1import{D as _,b as A,p as E,r,j as e,B as t,m as x,c as O,I as h,o as $,a$ as z,d as N,C as U}from"./index-QiiZ-xPT.js";import{N as y}from"./Navigation-r93ZBuy6.js";import{F as w}from"./Footer-3JNsJayo.js";import{C as l,a as o}from"./card-DkXabqFf.js";import{L as u}from"./label-BA9Xin3m.js";import{D as Y,a as H,b as J,c as V}from"./dialog-D2VXyQJN.js";import{g as q,W as G}from"./whitepaper-content-5v9Xeu6I.js";import{A as v}from"./arrow-left-B-CeY16K.js";import{D as j}from"./download-D-fGOqS3.js";import{S as K}from"./share-2-hqok4cMh.js";import{C as k}from"./circle-check-BOGFOgJv.js";import{U as C}from"./users-JkJLChox.js";import{T as M}from"./target-C2CH8bm6.js";import{S as Q}from"./sparkles-C108-045.js";import"./checkbox-CrGTwbPu.js";import"./index-DqZlRfV5.js";import"./check-KTa2Xihg.js";import"./select-B1P2Vx_w.js";import"./index-BMyKsIJE.js";import"./Combination-TP2Egp2x.js";import"./chevron-down-BWOHa16b.js";import"./save-BsB7cS8F.js";import"./dropdown-menu-D4zjGRmc.js";import"./index-Bj3iuRQR.js";import"./chevron-right-f4G5e4zR.js";import"./circle-2nw1jhuN.js";import"./useTranslation-XedzLvcK.js";import"./globe-3tsuvpPT.js";import"./log-out-CqAuLeet.js";import"./building-2-Bz-h5bHH.js";import"./BrandSponsor-DEW6i_On.js";import"./mail-Cr62Xklx.js";import"./twitter-BzZd48jL.js";function Le(){const{slug:D}=_(),[,n]=A(),{toast:c}=E(),[P,d]=r.useState(!1),[m,F]=r.useState(""),[p,S]=r.useState(""),[g,T]=r.useState(""),[f,b]=r.useState(!1),a=q(D||"");if(!a)return e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx(y,{}),e.jsxs("div",{className:"max-w-4xl mx-auto px-4 py-20 text-center",children:[e.jsx("h1",{className:"text-3xl font-bold mb-4",children:"White Paper Not Found"}),e.jsx("p",{className:"text-muted-foreground mb-8",children:"The white paper you're looking for doesn't exist or has been moved."}),e.jsxs(t,{onClick:()=>n("/resources"),"data-testid":"button-back-resources",children:[e.jsx(v,{className:"w-4 h-4 mr-2"}),"Back to Resources"]})]}),e.jsx(w,{})]});const I=async()=>{if(!m||!p){c({title:"Required fields",description:"Please fill in your name and email.",variant:"destructive"});return}b(!0);try{if(!(await fetch("/api/resource-downloads",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({resourceId:a.id,resourceTitle:a.title,email:m,firstName:p,company:g})})).ok)throw new Error("Failed to record download");z(a.title),c({title:"Opening printable version",description:"Use your browser's Print dialog to save as PDF."}),d(!1),window.open(`/whitepapers/${a.slug}/print`,"_blank")}catch{c({title:"Error",description:"Failed to process download. Please try again.",variant:"destructive"})}finally{b(!1)}},L=async()=>{const s=window.location.href;navigator.share?await navigator.share({title:a.title,text:a.description,url:s}):(await navigator.clipboard.writeText(s),c({title:"Link copied to clipboard!"}))},R=(()=>{switch(a.persona){case"enterprise_learning":return N;case"enterprise_data":return U;case"enterprise_brand":return Q;case"genz_individual":return M;case"mid_level_manager":return C;case"senior_executive":return C;default:return N}})();return e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx(y,{}),e.jsx(x.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5},className:"relative bg-gradient-to-br from-primary/10 via-background to-background pt-20 pb-16",children:e.jsxs("div",{className:"max-w-5xl mx-auto px-4",children:[e.jsxs(t,{variant:"ghost",onClick:()=>n("/resources"),className:"mb-6","data-testid":"button-back",children:[e.jsx(v,{className:"w-4 h-4 mr-2"}),"Back to Resources"]}),e.jsx("div",{className:"flex items-center gap-2 mb-4",children:e.jsxs("div",{className:"inline-flex items-center gap-2 px-3 py-1 bg-primary/20 text-primary rounded-full text-sm font-medium",children:[e.jsx(R,{className:"w-4 h-4"}),a.personaLabel]})}),e.jsx("h1",{className:"text-3xl md:text-4xl lg:text-5xl font-bold mb-4","data-testid":"text-whitepaper-title",children:a.title}),e.jsx("p",{className:"text-xl text-muted-foreground mb-8 max-w-3xl",children:a.subtitle}),e.jsxs("div",{className:"flex flex-wrap gap-4",children:[a.downloadable&&e.jsxs(t,{size:"lg",onClick:()=>d(!0),className:"gap-2","data-testid":"button-download-pdf",children:[e.jsx(j,{className:"w-5 h-5"}),"Download PDF"]}),e.jsxs(t,{size:"lg",variant:"outline",onClick:L,className:"gap-2","data-testid":"button-share",children:[e.jsx(K,{className:"w-5 h-5"}),"Share"]})]})]})}),e.jsxs("div",{className:"max-w-5xl mx-auto px-4 py-12",children:[e.jsxs("div",{className:"grid md:grid-cols-3 gap-8",children:[e.jsxs("div",{className:"md:col-span-2 space-y-12",children:[e.jsxs("section",{children:[e.jsx("h2",{className:"text-2xl font-bold mb-4",children:"Overview"}),e.jsx("p",{className:"text-lg text-muted-foreground",children:a.description})]}),a.sections.map((s,i)=>e.jsxs(x.section,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},transition:{delay:i*.1},viewport:{once:!0},children:[e.jsx("h2",{className:"text-2xl font-bold mb-4",children:s.title}),e.jsx("p",{className:"text-muted-foreground mb-6 leading-relaxed",children:s.content}),s.highlights&&e.jsx("ul",{className:"space-y-2",children:s.highlights.map((B,W)=>e.jsxs("li",{className:"flex items-start gap-3",children:[e.jsx(k,{className:"w-5 h-5 text-primary flex-shrink-0 mt-0.5"}),e.jsx("span",{children:B})]},W))})]},i)),a.references&&a.references.length>0&&e.jsxs(x.section,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},className:"border-t pt-8",children:[e.jsx("h2",{className:"text-2xl font-bold mb-6",children:"References"}),e.jsx("ol",{className:"space-y-4 list-decimal list-inside",children:a.references.map(s=>e.jsxs("li",{className:"text-sm text-muted-foreground",children:[e.jsx("span",{className:"text-foreground font-medium",children:s.authors})," (",s.year,'). "',s.title,'." ',e.jsx("em",{children:s.journal}),s.volume&&`, ${s.volume}`,s.issue&&`(${s.issue})`,s.pages&&`, pp. ${s.pages}`,".",s.jstor&&e.jsx("a",{href:s.jstor,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline ml-1",children:"[JSTOR]"})]},s.id))})]}),e.jsx(l,{className:"bg-primary/5 border-primary/20",children:e.jsxs(o,{className:"p-8",children:[e.jsx("h2",{className:"text-2xl font-bold mb-4",children:a.callToAction.title}),e.jsx("p",{className:"text-muted-foreground mb-6",children:a.callToAction.description}),e.jsxs(t,{size:"lg",onClick:()=>n(a.callToAction.buttonLink),className:"gap-2","data-testid":"button-cta",children:[a.callToAction.buttonText,e.jsx(O,{className:"w-5 h-5"})]})]})})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsx(l,{children:e.jsxs(o,{className:"p-6",children:[e.jsx("h3",{className:"font-semibold mb-4",children:"Key Benefits"}),e.jsx("ul",{className:"space-y-3",children:a.keyBenefits.map((s,i)=>e.jsxs("li",{className:"flex items-start gap-3 text-sm",children:[e.jsx(k,{className:"w-4 h-4 text-primary flex-shrink-0 mt-0.5"}),e.jsx("span",{children:s})]},i))})]})}),e.jsx(l,{children:e.jsxs(o,{className:"p-6",children:[e.jsx("h3",{className:"font-semibold mb-4",children:"Related Platform Features"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:a.relatedFeatures.map((s,i)=>e.jsx("span",{className:"px-3 py-1 bg-secondary text-secondary-foreground rounded-full text-xs",children:s},i))})]})}),a.downloadable&&e.jsx(l,{className:"bg-primary text-primary-foreground",children:e.jsxs(o,{className:"p-6",children:[e.jsx("h3",{className:"font-semibold mb-2",children:"Download This White Paper"}),e.jsx("p",{className:"text-sm opacity-90 mb-4",children:"Get the full PDF to share with your team or read offline."}),e.jsxs(t,{variant:"secondary",className:"w-full gap-2",onClick:()=>d(!0),"data-testid":"button-sidebar-download",children:[e.jsx(j,{className:"w-4 h-4"}),"Download PDF"]})]})})]})]}),e.jsxs("section",{className:"mt-16",children:[e.jsx("h2",{className:"text-2xl font-bold mb-8",children:"More Resources"}),e.jsx("div",{className:"grid md:grid-cols-3 gap-6",children:G.filter(s=>s.id!==a.id).slice(0,3).map(s=>e.jsx(l,{className:"cursor-pointer hover:shadow-lg transition-shadow",onClick:()=>n(`/whitepapers/${s.slug}`),"data-testid":`card-whitepaper-${s.id}`,children:e.jsxs(o,{className:"p-6",children:[e.jsx("div",{className:"text-xs text-primary font-medium mb-2",children:s.personaLabel}),e.jsx("h3",{className:"font-semibold mb-2 line-clamp-2",children:s.title}),e.jsx("p",{className:"text-sm text-muted-foreground line-clamp-3",children:s.description})]})},s.id))})]})]}
1),e.jsx(Y,{open:P,onOpenChange:d,children:e.jsxs(H,{children:[e.jsx(J,{children:e.jsx(V,{children:"Download White Paper"})}),e.jsxs("div",{className:"space-y-4 pt-4",children:[e.jsxs("div",{children:[e.jsx(u,{htmlFor:"firstName",children:"First Name *"}),e.jsx(h,{id:"firstName",value:p,onChange:s=>S(s.target.value),placeholder:"Your first name","data-testid":"input-firstname"})]}),e.jsxs("div",{children:[e.jsx(u,{htmlFor:"email",children:"Work Email *"}),e.jsx(h,{id:"email",type:"email",value:m,onChange:s=>F(s.target.value),placeholder:"[email protected]","data-testid":"input-email"})]}),e.jsxs("div",{children:[e.jsx(u,{htmlFor:"company",children:"Company"}),e.jsx(h,{id:"company",value:g,onChange:s=>T(s.target.value),placeholder:"Your company name","data-testid":"input-company"})]}),e.jsx(t,{className:"w-full gap-2",onClick:I,disabled:f,"data-testid":"button-submit-download",children:f?e.jsxs(e.Fragment,{children:[e.jsx($,{className:"w-4 h-4 animate-spin"}),"Processing..."]}):e.jsxs(e.Fragment,{children:[e.jsx(j,{className:"w-4 h-4"}),"Download PDF"]})}),e.jsx("p",{className:"text-xs text-muted-foreground text-center",children:"By downloading, you agree to receive occasional updates from Living Corporate. You can unsubscribe at any time."})]})]})}),e.jsx(w,{})]})}export{Le 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.