PageSourceSearch

https://tresda.institute/assets/TraceItemDetail-CXFJZA_D.js

js tresda.institute collected 2026-10-02 01:59:02 UTC 26,168 bytes, 1 lines download raw bytes

1import{r as d,j as e,bg as A,X as M,R as B,f as Q,s as U,N as $,O as K,z as G,u as J,m as k,b as H,A as W,v as Z,M as X,b$ as Y,w as ee,as as O,x as P,P as te,G as se,J as re,bu as oe,bq as ae,l as ne,k as z,h as le,a1 as R,bW as ie}from"./index-u0HMC9Vb.js";import{S as ce}from"./ShareModal-N52Fp37K.js";import{P as de}from"./pause-CJoX5Z0J.js";import{V as ue}from"./volume-2-C5a-LV8v.js";import"./index-CNbazIQW.js";function me({urls:t,compact:s=!1}){const[l,r]=d.useState(null);if(!t||t.length===0)return null;const n=(i,a)=>{a.stopPropagation(),r(i)},u=i=>{i.stopPropagation(),r(null)},f=i=>{i.stopPropagation(),r(a=>(a-1+t.length)%t.length)},m=i=>{i.stopPropagation(),r(a=>(a+1)%t.length)},h=s?t.slice(0,4):t;return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:`grid gap-1 mt-1 ${h.length===1?"grid-cols-1":(h.length===2,"grid-cols-2")}`,children:h.map((i,a)=>e.jsxs("div",{className:"relative group overflow-hidden bg-muted cursor-zoom-in",onClick:b=>n(a,b),style:{aspectRatio:t.length===1?"16/9":"1/1"},children:[e.jsx("img",{src:i,alt:"",className:"w-full h-full object-cover transition-transform duration-300 group-hover:scale-105"}),a===3&&t.length>4&&e.jsx("div",{className:"absolute inset-0 bg-black/60 flex items-center justify-center",children:e.jsxs("span",{className:"text-white text-sm font-medium",children:["+",t.length-4]})}),t.length===1&&e.jsx("div",{className:"absolute bottom-2 right-2 opacity-0 group-hover:opacity-100 transition-opacity",children:e.jsx("div",{className:"bg-black/50 text-white p-1",children:e.jsx(A,{className:"w-3 h-3",strokeWidth:1.5})})})]},a))}),l!==null&&e.jsxs("div",{className:"fixed inset-0 z-[200] bg-black/95 flex items-center justify-center",onClick:u,children:[e.jsx("button",{onClick:u,className:"absolute top-4 right-4 text-white/70 hover:text-white transition-colors z-10",children:e.jsx(M,{className:"w-6 h-6",strokeWidth:1.5})}),t.length>1&&e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:f,className:"absolute left-4 top-1/2 -translate-y-1/2 text-white/70 hover:text-white transition-colors z-10",children:e.jsx(B,{className:"w-8 h-8",strokeWidth:1.5})}),e.jsx("button",{onClick:m,className:"absolute right-4 top-1/2 -translate-y-1/2 text-white/70 hover:text-white transition-colors z-10",children:e.jsx(Q,{className:"w-8 h-8",strokeWidth:1.5})})]}),e.jsx("img",{src:t[l],alt:"",className:"max-w-[90vw] max-h-[90vh] object-contain",onClick:i=>i.stopPropagation()}),t.length>1&&e.jsx("div",{className:"absolute bottom-4 left-1/2 -translate-x-1/2 flex gap-1.5",children:t.map((i,a)=>e.jsx("button",{onClick:b=>{b.stopPropagation(),r(a)},className:`w-1.5 h-1.5 rounded-full transition-colors ${a===l?"bg-white":"bg-white/30"}`},a))})]})]})}function xe({src:t,compact:s=!1}){const l=d.useRef(null),[r,n]=d.useState(!1),[u,f]=d.useState(0),[m,h]=d.useState(0),[i,a]=d.useState(0);d.useEffect(()=>{const c=l.current;if(!c)return;const g=()=>{a(c.currentTime),f(c.duration?c.currentTime/c.duration*100:0)},o=()=>h(c.duration||0),y=()=>n(!1);return c.addEventListener("timeupdate",g),c.addEventListener("loadedmetadata",o),c.addEventListener("ended",y),()=>{c.removeEventListener("timeupdate",g),c.removeEventListener("loadedmetadata",o),c.removeEventListener("ended",y)}},[t]);const b=c=>{c.stopPropagation();const g=l.current;g&&(r?(g.pause(),n(!1)):(g.play(),n(!0)))},w=c=>{c.stopPropagation();const g=l.current;if(!g||!m)return;const o=c.currentTarget.getBoundingClientRect(),j=(c.clientX-o.left)/o.width;g.currentTime=j*m},v=c=>{if(!c||isNaN(c))return"0:00";const g=Math.floor(c/60),o=Math.floor(c%60);return`${g}:${o.toString().padStart(2,"0")}`};return e.jsxs("div",{className:"flex items-center gap-3 mt-1 p-3 bg-muted/40 border border-border/30",onClick:c=>c.stopPropagation(),children:[e.jsx("audio",{ref:l,src:t,preload:"metadata"}),e.jsx("button",{onClick:b,className:"flex-shrink-0 w-8 h-8 bg-foreground text-background flex items-center justify-center hover:opacity-80 transition-opacity",children:r?e.jsx(de,{className:"w-3.5 h-3.5",strokeWidth:1.5,fill:"currentColor"}):e.jsx(U,{className:"w-3.5 h-3.5",strokeWidth:1.5,fill:"currentColor"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"w-full h-1 bg-border/50 cursor-pointer relative",onClick:w,children:e.jsx("div",{className:"h-full bg-foreground transition-all",style:{width:`${u}%`}})}),e.jsxs("div",{className:"flex items-center justify-between mt-1",children:[e.jsx("span",{className:"text-[9px] font-meta tabular-nums text-muted-foreground
1/50",children:v(i)}),e.jsx("span",{className:"text-[9px] font-meta tabular-nums text-muted-foreground/40",children:v(m)})]})]}),e.jsx(ue,{className:"w-3.5 h-3.5 text-muted-foreground/30 flex-shrink-0",strokeWidth:1.5})]})}function he({src:t,compact:s=!1}){const l=d.useRef(null),[r,n]=d.useState(!1),u=f=>{f.stopPropagation(),n(!0),setTimeout(()=>{var m;return(m=l.current)==null?void 0:m.play()},50)};return e.jsxs("div",{className:"relative mt-1 bg-black overflow-hidden",onClick:f=>f.stopPropagation(),children:[e.jsx("video",{ref:l,src:t,controls:r,className:`w-full ${s?"max-h-48":"max-h-80"} object-contain`,preload:"metadata",playsInline:!0}),!r&&e.jsx("div",{className:"absolute inset-0 flex items-center justify-center cursor-pointer group",onClick:u,children:e.jsx("div",{className:"w-12 h-12 bg-white/20 backdrop-blur-sm border border-white/30 flex items-center justify-center group-hover:bg-white/30 transition-colors",children:e.jsx(U,{className:"w-5 h-5 text-white",strokeWidth:1.5,fill:"white"})})})]})}function ge(t){try{const{hostname:s}=new URL(t);return`https://www.google.com/s2/favicons?domain=${s}&sz=32`}catch{return null}}function fe(t){try{return new URL(t).hostname.replace("www.","")}catch{return t}}function pe({url:t,preview:s,mediaType:l="link"}){if(!t)return null;const r=ge(t),n=fe(t),u=s==null?void 0:s.title,f=s==null?void 0:s.description,m=s==null?void 0:s.image,h=t.match(/(?:youtube\.com\/watch\?v=|youtu\.be\/)([a-zA-Z0-9_-]{11})/),i=t.match(/vimeo\.com\/(\d+)/);return h?e.jsx("div",{className:"mt-1 overflow-hidden bg-black aspect-video",onClick:a=>a.stopPropagation(),children:e.jsx("iframe",{src:`https://www.youtube.com/embed/${h[1]}`,className:"w-full h-full",frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,loading:"lazy"})}):i?e.jsx("div",{className:"mt-1 overflow-hidden bg-black aspect-video",onClick:a=>a.stopPropagation(),children:e.jsx("iframe",{src:`https://player.vimeo.com/video/${i[1]}`,className:"w-full h-full",frameBorder:"0",allow:"autoplay; fullscreen; picture-in-picture",allowFullScreen:!0,loading:"lazy"})}):u||m?e.jsxs("a",{href:t,target:"_blank",rel:"noopener noreferrer",onClick:a=>a.stopPropagation(),className:"block mt-1 border border-border/40 hover:border-border/80 bg-muted/20 hover:bg-muted/40 transition-colors overflow-hidden group",children:[m&&e.jsx("div",{className:"w-full overflow-hidden",style:{maxHeight:"180px"},children:e.jsx("img",{src:m,alt:"",className:"w-full object-cover group-hover:scale-[1.02] transition-transform duration-500",style:{maxHeight:"180px"}})}),e.jsxs("div",{className:"px-3 py-2.5 flex items-start gap-2",children:[r&&e.jsx("img",{src:r,alt:"",className:"w-3.5 h-3.5 rounded-sm flex-shrink-0 mt-0.5 object-contain",onError:a=>a.target.style.display="none"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[u&&e.jsx("p",{className:"text-xs font-medium text-foreground leading-snug line-clamp-2",children:u}),f&&e.jsx("p",{className:"text-[10px] text-muted-foreground mt-0.5 line-clamp-2 leading-relaxed",children:f}),e.jsx("p",{className:"text-[9px] font-meta text-muted-foreground/40 mt-1 truncate",children:n})]}),e.jsx($,{className:"w-3 h-3 text-muted-foreground/30 flex-shrink-0 mt-0.5 group-hover:text-muted-foreground transition-colors",strokeWidth:1.5})]})]}):e.jsxs("a",{href:t,target:"_blank",rel:"noopener noreferrer",onClick:a=>a.stopPropagation(),className:"flex items-center gap-2 mt-1 text-xs text-foreground hover:text-muted-foreground transition-colors group",children:[r&&e.jsx("img",{src:r,alt:"",className:"w-3.5 h-3.5 rounded-sm flex-shrink-0 object-contain",onError:a=>a.target.style.display="none"}),e.jsx("span",{className:"underline underline-offset-2 decoration-border/50 group-hover:decoration-foreground/40 truncate",children:n}),e.jsx($,{className:"w-3 h-3 flex-shrink-0 opacity-40",strokeWidth:1.5})]})}function be({url:t,preview:s}){if(!t)return null;const l=(s==null?void 0:s.spotify_embed_url)||(()=>{const n=t.match(/open\.spotify\.com\/(track|album|playlist|episode|show)\/([a-zA-Z0-9]+)/);return n?`https://open.spotify.com/embed/${n[1]}/${n[2]}`:null})(),r=(s==null?void 0:s.spotify_type)==="track"||t.includes("/track/");return l?e.jsx("div",{className:"mt-1 overflow-hidden",onClick:n=>n.stopPropagation(),children:e.jsx("iframe",{src:l,width:"100%",height:r?80:152,frameBorder:"0",allow:"autoplay; clipboard-write; encrypted-media; fullscreen; picture-in-picture",loading:"lazy",style:{borderRadius:0}})}):e.jsx("a",{href:t,target:"_blank",rel:"noopener noreferrer",onClick:n=>n.stopPropagation(),className:"text-xs text-foreground underline underline-offset-2",children:t})}const je={figma:"https://upload.wikimedia.org/wikipedia/commons/thumb/3/33/Figma-logo.svg/1920px-Figma-logo.svg.png",google:"https://www.svgrepo.com/show/303108/google-icon-logo.svg",pinterest:"https://upload.wikimedia.org/wikipedia/commons/thumb/4/4d/Pinterest.svg/960px-Pinterest.svg.png"},Ne={figma:"border-[#1E1E1E]/20",google:"border-[#4285F4]/20",pinterest:"border-[#
1E60023]/20"};function ye({url:t,preview:s,mediaType:l}){if(!t)return null;const r=je[l],n=Ne[l]||"border-border/40";return e.jsxs("a",{href:t,target:"_blank",rel:"noopener noreferrer",onClick:u=>u.stopPropagation(),className:`block mt-1 border ${n} hover:border-border transition-colors overflow-hidden group bg-muted/20 hover:bg-muted/40`,children:[(s==null?void 0:s.image)&&e.jsx("div",{className:"w-full overflow-hidden",style:{maxHeight:"160px"},children:e.jsx("img",{src:s.image,alt:"",className:"w-full object-cover group-hover:scale-[1.02] transition-transform duration-500",style:{maxHeight:"160px"}})}),e.jsxs("div",{className:"px-3 py-2.5 flex items-start gap-2",children:[r&&e.jsx("img",{src:r,alt:l,className:"w-3.5 h-3.5 flex-shrink-0 mt-0.5 object-contain"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"text-xs font-medium text-foreground leading-snug line-clamp-2",children:(s==null?void 0:s.title)||t}),(s==null?void 0:s.description)&&e.jsx("p",{className:"text-[10px] text-muted-foreground mt-0.5 line-clamp-2 leading-relaxed",children:s.description}),e.jsx("p",{className:"text-[9px] font-meta text-muted-foreground/40 mt-1 truncate",children:t})]}),e.jsx($,{className:"w-3 h-3 text-muted-foreground/30 flex-shrink-0 mt-0.5 group-hover:text-muted-foreground transition-colors",strokeWidth:1.5})]})]})}const ve={text:O,images:ee,motion:Y,audio:X,link:Z};function ke({item:t}){var l,r,n;let s=null;if(t.link_preview)try{s=JSON.parse(t.link_preview)}catch{}return e.jsxs("div",{className:"space-y-6",children:[t.media_type==="text"&&t.content&&(/<[a-z][\s\S]*>/i.test(t.content)?e.jsx("div",{className:"prose prose-sm max-w-none text-foreground",dangerouslySetInnerHTML:{__html:t.content}}):e.jsx("p",{className:"text-base text-foreground whitespace-pre-wrap leading-relaxed",children:t.content})),t.media_type==="images"&&((l=t.file_urls)==null?void 0:l.length)>0&&e.jsx(me,{urls:t.file_urls}),t.media_type==="motion"&&((r=t.file_urls)==null?void 0:r.length)>0&&e.jsx(he,{src:t.file_urls[0]}),t.media_type==="audio"&&((n=t.file_urls)==null?void 0:n.length)>0&&e.jsx(xe,{src:t.file_urls[0]}),t.media_type==="link"&&e.jsx(pe,{url:t.link_url,preview:s}),t.media_type==="spotify"&&e.jsx(be,{url:t.link_url,preview:s}),["figma","google","pinterest"].includes(t.media_type)&&e.jsx(ye,{url:t.link_url,preview:s,mediaType:t.media_type}),t.note&&e.jsx("div",{className:"bg-muted/30 border-l-2 border-foreground
1/20 pl-4 py-2 text-sm text-muted-foreground italic leading-relaxed",children:t.note})]})}function we({item:t,onSave:s,onCancel:l}){const[r,n]=d.useState(t.content||""),[u,f]=d.useState(t.note||""),[m,h]=d.useState(t.link_url||""),[i,a]=d.useState(t.link_preview?(()=>{try{return JSON.parse(t.link_preview)}catch{return null}})():null),[b,w]=d.useState(!1),[v,c]=d.useState([]),[g,o]=d.useState([]),[y,j]=d.useState(t.file_urls||[]),[L,E]=d.useState(!1),[C,N]=d.useState(!1),_=d.useRef(null),F=t.media_type==="images"?"image/*":t.media_type==="motion"?"video/*":"audio/*",q=x=>{const p=Array.from(x.target.files);c(p),o(p.map(S=>URL.createObjectURL(S)))},D=async()=>{if(m.trim()){w(!0);try{const x=await k.functions.invoke("fetchLinkPreview",{url:m.trim()});a(x.data)}catch{a({title:m,description:"",image:null})}finally{w(!1)}}},V=async()=>{N(!0);let x=y;v.length>0&&(E(!0),x=await Promise.all(v.map(I=>k.integrations.Core.UploadFile({file:I}).then(T=>T.file_url))),E(!1));const p=await ie(),S=p?[p.city,p.country].filter(Boolean).join(", "):null;await s({content:r||void 0,note:u.trim()||void 0,link_url:m.trim()||void 0,link_preview:i?JSON.stringify(i):void 0,file_urls:x.length>0?x:void 0,created_location:S||void 0}),N(!1)};return e.jsxs("div",{className:"space-y-6",children:[t.media_type==="text"&&e.jsx("div",{className:"border border-border/50 rounded-lg overflow-hidden",children:e.jsx(ae,{value:r,onChange:n,theme:"snow",modules:{toolbar:[["bold","italic","underline"],[{list:"ordered"},{list:"bullet"}],["blockquote"],["clean"]]},className:"bg-background text-foreground",style:{minHeight:"200px"}})}),["images","motion","audio"].includes(t.media_type)&&e.jsxs("div",{children:[y.length>0&&e.jsx("div",{className:"flex flex-wrap gap-2 mb-3",children:y.map((x,p)=>t.media_type==="images"?e.jsxs("div",{className:"relative group",children:[e.jsx("img",{src:x,alt:"",className:"w-20 h-20 object-cover rounded border border-border"}),e.jsx("button",{onClick:()=>j(S=>S.filter((I,T)=>T!==p)),className:"absolute top-1 right-1 w-4 h-4 bg-destructive text-destructive-foreground rounded-full text-xs hidden group-hover:flex items-center justify-center",children:"×"})]},p):e.jsx("audio",{src:x,controls:!0,className:"w-full"},p))}),e.jsxs("div",{onClick:()=>{var x;return(x=_.current)==null?void 0:x.click()},className:"w-full border border-dashed border-border rounded p-4 flex items-center justify-center gap-2 cursor-pointer hover:border-foreground
1/40 transition-colors bg-muted text-xs text-muted-foreground",children:[e.jsx(ne,{className:"w-4 h-4"}),L?"Uploading...":`Replace / add ${t.media_type}`]}),e.jsx("input",{ref:_,type:"file",accept:F,multiple:t.media_type==="images",className:"hidden",onChange:q}),g.length>0&&e.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:g.map((x,p)=>t.media_type==="images"?e.jsx("img",{src:x,alt:"",className:"w-20 h-20 object-cover rounded border border-border"},p):t.media_type==="motion"?e.jsx("video",{src:x,className:"w-32 h-20 rounded border border-border",muted:!0},p):e.jsx("audio",{src:x,controls:!0,className:"w-full"},p))})]}),t.media_type==="link"&&e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{type:"url",value:m,onChange:x=>{h(x.target.value),a(null)},placeholder:"https://...",className:"flex-1 px-3 py-2 bg-muted border border-border rounded text-sm focus:outline-none focus:border-foreground"}),e.jsx("button",{type:"button",onClick:D,disabled:!m.trim()||b,className:"px-3 py-2 bg-muted border border-border rounded text-xs hover:border-foreground
1/40 transition-colors disabled:opacity-40 flex items-center gap-1.5",children:b?e.jsx(z,{className:"w-3.5 h-3.5 animate-spin"}):"Fetch"})]}),i&&e.jsxs("div",{className:"border border-border rounded overflow-hidden flex bg-muted",children:[i.image&&e.jsx("img",{src:i.image,alt:"",className:"w-16 h-16 object-cover flex-shrink-0"}),e.jsxs("div",{className:"p-2 min-w-0",children:[e.jsx("p",{className:"text-xs font-medium text-foreground truncate",children:i.title}),i.description&&e.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 line-clamp-1",children:i.description})]})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-medium text-muted-foreground mb-1",children:"Note"}),e.jsx("textarea",{value:u,onChange:x=>f(x.target.value),rows:2,placeholder:"Add context...",className:"w-full px-3 py-2 bg-muted border border-border rounded text-sm focus:outline-none focus:border-foreground resize-none"})]}),e.jsxs("div",{className:"flex gap-3 justify-end pt-2",children:[e.jsx("button",{onClick:l,className:"px-4 py-2 text-sm font-medium text-foreground hover:bg-muted transition-colors rounded border border-border/40",disabled:C,children:"Cancel"}),e.jsxs("button",{onClick:V,disabled:C||L,className:"flex items-center gap-2 px-4 py-2 bg-foreground text-background hover:opacity-90 transition-opacity rounded-lg text-sm font-medium disabled:opacity-50",children:[C&&e.jsx(z,{className:"w-4 h-4 animate-spin"}),"Save"]})]})]})}function _e({versions:t,selectedVersionId:s,onSelect:l}){return t.length?e.jsx("div",{className:"space-y-0",children:t.map((r,n)=>{const u=n===t.length-1,f=s===r.id;return e.jsxs("div",{onClick:()=>l(f?null:r),className:R("flex gap-3 pb-6 relative cursor-pointer rounded-lg px-2 -mx-2 transition-colors",f?"bg-muted/60":"hover:bg-muted/30"),children:[e.jsxs("div",{className:"flex flex-col items-center",children:[e.jsx("div",{className:R("w-6 h-6 rounded-full border-2 flex items-center justify-center flex-shrink-0",f?"border-foreground bg-foreground":"border-border bg-muted"),children:e.jsx(le,{className:R("w-3 h-3",f?"text-background":"text-foreground/70"),strokeWidth:2.5})}),!u&&e.jsx("div",{className:"w-0.5 h-12 bg-border/30 mt-1"})]}),e.jsxs("div",{className:"pt-0.5 flex-1",children:[e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("p",{className:"text-xs font-medium text-foreground",children:["v",r.version_number]}),e.jsx("p",{className:"text-[10px] font-meta text-muted-foreground/60 text-right flex-shrink-0",children:r.created_date?P(new Date(r.created_date),"MMM d, HH:mm"):"—"})]}),r.notes&&e.jsx("p",{className:"text-xs text-muted-foreground/80 mt-0.5",children:r.notes})]})]},r.id)})}):null}function Fe(){const{projectId:t,itemId:s}=K(),l=G(),r=J(),[n,u]=d.useState(!1),[f,m]=d.useState(null),[h,i]=d.useState(null),[a,b]=d.useState(!1),[w,v]=d.useState(!1),[c,g]=d.useState(!1);d.useEffect(()=>{k.auth.me().then(N=>m(N)).catch(()=>{})},[]);const{data:o,isLoading:y}=H({queryKey:["trace-item",s],queryFn:()=>k.entities.TraceItem.list().then(N=>N.find(_=>_.id===s)),enabled:!!s}),{data:j=[]}=H({queryKey:["trace-item-versions",s],queryFn:()=>k.entities.TraceItemVersion.filter({trace_item_id:s},"-version_number"),enabled:!!s}),L=async()=>{b(!0),await k.entities.TraceItem.update(s,{is_public:!o.is_public}),r.invalidateQueries({queryKey:["trace-item",s]}),r.invalidateQueries({queryKey:["trace-items",t]}),b(!1)},E=async N=>{var F;const _=(((F=j[0])==null?void 0:F.version_number)||0)+1;await k.entities.TraceItemVersion.create({trace_item_id:s,version_number:_,media_type:o.media_type,content:o.content,file_urls:o.file_urls,link_url:o.link_url,link_preview:o.link_preview,note:o.note,created_location:o.created_location}),await k.entities.TraceItem.update(s,N),r.invalidateQueries({queryKey:["trace-item",s]}),r.invalidateQueries({queryKey:["trace-item-versions",s]}),r.invalidateQueries({queryKey:["trace-items",t]}),u(!1)};if(y)return e.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:e.jsx("div",{className:"w-8 h-8 border-4 border-slate-200 border-t-slate-800 rounded-full animate-spin"})});if(!o)return e.jsx("div",{className:"min-h-screen bg-background px-4 py-8 flex items-center justify-center",children:e.jsxs("div",{className:"max-w-2xl w-full",children:[e.jsxs("button",{onClick:()=>l(-1),className:"flex items-center gap-2 text-xs font-medium text-muted-foreground hover:text-foreground transition-colors mb-8",children:[e.jsx(W,{className:"w-4 h-4",strokeWidth:1.5})," Back to project"]}),e.jsx("p",{className:"text-foreground",children:"Trace not found."})]})});const C=ve[o.media_type]||O;return e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsxs("div",{className:"lg:flex lg:h-screen lg:overflow-hidden",children:[e.jsxs("div",{className:"lg:w-64 xl:w-
172 lg:flex-shrink-0 lg:border-r lg:border-border/40 lg:sticky lg:top-0 lg:h-screen lg:overflow-y-auto px-6 py-8 flex flex-col",children:[e.jsxs("button",{onClick:()=>l(`/trace/${t}`),className:"flex items-center gap-2 text-xs text-muted-foreground/70 hover:text-foreground transition-colors mb-10",children:[e.jsx(W,{className:"w-3.5 h-3.5",strokeWidth:1.5})," Back"]}),e.jsxs("div",{className:"flex items-center gap-2 mb-6",children:[e.jsx(C,{className:"w-3.5 h-3.5 text-foreground/40",strokeWidth:1.5}),e.jsx("span",{className:"text-[10px] font-meta uppercase tracking-widest text-muted-foreground/50",children:o.media_type})]}),e.jsxs("div",{className:"space-y-5 mb-8 flex-1",children:[o.created_date&&e.jsxs("div",{children:[e.jsx("p",{className:"text-[9px] font-meta uppercase tracking-widest text-muted-foreground/35 mb-1",children:"Added"}),e.jsxs("p",{className:"text-xs text-muted-foreground leading-relaxed",children:[P(new Date(o.created_date),"MMMM d, yyyy"),e.jsx("br",{}),e.jsx("span",{className:"text-muted-foreground/50",children:P(new Date(o.created_date),"HH:mm")})]})]}),o.created_location&&e.jsxs("div",{children:[e.jsx("p",{className:"text-[9px] font-meta uppercase tracking-widest text-muted-foreground/35 mb-1",children:"Location"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:o.created_location})]}),o.trace_display_id&&e.jsxs("div",{children:[e.jsx("p",{className:"text-[9px] font-meta uppercase tracking-widest text-muted-foreground/35 mb-1",children:"Trace ID"}),e.jsx("p",{className:"text-[10px] font-meta text-muted-foreground/40 select-all leading-relaxed",children:o.trace_display_id})]})]}),!n&&e.jsxs("div",{className:"flex flex-col gap-3 border-t border-border/20 pt-6",children:[e.jsxs("button",{onClick:()=>u(!0),className:"flex items-center gap-2 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[e.jsx(te,{className:"w-3.5 h-3.5",strokeWidth:1.5})," Edit"]}),e.jsx("button",{onClick:L,disabled:a,className:"flex items-center gap-2 text-xs text-muted-foreground hover:text-foreground transition-colors disabled:opacity-50",children:o.is_public?e.jsxs(e.Fragment,{children:[e.jsx(se,{className:"w-3.5 h-3.5",strokeWidth:1.5})," Public"]}):e.jsxs(e.Fragment,{children:[e.jsx(re,{className:"w-3.5 h-3.5",strokeWidth:1.5})," Private"]})}),e.jsxs("button",{onClick:()=>v(!0),className:"flex items-center gap-2 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[e.jsx(oe,{className:"w-3.5 h-3.5",strokeWidth:1.5})," Share"]}),j.length>0&&e.jsx("button",{onClick:()=>g(!0),className:"flex items-center gap-2 text-xs text-muted-foreground hover:text-foreground transition-colors",children:e.jsxs("span",{className:"text-[9px] font-meta uppercase tracking-widest",children:["History (",j.length,")"]})})]})]}),e.jsxs("div",{className:"flex-1 lg:overflow-y-auto lg:h-screen",children:[e.jsx("div",{className:"lg:hidden px-5 py-5",children:e.jsxs("button",{onClick:()=>l(`/trace/${t}`),className:"flex items-center gap-2 text-xs text-muted-foreground/70 hover:text-foreground transition-colors",children:[e.jsx(W,{className:"w-3.5 h-3.5",strokeWidth:1.5})," Back"]})}),e.jsxs("div",{className:"p-6 lg:p-12 max-w-3xl",children:[h&&!n&&e.jsxs("div",{className:"flex items-center justify-between mb-8 px-4 py-2.5 border border-border/40 bg-muted/30",children:[e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Viewing ",e.jsxs("span",{className:"font-medium text-foreground",children:["v",h.version_number]})," — ",P(new Date(h.created_date),"MMM d, yyyy HH:mm")]}),e.jsxs("button",{onClick:()=>i(null),className:"text-xs text-muted-foreground hover:text-foreground transition-colors flex items-center gap-1",children:[e.jsx(M,{className:"w-3 h-3",strokeWidth:1.5})," Current"]})]}),n?e.jsxs("div",{className:"max-w-2xl",children:[e.jsxs("div",{className:"flex items-center justify-between mb-6",children:[e.jsx("h3",{className:"text-sm font-medium text-foreground",children:"Edit Trace"}),e.jsx("button",{onClick:()=>u(!1),className:"text-muted-foreground hover:text-foreground transition-colors",children:e.jsx(M,{className:"w-4 h-4",strokeWidth:1.5})})]}),e.jsx(we,{item:o,onSave:E,onCancel:()=>u(!1)})]}):e.jsx(ke,{item:h?{...o,...h,file_urls:h.file_urls||o.file_urls}:o}),e.jsxs("div",{className:"lg:hidden mt-8 pt-6 border-t border-border/20 space-y-4",children:[e.jsxs("p",{className:"text-xs text-muted-foreground
1/60",children:[o.created_date&&P(new Date(o.created_date),"MMMM d, yyyy · HH:mm"),o.created_location&&` · ${o.created_location}`]}),j.length>0&&!n&&e.jsxs("button",{onClick:()=>g(!0),className:"text-[10px] font-meta uppercase tracking-widest text-muted-foreground/40 hover:text-foreground transition-colors",children:["History (",j.length,")"]})]})]})]})]}),c&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed inset-0 z-40 bg-black/20 backdrop-blur-sm",onClick:()=>g(!1)}),e.jsx("div",{className:"fixed top-0 right-0 bottom-0 z-50 w-80 bg-background border-l border-border/40 shadow-2xl overflow-y-auto",children:e.jsxs("div",{className:"px-6 py-6",children:[e.jsxs("div",{className:"flex items-center justify-between mb-6",children:[e.jsx("p",{className:"text-[10px] font-meta uppercase tracking-widest text-muted-foreground/50",children:"Version History"}),e.jsx("button",{onClick:()=>g(!1),className:"text-muted-foreground hover:text-foreground transition-colors",children:e.jsx(M,{className:"w-4 h-4",strokeWidth:1.5})})]}),e.jsx(_e,{versions:j,selectedVersionId:h==null?void 0:h.id,onSelect:N=>{i(N),g(!1)}})]})})]}),e.jsx(ce,{open:w,onClose:()=>v(!1),url:`${window.location.origin}/trace/${t}/item/${s}`,title:o.media_type})]})}export{Fe as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.