import{j as e}from"./ui-vendor-Dyu0xMC9.js";import{r as s,L as a}from"./react-vendor-BiKEbLqf.js";import{H as t,M as i,F as r}from"./Footer-BCdrvFQr.js";import{H as l,B as n}from"./button-F0c2zgfO.js";import{C as d,a as c,b as o,c as m,d as x}from"./card-D8XUAx1y.js";import{L as u,I as h}from"./client-Ccea0ZZ8.js";import{S as j}from"./slider-DpkpY2uB.js";import{A as v,a as f,b as p,c as N}from"./accordion-DK3ZPWHL.js";import{B as g,a as b,b as y,c as w,d as C,e as M}from"./breadcrumb-BZGpceck.js";import{r as S,s as k}from"./index-D2mkZfe8.js";import{D as F}from"./download-DlY6qDWe.js";import{a as $}from"./chevron-right-9d459eh4.js";import"./chart-vendor-V3pFlbOw.js";import"./index-D9xaiIhE.js";const I=()=>{const[I,L]=s.useState(15e3),[R,B]=s.useState(30),[z,P]=s.useState(800),[D,O]=s.useState(25),[A,E]=s.useState(75),[Y,H]=s.useState(15e4),[V,_]=s.useState(10500),[T,q]=s.useState("expected"),G=s.useMemo(()=>{const e=12*(I-V),s=z*(D/100)*A*12,a=(e+s)*("conservative"===T?.7:"expected"===T?1:1.3),t=Y+12*V,i=(a-t)/t*100,r=a-t,l=Y/Math.max((a-12*V)/12,1);return{paybackMonths:Math.max(l,0),netBenefit:r,roi:i,benefits:a,costs:t,infraSavings:e,devProductivity:s}},[I,R,z,D,A,Y,V,T]);s.useEffect(()=>{I>0&&z>0&&S({scenario:"modernization",roi_pct:Math.round(100*G.roi)/100,payback_months:Math.round(10*G.paybackMonths)/10,npv_3yr:Math.round(G.netBenefit)})},[G.roi,G.paybackMonths,G.netBenefit,I,z]);return e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsxs(l,{children:[e.jsx("title",{children:"Platform Modernization ROI Calculator | Allerin"}),e.jsx("meta",{name:"description",content:"Calculate Year-1 ROI and payback for platform and Rails modernization projects including infrastructure savings and developer velocity."})]}),e.jsx(t,{}),e.jsx("main",{className:"py-8 md:py-12",children:e.jsxs("div",{className:"container max-w-6xl",children:[e.jsx(g,{className:"mb-6",children:e.jsxs(b,{children:[e.jsx(y,{children:e.jsx(w,{asChild:!0,children:e.jsx(a,{to:"/",children:"Home"})})}),e.jsx(C,{}),e.jsx(y,{children:e.jsx(w,{asChild:!0,children:e.jsx(a,{to:"/roi-calculator",children:"ROI Calculator"})})}),e.jsx(C,{}),e.jsx(M,{children:"Modernization"})]})}),e.jsxs("div",{className:"mb-8",children:[e.jsx("h1",{className:"text-3xl md:text-4xl font-bold mb-2",children:"Platform/Rails Modernization ROI Estimate"}),e.jsx("p",{className:"text-muted-foreground",children:"Calculate infrastructure savings and developer velocity gains."})]}),e.jsxs("div",{className:"grid lg:grid-cols-2 gap-8",children:[e.jsxs(d,{children:[e.jsxs(c,{children:[e.jsx(o,{children:"Your Inputs"}),e.jsx(m,{children:"Adjust values to match your environment"})]}),e.jsxs(x,{className:"space-y-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(u,{htmlFor:"current",children:"Current infrastructure per month ($)"}),e.jsx(h,{id:"current",type:"number",value:I,onChange:e=>L(Number(e.target.value))})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs(u,{htmlFor:"reduction",children:["Infrastructure reduction (%): ",R]}),e.jsx(j,{id:"reduction",min:0,max:60,step:5,value:[R],onValueChange:e=>{B(e[0]),_(Math.round(I*(1-e[0]/100)))}})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(u,{htmlFor:"devhours",children:"Developer hours per month"}),e.jsx(h,{id:"devhours",type:"number",value:z,onChange:e=>P(Number(e.target.value))})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs(u,{htmlFor:"velocity",children:["Velocity gain (%): ",D]}),e.jsx(j,{id:"velocity",min:0,max:50,step:5,value:[D],onValueChange:e=>O(e[0])})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(u,{htmlFor:"hourly",children:"Developer hourly rate ($)"}),e.jsx(h,{id:"hourly",type:"number",value:A,onChange:e=>E(Number(e.target.value))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(u,{htmlFor:"project",children:"One-time project cost ($)"}),e.jsx(h,{id:"project",type:"number",value:Y,onChange:e=>H(Number(e.target.value))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(u,{htmlFor:"new",children:"New infrastructure per month ($)"}),e.jsx(h,{id:"new",type:"number",value:V,onChange:e=>_(Number(e.target.value))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(u,{children:"Confidence level"}),e.jsx("div",{className:"flex gap-2",children:[{value:"conservative",label:"Conservative (0.7×)"},{value:"expected",label:"Expected (1.0×)"},{value:"aggressive",label:"Aggressive (1.3×)"}].map(s=>e.jsx(n,{variant:T===s.value?"default":"outline",size:"sm",onClick:()=>q(s.value),className:"flex-1",children:s.label.split(" ")[0]},s.value))}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Conservative = 0.7×, Expected = 1.0×, Aggressive = 1.3× applied to benefits only."})]})]})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs(d,{children:[e.jsx(c,{children:e.jsx(o,{children:"Year-1 Results"})}),e.jsxs(x,{className:"space-y-6",role:"region","aria-live":"polite",children:[e.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-sm text-muted-foreground mb-1",children:"Payback"}),e.jsxs("div",{className:"text-2xl font-bold",children:[G.paybackMonths.toFixed(1)," mo"]})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-sm text-muted-foreground mb-1",children:"Net Benefit"}),e.jsxs("div",{className:"text-2xl font-bold",children:["$",Math.round(G.netBenefit).toLocaleString()]})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-sm text-muted-foreground mb-1",children:"ROI"}),e.jsxs("div",{className:"text-2xl font-bold",children:[G.roi.toFixed(0),"%"]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"text-sm font-medium",children:"Costs vs Benefits (Year-1)"}),e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-20 text-xs text-muted-foreground",children:"Costs"}),e.jsxs("div",{className:"flex-1 h-8 bg-destructive/20 rounded relative overflow-hidden",children:[e.jsx("div",{className:"h-full bg-destructive transition-all",style:{width:G.costs/Math.max(G.benefits,G.costs)*100+"%"}}),e.jsxs("span",{className:"absolute inset-0 flex items-center px-2 text-xs font-medium",children:["$",Math.round(G.costs).toLocaleString()]})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-20 text-xs text-muted-foreground",children:"Benefits"}),e.jsxs("div",{className:"flex-1 h-8 bg-primary/20 rounded relative overflow-hidden",children:[e.jsx("div",{className:"h-full bg-primary transition-all",style:{width:G.benefits/Math.max(G.benefits,G.costs)*100+"%"}}),e.jsxs("span",{className:"absolute inset-0 flex items-center px-2 text-xs font-medium",children:["$",Math.round(G.benefits).toLocaleString()]})]})]})]})]})]})]}),e.jsxs(d,{children:[e.jsx(c,{children:e.jsx(o,{children:"Actions"})}),e.jsxs(x,{className:"flex flex-col gap-3",children:[e.jsxs(n,{onClick:()=>{alert("PDF download would trigger here with assumptions + results")},className:"w-full justify-start",children:[e.jsx(F,{className:"mr-2 h-4 w-4"}),"Download PDF"]}),e.jsxs(n,{onClick:()=>{alert("Email form would open here")},variant:"outline",className:"w-full justify-start",children:[e.jsx(i,{className:"mr-2 h-4 w-4"}),"Email me this"]}),e.jsxs(n,{onClick:()=>{k({scenario:"modernization",roi_pct:Math.round(100*G.roi)/100,payback_months:Math.round(10*G.paybackMonths)/10}),window.location.href="mailto:contact@allerin.com?subject=ROI Consult: Platform/Rails Modernization"},variant:"outline",className:"w-full justify-start",children:[e.jsx($,{className:"mr-2 h-4 w-4"}),"Book 30-min consult"]})]})]}),e.jsx(v,{type:"single",collapsible:!0,children:e.jsxs(f,{value:"assumptions",children:[e.jsx(p,{children:"View all assumptions"}),e.jsx(N,{className:"space-y-2 text-sm",children:e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsx("div",{className:"text-muted-foreground",children:"Current infra/mo:"}),e.jsxs("div",{className:"font-medium",children:["$",I.toLocaleString()]}),e.jsx("div",{className:"text-muted-foreground",children:"New infra/mo:"}),e.jsxs("div",{className:"font-medium",children:["$",V.toLocaleString()]}),e.jsx("div",{className:"text-muted-foreground",children:"Reduction:"}),e.jsxs("div",{className:"font-medium",children:[R,"%"]}),e.jsx("div",{className:"text-muted-foreground",children:"Infra savings (Y1):"}),e.jsxs("div",{className:"font-medium",children:["$",Math.round(G.infraSavings).toLocaleString()]}),e.jsx("div",{className:"text-muted-foreground",children:"Dev hours/mo:"}),e.jsx("div",{className:"font-medium",children:z.toLocaleString()}),e.jsx("div",{className:"text-muted-foreground",children:"Velocity gain:"}),e.jsxs("div",{className:"font-medium",children:[D,"%"]}),e.jsx("div",{className:"text-muted-foreground",children:"Hourly rate:"}),e.jsxs("div",{className:"font-medium",children:["$",A]}),e.jsx("div",{className:"text-muted-foreground",children:"Dev productivity (Y1):"}),e.jsxs("div",{className:"font-medium",children:["$",Math.round(G.devProductivity).toLocaleString()]}),e.jsx("div",{className:"text-muted-foreground",children:"One-time project:"}),e.jsxs("div",{className:"font-medium",children:["$",Y.toLocaleString()]}),e.jsx("div",{className:"text-muted-foreground",children:"Confidence:"}),e.jsx("div",{className:"font-medium capitalize",children:T})]})})]})}),e.jsx("p",{className:"text-xs text-muted-foreground text-center",children:"This is an estimate based on provided inputs and industry heuristics. It is not financial advice."})]})]})]})}),e.jsx(r,{})]})};export{I as default};