o.jsx("div",{className:"relative w-full overflow-auto",children:o.jsx("table",{ref:n,className:Ce("w-full caption-bottom text-sm",e),...t})}));QE.displayName="Table";const LE=g.forwardRef(({className:e,...t},n)=>o.jsx("thead",{ref:n,className:Ce("[&_tr]:border-b",e),...t}));LE.displayName="TableHeader";const UE=g.forwardRef(({className:e,...t},n)=>o.jsx("tbody",{ref:n,className:Ce("[&_tr:last-child]:border-0",e),...t}));UE.displayName="TableBody";const sF=g.forwardRef(({className:e,...t},n)=>o.jsx("tfoot",{ref:n,className:Ce("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));sF.displayName="TableFooter";const Gc=g.forwardRef(({className:e,...t},n)=>o.jsx("tr",{ref:n,className:Ce("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));Gc.displayName="TableRow";const Ss=g.forwardRef(({className:e,...t},n)=>o.jsx("th",{ref:n,className:Ce("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));Ss.displayName="TableHead";const $r=g.forwardRef(({className:e,...t},n)=>o.jsx("td",{ref:n,className:Ce("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));$r.displayName="TableCell";const oF=g.forwardRef(({className:e,...t},n)=>o.jsx("caption",{ref:n,className:Ce("mt-4 text-sm text-muted-foreground",e),...t}));oF.displayName="TableCaption";var zE="AlertDialog",[aF,OL]=cn(zE,[bb]),ts=bb(),YE=e=>{const{__scopeAlertDialog:t,...n}=e,s=ts(t);return o.jsx(Mb,{...s,...n,modal:!0})};YE.displayName=zE;var iF="AlertDialogTrigger",lF=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...s}=e,i=ts(n);return o.jsx(Qb,{...i,...s,ref:t})});lF.displayName=iF;var cF="AlertDialogPortal",GE=e=>{const{__scopeAlertDialog:t,...n}=e,s=ts(t);return o.jsx(Lb,{...s,...n})};GE.displayName=cF;var dF="AlertDialogOverlay",HE=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...s}=e,i=ts(n);return o.jsx(rp,{...i,...s,ref:t})});HE.displayName=dF;var ma="AlertDialogContent",[uF,fF]=aF(ma),hF=Qy("AlertDialogContent"),VE=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:s,...i}=e,l=ts(n),c=g.useRef(null),u=Ue(t,c),f=g.useRef(null);return o.jsx(oD,{contentName:ma,titleName:$E,docsSlug:"alert-dialog",children:o.jsx(uF,{scope:n,cancelRef:f,children:o.jsxs(sp,{role:"alertdialog",...l,...i,ref:u,onOpenAutoFocus:ve(i.onOpenAutoFocus,m=>{m.preventDefault(),f.current?.focus({preventScroll:!0})}),onPointerDownOutside:m=>m.preventDefault(),onInteractOutside:m=>m.preventDefault(),children:[o.jsx(hF,{children:s}),o.jsx(pF,{contentRef:c})]})})})});VE.displayName=ma;var $E="AlertDialogTitle",WE=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...s}=e,i=ts(n);return o.jsx(op,{...i,...s,ref:t})});WE.displayName=$E;var KE="AlertDialogDescription",JE=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...s}=e,i=ts(n);return o.jsx(ap,{...i,...s,ref:t})});JE.displayName=KE;var mF="AlertDialogAction",qE=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...s}=e,i=ts(n);return o.jsx(ip,{...i,...s,ref:t})});qE.displayName=mF;var XE="AlertDialogCancel",ZE=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...s}=e,{cancelRef:i}=fF(XE,n),l=ts(n),c=Ue(t,i);return o.jsx(ip,{...l,...s,ref:c})});ZE.displayName=XE;var pF=({contentRef:e})=>{const t=`\`${ma}\` requires a description for the component to be accessible for screen reader users.
+
+You can add a description to the \`${ma}\` by passing a \`${KE}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
+
+Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${ma}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
+
+For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return g.useEffect(()=>{document.getElementById(e.current?.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},gF=YE,AF=GE,e1=HE,t1=VE,n1=qE,r1=ZE,s1=WE,o1=JE;const jp=gF,vF=AF,a1=g.forwardRef(({className:e,...t},n)=>o.jsx(e1,{className:Ce("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:n}));a1.displayName=e1.displayName;const Wd=g.forwardRef(({className:e,...t},n)=>o.jsxs(vF,{children:[o.jsx(a1,{}),o.jsx(t1,{ref:n,className:Ce("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...t})]}));Wd.displayName=t1.displayName;const Kd=({className:e,...t})=>o.jsx("div",{className:Ce("flex flex-col space-y-2 text-center sm:text-left",e),...t});Kd.displayName="AlertDialogHeader";const Jd=({className:e,...t})=>o.jsx("div",{className:Ce("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Jd.displayName="AlertDialogFooter";const qd=g.forwardRef(({className:e,...t},n)=>o.jsx(s1,{ref:n,className:Ce("text-lg font-semibold",e),...t}));qd.displayName=s1.displayName;const Xd=g.forwardRef(({className:e,...t},n)=>o.jsx(o1,{ref:n,className:Ce("text-sm text-muted-foreground",e),...t}));Xd.displayName=o1.displayName;const Zd=g.forwardRef(({className:e,...t},n)=>o.jsx(n1,{ref:n,className:Ce(Wm(),e),...t}));Zd.displayName=n1.displayName;const eu=g.forwardRef(({className:e,...t},n)=>o.jsx(r1,{ref:n,className:Ce(Wm({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));eu.displayName=r1.displayName;function xF(e,t){const n=bo(),{toast:s}=wo(),i=xw({mutationFn:async l=>await Ge.cancelJob(e,l),onMutate:async l=>{await n.cancelQueries({queryKey:kn.job(e)});const c=n.getQueryData(kn.job(e));return n.setQueryData(kn.job(e),u=>u&&{...u,status:"cancelling",updated_at:new Date().toISOString()}),{previousJob:c}},onSuccess:l=>{n.setQueryData(kn.job(e),c=>c&&{...c,status:l.status,cancelled_at:l.cancelled_at||new Date().toISOString(),updated_at:new Date().toISOString()}),n.invalidateQueries({queryKey:kn.jobs}),s({title:"Job cancelled",description:l.message||`Job ${e} has been cancelled successfully.`})},onError:(l,c,u)=>{u?.previousJob&&n.setQueryData(kn.job(e),u.previousJob);const f=Zt(l);wp(s,f)},onSettled:()=>{n.invalidateQueries({queryKey:kn.job(e)})}});return{cancelJob:i.mutate,cancelJobAsync:i.mutateAsync,isLoading:i.isPending,isSuccess:i.isSuccess,isError:i.isError,error:i.error}}function Np(e){return e==="pending"||e==="queued"||e==="running"}function i1({jobId:e,jobStatus:t,variant:n="destructive",size:s="default",className:i}){const[l,c]=g.useState(!1),{cancelJob:u,isLoading:f}=xF(e);if(!Np(t))return null;const m=()=>{u(void 0,{onSuccess:()=>{c(!1)}})};return o.jsxs(o.Fragment,{children:[o.jsx(X,{variant:n,size:s,className:i,onClick:()=>c(!0),disabled:f||t==="cancelling",children:f||t==="cancelling"?o.jsxs(o.Fragment,{children:[o.jsx(yn,{className:"mr-2 h-4 w-4 animate-spin"}),"Cancelling..."]}):o.jsxs(o.Fragment,{children:[o.jsx(da,{className:"mr-2 h-4 w-4"}),"Cancel Job"]})}),o.jsx(jp,{open:l,onOpenChange:c,children:o.jsxs(Wd,{children:[o.jsxs(Kd,{children:[o.jsx(qd,{children:"Cancel Job?"}),o.jsx(Xd,{children:"Are you sure you want to cancel this job? This action cannot be undone. The job will stop processing and any partial results may be discarded."})]}),o.jsxs(Jd,{children:[o.jsx(eu,{disabled:f,children:"No, keep running"}),o.jsx(Zd,{onClick:m,disabled:f,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:f?o.jsxs(o.Fragment,{children:[o.jsx(yn,{className:"mr-2 h-4 w-4 animate-spin"}),"Cancelling..."]}):"Yes, cancel job"})]})]})})]})}function yF(e,t){const n=bo(),{toast:s}=wo(),i=xw({mutationFn:async()=>await Ge.deleteJob(e),onMutate:async()=>{await n.cancelQueries({queryKey:kn.job(e)});const l=n.getQueryData(kn.job(e));return n.removeQueries({queryKey:kn.job(e)}),{previousJob:l}},onSuccess:()=>{n.invalidateQueries({queryKey:kn.jobs}),s({title:"Job deleted",description:`Job ${e.slice(0,8)}... has been permanently deleted.`})},onError:(l,c,u)=>{u?.previousJob&&n.setQueryData(kn.job(e),u.previousJob);const f=Zt(l);wp(s,f)},onSettled:()=>{n.invalidateQueries({queryKey:kn.jobs})}});return{deleteJob:i.mutate,deleteJobAsync:i.mutateAsync,isLoading:i.isPending,isSuccess:i.isSuccess,isError:i.isError,error:i.error}}function kp(e){return e==="completed"||e==="failed"||e==="cancelled"}function l1({jobId:e,jobStatus:t,variant:n="outline",size:s="default",className:i,onDeleted:l}){const[c,u]=g.useState(!1),{deleteJob:f,isLoading:m}=yF(e);if(!kp(t))return null;const p=()=>{f(void 0,{onSuccess:()=>{u(!1),l?.()}})};return o.jsxs(o.Fragment,{children:[o.jsx(X,{variant:n,size:s,className:i,onClick:()=>u(!0),disabled:m,children:m?o.jsxs(o.Fragment,{children:[o.jsx(yn,{className:"mr-2 h-4 w-4 animate-spin"}),"Deleting..."]}):o.jsxs(o.Fragment,{children:[o.jsx(w0,{className:"mr-2 h-4 w-4"}),"Delete"]})}),o.jsx(jp,{open:c,onOpenChange:u,children:o.jsxs(Wd,{children:[o.jsxs(Kd,{children:[o.jsx(qd,{children:"Delete Job?"}),o.jsx(Xd,{children:"Are you sure you want to delete this job? This action cannot be undone. All job data and results will be permanently removed from the server."})]}),o.jsxs(Jd,{children:[o.jsx(eu,{disabled:m,children:"Cancel"}),o.jsx(Zd,{onClick:p,disabled:m,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:m?o.jsxs(o.Fragment,{children:[o.jsx(yn,{className:"mr-2 h-4 w-4 animate-spin"}),"Deleting..."]}):"Yes, delete permanently"})]})]})})]})}function Zx(e){const t=Zt(e),n=t.message,s=localStorage.getItem("videoannotator_api_token")||"";return n.includes("API key required")||n.includes("AUTH_REQUIRED")||n.includes("401")||n.includes("404")||n.includes("Not Found")||n.includes("Unauthorized")||n.includes("authentication")?s==="dev-token"||s==="test-token"?{message:"Authentication Required",hint:`You have a placeholder token ("dev-token") that doesn't work. Go to Settings and clear the API Token field to connect anonymously.`,fieldErrors:[],code:t.code,requestId:t.requestId}:{message:"Authentication Required",hint:"The server requires authentication. Go to Settings to configure your API token.",fieldErrors:[],code:t.code,requestId:t.requestId}:t}const c1=({embedded:e=!1})=>{const t=So(),[n,s]=g.useState(1),i=10,{toast:l}=wo(),{data:c,isLoading:u,error:f,refetch:m,dataUpdatedAt:p}=Zr({queryKey:["jobs",n],queryFn:async()=>{console.log("🔍 Fetching jobs...",{page:n,perPage:i});const I=await Ge.getJobs(n,i);if(console.log("📦 Jobs API response:",I),!I)throw console.error("❌ Jobs API returned null/undefined"),new Error("Jobs API returned empty response");if(!Array.isArray(I.jobs))throw console.error("❌ Jobs API response missing jobs array:",I),new Error("Invalid jobs API response format");return console.log(`✅ Found ${I.jobs.length} jobs (total: ${I.total})`),I},refetchInterval:I=>{const _=I.state.data;return!_?.jobs||_.jobs.some(M=>M.status==="pending"||M.status==="running"||M.status==="cancelling")?5e3:3e4},refetchOnMount:!1,refetchOnWindowFocus:!1});g.useEffect(()=>{if(f){const I=Zx(f),_=`${I.message}
+
+${I.hint}`;l({title:I.message,description:I.hint,variant:"destructive",duration:1e4,action:o.jsx("button",{onClick:()=>{navigator.clipboard.writeText(_),l({title:"Copied!",description:"Error message copied to clipboard",duration:2e3})},className:"inline-flex h-8 shrink-0 items-center justify-center rounded-md border border-muted/40 bg-transparent px-3 text-sm font-medium hover:bg-destructive/10 focus:outline-none focus:ring-2 focus:ring-ring",children:"Copy"})})}},[f,l]);const v=I=>{t("/jobs/new",{state:{retryJobId:I.id,retryJobConfig:I.config,retryJobPipelines:I.selected_pipelines,retryJobVideoFilename:I.video_filename}})},x=(I,_)=>{const T={pending:{className:"bg-yellow-100 text-yellow-800 hover:bg-yellow-100 border-yellow-200"},running:{className:"bg-blue-100 text-blue-800 hover:bg-blue-100 border-blue-200"},completed:{className:"bg-green-100 text-green-800 hover:bg-green-100 border-green-200"},failed:{className:"bg-red-100 text-red-800 hover:bg-red-100 border-red-200"},cancelled:{className:"bg-gray-100 text-gray-800 hover:bg-gray-100 border-gray-200"},cancelling:{className:"bg-orange-100 text-orange-800 hover:bg-orange-100 border-orange-200"}},M=I==="completed"&&_;let D=T[I]||T.pending;M&&(D={className:"bg-orange-100 text-orange-800 hover:bg-orange-100 border-orange-200"});const F=o.jsxs(Je,{variant:"outline",className:D.className,children:[I.toUpperCase(),M&&o.jsx(Lt,{className:"ml-1 h-3 w-3 inline"}),I==="failed"&&_&&o.jsx(Lt,{className:"ml-1 h-3 w-3 inline"})]});return(I==="failed"||M)&&_?o.jsx(Fh,{children:o.jsxs(Wv,{children:[o.jsx(Kv,{asChild:!0,children:F}),o.jsxs(Mh,{className:"max-w-xs",children:[o.jsx("p",{className:"font-semibold",children:M?"Partial Success:":"Error:"}),o.jsx("p",{children:_})]})]})}):F},y=I=>{if(!I)return"N/A";const _=Math.floor(I/60),T=Math.floor(I%60);return`${_}:${T.toString().padStart(2,"0")}`},E=I=>I?`${(I/(1024*1024)).toFixed(1)} MB`:"N/A";if(f){const I=Zx(f),_=I.message==="Authentication Required";return o.jsxs("div",{className:"py-8 space-y-4",children:[o.jsx(jo,{error:I}),o.jsxs("div",{className:"flex gap-2 justify-center",children:[_&&o.jsx(ot,{to:"/settings",children:o.jsx(X,{variant:"default",children:"Configure API Token"})}),o.jsxs(X,{onClick:()=>m(),variant:"outline",children:[o.jsx(Yn,{className:"h-4 w-4 mr-2"}),"Retry"]})]})]})}if(c&&!Array.isArray(c.jobs))return o.jsx("div",{className:"py-8",children:o.jsxs(Qe,{className:"p-6 border-yellow-500",children:[o.jsx("h3",{className:"text-lg font-semibold text-yellow-700 mb-2",children:"⚠️ Unexpected API Response"}),o.jsx("p",{className:"text-sm text-gray-600 mb-4",children:"The jobs API returned data in an unexpected format. This might indicate a server issue."}),o.jsxs("details",{className:"text-xs bg-gray-50 p-3 rounded",children:[o.jsx("summary",{className:"cursor-pointer font-semibold",children:"View raw response"}),o.jsx("pre",{className:"mt-2 overflow-auto",children:JSON.stringify(c,null,2)})]}),o.jsx("div",{className:"mt-4",children:o.jsxs(X,{onClick:()=>m(),variant:"outline",children:[o.jsx(Yn,{className:"h-4 w-4 mr-2"}),"Retry"]})})]})});const C=p?new Date(p):null,S=C?`Last checked ${ME(C,{addSuffix:!0})}`:"Never checked",j=c?.jobs?.some(I=>I.status==="pending"||I.status==="running"||I.status==="cancelling")?"⚡ Auto-refreshing every 5s":"💤 Auto-refreshing every 30s";return o.jsxs("div",{className:e?"space-y-4":"container mx-auto px-6 py-8 max-w-6xl space-y-6",children:[!e&&o.jsxs("div",{className:"flex justify-between items-center",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("img",{src:dl,alt:"VideoAnnotator",className:"h-8 w-8"}),o.jsxs("div",{children:[o.jsx("h2",{className:"text-2xl font-bold",children:"Annotation Jobs"}),o.jsx("p",{className:"text-gray-600",children:"Monitor and manage your annotation jobs"})]})]}),o.jsxs("div",{className:"flex flex-col items-end gap-2",children:[o.jsxs("div",{className:"flex gap-2",children:[o.jsxs(X,{onClick:()=>m(),variant:"outline",size:"sm",children:[o.jsx(Yn,{className:`h-4 w-4 mr-2 ${u?"animate-spin":""}`}),"Refresh"]}),o.jsx(ot,{to:"/jobs/new",children:o.jsxs(X,{children:[o.jsx(ol,{className:"h-4 w-4 mr-2"}),"New Job"]})})]}),o.jsxs("div",{className:"text-xs text-muted-foreground",children:[S," • ",j]})]})]}),u&&!c?o.jsx("div",{className:"flex justify-center py-8",children:o.jsx(yn,{className:"h-8 w-8 animate-spin"})}):o.jsxs(Qe,{children:[o.jsx("div",{className:"px-6 pt-4 pb-2",children:o.jsx("p",{className:"text-xs text-muted-foreground",children:"💡 Tip: Double-click any row to view job details"})}),o.jsxs(QE,{children:[o.jsx(LE,{children:o.jsxs(Gc,{children:[o.jsx(Ss,{children:"Job ID"}),o.jsx(Ss,{children:"Status"}),o.jsx(Ss,{children:"Video"}),o.jsx(Ss,{children:"Duration"}),o.jsx(Ss,{children:"Size"}),o.jsx(Ss,{children:"Pipelines"}),o.jsx(Ss,{children:"Actions"})]})}),o.jsx(UE,{children:c?.jobs?.length===0?o.jsx(Gc,{children:o.jsxs($r,{colSpan:7,className:"text-center py-8",children:[o.jsx("p",{className:"text-gray-500 mb-4",children:c?.total>0?`No jobs on this page (${c.total} total jobs found)`:"No jobs found"}),o.jsx("div",{className:"flex gap-2 justify-center",children:c?.total>0&&n>1?o.jsx(X,{onClick:()=>s(1),variant:"outline",children:"Go to First Page"}):o.jsx(ot,{to:"/jobs/new",children:o.jsx(X,{children:"Create your first job"})})})]})}):c?.jobs?.map(I=>{const _=I,T=W=>typeof W=="string"?W:void 0,M=W=>typeof W=="number"&&Number.isFinite(W)?W:null;let D=T(_.video_filename)??T(_.filename)??T(_.video_name);const F=T(_.video_path);!D&&F&&(D=F.split("/").pop()||F),D=D||"N/A";const L=M(_.video_duration_seconds)??M(_.duration_seconds),J=M(_.video_size_bytes)??M(_.file_size_bytes);return o.jsxs(Gc,{onDoubleClick:()=>t(`/jobs/${I.id}`),className:"cursor-pointer hover:bg-muted/50",children:[o.jsxs($r,{className:"font-mono text-sm",children:[I.id.slice(0,8),"..."]}),o.jsx($r,{children:x(I.status,I.error_message)}),o.jsx($r,{className:"max-w-[200px] truncate",children:D}),o.jsx($r,{children:y(L)}),o.jsx($r,{children:E(J)}),o.jsx($r,{children:o.jsxs("div",{className:"flex flex-wrap gap-1",children:[I.selected_pipelines?.slice(0,2).map(W=>o.jsx(Je,{variant:"outline",className:"text-xs",children:W},W)),I.selected_pipelines&&I.selected_pipelines.length>2&&o.jsxs(Je,{variant:"outline",className:"text-xs",children:["+",I.selected_pipelines.length-2]})]})}),o.jsx($r,{children:o.jsxs("div",{className:"flex items-center gap-2",children:[Np(I.status)&&o.jsx(i1,{jobId:I.id,jobStatus:I.status,size:"sm",variant:"outline"}),I.status==="failed"&&o.jsxs(X,{variant:"outline",size:"sm",onClick:W=>{W.stopPropagation(),v(I)},children:[o.jsx(Sm,{className:"h-4 w-4 mr-1"}),"Retry"]}),kp(I.status)&&o.jsx(l1,{jobId:I.id,jobStatus:I.status,size:"sm",variant:"outline",onDeleted:()=>m()}),I.status==="completed"&&o.jsx(Fh,{children:o.jsxs(Wv,{children:[o.jsx(Kv,{asChild:!0,children:o.jsxs(X,{variant:"outline",size:"sm",onClick:W=>{W.stopPropagation(),t(`/view/${I.id}`)},children:[o.jsx(Bs,{className:"h-4 w-4 mr-1"}),"View"]})}),o.jsx(Mh,{children:o.jsx("p",{children:"View Results"})})]})})]})})]},I.id)})})]})]}),c&&c.total>i&&o.jsxs("div",{className:"flex justify-center gap-2",children:[o.jsx(X,{variant:"outline",onClick:()=>s(I=>Math.max(1,I-1)),disabled:n===1,children:"Previous"}),o.jsxs("span",{className:"px-4 py-2 text-sm",children:["Page ",n," of ",Math.ceil(c.total/i)]}),o.jsx(X,{variant:"outline",onClick:()=>s(I=>I+1),disabled:n>=Math.ceil(c.total/i),children:"Next"})]})]})};function wF({status:e}){const t=e==="completed"?"bg-green-100 text-green-800 border-green-200":e==="failed"?"bg-red-100 text-red-800 border-red-200":e==="running"?"bg-blue-100 text-blue-800 border-blue-200":e==="pending"?"bg-yellow-100 text-yellow-800 border-yellow-200":"bg-gray-100 text-gray-800 border-gray-200";return o.jsx(Je,{variant:"outline",className:t,children:e.toUpperCase()})}function bF(){const{data:e,isLoading:t,error:n,refetch:s,dataUpdatedAt:i}=Zr({queryKey:["dashboardJobs","recent"],queryFn:()=>Ge.getJobs(1,5),refetchInterval:3e4,refetchOnWindowFocus:!1}),l=g.useMemo(()=>i?`Last checked: ${new Date(i).toLocaleTimeString()}`:"Not checked yet",[i]);return n?o.jsx(jo,{error:Zt(n)}):o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"flex items-center justify-between gap-3 flex-wrap",children:[o.jsx("div",{className:"text-xs text-muted-foreground",children:l}),o.jsx(X,{variant:"outline",size:"sm",onClick:()=>void s(),disabled:t,children:"Refresh"})]}),t&&!e?o.jsx("div",{className:"text-sm text-muted-foreground",children:"Loading jobs…"}):e?.jobs?.length?o.jsx("div",{className:"space-y-2",children:e.jobs.map(c=>{const u=c,f=E=>u[E],m=f("video_filename"),p=f("filename"),v=f("video_name"),x=f("video_path"),y=typeof m=="string"&&m||typeof p=="string"&&p||typeof v=="string"&&v||typeof x=="string"&&(x.split("/").pop()||x)||"N/A";return o.jsxs("div",{className:"flex items-center justify-between gap-4 border rounded-md p-3",children:[o.jsxs("div",{className:"min-w-0",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsxs("div",{className:"font-mono text-sm",children:[c.id.slice(0,8),"…"]}),o.jsx(wF,{status:c.status})]}),o.jsx("div",{className:"text-sm text-muted-foreground truncate",children:y})]}),o.jsxs("div",{className:"flex gap-2 shrink-0",children:[o.jsx(ot,{to:`/view/${c.id}`,children:o.jsx(X,{variant:"outline",size:"sm",children:"View"})}),o.jsx(ot,{to:`/jobs/${c.id}`,children:o.jsx(X,{size:"sm",children:"Job"})})]})]},c.id)})}):o.jsx("div",{className:"text-sm text-muted-foreground",children:"No jobs found."})]})}const ey="vav.dashboard.jobsMode",CF=[{icon:o.jsx(Bs,{className:"w-6 h-6"}),title:"Multimodal Overlays",description:"View pose detection, facial emotions, audio sentiment, and events overlaid on video"},{icon:o.jsx(ol,{className:"w-6 h-6"}),title:"Synchronized Timeline",description:"Navigate through rich timeline with waveforms, motion graphs, and event markers"},{icon:o.jsx(Em,{className:"w-6 h-6"}),title:"JSON Annotations",description:"Load analysis results from any computer vision or audio processing pipeline"}];function EF(){const{capabilities:e}=$m(),[t,n]=g.useState(null),[s,i]=g.useState(0),[l,c]=g.useState(()=>localStorage.getItem(ey)==="full"?"full":"compact"),u=`${ll}/blob/master/CHANGELOG.md`;g.useEffect(()=>{(async()=>{const v=await md();n(v?.name??null);const x=await La();i(Object.keys(x).length)})()},[]);const f=p=>{c(p),localStorage.setItem(ey,p)},m=!!e;return o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"relative overflow-hidden",children:[o.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-primary/10 via-transparent to-accent/10"}),o.jsxs("div",{className:"container mx-auto px-6 py-12 relative",children:[o.jsxs("div",{className:"text-center max-w-4xl mx-auto mb-10",children:[o.jsx("div",{className:"flex items-center justify-center gap-3 mb-4",children:o.jsx("h1",{className:"text-4xl md:text-5xl font-bold bg-gradient-to-r from-primary to-accent bg-clip-text text-transparent",children:ja})}),o.jsxs("div",{className:"flex items-center justify-center gap-3 mb-6",children:[o.jsxs("span",{className:"font-mono px-2 py-0.5 rounded bg-primary/10 text-primary text-sm",children:["v",Wi]}),o.jsx("a",{href:u,target:"_blank",rel:"noopener noreferrer",className:"text-sm text-muted-foreground underline underline-offset-2 hover:text-foreground",children:"Release notes"})]}),o.jsx("p",{className:"text-lg text-muted-foreground mb-8 leading-relaxed max-w-2xl mx-auto",children:"Review video annotations with pose detection, emotion recognition, audio analysis, and interactive timeline visualization."}),o.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 justify-center",children:[o.jsx(ot,{to:"/library",children:o.jsxs(X,{size:"lg",className:"text-lg px-6 gap-2",children:[o.jsx(Wc,{className:"w-5 h-5"}),"Open Library"]})}),o.jsx(ot,{to:"/viewer",children:o.jsxs(X,{size:"lg",variant:"outline",className:"text-lg px-6 gap-2",children:[o.jsx(Fi,{className:"w-5 h-5"}),"View Files"]})}),m&&o.jsx(ot,{to:"/jobs/new",children:o.jsxs(X,{size:"lg",variant:"outline",className:"text-lg px-6 gap-2",children:[o.jsx(h0,{className:"w-5 h-5"}),"New Job"]})})]})]}),o.jsx("div",{className:"max-w-5xl mx-auto",children:o.jsx(Qe,{className:"overflow-hidden border-0 shadow-2xl",children:o.jsx("img",{src:FE,alt:"Video Annotation Viewer Interface",className:"w-full h-auto"})})})]})]}),o.jsxs("div",{className:"container mx-auto px-6 py-8",children:[o.jsxs("div",{className:"grid gap-4 md:grid-cols-3 mb-8",children:[o.jsx(ot,{to:"/settings",className:"block",children:o.jsx(Qe,{className:"p-4 hover:shadow-md transition-shadow h-full",children:o.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[o.jsx("div",{className:`w-10 h-10 rounded-lg flex items-center justify-center ${m?"bg-green-100 text-green-600":"bg-gray-100 text-gray-400"}`,children:o.jsx(io,{className:"w-5 h-5"})}),o.jsxs("div",{children:[o.jsx("div",{className:"font-semibold text-sm",children:"Server"}),o.jsx("div",{className:`text-xs ${m?"text-green-600":"text-muted-foreground"}`,children:m?"Connected":"Not connected"})]})]})})}),o.jsx(ot,{to:"/library",className:"block",children:o.jsx(Qe,{className:"p-4 hover:shadow-md transition-shadow h-full",children:o.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[o.jsx("div",{className:`w-10 h-10 rounded-lg flex items-center justify-center ${t?"bg-blue-100 text-blue-600":"bg-gray-100 text-gray-400"}`,children:o.jsx(Wc,{className:"w-5 h-5"})}),o.jsxs("div",{children:[o.jsx("div",{className:"font-semibold text-sm",children:"Library"}),o.jsx("div",{className:"text-xs text-muted-foreground",children:t?`${s} dataset${s!==1?"s":""} in ${t}`:"No folder selected"})]})]})})}),o.jsx(ot,{to:"/getting-started",className:"block",children:o.jsx(Qe,{className:"p-4 hover:shadow-md transition-shadow h-full border-primary/20 bg-primary/5",children:o.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[o.jsx("div",{className:"w-10 h-10 rounded-lg flex items-center justify-center bg-primary/10 text-primary",children:o.jsx(y0,{className:"w-5 h-5"})}),o.jsxs("div",{children:[o.jsx("div",{className:"font-semibold text-sm",children:"Getting Started"}),o.jsx("div",{className:"text-xs text-muted-foreground",children:"New here? Learn how to use VAV"})]})]})})})]}),o.jsxs("div",{className:"mb-8",children:[o.jsx("h2",{className:"text-2xl font-bold text-center mb-6",children:"Powerful Analysis Features"}),o.jsx("div",{className:"grid md:grid-cols-3 gap-6 max-w-4xl mx-auto",children:CF.map((p,v)=>o.jsxs(Qe,{className:"p-5 text-center hover:shadow-md transition-shadow",children:[o.jsx("div",{className:"w-12 h-12 mx-auto mb-3 bg-primary/10 rounded-lg flex items-center justify-center text-primary",children:p.icon}),o.jsx("h3",{className:"font-semibold mb-2",children:p.title}),o.jsx("p",{className:"text-sm text-muted-foreground",children:p.description})]},v))})]}),o.jsxs(Qe,{className:"p-4 space-y-4",children:[o.jsxs("div",{className:"flex items-start justify-between gap-4 flex-wrap",children:[o.jsxs("div",{children:[o.jsx("div",{className:"font-semibold",children:"Recent Jobs"}),o.jsx("div",{className:"text-sm text-muted-foreground",children:"Latest annotation jobs from your server."})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(ot,{to:"/jobs/new",children:o.jsx(X,{size:"sm",children:"New Job"})}),o.jsx(ot,{to:"/jobs",children:o.jsx(X,{variant:"outline",size:"sm",children:"All Jobs"})})]})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(X,{variant:l==="compact"?"default":"outline",size:"sm",onClick:()=>f("compact"),children:"Compact"}),o.jsx(X,{variant:l==="full"?"default":"outline",size:"sm",onClick:()=>f("full"),children:"Full table"})]}),l==="compact"?o.jsx(bF,{}):o.jsx(c1,{embedded:!0})]})]})]})}const SF=[{icon:o.jsx(Mi,{className:"w-5 h-5"}),title:"Pose Detection",description:"COCO-format skeletal pose overlays with 17-point body landmarks"},{icon:o.jsx(Qk,{className:"w-5 h-5"}),title:"Facial Emotions",description:"OpenFace3 facial action units, gaze direction, and emotion recognition"},{icon:o.jsx(kk,{className:"w-5 h-5"}),title:"Speech Transcription",description:"Whisper-based transcription with word-level timestamps (WebVTT)"},{icon:o.jsx(Nk,{className:"w-5 h-5"}),title:"Speaker Diarization",description:"RTTM speaker labels identifying who is speaking when"},{icon:o.jsx(bk,{className:"w-5 h-5"}),title:"Scene Detection",description:"Automatic scene boundary detection and visual change analysis"}];function jF(){const{toast:e}=wo(),[t,n]=g.useState(!1),[s,i]=g.useState(null),l=async()=>{n(!0),i(null);try{const c=await OE(u=>i(u));if(c.installed===0&&c.failed.length===0)e({title:"Demo datasets already installed",description:`All ${c.skipped} demos are up to date.`,duration:4e3});else if(c.failed.length>0){const u=c.failed.map(m=>`${$d[m.key]??m.key}: ${m.error}`).join(`
+`),f=`Demo install errors
+
+Installed ${c.installed}, failed ${c.failed.length}.
+${u}`;e({title:"Some demos failed to install",description:`Installed ${c.installed}, failed ${c.failed.length}.`,variant:"destructive",duration:12e3,action:Ji(f)})}else e({title:"Demo datasets installed",description:`Installed ${c.installed} demo dataset${c.installed===1?"":"s"}.`,duration:5e3})}catch(c){const u=c instanceof Error?c.message:String(c);e({title:"Demo install failed",description:u,variant:"destructive",duration:1e4,action:Ji(`Demo install failed
+
+${u}`)})}finally{n(!1),i(null)}};return o.jsxs("div",{className:"container mx-auto px-6 py-10 max-w-5xl",children:[o.jsxs("div",{className:"text-center mb-12",children:[o.jsx("h1",{className:"text-4xl font-bold mb-4",children:"Getting Started"}),o.jsx("p",{className:"text-lg text-muted-foreground max-w-2xl mx-auto",children:"Video Annotation Viewer (VAV) helps researchers visualize multimodal video annotations with interactive overlays and a synchronized timeline."})]}),o.jsx(Qe,{className:"overflow-hidden border-0 shadow-xl mb-12",children:o.jsx("img",{src:FE,alt:"Video Annotation Viewer showing pose detection, timeline, and controls",className:"w-full h-auto"})}),o.jsx("h2",{className:"text-2xl font-bold text-center mb-6",children:"Two Ways to Use VAV"}),o.jsxs("div",{className:"grid md:grid-cols-2 gap-6 mb-12",children:[o.jsxs(Qe,{className:"p-6",children:[o.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[o.jsx("div",{className:"w-10 h-10 rounded-lg bg-blue-100 text-blue-600 flex items-center justify-center",children:o.jsx(Fi,{className:"w-5 h-5"})}),o.jsx("h3",{className:"text-xl font-semibold",children:"View Local Files"})]}),o.jsx("p",{className:"text-muted-foreground mb-4",children:"Upload a video and its annotation JSON directly in your browser. No server needed."}),o.jsxs("ol",{className:"space-y-2 mb-6 text-sm",children:[o.jsxs("li",{className:"flex items-start gap-2",children:[o.jsx("span",{className:"font-semibold text-primary min-w-[1.5rem]",children:"1."}),"Open the Viewer page"]}),o.jsxs("li",{className:"flex items-start gap-2",children:[o.jsx("span",{className:"font-semibold text-primary min-w-[1.5rem]",children:"2."}),"Upload a video file and its JSON annotation data"]}),o.jsxs("li",{className:"flex items-start gap-2",children:[o.jsx("span",{className:"font-semibold text-primary min-w-[1.5rem]",children:"3."}),"Explore with interactive overlays and timeline"]})]}),o.jsx(ot,{to:"/viewer",children:o.jsxs(X,{className:"w-full gap-2",children:[o.jsx(Fi,{className:"w-4 h-4"}),"Open Viewer",o.jsx($c,{className:"w-4 h-4"})]})})]}),o.jsxs(Qe,{className:"p-6",children:[o.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[o.jsx("div",{className:"w-10 h-10 rounded-lg bg-green-100 text-green-600 flex items-center justify-center",children:o.jsx(io,{className:"w-5 h-5"})}),o.jsx("h3",{className:"text-xl font-semibold",children:"Use with VideoAnnotator"})]}),o.jsx("p",{className:"text-muted-foreground mb-4",children:"Connect to a VideoAnnotator server to create annotation jobs and view results."}),o.jsxs("ol",{className:"space-y-2 mb-6 text-sm",children:[o.jsxs("li",{className:"flex items-start gap-2",children:[o.jsx("span",{className:"font-semibold text-primary min-w-[1.5rem]",children:"1."}),"Configure your server connection in Settings"]}),o.jsxs("li",{className:"flex items-start gap-2",children:[o.jsx("span",{className:"font-semibold text-primary min-w-[1.5rem]",children:"2."}),"Create annotation jobs by uploading videos"]}),o.jsxs("li",{className:"flex items-start gap-2",children:[o.jsx("span",{className:"font-semibold text-primary min-w-[1.5rem]",children:"3."}),"View results in the Viewer or save to your Library"]})]}),o.jsx(ot,{to:"/settings",children:o.jsxs(X,{variant:"outline",className:"w-full gap-2",children:[o.jsx(uo,{className:"w-4 h-4"}),"Configure Server",o.jsx($c,{className:"w-4 h-4"})]})})]})]}),o.jsx(Qe,{className:"p-6 mb-12 border-primary/20 bg-primary/5",children:o.jsxs("div",{className:"text-center",children:[o.jsxs("div",{className:"flex items-center justify-center gap-3 mb-3",children:[o.jsx(ol,{className:"w-6 h-6 text-primary"}),o.jsx("h2",{className:"text-2xl font-bold",children:"Try the Demo"})]}),o.jsx("p",{className:"text-muted-foreground mb-6 max-w-xl mx-auto",children:"Install bundled sample datasets to explore the viewer without any server. Includes example videos with pose detection, speech, and emotion annotations."}),o.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 justify-center",children:[o.jsxs(X,{size:"lg",onClick:()=>void l(),disabled:t,className:"gap-2",children:[o.jsx(sl,{className:"w-5 h-5"}),t?s??"Installing demos…":"Install Demo Datasets"]}),o.jsx(ot,{to:"/library",children:o.jsxs(X,{size:"lg",variant:"outline",className:"gap-2",children:[o.jsx(Wc,{className:"w-5 h-5"}),"Open Library"]})})]})]})}),o.jsx("h2",{className:"text-2xl font-bold text-center mb-6",children:"Supported Annotation Types"}),o.jsx("div",{className:"grid sm:grid-cols-2 lg:grid-cols-3 gap-4 mb-12",children:SF.map((c,u)=>o.jsx(Qe,{className:"p-4",children:o.jsxs("div",{className:"flex items-start gap-3",children:[o.jsx("div",{className:"w-9 h-9 rounded-lg bg-primary/10 text-primary flex items-center justify-center flex-shrink-0 mt-0.5",children:c.icon}),o.jsxs("div",{children:[o.jsx("h3",{className:"font-semibold mb-1",children:c.title}),o.jsx("p",{className:"text-sm text-muted-foreground",children:c.description})]})]})},u))}),o.jsxs(Qe,{className:"p-6",children:[o.jsx("h2",{className:"text-xl font-bold mb-4",children:"Need Help?"}),o.jsxs("div",{className:"grid sm:grid-cols-3 gap-4",children:[o.jsxs("a",{href:"https://deepwiki.com/InfantLab/video-annotation-viewer",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground transition-colors",children:[o.jsx(Is,{className:"w-4 h-4"}),"Documentation"]}),o.jsxs("a",{href:`${ll}/issues`,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground transition-colors",children:[o.jsx(x0,{className:"w-4 h-4"}),"Report an Issue"]}),o.jsxs("a",{href:"https://github.com/InfantLab/VideoAnnotator#server-setup",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground transition-colors",children:[o.jsx(io,{className:"w-4 h-4"}),"Server Setup Guide"]})]})]})]})}const NF=()=>{const e=Eo();return g.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",e.pathname)},[e.pathname]),o.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gray-100",children:o.jsxs("div",{className:"text-center",children:[o.jsx("h1",{className:"text-4xl font-bold mb-4",children:"404"}),o.jsx("p",{className:"text-xl text-gray-600 mb-4",children:"Oops! Page not found"}),o.jsx("a",{href:"/",className:"text-blue-500 hover:text-blue-700 underline",children:"Return to Home"})]})})},kF=()=>{const{jobId:e}=kw(),t=So(),{data:n,isLoading:s,error:i}=Zr({queryKey:["job",e],queryFn:()=>{if(!e)throw new Error("Job ID is required");return Ge.getJob(e)},enabled:!!e,refetchInterval:j=>{if(!j)return!1;const I=j.status;return I==="running"||I==="pending"||I==="cancelling"?2e3:!1}}),l=(j,I)=>{const _={pending:"bg-yellow-100 text-yellow-800 border-yellow-200",running:"bg-blue-100 text-blue-800 border-blue-200",completed:"bg-green-100 text-green-800 border-green-200",failed:"bg-red-100 text-red-800 border-red-200",cancelled:"bg-gray-100 text-gray-800 border-gray-200",cancelling:"bg-orange-100 text-orange-800 border-orange-200"};return j==="completed"&&I?"bg-orange-100 text-orange-800 border-orange-200":_[j]||"bg-gray-100 text-gray-800 border-gray-200"},c=j=>({pending:0,running:50,completed:100,failed:0,cancelled:0,cancelling:25})[j]||0,u=()=>{if(n){if(n.status!=="completed"){alert(`Job ${n.id} is not yet completed (status: ${n.status}).
+
+Only completed jobs can be opened in the viewer.`);return}t(`/view/${n.id}`)}},f=async()=>{if(n)try{alert(`Download functionality coming soon for job ${n.id}`)}catch(j){console.error("Download failed:",j),alert("Download failed. Please try again.")}},m=()=>{if(!n)return;const j=n,I=T=>typeof T=="string"?T:void 0,_=I(j.video_filename)??I(j.filename)??I(j.video_name);t("/jobs/new",{state:{retryJobId:n.id,retryJobConfig:n.config,retryJobPipelines:n.selected_pipelines,retryJobVideoFilename:_}})},p=()=>{if(!n)return;const j=window.open("","_blank");j&&(j.document.write(`
+
+ Job ${n.id} - Raw Data
+
+ Job ${n.id} Raw Data
+ ${JSON.stringify(n,null,2)}
+
+
+ `),j.document.close())};if(s)return o.jsx("div",{className:"container mx-auto px-6 py-8 max-w-5xl",children:o.jsx("div",{className:"flex justify-center py-8",children:o.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-blue-600"})})});if(i||!n)return o.jsxs("div",{className:"container mx-auto px-6 py-8 max-w-5xl space-y-4",children:[o.jsx(ot,{to:"/jobs",children:o.jsxs(X,{variant:"outline",children:[o.jsx(Pi,{className:"h-4 w-4 mr-2"}),"Back to Jobs"]})}),o.jsx(jo,{error:Zt(i||"Job not found")})]});const v=n,x=j=>typeof j=="string"?j:void 0,y=j=>typeof j=="number"&&Number.isFinite(j)?j:null;let E=x(v.video_filename)??x(v.filename)??x(v.video_name);const w=x(v.video_path);!E&&w&&(E=w.split("/").pop()||w),E=E||"N/A";const C=y(v.video_size_bytes)??y(v.file_size_bytes),S=y(v.video_duration_seconds)??y(v.duration_seconds),N=x(v.video_path)??x(v.file_path)??x(v.input_file)??"N/A";return o.jsxs("div",{className:"container mx-auto px-6 py-8 max-w-5xl space-y-6",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsx(ot,{to:"/jobs",children:o.jsxs(X,{variant:"outline",size:"sm",children:[o.jsx(Pi,{className:"h-4 w-4 mr-2"}),"Back to Jobs"]})}),o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("img",{src:dl,alt:"VideoAnnotator",className:"h-8 w-8"}),o.jsxs("div",{children:[o.jsx("h2",{className:"text-2xl font-bold",children:"Job Details"}),o.jsx("p",{className:"text-muted-foreground font-mono text-sm",children:n.id})]})]})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[Np(n.status)&&o.jsx(i1,{jobId:n.id,jobStatus:n.status,size:"sm"}),n.status==="failed"&&o.jsxs(X,{onClick:m,variant:"outline",size:"sm",children:[o.jsx(Sm,{className:"h-4 w-4 mr-2"}),"Retry Job"]}),kp(n.status)&&o.jsx(l1,{jobId:n.id,jobStatus:n.status,size:"sm",onDeleted:()=>t("/jobs")}),n.status==="completed"&&o.jsxs(X,{onClick:u,children:[o.jsx(Bs,{className:"h-4 w-4 mr-2"}),"Open in Viewer"]})]})]}),n.status==="completed"&&n.error_message&&o.jsxs(et,{className:"bg-orange-50 border-orange-200 text-orange-800",children:[o.jsx(Lt,{className:"h-4 w-4 !text-orange-600"}),o.jsxs(tt,{className:"ml-2",children:[o.jsx("span",{className:"font-semibold",children:"Partial Success:"})," ",n.error_message]})]}),o.jsxs(Qe,{children:[o.jsx(Nt,{children:o.jsxs(kt,{className:"flex items-center justify-between",children:[o.jsx("span",{children:"Job Status"}),o.jsxs(Je,{variant:"outline",className:l(n.status,n.error_message),children:[n.status.toUpperCase(),n.status==="completed"&&n.error_message&&o.jsx(Lt,{className:"ml-1 h-3 w-3 inline"})]})]})}),o.jsx(yt,{children:o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{children:[o.jsxs("div",{className:"flex justify-between text-sm mb-2",children:[o.jsx("span",{children:"Progress"}),o.jsxs("span",{children:[c(n.status),"%"]})]}),o.jsx(fl,{value:c(n.status),className:"h-2"})]}),n.status==="running"&&o.jsx(et,{children:o.jsx(tt,{children:"Job is currently running. This page will update automatically."})}),n.status==="failed"&&o.jsx(et,{variant:"destructive",children:o.jsx(tt,{children:o.jsxs("div",{className:"space-y-2",children:[o.jsx("p",{className:"font-semibold",children:"Job failed during processing"}),n.error_message&&o.jsxs("p",{className:"text-sm",children:[o.jsx("span",{className:"font-medium",children:"Error:"})," ",n.error_message]})]})})})]})})]}),o.jsxs(Qe,{children:[o.jsx(Nt,{children:o.jsx(kt,{children:"Video Information"})}),o.jsx(yt,{children:o.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[o.jsxs("div",{children:[o.jsx("label",{className:"text-sm font-medium text-muted-foreground",children:"Filename"}),o.jsx("p",{className:"mt-1",children:E})]}),o.jsxs("div",{children:[o.jsx("label",{className:"text-sm font-medium text-muted-foreground",children:"File Size"}),o.jsx("p",{className:"mt-1",children:C?`${(C/(1024*1024)).toFixed(1)} MB`:"N/A"})]}),o.jsxs("div",{children:[o.jsx("label",{className:"text-sm font-medium text-muted-foreground",children:"Duration"}),o.jsx("p",{className:"mt-1",children:S?`${Math.floor(S/60)}:${(S%60).toFixed(0).padStart(2,"0")}`:"N/A"})]}),o.jsxs("div",{children:[o.jsx("label",{className:"text-sm font-medium text-muted-foreground",children:"Path"}),o.jsx("p",{className:"mt-1 font-mono text-sm break-all",children:N})]})]})})]}),o.jsxs(Qe,{children:[o.jsx(Nt,{children:o.jsx(kt,{children:"Pipeline Configuration"})}),o.jsx(yt,{children:o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{children:[o.jsx("label",{className:"text-sm font-medium text-muted-foreground",children:"Selected Pipelines"}),o.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:n.selected_pipelines?.map(j=>o.jsx(Je,{variant:"outline",children:j},j))||o.jsx("span",{className:"text-muted-foreground",children:"No pipelines selected"})})]}),n.config&&o.jsxs("div",{children:[o.jsx("label",{className:"text-sm font-medium text-muted-foreground",children:"Configuration"}),o.jsx("pre",{className:"mt-2 p-3 bg-muted rounded-md text-sm overflow-x-auto text-foreground",children:JSON.stringify(n.config,null,2)})]})]})})]}),n.status==="completed"&&o.jsxs(Qe,{children:[o.jsx(Nt,{children:o.jsx(kt,{children:"Results"})}),o.jsx(yt,{children:o.jsxs("div",{className:"space-y-4",children:[o.jsx("p",{className:"text-muted-foreground",children:"Job completed successfully! Results are ready for viewing."}),o.jsxs("div",{className:"flex gap-2",children:[o.jsxs(X,{onClick:u,children:[o.jsx(Bs,{className:"h-4 w-4 mr-2"}),"Open in Viewer"]}),o.jsxs(X,{variant:"outline",onClick:f,children:[o.jsx(sl,{className:"h-4 w-4 mr-2"}),"Download Results"]}),o.jsxs(X,{variant:"outline",onClick:p,children:[o.jsx(Is,{className:"h-4 w-4 mr-2"}),"View Raw Data"]})]})]})})]}),o.jsxs(Qe,{children:[o.jsx(Nt,{children:o.jsx(kt,{children:"Logs"})}),o.jsx(yt,{children:o.jsx("div",{className:"bg-black text-green-400 p-4 rounded-md font-mono text-sm h-64 overflow-y-auto",children:o.jsxs("div",{className:"space-y-1",children:[o.jsxs("div",{children:["[",new Date().toISOString(),"] Job ",n.id," created"]}),o.jsxs("div",{children:["[",new Date().toISOString(),"] Video uploaded: ",E]}),n.status!=="pending"&&o.jsxs("div",{children:["[",new Date().toISOString(),"] Processing started..."]}),n.status==="completed"&&o.jsxs("div",{children:["[",new Date().toISOString(),"] Job completed successfully"]}),n.status==="failed"&&o.jsxs("div",{children:["[",new Date().toISOString(),"] Job failed: Check error details"]})]})})})]})]})};function or({className:e,...t}){return o.jsx("div",{className:Ce("animate-pulse rounded-md bg-muted",e),...t})}const Ti=["videoannotator","pipelines","catalog"],fm=["videoannotator","server-info"],d1=300*1e3,IF=(e={})=>({queryKey:Ti,queryFn:()=>Ge.getPipelineCatalog({forceRefresh:e.forceRefresh}),staleTime:d1}),BF=()=>({queryKey:fm,queryFn:()=>Ge.getServerInfo(),staleTime:d1});function u1(e={}){return Zr({...IF(),enabled:e.enabled??!0})}function _F(e={}){return Zr({...BF(),enabled:e.enabled??!0})}function f1(){const e=bo();return g.useCallback(async(t={})=>{const{forceServerRefresh:n=!1}=t;if(n){Ge.clearPipelineCache(),Ge.clearServerInfoCache();const s=await Ge.getPipelineCatalog({forceRefresh:!0});return await e.setQueryData(Ti,s),await e.invalidateQueries({queryKey:fm}),s}return await e.invalidateQueries({queryKey:Ti}),await e.invalidateQueries({queryKey:fm}),e.getQueryData(Ti)},[e])}function RF(){const e=bo();return g.useCallback(async()=>{Ge.clearPipelineCache(),await e.removeQueries({queryKey:Ti})},[e])}var tu="Checkbox",[TF,PL]=cn(tu),[DF,Ip]=TF(tu);function OF(e){const{__scopeCheckbox:t,checked:n,children:s,defaultChecked:i,disabled:l,form:c,name:u,onCheckedChange:f,required:m,value:p="on",internal_do_not_use_render:v}=e,[x,y]=lr({prop:n,defaultProp:i??!1,onChange:f,caller:tu}),[E,w]=g.useState(null),[C,S]=g.useState(null),N=g.useRef(!1),j=E?!!c||!!E.closest("form"):!0,I={checked:x,disabled:l,setChecked:y,control:E,setControl:w,name:u,form:c,value:p,hasConsumerStoppedPropagationRef:N,required:m,defaultChecked:Ds(i)?!1:i,isFormControl:j,bubbleInput:C,setBubbleInput:S};return o.jsx(DF,{scope:t,...I,children:PF(v)?v(I):s})}var h1="CheckboxTrigger",m1=g.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...s},i)=>{const{control:l,value:c,disabled:u,checked:f,required:m,setControl:p,setChecked:v,hasConsumerStoppedPropagationRef:x,isFormControl:y,bubbleInput:E}=Ip(h1,e),w=Ue(i,p),C=g.useRef(f);return g.useEffect(()=>{const S=l?.form;if(S){const N=()=>v(C.current);return S.addEventListener("reset",N),()=>S.removeEventListener("reset",N)}},[l,v]),o.jsx(Ie.button,{type:"button",role:"checkbox","aria-checked":Ds(f)?"mixed":f,"aria-required":m,"data-state":x1(f),"data-disabled":u?"":void 0,disabled:u,value:c,...s,ref:w,onKeyDown:ve(t,S=>{S.key==="Enter"&&S.preventDefault()}),onClick:ve(n,S=>{v(N=>Ds(N)?!0:!N),E&&y&&(x.current=S.isPropagationStopped(),x.current||S.stopPropagation())})})});m1.displayName=h1;var Bp=g.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:s,checked:i,defaultChecked:l,required:c,disabled:u,value:f,onCheckedChange:m,form:p,...v}=e;return o.jsx(OF,{__scopeCheckbox:n,checked:i,defaultChecked:l,disabled:u,required:c,onCheckedChange:m,name:s,form:p,value:f,internal_do_not_use_render:({isFormControl:x})=>o.jsxs(o.Fragment,{children:[o.jsx(m1,{...v,ref:t,__scopeCheckbox:n}),x&&o.jsx(v1,{__scopeCheckbox:n})]})})});Bp.displayName=tu;var p1="CheckboxIndicator",g1=g.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:s,...i}=e,l=Ip(p1,n);return o.jsx(dn,{present:s||Ds(l.checked)||l.checked===!0,children:o.jsx(Ie.span,{"data-state":x1(l.checked),"data-disabled":l.disabled?"":void 0,...i,ref:t,style:{pointerEvents:"none",...e.style}})})});g1.displayName=p1;var A1="CheckboxBubbleInput",v1=g.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:s,hasConsumerStoppedPropagationRef:i,checked:l,defaultChecked:c,required:u,disabled:f,name:m,value:p,form:v,bubbleInput:x,setBubbleInput:y}=Ip(A1,e),E=Ue(n,y),w=mp(l),C=Dm(s);g.useEffect(()=>{const N=x;if(!N)return;const j=window.HTMLInputElement.prototype,_=Object.getOwnPropertyDescriptor(j,"checked").set,T=!i.current;if(w!==l&&_){const M=new Event("click",{bubbles:T});N.indeterminate=Ds(l),_.call(N,Ds(l)?!1:l),N.dispatchEvent(M)}},[x,w,l,i]);const S=g.useRef(Ds(l)?!1:l);return o.jsx(Ie.input,{type:"checkbox","aria-hidden":!0,defaultChecked:c??S.current,required:u,disabled:f,name:m,value:p,form:v,...t,tabIndex:-1,ref:E,style:{...t.style,...C,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});v1.displayName=A1;function PF(e){return typeof e=="function"}function Ds(e){return e==="indeterminate"}function x1(e){return Ds(e)?"indeterminate":e?"checked":"unchecked"}const y1=g.forwardRef(({className:e,...t},n)=>o.jsx(Bp,{ref:n,className:Ce("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:o.jsx(g1,{className:Ce("flex items-center justify-center text-current"),children:o.jsx(m0,{className:"h-4 w-4"})})}));y1.displayName=Bp.displayName;const w1=g.forwardRef(({className:e,...t},n)=>o.jsx("textarea",{className:Ce("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...t}));w1.displayName="Textarea";const ty=(e,t)=>{const n=e[t];return n&&typeof n=="object"&&!Array.isArray(n)?n:{}},FF=(e,t)=>{if(e==="")return;const n=Number(e);return Number.isNaN(n)?t:n},MF=(e,t)=>{if(typeof e=="boolean")return e;if(typeof e=="string"){if(e==="true")return!0;if(e==="false")return!1}return t??!1},QF=e=>e.default!==void 0?e.default:e.type==="boolean"?!1:e.type==="multiselect"?[]:"",LF=(e,t)=>{if(t==null)return QF(e);switch(e.type){case"boolean":return MF(t,!!e.default);case"integer":case"number":return typeof t=="number"?t:Number(t);case"multiselect":return Array.isArray(t)?t:[];default:return t}},UF=e=>{const t=[];return e.required&&t.push("required"),e.min!==void 0&&t.push(`min ${e.min}`),e.max!==void 0&&t.push(`max ${e.max}`),e.step!==void 0&&t.push(`step ${e.step}`),e.unit&&t.push(e.unit),t.join(" · ")},zF=({pipelines:e,selectedPipelineIds:t,config:n,onConfigChange:s})=>{const i=g.useMemo(()=>e.filter(c=>t.includes(c.id)),[e,t]),l=(c,u,f)=>{s(m=>{const p={...m},v={...ty(m,c)};return v[u.name]=f,p[c]=v,p})};return i.length===0?o.jsx("p",{className:"text-sm text-muted-foreground",children:"Select pipelines in the previous step to configure their parameters."}):o.jsx("div",{className:"space-y-6",children:i.map(c=>{const u=ty(n,c.id);return o.jsxs("div",{className:"rounded-lg border bg-card p-4 space-y-3",children:[o.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[o.jsxs("div",{children:[o.jsx("h4",{className:"text-sm font-semibold text-foreground",children:c.name}),c.description&&o.jsx("p",{className:"text-xs text-muted-foreground",children:c.description})]}),o.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-[11px] text-muted-foreground",children:[c.version&&o.jsxs("span",{children:["v",c.version]}),c.model&&o.jsx("span",{children:c.model})]})]}),c.parameters&&c.parameters.length>0?o.jsx("div",{className:"space-y-3",children:c.parameters.map(f=>{const m=LF(f,u[f.name]),p=UF(f);switch(f.type){case"boolean":return o.jsxs("div",{className:"flex items-center justify-between rounded border bg-muted/40 px-3 py-2",children:[o.jsxs("div",{className:"space-y-1",children:[o.jsx(Et,{htmlFor:`${c.id}-${f.name}`,className:"text-sm",children:f.label||f.name}),f.description&&o.jsx("p",{className:"text-xs text-muted-foreground",children:f.description}),p&&o.jsx("p",{className:"text-[11px] text-muted-foreground/80",children:p})]}),o.jsx(Ln,{id:`${c.id}-${f.name}`,checked:!!m,onCheckedChange:v=>l(c.id,f,v)})]},f.name);case"integer":case"number":return o.jsxs("div",{className:"space-y-1",children:[o.jsx(Et,{htmlFor:`${c.id}-${f.name}`,className:"text-sm",children:f.label||f.name}),o.jsx(Ia,{id:`${c.id}-${f.name}`,type:"number",value:m??"",onChange:v=>{const x=FF(v.target.value,typeof m=="number"?m:void 0);l(c.id,f,x)},min:f.min,max:f.max,step:f.step}),f.description&&o.jsx("p",{className:"text-xs text-muted-foreground",children:f.description}),p&&o.jsx("p",{className:"text-[11px] text-muted-foreground/80",children:p})]},f.name);case"enum":return o.jsxs("div",{className:"space-y-1",children:[o.jsx(Et,{className:"text-sm",children:f.label||f.name}),o.jsxs(aE,{value:m!=null?String(m):void 0,onValueChange:v=>{const x=(f.enum??[]).find(y=>String(y.value)===v);l(c.id,f,x?x.value:v)},children:[o.jsx(gp,{children:o.jsx(iE,{placeholder:"Select option"})}),o.jsx(Ap,{children:(f.enum??[]).map(v=>o.jsx(vp,{value:String(v.value),children:v.label||String(v.value)},String(v.value)))})]}),f.description&&o.jsx("p",{className:"text-xs text-muted-foreground",children:f.description})]},f.name);case"multiselect":return o.jsxs("div",{className:"space-y-1",children:[o.jsx(Et,{className:"text-sm",children:f.label||f.name}),o.jsx("div",{className:"flex flex-wrap gap-3 rounded border bg-muted/40 p-3",children:(f.enum??[]).map(v=>{const x=Array.isArray(m)?m:[],y=x.includes(v.value);return o.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[o.jsx(y1,{checked:y,onCheckedChange:E=>{const w=new Set(x);E===!0?w.add(v.value):E===!1&&w.delete(v.value),l(c.id,f,Array.from(w))}}),o.jsx("span",{children:v.label||String(v.value)})]},String(v.value))})}),f.description&&o.jsx("p",{className:"text-xs text-muted-foreground",children:f.description})]},f.name);case"object":return o.jsxs("div",{className:"space-y-1",children:[o.jsx(Et,{className:"text-sm",children:f.label||f.name}),o.jsx(w1,{value:JSON.stringify(m??f.default??{},null,2),className:"font-mono text-xs",rows:6,onChange:v=>{try{const x=JSON.parse(v.target.value);l(c.id,f,x)}catch{}}}),f.description&&o.jsx("p",{className:"text-xs text-muted-foreground",children:f.description})]},f.name);default:return o.jsxs("div",{className:"space-y-1",children:[o.jsx(Et,{className:"text-sm",children:f.label||f.name}),o.jsx(Ia,{value:String(m??""),onChange:v=>l(c.id,f,v.target.value)}),f.description&&o.jsx("p",{className:"text-xs text-muted-foreground",children:f.description})]},f.name)}})}):o.jsx("p",{className:"text-xs text-muted-foreground",children:"No configurable parameters for this pipeline."})]},c.id)})})};function YF(e){const t=s=>{if(s===null||typeof s!="object")return s;if(Array.isArray(s))return s.map(t);const i=s;return Object.keys(i).sort().reduce((l,c)=>(l[c]=t(i[c]),l),{})},n=t(e);return JSON.stringify(n)}function GF(){const[e,t]=g.useState(null),[n,s]=g.useState(!1),[i,l]=g.useState(null),c=g.useRef(null),u=g.useRef(new Map),f=g.useRef(null),m=g.useCallback(async y=>{f.current&&f.current.abort();const E=YF(y),w=u.current.get(E);if(w){t(w),s(!1),l(null);return}s(!0),l(null);const C=new AbortController;f.current=C;try{const S=await Ge.validateConfig(y);C.signal.aborted||(t(S),u.current.set(E,S),l(null))}catch(S){if(!C.signal.aborted){const N=S instanceof Error?S:new Error("Validation failed");l(N),t(null)}}finally{C.signal.aborted||s(!1)}},[]),p=g.useCallback(y=>{c.current&&clearTimeout(c.current),c.current=setTimeout(()=>{m(y)},500)},[m]),v=g.useCallback(async y=>{c.current&&(clearTimeout(c.current),c.current=null),await m(y)},[m]),x=g.useCallback(()=>{c.current&&(clearTimeout(c.current),c.current=null),f.current&&(f.current.abort(),f.current=null),t(null),s(!1),l(null)},[]);return g.useEffect(()=>()=>{c.current&&clearTimeout(c.current),f.current&&f.current.abort()},[]),{validationResult:e,isValidating:n,error:i,validateConfig:p,validateNow:v,clearValidation:x}}var nu="Collapsible",[HF,FL]=cn(nu),[VF,_p]=HF(nu),b1=g.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:s,defaultOpen:i,disabled:l,onOpenChange:c,...u}=e,[f,m]=lr({prop:s,defaultProp:i??!1,onChange:c,caller:nu});return o.jsx(VF,{scope:n,disabled:l,contentId:ar(),open:f,onOpenToggle:g.useCallback(()=>m(p=>!p),[m]),children:o.jsx(Ie.div,{"data-state":Tp(f),"data-disabled":l?"":void 0,...u,ref:t})})});b1.displayName=nu;var C1="CollapsibleTrigger",E1=g.forwardRef((e,t)=>{const{__scopeCollapsible:n,...s}=e,i=_p(C1,n);return o.jsx(Ie.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":Tp(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...s,ref:t,onClick:ve(e.onClick,i.onOpenToggle)})});E1.displayName=C1;var Rp="CollapsibleContent",S1=g.forwardRef((e,t)=>{const{forceMount:n,...s}=e,i=_p(Rp,e.__scopeCollapsible);return o.jsx(dn,{present:n||i.open,children:({present:l})=>o.jsx($F,{...s,ref:t,present:l})})});S1.displayName=Rp;var $F=g.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:s,children:i,...l}=e,c=_p(Rp,n),[u,f]=g.useState(s),m=g.useRef(null),p=Ue(t,m),v=g.useRef(0),x=v.current,y=g.useRef(0),E=y.current,w=c.open||u,C=g.useRef(w),S=g.useRef(void 0);return g.useEffect(()=>{const N=requestAnimationFrame(()=>C.current=!1);return()=>cancelAnimationFrame(N)},[]),Ot(()=>{const N=m.current;if(N){S.current=S.current||{transitionDuration:N.style.transitionDuration,animationName:N.style.animationName},N.style.transitionDuration="0s",N.style.animationName="none";const j=N.getBoundingClientRect();v.current=j.height,y.current=j.width,C.current||(N.style.transitionDuration=S.current.transitionDuration,N.style.animationName=S.current.animationName),f(s)}},[c.open,s]),o.jsx(Ie.div,{"data-state":Tp(c.open),"data-disabled":c.disabled?"":void 0,id:c.contentId,hidden:!w,...l,ref:p,style:{"--radix-collapsible-content-height":x?`${x}px`:void 0,"--radix-collapsible-content-width":E?`${E}px`:void 0,...e.style},children:w&&i})});function Tp(e){return e?"open":"closed"}var WF=b1;const j1=WF,N1=E1,k1=S1;function KF({validationResult:e,isValidating:t,className:n="",devMode:s}){const[i,l]=g.useState(new Set),c=s??!1;if(he.useEffect(()=>{if(e){const x=new Map;[...e.errors||[],...e.warnings||[]].forEach(y=>{const w=(y.field||"general").split(".")[0];x.has(w)||x.set(w,[]),x.get(w).push(y)}),l(new Set(Array.from(x.keys())))}},[e]),!e&&!t)return null;if(t)return o.jsxs("div",{className:`flex items-center gap-2 text-muted-foreground ${n}`,children:[o.jsx(yn,{className:"h-4 w-4 animate-spin"}),o.jsx("span",{children:"Validating configuration..."})]});if(!e)return null;const{valid:u,errors:f=[],warnings:m=[]}=e;if(u&&f.length===0&&m.length===0)return o.jsxs(et,{className:`border-green-200 bg-green-50 ${n}`,children:[o.jsx(Nr,{className:"h-4 w-4 text-green-600"}),o.jsx(an,{className:"text-green-900",children:"Configuration Valid"}),o.jsx(tt,{className:"text-green-700",children:"Your configuration is valid and ready to use."})]});const p=new Map;[...f,...m].forEach(x=>{const E=(x.field||"general").split(".")[0];p.has(E)||p.set(E,[]),p.get(E).push(x)});const v=x=>{const y=new Set(i);y.has(x)?y.delete(x):y.add(x),l(y)};return o.jsxs("div",{className:`space-y-4 ${n}`,role:"region","aria-label":"Configuration validation results",children:[f.length>0&&o.jsxs(et,{variant:"destructive",children:[o.jsx(Lt,{className:"h-4 w-4"}),o.jsx(an,{children:"Configuration Errors"}),o.jsxs(tt,{children:[f.length," error",f.length!==1?"s":""," found. Please fix these before submitting."]})]}),m.length>0&&f.length===0&&o.jsxs(et,{className:"border-yellow-200 bg-yellow-50",children:[o.jsx(Hn,{className:"h-4 w-4 text-yellow-600"}),o.jsx(an,{className:"text-yellow-900",children:"Configuration Warnings"}),o.jsxs(tt,{className:"text-yellow-700",children:[m.length," warning",m.length!==1?"s":""," found. You can proceed, but review these suggestions."]})]}),o.jsx("div",{className:"space-y-2",children:Array.from(p.entries()).map(([x,y])=>{const E=i.has(x),w=y.some(S=>S.severity==="error"),C=y.some(S=>S.severity==="warning");return o.jsxs(j1,{open:E,onOpenChange:()=>v(x),className:"border rounded-lg p-4 bg-card",children:[o.jsx(N1,{className:"flex items-center justify-between w-full text-left",children:o.jsxs("div",{className:"flex items-center gap-2",children:[E?o.jsx(Jr,{className:"h-4 w-4"}):o.jsx(Aa,{className:"h-4 w-4"}),o.jsx("span",{className:"font-medium",children:x}),o.jsxs("div",{className:"flex gap-1",children:[w&&o.jsxs(Je,{variant:"destructive",className:"text-xs",children:[y.filter(S=>S.severity==="error").length," error",y.filter(S=>S.severity==="error").length!==1?"s":""]}),C&&o.jsxs(Je,{variant:"outline",className:"text-xs border-yellow-400 text-yellow-700",children:[y.filter(S=>S.severity==="warning").length," warning",y.filter(S=>S.severity==="warning").length!==1?"s":""]})]})]})}),o.jsx(k1,{className:"mt-3 space-y-3",children:y.map((S,N)=>o.jsx("div",{className:`p-3 rounded-md ${S.severity==="error"?"bg-red-50 border border-red-200":"bg-yellow-50 border border-yellow-200"}`,children:o.jsxs("div",{className:"flex items-start gap-2",children:[S.severity==="error"?o.jsx(Lt,{className:"h-4 w-4 text-red-600 mt-0.5 flex-shrink-0"}):o.jsx(Hn,{className:"h-4 w-4 text-yellow-600 mt-0.5 flex-shrink-0"}),o.jsxs("div",{className:"flex-1 space-y-1",children:[S.field&&S.field.includes(".")&&o.jsx("p",{className:`text-xs font-mono ${S.severity==="error"?"text-red-600":"text-yellow-600"}`,children:S.field.split(".").slice(1).join(".")}),o.jsx("p",{className:`text-sm font-medium ${S.severity==="error"?"text-red-900":"text-yellow-900"}`,children:S.message}),S.hint&&o.jsxs("p",{className:`text-sm ${S.severity==="error"?"text-red-700":"text-yellow-700"}`,children:[o.jsx("span",{className:"font-medium",children:"Hint:"})," ",S.hint]}),S.suggested_value!==void 0&&o.jsxs("p",{className:`text-sm ${S.severity==="error"?"text-red-700":"text-yellow-700"}`,children:[o.jsx("span",{className:"font-medium",children:"Suggested:"})," ",o.jsx("code",{className:"px-1 py-0.5 rounded bg-black/10",children:JSON.stringify(S.suggested_value)})]}),c&&S.error_code&&o.jsxs("p",{className:`text-xs font-mono ${S.severity==="error"?"text-red-600":"text-yellow-600"}`,children:["Code: ",S.error_code]})]})]})},`${x}-${N}`))})]},x)})})]})}const oa=[{id:1,title:"Upload Videos",description:"Select video files to process"},{id:2,title:"Select Pipelines",description:"Choose annotation pipelines"},{id:3,title:"Configure",description:"Set pipeline parameters"},{id:4,title:"Review & Submit",description:"Review and start jobs"}],I1=e=>{if(!e.parameters||e.parameters.length===0)return null;const t={};return e.parameters.forEach(n=>{n.default!==void 0&&(t[n.name]=n.default)}),Object.keys(t).length>0?t:null},JF=e=>e.reduce((t,n)=>{const s=I1(n);return s&&(t[n.id]=s),t},{}),qF=()=>{const e=So(),n=Eo().state,{data:s,isLoading:i,error:l}=u1(),c=f1(),u=g.useMemo(()=>s?.catalog.pipelines??[],[s?.catalog.pipelines]),[f,m]=g.useState(1),[p,v]=g.useState([]),[x,y]=g.useState([]),[E,w]=g.useState({}),[C,S]=g.useState(!1),[N,j]=g.useState(null),[I,_]=g.useState([]),[T,M]=g.useState(!1),{validationResult:D,isValidating:F,validateConfig:L}=GF(),J=g.useMemo(()=>u.filter(z=>z.defaultEnabled!==!1).map(z=>z.id),[u]);g.useEffect(()=>{u.length&&(y(z=>z.length?z:J),w(z=>{const Z={...z};return u.forEach(O=>{if(!Z[O.id]){const Y=I1(O);Y&&(Z[O.id]=Y)}}),Object.keys(Z).length?Z:JF(u)}))},[u,J]),g.useEffect(()=>{n&&u.length&&(n.retryJobPipelines&&y(n.retryJobPipelines),n.retryJobConfig&&w(n.retryJobConfig),window.history.replaceState({},document.title))},[n,u]),g.useEffect(()=>{Object.keys(E).length>0&&L(E)},[E,L]);const W=f/oa.length*100,te=()=>{f{f>1&&m(f-1)},re=()=>{if(D?.warnings&&D.warnings.length>0){M(!0);return}ee()},ee=async()=>{if(console.log("🚀 Submit button clicked - starting job submission"),console.log("Selected files:",p.map(B=>B.name)),console.log("Selected pipelines:",x),console.log("Config:",E),p.length===0){j(Zt("No videos selected"));return}if(x.length===0){j(Zt("No pipelines selected"));return}S(!0),j(null),_([]);const z=[],Z=[],O=Object.entries(E).filter(([B])=>x.includes(B)),Y=O.length>0?Object.fromEntries(O):void 0;try{console.log(`📤 Submitting ${p.length} job(s) to VideoAnnotator API...`);for(const B of p)try{console.log(`📹 Submitting job for: ${B.name}`);const $=await Ge.submitJob(B,x,Y);console.log(`✅ Job created successfully: ${$.id}`),z.push($.id)}catch($){console.error(`❌ Job submission failed for ${B.name}:`,$);const ne=Zt($);Z.push(`${B.name}: ${ne.message}`)}z.length>0&&(_(z),Z.length===0&&setTimeout(()=>{e("/jobs")},2e3)),Z.length>0&&(console.warn(`⚠️ Some jobs failed: ${Z.length} out of ${p.length}`),j(Zt({error:`Failed to submit ${Z.length} job(s)`,hint:`${Z.join(`
+`)}`}))),z.length===0&&Z.length>0&&(console.error("❌ All job submissions failed"),j(Zt({error:"All job submissions failed",hint:`Common issues:
+• VideoAnnotator API server not running (check http://localhost:18011)
+• Invalid API token or authentication
+• Network connectivity issues`,error_code:"ALL_JOBS_FAILED"})))}catch(B){console.error("💥 Unexpected error during job submission:",B),j(Zt(B))}finally{S(!1),console.log("🏁 Job submission process completed")}},le=()=>{switch(f){case 1:return o.jsx(XF,{selectedFiles:p,setSelectedFiles:v});case 2:return o.jsx(ZF,{pipelines:u,selectedPipelines:x,setSelectedPipelines:y,isLoading:i,error:l,onRetry:()=>c({forceServerRefresh:!0})});case 3:return o.jsx(eM,{config:E,setConfig:w,selectedPipelines:x,pipelines:u,validationResult:D,isValidating:F});case 4:return o.jsx(tM,{selectedFiles:p,selectedPipelines:x,config:E,onSubmit:re,isSubmitting:C,submitError:N,submitSuccess:I,pipelines:u});default:return null}},V=()=>{switch(f){case 1:return p.length>0;case 2:return x.length>0&&u.length>0&&!i;case 3:return D?.valid!==!1;case 4:return D?.valid!==!1;default:return!1}};return o.jsxs("div",{className:"container mx-auto px-6 py-8 max-w-5xl space-y-6",children:[o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsx(ot,{to:"/jobs",children:o.jsxs(X,{variant:"outline",size:"sm",children:[o.jsx(Pi,{className:"h-4 w-4 mr-2"}),"Back to Jobs"]})}),o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("img",{src:dl,alt:"VideoAnnotator",className:"h-8 w-8"}),o.jsxs("div",{children:[o.jsx("h2",{className:"text-2xl font-bold text-foreground",children:"Create New Annotation Jobs"}),o.jsx("p",{className:"text-muted-foreground",children:"Process videos through the VideoAnnotator pipeline (supports batch processing)"})]})]})]}),n&&o.jsxs(et,{children:[o.jsx(Sm,{className:"h-4 w-4"}),o.jsx(an,{children:"Retrying Failed Job"}),o.jsx(tt,{children:o.jsxs("div",{className:"space-y-1",children:[o.jsxs("p",{children:["Job ID: ",o.jsx("span",{className:"font-mono text-sm",children:n.retryJobId})]}),o.jsx("p",{children:"Pipeline settings and configuration have been pre-filled."}),o.jsx("p",{className:"font-semibold",children:n.retryJobVideoFilename?`Please upload "${n.retryJobVideoFilename}" again to retry the job.`:"Please upload the same video file to retry the job."})]})})]}),o.jsx(Qe,{children:o.jsx(yt,{className:"pt-6",children:o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"flex justify-between text-sm",children:[o.jsxs("span",{children:["Step ",f," of ",oa.length]}),o.jsxs("span",{children:[Math.round(W),"% Complete"]})]}),o.jsx(fl,{value:W,className:"h-2"}),o.jsx("div",{className:"flex justify-between",children:oa.map(z=>o.jsxs("div",{className:`text-center ${z.id===f?"text-blue-600":z.id1?"s":""}`]}):o.jsxs(X,{onClick:te,disabled:!V(),children:["Next",o.jsx($c,{className:"h-4 w-4 ml-2"})]})]}),o.jsx(jp,{open:T,onOpenChange:M,children:o.jsxs(Wd,{children:[o.jsxs(Kd,{children:[o.jsx(qd,{children:"Configuration Warnings Detected"}),o.jsxs(Xd,{children:["Your configuration has ",D?.warnings?.length||0," warning(s). These may indicate suboptimal settings, but you can proceed if you understand the implications.",D?.warnings&&D.warnings.length>0&&o.jsx("div",{className:"mt-4 space-y-2",children:D.warnings.map((z,Z)=>o.jsxs("div",{className:"text-sm",children:[o.jsxs("strong",{className:"text-yellow-700",children:[z.field,":"]})," ",z.message]},Z))})]})]}),o.jsxs(Jd,{children:[o.jsx(eu,{children:"Cancel"}),o.jsx(Zd,{onClick:()=>{M(!1),ee()},children:"Submit Anyway"})]})]})})]})},XF=({selectedFiles:e,setSelectedFiles:t})=>{const n=l=>{const c=Array.from(l.target.files||[]);t([...e,...c])},s=l=>{t(e.filter((c,u)=>u!==l))},i=e.reduce((l,c)=>l+c.size,0);return o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"border-2 border-dashed border-gray-300 rounded-lg p-8 text-center",children:[o.jsx(Fi,{className:"h-12 w-12 mx-auto text-gray-400 mb-4"}),o.jsx("h3",{className:"text-lg font-medium mb-2",children:"Upload Video Files"}),o.jsx("p",{className:"text-muted-foreground mb-4",children:"Select video files to process. Supports batch processing. Formats: MP4, WebM, AVI, MOV"}),o.jsx("input",{type:"file",accept:"video/*",multiple:!0,onChange:n,className:"block w-full text-sm text-gray-500 file:mr-4 file:py-2 file:px-4 file:rounded-md file:border-0 file:text-sm file:font-medium file:bg-blue-50 file:text-blue-700 hover:file:bg-blue-100"})]}),e.length>0&&o.jsxs("div",{className:"p-4 bg-green-50 rounded-lg",children:[o.jsxs("div",{className:"flex justify-between items-center mb-2",children:[o.jsxs("h4",{className:"font-medium text-green-800",children:["Selected Files (",e.length,"):"]}),o.jsxs("span",{className:"text-sm text-green-700",children:["Total: ",(i/(1024*1024)).toFixed(1)," MB"]})]}),o.jsx("div",{className:"space-y-2 max-h-40 overflow-y-auto",children:e.map((l,c)=>o.jsxs("div",{className:"flex justify-between items-center bg-white p-2 rounded",children:[o.jsxs("div",{className:"text-sm text-green-700",children:[o.jsx("span",{className:"font-medium",children:l.name}),o.jsxs("span",{className:"text-gray-500 ml-2",children:["(",(l.size/(1024*1024)).toFixed(1)," MB)"]})]}),o.jsx(X,{variant:"ghost",size:"sm",onClick:()=>s(c),className:"h-6 w-6 p-0 text-red-600 hover:text-red-800",children:o.jsx(wd,{className:"h-4 w-4"})})]},c))})]})]})},ZF=({pipelines:e,selectedPipelines:t,setSelectedPipelines:n,isLoading:s,error:i,onRetry:l})=>{const c=g.useMemo(()=>{const f=new Map;return e.forEach(m=>{const p=m.group||"Other",v=f.get(p)??[];v.push(m),f.set(p,v)}),Array.from(f.entries()).map(([m,p])=>({groupName:m,list:p.slice().sort((v,x)=>v.name.localeCompare(x.name))})).sort((m,p)=>m.groupName.localeCompare(p.groupName))},[e]),u=f=>{t.includes(f)?n(t.filter(m=>m!==f)):n([...t,f])};if(s)return o.jsxs("div",{className:"space-y-4",children:[o.jsx(or,{className:"h-5 w-48"}),o.jsx(or,{className:"h-20 w-full"}),o.jsx(or,{className:"h-20 w-full"})]});if(i){const f=Zt(i);return(f.message==="undefined"||!f.message)&&(f.message="Failed to load pipelines. Please check your connection."),o.jsx(jo,{error:f})}return e.length===0?o.jsxs(et,{children:[o.jsx(an,{children:"No pipelines detected"}),o.jsx(tt,{children:"Connect to a VideoAnnotator v1.2.x server and refresh the catalog before creating jobs."})]}):o.jsxs("div",{className:"space-y-6",children:[o.jsx("p",{className:"text-foreground",children:"Select the annotation pipelines reported by your VideoAnnotator server. Feature availability reflects the live API catalog."}),o.jsx("div",{className:"space-y-6",children:c.map(({groupName:f,list:m})=>o.jsxs("div",{className:"space-y-2",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("h3",{className:"text-sm font-semibold text-foreground",children:f}),o.jsxs("span",{className:"text-xs text-muted-foreground",children:[m.length," pipelines"]})]}),o.jsx("div",{className:"space-y-3",children:m.map(p=>{const v=t.includes(p.id),x=p.description??"No description provided.";return o.jsxs("label",{className:`flex cursor-pointer flex-col gap-1 rounded-lg border p-3 transition hover:border-primary/70 ${v?"border-primary bg-primary/5":"border-border bg-card"}`,children:[o.jsxs("div",{className:"flex items-center justify-between gap-2",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("input",{type:"checkbox",className:"rounded",checked:v,onChange:()=>u(p.id)}),o.jsx("span",{className:"text-sm font-medium text-foreground",children:p.name})]}),o.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[p.version&&o.jsxs(Je,{variant:"secondary",className:"text-[10px] px-1.5 py-0",children:["v",p.version]}),p.model&&o.jsx(Je,{variant:"outline",className:"text-[10px] px-1.5 py-0",children:p.model}),p.capabilities?.length?o.jsxs("span",{className:"text-[11px] text-muted-foreground",children:[p.capabilities.length," capabilities"]}):null]})]}),o.jsx("p",{className:"text-xs text-muted-foreground",children:x})]},p.id)})})]},f))}),t.length===0&&o.jsxs(et,{children:[o.jsx(Lt,{className:"h-4 w-4"}),o.jsx(tt,{children:"Please select at least one pipeline to proceed."})]})]})},eM=({config:e,setConfig:t,selectedPipelines:n,pipelines:s,validationResult:i,isValidating:l})=>{const c=g.useMemo(()=>s.filter(v=>n.includes(v.id)),[s,n]),[u,f]=g.useState(()=>JSON.stringify(e,null,2)),[m,p]=g.useState(null);return g.useEffect(()=>{f(JSON.stringify(e,null,2))},[e]),o.jsxs("div",{className:"space-y-6",children:[o.jsx("p",{className:"text-muted-foreground",children:"Configure pipeline parameters discovered from the VideoAnnotator server. Adjust values below or edit the JSON override for advanced scenarios."}),o.jsx(zF,{pipelines:s,selectedPipelineIds:n,config:e,onConfigChange:t}),o.jsxs("details",{className:"p-4 bg-blue-50 rounded-lg",children:[o.jsx("summary",{className:"font-medium text-blue-800 mb-2 cursor-pointer hover:text-blue-900",children:"Advanced: Raw JSON Configuration (click to expand)"}),o.jsxs("div",{className:"mt-4 space-y-3",children:[o.jsxs("div",{className:"p-3 bg-white border border-blue-200 rounded text-sm",children:[o.jsx("p",{className:"font-semibold text-blue-900 mb-2",children:"💡 What is this?"}),o.jsx("p",{className:"text-gray-700 mb-2",children:'The JSON below represents your complete pipeline configuration. Each pipeline (like "openface3" or "whisper") can have custom parameters. Most users can ignore this and use the form controls above.'}),o.jsx("p",{className:"text-gray-700 mb-2",children:o.jsx("strong",{children:"When to use this:"})}),o.jsxs("ul",{className:"list-disc ml-5 space-y-1 text-gray-700",children:[o.jsx("li",{children:"Testing specific parameter combinations not exposed in the UI"}),o.jsx("li",{children:"Copying/pasting configurations between jobs"}),o.jsx("li",{children:"Applying parameters that don't have form controls yet"})]}),o.jsx("p",{className:"text-gray-700 mt-2",children:o.jsx("strong",{children:"Example structure:"})}),o.jsx("pre",{className:"mt-2 p-2 bg-gray-50 rounded text-xs overflow-x-auto text-gray-800",children:`{
+ "openface3": {
+ "model": "mobilenet",
+ "confidence_threshold": 0.5
+ },
+ "whisper": {
+ "model": "base",
+ "language": "en"
+ }
+}`})]}),o.jsxs("div",{className:`bg-white p-4 rounded border-2 ${i?.errors&&i.errors.length>0?"border-red-300 shadow-sm shadow-red-100":i?.warnings&&i.warnings.length>0?"border-yellow-300 shadow-sm shadow-yellow-100":"border-blue-300"}`,children:[o.jsxs("div",{className:"flex justify-between items-center mb-3",children:[o.jsxs("div",{children:[o.jsx("label",{className:"text-sm font-semibold text-gray-900",children:"✏️ Edit Configuration JSON (Editable)"}),o.jsx("p",{className:"text-xs text-gray-600 mt-0.5",children:"Click inside and type to edit the configuration directly"})]}),o.jsx("button",{type:"button",onClick:()=>{navigator.clipboard.writeText(JSON.stringify(e,null,2))},className:"text-xs text-blue-600 hover:text-blue-800 underline",children:"Copy to clipboard"})]}),o.jsx("textarea",{value:u,onChange:v=>{const x=v.target.value;f(x);try{const y=JSON.parse(x);t(y),p(null)}catch(y){p(y instanceof Error?y.message:"Invalid JSON")}},className:`w-full h-64 text-sm font-mono resize-y border-2 rounded px-3 py-2 text-gray-900 bg-white focus:outline-none ${m?"border-orange-400 focus:ring-2 focus:ring-orange-500 focus:border-orange-500":i?.errors&&i.errors.length>0?"border-red-400 focus:ring-2 focus:ring-red-500 focus:border-red-500":i?.warnings&&i.warnings.length>0?"border-yellow-400 focus:ring-2 focus:ring-yellow-500 focus:border-yellow-500":"border-gray-300 focus:ring-2 focus:ring-blue-500 focus:border-blue-500"}`,placeholder:'{"pipeline_name": {"parameter": "value"}}'}),o.jsxs("div",{className:"mt-2 space-y-1",children:[m&&o.jsxs("p",{className:"text-xs text-orange-600 font-medium",children:["⚠️ JSON Parse Error: ",m," (config will update when valid)"]}),o.jsxs("div",{className:"flex justify-between items-start",children:[o.jsxs("p",{className:"text-xs text-muted-foreground",children:["Active pipelines: ",c.map(v=>v.name).join(", ")||"None"]}),!m&&o.jsx("p",{className:"text-xs text-green-600",children:"✓ Valid JSON"})]})]})]})]})]}),o.jsx(KF,{validationResult:i,isValidating:l})]})},tM=({selectedFiles:e,selectedPipelines:t,config:n,onSubmit:s,isSubmitting:i,submitError:l,submitSuccess:c,pipelines:u})=>{const f=e.reduce((p,v)=>p+v.size,0),m=t.map(p=>u.find(v=>v.id===p)?.name||p).join(", ");return o.jsxs("div",{className:"space-y-6",children:[o.jsx("p",{className:"text-muted-foreground",children:"Review your job configuration before submission."}),l&&o.jsx(jo,{error:l}),c.length>0&&o.jsx(et,{children:o.jsxs(tt,{children:["Successfully submitted ",c.length," job(s). Job IDs: ",c.join(", "),l?"":" Redirecting to jobs list..."]})}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"p-4 border rounded-lg",children:[o.jsxs("h4",{className:"font-medium mb-2",children:["Video Files (",e.length,")"]}),o.jsxs("div",{className:"space-y-1",children:[e.slice(0,3).map((p,v)=>o.jsxs("p",{className:"text-sm text-foreground",children:[p.name," (",(p.size/(1024*1024)).toFixed(1)," MB)"]},v)),e.length>3&&o.jsxs("p",{className:"text-sm text-muted-foreground",children:["...and ",e.length-3," more files"]}),o.jsxs("p",{className:"text-sm font-medium text-muted-foreground",children:["Total size: ",(f/(1024*1024)).toFixed(1)," MB"]})]})]}),o.jsxs("div",{className:"p-4 border rounded-lg",children:[o.jsx("h4",{className:"font-medium mb-2",children:"Selected Pipelines"}),o.jsx("p",{children:m||"None selected"})]}),o.jsxs("div",{className:"p-4 border rounded-lg",children:[o.jsx("h4",{className:"font-medium mb-2",children:"Estimated Processing Time"}),o.jsxs("p",{children:["~",Math.ceil(e.length*7)," minutes (depending on video lengths and selected pipelines)"]})]}),o.jsxs("div",{className:"p-4 border rounded-lg",children:[o.jsx("h4",{className:"font-medium mb-2",children:"Configuration Preview"}),o.jsx("pre",{className:"text-xs text-muted-foreground bg-muted p-2 rounded overflow-x-auto",children:JSON.stringify(n,null,2)})]})]})]})},nM=()=>o.jsxs("div",{className:"container mx-auto px-6 py-8 max-w-5xl space-y-6",children:[o.jsxs("div",{className:"flex justify-between items-center",children:[o.jsxs("div",{children:[o.jsx("h2",{className:"text-2xl font-bold",children:"Dataset Management"}),o.jsx("p",{className:"text-gray-600",children:"Manage video datasets for batch processing"})]}),o.jsxs(X,{disabled:!0,children:[o.jsx(_v,{className:"h-4 w-4 mr-2"}),"Register Dataset (Coming Soon)"]})]}),o.jsxs(et,{children:[o.jsx(Sk,{className:"h-4 w-4"}),o.jsx(tt,{children:"Dataset management will allow you to register video collections for batch processing. This feature is planned for a future release."})]}),o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:[o.jsx(Qe,{className:"border-dashed border-2",children:o.jsxs(yt,{className:"flex flex-col items-center justify-center p-8 text-center",children:[o.jsx(Cm,{className:"h-12 w-12 text-gray-400 mb-4"}),o.jsx("h3",{className:"font-medium text-gray-600 mb-2",children:"No Datasets Registered"}),o.jsx("p",{className:"text-sm text-gray-500 mb-4",children:"Register your first video dataset to enable batch processing"}),o.jsxs(X,{variant:"outline",disabled:!0,children:[o.jsx(_v,{className:"h-4 w-4 mr-2"}),"Add Dataset"]})]})}),o.jsxs(Qe,{className:"opacity-50",children:[o.jsx(Nt,{className:"pb-3",children:o.jsxs(kt,{className:"text-lg flex items-center gap-2",children:[o.jsx(Ck,{className:"h-5 w-5"}),"Example Dataset"]})}),o.jsxs(yt,{children:[o.jsxs("div",{className:"space-y-2 text-sm",children:[o.jsxs("div",{children:[o.jsx("span",{className:"font-medium",children:"Path:"}),o.jsx("span",{className:"ml-2 text-gray-600",children:"/videos/training"})]}),o.jsxs("div",{children:[o.jsx("span",{className:"font-medium",children:"Videos:"}),o.jsx("span",{className:"ml-2 text-gray-600",children:"125 files"})]}),o.jsxs("div",{children:[o.jsx("span",{className:"font-medium",children:"Total Size:"}),o.jsx("span",{className:"ml-2 text-gray-600",children:"2.3 GB"})]})]}),o.jsxs("div",{className:"mt-4 flex gap-2",children:[o.jsx(X,{size:"sm",variant:"outline",disabled:!0,children:"Scan"}),o.jsx(X,{size:"sm",variant:"outline",disabled:!0,children:"Process"})]})]})]})]}),o.jsxs(Qe,{children:[o.jsx(Nt,{children:o.jsx(kt,{children:"Planned Features"})}),o.jsx(yt,{children:o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"flex items-start gap-3",children:[o.jsx("div",{className:"w-2 h-2 rounded-full bg-blue-500 mt-2"}),o.jsxs("div",{children:[o.jsx("h4",{className:"font-medium",children:"Dataset Registration"}),o.jsx("p",{className:"text-sm text-gray-600",children:"Register video directories with metadata for organized batch processing"})]})]}),o.jsxs("div",{className:"flex items-start gap-3",children:[o.jsx("div",{className:"w-2 h-2 rounded-full bg-blue-500 mt-2"}),o.jsxs("div",{children:[o.jsx("h4",{className:"font-medium",children:"Video Scanning"}),o.jsx("p",{className:"text-sm text-gray-600",children:"Automatically discover and catalog video files in registered datasets"})]})]}),o.jsxs("div",{className:"flex items-start gap-3",children:[o.jsx("div",{className:"w-2 h-2 rounded-full bg-blue-500 mt-2"}),o.jsxs("div",{children:[o.jsx("h4",{className:"font-medium",children:"Batch Processing"}),o.jsx("p",{className:"text-sm text-gray-600",children:"Process entire datasets with consistent pipeline configurations"})]})]}),o.jsxs("div",{className:"flex items-start gap-3",children:[o.jsx("div",{className:"w-2 h-2 rounded-full bg-blue-500 mt-2"}),o.jsxs("div",{children:[o.jsx("h4",{className:"font-medium",children:"Progress Tracking"}),o.jsx("p",{className:"text-sm text-gray-600",children:"Monitor batch job progress across multiple videos simultaneously"})]})]})]})})]})]});function ki(e){const t=new AbortController;return setTimeout(()=>t.abort(),e),t.signal}async function rM(e,t){const n=[],s=[];console.log("🔍 DIAGNOSTICS STARTED"),console.log("Target API URL:",e);const i=e.replace(/\/$/,""),l=!i.startsWith("http");let c="unknown",u="";try{if(l)c=window.location.hostname,u=window.location.port;else{const E=new URL(i);c=E.hostname,u=E.port}console.log("Parsed Hostname:",c,"Port:",u)}catch{return n.push({test:"URL Validation",passed:!1,error:"Invalid API URL format"}),{timestamp:new Date().toISOString(),summary:"complete_failure",results:n,recommendations:["Check the API URL format"]}}let f=!1,m=null;const p=`${i}/api/v1/system/health`;try{const E=performance.now();console.log(`Attempting fetch: ${p}`);const w=await fetch(p,{method:"GET",signal:ki(1e4)}),C=performance.now()-E;console.log(`Fetch success (${C}ms):`,w.status),m=w,f=w.ok||w.status===401,n.push({test:"Server Reachable",passed:f,duration:C,details:{status:w.status,statusText:w.statusText,url:p,mode:l?"Proxy (Relative URL)":"Direct (Absolute URL)"}}),C>3e3&&s.push(`⏱️ Server is slow (${Math.round(C/1e3)}s response time)`)}catch(E){const w=E instanceof Error?E.message:String(E);n.push({test:"Server Reachable",passed:!1,error:w,details:{url:`${i}/api/v1/system/health`}}),w.includes("timeout")||w.includes("timed out")||w.includes("abort")?(s.push("⏱️ Server not responding (timeout)"),s.push("💡 Check if VideoAnnotator server is running")):(w.includes("fetch")||w.includes("Failed to fetch"))&&s.push("🚫 Cannot connect to server (Connection Refused or CORS)")}if(!f&&c==="localhost"&&!l){const E=i.replace("localhost","127.0.0.1");try{const w=await fetch(`${E}/api/v1/system/health`,{signal:ki(3e3)});w.ok||w.status===401?(n.push({test:"Address Resolution",passed:!1,error:"localhost failed, but 127.0.0.1 worked",details:{note:"IPv4/IPv6 resolution issue"}}),s.push(`💡 Use IP address instead of localhost: ${E}`)):n.push({test:"Address Resolution",passed:!1,error:"Both localhost and 127.0.0.1 failed"})}catch{n.push({test:"Address Resolution",passed:!1,error:"Both localhost and 127.0.0.1 failed"})}}else f&&n.push({test:"Address Resolution",passed:!0,details:{hostname:c}});if(!f&&!l&&window.location.hostname==="localhost")try{const w=await fetch("/api/v1/system/health",{signal:ki(3e3)});(w.ok||w.status===401)&&(n.push({test:"Proxy Availability",passed:!0,details:{note:"Proxy works!"}}),s.push("💡 Connection blocked? Try using the built-in proxy by clearing the API URL field (leave it empty)."))}catch{}if(f&&!l){const E=m?.headers.get("Access-Control-Allow-Origin");n.push({test:"Cross-Origin Access",passed:!0,details:{allowOrigin:E||"(not visible)"}})}else!f&&!l&&n.push({test:"Cross-Origin Access",passed:!1,error:"Cannot test (Server unreachable)"});if(t&&f)try{const E=performance.now(),w=await fetch(`${i}/api/v1/jobs/?per_page=1`,{headers:{Authorization:`Bearer ${t}`},signal:ki(1e4)}),C=performance.now()-E;n.push({test:"API Token Valid",passed:w.ok,duration:C,details:{status:w.status}}),w.status===401?(s.push("🔑 Your API token is invalid or expired"),s.push("💡 Get a new token from the server administrator")):w.status===404&&s.push("⚠️ Server returned 404 (may indicate auth issue on v1.3.0 servers)")}catch(E){n.push({test:"API Token Valid",passed:!1,error:E instanceof Error?E.message:String(E)})}else t&&n.push({test:"API Token Valid",passed:!1,error:"Skipped (Server unreachable)"});if(f)try{const E=performance.now();let w;m&&!m.bodyUsed?w=await m.json():w=await(await fetch(`${i}/api/v1/system/health`,{signal:ki(1e4)})).json();const C=performance.now()-E;n.push({test:"Server Info",passed:!0,duration:C,details:{version:w.videoannotator_version||w.version,api_version:w.api_version}})}catch(E){n.push({test:"Server Info",passed:!1,error:E instanceof Error?E.message:String(E)})}const v=n.filter(E=>E.passed).length,x=n.length;let y;return v===x?y="all_passed":v>0?y="partial_failure":y="complete_failure",y==="complete_failure"&&(s.push("Server appears to be completely unreachable"),s.push(`1. Verify server is running on port ${u||"18011"}`),s.push("2. Check if firewall is blocking connections"),c==="localhost"&&s.push("3. Try using 127.0.0.1 instead of localhost")),{timestamp:new Date().toISOString(),summary:y,results:n,recommendations:[...new Set(s)]}}function sM(e){let t=`Connection Diagnostics Report
+`;t+=`Timestamp: ${new Date(e.timestamp).toLocaleString()}
+`,t+=`Summary: ${e.summary.replace("_"," ").toUpperCase()}
+
+`,t+=`Test Results:
+`,t+=`${"=".repeat(60)}
+`;for(const n of e.results){const s=n.passed?"✅ PASS":"❌ FAIL",i=n.duration?` (${Math.round(n.duration)}ms)`:"";t+=`${s} ${n.test}${i}
+`,n.error&&(t+=` Error: ${n.error}
+`),n.details&&(t+=` Details: ${JSON.stringify(n.details)}
+`),t+=`
+`}return e.recommendations.length>0&&(t+=`
+Recommendations:
+`,t+=`${"=".repeat(60)}
+`,e.recommendations.forEach((n,s)=>{t+=`${s+1}. ${n}
+`})),t}function oM({onTokenConfigured:e}){const[t,n]=g.useState(()=>{const F=localStorage.getItem("videoannotator_api_url");if(F!==null)return F.includes("//localhost:")?F.replace("//localhost:","//127.0.0.1:"):F;const L="http://localhost:18011";return L.includes("//localhost:")?L.replace("//localhost:","//127.0.0.1:"):L||"http://127.0.0.1:18011"}),[s,i]=g.useState(()=>{const F=localStorage.getItem("videoannotator_api_token");return F!==null?F:"va__-uN6rm1rwDdx7ksAGj1b-xndPfUCwbJHAcl7p00sbs"}),[l,c]=g.useState(!1),[u,f]=g.useState(!1),[m,p]=g.useState(null),[v,x]=g.useState(!1),[y,E]=g.useState(null),[w,C]=g.useState(null),[S,N]=g.useState(!1),j=async(F,L)=>{const J=F||t,W=L!==void 0?L:s;f(!0);const te=Ge.baseURL,q=Ge.token;Ge.updateConfig(J,W||void 0);try{const re=await Ge.validateToken();p({isValid:re.isValid,user:re.user,permissions:re.permissions,expiresAt:re.expiresAt,error:re.error});try{const ee=await Ge.getSystemHealth();E(ee.security?.auth_required??null)}catch{}}catch(re){p({isValid:!1,error:re instanceof Error?re.message:String(re)})}finally{Ge.updateConfig(te,q),f(!1)}},I=()=>{let F=t;F.includes("//localhost:")&&(F=F.replace("//localhost:","//127.0.0.1:"),n(F)),localStorage.setItem("videoannotator_api_url",F),localStorage.setItem("videoannotator_api_token",s),x(!1),Ge.updateConfig(F,s.trim()?s:void 0),s.trim(),console.log(`✅ Configuration saved: URL=${F}, Token=${s?"***":"(empty)"}`),e?.(),console.log("🔄 Reloading page to apply new token configuration..."),setTimeout(()=>{window.location.reload()},500)};g.useEffect(()=>{const F=localStorage.getItem("videoannotator_api_url"),L=localStorage.getItem("videoannotator_api_token");F!==null&&(F.includes("//localhost:")?n(F.replace("//localhost:","//127.0.0.1:")):n(F)),L!==null&&i(L)},[]),g.useEffect(()=>{const F=localStorage.getItem("videoannotator_api_url"),L=localStorage.getItem("videoannotator_api_token"),te=t!==(F!==null?F:"http://localhost:18011")||s!==(L!==null?L:"va__-uN6rm1rwDdx7ksAGj1b-xndPfUCwbJHAcl7p00sbs");x(te),te&&p(null)},[t,s]);const _=()=>{const F="http://localhost:18011",L="va__-uN6rm1rwDdx7ksAGj1b-xndPfUCwbJHAcl7p00sbs";localStorage.setItem("videoannotator_api_url",F),localStorage.setItem("videoannotator_api_token",L),n(F),i(L),x(!1),Ge.updateConfig(F,L),p(null),setTimeout(()=>{j(F,L)},100)},T=()=>{j()},M=async()=>{N(!0),C(null);try{const F=await rM(t,s||void 0);C(F);const L=sM(F);navigator.clipboard.writeText(L).catch(()=>{})}catch(F){console.error("Diagnostics failed:",F)}finally{N(!1)}},D=!localStorage.getItem("videoannotator_api_token")&&!m;return o.jsxs("div",{className:"max-w-2xl mx-auto space-y-6",children:[D&&o.jsxs(et,{className:"border-blue-200 bg-blue-50",children:[o.jsx(Rk,{className:"h-5 w-5 text-blue-600"}),o.jsx(an,{className:"text-blue-900 font-semibold",children:"Welcome! Let's get you connected"}),o.jsxs(tt,{className:"text-blue-800 space-y-3 mt-2",children:[o.jsx("p",{children:"To start creating annotation jobs, you need to configure your VideoAnnotator server connection."}),o.jsxs("div",{className:"space-y-2 text-sm",children:[o.jsx("p",{className:"font-medium",children:"Quick Start:"}),o.jsxs("ol",{className:"list-decimal list-inside space-y-1 ml-2",children:[o.jsx("li",{children:"Make sure your VideoAnnotator server is running (default: http://localhost:18011)"}),o.jsx("li",{children:"Get your API token from the server console or administrator"}),o.jsx("li",{children:'Enter the token below and click "Test Connection"'}),o.jsx("li",{children:'Once validated, click "Save Configuration"'})]})]}),o.jsxs("div",{className:"flex items-start gap-2 mt-3 p-3 bg-white/50 rounded-md border border-blue-200",children:[o.jsx(g0,{className:"h-4 w-4 text-blue-600 mt-0.5 flex-shrink-0"}),o.jsxs("div",{className:"text-sm",children:[o.jsx("p",{className:"font-medium mb-1",children:"For local development:"}),o.jsxs("p",{children:["Use the default values below. Click ",o.jsx("strong",{children:'"Reset to Defaults"'})," to auto-fill, then ",o.jsx("strong",{children:'"Test Connection"'})," to verify."]})]})]})]})]}),o.jsxs(Qe,{children:[o.jsxs(Nt,{children:[o.jsxs(kt,{className:"flex items-center gap-2",children:[o.jsx(uo,{className:"h-5 w-5"}),"VideoAnnotator API Configuration"]}),o.jsx(Kr,{children:"Configure your VideoAnnotator server connection and authentication token. This is required to create and manage annotation jobs."})]}),o.jsxs(yt,{className:"space-y-6",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(Et,{htmlFor:"api-url",children:"Server URL"}),o.jsxs("div",{className:"flex gap-2",children:[o.jsxs("div",{className:"relative flex-1",children:[o.jsx(Ia,{id:"api-url",value:t,onChange:F=>n(F.target.value),placeholder:"http://localhost:18011",className:t?"":"pl-24"}),!t&&o.jsx("div",{className:"absolute left-3 top-1/2 -translate-y-1/2 pointer-events-none",children:o.jsx(Je,{variant:"secondary",className:"h-6 bg-green-100 text-green-800 hover:bg-green-100",children:"PROXY MODE"})})]}),!1]}),o.jsx("p",{className:"text-sm text-muted-foreground",children:t?"The base URL of your VideoAnnotator API server (e.g., http://localhost:18011)":"Using built-in proxy to bypass CORS (Recommended for local dev)"})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsxs(Et,{htmlFor:"api-token",children:["API Token",y===!1&&o.jsx("span",{className:"text-muted-foreground",children:" (Optional)"}),y===!0&&o.jsx("span",{className:"text-destructive",children:" (Required)"}),y===null&&o.jsx("span",{className:"text-muted-foreground",children:" (Click Test Connection to check)"})]}),o.jsxs("div",{className:"relative",children:[o.jsx(Ia,{id:"api-token",type:l?"text":"password",value:s,onChange:F=>i(F.target.value),placeholder:y===!1?"Leave empty for anonymous access":y===!0?"va_xxxxxxxxxxxx (required by server)":"va_xxxxxxxxxxxx or leave empty",className:"pr-10"}),o.jsx(X,{type:"button",variant:"ghost",size:"sm",className:"absolute right-0 top-0 h-full px-3",onClick:()=>c(!l),children:l?o.jsx(wk,{className:"h-4 w-4"}):o.jsx(Bs,{className:"h-4 w-4"})})]}),s==="dev-token"&&o.jsxs(et,{className:"mt-2 bg-yellow-50 border-yellow-200",children:[o.jsx(Lt,{className:"h-4 w-4 text-yellow-600"}),o.jsx(an,{className:"text-yellow-900",children:"Invalid Token Configuration"}),o.jsxs(tt,{className:"text-yellow-800 space-y-3",children:[o.jsx("p",{children:'"dev-token" is a placeholder. You need to choose how to authenticate:'}),o.jsxs("div",{className:"space-y-3",children:[o.jsx("div",{className:"bg-white rounded-md p-3 border border-yellow-300",children:o.jsx("div",{className:"flex items-start gap-2",children:o.jsxs("div",{className:"flex-1",children:[o.jsx("p",{className:"font-semibold text-yellow-900 mb-1",children:"Option 1: No Authentication (Local Testing)"}),o.jsxs("p",{className:"text-xs mb-2",children:[y===null&&"Click 'Test Connection' to check if your server requires authentication.",y===!1&&"✅ Your server does not require authentication. Clear this field to connect.",y===!0&&"❌ Your server requires authentication. Use Option 2 instead."]}),o.jsx(X,{variant:"outline",size:"sm",onClick:()=>{i(""),x(!0)},className:"text-xs",disabled:y===!0,children:"Clear Token Field"})]})})}),o.jsx("div",{className:"bg-white rounded-md p-3 border border-yellow-300",children:o.jsx("div",{className:"flex items-start gap-2",children:o.jsxs("div",{className:"flex-1",children:[o.jsx("p",{className:"font-semibold text-yellow-900 mb-1",children:"Option 2: Use API Token (Production/Secure)"}),o.jsx("p",{className:"text-xs mb-2",children:'Get a token from your VideoAnnotator server. Tokens start with "va_" or are JWT format (starts with "eyJ").'}),o.jsxs("details",{className:"text-xs",children:[o.jsx("summary",{className:"cursor-pointer text-yellow-700 hover:text-yellow-900 font-medium",children:"How to get a token"}),o.jsxs("div",{className:"mt-2 space-y-1 text-yellow-800 bg-yellow-50 p-2 rounded",children:[o.jsxs("p",{children:["• ",o.jsx("strong",{children:"From server admin:"})," Ask your VideoAnnotator admin for an API key"]}),o.jsxs("p",{children:["• ",o.jsx("strong",{children:"Generate yourself:"})," In the ",o.jsx("em",{children:"backend"})," folder, run: ",o.jsx("code",{className:"bg-yellow-100 px-1 rounded",children:"uv run videoannotator generate-token"})]}),o.jsxs("p",{children:["• ",o.jsx("strong",{children:"Token format:"})," Should look like ",o.jsx("code",{className:"bg-yellow-100 px-1 rounded",children:"va_abc123xyz..."})]})]})]})]})})})]})]})]}),!s&&y===!1&&o.jsx("div",{className:"bg-green-50 border border-green-200 rounded-md p-3",children:o.jsxs("p",{className:"text-sm text-green-800",children:["✅ ",o.jsx("strong",{children:"No token set"})," - You'll connect anonymously (your server doesn't require authentication)"]})}),!s&&y===!0&&o.jsx("div",{className:"bg-yellow-50 border border-yellow-200 rounded-md p-3",children:o.jsxs("div",{className:"space-y-3",children:[o.jsxs("p",{className:"text-sm text-yellow-800 font-medium",children:["⚠️ ",o.jsx("strong",{children:"No token set"})," - Your server requires authentication."]}),o.jsxs("div",{className:"bg-white/60 border border-yellow-300 rounded p-2",children:[o.jsx("p",{className:"text-xs font-semibold text-yellow-900 mb-2",children:"How to get an API token:"}),o.jsxs("div",{className:"space-y-1 text-xs text-yellow-800",children:[o.jsxs("p",{children:["• ",o.jsx("strong",{children:"From server admin:"})," Ask your VideoAnnotator admin for an API key"]}),o.jsxs("p",{children:["• ",o.jsx("strong",{children:"Generate yourself:"})," In the ",o.jsx("em",{children:"backend"})," folder, run: ",o.jsx("code",{className:"bg-yellow-100 px-1 rounded",children:"uv run videoannotator generate-token"})]}),o.jsxs("p",{children:["• ",o.jsx("strong",{children:"Token format:"})," Should look like ",o.jsx("code",{className:"bg-yellow-100 px-1 rounded",children:"va_abc123xyz..."})]})]})]})]})}),!s&&y===null&&o.jsx("div",{className:"bg-blue-50 border border-blue-200 rounded-md p-3",children:o.jsxs("p",{className:"text-sm text-blue-800",children:["💡 ",o.jsx("strong",{children:"No token set"}),' - Click "Test Connection" to check if your server requires authentication.']})}),s.trim()&&m&&!m.isValid&&y===!0&&o.jsx("div",{className:"bg-yellow-50 border border-yellow-200 rounded-md p-3 mt-2",children:o.jsxs("div",{className:"space-y-3",children:[o.jsxs("p",{className:"text-sm text-yellow-800 font-medium",children:["💡 ",o.jsx("strong",{children:"Token invalid or authentication failed"})]}),o.jsxs("div",{className:"bg-white/60 border border-yellow-300 rounded p-2",children:[o.jsx("p",{className:"text-xs font-semibold text-yellow-900 mb-2",children:"How to get a valid API token:"}),o.jsxs("div",{className:"space-y-1 text-xs text-yellow-800",children:[o.jsxs("p",{children:["• ",o.jsx("strong",{children:"From server admin:"})," Ask your VideoAnnotator admin for an API key"]}),o.jsxs("p",{children:["• ",o.jsx("strong",{children:"Generate yourself:"})," In the ",o.jsx("em",{children:"backend"})," folder, run: ",o.jsx("code",{className:"bg-yellow-100 px-1 rounded",children:"uv run videoannotator generate-token"})]}),o.jsxs("p",{children:["• ",o.jsx("strong",{children:"Token format:"})," Should look like ",o.jsx("code",{className:"bg-yellow-100 px-1 rounded",children:"va_abc123xyz..."})]})]})]})]})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:'💡 Click "Test Connection" to verify your configuration'})]}),o.jsx(ir,{}),m&&o.jsx(et,{children:o.jsxs("div",{className:"flex items-start gap-2",children:[m.isValid?o.jsx(Kc,{className:"h-4 w-4 text-green-600 mt-0.5"}):o.jsx(Lt,{className:"h-4 w-4 text-red-600 mt-0.5"}),o.jsx("div",{className:"flex-1",children:o.jsx(tt,{children:m.isValid?o.jsxs("div",{className:"space-y-2",children:[o.jsx("p",{className:"font-medium text-green-700",children:"✅ Token is valid and working!"}),m.user&&o.jsxs("div",{children:["Authenticated as: ",o.jsx(Je,{variant:"secondary",children:m.user})]}),m.permissions&&m.permissions.length>0&&o.jsxs("div",{children:["Permissions: ",m.permissions.map(F=>o.jsx(Je,{variant:"outline",className:"mr-1",children:F},F))]}),m.expiresAt&&o.jsxs("p",{className:"text-sm text-muted-foreground",children:["Expires: ",new Date(m.expiresAt).toLocaleString()]}),v&&o.jsx("div",{className:"bg-green-50 border border-green-200 rounded p-2 mt-2",children:o.jsxs("p",{className:"text-sm text-green-800 font-medium",children:["⚠️ ",o.jsx("strong",{children:'Remember to click "Save Configuration"'})," below to apply this token!"]})})]}):o.jsxs("div",{className:"space-y-3",children:[o.jsxs("p",{className:"font-medium text-red-700",children:["❌ ",m.error]}),!s&&y===!0&&o.jsxs("div",{className:"bg-red-50 border border-red-200 rounded-md p-3 mt-2",children:[o.jsx("p",{className:"text-sm font-semibold text-red-900 mb-2",children:"How to get an API token:"}),o.jsxs("div",{className:"space-y-1 text-xs text-red-800",children:[o.jsxs("p",{children:["• ",o.jsx("strong",{children:"From server admin:"})," Ask your VideoAnnotator admin for an API key"]}),o.jsxs("p",{children:["• ",o.jsx("strong",{children:"Generate yourself:"})," In the ",o.jsx("em",{children:"backend"})," folder, run: ",o.jsx("code",{className:"bg-red-100 px-1 rounded",children:"uv run videoannotator generate-token"})]}),o.jsxs("p",{children:["• ",o.jsx("strong",{children:"Token format:"})," Should look like ",o.jsx("code",{className:"bg-red-100 px-1 rounded",children:"va_abc123xyz..."})]})]})]})]})})})]})}),w&&o.jsxs(et,{className:w.summary==="all_passed"?"border-green-500":"border-yellow-500",children:[o.jsx(Rv,{className:"h-4 w-4"}),o.jsx(an,{children:"Connection Diagnostics"}),o.jsx(tt,{children:o.jsxs("div",{className:"space-y-3 mt-2",children:[o.jsxs("div",{className:"text-sm",children:["Status: ",o.jsx(Je,{variant:w.summary==="all_passed"?"default":"destructive",children:w.summary.replace("_"," ").toUpperCase()})]}),o.jsx("div",{className:"space-y-1",children:w.results.map((F,L)=>o.jsxs("div",{className:"text-sm flex items-start gap-2",children:[o.jsx("span",{children:F.passed?"✅":"❌"}),o.jsxs("span",{className:"flex-1",children:[o.jsx("strong",{children:F.test}),F.duration&&o.jsxs("span",{className:"text-muted-foreground",children:[" (",Math.round(F.duration),"ms)"]}),F.error&&o.jsx("div",{className:"text-red-600 text-xs mt-1",children:F.error})]})]},L))}),w.recommendations.length>0&&o.jsxs("div",{className:"bg-yellow-50 border border-yellow-200 rounded p-3 mt-2",children:[o.jsx("p",{className:"text-sm font-semibold text-yellow-900 mb-2",children:"Recommendations:"}),o.jsx("ul",{className:"text-xs text-yellow-800 space-y-1",children:w.recommendations.map((F,L)=>o.jsxs("li",{children:["• ",F]},L))})]}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"Report copied to clipboard. Share with support if needed."})]})})]}),o.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[o.jsx(X,{onClick:T,disabled:u,variant:"outline",children:u?"Testing...":"Test Connection"}),o.jsxs(X,{onClick:M,disabled:S,variant:"outline",className:"text-blue-600 hover:text-blue-700",children:[o.jsx(Rv,{className:"h-4 w-4 mr-2"}),S?"Running...":"Run Diagnostics"]}),o.jsx(X,{onClick:_,variant:"outline",className:"text-orange-600 hover:text-orange-700",title:"Reset to: URL=http://localhost:18011, Token=va__-uN6rm1rwDdx7ksAGj1b-xndPfUCwbJHAcl7p00sbs",children:"Reset to Defaults"}),o.jsx(X,{onClick:I,disabled:!t.trim(),children:"Save Configuration"}),v&&o.jsx(Je,{variant:"secondary",children:"Unsaved changes"})]}),o.jsx(ir,{}),o.jsxs("div",{className:"space-y-3",children:[o.jsx("h4",{className:"font-medium",children:"Need help getting your token?"}),o.jsxs("div",{className:"text-sm text-muted-foreground space-y-2",children:[o.jsx("p",{children:"1. Contact your VideoAnnotator server administrator"}),o.jsx("p",{children:"2. Or check the server documentation for token generation"}),o.jsxs("p",{children:["3. For development, use the default token: ",o.jsx("code",{className:"bg-muted px-1 rounded",children:"dev-token"})]})]}),o.jsx(X,{variant:"link",size:"sm",className:"pl-0",asChild:!0,children:o.jsxs("a",{href:"https://github.com/InfantLab/VideoAnnotator/blob/master/docs/CLIENT_TOKEN_SETUP_GUIDE.md",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1",children:["View Token Setup Guide ",o.jsx(Is,{className:"h-3 w-3"})]})})]})]})]})]})}function aM(e){if(e<60)return`${e} second${e!==1?"s":""}`;const t=Math.floor(e/60);if(t<60)return`${t} minute${t!==1?"s":""}`;const n=Math.floor(t/60),s=t%60;if(n<24)return s===0?`${n} hour${n!==1?"s":""}`:`${n} hour${n!==1?"s":""}, ${s} minute${s!==1?"s":""}`;const i=Math.floor(n/24),l=n%24;return l===0?`${i} day${i!==1?"s":""}`:`${i} day${i!==1?"s":""}, ${l} hour${l!==1?"s":""}`}function iM(e,t){const n=["B","KB","MB","GB","TB"],s=l=>{if(l===0)return"0 B";const c=Math.floor(Math.log(l)/Math.log(1024));return`${(l/Math.pow(1024,c)).toFixed(c>0?1:0)} ${n[c]}`},i=t>0?Math.round(e/t*100):0;return{used:s(e),total:s(t),percentage:i}}function lM(e){switch(e){case"idle":return"text-green-600 dark:text-green-400";case"busy":return"text-yellow-600 dark:text-yellow-400";case"overloaded":return"text-red-600 dark:text-red-400";default:return"text-gray-600 dark:text-gray-400"}}function ny(e){switch(e){case"healthy":return"text-green-600 dark:text-green-400";case"degraded":return"text-yellow-600 dark:text-yellow-400";case"unhealthy":return"text-red-600 dark:text-red-400";default:return"text-gray-600 dark:text-gray-400"}}function cM({className:e,defaultOpen:t=!0}){const[n,s]=g.useState(t),[i,l]=g.useState(Date.now()),{data:c,isLoading:u,error:f,refetch:m,isFetching:p}=Zr({queryKey:["server-health"],queryFn:async()=>{const w=await Ge.getEnhancedHealth();return l(Date.now()),w},refetchInterval:n?3e4:!1,enabled:!0,refetchOnMount:n}),[v,x]=g.useState(!1);g.useEffect(()=>{if(!n){x(!1);return}const w=()=>{const S=Date.now()-i;x(S>12e4)};w();const C=setInterval(w,1e4);return()=>clearInterval(C)},[i,n]),g.useEffect(()=>{n&&m()},[n,m]);const y=()=>{m()},E=({status:w})=>{switch(w){case"healthy":return o.jsx(Nr,{className:"h-4 w-4 text-green-600 dark:text-green-400"});case"degraded":return o.jsx(Hn,{className:"h-4 w-4 text-yellow-600 dark:text-yellow-400"});case"unhealthy":return o.jsx(da,{className:"h-4 w-4 text-red-600 dark:text-red-400"});default:return o.jsx(io,{className:"h-4 w-4 text-gray-600 dark:text-gray-400"})}};return o.jsx(Qe,{className:e,children:o.jsxs(j1,{open:n,onOpenChange:s,children:[o.jsx(Nt,{className:"pb-3",children:o.jsx("div",{className:"flex items-center justify-between",children:o.jsx(N1,{asChild:!0,children:o.jsxs(X,{variant:"ghost",className:"w-full justify-between p-0 hover:bg-transparent",children:[o.jsxs(kt,{className:"flex items-center gap-2 text-lg",children:[o.jsx(io,{className:"h-5 w-5"}),"Server Diagnostics",c&&o.jsx(Je,{variant:c.status==="healthy"?"default":"destructive",className:"ml-2",children:c.status})]}),n?o.jsx(p0,{className:"h-4 w-4"}):o.jsx(Jr,{className:"h-4 w-4"})]})})})}),o.jsx(k1,{children:o.jsxs(yt,{className:"space-y-4",children:[v&&!p&&o.jsxs(et,{variant:"default",className:"border-yellow-500 dark:border-yellow-400",children:[o.jsx(Hn,{className:"h-4 w-4 text-yellow-600 dark:text-yellow-400"}),o.jsxs(tt,{children:["Data may be stale. Last updated ",Math.floor((Date.now()-i)/6e4)," minutes ago."]})]}),u&&o.jsxs("div",{className:"flex items-center justify-center py-8 text-muted-foreground",children:[o.jsx(Yn,{className:"mr-2 h-4 w-4 animate-spin"}),"Loading server diagnostics..."]}),f&&o.jsxs("div",{className:"space-y-3",children:[o.jsxs(et,{variant:"destructive",children:[o.jsx(da,{className:"h-4 w-4"}),o.jsxs(tt,{children:[o.jsx("div",{className:"font-semibold mb-2",children:"Cannot connect to server"}),o.jsx("div",{className:"text-sm space-y-2",children:f.message?.includes("CORS")||f.message?.includes("fetch")?o.jsxs(o.Fragment,{children:[o.jsx("p",{children:"Unable to reach the VideoAnnotator server at:"}),o.jsx("code",{className:"block bg-destructive/20 px-2 py-1 rounded text-xs",children:localStorage.getItem("videoannotator_api_url")||"http://localhost:18011"}),o.jsxs("div",{className:"pt-2",children:[o.jsx("p",{className:"font-medium mb-1",children:"Quick fixes:"}),o.jsxs("ul",{className:"list-disc list-inside space-y-1 text-xs",children:[o.jsx("li",{children:"Make sure the VideoAnnotator server is running"}),o.jsx("li",{children:"Check the API URL in Settings matches your server"}),o.jsx("li",{children:"Try visiting the server URL in your browser to test it"})]})]})]}):o.jsxs(o.Fragment,{children:[o.jsx("p",{children:f.message||"An unexpected error occurred"}),o.jsx("p",{className:"mt-2",children:"Check that the server is running and accessible."})]})})]})]}),o.jsx(X,{onClick:y,variant:"outline",size:"sm",disabled:p,className:"w-full",children:p?o.jsxs(o.Fragment,{children:[o.jsx(Yn,{className:"mr-2 h-4 w-4 animate-spin"}),"Retrying..."]}):o.jsxs(o.Fragment,{children:[o.jsx(Yn,{className:"mr-2 h-4 w-4"}),"Retry Connection"]})})]}),c&&!u&&o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[o.jsxs("div",{children:[o.jsx("div",{className:"text-sm font-medium text-muted-foreground",children:"Version"}),o.jsx("div",{className:"text-lg font-semibold",children:c.version||c.api_version||c.videoannotator_version||"Unknown"})]}),c.uptime_seconds!==void 0&&o.jsxs("div",{children:[o.jsx("div",{className:"text-sm font-medium text-muted-foreground",children:"Uptime"}),o.jsxs("div",{className:"flex items-center gap-2 text-lg",children:[o.jsx(yk,{className:"h-4 w-4"}),aM(c.uptime_seconds)]})]})]}),o.jsx(ir,{}),c.gpu_status&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{children:[o.jsxs("div",{className:"mb-2 flex items-center gap-2 text-sm font-medium",children:[o.jsx(Ih,{className:"h-4 w-4"}),"GPU Status"]}),c.gpu_status.available?o.jsxs("div",{className:"space-y-2 rounded-md border p-3",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("span",{className:"text-sm text-muted-foreground",children:"Device"}),o.jsx("span",{className:"text-sm font-medium",children:c.gpu_status.device_name||"Unknown"})]}),c.gpu_status.cuda_version&&o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("span",{className:"text-sm text-muted-foreground",children:"CUDA Version"}),o.jsxs("span",{className:"text-sm font-medium",children:["CUDA ",c.gpu_status.cuda_version]})]}),c.gpu_status.memory_total!==void 0&&c.gpu_status.memory_used!==void 0&&o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("span",{className:"text-sm text-muted-foreground",children:"Memory"}),o.jsx("span",{className:"text-sm font-medium",children:(()=>{const w=iM(c.gpu_status.memory_used,c.gpu_status.memory_total);return`${w.used} / ${w.total} (${w.percentage}%)`})()})]})]}):o.jsx("div",{className:"rounded-md border border-dashed p-3 text-center text-sm text-muted-foreground",children:"GPU not available"})]}),o.jsx(ir,{})]}),c.worker_info&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{children:[o.jsx("div",{className:"mb-2 text-sm font-medium",children:"Worker Status"}),o.jsxs("div",{className:"space-y-2 rounded-md border p-3",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("span",{className:"text-sm text-muted-foreground",children:"Status"}),o.jsx(Je,{variant:"outline",className:lM(c.worker_info.worker_status),children:c.worker_info.worker_status})]}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("span",{className:"text-sm text-muted-foreground",children:"Active Jobs"}),o.jsx("span",{className:"text-sm font-medium",children:c.worker_info.active_jobs})]}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("span",{className:"text-sm text-muted-foreground",children:"Queued Jobs"}),o.jsx("span",{className:"text-sm font-medium",children:c.worker_info.queued_jobs})]}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("span",{className:"text-sm text-muted-foreground",children:"Max Concurrent"}),o.jsx("span",{className:"text-sm font-medium",children:c.worker_info.max_concurrent_jobs})]})]})]}),o.jsx(ir,{})]}),c.diagnostics&&o.jsxs("div",{children:[o.jsx("div",{className:"mb-2 text-sm font-medium",children:"System Diagnostics"}),o.jsxs("div",{className:"space-y-2",children:[c.diagnostics.database&&o.jsxs("div",{className:"rounded-md border p-3",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Cm,{className:"h-4 w-4"}),o.jsx("span",{className:"text-sm font-medium",children:"Database"})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(E,{status:c.diagnostics.database.status}),o.jsx("span",{className:`text-sm ${ny(c.diagnostics.database.status)}`,children:c.diagnostics.database.status})]})]}),c.diagnostics.database.message&&o.jsx("div",{className:"mt-2 text-xs text-muted-foreground",children:c.diagnostics.database.message})]}),c.diagnostics.storage&&o.jsxs("div",{className:"rounded-md border p-3",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Ek,{className:"h-4 w-4"}),o.jsx("span",{className:"text-sm font-medium",children:"Storage"})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(E,{status:c.diagnostics.storage.status}),o.jsx("span",{className:`text-sm ${ny(c.diagnostics.storage.status)}`,children:c.diagnostics.storage.status}),c.diagnostics.storage.disk_usage_percent!==void 0&&o.jsxs(Je,{variant:"outline",className:"ml-2",children:[c.diagnostics.storage.disk_usage_percent,"% used"]})]})]}),c.diagnostics.storage.message&&o.jsx("div",{className:"mt-2 text-xs text-muted-foreground",children:c.diagnostics.storage.message})]}),c.diagnostics.ffmpeg&&o.jsxs("div",{className:"flex items-center justify-between rounded-md border p-3",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(io,{className:"h-4 w-4"}),o.jsx("span",{className:"text-sm font-medium",children:"FFmpeg"})]}),o.jsx("div",{className:"flex items-center gap-2",children:c.diagnostics.ffmpeg.available?o.jsxs(o.Fragment,{children:[o.jsx(Nr,{className:"h-4 w-4 text-green-600 dark:text-green-400"}),c.diagnostics.ffmpeg.version&&o.jsxs("span",{className:"text-sm text-muted-foreground",children:["v",c.diagnostics.ffmpeg.version]})]}):o.jsxs(o.Fragment,{children:[o.jsx(da,{className:"h-4 w-4 text-red-600 dark:text-red-400"}),o.jsx("span",{className:"text-sm text-red-600 dark:text-red-400",children:"Not available"})]})})]})]})]}),o.jsxs("div",{className:"flex items-center justify-between pt-2",children:[o.jsx("div",{className:"text-xs text-muted-foreground",children:p?o.jsxs("span",{className:"flex items-center gap-1",children:[o.jsx(Yn,{className:"h-3 w-3 animate-spin"}),"Refreshing..."]}):`Last updated: ${new Date(i).toLocaleTimeString()}`}),o.jsxs(X,{variant:"outline",size:"sm",onClick:y,disabled:p,className:"h-8",children:[o.jsx(Yn,{className:`mr-2 h-3 w-3 ${p?"animate-spin":""}`}),"Refresh Now"]})]})]})]})})]})})}function B1(e={}){const{enabled:t=!1}=e;return Zr({queryKey:["system","health"],queryFn:()=>Ge.getSystemHealth(),enabled:t,refetchInterval:t?3e4:!1,staleTime:15e3,retry:2})}function dM(){const[e,t]=g.useState(!1),{data:n,isLoading:s,error:i}=B1();if(s)return o.jsxs(Qe,{children:[o.jsx(Nt,{children:o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsxs(kt,{className:"flex items-center gap-2",children:[o.jsx(Ih,{className:"h-5 w-5"}),"Server GPU Information"]}),o.jsx(Kr,{children:"Hardware acceleration status"})]}),o.jsxs(X,{variant:"ghost",size:"sm",onClick:()=>t(!e),className:"gap-1",children:[e?o.jsx(Jr,{className:"h-4 w-4"}):o.jsx(Aa,{className:"h-4 w-4"}),e?"Collapse":"Expand"]})]})}),e&&o.jsx(yt,{children:o.jsx(or,{className:"h-20 w-full"})})]});if(i||!n)return null;const l=n.gpu,c=l?.available===!0,u=l?.device_name||"Unknown GPU",f=l?.device_count||0,m=!!l?.compatibility_warning;let p,v,x;return c?m?(p="warning",v=o.jsx(Hn,{className:"h-4 w-4"}),x="secondary"):(p="working",v=o.jsx(Nr,{className:"h-4 w-4"}),x="secondary"):(p="unavailable",v=o.jsx(da,{className:"h-4 w-4"}),x="outline"),o.jsxs(Qe,{children:[o.jsx(Nt,{children:o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsxs(kt,{className:"flex items-center gap-2",children:[o.jsx(Ih,{className:"h-5 w-5"}),"Server GPU Information"]}),o.jsx(Kr,{children:"Hardware acceleration status for video processing"})]}),o.jsxs(X,{variant:"ghost",size:"sm",onClick:()=>t(!e),className:"gap-1",children:[e?o.jsx(Jr,{className:"h-4 w-4"}):o.jsx(Aa,{className:"h-4 w-4"}),e?"Collapse":"Expand"]})]})}),e&&o.jsxs(yt,{className:"space-y-4",children:[o.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[o.jsxs("div",{children:[o.jsx("p",{className:"font-medium text-sm",children:"Status"}),o.jsx("div",{className:"mt-1 flex items-center gap-2",children:o.jsxs(Je,{variant:x,className:"gap-1",children:[v,p==="working"?"Active":p==="warning"?"Warning":"Unavailable"]})})]}),c&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{children:[o.jsx("p",{className:"font-medium text-sm",children:"Device Name"}),o.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:u})]}),o.jsxs("div",{children:[o.jsx("p",{className:"font-medium text-sm",children:"Device Count"}),o.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:f})]}),o.jsxs("div",{children:[o.jsx("p",{className:"font-medium text-sm",children:"Current Device"}),o.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:l?.current_device!==void 0?`Device ${l.current_device}`:"N/A"})]}),l?.compute_capability!==void 0&&o.jsxs("div",{children:[o.jsx("p",{className:"font-medium text-sm",children:"Compute Capability"}),o.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:l.compute_capability})]}),l?.pytorch_version&&o.jsxs("div",{children:[o.jsx("p",{className:"font-medium text-sm",children:"PyTorch Version"}),o.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:l.pytorch_version})]}),(l?.memory_allocated!==void 0||l?.memory_reserved!==void 0)&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{children:[o.jsx("p",{className:"font-medium text-sm",children:"Memory Allocated"}),o.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:l?.memory_allocated?`${(l.memory_allocated/1024/1024/1024).toFixed(2)} GB`:"0 GB"})]}),o.jsxs("div",{children:[o.jsx("p",{className:"font-medium text-sm",children:"Memory Reserved"}),o.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:l?.memory_reserved?`${(l.memory_reserved/1024/1024/1024).toFixed(2)} GB`:"0 GB"})]})]})]})]}),m&&l?.compatibility_warning&&o.jsxs(et,{children:[o.jsx(Hn,{className:"h-4 w-4"}),o.jsx(an,{children:"GPU Compatibility Warning"}),o.jsxs(tt,{className:"space-y-2",children:[o.jsx("p",{children:l.compatibility_warning}),l.min_compute_capability&&o.jsxs("p",{className:"text-xs",children:["Minimum compute capability required: ",l.min_compute_capability,l.compute_capability&&` (your GPU: ${l.compute_capability})`]}),o.jsx("p",{className:"text-xs font-medium",children:"Processing will automatically fall back to CPU. Consider downgrading PyTorch or upgrading your GPU for better performance."})]})]}),!c&&o.jsx(et,{children:o.jsx(tt,{children:"No GPU detected. Video processing will use CPU, which may be slower for large files or complex pipelines. For best performance, ensure the server has a compatible NVIDIA GPU with CUDA support."})}),c&&!m&&l?.memory_allocated===0&&l?.memory_reserved===0&&o.jsxs(et,{children:[o.jsx(Hn,{className:"h-4 w-4"}),o.jsx(an,{children:"GPU Not Currently Active"}),o.jsx(tt,{children:"A GPU is available but no memory is currently allocated. The GPU will be activated when processing jobs. If you experience issues, check the server logs for GPU initialization errors."})]})]})]})}function uM(){const[e,t]=g.useState(!1),{data:n,isLoading:s,error:i}=B1();if(s)return o.jsxs(Qe,{children:[o.jsx(Nt,{children:o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsxs(kt,{className:"flex items-center gap-2",children:[o.jsx(Mi,{className:"h-5 w-5"}),"Worker Information"]}),o.jsx(Kr,{children:"Job processing worker status"})]}),o.jsxs(X,{variant:"ghost",size:"sm",onClick:()=>t(!e),className:"gap-1",children:[e?o.jsx(Jr,{className:"h-4 w-4"}):o.jsx(Aa,{className:"h-4 w-4"}),e?"Collapse":"Expand"]})]})}),e&&o.jsx(yt,{children:o.jsx(or,{className:"h-20 w-full"})})]});if(i||!n||!n.workers)return null;const l=n.workers,c=l.status.toLowerCase();let u,f,m;c==="running"||c==="active"?(u=o.jsx(Nr,{className:"h-4 w-4"}),f="secondary",m="Running"):c==="stopped"||c==="idle"?(u=o.jsx(da,{className:"h-4 w-4"}),f="outline",m="Stopped"):c==="overloaded"||c==="busy"?(u=o.jsx(Hn,{className:"h-4 w-4"}),f="destructive",m="Overloaded"):(u=o.jsx(Hn,{className:"h-4 w-4"}),f="secondary",m=l.status);const p=l.active_jobs>0,v=l.active_jobs>=l.max_concurrent_workers&&l.queued_jobs>0;return o.jsxs(Qe,{children:[o.jsx(Nt,{children:o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsxs(kt,{className:"flex items-center gap-2",children:[o.jsx(Mi,{className:"h-5 w-5"}),"Worker Information"]}),o.jsx(Kr,{children:"Job processing worker status"})]}),o.jsxs(X,{variant:"ghost",size:"sm",onClick:()=>t(!e),className:"gap-1",children:[e?o.jsx(Jr,{className:"h-4 w-4"}):o.jsx(Aa,{className:"h-4 w-4"}),e?"Collapse":"Expand"]})]})}),e&&o.jsxs(yt,{className:"space-y-4",children:[o.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[o.jsxs("div",{children:[o.jsx("p",{className:"font-medium text-sm",children:"Status"}),o.jsx("div",{className:"mt-1 flex items-center gap-2",children:o.jsxs(Je,{variant:f,className:"gap-1",children:[u,m]})})]}),o.jsxs("div",{children:[o.jsx("p",{className:"font-medium text-sm",children:"Active Jobs"}),o.jsxs("p",{className:"text-sm text-muted-foreground mt-1",children:[l.active_jobs," / ",l.max_concurrent_workers," slots"]})]}),o.jsxs("div",{children:[o.jsx("p",{className:"font-medium text-sm",children:"Queued Jobs"}),o.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:l.queued_jobs})]}),o.jsxs("div",{children:[o.jsx("p",{className:"font-medium text-sm",children:"Max Concurrent Workers"}),o.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:l.max_concurrent_workers})]}),o.jsxs("div",{children:[o.jsx("p",{className:"font-medium text-sm",children:"Poll Interval"}),o.jsxs("p",{className:"text-sm text-muted-foreground mt-1",children:[l.poll_interval_seconds,"s"]})]}),l.processing_jobs.length>0&&o.jsxs("div",{className:"md:col-span-2",children:[o.jsx("p",{className:"font-medium text-sm",children:"Processing Jobs"}),o.jsx("div",{className:"mt-1 flex flex-wrap gap-1",children:l.processing_jobs.map(x=>o.jsx(Je,{variant:"secondary",className:"text-[10px] px-1.5 py-0",children:x},x))})]})]}),v&&o.jsxs(et,{children:[o.jsx(Hn,{className:"h-4 w-4"}),o.jsxs(tt,{children:["Workers are at maximum capacity (",l.active_jobs,"/",l.max_concurrent_workers,") with ",l.queued_jobs," job",l.queued_jobs!==1?"s":""," queued. New jobs will be queued until workers become available."]})]}),!p&&c==="stopped"&&o.jsx(et,{children:o.jsx(tt,{children:"Workers are currently stopped. Jobs will not be processed until workers are started. Check server configuration or restart the worker service."})}),p&&!v&&o.jsxs(et,{children:[o.jsx(Nr,{className:"h-4 w-4"}),o.jsxs(tt,{children:["Workers are processing ",l.active_jobs," job",l.active_jobs!==1?"s":"",".",l.queued_jobs>0&&` ${l.queued_jobs} job${l.queued_jobs!==1?"s are":" is"} queued.`]})]})]})]})}const ry="videoannotator_api_token",Fc="videoannotator_api_url",fM={pipelineCatalog:"Pipeline Catalog",pipelineSchemas:"Parameter Schemas",pipelineHealth:"Pipeline Health",jobSSE:"Job SSE",artifactListing:"Artifact Listing"},hM=()=>{const[e,t]=g.useState(()=>localStorage.getItem(Fc)||""),[n,s]=g.useState(!1),[i,l]=g.useState(!1),c=gb(),{data:u,isLoading:f,error:m}=_F(),{data:p,isLoading:v,error:x}=u1({enabled:!1}),y=f1(),E=RF();g.useEffect(()=>{const D=F=>{!F.key||F.key!==Fc&&F.key!==ry||t(localStorage.getItem(Fc)||"")};return window.addEventListener("storage",D),()=>{window.removeEventListener("storage",D)}},[]);const w=g.useMemo(()=>p?.server?p.server:u||null,[p,u]),C=w?.features||{},S=p?.catalog.pipelines.length??0,N=g.useMemo(()=>{if(!p?.catalog.pipelines?.length)return[];const D=new Map;return p.catalog.pipelines.forEach(F=>{const L=F.group||"Other",J=D.get(L)??[];J.push(F),D.set(L,J)}),Array.from(D.entries()).map(([F,L])=>({group:F,pipelines:L.slice().sort((J,W)=>J.name.localeCompare(W.name))})).sort((F,L)=>F.group.localeCompare(L.group))},[p]),j=g.useMemo(()=>{const D=p?.catalog.generatedAt||w?.lastUpdated;if(!D)return null;try{return ME(new Date(D),{addSuffix:!0})}catch(F){return console.warn("Unable to format catalog timestamp:",F),null}},[p,w]),I=async()=>{s(!0);try{await y({forceServerRefresh:!0}),c.refresh(),t(localStorage.getItem(Fc)||"")}finally{s(!1)}},_=async()=>{l(!0);try{await E(),await y({forceServerRefresh:!0})}finally{l(!1)}},T=c.isValid?"secondary":c.error?"destructive":"outline",M=c.isLoading?"Checking…":c.isValid?"Token Valid":c.error?"Token Error":"Not Validated";return o.jsxs("div",{className:"container mx-auto px-6 py-8 max-w-5xl space-y-6",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("img",{src:dl,alt:"VideoAnnotator",className:"h-8 w-8"}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(uo,{className:"h-6 w-6"}),o.jsx("h2",{className:"text-2xl font-semibold",children:"Settings"})]})]}),o.jsxs(dC,{defaultValue:"api",className:"space-y-4",children:[o.jsxs(cp,{children:[o.jsxs(Cr,{value:"api",className:"flex items-center gap-2",children:[o.jsx(jk,{className:"h-4 w-4"}),"API Configuration"]}),o.jsxs(Cr,{value:"server",className:"flex items-center gap-2",children:[o.jsx(io,{className:"h-4 w-4"}),"Server Info"]}),o.jsxs(Cr,{value:"help",className:"flex items-center gap-2",children:[o.jsx(g0,{className:"h-4 w-4"}),"Help"]})]}),o.jsx(Er,{value:"api",children:o.jsx(oM,{})}),o.jsxs(Er,{value:"server",className:"space-y-4",children:[(m||x||c.error&&!c.isLoading)&&o.jsx(jo,{error:Zt(x||m||c.error||"Server diagnostics issue")}),o.jsxs(Qe,{children:[o.jsx(Nt,{children:o.jsxs("div",{className:"flex flex-col gap-3 md:flex-row md:items-start md:justify-between",children:[o.jsxs("div",{children:[o.jsx(kt,{children:"Server Integration Status"}),o.jsx(Kr,{children:"Live VideoAnnotator connection and pipeline capabilities"})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsxs(X,{variant:"outline",size:"sm",onClick:_,disabled:i||v,className:"gap-1",children:[i?o.jsx(yn,{className:"h-4 w-4 animate-spin"}):o.jsx(w0,{className:"h-4 w-4"}),"Clear Cache"]}),o.jsxs(X,{size:"sm",onClick:I,disabled:n,className:"gap-1",children:[n?o.jsx(yn,{className:"h-4 w-4 animate-spin"}):o.jsx(Yn,{className:"h-4 w-4"}),"Refresh"]})]})]})}),o.jsxs(yt,{className:"space-y-4",children:[o.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[o.jsxs("div",{children:[o.jsx("p",{className:"font-medium text-sm",children:"Server URL"}),v&&f?o.jsx(or,{className:"mt-1 h-4 w-40"}):o.jsx("p",{className:"text-sm text-muted-foreground break-all",children:e})]}),o.jsxs("div",{children:[o.jsx("p",{className:"font-medium text-sm",children:"Token Status"}),o.jsxs("div",{className:"mt-1 flex items-center gap-2",children:[o.jsx(Je,{variant:T,children:M}),c.user&&!c.isLoading&&o.jsx("span",{className:"text-xs text-muted-foreground",children:c.user})]})]}),o.jsxs("div",{children:[o.jsx("p",{className:"font-medium text-sm",children:"Server Version"}),f&&!w?o.jsx(or,{className:"mt-1 h-4 w-24"}):o.jsx("p",{className:"text-sm text-muted-foreground",children:w?.version||"Unknown"})]}),o.jsxs("div",{children:[o.jsx("p",{className:"font-medium text-sm",children:"Pipelines Detected"}),v?o.jsx(or,{className:"mt-1 h-4 w-16"}):o.jsxs("div",{className:"mt-1 flex items-center gap-2",children:[o.jsxs(Je,{variant:"secondary",className:"gap-1",children:[o.jsx(Cm,{className:"h-3.5 w-3.5"})," ",S]}),j&&o.jsxs("span",{className:"text-xs text-muted-foreground",children:["Updated ",j]})]})]})]}),o.jsxs("div",{children:[o.jsx("p",{className:"font-medium text-sm mb-2",children:"Server Features"}),o.jsx("div",{className:"flex flex-wrap gap-2",children:Object.entries(fM).map(([D,F])=>{const L=C[D]??!1;return o.jsx(Je,{variant:L?"secondary":"outline",className:"text-xs",children:F},D)})})]}),o.jsx(ir,{}),o.jsxs("div",{children:[o.jsx("p",{className:"font-medium text-sm mb-3",children:"Pipeline Catalog Overview"}),v?o.jsxs("div",{className:"space-y-2",children:[o.jsx(or,{className:"h-5 w-32"}),o.jsx(or,{className:"h-20 w-full"}),o.jsx(or,{className:"h-20 w-full"})]}):N.length===0?o.jsx("p",{className:"text-sm text-muted-foreground",children:"No pipelines detected. Refresh once the server is online."}):o.jsx("div",{className:"space-y-4",children:N.map(({group:D,pipelines:F})=>o.jsxs("div",{className:"space-y-2",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("h4",{className:"text-sm font-semibold",children:D}),o.jsxs(Je,{variant:"outline",className:"text-xs",children:[F.length," pipelines"]})]}),o.jsx("div",{className:"space-y-1.5",children:F.map(L=>o.jsx("div",{className:"rounded-md border bg-muted/40 p-3",children:o.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-2",children:[o.jsxs("div",{children:[o.jsx("p",{className:"text-sm font-medium",children:L.name}),L.description&&o.jsx("p",{className:"text-xs text-muted-foreground",children:L.description})]}),o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[L.version&&o.jsxs(Je,{variant:"secondary",className:"text-[10px]",children:["v",L.version]}),L.model&&o.jsx(Je,{variant:"outline",className:"text-[10px]",children:L.model})]})]})},L.id))})]},D))})]})]})]}),o.jsx(cM,{className:"mt-6",defaultOpen:!1}),o.jsx(dM,{}),o.jsx(uM,{}),o.jsxs(Qe,{children:[o.jsxs(Nt,{children:[o.jsx(kt,{children:"Server Debugging Tools"}),o.jsx(Kr,{children:"Use these tools to test your server connection and debug API issues"})]}),o.jsx(yt,{children:o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[o.jsxs("div",{children:[o.jsx("p",{className:"font-medium",children:"Server URL"}),o.jsx("p",{className:"text-muted-foreground break-all",children:e})]}),o.jsxs("div",{children:[o.jsx("p",{className:"font-medium",children:"Token"}),o.jsx("p",{className:"text-muted-foreground break-all",children:localStorage.getItem(ry)?"Configured":"Not configured"})]})]}),o.jsxs("div",{className:"p-3 bg-muted rounded-md",children:[o.jsx("p",{className:"font-mono text-sm",children:"python scripts/test_api_quick.py"}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Comprehensive API endpoint testing"})]}),o.jsxs("div",{className:"p-3 bg-muted rounded-md",children:[o.jsx("p",{className:"font-mono text-sm",children:"VideoAnnotatorDebug.runAllTests()"}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Browser console debugging suite (paste in browser dev tools)"})]}),o.jsxs("div",{className:"pt-3 border-t",children:[o.jsx("h4",{className:"font-medium text-sm mb-2",children:"API Documentation"}),o.jsx(X,{variant:"link",className:"pl-0 h-auto",asChild:!0,children:o.jsxs("a",{href:`${e}/docs`,target:"_blank",rel:"noopener noreferrer",className:"text-sm",children:["📖 Open Interactive API Docs (",e,"/docs)"]})})]})]})})]})]}),o.jsx(Er,{value:"help",className:"space-y-4",children:o.jsxs(Qe,{children:[o.jsxs(Nt,{children:[o.jsx(kt,{children:"Getting Help"}),o.jsx(Kr,{children:"Resources and support for VideoAnnotator configuration"})]}),o.jsx(yt,{className:"space-y-4",children:o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{children:[o.jsx("h4",{className:"font-medium",children:"Common Issues"}),o.jsxs("ul",{className:"list-disc list-inside space-y-1 text-sm text-muted-foreground mt-2",children:[o.jsx("li",{children:"Token authentication errors: Check your token is valid and not expired"}),o.jsx("li",{children:"Connection refused: Ensure VideoAnnotator server is running"}),o.jsx("li",{children:"404 errors: Server may not have all endpoints implemented yet"}),o.jsx("li",{children:"CORS issues: Check server allows requests from this domain"})]})]}),o.jsxs("div",{children:[o.jsx("h4",{className:"font-medium",children:"Getting Your Token"}),o.jsxs("ol",{className:"list-decimal list-inside space-y-1 text-sm text-muted-foreground mt-2",children:[o.jsx("li",{children:"Contact your VideoAnnotator server administrator"}),o.jsxs("li",{children:["For development, use the default token:",o.jsx("code",{className:"bg-muted px-1 rounded",children:"dev-token"})]}),o.jsx("li",{children:"Check server documentation for token generation instructions"})]})]}),o.jsx("div",{className:"pt-4 border-t",children:o.jsx(X,{variant:"link",className:"pl-0",asChild:!0,children:o.jsx("a",{href:"https://github.com/InfantLab/VideoAnnotator/blob/master/docs/CLIENT_TOKEN_SETUP_GUIDE.md",target:"_blank",rel:"noopener noreferrer",children:"📖 View Complete Token Setup Guide"})})})]})})]})})]})]})},lo=4294967295,br=65535,hm=255,mM=8,sy=9,pM=0,gM=99,AM=67324752,_1=134695760,vM=_1,oy=33639248,xM=101010256,ay=101075792,yM=117853008,aa=22,hh=20,mh=56,wM=12,bM=20,iy=4,CM=1,EM=39169,SM=10,jM=1,NM=21589,kM=28789,IM=25461,BM=6534,_M=30837,RM=30805,ly=1,TM=6,cy=8,dy=2048,DM=16,OM=1,PM=2,FM=4,MM=32,uy=61440,ph=16384,gh=73,QM=420,LM=2048,UM=1024,zM=512,YM="/",Ah=30,GM=10,HM=14,VM=18,ht=void 0,Ls="undefined",No="function",$M=64;let R1=2;try{typeof navigator!=Ls&&navigator.hardwareConcurrency&&(R1=navigator.hardwareConcurrency)}catch{}const WM={workerURI:"./core/web-worker-wasm.js",wasmURI:"./core/streams/zlib-wasm/zlib-streams.wasm",chunkSize:64*1024,maxWorkers:R1,terminateWorkerTimeout:5e3,useWebWorkers:!0,useCompressionStream:!0,CompressionStream:typeof CompressionStream!=Ls&&CompressionStream,DecompressionStream:typeof DecompressionStream!=Ls&&DecompressionStream},T1=Object.assign({},WM);function KM(){return T1}function JM(e){return Math.max(e.chunkSize,$M)}function ru(e){const{baseURI:t,chunkSize:n,maxWorkers:s,terminateWorkerTimeout:i,useCompressionStream:l,useWebWorkers:c,CompressionStream:u,DecompressionStream:f,CompressionStreamZlib:m,DecompressionStreamZlib:p,workerURI:v,wasmURI:x}=e;Qn("baseURI",t),Qn("wasmURI",x),Qn("workerURI",v),Qn("chunkSize",n),Qn("maxWorkers",s),Qn("terminateWorkerTimeout",i),Qn("useCompressionStream",l),Qn("useWebWorkers",c),Qn("CompressionStream",u),Qn("DecompressionStream",f),Qn("CompressionStreamZlib",m),Qn("DecompressionStreamZlib",p)}function Qn(e,t){t!==ht&&(T1[e]=t)}function qM(e){let t;e({workerURI:()=>(t||(t="data:text/javascript,"+encodeURIComponent(`(t=>{"function"==typeof define&&define.amd?define(t):t()})(function(){"use strict";const{Array:t,Object:e,Number:n,Math:s,Error:r,Uint8Array:o,Uint16Array:i,Uint32Array:c,Int32Array:a,Map:h,DataView:f,Promise:l,TextEncoder:u,crypto:w,postMessage:p,TransformStream:d,ReadableStream:y,WritableStream:m,CompressionStream:g,DecompressionStream:S}=self,b=void 0,v="undefined",k="function",z=[];for(let t=0;256>t;t++){let e=t;for(let t=0;8>t;t++)1&e?e=e>>>1^3988292384:e>>>=1;z[t]=e}class C{constructor(t){this.t=t||-1}append(t){let e=0|this.t;for(let n=0,s=0|t.length;s>n;n++)e=e>>>8^z[255&(e^t[n])];this.t=e}get(){return~this.t}}class A extends d{constructor(){let t;const e=new C;super({transform(t,n){e.append(t),n.enqueue(t)},flush(){const n=new o(4);new f(n.buffer).setUint32(0,e.get()),t.value=n}}),t=this}}const x={concat(t,e){if(0===t.length||0===e.length)return t.concat(e);const n=t[t.length-1],s=x.o(n);return 32===s?t.concat(e):x.i(e,s,0|n,t.slice(0,t.length-1))},h(t){const e=t.length;if(0===e)return 0;const n=t[e-1];return 32*(e-1)+x.o(n)},l(t,e){if(32*t.length0&&e&&(t[n-1]=x.u(e,t[n-1]&2147483648>>e-1,1)),t},u:(t,e,n)=>32===t?e:(n?0|e:e<<32-t)+1099511627776*t,o:t=>s.round(t/1099511627776)||32,i(t,e,n,s){for(void 0===s&&(s=[]);e>=32;e-=32)s.push(n),n=0;if(0===e)return s.concat(t);for(let r=0;r>>e),n=t[r]<<32-e;const r=t.length?t[t.length-1]:0,o=x.o(r);return s.push(x.u(e+o&31,e+o>32?n:s.pop(),1)),s}},I={bytes:{p(t){const e=x.h(t)/8,n=new o(e);let s;for(let r=0;e>r;r++)3&r||(s=t[r/4]),n[r]=s>>>24,s<<=8;return n},m(t){const e=[];let n,s=0;for(n=0;n9007199254740991)throw new r("Cannot hash more than 2^53 - 1 bits");const i=new c(n);let a=0;for(let t=e.blockSize+s-(e.blockSize+s&e.blockSize-1);o>=t;t+=e.blockSize)e.R(i.subarray(16*a,16*(a+1))),a+=1;return n.splice(0,16*a),e}P(){const t=this;let e=t.C;const n=t.k;e=x.concat(e,[x.u(1,1)]);for(let t=e.length+2;15&t;t++)e.push(0);for(e.push(s.floor(t.A/4294967296)),e.push(0|t.A);e.length;)t.R(e.splice(0,16));return t.reset(),n}U(t,e,n,s){return t>19?t>39?t>59?t>79?void 0:e^n^s:e&n|e&s|n&s:e^n^s:e&n|~e&s}V(t,e){return e<>>32-t}R(e){const n=this,r=n.k,o=t(80);for(let t=0;16>t;t++)o[t]=e[t];let i=r[0],c=r[1],a=r[2],h=r[3],f=r[4];for(let t=0;79>=t;t++){16>t||(o[t]=n.V(1,o[t-3]^o[t-8]^o[t-14]^o[t-16]));const e=n.V(5,i)+n.U(t,c,a,h)+f+o[t]+n.v[s.floor(t/20)]|0;f=h,h=a,a=n.V(30,c),c=i,i=e}r[0]=r[0]+i|0,r[1]=r[1]+c|0,r[2]=r[2]+a|0,r[3]=r[3]+h|0,r[4]=r[4]+f|0}},P={getRandomValues(t){const e=new c(t.buffer),n=t=>{let e=987654321;const n=4294967295;return()=>(e=36969*(65535&e)+(e>>16)&n,(((e<<16)+(t=18e3*(65535&t)+(t>>16)&n)&n)/4294967296+.5)*(s.random()>.5?1:-1))};for(let r,o=0;onew U.M(I.bytes.m(t)),_(t,e,n,s){if(n=n||1e4,0>s||0>n)throw new r("invalid params to pbkdf2");const o=1+(s>>5)<<2;let i,c,a,h,l;const u=new ArrayBuffer(o),w=new f(u);let p=0;const d=x;for(e=I.bytes.m(e),l=1;(o||1)>p;l++){for(i=c=t.encrypt(d.concat(e,[l])),a=1;n>a;a++)for(c=t.encrypt(c),h=0;hp&&ar&&(t=(new n).update(t).P());for(let e=0;r>e;e++)s[0][e]=909522486^t[e],s[1][e]=1549556828^t[e];e.D[0].update(s[0]),e.D[1].update(s[1]),e.W=new n(e.D[0])}reset(){const t=this;t.W=new t.B(t.D[0]),t.K=!1}update(t){this.K=!0,this.W.update(t)}digest(){const t=this,e=t.W.P(),n=new t.B(t.D[1]).update(e).P();return t.reset(),n}encrypt(t){if(this.K)throw new r("encrypt on already updated hmac called!");return this.update(t),this.digest(t)}}},V=typeof w!=v&&typeof w.getRandomValues==k,M="Invalid password",_="Invalid signature",B="zipjs-abort-check-password";function D(t){return V?w.getRandomValues(t):P.getRandomValues(t)}const W=16,K={name:"PBKDF2"},E=e.assign({hash:{name:"HMAC"}},K),L=e.assign({iterations:1e3,hash:{name:"SHA-1"}},K),O=["deriveBits"],T=[8,12,16],j=[16,24,32],H=10,Z=[0,0,0,0],F=typeof w!=v,N=F&&w.subtle,q=F&&typeof N!=v,G=I.bytes,J=class{constructor(t){const e=this;e.L=[[[],[],[],[],[]],[[],[],[],[],[]]],e.L[0][0][0]||e.O();const n=e.L[0][4],s=e.L[1],o=t.length;let i,c,a,h=1;if(4!==o&&6!==o&&8!==o)throw new r("invalid aes key size");for(e.v=[c=t.slice(0),a=[]],i=o;4*o+28>i;i++){let t=c[i-1];(i%o===0||8===o&&i%o===4)&&(t=n[t>>>24]<<24^n[t>>16&255]<<16^n[t>>8&255]<<8^n[255&t],i%o===0&&(t=t<<8^t>>>24^h<<24,h=h<<1^283*(h>>7))),c[i]=c[i-o]^t}for(let t=0;i;t++,i--){const e=c[3&t?i:i-4];a[t]=4>=i||4>t?e:s[0][n[e>>>24]]^s[1][n[e>>16&255]]^s[2][n[e>>8&255]]^s[3][n[255&e]]}}encrypt(t){return this.T(t,0)}decrypt(t){return this.T(t,1)}O(){const t=this.L[0],e=this.L[1],n=t[4],s=e[4],r=[],o=[];let i,c,a,h;for(let t=0;256>t;t++)o[(r[t]=t<<1^283*(t>>7))^t]=t;for(let f=i=0;!n[f];f^=c||1,i=o[i]||1){let o=i^i<<1^i<<2^i<<3^i<<4;o=o>>8^255&o^99,n[f]=o,s[o]=f,h=r[a=r[c=r[f]]];let l=16843009*h^65537*a^257*c^16843008*f,u=257*r[o]^16843008*o;for(let n=0;4>n;n++)t[n][f]=u=u<<24^u>>>8,e[n][o]=l=l<<24^l>>>8}for(let n=0;5>n;n++)t[n]=t[n].slice(0),e[n]=e[n].slice(0)}T(t,e){if(4!==t.length)throw new r("invalid aes block size");const n=this.v[e],s=n.length/4-2,o=[0,0,0,0],i=this.L[e],c=i[0],a=i[1],h=i[2],f=i[3],l=i[4];let u,w,p,d=t[0]^n[0],y=t[e?3:1]^n[1],m=t[2]^n[2],g=t[e?1:3]^n[3],S=4;for(let t=0;s>t;t++)u=c[d>>>24]^a[y>>16&255]^h[m>>8&255]^f[255&g]^n[S],w=c[y>>>24]^a[m>>16&255]^h[g>>8&255]^f[255&d]^n[S+1],p=c[m>>>24]^a[g>>16&255]^h[d>>8&255]^f[255&y]^n[S+2],g=c[g>>>24]^a[d>>16&255]^h[y>>8&255]^f[255&m]^n[S+3],S+=4,d=u,y=w,m=p;for(let t=0;4>t;t++)o[e?3&-t:t]=l[d>>>24]<<24^l[y>>16&255]<<16^l[m>>8&255]<<8^l[255&g]^n[S++],u=d,d=y,y=m,m=g,g=u;return o}},Q=class{constructor(t,e){this.j=t,this.H=e,this.Z=e}reset(){this.Z=this.H}update(t){return this.F(this.j,t,this.Z)}N(t){if(255&~(t>>24))t+=1<<24;else{let e=t>>16&255,n=t>>8&255,s=255&t;255===e?(e=0,255===n?(n=0,255===s?s=0:++s):++n):++e,t=0,t+=e<<16,t+=n<<8,t+=s}return t}q(t){0===(t[0]=this.N(t[0]))&&(t[1]=this.N(t[1]))}F(t,e,n){let s;if(!(s=e.length))return[];const r=x.h(e);for(let r=0;s>r;r+=4){this.q(n);const s=t.encrypt(n);e[r]^=s[0],e[r+1]^=s[1],e[r+2]^=s[2],e[r+3]^=s[3]}return x.l(e,r)}},X=U.M;let Y=F&&q&&typeof N.importKey==k,$=F&&q&&typeof N.deriveBits==k;class tt extends d{constructor({password:t,rawPassword:n,signed:s,encryptionStrength:i,checkPasswordOnly:c}){super({start(){e.assign(this,{ready:new l(t=>this.G=t),password:rt(t,n),signed:s,J:i-1,pending:new o})},async transform(t,e){const n=this,{password:s,J:i,G:a,ready:h}=n;s?(await(async(t,e,n,s)=>{const o=await st(t,e,n,it(s,0,T[e])),i=it(s,T[e]);if(o[0]!=i[0]||o[1]!=i[1])throw new r(M)})(n,i,s,it(t,0,T[i]+2)),t=it(t,T[i]+2),c?e.error(new r(B)):a()):await h;const f=new o(t.length-H-(t.length-H)%W);e.enqueue(nt(n,t,f,0,H,!0))},async flush(t){const{signed:e,X:n,Y:s,pending:i,ready:c}=this;if(s&&n){await c;const a=it(i,0,i.length-H),h=it(i,i.length-H);let f=new o;if(a.length){const t=at(G,a);s.update(t);const e=n.update(t);f=ct(G,e)}if(e){const t=it(ct(G,s.digest()),0,H);for(let e=0;H>e;e++)if(t[e]!=h[e])throw new r(_)}t.enqueue(f)}}})}}class et extends d{constructor({password:t,rawPassword:n,encryptionStrength:s}){let r;super({start(){e.assign(this,{ready:new l(t=>this.G=t),password:rt(t,n),J:s-1,pending:new o})},async transform(t,e){const n=this,{password:s,J:r,G:i,ready:c}=n;let a=new o;s?(a=await(async(t,e,n)=>{const s=D(new o(T[e]));return ot(s,await st(t,e,n,s))})(n,r,s),i()):await c;const h=new o(a.length+t.length-t.length%W);h.set(a,0),e.enqueue(nt(n,t,h,a.length,0))},async flush(t){const{X:e,Y:n,pending:s,ready:i}=this;if(n&&e){await i;let c=new o;if(s.length){const t=e.update(at(G,s));n.update(t),c=ct(G,t)}r.signature=ct(G,n.digest()).slice(0,H),t.enqueue(ot(c,r.signature))}}}),r=this}}function nt(t,e,n,s,r,i){const{X:c,Y:a,pending:h}=t,f=e.length-r;let l;for(h.length&&(e=ot(h,e),n=((t,e)=>{if(e&&e>t.length){const n=t;(t=new o(e)).set(n,0)}return t})(n,f-f%W)),l=0;f-W>=l;l+=W){const t=at(G,it(e,l,l+W));i&&a.update(t);const r=c.update(t);i||a.update(r),n.set(ct(G,r),l+s)}return t.pending=it(e,l),n}async function st(n,s,r,i){n.password=null;const c=await(async(t,e,n,s,r)=>{if(!Y)return U.importKey(e);try{return await N.importKey("raw",e,n,!1,r)}catch{return Y=!1,U.importKey(e)}})(0,r,E,0,O),a=await(async(t,e,n)=>{if(!$)return U._(e,t.salt,L.iterations,n);try{return await N.deriveBits(t,e,n)}catch{return $=!1,U._(e,t.salt,L.iterations,n)}})(e.assign({salt:i},L),c,8*(2*j[s]+2)),h=new o(a),f=at(G,it(h,0,j[s])),l=at(G,it(h,j[s],2*j[s])),u=it(h,2*j[s]);return e.assign(n,{keys:{key:f,$:l,passwordVerification:u},X:new Q(new J(f),t.from(Z)),Y:new X(l)}),u}function rt(t,e){return e===b?(t=>{if(typeof u==v){const e=new o((t=unescape(encodeURIComponent(t))).length);for(let n=0;n>>24]),o=~t.et.get(),t.keys=[n,r,o]}function dt(t){const e=2|t.keys[2];return yt(s.imul(e,1^e)>>>8)}function yt(t){return 255&t}function mt(t){return 4294967295&t}class gt extends d{constructor(t,{chunkSize:e,nt:n,CompressionStream:s}){super({});const{compressed:r,encrypted:o,useCompressionStream:i,zipCrypto:c,signed:a,level:h}=t,l=this;let u,w,p=super.readable;o&&!c||!a||(u=new A,p=kt(p,u)),r&&(p=vt(p,i,{level:h,chunkSize:e},s,n,s)),o&&(c?p=kt(p,new ft(t)):(w=new et(t),p=kt(p,w))),bt(l,p,()=>{let t;o&&!c&&(t=w.signature),o&&!c||!a||(t=new f(u.value.buffer).getUint32(0)),l.signature=t})}}class St extends d{constructor(t,{chunkSize:e,st:n,DecompressionStream:s}){super({});const{zipCrypto:o,encrypted:i,signed:c,signature:a,compressed:h,useCompressionStream:l,rt:u}=t;let w,p,d=super.readable;i&&(o?d=kt(d,new ht(t)):(p=new tt(t),d=kt(d,p))),h&&(d=vt(d,l,{chunkSize:e,rt:u},s,n,s)),i&&!o||!c||(w=new A,d=kt(d,w)),bt(this,d,()=>{if((!i||o)&&c){const t=new f(w.value.buffer);if(a!=t.getUint32(0,!1))throw new r(_)}})}}function bt(t,n,s){n=kt(n,new d({flush:s})),e.defineProperty(t,"readable",{get:()=>n})}function vt(t,e,n,s,r,o){const i=e&&s?s:r||o,c=n.rt?"deflate64-raw":"deflate-raw";try{t=kt(t,new i(c,n))}catch(s){if(!e)throw s;if(r)t=kt(t,new r(c,n));else{if(!o)throw s;t=kt(t,new o(c,n))}}return t}function kt(t,e){return t.pipeThrough(e)}const zt="data",Ct="close";class At extends d{constructor(t,n){super({});const s=this,{codecType:o}=t;let i;o.startsWith("deflate")?i=gt:o.startsWith("inflate")&&(i=St),s.outputSize=0;let c=0;const a=new i(t,n),h=super.readable,f=new d({transform(t,e){t&&t.length&&(c+=t.length,e.enqueue(t))},flush(){e.assign(s,{inputSize:c})}}),l=new d({transform(e,n){if(e&&e.length&&(n.enqueue(e),s.outputSize+=e.length,t.outputSize!==b&&s.outputSize>t.outputSize))throw new r("Invalid uncompressed size")},flush(){const{signature:t}=a;e.assign(s,{signature:t,inputSize:c})}});e.defineProperty(s,"readable",{get:()=>h.pipeThrough(f).pipeThrough(a).pipeThrough(l)})}}class xt extends d{constructor(t){let e;super({transform:function n(s,r){if(e){const t=new o(e.length+s.length);t.set(e),t.set(s,e.length),s=t,e=null}s.length>t?(r.enqueue(s.slice(0,t)),n(s.slice(t),r)):e=s},flush(t){e&&e.length&&t.enqueue(e)}})}}const It=new h,Rt=new h;let Pt,Ut,Vt,Mt,_t,Bt=0;async function Dt(t){try{const{options:e,config:s}=t;if(!e.useCompressionStream)try{await self.initModule(t.config)}catch{e.useCompressionStream=!0}s.CompressionStream=self.CompressionStream,s.DecompressionStream=self.DecompressionStream;const r={highWaterMark:1},o=t.readable||new y({async pull(t){const e=new l(t=>It.set(Bt,t));Wt({type:"pull",messageId:Bt}),Bt=(Bt+1)%n.MAX_SAFE_INTEGER;const{value:s,done:r}=await e;t.enqueue(s),r&&t.close()}},r),i=t.writable||new m({async write(t){let e;const s=new l(t=>e=t);Rt.set(Bt,e),Wt({type:zt,value:t,messageId:Bt}),Bt=(Bt+1)%n.MAX_SAFE_INTEGER,await s}},r),c=new At(e,s);Pt=new AbortController;const{signal:a}=Pt;await o.pipeThrough(c).pipeThrough(new xt(s.chunkSize)).pipeTo(i,{signal:a,preventClose:!0,preventAbort:!0}),await i.getWriter().close();const{signature:h,inputSize:f,outputSize:u}=c;Wt({type:Ct,result:{signature:h,inputSize:f,outputSize:u}})}catch(t){t.outputSize=0,Kt(t)}}function Wt(t){let{value:e}=t;if(e)if(e.length)try{e=new o(e),t.value=e.buffer,p(t,[t.value])}catch{p(t)}else p(t);else p(t)}function Kt(t=new r("Unknown error")){const{message:e,stack:n,code:s,name:o,outputSize:i}=t;p({error:{message:e,stack:n,code:s,name:o,outputSize:i}})}function Et(t,e,n={}){const i="number"==typeof n.level?n.level:-1,c="number"==typeof n.ot?n.ot:65536,a="number"==typeof n.it?n.it:65536;return new d({start(){let n;if(this.ct=Vt(c),this.in=Vt(a),this.it=a,this.ht=new o(c),t?(this.ft=Ut.deflate_process,this.lt=Ut.deflate_last_consumed,this.ut=Ut.deflate_end,this.wt=Ut.deflate_new(),n="gzip"===e?Ut.deflate_init_gzip(this.wt,i):"deflate-raw"===e?Ut.deflate_init_raw(this.wt,i):Ut.deflate_init(this.wt,i)):"deflate64-raw"===e?(this.ft=Ut.inflate9_process,this.lt=Ut.inflate9_last_consumed,this.ut=Ut.inflate9_end,this.wt=Ut.inflate9_new(),n=Ut.inflate9_init_raw(this.wt)):(this.ft=Ut.inflate_process,this.lt=Ut.inflate_last_consumed,this.ut=Ut.inflate_end,this.wt=Ut.inflate_new(),n="deflate-raw"===e?Ut.inflate_init_raw(this.wt):"gzip"===e?Ut.inflate_init_gzip(this.wt):Ut.inflate_init(this.wt)),0!==n)throw new r("init failed:"+n)},transform(e,n){try{const i=e,a=new o(_t.buffer),h=this.ft,f=this.lt,l=this.ct,u=this.ht;let w=0;for(;w=e||(this.in&&Mt&&Mt(this.in),this.in=Vt(e),this.it=e),a.set(i.subarray(w,w+e),this.in);const o=h(this.wt,this.in,e,l,c,0),p=16777215&o;if(p&&(u.set(a.subarray(l,l+p),0),n.enqueue(u.slice(0,p))),!t){const t=o>>24&255,e=128&t?t-256:t;if(0>e)throw new r("process error:"+e)}const d=f(this.wt);if(0===d)break;w+=d}}catch(t){this.ut&&this.wt&&this.ut(this.wt),this.in&&Mt&&Mt(this.in),this.ct&&Mt&&Mt(this.ct),n.error(t)}},flush(e){try{const n=new o(_t.buffer),s=this.ft,i=this.ct,a=this.ht;for(;;){const o=s(this.wt,0,0,i,c,4),h=16777215&o,f=o>>24&255;if(!t){const t=128&f?f-256:f;if(0>t)throw new r("process error:"+t)}if(h&&(a.set(n.subarray(i,i+h),0),e.enqueue(a.slice(0,h))),1===f||0===h)break}}catch(t){e.error(t)}finally{if(this.ut&&this.wt){const t=this.ut(this.wt);0!==t&&e.error(new r("end error:"+t))}this.in&&Mt&&Mt(this.in),this.ct&&Mt&&Mt(this.ct)}}})}addEventListener("message",({data:t})=>{const{type:e,messageId:n,value:s,done:r}=t;try{if("start"==e&&Dt(t),e==zt){const t=It.get(n);It.delete(n),t({value:new o(s),done:r})}if("ack"==e){const t=Rt.get(n);Rt.delete(n),t()}e==Ct&&Pt.abort()}catch(t){Kt(t)}});class Lt{constructor(t="deflate",e){return Et(!0,t,e)}}class Ot{constructor(t="deflate",e){return Et(!1,t,e)}}let Tt=!1;self.initModule=async t=>{try{const e=await(async(t,{baseURI:e})=>{if(!Tt){let n,s;try{try{s=new URL(t,e)}catch{}const r=await fetch(s);n=await r.arrayBuffer()}catch(e){if(!t.startsWith("data:application/wasm;base64,"))throw e;n=(t=>{const e=t.split(",")[1],n=atob(e),s=n.length,r=new o(s);for(let t=0;s>t;++t)r[t]=n.charCodeAt(t);return r.buffer})(t)}(t=>{if(Ut=t,({malloc:Vt,free:Mt,memory:_t}=Ut),"function"!=typeof Vt||"function"!=typeof Mt||!_t)throw Ut=Vt=Mt=_t=null,new r("Invalid WASM module")})((await WebAssembly.instantiate(n)).instance.exports),Tt=!0}})(t.wasmURI,t);return t.nt=Lt,t.st=Ot,e}catch{}}});
+`)),t)})}const D1=[];for(let e=0;e<256;e++){let t=e;for(let n=0;n<8;n++)t&1?t=t>>>1^3988292384:t=t>>>1;D1[e]=t}class gd{constructor(t){this.crc=t||-1}append(t){let n=this.crc|0;for(let s=0,i=t.length|0;s>>8^D1[(n^t[s])&255];this.crc=n}get(){return~this.crc}}class O1 extends TransformStream{constructor(){let t;const n=new gd;super({transform(s,i){n.append(s),i.enqueue(s)},flush(){const s=new Uint8Array(4);new DataView(s.buffer).setUint32(0,n.get()),t.value=s}}),t=this}}function XM(e){if(typeof TextEncoder==Ls){e=unescape(encodeURIComponent(e));const t=new Uint8Array(e.length);for(let n=0;n0&&t&&(e[n-1]=on.partial(t,e[n-1]&2147483648>>t-1,1)),e},partial(e,t,n){return e===32?t:(n?t|0:t<<32-e)+e*1099511627776},getPartial(e){return Math.round(e/1099511627776)||32},_shiftRight(e,t,n,s){for(s===void 0&&(s=[]);t>=32;t-=32)s.push(n),n=0;if(t===0)return s.concat(e);for(let c=0;c>>t),n=e[c]<<32-t;const i=e.length?e[e.length-1]:0,l=on.getPartial(i);return s.push(on.partial(t+l&31,t+l>32?n:s.pop(),1)),s}},Ad={bytes:{fromBits(e){const n=on.bitLength(e)/8,s=new Uint8Array(n);let i;for(let l=0;l>>24,i<<=8;return s},toBits(e){const t=[];let n,s=0;for(n=0;n9007199254740991)throw new Error("Cannot hash more than 2^53 - 1 bits");const l=new Uint32Array(n);let c=0;for(let u=t.blockSize+s-(t.blockSize+s&t.blockSize-1);u<=i;u+=t.blockSize)t._block(l.subarray(16*c,16*(c+1))),c+=1;return n.splice(0,16*c),t}finalize(){const e=this;let t=e._buffer;const n=e._h;t=on.concat(t,[on.partial(1,1)]);for(let s=t.length+2;s&15;s++)t.push(0);for(t.push(Math.floor(e._length/4294967296)),t.push(e._length|0);t.length;)e._block(t.splice(0,16));return e.reset(),n}_f(e,t,n,s){if(e<=19)return t&n|~t&s;if(e<=39)return t^n^s;if(e<=59)return t&n|t&s|n&s;if(e<=79)return t^n^s}_S(e,t){return t<>>32-e}_block(e){const t=this,n=t._h,s=Array(80);for(let m=0;m<16;m++)s[m]=e[m];let i=n[0],l=n[1],c=n[2],u=n[3],f=n[4];for(let m=0;m<=79;m++){m>=16&&(s[m]=t._S(1,s[m-3]^s[m-8]^s[m-14]^s[m-16]));const p=t._S(5,i)+t._f(m,l,c,u)+f+s[m]+t._key[Math.floor(m/20)]|0;f=u,u=c,c=t._S(30,l),l=i,i=p}n[0]=n[0]+i|0,n[1]=n[1]+l|0,n[2]=n[2]+c|0,n[3]=n[3]+u|0,n[4]=n[4]+f|0}};const F1={};F1.aes=class{constructor(e){const t=this;t._tables=[[[],[],[],[],[]],[[],[],[],[],[]]],t._tables[0][0][0]||t._precompute();const n=t._tables[0][4],s=t._tables[1],i=e.length;let l,c,u,f=1;if(i!==4&&i!==6&&i!==8)throw new Error("invalid aes key size");for(t._key=[c=e.slice(0),u=[]],l=i;l<4*i+28;l++){let m=c[l-1];(l%i===0||i===8&&l%i===4)&&(m=n[m>>>24]<<24^n[m>>16&255]<<16^n[m>>8&255]<<8^n[m&255],l%i===0&&(m=m<<8^m>>>24^f<<24,f=f<<1^(f>>7)*283)),c[l]=c[l-i]^m}for(let m=0;l;m++,l--){const p=c[m&3?l:l-4];l<=4||m<4?u[m]=p:u[m]=s[0][n[p>>>24]]^s[1][n[p>>16&255]]^s[2][n[p>>8&255]]^s[3][n[p&255]]}}encrypt(e){return this._crypt(e,0)}decrypt(e){return this._crypt(e,1)}_precompute(){const e=this._tables[0],t=this._tables[1],n=e[4],s=t[4],i=[],l=[];let c,u,f,m;for(let p=0;p<256;p++)l[(i[p]=p<<1^(p>>7)*283)^p]=p;for(let p=c=0;!n[p];p^=u||1,c=l[c]||1){let v=c^c<<1^c<<2^c<<3^c<<4;v=v>>8^v&255^99,n[p]=v,s[v]=p,m=i[f=i[u=i[p]]];let x=m*16843009^f*65537^u*257^p*16843008,y=i[v]*257^v*16843008;for(let E=0;E<4;E++)e[E][p]=y=y<<24^y>>>8,t[E][v]=x=x<<24^x>>>8}for(let p=0;p<5;p++)e[p]=e[p].slice(0),t[p]=t[p].slice(0)}_crypt(e,t){if(e.length!==4)throw new Error("invalid aes block size");const n=this._key[t],s=n.length/4-2,i=[0,0,0,0],l=this._tables[t],c=l[0],u=l[1],f=l[2],m=l[3],p=l[4];let v=e[0]^n[0],x=e[t?3:1]^n[1],y=e[2]^n[2],E=e[t?1:3]^n[3],w=4,C,S,N;for(let j=0;j>>24]^u[x>>16&255]^f[y>>8&255]^m[E&255]^n[w],S=c[x>>>24]^u[y>>16&255]^f[E>>8&255]^m[v&255]^n[w+1],N=c[y>>>24]^u[E>>16&255]^f[v>>8&255]^m[x&255]^n[w+2],E=c[E>>>24]^u[v>>16&255]^f[x>>8&255]^m[y&255]^n[w+3],w+=4,v=C,x=S,y=N;for(let j=0;j<4;j++)i[t?3&-j:j]=p[v>>>24]<<24^p[x>>16&255]<<16^p[y>>8&255]<<8^p[E&255]^n[w++],C=v,v=x,x=y,y=E,E=C;return i}};const ZM={getRandomValues(e){const t=new Uint32Array(e.buffer),n=s=>{let i=987654321;const l=4294967295;return function(){return i=36969*(i&65535)+(i>>16)&l,s=18e3*(s&65535)+(s>>16)&l,(((i<<16)+s&l)/4294967296+.5)*(Math.random()>.5?1:-1)}};for(let s=0,i;s>24&255)===255){let t=e>>16&255,n=e>>8&255,s=e&255;t===255?(t=0,n===255?(n=0,s===255?s=0:++s):++n):++t,e=0,e+=t<<16,e+=n<<8,e+=s}else e+=1<<24;return e}incCounter(e){(e[0]=this.incWord(e[0]))===0&&(e[1]=this.incWord(e[1]))}calculate(e,t,n){let s;if(!(s=t.length))return[];const i=on.bitLength(t);for(let l=0;l>5)+1<<2;let l,c,u,f,m;const p=new ArrayBuffer(i),v=new DataView(p);let x=0;const y=on;for(t=Ad.bytes.toBits(t),m=1;x<(i||1);m++){for(l=c=e.encrypt(y.concat(t,[m])),u=1;ui&&(e=new n().update(e).finalize());for(let l=0;lthis.resolveReady=c),password:V1(t,n),signed:s,strength:i-1,pending:new Uint8Array})},async transform(c,u){const f=this,{password:m,strength:p,resolveReady:v,ready:x}=f;m?(await fQ(f,p,m,Gn(c,0,Xi[p]+2)),c=Gn(c,Xi[p]+2),l?u.error(new Error(Dp)):v()):await x;const y=new Uint8Array(c.length-js-(c.length-js)%ca);u.enqueue(G1(f,c,y,0,js,!0))},async flush(c){const{signed:u,ctr:f,hmac:m,pending:p,ready:v}=this;if(m&&f){await v;const x=Gn(p,0,p.length-js),y=Gn(p,p.length-js);let E=new Uint8Array;if(x.length){const w=el(Br,x);m.update(w);const C=f.update(w);E=Zi(Br,C)}if(u){const w=Gn(Zi(Br,m.digest()),0,js);for(let C=0;Cthis.resolveReady=l),password:V1(t,n),strength:s-1,pending:new Uint8Array})},async transform(l,c){const u=this,{password:f,strength:m,resolveReady:p,ready:v}=u;let x=new Uint8Array;f?(x=await hQ(u,m,f),p()):await v;const y=new Uint8Array(x.length+l.length-l.length%ca);y.set(x,0),c.enqueue(G1(u,l,y,x.length,0))},async flush(l){const{ctr:c,hmac:u,pending:f,ready:m}=this;if(u&&c){await m;let p=new Uint8Array;if(f.length){const v=c.update(el(Br,f));u.update(v),p=Zi(Br,v)}i.signature=Zi(Br,u.digest()).slice(0,js),l.enqueue(Op(p,i.signature))}}}),i=this}}function G1(e,t,n,s,i,l){const{ctr:c,hmac:u,pending:f}=e,m=t.length-i;f.length&&(t=Op(f,t),n=gQ(n,m-m%ca));let p;for(p=0;p<=m-ca;p+=ca){const v=el(Br,Gn(t,p,p+ca));l&&u.update(v);const x=c.update(v);l||u.update(x),n.set(Zi(Br,x),p+s)}return e.pending=Gn(t,p),n}async function fQ(e,t,n,s){const i=await H1(e,t,n,Gn(s,0,Xi[t])),l=Gn(s,Xi[t]);if(i[0]!=l[0]||i[1]!=l[1])throw new Error(Q1)}async function hQ(e,t,n){const s=U1(new Uint8Array(Xi[t])),i=await H1(e,t,n,s);return Op(s,i)}async function H1(e,t,n,s){e.password=null;const i=await mQ(tQ,n,sQ,!1,oQ),l=await pQ(Object.assign({salt:s},mm),i,8*(Ii[t]*2+2)),c=new Uint8Array(l),u=el(Br,Gn(c,0,Ii[t])),f=el(Br,Gn(c,Ii[t],Ii[t]*2)),m=Gn(c,Ii[t]*2);return Object.assign(e,{keys:{key:u,authentication:f,passwordVerification:m},ctr:new lQ(new iQ(u),Array.from(aQ)),hmac:new cQ(f)}),m}async function mQ(e,t,n,s,i){if(fy)try{return await hl.importKey(e,t,n,s,i)}catch{return fy=!1,yo.importKey(t)}else return yo.importKey(t)}async function pQ(e,t,n){if(hy)try{return await hl.deriveBits(e,t,n)}catch{return hy=!1,yo.pbkdf2(t,e.salt,mm.iterations,n)}else return yo.pbkdf2(t,e.salt,mm.iterations,n)}function V1(e,t){return t===ht?XM(e):t}function Op(e,t){let n=e;return e.length+t.length&&(n=new Uint8Array(e.length+t.length),n.set(e,0),n.set(t,e.length)),n}function gQ(e,t){if(t&&t>e.length){const n=e;e=new Uint8Array(t),e.set(n,0)}return e}function Gn(e,t,n){return e.subarray(t,n)}function Zi(e,t){return e.fromBits(t)}function el(e,t){return e.toBits(t)}const Di=12;class AQ extends TransformStream{constructor({password:t,passwordVerification:n,checkPasswordOnly:s}){super({start(){Object.assign(this,{password:t,passwordVerification:n}),$1(this,t)},transform(i,l){const c=this;if(c.password){const u=my(c,i.subarray(0,Di));if(c.password=null,u.at(-1)!=c.passwordVerification)throw new Error(Q1);i=i.subarray(Di)}s?l.error(new Error(Dp)):l.enqueue(my(c,i))}})}}class vQ extends TransformStream{constructor({password:t,passwordVerification:n}){super({start(){Object.assign(this,{password:t,passwordVerification:n}),$1(this,t)},transform(s,i){const l=this;let c,u;if(l.password){l.password=null;const f=U1(new Uint8Array(Di));f[Di-1]=l.passwordVerification,c=new Uint8Array(s.length+f.length),c.set(py(l,f),0),u=Di}else c=new Uint8Array(s.length),u=0;c.set(py(l,s),u),i.enqueue(c)}})}}function my(e,t){const n=new Uint8Array(t.length);for(let s=0;s>>24]),i=~e.crcKey2.get(),e.keys=[n,s,i]}function W1(e){const t=e.keys[2]|2;return K1(Math.imul(t,t^1)>>>8)}function K1(e){return e&255}function gy(e){return e&4294967295}const J1="Invalid uncompressed size",xQ="deflate-raw",yQ="deflate64-raw";class wQ extends TransformStream{constructor(t,{chunkSize:n,CompressionStreamZlib:s,CompressionStream:i}){super({});const{compressed:l,encrypted:c,useCompressionStream:u,zipCrypto:f,signed:m,level:p}=t,v=this;let x,y,E=super.readable;(!c||f)&&m&&(x=new O1,E=_r(E,x)),l&&(E=X1(E,u,{level:p,chunkSize:n},i,s,i)),c&&(f?E=_r(E,new vQ(t)):(y=new uQ(t),E=_r(E,y))),q1(v,E,()=>{let w;c&&!f&&(w=y.signature),(!c||f)&&m&&(w=new DataView(x.value.buffer).getUint32(0)),v.signature=w})}}class bQ extends TransformStream{constructor(t,{chunkSize:n,DecompressionStreamZlib:s,DecompressionStream:i}){super({});const{zipCrypto:l,encrypted:c,signed:u,signature:f,compressed:m,useCompressionStream:p,deflate64:v}=t;let x,y,E=super.readable;c&&(l?E=_r(E,new AQ(t)):(y=new dQ(t),E=_r(E,y))),m&&(E=X1(E,p,{chunkSize:n,deflate64:v},i,s,i)),(!c||l)&&u&&(x=new O1,E=_r(E,x)),q1(this,E,()=>{if((!c||l)&&u){const w=new DataView(x.value.buffer);if(f!=w.getUint32(0,!1))throw new Error(L1)}})}}function q1(e,t,n){t=_r(t,new TransformStream({flush:n})),Object.defineProperty(e,"readable",{get(){return t}})}function X1(e,t,n,s,i,l){const c=t&&s?s:i||l,u=n.deflate64?yQ:xQ;try{e=_r(e,new c(u,n))}catch(f){if(t)if(i)e=_r(e,new i(u,n));else if(l)e=_r(e,new l(u,n));else throw f;else throw f}return e}function _r(e,t){return e.pipeThrough(t)}const CQ="message",EQ="start",SQ="pull",Ay="data",jQ="ack",vy="close",NQ="deflate",Z1="inflate";class kQ extends TransformStream{constructor(t,n){super({});const s=this,{codecType:i}=t;let l;i.startsWith(NQ)?l=wQ:i.startsWith(Z1)&&(l=bQ),s.outputSize=0;let c=0;const u=new l(t,n),f=super.readable,m=new TransformStream({transform(v,x){v&&v.length&&(c+=v.length,x.enqueue(v))},flush(){Object.assign(s,{inputSize:c})}}),p=new TransformStream({transform(v,x){if(v&&v.length&&(x.enqueue(v),s.outputSize+=v.length,t.outputSize!==ht&&s.outputSize>t.outputSize))throw new Error(J1)},flush(){const{signature:v}=u;Object.assign(s,{signature:v,inputSize:c})}});Object.defineProperty(s,"readable",{get(){return f.pipeThrough(m).pipeThrough(u).pipeThrough(p)}})}}class IQ extends TransformStream{constructor(t){let n;super({transform:s,flush(i){n&&n.length&&i.enqueue(n)}});function s(i,l){if(n){const c=new Uint8Array(n.length+i.length);c.set(n),c.set(i,n.length),i=c,n=null}i.length>t?(l.enqueue(i.slice(0,t)),s(i.slice(t),l)):n=i}}}let eS=typeof Worker!=Ls,tS=()=>{};function BQ({initModule:e}){tS=e}class vh{constructor(t,{readable:n,writable:s},{options:i,config:l,streamOptions:c,useWebWorkers:u,transferStreams:f,workerURI:m},p){const{signal:v}=c;return Object.assign(t,{busy:!0,readable:n.pipeThrough(new IQ(l.chunkSize)).pipeThrough(new _Q(c),{signal:v}),writable:s,options:Object.assign({},i),workerURI:m,transferStreams:f,terminate(){return new Promise(x=>{const{worker:y,busy:E}=t;y?(E?t.resolveTerminated=x:(y.terminate(),x()),t.interface=null):x()})},onTaskFinished(){const{resolveTerminated:x}=t;x&&(t.resolveTerminated=null,t.terminated=!0,t.worker.terminate(),x()),t.busy=!1,p(t)}}),(u&&eS?RQ:nS)(t,l)}}class _Q extends TransformStream{constructor({onstart:t,onprogress:n,size:s,onend:i}){let l=0;super({async start(){t&&await xh(t,s)},async transform(c,u){l+=c.length,n&&await xh(n,l,s),u.enqueue(c)},async flush(){i&&await xh(i,l)}})}}async function xh(e,...t){try{await e(...t)}catch{}}function nS(e,t){return{run:()=>TQ(e,t)}}function RQ(e,t){const{baseURI:n,chunkSize:s}=t;let{wasmURI:i}=t;if(!e.interface){typeof i==No&&(i=i());let l;try{l=PQ(e.workerURI,n,e)}catch{return eS=!1,nS(e,t)}Object.assign(e,{worker:l,interface:{run:()=>DQ(e,{chunkSize:s,wasmURI:i,baseURI:n})}})}return e.interface}async function TQ({options:e,readable:t,writable:n,onTaskFinished:s},i){let l;try{if(!e.useCompressionStream)try{await tS(i)}catch{e.useCompressionStream=!0}l=new kQ(e,i),await t.pipeThrough(l).pipeTo(n,{preventClose:!0,preventAbort:!0});const{signature:c,inputSize:u,outputSize:f}=l;return{signature:c,inputSize:u,outputSize:f}}catch(c){throw l&&(c.outputSize=l.outputSize),c}finally{s()}}async function DQ(e,t){let n,s;const i=new Promise((v,x)=>{n=v,s=x});Object.assign(e,{reader:null,writer:null,resolveResult:n,rejectResult:s,result:i});const{readable:l,options:c}=e,{writable:u,closed:f}=OQ(e.writable),m=Hc({type:EQ,options:c,config:t,readable:l,writable:u},e);m||Object.assign(e,{reader:l.getReader(),writer:u.getWriter()});const p=await i;return m||await u.getWriter().close(),await f,p}function OQ(e){let t;const n=new Promise(i=>t=i);return{writable:new WritableStream({async write(i){const l=e.getWriter();await l.ready,await l.write(i),l.releaseLock()},close(){t()},abort(i){return e.getWriter().abort(i)}}),closed:n}}let xy=!0;function PQ(e,t,n){const s={type:"module"};let i,l;if(typeof e==No&&(e=e()),e.startsWith("data:")||e.startsWith("blob:"))try{l=new Worker(e)}catch{l=new Worker(e,s)}else{try{i=new URL(e,t)}catch{i=e}l=new Worker(i,s)}return l.addEventListener(CQ,c=>FQ(c,n)),l}function Hc(e,{worker:t,writer:n,onTaskFinished:s,transferStreams:i}){try{const{value:l,readable:c,writable:u}=e,f=[];if(l&&(e.value=l,f.push(e.value.buffer)),i&&xy?(c&&f.push(c),u&&f.push(u)):e.readable=e.writable=null,f.length)try{return t.postMessage(e,f),!0}catch{xy=!1,e.readable=e.writable=null,t.postMessage(e)}else t.postMessage(e)}catch(l){throw n&&n.releaseLock(),s(),l}}async function FQ({data:e},t){const{type:n,value:s,messageId:i,result:l,error:c}=e,{reader:u,writer:f,resolveResult:m,rejectResult:p,onTaskFinished:v}=t;try{if(c){const{message:y,stack:E,code:w,name:C,outputSize:S}=c,N=new Error(y);Object.assign(N,{stack:E,code:w,name:C,outputSize:S}),x(N)}else{if(n==SQ){const{value:y,done:E}=await u.read();Hc({type:Ay,value:y,done:E,messageId:i},t)}n==Ay&&(await f.ready,await f.write(new Uint8Array(s)),Hc({type:jQ,messageId:i},t)),n==vy&&x(null,l)}}catch(y){Hc({type:vy,messageId:i},t),x(y)}function x(y,E){y?p(y):m(E),f&&f.releaseLock(),v()}}let ao=[];const yh=[];let yy=0;async function MQ(e,t){const{options:n,config:s}=t,{transferStreams:i,useWebWorkers:l,useCompressionStream:c,compressed:u,signed:f,encrypted:m}=n,{workerURI:p,maxWorkers:v}=s;t.transferStreams=i||i===ht;const x=!u&&!f&&!m&&!t.transferStreams;return t.useWebWorkers=!x&&(l||l===ht&&s.useWebWorkers),t.workerURI=t.useWebWorkers&&p?p:ht,n.useCompressionStream=c||c===ht&&s.useCompressionStream,(await y()).run();async function y(){const w=ao.find(C=>!C.busy);if(w)return wy(w),new vh(w,e,t,E);if(ao.lengthyh.push({resolve:C,stream:e,workerOptions:t}))}function E(w){if(yh.length){const[{resolve:C,stream:S,workerOptions:N}]=yh.splice(0,1);C(new vh(w,S,N,E))}else w.worker?(wy(w),QQ(w,t)):ao=ao.filter(C=>C!=w)}}function QQ(e,t){const{config:n}=t,{terminateWorkerTimeout:s}=n;Number.isFinite(s)&&s>=0&&(e.terminated?e.terminated=!1:e.terminateTimeout=setTimeout(async()=>{ao=ao.filter(i=>i!=e);try{await e.terminate()}catch{}},s))}function wy(e){const{terminateTimeout:t}=e;t&&(clearTimeout(t),e.terminateTimeout=null)}const LQ="Writer iterator completed too soon",UQ="Content-Type",zQ=64*1024,rS="writable";class Fp{constructor(){this.size=0}init(){this.initialized=!0}}class sS extends Fp{get readable(){const t=this,{chunkSize:n=zQ}=t,s=new ReadableStream({start(){this.chunkOffset=0},async pull(i){const{offset:l=0,size:c,diskNumberStart:u}=s,{chunkOffset:f}=this,m=c===ht?n:Math.min(n,c-f),p=await Ht(t,l+f,m,u);i.enqueue(p),f+n>c||c===ht&&!p.length&&m?i.close():this.chunkOffset+=n}});return s}}class oS extends sS{constructor(t){super(),Object.assign(this,{blob:t,size:t.size})}async readUint8Array(t,n){const s=this,i=t+n;let c=await(t||in&&(c=c.slice(t,i)),new Uint8Array(c)}}class by extends Fp{constructor(t){super();const n=this,s=new TransformStream,i=[];t&&i.push([UQ,t]),Object.defineProperty(n,rS,{get(){return s.writable}}),n.blob=new Response(s.readable,{headers:i}).blob()}getData(){return this.blob}}class YQ extends sS{constructor(t){super(),this.readers=t}async init(){const t=this,{readers:n}=t;t.lastDiskNumber=0,t.lastDiskOffset=0,await Promise.all(n.map(async(s,i)=>{await s.init(),i!=n.length-1&&(t.lastDiskOffset+=s.size),t.size+=s.size})),super.init()}async readUint8Array(t,n,s=0){const i=this,{readers:l}=this;let c,u=s;u==-1&&(u=l.length-1);let f=t;for(;l[u]&&f>=l[u].size;)f-=l[u].size,u++;const m=l[u];if(m){const p=m.size;if(f+n<=p)c=await Ht(m,f,n);else{const v=p-f;c=new Uint8Array(n);const x=await Ht(m,f,v);c.set(x,0);const y=await i.readUint8Array(t+v,n-v,s);c.set(y,v),x.length+y.length=v?(await f(p.subarray(0,v)),await m(),s.diskOffset+=i.size,s.diskNumber++,c=null,await this.write(p.subarray(v))):await f(p);else{const{value:x,done:y}=await t.next();if(y&&!x)throw new Error(LQ);i=x,i.size=0,i.maxSize&&(s.maxSize=i.maxSize),s.availableSize=s.maxSize,await vd(i),l=x.writable,c=l.getWriter(),await this.write(p)}},async close(){await c.ready,await m()}});Object.defineProperty(s,rS,{get(){return u}});async function f(p){const v=p.length;v&&(await c.ready,await c.write(p),i.size+=v,s.size+=v,s.availableSize-=v)}async function m(){await c.close()}}}class GQ{constructor(t){return Array.isArray(t)&&(t=new YQ(t)),t instanceof ReadableStream&&(t={readable:t}),t}}class HQ{constructor(t){return t.writable===ht&&typeof t.next==No&&(t=new Cy(t)),t instanceof WritableStream&&(t={writable:t}),t.size===ht&&(t.size=0),t instanceof Cy||Object.assign(t,{diskNumber:0,diskOffset:0,availableSize:1/0,maxSize:1/0}),t}}async function vd(e,t){if(e.init&&!e.initialized)await e.init(t);else return Promise.resolve()}function Ht(e,t,n,s){return e.readUint8Array(t,n,s)}const aS="\0☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ".split(""),VQ=aS.length==256;function $Q(e){if(VQ){let t="";for(let n=0;nthis[n]=t[n])}}const I3="filenameEncoding",B3="commentEncoding",_3="decodeText",R3="extractPrependedData",T3="extractAppendedData",D3="password",O3="rawPassword",P3="passThrough",F3="signal",M3="checkPasswordOnly",Q3="checkOverlappingEntryOnly",L3="checkOverlappingEntry",U3="checkSignature",z3="useWebWorkers",Y3="useCompressionStream",G3="transferStreams",H3="preventClose",wh="File format is not recognized",V3="End of central directory not found",$3="End of Zip64 central directory locator not found",W3="Central directory header not found",K3="Local file header not found",J3="Zip64 extra field not found",q3="File contains encrypted entry",X3="Encryption method not supported",Sy="Compression method not supported",jy="Split zip file",Z3="Overlapping entry found",Ny="utf-8",eL="UTF8",ky="cp437",tL=[[uS,lo],[fS,lo],[hS,lo],[mS,br]],nL={[br]:{getValue:ut,bytes:4},[lo]:{getValue:pa,bytes:8}};class rL{constructor(t,n={}){Object.assign(this,{reader:new GQ(t),options:n,config:KM(),readRanges:[]})}async*getEntriesGenerator(t={}){const n=this;let{reader:s}=n;const{config:i}=n;if(await vd(s),(s.size===ht||!s.readUint8Array)&&(s=new oS(await new Response(s.readable).blob()),await vd(s)),s.sizere&&(C=f-re),W=await Ht(s,f,mh,-1),te=ft(W)}if(ut(te,0)!=ay)throw new Error($3);x==br&&(x=ut(te,16)),E==br&&(E=ut(te,20)),w==br&&(w=pa(te,32)),u==lo&&(u=pa(te,40)),f-=u}}if(f>=s.size&&(C=s.size-f-u-aa,f=s.size-u-aa),y!=x)throw new Error(jy);if(f<0)throw new Error(wh);let N=0,j=await Ht(s,f,u,E),I=ft(j);if(u){const L=l.offset-u;if(ut(I,N)!=oy&&f!=L){const J=f;f=L,f>J&&(C+=f-J),j=await Ht(s,f,u,E),I=ft(j)}}const _=l.offset-f-(s.lastDiskOffset||0);if(u!=_&&_>=0&&(u=_,j=await Ht(s,f,u,E),I=ft(j)),f<0||f>=s.size)throw new Error(wh);const T=Gt(n,t,I3),M=Gt(n,t,B3);for(let L=0;L>8==0,V=ee>>8==3,z=j.subarray(te,q),Z=Qt(I,N+32),O=re+Z,Y=j.subarray(re,O),B=W,$=W,ne=ut(I,N+38),se=ne&hm,G={readOnly:!!(se&OM),hidden:!!(se&PM),system:!!(se&FM),directory:!!(se&DM),archive:!!(se&MM)},me=ut(I,N+42)+C,ae=Gt(n,t,_3)||Vc,de=B?Ny:T||ky,Ae=$?Ny:M||ky;let Ne=ae(z,de);Ne===ht&&(Ne=Vc(z,de));let ke=ae(Y,Ae);ke===ht&&(ke=Vc(Y,Ae)),Object.assign(J,{versionMadeBy:ee,msDosCompatible:le,compressedSize:0,uncompressedSize:0,commentLength:Z,offset:me,diskNumberStart:Qt(I,N+34),internalFileAttributes:Qt(I,N+36),externalFileAttributes:ne,msdosAttributesRaw:se,msdosAttributes:G,rawFilename:z,filenameUTF8:B,commentUTF8:$,rawExtraField:j.subarray(q,re),rawComment:Y,filename:Ne,comment:ke}),S=Math.max(me,S),xS(J,J,I,N+6);const ye=J.externalFileAttributes>>16&br;J.unixMode===ht&&(ye&(QM|gh|ph))!=0&&(J.unixMode=ye);const We=!!(J.unixMode&LM),He=!!(J.unixMode&UM),Ve=!!(J.unixMode&zM),rt=J.unixMode!==ht?(J.unixMode&gh)!=0:V&&(ye&gh)!=0,wt=J.unixMode!==ht&&(J.unixMode&uy)==ph,mt=(ye&uy)==ph;Object.assign(J,{setuid:We,setgid:He,sticky:Ve,unixExternalUpper:ye,internalFileAttribute:J.internalFileAttributes,externalFileAttribute:J.externalFileAttributes,executable:rt,directory:wt||mt||le&&G.directory||Ne.endsWith(YM)&&!J.uncompressedSize,zipCrypto:J.encrypted&&!J.extraFieldAES});const nt=new Ey(J);nt.getData=(Wt,Pr)=>J.getData(Wt,nt,n.readRanges,Pr),nt.arrayBuffer=async Wt=>{const Pr=new TransformStream,[ko]=await Promise.all([new Response(Pr.readable).arrayBuffer(),J.getData(Pr,nt,n.readRanges,Wt)]);return ko},N=O;const{onprogress:$t}=t;if($t)try{await $t(L+1,w,new Ey(J))}catch{}yield nt}const D=Gt(n,t,R3),F=Gt(n,t,T3);return D&&(n.prependedData=S>0?await Ht(s,0,S):new Uint8Array),n.comment=p?await Ht(s,m+aa,p):new Uint8Array,F&&(n.appendedData=v>>8&hm:E>>>24&hm),outputSize:D?S:C,signature:E,compressed:v!=0&&!D,encrypted:l.encrypted&&!D,useWebWorkers:Gt(l,i,z3),useCompressionStream:se,transferStreams:Gt(l,i,G3),deflate64:ne,checkPasswordOnly:z},config:x,streamOptions:{signal:V,size:ee,onstart:Y,onprogress:B,onend:$}};Z&&await cL({reader:c,fileEntry:n,offset:u,diskNumberStart:f,signature:E,compressedSize:S,uncompressedSize:C,dataOffset:re,dataDescriptor:N||j.bitFlag.dataDescriptor,extraFieldZip64:p||j.extraFieldZip64,readRanges:s});let me;try{if(!O){z&&(t=new WritableStream),t=new HQ(t),await vd(t,D?S:C),{writable:me}=t;const{outputSize:ae}=await MQ({readable:le,writable:me},G);if(t.size+=ae,ae!=(D?S:C))throw new Error(J1)}}catch(ae){if(ae.outputSize!==ht&&(t.size+=ae.outputSize),!z||ae.message!=Dp)throw ae}finally{!Gt(l,i,H3)&&me&&!me.locked&&await me.getWriter().close()}return z||O?ht:t.getData?t.getData():me}}function vS(e,t,n){const s=e.rawBitFlag=Qt(t,n+2),i=(s&ly)==ly,l=ut(t,n+6);Object.assign(e,{encrypted:i,version:Qt(t,n),bitFlag:{level:(s&TM)>>1,dataDescriptor:(s&cy)==cy,languageEncodingFlag:(s&dy)==dy},rawLastModDate:l,lastModDate:uL(l),filenameLength:Qt(t,n+22),extraFieldLength:Qt(t,n+24)})}function xS(e,t,n,s,i){const{rawExtraField:l}=t,c=t.extraField=new Map,u=ft(new Uint8Array(l));let f=0;try{for(;ft[i]==l);for(let i=0,l=0;i=5&&(l.push(pm),c.push(gm));let u=1;l.forEach((f,m)=>{if(e.data.length>=u+4){const p=ut(s,u);t[f]=e[f]=new Date(p*1e3);const v=c[m];e[v]=p}u+=4})}async function cL({reader:e,fileEntry:t,offset:n,diskNumberStart:s,signature:i,compressedSize:l,uncompressedSize:c,dataOffset:u,dataDescriptor:f,extraFieldZip64:m,readRanges:p}){let v=0;if(s)for(let E=0;E=E.start&&y.start=0;x--)if(v[x]==l[0]&&v[x+1]==l[1]&&v[x+2]==l[2]&&v[x+3]==l[3])return{offset:p+x,buffer:v.slice(x,x+s).buffer}}}function Gt(e,t,n){return t[n]===ht?e.options[n]:t[n]}function uL(e){const t=(e&4294901760)>>16,n=e&br;try{return new Date(1980+((t&65024)>>9),((t&480)>>5)-1,t&31,(n&63488)>>11,(n&2016)>>5,(n&31)*2,0)}catch{}}function bh(e){return new Date(Number(e/BigInt(1e4)-BigInt(116444736e5)))}function Os(e,t){return e.getUint8(t)}function Qt(e,t){return e.getUint16(t,!0)}function ut(e,t){return e.getUint32(t,!0)}function pa(e,t){return Number(e.getBigUint64(t,!0))}function fL(e,t,n){e.setUint32(t,n,!0)}function ft(e){return new DataView(e.buffer)}try{ru({baseURI:import.meta.url})}catch{}const Sn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function hL(e){let t;e({wasmURI:()=>(t||(t="data:application/wasm;base64,"+(n=>{n=(c=>{const u=(c=(c+"").replace(/[^A-Za-z0-9+/=]/g,"")).length,f=[];for(let m=0;u>m;m+=4){const p=Sn.indexOf(c[m])<<18|Sn.indexOf(c[m+1])<<12|(63&Sn.indexOf(c[m+2]))<<6|63&Sn.indexOf(c[m+3]);f.push(p>>16&255),c[m+2]!=="="&&f.push(p>>8&255),c[m+3]!=="="&&f.push(255&p)}return new Uint8Array(f)})(n);let s=new Uint8Array(1024),i=0;for(let c=0;cv;v++)s[i++]=s[p+v]}else{const f=u;l(i+f);for(let m=0;f>m&&c{let u="";const f=c.length;let m=0;for(;f>m+2;m+=3){const v=c[m]<<16|c[m+1]<<8|c[m+2];u+=Sn[v>>18&63]+Sn[v>>12&63]+Sn[v>>6&63]+Sn[63&v]}const p=f-m;if(p===1){const v=c[m]<<16;u+=Sn[v>>18&63]+Sn[v>>12&63]+"=="}else if(p===2){const v=c[m]<<16|c[m+1]<<8;u+=Sn[v>>18&63]+Sn[v>>12&63]+Sn[v>>6&63]+"="}return u})(new Uint8Array(s.buffer.slice(0,i)));function l(c){if(s.lengthu;)u*=2;const f=new Uint8Array(u);f.set(s.subarray(0,i)),s=f}}})("FQBhc20BAAAAAUULYAF/AX9gAn9/AIEABYAACwIDf4IABwEBgAARAQaAAAuDAA6BABUDAGAAgAADgAANAQSBABUDAGAHgwAegAAfEgNCQQcABAEABAgIAAIABQIKAIAAB4EAAwEFgQAHAgICgQAHEAEDAAUGAAMDBQQJBAQJAQaAAAEeAAIEAwIEAgIBBAcDAwQFAXABDQ0FBgEBggKCAgYIgACYIkHQ1QQLB4oEHAZtZW1vcnkCAAxpbmZsYXRlOV9uZXcABw2GAA8HaW5pdAAIEYoAEAdfcmF3AAoQhgAUCXByb2Nlc3MAC4cARgZlbmQADhaGAA8QbGFzdF9jb25zdW1lZAARC4QAGYMAbYUANoMAbAEShQBYhwBrARSFAH+DABMHZ3ppcAAVD4UAFIUAfgEWhgBWgQB9AhgVhQAOjQB8AmRliQB8hQAOggB8AhoQiQAPggB8AhsRigATggB8AhwPhQAUhQB8AR2GAFaBAHwJHwRmcmVlAAIVhQAVjACDCgZtYWxsb2MAAQuCAFUKaWFsaXplAAAZX4AADxZkaXJlY3RfZnVuY3Rpb25fdGFibGUBgAAcG2Vtc2NyaXB0ZW5fc3RhY2tfcmVzdG9yZQAFHI4AGwJnZYAAbw51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AAAQBMIAABAE4gAAEAUCAAAQBUIAABIEGvQFwgAAEAYCAAAQBoIAABAHAgAAEAeCAAG8DHwtyjQBvgQBrgQBngQBjgQBfgQBbgQBXgQBTgQBPgQBLgQBHgQBDgQE8AYCvAEGAUc0CC22BAMcBBIAAAgEIgAAEgQEzgQJLARCAAA6DAAyBnqyAqmuEACSBB3OBAE8BCIAACIEAGIUADIEIt4MADAEggQCUgDKEgQBrAYCBCC8BBIMADIA/SAoBABAMAEGRIQv/gCUfgMDAgIKxBQgJCQoKgEk3gAABAQ2AAAEBDoAAAQEPgAABARCEAAEBEYQAAQEShAABAROEAAEBFIwAAQEVjAABARaMAAEBF4wAAQEYnAABARmcAAEBGpwAAQEbmwABARyBffsEBAQFBYHB1QEHgAABAQiEAAGAXSqCAAEBCowAAYAnsooAAYEBMJkAAYEBTJkAAYEBaLkAAYEBpLkAAYIDdYABzoUBvI0BqJ0BkLwBgAIbHLwAAQEdvAABgA9PgH05A9AqAQ==")),t)})}let xt,ga,Nn,Oi;function mL(e){if(xt=e,{malloc:ga,free:Nn,memory:Oi}=xt,typeof ga!="function"||typeof Nn!="function"||!Oi)throw xt=ga=Nn=Oi=null,new Error("Invalid WASM module")}function yS(e,t,n={}){const s=typeof n.level=="number"?n.level:-1,i=typeof n.outBuffer=="number"?n.outBuffer:64*1024,l=typeof n.inBufferSize=="number"?n.inBufferSize:64*1024;return new TransformStream({start(){let c;if(this.out=ga(i),this.in=ga(l),this.inBufferSize=l,this._scratch=new Uint8Array(i),e?(this._process=xt.deflate_process,this._last_consumed=xt.deflate_last_consumed,this._end=xt.deflate_end,this.streamHandle=xt.deflate_new(),t==="gzip"?c=xt.deflate_init_gzip(this.streamHandle,s):t==="deflate-raw"?c=xt.deflate_init_raw(this.streamHandle,s):c=xt.deflate_init(this.streamHandle,s)):t==="deflate64-raw"?(this._process=xt.inflate9_process,this._last_consumed=xt.inflate9_last_consumed,this._end=xt.inflate9_end,this.streamHandle=xt.inflate9_new(),c=xt.inflate9_init_raw(this.streamHandle)):(this._process=xt.inflate_process,this._last_consumed=xt.inflate_last_consumed,this._end=xt.inflate_end,this.streamHandle=xt.inflate_new(),t==="deflate-raw"?c=xt.inflate_init_raw(this.streamHandle):t==="gzip"?c=xt.inflate_init_gzip(this.streamHandle):c=xt.inflate_init(this.streamHandle)),c!==0)throw new Error("init failed:"+c)},transform(c,u){try{const f=c,m=new Uint8Array(Oi.buffer),p=this._process,v=this._last_consumed,x=this.out,y=this._scratch;let E=0;for(;E>24&255,I=j&128?j-256:j;if(I<0)throw new Error("process error:"+I)}const N=v(this.streamHandle);if(N===0)break;E+=N}}catch(f){this._end&&this.streamHandle&&this._end(this.streamHandle),this.in&&Nn&&Nn(this.in),this.out&&Nn&&Nn(this.out),u.error(f)}},flush(c){try{const u=new Uint8Array(Oi.buffer),f=this._process,m=this.out,p=this._scratch;for(;;){const v=f(this.streamHandle,0,0,m,i,4),x=v&16777215,y=v>>24&255;if(!e){const E=y&128?y-256:y;if(E<0)throw new Error("process error:"+E)}if(x&&(p.set(u.subarray(m,m+x),0),c.enqueue(p.slice(0,x))),y===1||x===0)break}}catch(u){c.error(u)}finally{if(this._end&&this.streamHandle){const u=this._end(this.streamHandle);u!==0&&c.error(new Error("end error:"+u))}this.in&&Nn&&Nn(this.in),this.out&&Nn&&Nn(this.out)}}})}class pL{constructor(t="deflate",n){return yS(!0,t,n)}}class gL{constructor(t="deflate",n){return yS(!1,t,n)}}let Ry=!1;async function AL(e,{baseURI:t}){if(!Ry){let n,s;try{try{s=new URL(e,t)}catch{}n=await(await fetch(s)).arrayBuffer()}catch(l){if(e.startsWith("data:application/wasm;base64,"))n=vL(e);else throw l}const i=await WebAssembly.instantiate(n);mL(i.instance.exports),Ry=!0}}function vL(e){const t=e.split(",")[1],n=atob(t),s=n.length,i=new Uint8Array(s);for(let l=0;l{if(!Ch){let{wasmURI:t}=e;typeof t==No&&(t=t()),Ch=AL(t,e)}return Ch}});ru({CompressionStreamZlib:pL,DecompressionStreamZlib:gL});const Eh={application:{"andrew-inset":"ez",annodex:"anx","atom+xml":"atom","atomcat+xml":"atomcat","atomserv+xml":"atomsrv",bbolin:"lin","cu-seeme":"cu","davmount+xml":"davmount",dsptype:"tsp",ecmascript:["es","ecma"],futuresplash:"spl",hta:"hta","java-archive":"jar","java-serialized-object":"ser","java-vm":"class",m3g:"m3g","mac-binhex40":"hqx",mathematica:["nb","ma","mb"],msaccess:"mdb",msword:["doc","dot","wiz"],mxf:"mxf",oda:"oda",ogg:"ogx",pdf:"pdf","pgp-keys":"key","pgp-signature":["asc","sig"],"pics-rules":"prf",postscript:["ps","ai","eps","epsi","epsf","eps2","eps3"],rar:"rar","rdf+xml":"rdf","rss+xml":"rss",rtf:"rtf","xhtml+xml":["xhtml","xht"],xml:["xml","xsl","xsd","xpdl"],"xspf+xml":"xspf",zip:"zip","vnd.android.package-archive":"apk","vnd.cinderella":"cdy","vnd.google-earth.kml+xml":"kml","vnd.google-earth.kmz":"kmz","vnd.mozilla.xul+xml":"xul","vnd.ms-excel":["xls","xlb","xlt","xlm","xla","xlc","xlw"],"vnd.ms-pki.seccat":"cat","vnd.ms-pki.stl":"stl","vnd.ms-powerpoint":["ppt","pps","pot","ppa","pwz"],"vnd.oasis.opendocument.chart":"odc","vnd.oasis.opendocument.database":"odb","vnd.oasis.opendocument.formula":"odf","vnd.oasis.opendocument.graphics":"odg","vnd.oasis.opendocument.graphics-template":"otg","vnd.oasis.opendocument.image":"odi","vnd.oasis.opendocument.presentation":"odp","vnd.oasis.opendocument.presentation-template":"otp","vnd.oasis.opendocument.spreadsheet":"ods","vnd.oasis.opendocument.spreadsheet-template":"ots","vnd.oasis.opendocument.text":"odt","vnd.oasis.opendocument.text-master":["odm","otm"],"vnd.oasis.opendocument.text-template":"ott","vnd.oasis.opendocument.text-web":"oth","vnd.openxmlformats-officedocument.spreadsheetml.sheet":"xlsx","vnd.openxmlformats-officedocument.spreadsheetml.template":"xltx","vnd.openxmlformats-officedocument.presentationml.presentation":"pptx","vnd.openxmlformats-officedocument.presentationml.slideshow":"ppsx","vnd.openxmlformats-officedocument.presentationml.template":"potx","vnd.openxmlformats-officedocument.wordprocessingml.document":"docx","vnd.openxmlformats-officedocument.wordprocessingml.template":"dotx","vnd.smaf":"mmf","vnd.stardivision.calc":"sdc","vnd.stardivision.chart":"sds","vnd.stardivision.draw":"sda","vnd.stardivision.impress":"sdd","vnd.stardivision.math":["sdf","smf"],"vnd.stardivision.writer":["sdw","vor"],"vnd.stardivision.writer-global":"sgl","vnd.sun.xml.calc":"sxc","vnd.sun.xml.calc.template":"stc","vnd.sun.xml.draw":"sxd","vnd.sun.xml.draw.template":"std","vnd.sun.xml.impress":"sxi","vnd.sun.xml.impress.template":"sti","vnd.sun.xml.math":"sxm","vnd.sun.xml.writer":"sxw","vnd.sun.xml.writer.global":"sxg","vnd.sun.xml.writer.template":"stw","vnd.symbian.install":["sis","sisx"],"vnd.visio":["vsd","vst","vss","vsw","vsdx","vssx","vstx","vssm","vstm"],"vnd.wap.wbxml":"wbxml","vnd.wap.wmlc":"wmlc","vnd.wap.wmlscriptc":"wmlsc","vnd.wordperfect":"wpd","vnd.wordperfect5.1":"wp5","x-123":"wk","x-7z-compressed":"7z","x-abiword":"abw","x-apple-diskimage":"dmg","x-bcpio":"bcpio","x-bittorrent":"torrent","x-cbr":["cbr","cba","cbt","cb7"],"x-cbz":"cbz","x-cdf":["cdf","cda"],"x-cdlink":"vcd","x-chess-pgn":"pgn","x-cpio":"cpio","x-csh":"csh","x-director":["dir","dxr","cst","cct","cxt","w3d","fgd","swa"],"x-dms":"dms","x-doom":"wad","x-dvi":"dvi","x-httpd-eruby":"rhtml","x-font":"pcf.Z","x-freemind":"mm","x-gnumeric":"gnumeric","x-go-sgf":"sgf","x-graphing-calculator":"gcf","x-gtar":["gtar","taz"],"x-hdf":"hdf","x-httpd-php":["phtml","pht","php"],"x-httpd-php-source":"phps","x-httpd-php3":"php3","x-httpd-php3-preprocessed":"php3p","x-httpd-php4":"php4","x-httpd-php5":"php5","x-ica":"ica","x-info":"info","x-internet-signup":["ins","isp"],"x-iphone":"iii","x-iso9660-image":"iso","x-java-jnlp-file":"jnlp","x-jmol":"jmz","x-killustrator":"kil","x-latex":"latex","x-lyx":"lyx","x-lzx":"lzx","x-maker":["frm","fb","fbdoc"],"x-ms-wmd":"wmd","x-msdos-program":["com","exe","bat","dll"],"x-netcdf":["nc"],"x-ns-proxy-autoconfig":["pac","dat"],"x-nwc":"nwc","x-object":"o","x-oz-application":"oza","x-pkcs7-certreqresp":"p7r","x-python-code":["pyc","pyo"],"x-qgis":["qgs","shp","shx"],"x-quicktimeplayer":"qtl","x-redhat-package-manager":["rpm","rpa"],"x-ruby":"rb","x-sh":"sh","x-shar":"shar","x-shockwave-flash":["swf","swfl"],"x-silverlight":"scr","x-stuffit":"sit","x-sv4cpio":"sv4cpio","x-sv4crc":"sv4crc","x-tar":"tar","x-tex-gf":"gf","x-tex-pk":"pk","x-texinfo":["texinfo","texi"],"x-trash":["~","%","bak","old","sik"],"x-ustar":"ustar","x-wais-source":"src","x-wingz":"wz","x-x509-ca-cert":["crt","der","cer"],"x-xcf":"xcf","x-xfig":"fig","x-xpinstall":"xpi",applixware:"aw","atomsvc+xml":"atomsvc","ccxml+xml":"ccxml","cdmi-capability":"cdmia","cdmi-container":"cdmic","cdmi-domain":"cdmid","cdmi-object":"cdmio","cdmi-queue":"cdmiq","docbook+xml":"dbk","dssc+der":"dssc","dssc+xml":"xdssc","emma+xml":"emma","epub+zip":"epub",exi:"exi","font-tdpfr":"pfr","gml+xml":"gml","gpx+xml":"gpx",gxf:"gxf",hyperstudio:"stk","inkml+xml":["ink","inkml"],ipfix:"ipfix","jsonml+json":"jsonml","lost+xml":"lostxml","mads+xml":"mads",marc:"mrc","marcxml+xml":"mrcx","mathml+xml":["mathml","mml"],mbox:"mbox","mediaservercontrol+xml":"mscml","metalink+xml":"metalink","metalink4+xml":"meta4","mets+xml":"mets","mods+xml":"mods",mp21:["m21","mp21"],mp4:"mp4s","oebps-package+xml":"opf","omdoc+xml":"omdoc",onenote:["onetoc","onetoc2","onetmp","onepkg"],oxps:"oxps","patch-ops-error+xml":"xer","pgp-encrypted":"pgp",pkcs10:"p10","pkcs7-mime":["p7m","p7c"],"pkcs7-signature":"p7s",pkcs8:"p8","pkix-attr-cert":"ac","pkix-crl":"crl","pkix-pkipath":"pkipath",pkixcmp:"pki","pls+xml":"pls","prs.cww":"cww","pskc+xml":"pskcxml","reginfo+xml":"rif","relax-ng-compact-syntax":"rnc","resource-lists+xml":"rl","resource-lists-diff+xml":"rld","rls-services+xml":"rs","rpki-ghostbusters":"gbr","rpki-manifest":"mft","rpki-roa":"roa","rsd+xml":"rsd","sbml+xml":"sbml","scvp-cv-request":"scq","scvp-cv-response":"scs","scvp-vp-request":"spq","scvp-vp-response":"spp",sdp:"sdp","set-payment-initiation":"setpay","set-registration-initiation":"setreg","shf+xml":"shf","sparql-query":"rq","sparql-results+xml":"srx",srgs:"gram","srgs+xml":"grxml","sru+xml":"sru","ssdl+xml":"ssdl","ssml+xml":"ssml","tei+xml":["tei","teicorpus"],"thraud+xml":"tfi","timestamped-data":"tsd","vnd.3gpp.pic-bw-large":"plb","vnd.3gpp.pic-bw-small":"psb","vnd.3gpp.pic-bw-var":"pvb","vnd.3gpp2.tcap":"tcap","vnd.3m.post-it-notes":"pwn","vnd.accpac.simply.aso":"aso","vnd.accpac.simply.imp":"imp","vnd.acucobol":"acu","vnd.acucorp":["atc","acutc"],"vnd.adobe.air-application-installer-package+zip":"air","vnd.adobe.formscentral.fcdt":"fcdt","vnd.adobe.fxp":["fxp","fxpl"],"vnd.adobe.xdp+xml":"xdp","vnd.adobe.xfdf":"xfdf","vnd.ahead.space":"ahead","vnd.airzip.filesecure.azf":"azf","vnd.airzip.filesecure.azs":"azs","vnd.amazon.ebook":"azw","vnd.americandynamics.acc":"acc","vnd.amiga.ami":"ami","vnd.anser-web-certificate-issue-initiation":"cii","vnd.anser-web-funds-transfer-initiation":"fti","vnd.antix.game-component":"atx","vnd.apple.installer+xml":"mpkg","vnd.apple.mpegurl":"m3u8","vnd.aristanetworks.swi":"swi","vnd.astraea-software.iota":"iota","vnd.audiograph":"aep","vnd.blueice.multipass":"mpm","vnd.bmi":"bmi","vnd.businessobjects":"rep","vnd.chemdraw+xml":"cdxml","vnd.chipnuts.karaoke-mmd":"mmd","vnd.claymore":"cla","vnd.cloanto.rp9":"rp9","vnd.clonk.c4group":["c4g","c4d","c4f","c4p","c4u"],"vnd.cluetrust.cartomobile-config":"c11amc","vnd.cluetrust.cartomobile-config-pkg":"c11amz","vnd.commonspace":"csp","vnd.contact.cmsg":"cdbcmsg","vnd.cosmocaller":"cmc","vnd.crick.clicker":"clkx","vnd.crick.clicker.keyboard":"clkk","vnd.crick.clicker.palette":"clkp","vnd.crick.clicker.template":"clkt","vnd.crick.clicker.wordbank":"clkw","vnd.criticaltools.wbs+xml":"wbs","vnd.ctc-posml":"pml","vnd.cups-ppd":"ppd","vnd.curl.car":"car","vnd.curl.pcurl":"pcurl","vnd.dart":"dart","vnd.data-vision.rdz":"rdz","vnd.dece.data":["uvf","uvvf","uvd","uvvd"],"vnd.dece.ttml+xml":["uvt","uvvt"],"vnd.dece.unspecified":["uvx","uvvx"],"vnd.dece.zip":["uvz","uvvz"],"vnd.denovo.fcselayout-link":"fe_launch","vnd.dna":"dna","vnd.dolby.mlp":"mlp","vnd.dpgraph":"dpg","vnd.dreamfactory":"dfac","vnd.ds-keypoint":"kpxx","vnd.dvb.ait":"ait","vnd.dvb.service":"svc","vnd.dynageo":"geo","vnd.ecowin.chart":"mag","vnd.enliven":"nml","vnd.epson.esf":"esf","vnd.epson.msf":"msf","vnd.epson.quickanime":"qam","vnd.epson.salt":"slt","vnd.epson.ssf":"ssf","vnd.eszigno3+xml":["es3","et3"],"vnd.ezpix-album":"ez2","vnd.ezpix-package":"ez3","vnd.fdf":"fdf","vnd.fdsn.mseed":"mseed","vnd.fdsn.seed":["seed","dataless"],"vnd.flographit":"gph","vnd.fluxtime.clip":"ftc","vnd.framemaker":["fm","frame","maker","book"],"vnd.frogans.fnc":"fnc","vnd.frogans.ltf":"ltf","vnd.fsc.weblaunch":"fsc","vnd.fujitsu.oasys":"oas","vnd.fujitsu.oasys2":"oa2","vnd.fujitsu.oasys3":"oa3","vnd.fujitsu.oasysgp":"fg5","vnd.fujitsu.oasysprs":"bh2","vnd.fujixerox.ddd":"ddd","vnd.fujixerox.docuworks":"xdw","vnd.fujixerox.docuworks.binder":"xbd","vnd.fuzzysheet":"fzs","vnd.genomatix.tuxedo":"txd","vnd.geogebra.file":"ggb","vnd.geogebra.tool":"ggt","vnd.geometry-explorer":["gex","gre"],"vnd.geonext":"gxt","vnd.geoplan":"g2w","vnd.geospace":"g3w","vnd.gmx":"gmx","vnd.grafeq":["gqf","gqs"],"vnd.groove-account":"gac","vnd.groove-help":"ghf","vnd.groove-identity-message":"gim","vnd.groove-injector":"grv","vnd.groove-tool-message":"gtm","vnd.groove-tool-template":"tpl","vnd.groove-vcard":"vcg","vnd.hal+xml":"hal","vnd.handheld-entertainment+xml":"zmm","vnd.hbci":"hbci","vnd.hhe.lesson-player":"les","vnd.hp-hpgl":"hpgl","vnd.hp-hpid":"hpid","vnd.hp-hps":"hps","vnd.hp-jlyt":"jlt","vnd.hp-pcl":"pcl","vnd.hp-pclxl":"pclxl","vnd.hydrostatix.sof-data":"sfd-hdstx","vnd.ibm.minipay":"mpy","vnd.ibm.modcap":["afp","listafp","list3820"],"vnd.ibm.rights-management":"irm","vnd.ibm.secure-container":"sc","vnd.iccprofile":["icc","icm"],"vnd.igloader":"igl","vnd.immervision-ivp":"ivp","vnd.immervision-ivu":"ivu","vnd.insors.igm":"igm","vnd.intercon.formnet":["xpw","xpx"],"vnd.intergeo":"i2g","vnd.intu.qbo":"qbo","vnd.intu.qfx":"qfx","vnd.ipunplugged.rcprofile":"rcprofile","vnd.irepository.package+xml":"irp","vnd.is-xpr":"xpr","vnd.isac.fcs":"fcs","vnd.jam":"jam","vnd.jcp.javame.midlet-rms":"rms","vnd.jisp":"jisp","vnd.joost.joda-archive":"joda","vnd.kahootz":["ktz","ktr"],"vnd.kde.karbon":"karbon","vnd.kde.kchart":"chrt","vnd.kde.kformula":"kfo","vnd.kde.kivio":"flw","vnd.kde.kontour":"kon","vnd.kde.kpresenter":["kpr","kpt"],"vnd.kde.kspread":"ksp","vnd.kde.kword":["kwd","kwt"],"vnd.kenameaapp":"htke","vnd.kidspiration":"kia","vnd.kinar":["kne","knp"],"vnd.koan":["skp","skd","skt","skm"],"vnd.kodak-descriptor":"sse","vnd.las.las+xml":"lasxml","vnd.llamagraphics.life-balance.desktop":"lbd","vnd.llamagraphics.life-balance.exchange+xml":"lbe","vnd.lotus-1-2-3":"123","vnd.lotus-approach":"apr","vnd.lotus-freelance":"pre","vnd.lotus-notes":"nsf","vnd.lotus-organizer":"org","vnd.lotus-screencam":"scm","vnd.lotus-wordpro":"lwp","vnd.macports.portpkg":"portpkg","vnd.mcd":"mcd","vnd.medcalcdata":"mc1","vnd.mediastation.cdkey":"cdkey","vnd.mfer":"mwf","vnd.mfmp":"mfm","vnd.micrografx.flo":"flo","vnd.micrografx.igx":"igx","vnd.mif":"mif","vnd.mobius.daf":"daf","vnd.mobius.dis":"dis","vnd.mobius.mbk":"mbk","vnd.mobius.mqy":"mqy","vnd.mobius.msl":"msl","vnd.mobius.plc":"plc","vnd.mobius.txf":"txf","vnd.mophun.application":"mpn","vnd.mophun.certificate":"mpc","vnd.ms-artgalry":"cil","vnd.ms-cab-compressed":"cab","vnd.ms-excel.addin.macroenabled.12":"xlam","vnd.ms-excel.sheet.binary.macroenabled.12":"xlsb","vnd.ms-excel.sheet.macroenabled.12":"xlsm","vnd.ms-excel.template.macroenabled.12":"xltm","vnd.ms-fontobject":"eot","vnd.ms-htmlhelp":"chm","vnd.ms-ims":"ims","vnd.ms-lrm":"lrm","vnd.ms-officetheme":"thmx","vnd.ms-powerpoint.addin.macroenabled.12":"ppam","vnd.ms-powerpoint.presentation.macroenabled.12":"pptm","vnd.ms-powerpoint.slide.macroenabled.12":"sldm","vnd.ms-powerpoint.slideshow.macroenabled.12":"ppsm","vnd.ms-powerpoint.template.macroenabled.12":"potm","vnd.ms-project":["mpp","mpt"],"vnd.ms-word.document.macroenabled.12":"docm","vnd.ms-word.template.macroenabled.12":"dotm","vnd.ms-works":["wps","wks","wcm","wdb"],"vnd.ms-wpl":"wpl","vnd.ms-xpsdocument":"xps","vnd.mseq":"mseq","vnd.musician":"mus","vnd.muvee.style":"msty","vnd.mynfc":"taglet","vnd.neurolanguage.nlu":"nlu","vnd.nitf":["ntf","nitf"],"vnd.noblenet-directory":"nnd","vnd.noblenet-sealer":"nns","vnd.noblenet-web":"nnw","vnd.nokia.n-gage.data":"ngdat","vnd.nokia.n-gage.symbian.install":"n-gage","vnd.nokia.radio-preset":"rpst","vnd.nokia.radio-presets":"rpss","vnd.novadigm.edm":"edm","vnd.novadigm.edx":"edx","vnd.novadigm.ext":"ext","vnd.oasis.opendocument.chart-template":"otc","vnd.oasis.opendocument.formula-template":"odft","vnd.oasis.opendocument.image-template":"oti","vnd.olpc-sugar":"xo","vnd.oma.dd2+xml":"dd2","vnd.openofficeorg.extension":"oxt","vnd.openxmlformats-officedocument.presentationml.slide":"sldx","vnd.osgeo.mapguide.package":"mgp","vnd.osgi.dp":"dp","vnd.osgi.subsystem":"esa","vnd.palm":["pdb","pqa","oprc"],"vnd.pawaafile":"paw","vnd.pg.format":"str","vnd.pg.osasli":"ei6","vnd.picsel":"efif","vnd.pmi.widget":"wg","vnd.pocketlearn":"plf","vnd.powerbuilder6":"pbd","vnd.previewsystems.box":"box","vnd.proteus.magazine":"mgz","vnd.publishare-delta-tree":"qps","vnd.pvi.ptid1":"ptid","vnd.quark.quarkxpress":["qxd","qxt","qwd","qwt","qxl","qxb"],"vnd.realvnc.bed":"bed","vnd.recordare.musicxml":"mxl","vnd.recordare.musicxml+xml":"musicxml","vnd.rig.cryptonote":"cryptonote","vnd.rn-realmedia":"rm","vnd.rn-realmedia-vbr":"rmvb","vnd.route66.link66+xml":"link66","vnd.sailingtracker.track":"st","vnd.seemail":"see","vnd.sema":"sema","vnd.semd":"semd","vnd.semf":"semf","vnd.shana.informed.formdata":"ifm","vnd.shana.informed.formtemplate":"itp","vnd.shana.informed.interchange":"iif","vnd.shana.informed.package":"ipk","vnd.simtech-mindmapper":["twd","twds"],"vnd.smart.teacher":"teacher","vnd.solent.sdkm+xml":["sdkm","sdkd"],"vnd.spotfire.dxp":"dxp","vnd.spotfire.sfs":"sfs","vnd.stepmania.package":"smzip","vnd.stepmania.stepchart":"sm","vnd.sus-calendar":["sus","susp"],"vnd.svd":"svd","vnd.syncml+xml":"xsm","vnd.syncml.dm+wbxml":"bdm","vnd.syncml.dm+xml":"xdm","vnd.tao.intent-module-archive":"tao","vnd.tcpdump.pcap":["pcap","cap","dmp"],"vnd.tmobile-livetv":"tmo","vnd.trid.tpt":"tpt","vnd.triscape.mxs":"mxs","vnd.trueapp":"tra","vnd.ufdl":["ufd","ufdl"],"vnd.uiq.theme":"utz","vnd.umajin":"umj","vnd.unity":"unityweb","vnd.uoml+xml":"uoml","vnd.vcx":"vcx","vnd.visionary":"vis","vnd.vsf":"vsf","vnd.webturbo":"wtb","vnd.wolfram.player":"nbp","vnd.wqd":"wqd","vnd.wt.stf":"stf","vnd.xara":"xar","vnd.xfdl":"xfdl","vnd.yamaha.hv-dic":"hvd","vnd.yamaha.hv-script":"hvs","vnd.yamaha.hv-voice":"hvp","vnd.yamaha.openscoreformat":"osf","vnd.yamaha.openscoreformat.osfpvg+xml":"osfpvg","vnd.yamaha.smaf-audio":"saf","vnd.yamaha.smaf-phrase":"spf","vnd.yellowriver-custom-menu":"cmp","vnd.zul":["zir","zirz"],"vnd.zzazz.deck+xml":"zaz","voicexml+xml":"vxml",widget:"wgt",winhlp:"hlp","wsdl+xml":"wsdl","wspolicy+xml":"wspolicy","x-ace-compressed":"ace","x-authorware-bin":["aab","x32","u32","vox"],"x-authorware-map":"aam","x-authorware-seg":"aas","x-blorb":["blb","blorb"],"x-bzip":"bz","x-bzip2":["bz2","boz"],"x-cfs-compressed":"cfs","x-chat":"chat","x-conference":"nsc","x-dgc-compressed":"dgc","x-dtbncx+xml":"ncx","x-dtbook+xml":"dtb","x-dtbresource+xml":"res","x-eva":"eva","x-font-bdf":"bdf","x-font-ghostscript":"gsf","x-font-linux-psf":"psf","x-font-pcf":"pcf","x-font-snf":"snf","x-font-ttf":["ttf","ttc"],"x-font-type1":["pfa","pfb","pfm","afm"],"x-freearc":"arc","x-gca-compressed":"gca","x-glulx":"ulx","x-gramps-xml":"gramps","x-install-instructions":"install","x-lzh-compressed":["lzh","lha"],"x-mie":"mie","x-mobipocket-ebook":["prc","mobi"],"x-ms-application":"application","x-ms-shortcut":"lnk","x-ms-xbap":"xbap","x-msbinder":"obd","x-mscardfile":"crd","x-msclip":"clp","application/x-ms-installer":"msi","x-msmediaview":["mvb","m13","m14"],"x-msmetafile":["wmf","wmz","emf","emz"],"x-msmoney":"mny","x-mspublisher":"pub","x-msschedule":"scd","x-msterminal":"trm","x-mswrite":"wri","x-nzb":"nzb","x-pkcs12":["p12","pfx"],"x-pkcs7-certificates":["p7b","spc"],"x-research-info-systems":"ris","x-silverlight-app":"xap","x-sql":"sql","x-stuffitx":"sitx","x-subrip":"srt","x-t3vm-image":"t3","x-tex-tfm":"tfm","x-tgif":"obj","x-xliff+xml":"xlf","x-xz":"xz","x-zmachine":["z1","z2","z3","z4","z5","z6","z7","z8"],"xaml+xml":"xaml","xcap-diff+xml":"xdf","xenc+xml":"xenc","xml-dtd":"dtd","xop+xml":"xop","xproc+xml":"xpl","xslt+xml":"xslt","xv+xml":["mxml","xhvml","xvml","xvm"],yang:"yang","yin+xml":"yin",envoy:"evy",fractals:"fif","internet-property-stream":"acx",olescript:"axs","vnd.ms-outlook":"msg","vnd.ms-pkicertstore":"sst","x-compress":"z","x-perfmon":["pma","pmc","pmr","pmw"],"ynd.ms-pkipko":"pko",gzip:["gz","tgz"],"smil+xml":["smi","smil"],"vnd.debian.binary-package":["deb","udeb"],"vnd.hzn-3d-crossword":"x3d","vnd.sqlite3":["db","sqlite","sqlite3","db-wal","sqlite-wal","db-shm","sqlite-shm"],"vnd.wap.sic":"sic","vnd.wap.slc":"slc","x-krita":["kra","krz"],"x-perl":["pm","pl"],yaml:["yaml","yml"]},audio:{amr:"amr","amr-wb":"awb",annodex:"axa",basic:["au","snd"],flac:"flac",midi:["mid","midi","kar","rmi"],mpeg:["mpga","mpega","mp3","m4a","mp2a","m2a","m3a"],mpegurl:"m3u",ogg:["oga","ogg","spx"],"prs.sid":"sid","x-aiff":"aifc","x-gsm":"gsm","x-ms-wma":"wma","x-ms-wax":"wax","x-pn-realaudio":"ram","x-realaudio":"ra","x-sd2":"sd2",adpcm:"adp",mp4:"mp4a",s3m:"s3m",silk:"sil","vnd.dece.audio":["uva","uvva"],"vnd.digital-winds":"eol","vnd.dra":"dra","vnd.dts":"dts","vnd.dts.hd":"dtshd","vnd.lucent.voice":"lvp","vnd.ms-playready.media.pya":"pya","vnd.nuera.ecelp4800":"ecelp4800","vnd.nuera.ecelp7470":"ecelp7470","vnd.nuera.ecelp9600":"ecelp9600","vnd.rip":"rip",webm:"weba","x-caf":"caf","x-matroska":"mka","x-pn-realaudio-plugin":"rmp",xm:"xm",aac:"aac",aiff:["aiff","aif","aff"],opus:"opus",wav:"wav"},chemical:{"x-alchemy":"alc","x-cache":["cac","cache"],"x-cache-csf":"csf","x-cactvs-binary":["cbin","cascii","ctab"],"x-cdx":"cdx","x-chem3d":"c3d","x-cif":"cif","x-cmdf":"cmdf","x-cml":"cml","x-compass":"cpa","x-crossfire":"bsd","x-csml":["csml","csm"],"x-ctx":"ctx","x-cxf":["cxf","cef"],"x-embl-dl-nucleotide":["emb","embl"],"x-gamess-input":["inp","gam","gamin"],"x-gaussian-checkpoint":["fch","fchk"],"x-gaussian-cube":"cub","x-gaussian-input":["gau","gjc","gjf"],"x-gaussian-log":"gal","x-gcg8-sequence":"gcg","x-genbank":"gen","x-hin":"hin","x-isostar":["istr","ist"],"x-jcamp-dx":["jdx","dx"],"x-kinemage":"kin","x-macmolecule":"mcm","x-macromodel-input":"mmod","x-mdl-molfile":"mol","x-mdl-rdfile":"rd","x-mdl-rxnfile":"rxn","x-mdl-sdfile":"sd","x-mdl-tgf":"tgf","x-mmcif":"mcif","x-mol2":"mol2","x-molconn-Z":"b","x-mopac-graph":"gpt","x-mopac-input":["mop","mopcrt","zmt"],"x-mopac-out":"moo","x-ncbi-asn1":"asn","x-ncbi-asn1-ascii":["prt","ent"],"x-ncbi-asn1-binary":"val","x-rosdal":"ros","x-swissprot":"sw","x-vamas-iso14976":"vms","x-vmd":"vmd","x-xtel":"xtel","x-xyz":"xyz"},font:{otf:"otf",woff:"woff",woff2:"woff2"},image:{gif:"gif",ief:"ief",jpeg:["jpeg","jpg","jpe","jfif","jfif-tbnl","jif"],pcx:"pcx",png:"png","svg+xml":["svg","svgz"],tiff:["tiff","tif"],"vnd.djvu":["djvu","djv"],"vnd.wap.wbmp":"wbmp","x-canon-cr2":"cr2","x-canon-crw":"crw","x-cmu-raster":"ras","x-coreldraw":"cdr","x-coreldrawpattern":"pat","x-coreldrawtemplate":"cdt","x-corelphotopaint":"cpt","x-epson-erf":"erf","x-icon":"ico","x-jg":"art","x-jng":"jng","x-nikon-nef":"nef","x-olympus-orf":"orf","x-portable-anymap":"pnm","x-portable-bitmap":"pbm","x-portable-graymap":"pgm","x-portable-pixmap":"ppm","x-rgb":"rgb","x-xbitmap":"xbm","x-xpixmap":"xpm","x-xwindowdump":"xwd",bmp:"bmp",cgm:"cgm",g3fax:"g3",ktx:"ktx","prs.btif":"btif",sgi:"sgi","vnd.dece.graphic":["uvi","uvvi","uvg","uvvg"],"vnd.dwg":"dwg","vnd.dxf":"dxf","vnd.fastbidsheet":"fbs","vnd.fpx":"fpx","vnd.fst":"fst","vnd.fujixerox.edmics-mmr":"mmr","vnd.fujixerox.edmics-rlc":"rlc","vnd.ms-modi":"mdi","vnd.ms-photo":"wdp","vnd.net-fpx":"npx","vnd.xiff":"xif",webp:"webp","x-3ds":"3ds","x-cmx":"cmx","x-freehand":["fh","fhc","fh4","fh5","fh7"],"x-pict":["pic","pct"],"x-tga":"tga","cis-cod":"cod",avif:"avifs",heic:["heif","heic"],pjpeg:["pjpg"],"vnd.adobe.photoshop":"psd","x-adobe-dng":"dng","x-fuji-raf":"raf","x-icns":"icns","x-kodak-dcr":"dcr","x-kodak-k25":"k25","x-kodak-kdc":"kdc","x-minolta-mrw":"mrw","x-panasonic-raw":["raw","rw2","rwl"],"x-pentax-pef":["pef","ptx"],"x-sigma-x3f":"x3f","x-sony-arw":"arw","x-sony-sr2":"sr2","x-sony-srf":"srf"},message:{rfc822:["eml","mime","mht","mhtml","nws"]},model:{iges:["igs","iges"],mesh:["msh","mesh","silo"],vrml:["wrl","vrml"],"x3d+vrml":["x3dv","x3dvz"],"x3d+xml":"x3dz","x3d+binary":["x3db","x3dbz"],"vnd.collada+xml":"dae","vnd.dwf":"dwf","vnd.gdl":"gdl","vnd.gtw":"gtw","vnd.mts":"mts","vnd.usdz+zip":"usdz","vnd.vtu":"vtu"},text:{"cache-manifest":["manifest","appcache"],calendar:["ics","icz","ifb"],css:"css",csv:"csv",h323:"323",html:["html","htm","shtml","stm"],iuls:"uls",plain:["txt","text","brf","conf","def","list","log","in","bas","diff","ksh"],richtext:"rtx",scriptlet:["sct","wsc"],texmacs:"tm","tab-separated-values":"tsv","vnd.sun.j2me.app-descriptor":"jad","vnd.wap.wml":"wml","vnd.wap.wmlscript":"wmls","x-bibtex":"bib","x-boo":"boo","x-c++hdr":["h++","hpp","hxx","hh"],"x-c++src":["c++","cpp","cxx","cc"],"x-component":"htc","x-dsrc":"d","x-diff":"patch","x-haskell":"hs","x-java":"java","x-literate-haskell":"lhs","x-moc":"moc","x-pascal":["p","pas","pp","inc"],"x-pcs-gcd":"gcd","x-python":"py","x-scala":"scala","x-setext":"etx","x-tcl":["tcl","tk"],"x-tex":["tex","ltx","sty","cls"],"x-vcalendar":"vcs","x-vcard":"vcf",n3:"n3","prs.lines.tag":"dsc",sgml:["sgml","sgm"],troff:["t","tr","roff","man","me","ms"],turtle:"ttl","uri-list":["uri","uris","urls"],vcard:"vcard","vnd.curl":"curl","vnd.curl.dcurl":"dcurl","vnd.curl.scurl":"scurl","vnd.curl.mcurl":"mcurl","vnd.dvb.subtitle":"sub","vnd.fly":"fly","vnd.fmi.flexstor":"flx","vnd.graphviz":"gv","vnd.in3d.3dml":"3dml","vnd.in3d.spot":"spot","x-asm":["s","asm"],"x-c":["c","h","dic"],"x-fortran":["f","for","f77","f90"],"x-opml":"opml","x-nfo":"nfo","x-sfv":"sfv","x-uuencode":"uu",webviewhtml:"htt",javascript:"js",json:"json",markdown:["md","markdown","mdown","markdn"],"vnd.wap.si":"si","vnd.wap.sl":"sl"},video:{avif:"avif","3gpp":"3gp",annodex:"axv",dl:"dl",dv:["dif","dv"],fli:"fli",gl:"gl",mpeg:["mpeg","mpg","mpe","m1v","m2v","mp2","mpa","mpv2"],mp4:["mp4","mp4v","mpg4"],quicktime:["qt","mov"],ogg:"ogv","vnd.mpegurl":["mxu","m4u"],"x-flv":"flv","x-la-asf":["lsf","lsx"],"x-mng":"mng","x-ms-asf":["asf","asx","asr"],"x-ms-wm":"wm","x-ms-wmv":"wmv","x-ms-wmx":"wmx","x-ms-wvx":"wvx","x-msvideo":"avi","x-sgi-movie":"movie","x-matroska":["mpv","mkv","mk3d","mks"],"3gpp2":"3g2",h261:"h261",h263:"h263",h264:"h264",jpeg:"jpgv",jpm:["jpm","jpgm"],mj2:["mj2","mjp2"],"vnd.dece.hd":["uvh","uvvh"],"vnd.dece.mobile":["uvm","uvvm"],"vnd.dece.pd":["uvp","uvvp"],"vnd.dece.sd":["uvs","uvvs"],"vnd.dece.video":["uvv","uvvv"],"vnd.dvb.file":"dvb","vnd.fvt":"fvt","vnd.ms-playready.media.pyv":"pyv","vnd.uvvu.mp4":["uvu","uvvu"],"vnd.vivo":"viv",webm:"webm","x-f4v":"f4v","x-m4v":"m4v","x-ms-vob":"vob","x-smv":"smv",mp2t:"ts"},"x-conference":{"x-cooltalk":"ice"},"x-world":{"x-vrml":["vrm","flr","wrz","xaf","xof"]}};(()=>{const e={};for(const t of Object.keys(Eh))for(const n of Object.keys(Eh[t])){const s=Eh[t][n];if(typeof s=="string")e[s]=t+"/"+n;else for(let i=0;i{const[e,t]=g.useState("idle"),[n,s]=g.useState(0),[i,l]=g.useState(null),[c,u]=g.useState(null),[f,m]=g.useState(null),p=g.useCallback(()=>{t("idle"),s(0),l(null),u(null),m(null)},[]),v=g.useCallback(async C=>{const S=await md();if(!S||!await Kx(S,"readwrite"))return null;const j=await cP(C),I=j?.folderName??Jx(C);try{const T=await(await um(S)).getDirectoryHandle(I,{create:!1}),M=await T.getFileHandle("annotations_merged.json",{create:!1}).catch(()=>null);if(!M)return null;let D=null;if(j?.videoFileName){const W=await T.getFileHandle(j.videoFileName,{create:!1}).catch(()=>null);W&&(D=await W.getFile())}if(!D){const W=await T.getFileHandle("dataset.json",{create:!1}).catch(()=>null);if(W){const te=await W.getFile(),re=JSON.parse(await te.text()).video?.local?.relative_path;if(typeof re=="string"&&re.length>0){const ee=await T.getFileHandle(re,{create:!1}).catch(()=>null);ee&&(D=await ee.getFile())}}}if(!D)return null;const L=await(await M.getFile()).text(),J=JSON.parse(L);return{videoFile:D,annotationData:J}}catch{return null}},[]),x=g.useCallback(async()=>{if(!("showDirectoryPicker"in window))return null;const S=await md();if(S&&await Kx(S,"readwrite"))return S;try{const N=await window.showDirectoryPicker({mode:"readwrite"});return await RE(N),N}catch(N){return N instanceof Error&&N.name==="AbortError",null}},[]),y=g.useCallback(async(C,S,N)=>{const I=await(await C.getFileHandle(S,{create:!0})).createWritable();await I.write(N),await I.close()},[]),E=g.useCallback(async(C,S,N,j,I)=>{const _=await um(S),T=Jx(C),M=await _.getDirectoryHandle(T,{create:!0});await y(M,`job_${C}_artifacts.zip`,N),await y(M,j.name,j),await y(M,"annotations_merged.json",new Blob([JSON.stringify(I,null,2)],{type:"application/json"}));const D=await Ge.getJob(C).catch(()=>null),F=Ge.getConfig(),L=crypto.randomUUID(),J=new Date().toISOString(),W={schema_version:"1",dataset_id:L,created_at:J,updated_at:J,title:D?.video_filename??j.name,video:{original_filename:D?.video_filename??j.name,size_bytes:D?.video_size_bytes??j.size,duration_seconds:D?.video_duration_seconds??void 0,local:{relative_path:j.name}},artifacts:[{kind:"annotations_merged",local:{relative_path:"annotations_merged.json"}}],provenance:{source:"videoannotator",server_job:D?{base_url:F.baseURL,job_id:C,job_created_at:D.created_at,job_completed_at:D.completed_at,selected_pipelines:D.selected_pipelines??[],status:D.status}:{base_url:F.baseURL,job_id:C}}};await y(M,"dataset.json",new Blob([JSON.stringify(W,null,2)],{type:"application/json"})),await TE(C,{datasetId:L,folderName:T,createdAt:J,videoFileName:j.name})},[y]),w=g.useCallback(async C=>{if(console.log("Starting download for job:",C),l(null),s(0),Sp(C))try{t("downloading");const S=dP(C);if(!S)throw new Error(`Unknown demo key in "${C}".`);const[N,j]=await Promise.all([Ep(S),Cp(S)]);if(!N||!j)throw new Error("Failed to load demo video or annotations.");t("ready"),u(N),m(j);return}catch(S){const N=S instanceof Error?S.message:String(S);console.error("Failed to load demo from assets:",S),l(`Failed to load demo: ${N}`),t("error");return}try{const S=await v(C);if(S){t("ready"),u(S.videoFile),m(S.annotationData);return}}catch{}t("selecting_dir"),l(null),s(0);try{const S="showDirectoryPicker"in window;let N=null;if(S&&(N=await x(),!N)){t("idle");return}const j=await Ge.getJobArtifacts(C);if(!j.body)throw new Error("Response body is empty");const I=j.headers.get("Content-Length"),_=I?parseInt(I,10):0;let T=0;const M=new TransformStream({transform(re,ee){T+=re.length,_>0&&s(T/_*100),ee.enqueue(re)}});t("downloading");let D;if(N)D=await new Response(j.body.pipeThrough(M)).blob();else if(D=await new Response(j.body.pipeThrough(M)).blob(),!S){const re=URL.createObjectURL(D),ee=document.createElement("a");ee.href=re,ee.download=`job_${C}_artifacts.zip`,ee.click(),URL.revokeObjectURL(re)}t("unzipping");const F=new oS(D),L=new rL(F),J=await L.getEntries();let W=null,te=null;const q=[];for(const re of J){const ee=re;if(!ee.directory)if(ee.filename.match(/\.(mp4|mov|avi|mkv|webm)$/i)){const le=ee.getData,V=typeof le=="function"?await le(new by):null;V&&(W=new File([V],ee.filename,{type:"video/mp4"}))}else{const le=ee.getData,V=typeof le=="function"?await le(new by):null;V&&q.push(new File([V],ee.filename))}}if(await L.close(),!W)throw new Error("No video file found in artifacts ZIP");if(q.length>0){console.log("Detecting annotation files from ZIP:",q.map(ee=>ee.name));const re=[];for(const ee of q){const le=await bp(ee);if(le.type!=="unknown")console.log(`Detected ${ee.name} as ${le.type}`),re.push(le);else if(ee.name==="results.json")try{const V=await ee.text(),z=JSON.parse(V);z.metadata&&z.annotations&&(console.log("Detected legacy results.json"),te=z)}catch(V){console.warn("Failed to parse potential results.json",V)}}re.length>0&&(W&&re.push({file:W,type:"video",confidence:1}),te=(await Hd(re)).data)}if(!te){console.warn("No valid annotations found in artifacts ZIP");const re=new Date().toISOString();te={video_info:{filename:W.name,duration:0,width:0,height:0,frame_rate:30},metadata:{created:re,version:"1.0.0",pipelines:[],source:"videoannotator"}}}if(u(W),m(te),N)try{await E(C,N,D,W,te)}catch(re){console.warn("Failed to persist dataset locally (viewer will still work this session):",re)}t("ready")}catch(S){console.error("Download failed:",S),l(S instanceof Error?S.message:"Download failed"),t("error")}},[E,x,v]);return{state:e,progress:n,error:i,videoFile:c,annotationData:f,startDownload:w,reset:p}},yL=({state:e,progress:t,error:n,fileName:s="Job Artifacts"})=>{const i=()=>{switch(e){case"selecting_dir":return"Waiting for folder selection...";case"downloading":return`Downloading ${s}...`;case"unzipping":return"Extracting files...";case"ready":return"Ready!";case"error":return"Download failed";default:return"Initializing..."}},l=()=>{switch(e){case"selecting_dir":return o.jsx(v0,{className:"h-8 w-8 text-blue-500 animate-pulse"});case"downloading":return o.jsx(sl,{className:"h-8 w-8 text-blue-500 animate-bounce"});case"unzipping":return o.jsx(yn,{className:"h-8 w-8 text-blue-500 animate-spin"});case"error":return o.jsx(Lt,{className:"h-8 w-8 text-red-500"});default:return o.jsx(yn,{className:"h-8 w-8 text-gray-400"})}};return e==="idle"||e==="ready"?null:o.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 backdrop-blur-sm",children:o.jsxs(Qe,{className:"w-full max-w-md mx-4",children:[o.jsxs(Nt,{className:"flex flex-row items-center gap-4 space-y-0 pb-2",children:[l(),o.jsx(kt,{className:"text-xl","aria-live":"polite",children:i()})]}),o.jsx(yt,{className:"space-y-4 pt-4",children:e==="error"?o.jsxs(et,{variant:"destructive",children:[o.jsx(Lt,{className:"h-4 w-4"}),o.jsx(an,{children:"Error"}),o.jsx(tt,{children:n||"An unknown error occurred."})]}):o.jsxs("div",{className:"space-y-2",children:[o.jsx(fl,{value:t,className:"h-2"}),o.jsxs("div",{className:"flex justify-between text-sm text-muted-foreground","aria-live":"polite",children:[o.jsxs("span",{children:[Math.round(t),"%"]}),e==="downloading"&&o.jsx("span",{children:"Downloading..."}),e==="unzipping"&&o.jsx("span",{children:"Processing..."})]})]})})]})})},wL=()=>{const{jobId:e}=kw(),t=So(),{state:n,progress:s,error:i,videoFile:l,annotationData:c,startDownload:u,reset:f}=xL(),m=g.useMemo(()=>e?Sp(e):!1,[e]),p=g.useMemo(()=>e?pd(e):null,[e]);g.useEffect(()=>{e&&n==="idle"&&u(e)},[e,n,u]);const v=()=>{t(m?"/library":"/jobs")},x=m?"Back to Library":"Back to Jobs",y=()=>{f(),e&&u(e)};return n==="error"?o.jsxs("div",{className:"container mx-auto p-8 max-w-2xl",children:[o.jsxs(X,{variant:"ghost",onClick:v,className:"mb-4",children:[o.jsx(Pi,{className:"mr-2 h-4 w-4"}),x]}),o.jsxs(et,{variant:"destructive",className:"mb-6",children:[o.jsx(Lt,{className:"h-4 w-4"}),o.jsx(an,{children:"Failed to load results"}),o.jsx(tt,{children:i})]}),o.jsx("div",{className:"flex justify-center",children:o.jsx(X,{onClick:y,children:"Retry"})})]}):n==="ready"&&l&&c?o.jsx(Hw,{children:o.jsx(PE,{initialVideoFile:l,initialAnnotationData:c,backLabel:m?"Library":"Jobs",backPath:m?"/library":"/jobs"})}):o.jsxs("div",{className:"h-screen flex flex-col items-center justify-center bg-background gap-4",children:[o.jsx(yL,{state:n,progress:s,error:i||void 0}),m&&p&&o.jsxs("p",{className:"text-sm text-muted-foreground",children:["Loading demo: ",p]})]})},bL=()=>{const e=So(),{toast:t}=wo(),[n,s]=g.useState(null),[i,l]=g.useState([]),[c,u]=g.useState(!1),[f,m]=g.useState(!1),[p,v]=g.useState(null),x=g.useMemo(()=>DE(),[]),[y,E]=g.useState(!1),w=async()=>{u(!0);try{const N=await md();if(s(N?.name??null),N){const _=await um(N);E(_!==N)}else E(!1);const j=await La(),I=Object.entries(j).map(([_,T])=>({jobId:_,entry:T})).sort((_,T)=>T.entry.createdAt.localeCompare(_.entry.createdAt));l(I)}finally{u(!1)}};g.useEffect(()=>{w()},[]);const C=async()=>{if(!("showDirectoryPicker"in window))return;const N=await window.showDirectoryPicker({mode:"readwrite"});await RE(N),await w()},S=async()=>{m(!0),v(null);try{const N=await OE(j=>v(j));if(N.installed===0&&N.failed.length===0)t({title:"Demo datasets already installed",description:`All ${N.skipped} demos are up to date.`,duration:4e3});else if(N.failed.length>0){const j=N.failed.map(_=>`${$d[_.key]??_.key}: ${_.error}`).join(`
+`),I=`Demo install errors
+
+Installed ${N.installed}, failed ${N.failed.length}.
+${j}`;t({title:"Some demos failed to install",description:`Installed ${N.installed}, failed ${N.failed.length}.`,variant:"destructive",duration:12e3,action:Ji(I)})}else t({title:"Demo datasets installed",description:`Installed ${N.installed} demo dataset${N.installed===1?"":"s"}.`,duration:5e3});await w()}catch(N){const j=N instanceof Error?N.message:String(N);t({title:"Demo install failed",description:j,variant:"destructive",duration:1e4,action:Ji(`Demo install failed
+
+${j}`)})}finally{m(!1),v(null)}};return o.jsxs("div",{className:"container mx-auto p-6 max-w-5xl",children:[o.jsxs("div",{className:"mb-6",children:[o.jsx("h1",{className:"text-3xl font-bold",children:"Library"}),o.jsx("p",{className:"text-muted-foreground mt-2",children:"Browse and open your video annotation datasets."})]}),o.jsx(Qe,{className:"p-5 mb-6",children:o.jsxs("div",{className:"flex items-start gap-4 flex-wrap",children:[o.jsx("div",{className:`w-12 h-12 rounded-lg flex items-center justify-center flex-shrink-0 ${n?"bg-blue-100 text-blue-600":"bg-gray-100 text-gray-400"}`,children:o.jsx(v0,{className:"w-6 h-6"})}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("div",{className:"text-sm font-medium text-muted-foreground mb-1",children:"Library Folder"}),n?o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"text-lg font-semibold truncate",children:n}),y&&o.jsxs(Je,{variant:"secondary",className:"mt-1 text-xs",children:["Using legacy subdirectory: ",x]})]}):o.jsx("div",{className:"text-lg text-muted-foreground",children:"No folder selected"})]}),o.jsxs("div",{className:"flex gap-2 flex-shrink-0",children:[o.jsxs(X,{variant:"outline",size:"sm",onClick:()=>void w(),disabled:c,children:[o.jsx(Yn,{className:`h-4 w-4 mr-1 ${c?"animate-spin":""}`}),"Refresh"]}),o.jsx(X,{variant:"outline",size:"sm",onClick:()=>void C(),children:"Choose Folder"})]})]})}),o.jsx(Qe,{className:"p-4 mb-6",children:o.jsxs("div",{className:"flex items-center justify-between gap-4 flex-wrap",children:[o.jsxs("div",{children:[o.jsx("div",{className:"font-semibold",children:"Demo Datasets"}),o.jsx("div",{className:"text-sm text-muted-foreground",children:"Install bundled sample datasets to explore the viewer without a server."})]}),o.jsxs(X,{onClick:()=>void S(),disabled:f,size:"sm",className:"gap-2",children:[o.jsx(sl,{className:"h-4 w-4"}),f?p??"Installing…":"Install Demos"]})]})}),o.jsxs(Qe,{className:"p-4",children:[o.jsxs("div",{className:"flex items-center justify-between mb-4",children:[o.jsx("div",{className:"font-semibold",children:"Downloaded Datasets"}),o.jsxs("div",{className:"text-sm text-muted-foreground",children:[i.length," total"]})]}),i.length===0?o.jsxs("div",{className:"text-center py-8",children:[o.jsx("div",{className:"text-muted-foreground mb-4",children:n?"No datasets found. View a completed job to download artifacts into your library.":"Choose a library folder to get started, or install the demo datasets."}),o.jsx(ot,{to:"/getting-started",children:o.jsxs(X,{variant:"outline",size:"sm",className:"gap-2",children:[o.jsx(y0,{className:"h-4 w-4"}),"Getting Started Guide",o.jsx($c,{className:"h-4 w-4"})]})})]}):o.jsx("div",{className:"space-y-2",children:i.map(({jobId:N,entry:j})=>o.jsxs("div",{className:"flex items-center justify-between gap-4 border rounded-md p-3",children:[o.jsxs("div",{className:"min-w-0",children:[o.jsx("div",{className:"font-medium truncate",children:pd(N)?`Demo: ${pd(N)}`:`Job ${N}`}),o.jsxs("div",{className:"text-sm text-muted-foreground truncate",children:[j.videoFileName?`Video: ${j.videoFileName}`:`Folder: ${j.folderName}`,j.createdAt?` · Saved: ${new Date(j.createdAt).toLocaleString()}`:""]})]}),o.jsxs("div",{className:"flex gap-2 shrink-0",children:[o.jsx(X,{variant:"outline",onClick:()=>e(`/view/${N}`),children:"Open"}),!N.startsWith(xo)&&o.jsx(X,{onClick:()=>e(`/jobs/${N}`),children:"Job"})]})]},N))})]})]})},CL=new n2,EL=()=>o.jsx(Hw,{children:o.jsx(i2,{client:CL,children:o.jsx(F4,{children:o.jsx(k4,{enabled:!1,children:o.jsx(D4,{children:o.jsxs(Fh,{children:[o.jsx(CI,{}),o.jsx(tB,{}),o.jsx(x4,{basename:"/viewer/",future:{v7_startTransition:!0,v7_relativeSplatPath:!0},children:o.jsxs(f4,{children:[o.jsx(jn,{path:"/viewer",element:o.jsx(uP,{})}),o.jsx(jn,{path:"/view/:jobId",element:o.jsx(wL,{})}),o.jsxs(jn,{element:o.jsx(UT,{}),children:[o.jsx(jn,{path:"/",element:o.jsx(EF,{})}),o.jsx(jn,{path:"/getting-started",element:o.jsx(jF,{})}),o.jsx(jn,{path:"/library",element:o.jsx(bL,{})}),o.jsx(jn,{path:"/jobs",element:o.jsx(c1,{})}),o.jsx(jn,{path:"/jobs/:jobId",element:o.jsx(kF,{})}),o.jsx(jn,{path:"/jobs/new",element:o.jsx(qF,{})}),o.jsx(jn,{path:"/datasets",element:o.jsx(nM,{})}),o.jsx(jn,{path:"/settings",element:o.jsx(hM,{})})]}),o.jsx(jn,{path:"*",element:o.jsx(NF,{})})]})})]})})})})})});console.log("🚀 Application starting...");try{const e=document.getElementById("root");if(!e)throw new Error("Root element not found");bN.createRoot(e).render(o.jsx(EL,{})),console.log("✅ React root rendered")}catch(e){console.error("❌ Fatal error during app initialization:",e)}
diff --git a/src/videoannotator/viewer_static/assets/openface3Parser-Bf49xR9R.js b/src/videoannotator/viewer_static/assets/openface3Parser-Bf49xR9R.js
new file mode 100644
index 0000000..fe6496b
--- /dev/null
+++ b/src/videoannotator/viewer_static/assets/openface3Parser-Bf49xR9R.js
@@ -0,0 +1 @@
+class s{static instance;static getInstance(){return s.instance||(s.instance=new s),s.instance}parseOpenFace3Data(e){try{if(!this.isValidOpenFace3Data(e))throw new Error("Invalid OpenFace3 data structure");const a=e.faces.map((n,i)=>this.convertFaceAnnotation(n,i));return console.log(`✓ OpenFace3 Parser: Converted ${a.length} face annotations`),a}catch(t){throw console.error("OpenFace3 parsing failed:",t),new Error(`Failed to parse OpenFace3 data: ${t}`)}}convertFaceAnnotation(e,t){return{annotation_id:e.annotation_id||t,bbox:e.bbox,timestamp:e.timestamp,face_confidence:e.features.confidence,openface3:{landmarks_2d:e.features.landmarks_2d,action_units:e.features.action_units,head_pose:e.features.head_pose,gaze:e.features.gaze,emotion:e.features.emotion}}}isValidOpenFace3Data(e){if(!e||typeof e!="object")return!1;const t=e;if(!t.metadata||!t.faces||!Array.isArray(t.faces))return!1;const a=t.metadata;if(!a.pipeline||!a.model_info)return!1;const n=t.faces;if(n.length>0){const i=n[0];if(!i.bbox||!i.features||i.timestamp===void 0)return!1}return!0}getAvailableFeatures(e){const t=e.metadata.model_info.features,a=[];return t.landmarks&&a.push("landmarks_2d"),t.action_units&&a.push("action_units"),t.head_pose&&a.push("head_pose"),t.gaze&&a.push("gaze"),t.emotions&&a.push("emotions"),t.face_tracking&&a.push("face_tracking"),a}getProcessingStats(e){return{totalFaces:e.metadata.processing_stats.total_faces,avgProcessingTime:e.metadata.processing_stats.avg_processing_time,detectionConfidence:e.metadata.config.detection_confidence,modelInfo:`${e.metadata.model_info.model_name} v${e.metadata.model_info.version}`}}filterByConfidence(e,t=.5){return e.filter(a=>(a.face_confidence||0)>=t)}getTimestamps(e){const t=e.map(a=>a.timestamp);return[...new Set(t)].sort((a,n)=>a-n)}}s.getInstance();export{s as OpenFace3Parser};
diff --git a/src/videoannotator/viewer_static/assets/v-a-v.icon-CddpxgV4.png b/src/videoannotator/viewer_static/assets/v-a-v.icon-CddpxgV4.png
new file mode 100644
index 0000000..020e0d7
Binary files /dev/null and b/src/videoannotator/viewer_static/assets/v-a-v.icon-CddpxgV4.png differ
diff --git a/src/videoannotator/viewer_static/favicon.ico b/src/videoannotator/viewer_static/favicon.ico
new file mode 100644
index 0000000..0e77e96
Binary files /dev/null and b/src/videoannotator/viewer_static/favicon.ico differ
diff --git a/src/videoannotator/viewer_static/icon-16x16.png b/src/videoannotator/viewer_static/icon-16x16.png
new file mode 100644
index 0000000..7d6942f
Binary files /dev/null and b/src/videoannotator/viewer_static/icon-16x16.png differ
diff --git a/src/videoannotator/viewer_static/icon-32x32.png b/src/videoannotator/viewer_static/icon-32x32.png
new file mode 100644
index 0000000..f93391c
Binary files /dev/null and b/src/videoannotator/viewer_static/icon-32x32.png differ
diff --git a/src/videoannotator/viewer_static/icon-64x64.png b/src/videoannotator/viewer_static/icon-64x64.png
new file mode 100644
index 0000000..6816f4b
Binary files /dev/null and b/src/videoannotator/viewer_static/icon-64x64.png differ
diff --git a/src/videoannotator/viewer_static/index.html b/src/videoannotator/viewer_static/index.html
new file mode 100644
index 0000000..ebb876b
--- /dev/null
+++ b/src/videoannotator/viewer_static/index.html
@@ -0,0 +1,41 @@
+
+
+
+
+
+
+ Video Annotation Viewer
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/videoannotator/viewer_static/placeholder.svg b/src/videoannotator/viewer_static/placeholder.svg
new file mode 100644
index 0000000..9b13eb6
--- /dev/null
+++ b/src/videoannotator/viewer_static/placeholder.svg
@@ -0,0 +1 @@
+
diff --git a/src/videoannotator/viewer_static/robots.txt b/src/videoannotator/viewer_static/robots.txt
new file mode 100644
index 0000000..6018e70
--- /dev/null
+++ b/src/videoannotator/viewer_static/robots.txt
@@ -0,0 +1,14 @@
+User-agent: Googlebot
+Allow: /
+
+User-agent: Bingbot
+Allow: /
+
+User-agent: Twitterbot
+Allow: /
+
+User-agent: facebookexternalhit
+Allow: /
+
+User-agent: *
+Allow: /
diff --git a/tests/conftest.py b/tests/conftest.py
index e1b1cd2..cf99468 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -162,19 +162,28 @@ def test_storage_env(tmp_path_factory):
yield
- # Cleanup is handled by tmp_path fixture, but we should clear caches again
+ # Dispose engines before temp dir cleanup — Windows holds files open until
+ # all SQLAlchemy connection pools are explicitly released (WinError 32).
+ try:
+ import videoannotator.database.database as _db_module
+
+ if hasattr(_db_module, "engine"):
+ _db_module.engine.dispose()
+ except Exception:
+ pass
+
try:
from videoannotator.api.database import reset_storage_backend
- reset_storage_backend()
- except ImportError:
+ reset_storage_backend() # now calls backend.close() before clearing
+ except Exception:
pass
try:
from videoannotator.storage.manager import get_storage_provider
get_storage_provider.cache_clear()
- except ImportError:
+ except Exception:
pass
diff --git a/tests/contract/test_viewer_contract.py b/tests/contract/test_viewer_contract.py
new file mode 100644
index 0000000..87163e4
--- /dev/null
+++ b/tests/contract/test_viewer_contract.py
@@ -0,0 +1,210 @@
+"""Contract test: VideoAnnotator's real output vs. Video Annotation Viewer's parsers.
+
+This does not import or execute VAV's code (it's a separate TypeScript repo — that
+half of the contract is exercised in VAV's own CI against fixtures this test
+generates). Instead it models VAV's actual Zod validation schemas in Python,
+sourced directly from InfantLab/video-annotation-viewer:
+
+- COCOPersonAnnotationSchema: src/lib/validation.ts (~line 20)
+- WebVTT/RTTM syntax: src/lib/parsers/{webvtt,rttm}.ts
+
+Fixtures are produced via VideoAnnotator's real exporters
+(videoannotator.exporters.native_formats), following the exact code paths
+used by the person-tracking pipeline (with and without identity labeling
+enabled — see src/videoannotator/pipelines/person_tracking/person_pipeline.py
+around lines 456-501), not hand-rolled JSON. If VideoAnnotator's output shape
+drifts from what VAV requires, this test fails on the VideoAnnotator side
+before a researcher ever sees a broken viewer.
+
+History: the first run of this test (before the person_pipeline.py fix in the
+same change) caught a real, live gap — without identity labeling configured,
+person_id/person_label/label_confidence/labeling_method were omitted entirely,
+which VAV's schema requires as non-optional. The pipeline now always populates
+them with fallback defaults ("track_"/"unknown"/0.0/"none"); this test
+locks that fix in.
+"""
+
+import json
+
+import pytest
+
+from videoannotator.exporters.native_formats import (
+ create_coco_image_entry,
+ create_coco_keypoints_annotation,
+ export_coco_json,
+ export_rttm_diarization,
+ export_webvtt_captions,
+)
+
+# Mirrors COCOPersonAnnotationSchema in video-annotation-viewer's src/lib/validation.ts.
+# Each entry: (field, required, expected_python_types).
+VAV_COCO_PERSON_CONTRACT = [
+ ("id", True, (int,)),
+ ("image_id", True, (str,)), # Zod: z.string() — NOT the "integer" VideoAnnotator's
+ # own get_schema() docstring used to claim; runtime value is an f-string. Fixed
+ # alongside this test (person_pipeline.py get_schema()).
+ ("category_id", True, (int,)),
+ ("keypoints", True, (list,)), # z.array(z.number()).length(51)
+ ("num_keypoints", True, (int,)),
+ ("bbox", True, (list, tuple)),
+ ("area", True, (int, float)),
+ ("iscrowd", True, (int,)),
+ ("score", True, (int, float)),
+ ("track_id", False, (int,)), # z.number().optional() — NOT z.nullable(); an
+ # explicit `null` fails Zod validation, only a missing key is tolerated.
+ ("timestamp", True, (int, float)),
+ ("frame_number", True, (int, float)),
+ ("person_id", True, (str,)),
+ ("person_label", True, (str,)),
+ ("label_confidence", True, (int, float)),
+ ("labeling_method", True, (str,)),
+]
+
+
+def _build_annotation(*, with_identity: bool, track_id: int) -> dict:
+ """Build one annotation exactly as person_pipeline.py's fixed code does.
+
+ Mirrors PersonTrackingPipeline._process_frame's keypoints branch (lines
+ 456-468) followed by the identity-labeling block (lines ~483-501), which
+ now always sets person_id/person_label/label_confidence/labeling_method —
+ falling back to "track_"/"unknown"/0.0/"none" when identity_manager is
+ absent or has no resolved label for this track, rather than omitting them.
+ """
+ annotation = create_coco_keypoints_annotation(
+ annotation_id=1,
+ image_id="video123_frame_42",
+ category_id=1,
+ keypoints=[float(i % 10) for i in range(51)],
+ bbox=[10.0, 20.0, 30.0, 40.0],
+ num_keypoints=17,
+ score=0.91,
+ track_id=track_id,
+ timestamp=1.4,
+ frame_number=42,
+ )
+ if with_identity:
+ annotation["person_id"] = "person_video123_001"
+ annotation["person_label"] = "child"
+ annotation["label_confidence"] = 0.82
+ annotation["labeling_method"] = "automatic_size_based"
+ else:
+ # Fallback defaults applied by person_pipeline.py when identity_manager
+ # is None or has no label for this track yet.
+ annotation["person_id"] = f"track_{track_id}"
+ annotation["person_label"] = "unknown"
+ annotation["label_confidence"] = 0.0
+ annotation["labeling_method"] = "none"
+ return annotation
+
+
+def _check_against_vav_contract(annotation: dict) -> list[str]:
+ """Return a list of violations of VAV's COCOPersonAnnotationSchema, if any."""
+ violations = []
+ for field, required, expected_types in VAV_COCO_PERSON_CONTRACT:
+ if field not in annotation:
+ if required:
+ violations.append(f"missing required field '{field}'")
+ continue
+ value = annotation[field]
+ if value is None:
+ # Zod .optional() (not .nullable()) rejects an explicit null.
+ violations.append(f"field '{field}' is null, which Zod .optional() rejects")
+ continue
+ if not isinstance(value, expected_types):
+ violations.append(
+ f"field '{field}' is {type(value).__name__}, expected one of {expected_types}"
+ )
+ return violations
+
+
+def test_coco_person_annotation_matches_vav_contract_with_identity_labeling(tmp_path):
+ """Identity labeling enabled and a label resolved for this track."""
+ annotation = _build_annotation(with_identity=True, track_id=7)
+ image = create_coco_image_entry(
+ image_id="video123_frame_42", width=1920, height=1080, file_name="frame_42.jpg"
+ )
+ out_path = tmp_path / "person_tracking.json"
+ export_coco_json([annotation], [image], str(out_path))
+
+ saved = json.loads(out_path.read_text())
+ violations = _check_against_vav_contract(saved["annotations"][0])
+
+ assert not violations, (
+ "VideoAnnotator's COCO output no longer matches Video Annotation Viewer's "
+ f"COCOPersonAnnotationSchema: {violations}"
+ )
+
+
+def test_coco_person_annotation_without_identity_labeling_matches_vav_contract(
+ tmp_path,
+):
+ """Regression test: identity labeling disabled (or track unlabeled) still
+ produces schema-compliant output, thanks to the fallback defaults in
+ person_pipeline.py. This used to fail before that fix.
+ """
+ annotation = _build_annotation(with_identity=False, track_id=3)
+ image = create_coco_image_entry(
+ image_id="video123_frame_42", width=1920, height=1080, file_name="frame_42.jpg"
+ )
+ out_path = tmp_path / "person_tracking.json"
+ export_coco_json([annotation], [image], str(out_path))
+
+ saved = json.loads(out_path.read_text())
+ violations = _check_against_vav_contract(saved["annotations"][0])
+
+ assert not violations, (
+ "VideoAnnotator's COCO output without identity labeling no longer matches "
+ f"Video Annotation Viewer's COCOPersonAnnotationSchema: {violations}"
+ )
+
+
+def test_webvtt_export_is_well_formed(tmp_path):
+ """Syntactic check matching VAV's src/lib/parsers/webvtt.ts cue-block parsing."""
+ out_path = tmp_path / "speech.vtt"
+ export_webvtt_captions(
+ [
+ {"start": 1.0, "end": 3.5, "text": "Hello, how are you doing today?"},
+ {"start": 4.0, "end": 6.2, "text": "I'm doing great, thanks for asking."},
+ ],
+ str(out_path),
+ )
+ content = out_path.read_text()
+
+ assert content.startswith("WEBVTT")
+ # VAV's parseTimestamp expects exactly HH:MM:SS.mmm (3 colon-separated parts).
+ for line in content.splitlines():
+ if "-->" in line:
+ start, _, end = line.partition("-->")
+ for ts in (start.strip(), end.strip().split(" ")[0]):
+ parts = ts.split(":")
+ assert len(parts) == 3, f"timestamp '{ts}' is not HH:MM:SS.mmm"
+
+
+def test_rttm_export_is_well_formed(tmp_path):
+ """Syntactic check matching VAV's src/lib/parsers/rttm.ts line parsing.
+
+ parseRTTMLine requires >= 9 whitespace-separated fields and the literal
+ type token 'SPEAKER'.
+ """
+ out_path = tmp_path / "speakers.rttm"
+ export_rttm_diarization(
+ [
+ {"start": 1.25, "end": 3.55, "speaker_id": "SPEAKER_00"},
+ {"start": 3.8, "end": 5.3, "speaker_id": "SPEAKER_01"},
+ ],
+ str(out_path),
+ uri="video123",
+ )
+ content = out_path.read_text()
+ lines = [line for line in content.splitlines() if line.strip()]
+ assert lines, "RTTM export produced no lines"
+ for line in lines:
+ parts = line.split()
+ assert len(parts) >= 9, (
+ f"RTTM line has {len(parts)} fields, VAV requires >= 9: {line!r}"
+ )
+ assert parts[0] == "SPEAKER", f"unexpected RTTM type token: {parts[0]!r}"
+
+
+if __name__ == "__main__":
+ pytest.main([__file__, "-v"])