1import{d as x,r as h,j as e,C as z,m as l,b as y,B as w,f as R,A as B}from"./index-ldNoJLeA.js";import{t as u,d as F,e as d,f as H,h as v,j as k,k as M}from"./visualization-data-snd7WOZP.js";import{T as A}from"./target-CMZp3asK.js";import{C as f}from"./circle-check-DTRSG96X.js";import{R as P}from"./refresh-cw-mNYhDunt.js";import{Z as C}from"./zap-C_7OKAJU.js";import{A as g}from"./index-SibXLH70.js";import{A as W}from"./arrow-down-D60YZUiN.js";import{T as $}from"./triangle-alert-D0QZjqsl.js";import{L as U}from"./lightbulb-B_t6GseJ.js";const S=x("CircleDot",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]]);const q=x("Crosshair",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"22",x2:"18",y1:"12",y2:"12",key:"l9bcsi"}],["line",{x1:"6",x2:"2",y1:"12",y2:"12",key:"13hhkx"}],["line",{x1:"12",x2:"12",y1:"6",y2:"2",key:"10w3f3"}],["line",{x1:"12",x2:"12",y1:"22",y2:"18",key:"15g9kq"}]]);const T=x("FileSearch",[["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M4.268 21a2 2 0 0 0 1.727 1H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v3",key:"ms7g94"}],["path",{d:"m9 18-1.5-1.5",key:"1j6qii"}],["circle",{cx:"5",cy:"14",r:"3",key:"ufru5t"}]]);const L=x("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]),i={inputs:"hsl(199, 70%, 48%)",capacity:"hsl(162, 55%, 42%)",tools:"hsl(35, 75%, 50%)",adoption:"hsl(262, 60%, 55%)",sustained:"hsl(142, 60%, 40%)"},V={inputs:A,capacity:L,tools:q,adoption:P,sustained:f};function ee(){const[t,j]=h.useState(null),[m,N]=h.useState(null),[o,D]=h.useState(!1);return e.jsxs(z,{className:"p-6","data-testid":"chart-impact-pathway",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(A,{className:"w-5 h-5 text-primary"}),e.jsx("h3",{className:"text-lg font-bold text-foreground",style:{fontFamily:"var(--font-display)"},children:"Impact Pathway"})]}),e.jsxs("div",{className:"mb-4",children:[e.jsx("p",{className:"text-[10px] uppercase tracking-wider text-muted-foreground/70 font-semibold mb-0.5",children:"Strategic question"}),e.jsx("p",{className:"text-sm text-foreground font-medium italic","data-testid":"text-strategic-question",children:"How do technical investments translate into sustained institutional practice and system outcomes?"})]}),e.jsxs("div",{className:"bg-secondary/10 rounded-md p-3 mb-4","data-testid":"box-toc-narrative",children:[e.jsx("p",{className:"text-[10px] uppercase tracking-wider text-muted-foreground/70 font-semibold mb-1.5",children:"The narrative"}),e.jsxs("p",{className:"text-xs text-muted-foreground leading-relaxed",children:[e.jsx("span",{className:"text-foreground font-medium",children:"If"})," adequate funding, data, and technical expertise are mobilized,"," ",e.jsx("span",{className:"text-foreground font-medium",children:"and"})," institutions are strengthened through targeted capacity building and applied research,"," ",e.jsx("span",{className:"text-foreground font-medium",children:"then"})," decision-support tools and plans will be developed and adopted by practitioners."," ",e.jsx("span",{className:"text-foreground font-medium",children:"This leads to"})," changes in practice and governance â water-saving techniques, nature-based solutions, and inclusive policies â that,"," ",e.jsx("span",{className:"text-foreground font-medium",children:"over time"}),", produce sustained water security outcomes: reduced stress, equitable access, and climate-resilient systems that function without continued project support."]})]}),e.jsx("p",{className:"text-xs text-muted-foreground/70 mb-4",children:"Click any stage to explore evidence and decision-use. Click the arrows between stages to see assumptions and risks."}),e.jsx("div",{className:"space-y-0",children:u.map((s,a)=>{const c=a<u.length-1?F[a]:null,b=H[s],E=V[s];return e.jsxs("div",{children:[e.jsxs("div",{className:"rounded-md p-4 transition-all",style:{border:`1.5px solid color-mix(in srgb, ${i[s]} 30%, transparent)`,backgroundColor:`color-mix(in srgb, ${i[s]} 4%, transparent)`},children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx("div",{className:"w-7 h-7 rounded-full flex items-center justify-center flex-shrink-0",style:{backgroundColor:`color-mix(in srgb, ${i[s]} 15%, transparent)`},children:e.jsx(E,{className:"w-3.5 h-3.5",style:{color:i[s]}})}),e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("p",{className:"text-xs font-bold uppercase tracking-wider",style:{color:i[s]},children:d[s]}
1),e.jsxs("span",{className:"text-[10px] text-muted-foreground/50",children:["Stage ",a+1," of ",u.length]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"grid gap-2 sm:grid-cols-2",children:b.map(r=>{const n=t?.node.id===r.id,p=r.criticalPath;return e.jsxs(l.button,{onClick:()=>j(n?null:{node:r,stage:s}),whileTap:{scale:.98},className:`rounded-md p-3 text-left transition-all cursor-pointer ${n?"text-white shadow-md":"text-foreground"}`,style:{border:p?`2px solid ${i[s]}`:`1px solid color-mix(in srgb, ${i[s]} 25%, transparent)`,backgroundColor:n?i[s]:`color-mix(in srgb, ${i[s]} ${p?"10":"5"}%, transparent)`},"data-testid":`node-${r.id}`,children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsx("p",{className:"text-xs font-medium leading-snug",children:r.label}),p&&e.jsx(C,{className:"w-3 h-3 flex-shrink-0 mt-0.5",style:{color:n?"white":i[s]}})]}),r.decisionPoint&&e.jsxs("p",{className:"text-[10px] mt-1.5 leading-tight flex items-center gap-1",style:{color:n?"rgba(255,255,255,0.8)":void 0,opacity:n?1:.6},children:[e.jsx(S,{className:"w-2.5 h-2.5 flex-shrink-0"}),r.decisionPoint]})]},r.id)})}),e.jsx(g,{mode:"wait",children:t&&t.stage===s&&e.jsx(l.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},className:"overflow-hidden",children:e.jsxs("div",{className:"rounded-md p-4",style:{backgroundColor:`color-mix(in srgb, ${i[s]} 8%, hsl(var(--background)))`,border:`1px solid color-mix(in srgb, ${i[s]} 20%, transparent)`},children:[e.jsxs("div",{className:"flex items-center justify-between gap-2 mb-2 flex-wrap",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:i[s]}}),e.jsx("p",{className:"text-sm font-bold text-foreground",children:t.node.label}),e.jsxs("span",{className:"text-[10px] text-muted-foreground uppercase",children:["(",d[s],")"]}),t.node.criticalPath&&e.jsxs(y,{variant:"outline",className:"text-[9px] gap-0.5",children:[e.jsx(C,{className:"w-2.5 h-2.5"})," Critical path"]})]}),e.jsx(w,{variant:"ghost",size:"sm",onClick:()=>j(null),"data-testid":"button-close-pathway-panel",children:"Close"})]}),e.jsxs("div",{className:"grid sm:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] uppercase tracking-wider text-muted-foreground font-semibold mb-1",children:"Examples"}),e.jsx("ul",{className:"space-y-0.5",children:t.node.examples.map((r,n)=>e.jsxs(l.li,{initial:{opacity:0,x:-8},animate:{opacity:1,x:0},transition:{delay:n*.04},className:"text-xs text-muted-foreground flex items-start gap-1.5",children:[e.jsx("span",{className:"w-1 h-1 rounded-full mt-1.5 flex-shrink-0",style:{backgroundColor:i[s]}}),r]},n))})]}),e.jsxs("div",{children:[e.jsxs("p",{className:"text-[10px] uppercase tracking-wider text-muted-foreground font-semibold mb-1 flex items-center gap-1",children:[e.jsx(T,{className:"w-3 h-3"})," Evidence"]}),e.jsx("ul",{className:"space-y-0.5 mb-3",children:t.node.evidence.map((r,n)=>e.jsxs("li",{className:"text-xs text-muted-foreground flex items-start gap-1.5",children:[e.jsx(f,{className:"w-3 h-3 mt-0.5 text-green-500/60 flex-shrink-0"}),r]},n))}),t.node.decisionUse&&e.jsxs("div",{className:"mb-2",children:[e.jsxs("p",{className:"text-[10px] uppercase tracking-wider text-muted-foreground font-semibold mb-0.5 flex items-center gap-1",children:[e.jsx(q,{className:"w-3 h-3"})," Decision use"]}),e.jsx("p",{className:"text-xs text-foreground font-medium",children:t.node.decisionUse})]}),t.node.decisionPoint&&e.jsxs("div",{children:[e.jsxs("p",{className:"text-[10px] uppercase tracking-wider text-muted-foreground font-semibold mb-0.5 flex items-center gap-1",children:[e.jsx(S,{className:"w-3 h-3"})," Decision point"]}),e.jsx("p",{className:"text-xs text-foreground font-medium",children:t.node.decisionPoint})]})]})]})]})},t.node.id)})]}),e.jsxs("div",{className:"mt-3 flex items-start gap-1.5 px-1",children:[e.jsx(T,{className:"w-3 h-3 text-muted-foreground/50 mt-0.5 flex-shrink-0"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[9px] uppercase tracking-wider text-muted-foreground
1/60 font-semibold mb-0.5",children:"Evidence we look for"}),b.map((r,n)=>e.jsx("p",{className:"text-[10px] text-muted-foreground leading-snug","data-testid":`text-evidence-${s}-${n}`,children:r.evidenceSummary},n))]})]})]}),c&&e.jsxs("div",{className:"flex flex-col items-center py-1",children:[e.jsxs("button",{onClick:()=>N(m===a?null:a),className:"flex flex-col items-center gap-0.5 cursor-pointer group py-1","data-testid":`transition-${a}`,children:[e.jsx(W,{className:"w-4 h-4 transition-colors",style:{color:m===a?i[s]:"hsl(var(--muted-foreground) / 0.3)"}}),e.jsx("span",{className:"text-[9px] text-muted-foreground/50 group-hover:text-muted-foreground transition-colors",children:"assumptions & risks"})]}),e.jsx(g,{children:m===a&&e.jsx(l.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},className:"overflow-hidden w-full",children:e.jsxs("div",{className:"bg-secondary/15 rounded-md p-3 my-1",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2 mb-2 flex-wrap",children:[e.jsxs("p",{className:"text-xs font-semibold text-foreground",children:[d[c.from],e.jsx("span",{className:"text-muted-foreground mx-1.5",children:"â"}),d[c.to]]}),e.jsx(w,{variant:"ghost",size:"sm",onClick:()=>N(null),"data-testid":"button-close-transition",children:"Close"})]}),e.jsxs("div",{className:"grid sm:grid-cols-2 gap-3",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(L,{className:"w-3.5 h-3.5 text-green-500 mt-0.5 flex-shrink-0"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] uppercase tracking-wider text-muted-foreground font-semibold mb-0.5",children:"Assumption"}),e.jsx("p",{className:"text-xs text-foreground",children:c.assumption})]})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx($,{className:"w-3.5 h-3.5 text-amber-500 mt-0.5 flex-shrink-0"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] uppercase tracking-wider text-muted-foreground font-semibold mb-0.5",children:"Risk"}),e.jsx("p",{className:"text-xs text-foreground",children:c.risk})]})]})]})]})})})]})]},s)})}),e.jsxs("div",{className:"grid sm:grid-cols-2 gap-3 mt-4",children:[e.jsxs("div",{className:"bg-secondary/10 rounded-md p-3","data-testid":"box-breakpoints",children:[e.jsxs("p",{className:"text-[10px] uppercase tracking-wider text-muted-foreground font-semibold mb-1.5 flex items-center gap-1",children:[e.jsx($,{className:"w-3 h-3 text-red-400"}),t?e.jsxs(e.Fragment,{children:["What can break ",e.jsx("span",{style:{color:i[t.stage]},children:d[t.stage]})]}):"What can break this pathway"]}),e.jsx("ul",{className:"space-y-0.5",children:(t?v.filter(s=>s.stage===t.stage):v).map((s,a)=>e.jsxs("li",{className:"text-xs text-muted-foreground flex items-start gap-1.5",children:[e.jsx("span",{className:"w-1 h-1 rounded-full bg-red-400/60 mt-1.5 flex-shrink-0"}),s.label]},`${s.stage}-${a}`))}),t&&e.jsx("p",{className:"text-[9px] text-muted-foreground/50 mt-1.5",children:"Click another node or close the panel to see all risks"})]}),e.jsxs("div",{className:"bg-secondary/10 rounded-md p-3",children:[e.jsxs("button",{onClick:()=>D(!o),className:"flex items-center gap-2 text-[10px] uppercase tracking-wider text-muted-foreground font-semibold cursor-pointer w-full mb-1.5","data-testid":"button-toggle-learning",children:[e.jsx(P,{className:"w-3 h-3 text-primary"}),e.jsx("span",{children:"Adaptive management"}),e.jsx(R,{className:`w-3 h-3 text-muted-foreground/60 ml-auto transition-transform ${o?"rotate-180":""}`})]}),e.jsxs(g,{children:[!o&&e.jsx(l.p,{initial:{opacity:0}
1,animate:{opacity:1},exit:{opacity:0},className:"text-[9px] text-muted-foreground/60",children:"Trigger-based adjustments & operational lessons"}),o&&e.jsx(l.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},className:"overflow-hidden",children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-[9px] uppercase tracking-wider text-muted-foreground/70 font-semibold mb-1",children:"Trigger â Adjustment"}),e.jsx("ul",{className:"space-y-1",children:k.adaptiveActions.map((s,a)=>e.jsxs("li",{className:"text-xs text-muted-foreground flex items-start gap-1",children:[e.jsx(B,{className:"w-3 h-3 mt-0.5 text-primary/50 flex-shrink-0"}),e.jsxs("span",{children:[e.jsx("span",{className:"font-medium text-foreground",children:s.trigger}),e.jsx("span",{className:"text-muted-foreground/60 mx-1",children:"â"}),s.adjustment]})]},a))})]}),e.jsxs("div",{children:[e.jsxs("p",{className:"text-[9px] uppercase tracking-wider text-muted-foreground/70 font-semibold mb-1 flex items-center gap-1",children:[e.jsx(U,{className:"w-2.5 h-2.5 text-primary"})," Operational lessons for future phases"]}),e.jsx("ul",{className:"space-y-1",children:k.lessons.map((s,a)=>e.jsxs("li",{children:[e.jsx("p",{className:"text-[10px] font-medium text-foreground",children:s.what}),e.jsx("p",{className:"text-[9px] text-muted-foreground",children:s.insight})]},a))})]})]})})]})]})]}),e.jsxs("div",{className:"mt-3 bg-secondary/10 rounded-md p-3","data-testid":"box-success",children:[e.jsxs("p",{className:"text-[10px] uppercase tracking-wider text-muted-foreground font-semibold mb-1.5 flex items-center gap-1",children:[e.jsx(f,{className:"w-3 h-3 text-green-500"})," What success looks like"]}),e.jsx("p",{className:"text-xs text-foreground mb-2","data-testid":"text-success-summary",children:"Practices are routinely applied, decisions are evidence-based, and systems function without continued project support."}),e.jsx("div",{className:"flex flex-wrap gap-2",children:M.map((s,a)=>e.jsx(y,{variant:"outline",className:"text-[10px] font-normal","data-testid":`badge-success-${a}`,children:s},a))})]})]})}export{ee as ImpactPathway};
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.