PageSourceSearch

https://elzewhere.com/assets/Subject-D5S-krbY.js

js elzewhere.com collected 2026-10-09 05:15:49 UTC 14,104 bytes, 1 lines download raw bytes

1import{j as e}from"./radix-BKGOUGPy.js";import{c as j,m as B,a as R,j as U,q,X as K,p as w}from"./index-CQ3mh-re.js";import{u as N}from"./useQuery-DT7BwPXL.js";import{L as g}from"./Layout-ClRIc5KF.js";import{P as V}from"./PageState-Tb6Ikd4T.js";import{B as k}from"./button-DVXdkXF8.js";import{B as b}from"./badge-C-ZWulZV.js";import{C as G,b as H,c as W,a as Z}from"./card-QFdaScwj.js";import{S as i,b as Q,C as X,N as J,a as Y}from"./collectionReading-CyDREFwv.js";import{u as ee}from"./useSEO-DFpC2sg1.js";import{A as te}from"./arrow-left-D8w90HjM.js";import{C as z}from"./camera-DCuiu_ly.js";import{M as ae}from"./map-pin-CO2c6oL5.js";import{C}from"./clock-x3AU66cC.js";import{E as re}from"./eye-BCh0BLUG.js";import{S as se}from"./share-2-q8RhTvDF.js";import{T as M}from"./triangle-alert-BOBIqv1b.js";import{B as A}from"./building-2-DNr2_b3r.js";import{C as ne}from"./chevron-right-DNk19cPm.js";import{a as le,S as ie}from"./sun-B6ctUv83.js";import{L as oe}from"./landmark-Dygv7UZV.js";import{C as ce}from"./construction-BzXCVG5f.js";import{M as de}from"./mailbox-gYigAnZE.js";import{F as me}from"./factory-0hlPsWjR.js";import{P as ue}from"./palette-6TnGdevs.js";import{T as he}from"./tram-front-BQoc3gv6.js";import{S as xe}from"./shield-B5n29oQq.js";import{f}from"./format-Cwb9Zj0H.js";import"./mapbox-DYU4mihP.js";import"./user-B0xt_bjv.js";import"./check-CyzPzt_C.js";import"./refresh-cw-DOEVmfI7.js";import"./en-US-DaTnBiBt.js";const pe=[["path",{d:"M12 5a3 3 0 1 1 3 3m-3-3a3 3 0 1 0-3 3m3-3v1M9 8a3 3 0 1 0 3 3M9 8h1m5 0a3 3 0 1 1-3 3m3-3h-1m-2 3v-1",key:"3pnvol"}],["circle",{cx:"12",cy:"8",r:"2",key:"1822b1"}],["path",{d:"M12 10v12",key:"6ubwww"}],["path",{d:"M12 22c4.2 0 7-1.667 7-5-4.2 0-7 1.667-7 5Z",key:"9hd38g"}],["path",{d:"M12 22c-4.2 0-7-1.667-7-5 4.2 0 7 1.667 7 5Z",key:"ufn41s"}]],be=j("flower-2",pe);const fe=[["path",{d:"M11 20A7 7 0 0 1 9.8 6.1C15.5 5 17 4.48 19 2c1 2 2 4.18 2 8 0 5.5-4.78 10-10 10Z",key:"nnexq3"}],["path",{d:"M2 21c0-3 1.85-5.36 5.08-6C9.5 14.52 12 13 13 12",key:"mt58a7"}]],je=j("leaf",fe);const ge=[["path",{d:"M12 16h.01",key:"1drbdi"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z",key:"1fd625"}]],ye=j("octagon-alert",ge);const ve=[["path",{d:"m10 20-1.25-2.5L6 18",key:"18frcb"}],["path",{d:"M10 4 8.75 6.5 6 6",key:"7mghy3"}],["path",{d:"m14 20 1.25-2.5L18 18",key:"1chtki"}],["path",{d:"m14 4 1.25 2.5L18 6",key:"1b4wsy"}],["path",{d:"m17 21-3-6h-4",key:"15hhxa"}],["path",{d:"m17 3-3 6 1.5 3",key:"11697g"}],["path",{d:"M2 12h6.5L10 9",key:"kv9z4n"}],["path",{d:"m20 10-1.5 2 1.5 2",key:"1swlpi"}],["path",{d:"M22 12h-6.5L14 15",key:"1mxi28"}],["path",{d:"m4 10 1.5 2L4 14",key:"k9enpj"}],["path",{d:"m7 21 3-6-1.5-3",key:"j8hb9u"}],["path",{d:"m7 3 3 6h4",key:"1otusx"}]],we=j("snowflake",ve),Ne=r=>{switch(r){case"infrastructure_object":return A;case"mobile_asset":return he;case"surface_art":return ue;case"industrial_relic":return me;case"street_object":return de;case"rail_infrastructure":return ce;case"public_art":return oe;default:return le}},ke=r=>{switch(r){case"infrastructure_object":return"text-amber-700 dark:text-amber-300";case"mobile_asset":return"text-amber-800 dark:text-amber-300";case"surface_art":return"text-emerald-700 dark:text-emerald-300";case"industrial_relic":return"text-amber-800 dark:text-amber-300";case"street_object":return"text-cyan-700 dark:text-cyan-300";case"rail_infrastructure":return"text-yellow-700 dark:text-yellow-300";case"public_art":return"text-purple-700 dark:text-purple-300";default:return"text-red-700 dark:text-red-300"}};function ze(r){const l=new Date(r).getMonth();return l>=2&&l<=4?{label:"Spring",icon:e.jsx(be,{className:"w-3.5 h-3.5"}),color:"text-emerald-700 dark:text-emerald-300 bg-emerald-600/10"}:l>=5&&l<=7?{label:"Summer",icon:e.jsx(ie,{className:"w-3.5 h-3.5"}),color:"text-amber-700 dark:text-amber-300 bg-amber-600/10"}:l>=8&&l<=10?{label:"Autumn",icon:e.jsx(je,{className:"w-3.5 h-3.5"}),color:"text-orange-700 dark:text-orange-300 bg-orange-600/10"}:{label:"Winter",icon:e.jsx(we,{className:"w-3.5 h-3.5"}),color:"text-blue-700 dark:text-blue-300 bg-blue-600/10"}}function Ce(r){const s=r.toUpperCase();return s==="INTACT"||s==="WORKING"||s==="NORMAL"?{label:"Good condition",icon:e.jsx(xe,{className:"w-3.5 h-3.5"}),color:"text-emerald-700 dark:text-emerald-300 bg-emerald-600/10 border-emerald-500/30"}:s==="DAMAGED"||s==="ALTERED"?{label:"Damaged",icon:e.jsx(ye,{className:"w-3.5 h-3.5"}),color:"text-amber-700 dark:text-amber-300 bg-amber-600/10 border-amber-500/30"}:s==="ABANDONED"||s==="DECOMMISSIONED"?{label:"Abandoned",icon:e.jsx(M,{className:"w-3.5 h-3.5"}),color:"text-red-700 dark:text-red-300 bg-red-600/10 border-red-500/30"}:s==="REMOVED"?{label:"Removed",icon:e.jsx(K,{className:"w-3.5 h-3.5"}
1),color:"text-slate-600 dark:text-slate-300 bg-slate-600/10 border-slate-500/30"}:null}function lt(){const{publicId:r}=B(),[,s]=R(),{isDark:l}=U(),{data:n,isLoading:S,error:$,refetch:D,isFetching:L}=N({queryKey:["/api/subjects/by-public-id",r],queryFn:async()=>{const a=await w(`/api/subjects/by-public-id/${r}`,{credentials:"include"});if(!a.ok)throw a.status===404?new Error("Subject not found"):new Error("Failed to fetch subject");return a.json()},enabled:!!r}),{data:T}=N({queryKey:["/api/venues"],queryFn:async()=>{const a=await w("/api/venues",{credentials:"include"});if(!a.ok)throw new Error("Failed to fetch venues");return a.json()},enabled:!!n?.subject?.venueId,staleTime:6e4}),_=n?.subject?.title||n?.subject?.identityPrimary||"Place",I=n?.subject?.oneLineSummary||n?.subject?.canonicalNarrative||(n?.subject?.localArea?`A place in ${n.subject.localArea}`:"A place on Elzewhere");ee({title:_,description:I,canonical:r?`/subject/${r}`:void 0});const O=()=>{window.history.length>1?window.history.back():s("/compass")};if(S)return e.jsx(g,{children:e.jsxs("div",{className:"max-w-2xl md:max-w-3xl mx-auto pb-24 px-4",children:[e.jsx("div",{className:"h-4 w-24 bg-elz-surface animate-pulse rounded mb-4 mt-4"}),e.jsx(i,{className:"w-full aspect-video rounded-lg mb-6 bg-elz-surface"}),e.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[e.jsx(i,{className:"w-12 h-12 rounded-lg bg-elz-surface"}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{className:"h-6 w-48 bg-elz-surface"}),e.jsx(i,{className:"h-4 w-32 bg-elz-surface"})]})]}),e.jsxs("div",{className:"space-y-4 mb-8",children:[e.jsx(i,{className:"h-4 w-full bg-elz-surface"}),e.jsx(i,{className:"h-4 w-5/6 bg-elz-surface"}),e.jsx(i,{className:"h-4 w-4/6 bg-elz-surface"})]}),e.jsx(i,{className:"h-40 w-full rounded-lg bg-elz-surface"})]})});if($||!n)return e.jsx(g,{children:e.jsx(V,{title:"We couldn’t load this find",description:"Try again, or explore another find if this one has moved or been removed.",onRetry:()=>D(),retrying:L,children:e.jsx(k,{variant:"outline",onClick:()=>s("/feed"),children:"Explore other finds"})})});const{subject:t,observations:c}=n,E=Ne(t.parentDptKey),P=ke(t.parentDptKey),o=t.venueId!=null?T?.find(a=>a.id===t.venueId)??null:null,d=c[0]??null;Q({subject:t,linkedVenue:o});const y=c[0]?.conditionStatus||t.conditionStatus,m=y?Ce(y):null,u=t.firstObservedAt?ze(new Date(t.firstObservedAt).toISOString()):null,h=t.latitude,x=t.longitude,v=h&&x?`https://www.openstreetmap.org/export/embed.html?bbox=${x-.005},${h-.003},${x+.005},${h+.003}&layer=mapnik&marker=${h},${x}`:null,F=async()=>{const a=q(window.location.pathname+window.location.search);if(navigator.share)try{await navigator.share({title:t.title||"Elzewhere Place",url:a})}catch{navigator.clipboard.writeText(a)}else navigator.clipboard.writeText(a)};return e.jsx(g,{children:e.jsxs("div",{className:"max-w-2xl md:max-w-3xl mx-auto pb-24 px-4",children:[e.jsxs("button",{onClick:O,className:"flex items-center gap-2 text-elz-muted hover:text-elz-primary mb-4 mt-4 transition-colors","data-testid":"back-button",children:[e.jsx(te,{className:"w-4 h-4"}),e.jsx("span",{className:"text-sm font-medium",children:"Back"})]}),t.primaryImageUrl&&e.jsxs("div",{className:"relative w-full aspect-video rounded-lg overflow-hidden mb-6 border border-elz",children:[e.jsx("img",{src:t.primaryImageUrl,alt:t.title||"Subject image",className:"w-full h-full object-cover","data-testid":"subject-hero-image"}),t.observationCount>1&&e.jsxs("div",{className:"absolute bottom-3 right-3 bg-elz-elevated/90 px-2 py-1 rounded text-xs font-mono text-elz-primary flex items-center gap-1 shadow-sm",children:[e.jsx(z,{className:"w-3 h-3"}),t.observationCount," observations"]})]}),e.jsx(X,{label:"The story of this find",description:"Photos and details collected over time.",title:t.title||"An unnamed find",subtitle:t.subtype||t.identityPrimary||null,summary:t.oneLineSummary||"See what people have noticed about this thing and how it has changed over time.",highlights:[t.localArea?`Anchored in ${t.localArea}`:"Location anchored",t.firstObservedAt?`First noticed ${f(new Date(t.firstObservedAt),"MMM d, yyyy")}`:"Timeline started",`${t.observationCount} observation${t.observationCount===1?"":"s"}`],icon:e.jsx(E,{className:`w-5 h-5 ${P}`}),actions:e.jsx(k,{variant:"ghost",size:"icon",onClick:F,className:"text-elz-muted hover:text-elz-primary hover:bg-elz-surface","aria-label":"Share this find","data-testid":"share-button",children:e.jsx(se,{className:"w-5 h-5"})}),meta:e.jsxs("div",{className:"flex flex-wrap items-center gap-3 text-sm text-elz-secondary",children:[t.firstFoundBy?.username&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"text-elz-muted",children:"First found by"}),e.jsx("span",{className:"text-elz-accent-deep font-medium",children:t.firstFoundBy.username})]}),t.localArea&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(ae,{className:"w-4 h-4 text-elz-muted"}),e.jsx("span",{children:t.localArea})]}),t.firstObservedAt&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(C,{className:"w-4 h-4 text-elz-muted"}),e.jsx("span",{children:f(new Date(t.firstObservedAt),"MMM d, yyyy")})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(re,{className:"w-4 h-4 text-elz-muted"}),e.jsxs("span",{children:[t.observationCount," obs"]})]})]})}),(m||u)&&e.jsxs("div",{className:"flex flex-wrap gap-2 mb-4",children:[m&&e.jsxs(b,{variant:"outline",className:`${m.color} flex items-center gap-1.5 px-2.5 py-1`,children:[m.icon,m.label]}),u&&e.jsxs(b,{variant:"outline",className:`${u.color} border-0 flex items-center gap-1.5 px-2.5 py-1`,children:[u.icon,u.label]})]}),t.canonicalNarrative&&e.jsx("div",{className:"mb-6","data-testid":"canonical-narrative",children:e.jsx(J,{eyebrow:"Canonical Narrative",text:t.canonicalNarrative})}),t.contextChips&&t.contextChips.length>0&&e.jsx("div",{className:"flex flex-wrap gap-2 mb-6",children:t.contextChips.map((a,p)=>e.jsx(b,{variant:"secondary",className:"bg-elz-surface text-elz-secondary border border-elz",children:a},p))}),t.hazards&&t.hazards.length>0&&e.jsx("div",{className:"flex flex-wrap gap-2 mb-6",children:t.hazards.map((a,p)=>e.jsxs(b,{variant:"destructive",className:"bg-red-50 text-red-700 dark:text-red-300 border-red-200",children:[e.jsx(M,{className:"w-3 h-3 mr-1"}),a]},p))}),e.jsx("div",{className:"mb-6",children:e.jsx(Y,{eyebrow:"Collection Context",title:"The story of this find",description:o?"See what people have learned about this find, browse the
1ir photos, and explore the place where it belongs.":"See what people have learned about this find and how it has changed across their visits.",stats:[{label:"About",value:"This find"},{label:"Observations",value:`${c.length}`}],links:[...d?[{href:`/record/${d.publicId}`,label:d.title||d.identityPrimary||"Latest observation",description:`Most recent visit recorded ${f(new Date(d.capturedAt),"MMM d, yyyy")}.`,icon:z}]:[],...o?[{href:`/venue/${o.publicId}`,label:o.name,description:`Venue destination · ${o.exhibitCount} exhibit${o.exhibitCount===1?"":"s"} in this building.`,icon:A}]:[]]})}),v&&e.jsxs("div",{className:"mb-6","data-testid":"section-mini-map",children:[e.jsx("p",{className:"text-elz-muted text-xs uppercase tracking-wide font-bold mb-2",children:"Location"}),e.jsxs("div",{className:"rounded-lg overflow-hidden border border-elz relative group",style:{height:"180px"},children:[e.jsx("iframe",{title:"Subject location",width:"100%",height:"100%",style:{border:0,filter:l?"invert(90%) hue-rotate(180deg) brightness(95%) contrast(90%)":"none"},loading:"lazy",src:v}),e.jsx("div",{className:"absolute inset-0 pointer-events-none border border-black/5 rounded-lg"})]})]}),e.jsxs(G,{className:"bg-elz-elevated border-elz",children:[e.jsx(H,{children:e.jsxs(W,{className:"text-elz-primary text-sm font-semibold flex items-center gap-2",children:[e.jsx(C,{className:"w-4 h-4 text-elz-accent-deep"}),"Observation Timeline (",c.length,")"]})}),e.jsx(Z,{className:"space-y-3",children:c.length===0?e.jsx("p",{className:"text-elz-muted text-sm",children:"No observations yet."}):c.map(a=>e.jsxs("button",{onClick:()=>s(`/record/${a.publicId}`),className:"w-full flex items-center gap-3 p-3 bg-elz-ink rounded-lg border border-elz hover:border-elz-accent-50 hover:shadow-sm transition-all text-left","data-testid":`observation-${a.publicId}`,children:[a.primaryImageUrl&&e.jsx("img",{src:a.primaryImageUrl,alt:"",className:"w-12 h-12 rounded object-cover flex-shrink-0"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-0.5",children:[a.user?.username&&e.jsx("span",{className:"text-elz-accent-deep text-xs font-medium",children:a.user.username}),e.jsx("span",{className:"text-elz-muted text-xs",children:a.capturedAt&&f(new Date(a.capturedAt),"MMM d, yyyy")})]}),e.jsx("p",{className:"text-elz-secondary text-sm truncate",children:a.microStory||"Observed again."})]}),e.jsx(ne,{className:"w-4 h-4 text-elz-muted flex-shrink-0"})]},a.publicId))})]})]})})}export{lt 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.