PageSourceSearch

https://seniormoments.co.nz/assets/daily-cuppa-BtrWbnGn.js

js seniormoments.co.nz collected 2026-10-09 22:04:25 UTC 47,275 bytes, 1 lines download raw bytes

1import{d as Ee,a as $e,r as d,c as _,s as p,j as e,X as Fe,C as Ie,L as Pe,b as Ke,p as Qe,t as v}from"./index-B8x47Np6.js";import{w as Ue}from"./with-feature-gate-Cryy2otL.js";import{P as Ge,S as Ve,D as je,a as Ne,b as ve,c as _e,d as We}from"./page-shell-B6nVnWma.js";import{S as W,a as H,b as J,c as Y,d as Z}from"./select-GJU65LIw.js";import{g as xe,Q as He,L as Je,A as Ye,N as Ze}from"./cuppa-defaults-CWn-IEPP.js";import{R as de,P as we,a as ke,S as Xe,b as Ce}from"./reaction-picker-qbFD5rMq.js";import{c as u}from"./utils-0exNfmSl.js";import{n as et,c as tt}from"./scamFilters-CcfCaOTl.js";import{S as st}from"./safetyCopy-Drov0vUe.js";import{L as at}from"./listen-button-CFdLvfkH.js";import{L as rt}from"./listen-pill-BSlELNNf.js";import{a as X}from"./shopping-bag-kBsB5wOf.js";import{B as ee}from"./book-open-B3kxfUVr.js";import{C as it}from"./chevron-down-DgFpKikc.js";import{E as Be}from"./external-link-CUSlA8Bv.js";import{S as Se}from"./sparkles-BmGftohC.js";import{T as nt}from"./triangle-alert-CQ16ibye.js";import{C as ot}from"./circle-check-BDgNrDC8.js";import{P as lt}from"./printer-CGN44Bmu.js";import{H as dt}from"./heart-jaoJ1tBk.js";import{M as ct}from"./message-circle-DwyaTncy.js";import{S as mt}from"./send-DWXl7hJY.js";import"./use-feature-flags-Da5LJ0l8.js";import"./index-CT_4jwyh.js";import"./index-C_Ozil7u.js";import"./index-CgILayYx.js";import"./index-BCNAH5D-.js";import"./index-BKQnY9o4.js";import"./index-ChWmzZvy.js";import"./chevron-right-D6eNGqbj.js";import"./check-ksWrDi2E.js";import"./image-D3lfOXgY.js";import"./chef-hat-DZMgTATX.js";import"./sprout-BREjQGWU.js";import"./users-DpBRMavy.js";import"./shield-check-BQUdOSFv.js";import"./settings-CjD7M6aU.js";import"./index-D158fRLV.js";import"./chevron-up-BT2HJy7N.js";import"./clsx-B-dksMZM.js";import"./rotate-ccw-CWt9VsDT.js";import"./headphones-DOix1kvw.js";import"./play-Aw9wvxYm.js";const xt=[["rect",{width:"18",height:"7",x:"3",y:"3",rx:"1",key:"f1a2em"}],["rect",{width:"9",height:"7",x:"3",y:"14",rx:"1",key:"jqznyg"}],["rect",{width:"5",height:"7",x:"16",y:"14",rx:"1",key:"q5h2i8"}]],ut=Ee("layout-template",xt),pt="/assets/sunday-Ce_JYWDg.jpg",gt="/assets/monday-DAygX6rU.jpg",ft="/assets/tuesday-DVDHZGv-.jpg",ht="/assets/wednesday-Fkl5JhoN.jpg",bt="/assets/thursday-BnpdtB7E.jpg",yt="/assets/friday-BkumjzV
1d.jpg",jt="/assets/saturday-3I-1Z_GW.jpg",Nt=[pt,gt,ft,ht,bt,yt,jt];function vt(t=new Date){return Nt[t.getDay()]}const De=[{value:"classic_briefing",label:"Classic"},{value:"magazine_feature",label:"Feature"},{value:"compact_digest",label:"Digest"},{value:"nostalgia_style",label:"Nostalgia"},{value:"practical_update",label:"Practical"}],te=t=>new Date(t).toLocaleDateString("en-NZ",{weekday:"long",day:"numeric",month:"long",year:"numeric"}),Te=t=>t.split(/\s+/).filter(Boolean).slice(0,2).map(a=>a[0]?.toUpperCase()).join("")||"?",_t=t=>{const a=Math.floor((Date.now()-new Date(t).getTime())/6e4);if(a<1)return"just now";if(a<60)return`${a}m`;const r=Math.floor(a/60);return r<24?`${r}h`:`${Math.floor(r/24)}d`},wt=t=>t.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"").slice(0,48);function se(t){return t.item.type==="magazine"?t.item.data.section_title:t.item.data.contributor_posts?.title||"Daily Cuppa story"}function ce(t){return t.item.type==="magazine"?t.item.data.category||"Daily Cuppa":t.item.data.contributor_posts?.category||"Community"}function kt(t){return t.item.type==="magazine"?t.item.data.standfirst||t.item.data.section_body:t.item.data.contributor_posts?.excerpt||t.item.data.contributor_posts?.body||""}function Ct(t){return t.item.type==="magazine"?t.item.data.section_body:t.item.data.contributor_posts?.body||t.item.data.contributor_posts?.excerpt||""}function me(t){return`cuppa-${t.editionDate}-${wt(se(t)||t.id)}`}function qe(t){const a=`${se(t)} ${kt(t)} ${Ct(t)}`.trim().split(/\s+/).filter(Boolean).length;return Math.max(1,Math.ceil(a/220))}function E({section:t,className:a=""}){const{user:r,profile:x}=$e(),m=Ke(),[c,b]=d.useState(!1),[y,B]=d.useState(""),[I,S]=d.useState(!1),[P,w]=d.useState(!1),[D,K]=d.useState(!1),[R,T]=d.useState(!1),{data:re=[]}=_({queryKey:["daily-cuppa-section-likes",t.id],queryFn:async()=>{const{data:i}=await p.from("daily_cuppa_section_likes").select("user_id").eq("section_id",t.id);return i??[]}}),{data:A}=_({queryKey:["daily-cuppa-section-like-mine",t.id,r?.id],enabled:!!r,queryFn:async()=>{const{data:i}=await p.from("daily_cuppa_section_likes").select("id").eq("section_id",t.id).eq("user_id",r.id).maybeSingle();return i??null}}),{data:L={}}=_({queryKey:["daily-cuppa-section-reactions",t.id],queryFn:async()=>{const{data:i}=await p.from("daily_cuppa_section_reactions").select("reaction_type").eq("section_id",t.id),n={};return(i??[]).forEach(f=>{n[f.reaction_type]=(n[f.reaction_type]??0)+1}),n}}),{data:j}=_({queryKey:["daily-cuppa-section-reaction-mine",t.id,r?.id],enabled:!!r,queryFn:async()=>{const{data:i}=await p.from("daily_cuppa_section_reactions").select("reaction_type").eq("section_id",t.id).eq("user_id",r.id).maybeSingle();return i?.reaction_type??null}}),{data:M=0}=_({queryKey:["daily-cuppa-section-comments-count",t.id],queryFn:async()=>{const{count:i}=await p.from("daily_cuppa_section_comments").select("id",{count:"exact",head:!0}).eq("section_id",t.id).eq("status","published");return i??0}}),{data:Q=[]}=_({queryKey:["daily-cuppa-section-comments",t.id],enabled:c,queryFn:async()=>{const{data:i}=await p.from("daily_cuppa_section_comments").select("id, body, created_at, author_id").eq("section_id",t.id).eq("status","published").order("created_at",{ascending:!0});if(!i||i.length===0)return[];const n=Array.from(new Set(i.map(g=>g.author_id).filter(Boolean))),{data:f}=n.length?await p.from("profiles").select("id,display_name").in("id",n):{data:[]},q=new Map((f??[]).map(g=>[g.id,g.display_name]));return i.map(g=>({...g,display_name:q.get(g.author_id)??"Member"}))}}),k=!!A,z=re.length,U=Object.values(L).reduce((i,n)=>i+n,0),C=Object.entries(L).sort((i,n)=>n[1]-i[1]).slice(0,3),G=j?de.find(i=>i.type===j):null,N=async()=>{if(!r)return v.error("Sign in to like this story.");if(!P){w(!0);try{k?await p.from("daily_cuppa_section_likes").delete().eq("section_id",t.id).eq("user_id",r.id):await p.from("daily_cuppa_section_likes").insert({section_id:t.id,user_id:r.id}),m.invalidateQueries({queryKey:["daily-cuppa-section-likes",t.id]}),m.invalidateQueries({queryKey:["daily-cuppa-section-like-mine",t.id,r.id]})}catch(i){v.error(i?.message??"Couldn't save like.")}finally{w(!1)}}},ie=async i=>{if(!r)return v.error("Sign in to react to this story.");if(!R){T(!0);try{j===i?await p.from("daily_cuppa_section_reactions").delete().eq("section_id",t.id).eq("user_id",r.id):j?await p.from("daily_cuppa_section_reactions").update({reaction_type:i}).eq("section_id",t.id).eq("user_id",r.id):await p.from("daily_cuppa_section_reactions").insert({section_id:t.
1id,user_id:r.id,reaction_type:i}),m.invalidateQueries({queryKey:["daily-cuppa-section-reactions",t.id]}),m.invalidateQueries({queryKey:["daily-cuppa-section-reaction-mine",t.id,r.id]}),K(!1)}catch(n){v.error(n?.message??"Couldn't save reaction.")}finally{T(!1)}}},V=async()=>{const i=y.trim();if(!i)return;if(!r)return v.error("Sign in to comment.");const n=tt(i);if(!n.ok)return v.error(n.message);S(!0);try{const{error:f}=await p.from("daily_cuppa_section_comments").insert({section_id:t.id,author_id:r.id,body:i});if(f)throw f;B(""),m.invalidateQueries({queryKey:["daily-cuppa-section-comments",t.id]}),m.invalidateQueries({queryKey:["daily-cuppa-section-comments-count",t.id]}),v.success("Comment posted.")}catch(f){v.error(f?.message??"Couldn't post comment.")}finally{S(!1)}};return e.jsx("div",{className:`mt-5 border-t border-border/60 pt-4 ${a}`,children:e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(at,{sectionId:t.id,audioUrl:t.audio_url}),e.jsxs("button",{type:"button","aria-label":k?"Unlike story":"Like story",onClick:N,disabled:P,className:u("inline-flex min-h-[44px] items-center gap-2 rounded-xl px-4 py-3 text-sm font-medium transition focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-sage",k?"bg-red-50 text-red-500":"text-muted-foreground hover:bg-secondary hover:text-foreground"),children:[e.jsx(dt,{className:u("h-5 w-5",k&&"fill-current"),"aria-hidden":!0}),e.jsx("span",{children:z>0?`${z} Likes`:"Like"})]}),e.jsxs(we,{open:D,onOpenChange:K,children:[e.jsx(ke,{asChild:!0,children:e.jsxs("button",{type:"button","aria-label":"React to story",className:u("inline-flex min-h-[44px] items-center gap-2 rounded-xl px-4 py-3 text-sm font-medium transition focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-sage",j?"bg-sage/10 text-foreground":"text-muted-foreground hover:bg-secondary hover:text-foreground"),children:[G?e.jsx("span",{className:"text-lg leading-none",children:G.emoji}):e.jsx(Xe,{className:"h-5 w-5"}),e.jsx("span",{children:U>0?e.jsxs(e.Fragment,{children:[e.jsx("span",{"aria-hidden":!0,children:C.map(([i])=>de.find(n=>n.type===i)?.emoji).join("")}),e.jsx("span",{className:"ml-1",children:U})]}):"React"})]})}),e.jsx(Ce,{align:"start",className:"w-auto rounded-full p-1",children:e.jsx("div",{className:"flex items-center gap-1",children:de.map(i=>{const n=L[i.type]??0,f=j===i.type;return e.jsxs("button",{type:"button",onClick:()=>ie(i.type),disabled:R,title:i.label,className:u("flex flex-col items-center rounded-full px-2 py-1 text-xs transition hover:bg-secondary",f&&"bg-sage/15"),children:[e.jsx("span",{className:"text-2xl leading-none",children:i.emoji}),e.jsx("span",{className:"mt-0.5 text-[10px] text-muted-foreground",children:n>0?n:""})]},i.type)})})})]}),e.jsxs(we,{open:c,onOpenChange:b,children:[e.jsx(ke,{asChild:!0,children:e.jsxs("button",{type:"button","aria-label":"Comment on story",className:"inline-flex min-h-[44px] items-center gap-2 rounded-xl px-4 py-3 text-sm font-medium text-muted-foreground transition hover:bg-secondary hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-sage",children:[e.jsx(ct,{className:"h-5 w-5"}),e.jsx("span",{children:M>0?`${M} Comments`:"Comment"})]})}),e.jsxs(Ce,{align:"start",className:"w-[min(92vw,440px)] rounded-2xl p-0",children:[e.jsx("div",{className:"max-h-[320px] overflow-y-auto p-4",children:Q.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:"No comments yet, be the first."}):e.jsx("ul",{className:"space-y-3",children:Q.map(i=>e.jsxs("li",{className:"flex gap-2",children:[e.jsx("div",{className:"grid h-8 w-8 shrink-0 place-items-center rounded-full bg-secondary font-display text-xs",children:Te(i.display_name)}),e.jsxs("div",{className:"flex-1 rounded-xl bg-secondary/60 p-2.5",children:[e.jsxs("div",{className:"text-xs",children:[e.jsx("span",{className:"font-medium",children:Qe(i.display_name)})," ",e.jsxs("span",{className:"text-muted-foreground",children:["· ",_t(i.created_at)]})]}),e.jsx("p",{className:"mt-0.5 text-sm",children:et(i.body)})]})]},i.id))})}),e.jsxs("form",{onSubmit:i=>{i.preventDefault(),V()},className:"flex items-center gap-2 border-t border-border p-3",children:[e.jsx("div",{className:"grid h-8 w-8 shrink-0 place-items-center rounded-full bg-secondary font-display text-xs",children:x?.display_name?Te(x.display_name):"?"}),e.jsx("input",{value:y,onChange:i=>B(i.target.value),placeholder:r?st.commentPlaceholder:"Sign in to comment",disabled:!r||I,className:"min-h-[40px] flex-1 rounded-full border border-input bg-background px-3 py-1.5 text-sm outline-none focus:border-ring disabled:opacity-60"}),e.jsx("button",{type:"submit",disabled:!r||!y.trim()||I,className:"grid h-10 w-10 place-items-center rounded-full bg-foreground text-background disabled:opacity-50","aria-label":"Post comment",children:e.jsx(mt,{className:"h-4 w-4"})})]})]})]})]})})}function St(){const{profile:t}=$e(),[a,r]=d.useState("All"),[x,m]=d.useState(20);d.useEffect(()=>{m(20)},[a]);const[c,b]=d.useState(()=>{if(typeof window<"u"){const s=localStorage.getItem("daily_cuppa_reading_style");if(s)return s}return"magazine_feature"}
1),[y,B]=d.useState(!1),[I,S]=d.useState(!1),[P,w]=d.useState(!1),[D,K]=d.useState(!1);d.useEffect(()=>{const s=()=>S(l=>!l),o=()=>w(l=>!l);return window.addEventListener("toggle-mobile-options",s),window.addEventListener("toggle-cuppa-topics",o),()=>{window.removeEventListener("toggle-mobile-options",s),window.removeEventListener("toggle-cuppa-topics",o)}},[]);const R=s=>{b(s),typeof window<"u"&&localStorage.setItem("daily_cuppa_reading_style",s)},[T,re]=d.useState(()=>typeof window<"u"&&localStorage.getItem("daily_cuppa_text_size")||"md"),[A,L]=d.useState(()=>typeof window<"u"&&localStorage.getItem("daily_cuppa_reading_font")||"sans"),j=s=>{re(s),typeof window<"u"&&localStorage.setItem("daily_cuppa_text_size",s)},M=s=>{L(s),typeof window<"u"&&localStorage.setItem("daily_cuppa_reading_font",s)},Q=d.useRef(null),k=d.useRef(null),[z,U]=d.useState(0);d.useEffect(()=>{const s=k.current;if(!s)return;const o=()=>U(s.offsetWidth);o();const l=new ResizeObserver(o);return l.observe(s),()=>l.disconnect()},[]);const{data:C,isLoading:G}=_({queryKey:["public-cuppa-magazine"],queryFn:async()=>{const{data:s,error:o}=await p.from("ai_daily_cuppa_sections").select("*").eq("status","published").order("edition_date",{ascending:!1}).order("sort_order",{ascending:!0});if(o&&o.code!=="42P01")throw o;return s??[]}}),{data:N,isLoading:ie}=_({queryKey:["public-cuppa-legacy"],queryFn:async()=>{const{data:s}=await p.from("daily_cuppa_editions").select("id, edition_date, title, intro_text").eq("status","published");if(!s||s.length===0)return{editions:[],items:[]};const{data:o}=await p.from("daily_cuppa_items").select("edition_id, is_featured, display_order, contributor_posts(title, excerpt, body, category, source_url, source_label, contributors(name, avatar_url))").in("edition_id",s.map(l=>l.id));return{editions:s,items:o??[]}}}),V=d.useMemo(()=>{const s=new Set;return C?.forEach(o=>{o.category&&s.add(o.category)}),N?.items?.forEach(o=>{o.contributor_posts?.category&&s.add(o.contributor_posts.category)}),["All",...Array.from(s)].sort()},[C,N]),i=d.useMemo(()=>{const s=new Map;return N&&N.editions.forEach(l=>{const h=N.items.filter(le=>le.edition_id===l.id).map(le=>({type:"legacy",data:le}));h.length>0&&s.set(l.edition_date,{date:l.edition_date,title:l.title,intro:l.intro_text,items:h})}),C&&C.forEach(l=>{s.has(l.edition_date)||s.set(l.edition_date,{date:l.edition_date,items:[]}),s.get(l.edition_date).items.push({type:"magazine",data:l})}),Array.from(s.values()).map(l=>({...l,items:l.items.filter(h=>a==="All"?!0:h.type==="magazine"?h.data.category===a:h.type==="legacy"?h.data.contributor_posts?.category===a:!1)})).filter(l=>l.items.length>0).sort((l,h)=>h.date.localeCompare(l.date))},[C,N,a]),n=d.useMemo(()=>i.flatMap(s=>s.items.map((o,l)=>({id:o.type==="magazine"?o.data.id:`${s.date}-${o.data.edition_id}-${l}`,editionDate:s.date,editionTitle:s.title,editionIntro:s.intro,item:o}))),[i]),f=G||ie,q=n[0]?.editionDate,g=n,ne=d.useMemo(()=>g.slice(0,x),[g,x]),fe=t?.display_name?.split(/\s+/).filter(Boolean)[0],he=new Date().getHours(),be=he<12?"Good morning":he<18?"Good afternoon":"Good evening",Ae=fe?`${be}, ${fe}`:be,ye=d.useMemo(()=>Array.from(new Set(n.map(s=>ce(s)).filter(Boolean))).slice(0,4),[n]),oe=n.length>0?`${n.length} ${n.length===1?"story":"stories"} brewed fresh${ye.length?` across ${ye.join(", ")}`:""}.`:"A fresh issue is brewing.",Le=c==="magazine_feature"?"space-y-6":c==="compact_digest"?"grid gap-4":c==="classic_briefing"?"grid gap-5":"grid gap-5 md:grid-cols-2",Me={sm:"[&_.formatted-body]:text-sm [&_.formatted-body_p]:text-sm",md:"[&_.formatted-body]:text-base [&_.formatted-body_p]:text-base",lg:"[&_.formatted-body]:text-lg md:[&_.formatted-body]:text-xl [&_.formatted-body_p]:text-lg md:[&_.formatted-body_p]:text-xl",xl:"[&_.formatted-body]:text-xl md:[&_.formatted-body]:text-2xl [&_.formatted-body_p]:text-xl md:[&_.formatted-body_p]:text-2xl"}[T]||"text-base",ze={sans:"[&_.formatted-body]:font-sans",serif:"[&_.formatted-body]:font-serif [&_.formatted-body]:tracking-normal [&_.formatted-body]:leading-relaxed"}[A]||"font-sans",Oe=()=>null;return e.jsxs(Ge,{children:[e.jsxs("div",{className:"mx-auto max-w-7xl px-4 py-6 md:px-6 md:py-8",children:[e.jsxs("header",{className:"relative mb-5 overflow-hidden rounded-[2rem] border border-border bg-card shadow-sm",children:[e.jsx("div",{className:"absolute inset-0 rounded-[2rem] bg-cover bg-center",style:{backgroundImage:`url(${vt()})`}}),e.jsx("div",{className:"absolute inset-0 rounded-[2rem] bg-background/20"}),e.jsxs("div",{className:"relative grid gap-0 md:grid-cols-[1.35fr_0.65fr]",children:[e.jsxs("div",{className:"bg-background/88 p-5 backdrop-blur-sm md:p-8",children:[e.jsxs("div",{className:"mb-4 inline-flex items-center gap-2 rounded-full border border-border/70 bg-background/85 px-3 py-1 text-[11px] font-semibold uppercase tracking-[0.18em] text-muted-foreground",children:[e.jsx(X,{className:"h-3.5 w-3.5 text-sage"})," Daily Cuppa Magazine"]}),e.jsx("h1",{className:"font-display text-4xl leading-tight md:text-6xl",children:Ae}),e.jsxs("p",{className:"mt-3 max-w-2xl text-base leading-7 text-foreground
1/75 md:text-lg",children:[q?te(q):"Today's issue is brewing","."," ",oe]})]}),e.jsx("div",{className:"border-t border-border/30 bg-background/35 p-5 backdrop-blur-[2px] md:border-l md:border-t-0 md:p-6",children:e.jsxs("div",{className:"rounded-2xl bg-background/45 p-4 ring-1 ring-white/40 backdrop-blur-sm",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"grid h-10 w-10 place-items-center rounded-xl bg-primary text-primary-foreground shadow",children:e.jsx(ee,{className:"h-5 w-5"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-[11px] font-bold uppercase tracking-[0.18em] text-foreground/80",children:"Latest issue"}),e.jsx("div",{className:"truncate font-display text-xl text-foreground drop-shadow-sm",children:n[0]?te(n[0].editionDate):"Brewing soon"})]})]}),(n[0]?.editionIntro||oe)&&e.jsx("p",{className:"mt-3 text-sm leading-6 text-foreground/85",children:n[0]?.editionIntro||oe})]})})]})]}),f?e.jsx("div",{className:"rounded-3xl border border-border bg-card py-20 text-center text-muted-foreground",children:"Brewing today's issue..."}):n.length===0?e.jsxs("div",{className:"rounded-3xl border border-dashed border-border bg-card p-10 text-center",children:[e.jsx("div",{className:"mx-auto grid h-16 w-16 place-items-center rounded-full bg-sage/10 text-sage",children:e.jsx(X,{className:"h-7 w-7"})}),e.jsx("p",{className:"mt-5 font-display text-xl",children:"No editions found"}),e.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:"Try selecting a different category or check back later."})]}):e.jsx("div",{className:"space-y-6",children:e.jsxs("div",{ref:k,className:"grid gap-6 md:grid-cols-[200px_minmax(0,1fr)] lg:grid-cols-[260px_minmax(0,1fr)]",children:[e.jsxs("aside",{className:"hidden md:flex md:flex-col md:sticky md:self-start md:z-20",style:{top:"93px"},children:[e.jsx("div",{className:"relative mb-3",style:{height:"48px"},children:e.jsxs("section",{ref:Q,className:u("absolute top-0 left-0 rounded-2xl border border-border bg-background/94 shadow-sm backdrop-blur flex items-center overflow-hidden z-30","transition-[width,padding] duration-[360ms] ease-[cubic-bezier(0.4,0,0.2,1)]",y?"px-4 py-2":"w-full px-2 py-2"),style:y&&z>0?{width:`${z}px`,height:"48px"}:{height:"48px"},children:[e.jsxs("button",{type:"button",onClick:()=>B(!0),"aria-expanded":y,className:u("absolute inset-0 flex w-full items-center justify-between rounded-2xl px-3 hover:bg-secondary text-sm font-semibold !min-h-0","transition-[opacity,visibility] duration-200",y?"opacity-0 pointer-events-none invisible":"opacity-100 pointer-events-auto visible"),children:[e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(Ve,{className:"h-4 w-4 text-sage"}),e.jsx("span",{children:"Options"})]}),e.jsx("span",{className:"text-xs text-muted-foreground bg-secondary px-2 py-0.5 rounded-md",children:"Show"})]}),e.jsxs("div",{className:u("flex flex-nowrap items-center gap-3 w-full min-w-0","transition-[opacity,visibility] duration-200",y?"opacity-100 pointer-events-auto visible delay-100":"opacity-0 pointer-events-none invisible"),children:[e.jsx("span",{className:"text-xs font-bold uppercase tracking-[0.18em] text-muted-foreground whitespace-nowrap shrink-0",children:"Topics:"}),e.jsxs(W,{value:a,onValueChange:r,children:[e.jsx(H,{className:"w-[150px] h-8 bg-card rounded-xl border-border focus:ring-sage focus:ring-1 shrink-0 text-xs",children:e.jsx(J,{placeholder:"Select topic"})}),e.jsx(Y,{className:"rounded-xl max-h-[300px]",children:V.map(s=>e.jsx(Z,{value:s,className:"rounded-lg",children:s},s))})]}),e.jsx("span",{className:"text-muted-foreground/30 shrink-0 select-none",children:"·"}),e.jsxs("span",{className:"inline-flex items-center gap-1 text-xs font-bold uppercase tracking-[0.18em] text-muted-foreground whitespace-nowrap shrink-0",children:[e.jsx(ut,{className:"h-3.5 w-3.5"}),"Style:"]}),e.jsxs(W,{value:c,onValueChange:R,children:[e.jsx(H,{className:"w-[130px] h-8 bg-card rounded-xl border-border focus:ring-sage focus:ring-1 shrink-0 text-xs",children:e.jsx(J,{placeholder:"Select style"})}),e.jsx(Y,{className:"rounded-xl",children:De.map(s=>e.jsx(Z,{value:s.value,className:"rounded-lg",children:s.label},s.value))})]}
1),e.jsx("span",{className:"text-muted-foreground/30 shrink-0 select-none",children:"·"}),e.jsx("span",{className:"text-xs font-bold uppercase tracking-[0.18em] text-muted-foreground whitespace-nowrap shrink-0",children:"Size:"}),e.jsx("div",{className:"flex items-center gap-0.5 rounded-xl border border-border bg-card p-1 shrink-0",children:["sm","md","lg","xl"].map(s=>e.jsx("button",{type:"button",onClick:()=>j(s),className:u("px-2 py-0.5 text-xs font-semibold rounded-lg transition-all focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-sage",T===s?"bg-secondary text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:s==="sm"?"A-":s==="md"?"A":s==="lg"?"A+":"A++"},s))}),e.jsx("span",{className:"text-muted-foreground/30 shrink-0 select-none",children:"·"}),e.jsx("span",{className:"text-xs font-bold uppercase tracking-[0.18em] text-muted-foreground whitespace-nowrap shrink-0",children:"Font:"}),e.jsx("div",{className:"flex items-center gap-0.5 rounded-xl border border-border bg-card p-1 shrink-0",children:["sans","serif"].map(s=>e.jsx("button",{type:"button",onClick:()=>M(s),className:u("px-2.5 py-0.5 text-xs font-semibold rounded-lg capitalize transition-all focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-sage",A===s?"bg-secondary text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:s},s))}),e.jsx("button",{type:"button",onClick:()=>B(!1),className:"ml-auto shrink-0 inline-flex items-center justify-center h-7 w-7 rounded-xl hover:bg-secondary transition !min-h-0",title:"Collapse Options",children:e.jsx(Fe,{className:"h-3.5 w-3.5 text-muted-foreground"})})]})]})}),e.jsxs("div",{className:u("rounded-3xl border border-border bg-card shadow-sm flex flex-col overflow-hidden transition-all duration-300 ease-[cubic-bezier(0.4,0,0.2,1)]",D?"max-h-[60px]":"max-h-[calc(100vh-182px)] pb-4"),children:[e.jsxs("button",{type:"button",onClick:()=>K(s=>!s),className:"flex min-h-[44px] w-full items-center justify-between gap-3 text-left px-4 pt-4 pb-2 hover:bg-secondary/40 transition rounded-t-3xl !min-h-0",children:[e.jsxs("span",{children:[e.jsx("span",{className:"block text-[11px] font-bold uppercase tracking-[0.18em] text-sage",children:"Today's topics"}),e.jsx("span",{className:"mt-1 block font-display text-xl",children:q?te(q):"Latest issue"})]}),e.jsx(it,{className:u("h-5 w-5 text-muted-foreground transition-transform duration-200",D?"rotate-0":"rotate-180")})]}),e.jsx("nav",{className:u("flex-1 space-y-2 overflow-y-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden transition-all duration-300",D?"max-h-0 opacity-0 mt-0 px-0":"max-h-[1000px] opacity-100 mt-4 px-4"),children:n.map((s,o)=>e.jsxs("a",{href:`#${me(s)}`,onClick:()=>{o>=x&&m(o+1)},className:"flex min-h-[44px] items-start gap-3 rounded-2xl px-3 py-2 text-sm transition hover:bg-secondary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-sage",children:[e.jsx("span",{className:"grid h-7 w-7 shrink-0 place-items-center rounded-full bg-secondary text-xs font-bold",children:o+1}),e.jsxs("span",{className:"min-w-0",children:[e.jsx("span",{className:"block truncate font-semibold",children:se(s)}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:[ce(s)," · ",qe(s)," min read"]})]})]},s.id))}),e.jsx("div",{className:u("pt-2 border-t border-border/40 text-center text-[10px] uppercase tracking-wider text-muted-foreground/60 transition-all duration-300 px-4",D?"max-h-0 opacity-0 mt-0 overflow-hidden border-t-0":"max-h-10 opacity-100 mt-3"),children:"Scroll down for more"})]})]}),e.jsxs("main",{className:"min-w-0",children:[e.jsx("div",{className:"md:hidden mb-6 flex justify-center",children:e.jsxs("button",{type:"button",onClick:()=>w(!0),className:"flex w-full items-center justify-center gap-2 rounded-2xl bg-sage hover:bg-sage/90 border border-sage/20 px-4 py-3 text-sm font-bold text-sage-foreground transition shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-sage",children:[e.jsx(ee,{className:"h-4 w-4"}),"Today's Topics"]})}),e.jsxs("div",{className:"mb-4 flex flex-wrap items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-[11px] font-bold uppercase tracking-[0.18em] text-sage",children:"Magazine"}),e.jsxs("h2",{className:"mt-1 inline-flex items-center gap-2 font-display text-2xl",children:[e.jsx(ee,{className:"h-5 w-5 text-sage"}),a==="All"?"Daily Cuppa Magazine":`${a} Collection`]})]}),e.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[e.jsxs("span",{children:[n.length," stories"]}),e.jsx("span",{children:"·"}),e.jsx("span",{children:a})]})]}),ne.length>0?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:u(Le,Me,ze),children:ne.map((s,o)=>{const l=o===0||ne[o-1].editionDate!==s.editionDate;return e.jsxs("div",{children:[l&&e.jsxs("div",{className:u("flex items-center justify-between border-b border-sage/20 pb-3 mb-6",o===0?"mt-2":"mt-12"),children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ie,{className:"h-5 w-5 text-sage"}),e.jsx("h3",{className:"font-display text-xl font-bold text-foreground",children:te(s.editionDate)})]}),e.jsxs("span",{className:"text-[11px] font-medium text-sage/80 bg-sage/5 px-2.5 py-1 rounded-full border border-sage/10",children:[g.filter(h=>h.editionDate===s.editionDate).length," ",g.filter(h=>h.editionDate===s.editionDate).length===1?"story":"stories"]})]}),!l&&o>0&&e.jsx(Oe,{}),e.jsx("article",{id:me(s),style:{scrollMarginTop:"128px"},children:s.item.type==="magazine"?e.jsx(Dt,{section:s.item.data,templateKey:c}):e.jsx(At,{item:s.item.data})})]},s.id)})}),g.length>x&&e.jsx("div",{className:"mt-10 mb-16 flex justify-center",children:e.jsxs("button",{type:"button",onClick:()=>m(s=>s+20),className:"group relative inline-flex items-center gap-3 overflow-hidden rounded-full bg-background border border-sage/30 hover:border-sage px-8 py-3.5 text-sm font-bold text-sage transition-all duration-300 shadow-sm hover:shadow-md hover:bg-sage/5 hover:scale-[1.02] active:scale-[0.98] focus:outline-none focus:ring-2 focus:ring-sage focus:ring-offset-2",children:[e.jsx(X,{className:"h-4 w-4 animate-bounce group-hover:animate-spin"}),e.jsx("span",{children:"Brew More Stories"}),e.jsxs("span",{className:"ml-1 text-[10px] bg-sage/10 text-sage px-2 py-0.5 rounded-full font-normal font-sans",children:[g.length-x," left"]})]})})]}):e.jsx("div",{className:"rounded-3xl border border-dashed border-border bg-card p-8 text-center text-muted-foreground",children:"That's today's issue for this topic."})]})]})})]}),e.jsx(je,{open:P,onOpenChange:w,children:e.jsxs(Ne,{className:"pb-safe max-h-[85vh]",children:[e.jsx(ve,{className:"text-center pb-2 border-b border-border/40 flex flex-col items-center justify-center",children:e.jsxs(_e,{className:"font-display text-2xl flex items-center justify-center gap-2",children:[e.jsx(ee,{className:"h-5 w-5 text-sage"}),"Today's Topics"]})}),e.jsx("div",{className:"px-5 py-4 overflow-y-auto",children:e.jsx("nav",{className:"space-y-2",children:n.map((s,o)=>e.jsxs("a",{href:`#${me(s)}`,onClick:()=>{o>=x&&m(o+1),w(!1)},className:"flex min-h-[44px] items-start gap-3 rounded-2xl px-3 py-2 text-sm transition hover:bg-secondary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-sage",children:[e.jsx("span",{className:"grid h-7 w-7 shrink-0 place-items-center rounded-full bg-secondary text-xs font-bold",children:o+1}),e.jsxs("span",{className:"min-w-0",children:[e.jsx("span",{className:"block truncate font-semibold",children:se(s)}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:[ce(s)," · ",qe(s)," min read"]})]})]},s.id))})})]})}),e.jsx(je,{open:I,onOpenChange:S,children:e.jsxs(Ne,{className:"pb-safe max-h-[90vh]",children:[e.jsx(ve,{className:"text-center pb-2 border-b border-border/40 flex flex-col items-center justify-center",children:e.jsxs(_e,{className:"font-display text-2xl flex items-center justify-center gap-2",children:[e.jsx(X,{className:"h-5 w-5 text-sage"}),"Reading Options"]})}),e.jsxs("div",{className:"px-5 py-6 space-y-6 overflow-y-auto flex flex-col items-center",children:[e.jsxs("div",{className:"space-y-2 w-full max-w-sm flex flex-col items-center",children:[e.jsx("label",{className:"text-xs font-bold uppercase tracking-[0.18em] text-muted-foreground block text-center",children:"Browse Topics:"}),e.jsxs(W,{value:a,onValueChange:s=>{r(s),S(!1)},children:[e.jsx(H,{className:"w-full h-11 bg-secondary rounded-xl border-transparent focus:ring-sage focus:ring-1 text-center justify-center",children:e.jsx(J,{placeholder:"Select topic"})}),e.jsx(Y,{className:"rounded-xl max-h-[300px]",children:V.map(s=>e.jsx(Z,{value:s,className:"rounded-lg justify-center",children:s},s))})]})]}),e.jsxs("div",{className:"space-y-2 w-full max-w-sm flex flex-col items-center",children:[e.jsx("label",{className:"text-xs font-bold uppercase tracking-[0.18em] text-muted-foreground block text-center",children:"Reading Style:"}),e.jsxs(W,{value:c,onValueChange:R,children:[e.jsx(H,{className:"w-full h-11 bg-secondary rounded-xl border-transparent focus:ring-sage focus:ring-1 text-center justify-center",children:e.jsx(J,{placeholder:"Select style"})}),e.jsx(Y,{className:"rounded-xl",children:De.map(s=>e.jsx(Z,{value:s.value,className:"rounded-lg justify-center",children:s.label},s.value))})]})]}),e.jsxs("div",{className:"space-y-2 w-full max-w-sm flex flex-col items-center",children:[e.jsx("label",{className:"text-xs font-bold uppercase tracking-[0.18em] text-muted-foreground block text-center",children:"Text Size:"}),e.jsx("div",{className:"flex items-center gap-1.5 rounded-xl border border-border bg-secondary p-1 w-full",children:["sm","md","lg","xl"].map(s=>e.jsx("button",{type:"button",onClick:()=>j(s),className:u("flex-1 py-2 text-sm font-semibold rounded-lg transition-all focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-sage",T===s?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:s==="sm"?"A-":s==="md"?"A":s==="lg"?"A+":"A++"},s))})]}),e.jsxs("div",{className:"space-y-2 w-full max-w-sm flex flex-col items-center",children:[e.jsx("label",{className:"text-xs font-bold uppercase tracking-[0.18em] text-muted-foreground block text-center",children:"Font:"}),e.jsx("div",{className:"flex items-center gap-1.5 rounded-xl border border-border bg-secondary p-1 w-full",children:["sans","serif"].map(s=>e.jsx("button",{type:"button",onClick:()=>M(s),className:u("flex-1 py-2 text-sm font-semibold rounded-lg capitalize transition-all focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-sage",A===s?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:s},s))})]}),e.jsx("div",{className:"pt-2 w-full max-w-sm",children:e.jsx(We,{asChild:!0,children:e.jsx("button",{type:"button",className:"w-full py-3 bg-foreground text-background font-semibold rounded-xl hover:opacity-90 transition !min-h-0",children:"Done"})})})]})]})})]})}function Re(t){if(Array.isArray(t))return t.map(a=>
1String(a).trim()).filter(Boolean);if(typeof t=="string")try{const a=JSON.parse(t);if(Array.isArray(a))return a.map(r=>String(r).trim()).filter(Boolean)}catch{return t.split(/\n+/).map(a=>a.replace(/^[-*]\s*/,"").trim()).filter(Boolean)}return[]}function O(t,a="Daily Cuppa"){return t.category||a}function ue({section:t,className:a=""}){const r=[t.image_caption,t.image_credit?`Credit: ${t.image_credit}`:null].filter(Boolean).join(" | ");return r?e.jsx("p",{className:`mt-2 text-xs leading-5 text-muted-foreground ${a}`,children:r}):null}function pe({section:t,aspect:a="aspect-[16/10]",className:r="",frameClassName:x="",imageClassName:m="",metaClassName:c=""}){const b=t.image_url||xe(t.category);return e.jsxs("figure",{className:r,children:[e.jsxs("div",{className:`relative ${a} w-full overflow-hidden bg-secondary ${x}`,children:[e.jsx("img",{src:b,alt:t.image_alt||"",className:`h-full w-full object-cover transition duration-500 group-hover:scale-[1.03] ${m}`}),e.jsx("div",{className:"absolute right-3 top-3",children:e.jsx(rt,{sectionId:t.id,audioUrl:t.audio_url})})]}),e.jsx(ue,{section:t,className:c})]})}function ae({children:t,icon:a,className:r=""}){return e.jsxs("div",{className:`mb-3 inline-flex items-center gap-2 text-[11px] font-bold uppercase tracking-[0.18em] ${r}`,children:[a,e.jsx("span",{children:t})]})}function $({text:t,className:a=""}){if(!t)return null;const r=t.split(/\n{2,}/).map(x=>x.trim()).filter(Boolean);return e.jsx("div",{className:u("formatted-body",a),children:r.map((x,m)=>e.jsx("p",{className:m>0?"mt-4":"",children:x.split(/(\*\*.*?\*\*)/g).map((c,b)=>c.startsWith("**")&&c.endsWith("**")?e.jsx("strong",{className:"font-semibold",children:c.slice(2,-2)},b):c)},m))})}function ge(...t){const a=t.filter(Boolean).join(" ").trim().split(/\s+/).filter(Boolean).length;return Math.max(1,Math.ceil(a/220))}function Dt({section:t,templateKey:a}){const r=a||t.template_key;return r==="magazine_feature"?e.jsx(qt,{section:t}):r==="compact_digest"?e.jsx($t,{section:t}):r==="nostalgia_style"?e.jsx(Bt,{section:t}):r==="practical_update"?e.jsx(Rt,{section:t}):e.jsx(Tt,{section:t})}function F({links:t,className:a="",labelClassName:r="",linkClassName:x=""}){const m=Array.isArray(t)?t.filter(c=>typeof c=="object"&&c!==null&&"url"in c&&typeof c.url=="string"):[];return m.length===0?null:e.jsxs("div",{className:`mt-5 border-t border-border/60 pt-4 text-xs text-muted-foreground ${a}`,children:[e.jsx("div",{className:`mb-2 font-semibold uppercase tracking-[0.14em] ${r}`,children:"Sources"}),e.jsx("ul",{className:"space-y-1.5",children:m.map((c,b)=>e.jsx("li",{children:e.jsxs("a",{href:c.url,target:"_blank",rel:"noreferrer",className:`inline-flex !min-h-0 items-start gap-1.5 hover:text-foreground ${x}`,children:[e.jsx(Be,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"})," ",e.jsx("span",{children:c.title||c.url})]})},b))})]})}function Tt({section:t}){const a=ge(t.section_title,t.standfirst,t.section_body);return e.jsxs("article",{className:"group relative flex min-h-full flex-col overflow-hidden rounded-3xl border border-border/80 bg-card shadow-sm transition duration-300 hover:-translate-y-1 hover:shadow-xl",children:[e.jsx("div",{className:"h-1 bg-gradient-to-r from-sage via-accent to-primary/70"}),e.jsxs("div",{className:"flex flex-col p-4",children:[e.jsx(ae,{icon:e.jsx(Ze,{className:"h-3.5 w-3.5"}),className:"text-sage",children:O(t,"Briefing")}),e.jsx("h3",{className:"font-display text-2xl leading-tight text-foreground",children:t.section_title}),t.standfirst&&e.jsx("p",{className:"mt-2 text-base font-medium leading-7 text-foreground/75",children:t.standfirst}),e.jsxs("p",{className:"mt-3 text-xs font-semibold uppercase tracking-[0.14em] text-muted-foreground",children:[a," min read"]}),t.image_is_ai_generated&&e.jsx("p",{className:"mt-1.5 text-xs italic text-muted-foreground",children:"Representative illustration only; not a photograph of actual events or individuals"})]}),e.jsx(pe,{section:t,aspect:"aspect-[16/9]",className:"px-4",frameClassName:"rounded-2xl"}),e.jsxs("div",{className:"flex flex-1 flex-col p-4 pt-3",children:[e.jsx($,{text:t.section_body,className:"flex-1 text-base leading-7 text-muted-foreground"}),e.jsx(F,{links:t.source_links}),e.jsx(E,{section:t})]})]})}function qt({section:t}){const a=t.image_url||xe(t.category),r=ge(t.section_title,t.standfirst,t.section_body);return e.jsxs("article",{className:"group overflow-hidden rounded-3xl border border-border/80 bg-card shadow-lg shadow-foreground
1/5 transition duration-300 hover:-translate-y-1 hover:shadow-2xl",children:[a?e.jsxs("div",{className:"relative aspect-[16/7] w-full overflow-hidden bg-secondary md:aspect-[21/8]",children:[e.jsx("img",{src:a,alt:t.image_alt||"",className:"h-full w-full object-cover transition duration-700 group-hover:scale-[1.035]"}),e.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-charcoal/75 via-charcoal/15 to-transparent"}),e.jsxs("div",{className:"absolute bottom-4 left-4 right-4",children:[e.jsx(ae,{icon:e.jsx(Se,{className:"h-3.5 w-3.5"}),className:"mb-1.5 text-primary-foreground/90",children:O(t,"Feature")}),e.jsx("h3",{className:"max-w-3xl font-display text-2xl leading-tight text-primary-foreground md:text-3xl",children:t.section_title}),e.jsxs("p",{className:"mt-2 text-xs font-semibold uppercase tracking-[0.14em] text-primary-foreground/80",children:[r," min read"]}),t.image_is_ai_generated&&e.jsx("p",{className:"mt-1.5 text-xs italic text-primary-foreground/80",children:"Representative illustration only; not a photograph of actual events or individuals"})]})]}):e.jsxs("div",{className:"bg-gradient-to-br from-secondary via-card to-sage/20 p-5",children:[e.jsx(ae,{icon:e.jsx(Se,{className:"h-3.5 w-3.5"}),className:"text-sage",children:O(t,"Feature")}),e.jsx("h3",{className:"max-w-3xl font-display text-2xl leading-tight md:text-3xl",children:t.section_title})]}),e.jsxs("div",{className:"grid gap-5 p-5 md:grid-cols-[1.45fr_0.9fr] md:p-7",children:[e.jsxs("div",{children:[t.image_url&&e.jsx(ue,{section:t}),t.standfirst&&e.jsx("p",{className:"text-lg font-medium leading-8 text-foreground/80",children:t.standfirst}),e.jsx($,{text:t.section_body,className:"mt-4 text-lg leading-8 text-muted-foreground first-letter:float-left first-letter:mr-2 first-letter:font-display first-letter:text-5xl first-letter:text-foreground"}),e.jsx(F,{links:t.source_links})]}),t.pull_quote&&e.jsxs("aside",{className:"self-start rounded-2xl border border-sage/30 bg-sage/10 p-4",children:[e.jsx(He,{className:"mb-2 h-6 w-6 text-sage"}),e.jsx("blockquote",{className:"font-display text-xl leading-snug text-foreground",children:t.pull_quote})]})]}),e.jsx(E,{section:t,className:"mx-5 mb-5 md:mx-7"})]})}function $t({section:t}){const a=Re(t.bullet_items),r=ge(t.section_title,t.standfirst,t.section_body);return e.jsxs("article",{className:"group flex min-h-full flex-col rounded-3xl border border-border/80 bg-card p-4 shadow-sm transition duration-300 hover:-translate-y-1 hover:shadow-xl md:p-5",children:[e.jsx(ae,{icon:e.jsx(Je,{className:"h-3.5 w-3.5"}),className:"text-primary",children:O(t,"Digest")}),e.jsx("h3",{className:"font-display text-xl leading-tight",children:t.section_title}),e.jsxs("p",{className:"mt-2 text-xs font-semibold uppercase tracking-[0.14em] text-muted-foreground",children:["Quick read · ",r," min"]}),t.image_is_ai_generated&&e.jsx("p",{className:"mt-1.5 text-xs italic text-muted-foreground",children:"Representative illustration only; not a photograph of actual events or individuals"}),t.standfirst&&e.jsx("p",{className:"mt-3 text-base font-semibold leading-7 text-foreground/75",children:t.standfirst}),e.jsx(pe,{section:t,aspect:"aspect-[16/9]",className:"mt-3",frameClassName:"rounded-2xl"}),e.jsx($,{text:t.section_body,className:"mt-3 flex-1 text-base leading-7 text-muted-foreground"}),a.length>0&&e.jsx("ol",{className:"mt-3 space-y-2 text-base",children:a.map((x,m)=>e.jsxs("li",{className:"flex gap-2.5 rounded-xl border border-border/70 bg-secondary/40 p-2.5",children:[e.jsx("span",{className:"grid h-6 w-6 shrink-0 place-items-center rounded-full bg-primary text-[11px] font-bold text-primary-foreground",children:m+1}),e.jsx("span",{className:"leading-6 text-foreground/80",children:x})]},m))}),e.jsx(F,{links:t.source_links}),e.jsx(E,{section:t})]})}function Bt({section:t}){const a=t.image_url||xe(t.category);return e.jsxs("article",{className:"group flex min-h-full flex-col rounded-3xl border border-amber-300/70 bg-amber-50/70 p-5 text-amber-950 shadow-sm transition duration-300 hover:-translate-y-1 hover:shadow-xl dark:border-amber-700/50 dark:bg-amber-950/25 dark:text-amber-50 md:col-span-2 lg:col-span-1",children:[e.jsxs("div",{className:"mb-4 border-y border-amber-300/70 py-1.5 text-center text-[11px] font-bold uppercase tracking-[0.22em] text-amber-800 dark:text-amber-200",children:[e.jsx(Ye,{className:"mr-2 inline h-3.5 w-3.5"}),"Remember When"]}),e.jsx("h3",{className:"font-display text-2xl leading-tight",children:t.section_title}),t.standfirst&&e.jsx("p",{className:"mt-2 text-base font-medium leading-7 text-amber-900/80 dark:text-amber-100/80",children:t.standfirst}),t.image_is_ai_generated&&e.jsx("p",{className:"mt-1.5 text-xs italic text-amber-900/70 dark:text-amber-100/70",children:"Representative illustration only; not a photograph of actual events or individuals"}),a&&e.jsxs("div",{className:"mt-4 rotate-[-0.4deg] border border-amber-300 bg-amber-100 p-2 shadow-sm dark:border-amber-700 dark:bg-amber-950/40",children:[e.jsx("div",{className:"aspect-[16/9] w-full overflow-hidden bg-amber-200",children:e.jsx("img",{src:a,alt:t.image_alt||"",className:"h-full w-full object-cover sepia-[.28] transition duration-500 group-hover:scale-[1.03]"})}),e.jsx(ue,{section:t,className:"px-1 text-amber-900/70 dark:text-amber-100/70"})]}),e.jsx($,{text:t.section_body,className:"mt-4 flex-1 text-base leading-8 text-amber-950/80 dark:text-amber-50/80"}),e.jsx(Pe,{to:"/share",className:"mt-4 inline-flex min-h-[44px] w-fit items-center rounded-full bg-amber-900 px-4 text-sm font-semibold text-amber-50 hover:bg-amber-950 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-amber-700 dark:bg-amber-100 dar
1k:text-amber-950",children:"Share your memory"}),e.jsx(F,{links:t.source_links,className:"border-amber-300/70 text-amber-900/75 dark:border-amber-700/70 dark:text-amber-100/75",labelClassName:"text-amber-900 dark:text-amber-100",linkClassName:"hover:text-amber-950 dark:hover:text-white"}),e.jsx(E,{section:t,className:"border-amber-300/70 dark:border-amber-700/70"})]})}function Rt({section:t}){const a=Re(t.bullet_items);return e.jsxs("article",{className:"group flex min-h-full flex-col rounded-3xl border border-sky-200 bg-sky-50/80 p-4 text-slate-950 shadow-sm transition duration-300 hover:-translate-y-1 hover:shadow-xl dark:border-sky-800/60 dark:bg-sky-950/30 dark:text-sky-50",children:[e.jsxs("div",{className:"mb-3 flex items-center gap-3",children:[e.jsx("span",{className:"grid h-9 w-9 shrink-0 place-items-center rounded-2xl bg-sky-600 text-white shadow-sm",children:e.jsx(nt,{className:"h-4 w-4"})}),e.jsxs("div",{children:[e.jsx("div",{className:"text-[11px] font-bold uppercase tracking-[0.18em] text-sky-700 dark:text-sky-200",children:O(t,"Update")}),e.jsx("div",{className:"text-xs font-medium text-slate-600 dark:text-sky-100/70",children:"Practical note"})]})]}),e.jsx("h3",{className:"font-display text-xl leading-tight text-slate-950 dark:text-sky-50",children:t.section_title}),t.image_is_ai_generated&&e.jsx("p",{className:"mt-1.5 text-xs italic text-slate-600 dark:text-sky-200/80",children:"Representative illustration only; not a photograph of actual events or individuals"}),t.standfirst&&e.jsx("p",{className:"mt-3 rounded-xl border border-sky-200 bg-white/70 p-3 text-base font-semibold leading-6 text-slate-800 dark:border-sky-700/70 dark:bg-sky-950/50 dark:text-sky-50",children:t.standfirst}),e.jsx(pe,{section:t,aspect:"aspect-[16/9]",className:"mt-3",frameClassName:"rounded-2xl border border-sky-200 dark:border-sky-800",metaClassName:"text-slate-600 dark:text-sky-100/70"}),e.jsx($,{text:t.section_body,className:"mt-3 flex-1 text-base leading-7 text-slate-700 dark:text-sky-50/80"}),a.length>0&&e.jsx("ul",{className:"mt-3 space-y-1.5",children:a.map((r,x)=>e.jsxs("li",{className:"flex gap-2.5 rounded-xl bg-white/75 p-3 text-base leading-6 text-slate-800 dark:bg-sky-950/50 dark:text-sky-50/85",children:[e.jsx(ot,{className:"mt-0.5 h-4 w-4 shrink-0 text-sky-700 dark:text-sky-200"}),e.jsx("span",{children:r})]},x))}),e.jsxs("button",{type:"button",onClick:()=>typeof window<"u"&&window.print(),className:"mt-4 inline-flex min-h-[44px] w-fit items-center gap-2 rounded-full bg-sky-700 px-4 text-sm font-semibold text-white hover:bg-sky-800 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-sky-500",children:[e.jsx(lt,{className:"h-4 w-4"}),"Print"]}),e.jsx(F,{links:t.source_links,className:"border-sky-200 text-slate-600 dark:border-sky-800 dark:text-sky-100/75",labelClassName:"text-slate-800 dark:text-sky-50",linkClassName:"hover:text-slate-950 dark:hover:text-white"}),e.jsx(E,{section:t,className:"border-sky-200 dark:border-sky-800"})]})}function At({item:t}){const a=t.contributor_posts;if(!a)return null;const r=a.contributors;return e.jsxs("article",{className:`group flex flex-col rounded-2xl border border-border bg-card p-5 shadow-sm transition hover:shadow-md ${t.is_featured?"md:col-span-2 ring-1 ring-amber-200":""}`,children:[e.jsxs("div",{className:"flex items-center gap-3 mb-4 border-b border-border/50 pb-3",children:[r?.avatar_url?e.jsx("img",{src:r.avatar_url,alt:"",className:"h-8 w-8 shrink-0 rounded-full object-cover"}):e.jsx("div",{className:"grid h-8 w-8 shrink-0 place-items-center rounded-full bg-secondary text-xs",children:"☕"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"text-sm font-medium truncate",children:r?.name??"Contributor"}),e.jsx("div",{className:"text-[10px] uppercase tracking-wider text-muted-foreground truncate",children:a.category||"Community"})]})]}),e.jsx("h3",{className:"mb-2 font-display text-xl leading-tight",children:a.title}),e.jsx("div",{className:"prose prose-sm text-muted-foreground flex-1 leading-relaxed",children:e.jsx($,{text:a.body})}),a.source_url&&e.jsx("div",{className:"mt-4 pt-4 border-t border-border/50 text-[11px] text-muted-foreground",children:e.jsxs("a",{href:a.source_url,target:"_blank",rel:"noreferrer",className:"flex items-center gap-1 hover:text-foreground",children:[e.jsx(Be,{className:"w-3 h-3"})," ",a.source_label||"Source"]})})]})}const ws=Ue("daily_cuppa",St);export{ws as component};

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.