1import{r as y,j as t}from"./vendor-react-CIi57Twg.js";const x="#F97316",b="#06B6D4",C=[{label:"Spot",current:3,target:4},{label:"Understand",current:2,target:3},{label:"Alert",current:4,target:5},{label:"Protect",current:3,target:4},{label:"Recover",current:2,target:3}],D=["Aware","Reactive","Practised","Embedded","Optimised"],u=200,v=200,O=150;function f(n,l,o,m){const d=-Math.PI/2+2*Math.PI*n/o,a=O*l/m;return{x:u+a*Math.cos(d),y:v+a*Math.sin(d)}}function j(n,l,o){return n.map((m,d)=>{const a=f(d,m,l,o);return`${a.x.toFixed(1)},${a.y.toFixed(1)}`}).join(" ")}function G({dimensions:n,maturityLabels:l,maxLevel:o,heading:m,subheading:d}={}){const[a,k]=y.useState(!1),h=y.useRef(null),A=!!(n&&n.length>0),r=o&&o>0?o:5,F=l&&l.length>0?l:D,N=e=>Math.max(0,Math.min(r,Number.isFinite(e)?e:0)),i=(A?n:C).map(e=>({...e,current:N(e.current),target:N(e.target)})),c=i.length,R=m??"Your Scam Resilience Index",S=d??`Five capabilities, scored 1 to ${r} against a maturity ladder insurers and procurement teams recognise.`;y.useEffect(()=>{const e=new IntersectionObserver(([s])=>{s.isIntersecting&&(k(!0),e.disconnect())},{threshold:.25});return h.current&&e.observe(h.current),()=>e.disconnect()},[]);const $=Array.from({length:r},(e,s)=>j(i.map(()=>s+1),c,r)),M=j(i.map(e=>e.current),c,r),P=j(i.map(e=>e.target),c,r),I=i.map((e,s)=>f(s,e.current,c,r)),w=e=>F[e-1]??`Level ${e}`;return t.jsxs("div",{ref:h,className:"w-full max-w-[920px] mx-auto flex flex-col lg:flex-row items-center justify-center gap-6 lg:gap-10",children:[t.jsxs("div",{className:"w-full max-w-[460px]",children:[t.jsxs("svg",{viewBox:"0 0 400 400",className:"w-full mx-auto",role:"img","aria-label":"5 Dimensions of Scam Resilience radar chart",children:[t.jsx("defs",{children:t.jsxs("linearGradient",{id:"scamdrRadarFill",x1:"0%",y1:"0%",x2:"100%",y2:"100%",children:[t.jsx("stop",{offset:"0%",stopColor:x,stopOpacity:"0.32"}),t.jsx("stop",{offset:"100%",stopColor:x,stopOpacity:"0.18"})]})}),$.map((e,s)=>t.jsx("polygon",{points:e,fill:"none",stroke:"var(--color-slate-muted)",strokeWidth:"0.8",opacity:"0.28"},s)),i.map((e,s)=>{const p=f(s,r,c,r),g=f(s,r+.85,c,r),E=Math.abs(g.x-u)<6?"middle":g.x>u?"start":"end";return t.jsxs("g",{children:[t.jsx("line",{x1:u,y1:v,x2:p.x,y2:p.y,stroke:"var(--color-slate-muted)",strokeWidth:"0.8",opacity:"0.28"}),t.jsx("text",{x:g.x,y:g.y,textAnchor:E,dominantBaseline:"central",fill:"var(--color-foreground)",fontFamily:"var(--app-font-heading, 'Space Grotesk', sans-serif)",fontSize:"12",fontWeight:"700",children:e.label})]},e.label)}),Array.from({length:r},(e,s)=>{const p=f(0,s+1,c,r);return t.jsxs("text",{x:p.x+6,y:p.y,fill:"var(--color-slate-muted)",fontSize:"8",dominantBaseline:"middle",fontFamily:"var(--app-font-body, 'Inter', sans-serif)",children:[s+1," ",w(s+1)]},s)}),t.jsx("polygon",{points:P,fill:"none",stroke:b,strokeWidth:"2.2",strokeDasharray:"7 6",style:{opacity:a?1:0,transition:"opacity 1.4s ease 0.3s"}}),t.jsx("polygon",{points:M,fill:"url(#scamdrRadarFill)",stroke:x,strokeWidth:"2.6",style:{opacity:a?1:0,transform:a?"scale(1)":"scale(0.1)",transformOrigin:`${u}px ${v}px`,transition:"opacity 1s ease 0.6s, transform 1s cubic-bezier(.34,1.56,.64,1) 0.6s"}}),I.map((e,s)=>t.jsx("circle",{cx:e.x,cy:e.y,r:"4.5",fill:x,style:{opacity:a?1:0,transition:`opacity 0.4s ease ${1.1+s*.12}s`}},s))]}),t.jsxs("div",{className:"flex items-center justify-center gap-5 mt-3 text-[10px] text-slate-muted",children:[t.jsxs("span",{className:"flex items-center gap-1.5",children:[t.jsx("span",{className:"inline-block w-3.5 h-2 rounded-sm",style:{background:x,opacity:.6}}),"Current resilience"]}),t.jsxs("span",{className:"flex items-center gap-1.5",children:[t.jsx("span",{className:"inline-block w-3.5 border-t-2 border-dashed",style:{borderColor:b}}),"Next-stage target"]})]})]}),t.jsxs("div",{className:"w-full max-w-[340px]",children:[t.jsx("h3",{className:"text-foreground text-base font-bold mb-1",style:{fontFamily:"var(--app-font-heading)"},children:R}),t.jsx("p",{className:"text-slate-muted text-xs leading-relaxed mb-4",children:S}),t.jsx("div",{className:"flex flex-col gap-2",children:i.map((e,s)=>t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("div",{className:"text-[0.72rem] font-semibold min-w-[78px] text-right",style:{color:"var(--color-foreground)"},children:e.label}),t.jsxs("div",{className:"flex-1 h-2 rounded-full overflow-hidden relative",style:{background:"var(--badge-outline)"},children:[t.jsx("div",{className:"absolute inset-y-0 left-0 rounded-full",style:{background:`${b}55`,width:a?`${e.target/r*100}%`:"0%",transition:`width 1.3s ease ${.4+s*.14}s`}}),t.jsx("div",{className:"absolute inset-y-0 left-0 rounded-full",style:{background:x,width:a?`${e.current/r*100}%`:"0%",transition:`width 1.3s ease ${.2+s*.14}s`}})]}),t.jsx("div",{className:"text-[0.62rem] text-slate-muted min-w-[58px]",children:e.currentLabel??w(e.current)})]},e.label))})]}),t.jsx("div",{className:"w-full text-center lg:text-right mt-2 lg:mt-0 lg:self-end text-[10px] text-slate-muted/70 italic basis-full",children:"Adapted from the GoNexL.AI Doctrine by Punit Govind."})]})}
1export{G 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.