1import{b5 as u,Z as f,a as c,ay as t}from"./index-DmgU6RuH.js";import{i as p,d as i,a as g,L as h}from"./react-D3U8F7Tb.js";import{r as x,W as b}from"./WatchPage-CKFe-00K.js";import{A as v}from"./arrow-right-C6bBZ-JU.js";import"./firebase-mnCD0fI0.js";import"./FeedConsentSheet-B7lM94V4.js";import"./language-m9LaWKQc.js";import"./safeUrl-BkwVMgd-.js";import"./variants-CAUXRVyQ.js";import"./GuidanceDetails-CXqaE3eb.js";import"./external-link-QD-NtX3V.js";import"./play-BUTOqMCF.js";function T(){const{token:o=""}=p(),{loading:m}=u(),[e,l]=i.useState(null),[s,a]=i.useState(null);if(i.useEffect(()=>{let r=!1;return l(null),a(null),f(`/api/feed/placements/${encodeURIComponent(o)}`).then(n=>{r||l(n)}).catch(n=>{r||(n instanceof c&&n.status===410?a("gone"):n instanceof c&&n.status===404?a("not-found"):a("network"))}),()=>{r=!0}},[o]),i.useEffect(()=>{e&&x(e.token)},[e]),s)return t.jsx(d,{message:s==="gone"?"This link is no longer available.":s==="not-found"?"Link not found":"Unable to open this link. Please try again later."});if(!e||m)return t.jsxs("div",{className:"min-h-screen bg-brand-warm flex items-center justify-center","aria-live":"polite",children:[t.jsx("div",{className:"w-8 h-8 border-4 border-gray-200 border-t-brand-emerald rounded-full animate-spin"}),t.jsx("span",{className:"sr-only",children:"Loading"})]});if(e.kind==="video"&&e.video_id!=null)return t.jsx(b,{placement:{token:e.token,videoId:String(e.video_id)}});if(e.kind==="collection"&&e.collection){const r={placementToken:e.token,featuredCollectionId:e.collection.id};return t.jsx(g,{to:`/doctor/${e.doctor_id}`,replace:!0,state:r})}return t.jsx(d,{message:"This link is no longer available."})}function d({message:o}){return t.jsxs("div",{className:"min-h-screen bg-brand-warm flex flex-col items-center justify-center px-6 text-center",children:[t.jsx("p",{className:"text-gray-700 text-lg mb-6",children:o}),t.jsxs(h,{to:"/discover",className:"inline-flex items-center gap-2 bg-brand-emerald text-white px-6 py-3 rounded-full font-semibold hover:shadow-lg transition-shadow focus:outline-none focus:ring-2 focus:ring-brand-light-blue",children:["Explore health videos ",t.jsx(v,{className:"h-4 w-4"})]})]})}export{T as PlacementPage};
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.