import{j as e}from"./vendor-query-Dz__kayo.js";import{c as g,L as d}from"./vendor-router-DVl9jod2.js";import{H as b}from"./index-Dk8L4sRW.js";import{P as x}from"./PublicLayout-CkZXacde.js";import{F as c,a as f,S as y}from"./BrandComponents-Cqh2Mmpz.js";import{P as j}from"./ParticleBackground-DWyOBdzR.js";import{b as w,c as N}from"./useBlogPosts-DNlsGtkK.js";import{B as _}from"./siteConstants-DmrUoFea.js";import{A as v}from"./arrow-left-0SLfWqO4.js";import{C as B}from"./calendar-D4zbyfHQ.js";import{C as k}from"./clock-D4r-J4K6.js";import{A as L}from"./arrow-right-DsGXtIbd.js";import"./vendor-react-DszrpDkA.js";const h="Contemporary Psychology",A=new Set(["adhd","asd","ptsd","ocd","cbt","dbt","act","emdr","lgbtiqa+"]);function E(r){const t=r.toLowerCase();return A.has(t)?t==="lgbtiqa+"?"LGBTIQA+":t.toUpperCase():r.replace(/\b\w/g,n=>n.toUpperCase())}function P(r){return r?new Date(r).toLocaleDateString("en-AU",{day:"numeric",month:"long",year:"numeric"}):""}function T(r,t=155){const n=r.replace(/<[^>]+>/g,"").trim();return n.length<=t?n:n.slice(0,t).replace(/\s+\S*$/,"")+"…"}function I(r){if(!r)return"";const t=r.replace(/<!--[\s\S]*?-->/g,"").trim(),n=new DOMParser().parseFromString(`<!DOCTYPE html><html><body>${t}</body></html>`,"text/html"),m=new Set(["H1","H2","H3","H4","H5","H6","UL","OL","BLOCKQUOTE","FIGURE","TABLE","DIV","PRE","HR","P"]),l=[];let i="";const p=()=>{const o=i.trim();if(!o){i="";return}o.split(/\n+/).map(s=>s.trim()).filter(Boolean).forEach(s=>{l.push(`<p>${s}</p>`)}),i=""};for(const o of Array.from(n.body.childNodes))if(o.nodeType===Node.TEXT_NODE)i+=o.textContent??"";else if(o.nodeType===Node.ELEMENT_NODE){const s=o;s.removeAttribute("style"),s.removeAttribute("width"),s.removeAttribute("height"),s.querySelectorAll("[style],[width],[height]").forEach(a=>{a.removeAttribute("style"),a.removeAttribute("width"),a.removeAttribute("height")}),m.has(s.tagName)?(p(),s.tagName==="H1"?l.push(`<h2>${s.innerHTML}</h2>`):l.push(s.outerHTML)):i+=s.outerHTML}return p(),l.filter(o=>!/<p>(\s|&nbsp;)*<\/p>/i.test(o)).join(`
`)}function K(){const{slug:r}=g(),{data:t,isLoading:n,isError:m}=w(r),{data:l=[]}=N((t==null?void 0:t.category)??"",r??"",3);if(n)return e.jsxs(x,{children:[e.jsx("div",{className:"bg-surface-warm border-b border-cp-rule py-3",children:e.jsx("div",{className:"max-w-4xl mx-auto px-6 sm:px-8",children:e.jsx("div",{className:"h-4 w-16 bg-gray-200 rounded animate-pulse"})})}),e.jsx("section",{className:"relative bg-navy py-16",children:e.jsxs("div",{className:"max-w-3xl mx-auto px-6 sm:px-8 space-y-4 animate-pulse",children:[e.jsx("div",{className:"h-5 w-20 bg-[#071B27]/10 rounded-full"}),e.jsx("div",{className:"h-9 w-3/4 bg-[#071B27]/10 rounded"}),e.jsx("div",{className:"h-4 w-48 bg-[#071B27]/08 rounded"})]})}),e.jsx("section",{className:"py-16 bg-surface-warm",children:e.jsx("div",{className:"max-w-3xl mx-auto px-6 sm:px-8 space-y-4 animate-pulse",children:Array.from({length:8}).map((a,u)=>e.jsx("div",{className:"h-4 bg-gray-100 rounded",style:{width:u%3===2?"60%":"100%"}},u))})})]});if(m||!t)return e.jsx(x,{children:e.jsxs("div",{className:"min-h-[60vh] flex flex-col items-center justify-center text-center px-6 py-20",children:[e.jsx("h1",{className:"font-lora text-3xl font-bold text-[#071B27] mb-4",children:"Article not found"}),e.jsx(d,{to:"/blog",className:"text-brand-pink font-semibold hover:opacity-75",children:"← Back to blog"})]})});const i=I(t.body??""),p=`${t.title} | ${h}`,o=T(t.excerpt),s=`https://www.contemporarypsychology.com.au/${t.slug}`;return e.jsxs(x,{children:[e.jsxs(b,{children:[e.jsx("title",{children:p}),e.jsx("meta",{name:"description",content:o}),e.jsx("link",{rel:"canonical",href:s}),t.author_name&&e.jsx("meta",{name:"author",content:t.author_name}),e.jsx("meta",{property:"og:title",content:p}),e.jsx("meta",{property:"og:description",content:o}),e.jsx("meta",{property:"og:url",content:s}),e.jsx("meta",{property:"og:type",content:"article"}),t.featured_image_url&&e.jsx("meta",{property:"og:image",content:t.featured_image_url}),t.featured_image_url&&e.jsx("meta",{property:"og:image:width",content:"1200"}),t.featured_image_url&&e.jsx("meta",{property:"og:image:height",content:"630"}),t.published_at&&e.jsx("meta",{property:"article:published_time",content:t.published_at}),t.updated_at&&e.jsx("meta",{property:"article:modified_time",content:t.updated_at}),e.jsx("meta",{property:"article:section",content:t.category}),e.jsx("meta",{name:"twitter:card",content:"summary_large_image"}),e.jsx("meta",{name:"twitter:title",content:p}),e.jsx("meta",{name:"twitter:description",content:o}),t.featured_image_url&&e.jsx("meta",{name:"twitter:image",content:t.featured_image_url}),e.jsx("script",{type:"application/ld+json",children:JSON.stringify({"@context":"https://schema.org","@type":"BlogPosting",headline:t.title,description:o,url:s,datePublished:t.published_at??void 0,dateModified:t.updated_at??void 0,author:{"@type":"Person",name:t.author_name||h,url:"https://www.contemporarypsychology.com.au/our-team"},publisher:{"@type":"Organization",name:h,url:"https://www.contemporarypsychology.com.au",logo:{"@type":"ImageObject",url:"https://www.contemporarypsychology.com.au/og-image.png"},sameAs:["https://www.linkedin.com/company/contemporary-psychology/","https://www.instagram.com/contemporarypsychology/"]},...t.featured_image_url&&{image:{"@type":"ImageObject",url:t.featured_image_url,width:1200,height:630}}})}),e.jsx("script",{type:"application/ld+json",children:JSON.stringify({"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:[{"@type":"ListItem",position:1,name:"Home",item:"https://www.contemporarypsychology.com.au"},{"@type":"ListItem",position:2,name:"Blog",item:"https://www.contemporarypsychology.com.au/blog"},{"@type":"ListItem",position:3,name:t.title,item:s}]})})]}),e.jsx("div",{className:"bg-surface-warm border-b border-cp-rule py-3",children:e.jsx("div",{className:"max-w-4xl mx-auto px-6 sm:px-8",children:e.jsxs(d,{to:"/blog",className:"inline-flex items-center gap-2 text-sm text-cp-muted hover:text-brand-pink font-poppins transition-colors",children:[e.jsx(v,{className:"h-4 w-4"}),"Blog"]})})}),e.jsxs("section",{className:"relative bg-navy py-16 overflow-hidden",children:[e.jsx(j,{}),e.jsx("div",{className:"absolute left-0 top-0 bottom-0 w-[5px] z-10",style:{background:"linear-gradient(to bottom, #F2506A, #B67AEC, #27BBE9)"}}),e.jsxs("div",{className:"relative z-10 max-w-3xl mx-auto px-6 sm:px-8",children:[e.jsx("div",{className:"mb-5",children:e.jsx("span",{className:"text-xs font-bold text-white bg-brand-pink rounded-full px-2.5 py-0.5 uppercase tracking-wide",children:t.category})}),e.jsx("h1",{className:"font-lora text-3xl sm:text-4xl font-bold text-[#071B27] leading-tight mb-6",children:t.title}),e.jsxs("div",{className:"flex flex-wrap items-center gap-5 text-[#071B27]/65 text-sm font-poppins mb-4",children:[t.author_name&&e.jsxs("div",{className:"flex items-center gap-2.5",children:[t.author_photo_url?e.jsx("img",{src:t.author_photo_url,alt:t.author_name,className:"h-8 w-8 rounded-full object-cover object-top border-2 border-[#071B27]/20 flex-shrink-0"}):e.jsx("div",{className:"h-8 w-8 rounded-full bg-brand-pink/30 border-2 border-[#071B27]/20 flex-shrink-0 flex items-center justify-center",children:e.jsx("span",{className:"text-xs font-bold text-white",children:t.author_name.charAt(0)})}),e.jsxs("span",{className:"text-[#071B27]/85",children:["By ",t.author_name]})]}),t.published_at&&e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx(B,{className:"h-4 w-4"}),P(t.published_at)]}),e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx(k,{className:"h-4 w-4"}),t.read_time]})]}),t.tags&&t.tags.length>0&&e.jsx("div",{className:"flex flex-wrap gap-2",children:t.tags.map(a=>e.jsx("span",{className:"text-xs font-semibold font-poppins px-2.5 py-1 rounded-full bg-white text-[#071B27]",children:E(a)},a))})]})]}),t.featured_image_url&&e.jsx("div",{className:"bg-surface-warm border-b border-cp-rule",children:e.jsx("div",{className:"max-w-3xl mx-auto px-6 sm:px-8 py-8",children:e.jsx("img",{src:t.featured_image_url,alt:t.featured_image_alt??t.title,className:"w-full rounded-xl shadow-md"})})}),e.jsx("section",{className:"py-16 bg-surface-warm",children:e.jsxs("div",{className:"max-w-3xl mx-auto px-6 sm:px-8",children:[e.jsx(c,{children:e.jsx("div",{className:["prose prose-lg max-w-none","prose-headings:font-lora prose-headings:text-[#071B27] prose-headings:font-bold prose-headings:scroll-mt-4","prose-h2:text-2xl prose-h2:mt-10 prose-h2:mb-4 prose-h2:pb-2 prose-h2:border-b prose-h2:border-cp-rule","prose-h3:text-xl prose-h3:mt-8 prose-h3:mb-3","prose-h4:text-base prose-h4:mt-6 prose-h4:mb-2","prose-p:text-cp-body prose-p:font-poppins prose-p:leading-relaxed prose-p:my-4","prose-a:text-brand-pink prose-a:no-underline prose-a:font-medium hover:prose-a:underline","prose-strong:text-[#071B27] prose-strong:font-semibold","prose-ul:my-5 prose-ul:list-disc prose-ul:pl-6 prose-ul:space-y-1","prose-ol:my-5 prose-ol:list-decimal prose-ol:pl-6 prose-ol:space-y-1","prose-li:text-cp-body prose-li:font-poppins prose-li:leading-relaxed","prose-blockquote:border-l-4 prose-blockquote:border-brand-pink prose-blockquote:pl-5 prose-blockquote:not-italic prose-blockquote:text-cp-muted prose-blockquote:font-poppins prose-blockquote:my-6","prose-img:rounded-lg prose-img:my-8 prose-img:shadow-sm","prose-code:text-brand-pink prose-code:bg-surface-pink prose-code:px-1.5 prose-code:py-0.5 prose-code:rounded prose-code:text-sm prose-code:font-mono prose-code:before:content-none prose-code:after:content-none","prose-hr:border-cp-rule prose-hr:my-10"].join(" "),dangerouslySetInnerHTML:{__html:i}})}),e.jsx(c,{className:"mt-10",children:e.jsxs("div",{className:"bg-surface-purple rounded-xl p-5 border border-cp-rule text-xs text-cp-muted font-poppins leading-relaxed",children:[e.jsx("strong",{className:"text-[#071B27]",children:"Note:"})," This article is intended for general information purposes only and does not constitute clinical advice. If you have concerns about your mental health, please speak with a registered health professional."]})}),e.jsxs(c,{className:"mt-12 text-center",children:[e.jsx("h3",{className:"font-lora text-xl font-bold text-[#071B27] mb-3",children:"Ready to speak with a psychologist?"}),e.jsx("p",{className:"text-cp-muted font-poppins text-sm mb-5",children:"No GP referral required. Appointments available now."}),e.jsx(f,{href:_,children:"Book Online"})]}),l.length>0&&e.jsxs(c,{className:"mt-16",children:[e.jsx(y,{children:"MORE ARTICLES"}),e.jsx("div",{className:"mt-5 space-y-3",children:l.map(a=>e.jsxs(d,{to:`/blog/${a.slug}`,className:"flex items-start gap-3 group p-4 rounded-xl bg-white border border-cp-rule hover:border-brand-pink transition-colors",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx("span",{className:"text-xs font-bold text-brand-pink uppercase tracking-wide",children:a.category}),e.jsx("h4",{className:"font-lora font-semibold text-[#071B27] text-sm mt-0.5 group-hover:text-brand-pink transition-colors",children:a.title})]}),e.jsx(L,{className:"h-4 w-4 text-cp-muted group-hover:text-brand-pink flex-shrink-0 mt-1 transition-colors"})]},a.slug))})]})]})})]})}export{K as default};