1import{j as e}from"./data-vendor-C91Wc5Q_.js";import{r as o}from"./react-vendor-PqhhQyRC.js";import{j as y,D as m,b as g,C as b,T as p}from"./ui-vendor-C5EKwEwO.js";import{L as v}from"./DemoPage-C1RJBWhS.js";import"./index-Bxjb1Xws.js";import"./supabase-vendor-CVfkMyKi.js";const j="https://api.tillsyncai.com";function k(){const[r,l]=o.useState({monthlyRevenue:5e4,numLocations:1,currentPosSystem:"square",manualHoursPerWeek:5,bookkeeperHoursPerMonth:4,industry:"casual_dining"}),[s,u]=o.useState(null),[i,d]=o.useState(!1),[c,x]=o.useState(null);o.useEffect(()=>{const t=setTimeout(()=>{h()},500);return()=>clearTimeout(t)},[r]);const h=async()=>{d(!0),x(null);try{const t=await fetch(`${j}/api/v1/roi/calculate`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({monthly_revenue:r.monthlyRevenue,num_locations:r.numLocations,current_pos_system:r.currentPosSystem,manual_hours_per_week:r.manualHoursPerWeek,bookkeeper_hours_per_month:r.bookkeeperHoursPerMonth,industry:r.industry})});if(!t.ok)throw new Error("Failed to calculate ROI");const a=await t.json();u({monthlyRevenue:a.monthly_revenue,numLocations:a.num_locations,currentPosSystem:a.current_pos_system,timeSavingsMonthly:a.time_savings_monthly,timeSavingsAnnual:a.time_savings_annual,discrepancySavingsMonthly:a.discrepancy_savings_monthly,discrepancySavingsAnnual:a.discrepancy_savings_annual,posCostSavingsMonthly:a.pos_cost_savings_monthly,posCostSavingsAnnual:a.pos_cost_savings_annual,totalSavingsMonthly:a.total_savings_monthly,totalSavingsAnnual:a.total_savings_annual,tillsyncCostMonthly:a.tillsync_cost_monthly,tillsyncCostAnnual:a.tillsync_cost_annual,netSavingsMonthly:a.net_savings_monthly,netSavingsAnnual:a.net_savings_annual,paybackPeriodMonths:a.payback_period_months,roiPercentage:a.roi_percentage,details:{manualHoursMonthly:a.details.manual_hours_monthly,manualCostMonthly:a.details.manual_cost_monthly,bookkeeperCostMonthly:a.details.bookkeeper_cost_monthly,potentialLeakageMonthly:a.details.potential_leakage_monthly,currentPosCostMonthly:a.details.current_pos_cost_monthly}})}catch(t){x(t instanceof Error?t.message:"Failed to calculate ROI")}finally{d(!1)}},n=t=>new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:0,maximumFractionDigits:0}).format(t);return e.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-lg p-6",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-6",children:[e.jsx(y,{className:"w-6 h-6 text-blue-600 dark:text-blue-400"}),e.jsx("h2",{className:"text-2xl font-bold text-gray-900 dark:text-white",children:"ROI Calculator"})]}),e.jsx("p",{className:"text-gray-600 dark:text-gray-400 mb-8",children:"Calculate how much you could save with TillSync based on your business size and current operations."}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-6 mb-8",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Monthly Revenue"}),e.jsxs("div",{className:"relative",children:[e.jsx(m,{className:"absolute left-3 top-3 w-5 h-5 text-gray-400 dark:text-gray-500"}),e.jsx("input",{type:"number",value:r.monthlyRevenue,onChange:t=>l({...r,monthlyRevenue:parseFloat(t.target.value)||0}),className:"w-full pl-10 pr-4 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent bg-white dark:bg-gray-700 text-gray-900 dark:text-white",min:"0",step:"1000"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Number of Locations"}),e.jsx("input",{type:"number",value:r.numLocations,onChange:t=>l({...r,numLocations:parseInt(t.target.value)||1}),className:"w-full px-4 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent bg-white dark:bg-gray-700 text-gray-900 dark:text-white",min:"1",max:"100"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Restaurant Type"}
1),e.jsxs("select",{value:r.industry,onChange:t=>l({...r,industry:t.target.value}),className:"w-full px-4 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent bg-white dark:bg-gray-700 text-gray-900 dark:text-white",children:[e.jsx("option",{value:"qsr",children:"Quick Service (Fast Food)"}),e.jsx("option",{value:"casual_dining",children:"Casual Dining"}),e.jsx("option",{value:"fine_dining",children:"Fine Dining"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Current POS System"}),e.jsxs("select",{value:r.currentPosSystem,onChange:t=>l({...r,currentPosSystem:t.target.value}),className:"w-full px-4 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent bg-white dark:bg-gray-700 text-gray-900 dark:text-white",children:[e.jsx("option",{value:"",children:"None / Other"}),e.jsx("option",{value:"square",children:"Square"}),e.jsx("option",{value:"toast",children:"Toast"}),e.jsx("option",{value:"clover",children:"Clover"}),e.jsx("option",{value:"aloha",children:"Aloha"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Manual Reconciliation (hrs/week)"}),e.jsxs("div",{className:"relative",children:[e.jsx(g,{className:"absolute left-3 top-3 w-5 h-5 text-gray-400 dark:text-gray-500"}),e.jsx("input",{type:"number",value:r.manualHoursPerWeek,onChange:t=>l({...r,manualHoursPerWeek:parseFloat(t.target.value)||0}),className:"w-full pl-10 pr-4 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent bg-white dark:bg-gray-700 text-gray-900 dark:text-white",min:"0",step:"0.5"})]})]})]}),i&&e.jsxs("div",{className:"text-center py-12",children:[e.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600 mx-auto"}),e.jsx("p",{className:"text-gray-600 dark:text-gray-400 mt-4",children:"Calculating your savings..."})]}),c&&e.jsx("div",{className:"bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg p-4 mb-6",children:e.jsxs("div",{className:"flex items-center gap-2 text-red-800 dark:text-red-400",children:[e.jsx(b,{className:"w-5 h-5"}),e.jsx("span",{children:c})]})}),s&&!i&&e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"bg-gradient-to-br from-blue-50 to-indigo-50 dark:from-blue-900/30 dark:to-indigo-900/30 rounded-lg p-6 border-2 border-blue-200 dark:border-blue-700",children:[e.jsxs("div",{className:"text-center mb-4",children:[e.jsx("p",{className:"text-sm font-medium text-gray-600 dark:text-gray-400 mb-2",children:"Annual Net Savings"}),e.jsx("p",{className:"text-5xl font-bold text-blue-600 dark:text-blue-400",children:n(s.netSavingsAnnual)}),e.jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-400 mt-2",children:["(",n(s.netSavingsMonthly),"/month)"]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4 pt-4 border-t border-blue-200 dark:border-blue-700",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-1",children:"ROI"}),e.jsxs("p",{className:"text-2xl font-bold text-green-600",children:[s.roiPercentage.toFixed(0),"%"]})]}),e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-1",children:"Payback Period"}),e.jsx("p",{className:"text-2xl font-bold text-green-600",children:s.paybackPeriodMonths===0?"Immediate":"N/A"})]})]})]}),e.jsxs("div",{className:"grid md:grid-cols-3 gap-4",children:[e.jsxs("div",{className:"bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx(g,{className:"w-5 h-5 text-blue-600 dark:text-blue-400"}),e.jsx("h3",{className:"font-semibold text-gray-900 dark:text-white",children:"Time Savings"})]}),e.jsx("p",{className:"text-2xl font-bold text-gray-900 dark:text-white",children:n(s.timeSavingsAnnual)}),e.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mt-1",children:"/year"}),e.jsxs("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-2",children:[s.details.manualHoursMonthly.toFixed(1)," hrs/mo eliminated"]})]}),e.jsxs("div",{className:"bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx(p,{className:"w-5 h-5 text-green-600 dark:text-green-400"}),e.jsx("h3",{className:"font-semibold text-gray-900 dark:text-white",children:"Revenue Protected"})]}),e.jsx("p",{className:"text-2xl font-bold text-gray-900 dark:text-white",children:n(s.discrepancySavingsAnnual)}),e.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mt-1",children:"/year"}),e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-2",children:"Catch discrepancies early"})]}),s.posCostSavingsAnnual>0&&e.jsxs("div",{className:"bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx(m,{className:"w-5 h-5 text-purple-600 dar
1k:text-purple-400"}),e.jsx("h3",{className:"font-semibold text-gray-900 dark:text-white",children:"POS Savings"})]}),e.jsx("p",{className:"text-2xl font-bold text-gray-900 dark:text-white",children:n(s.posCostSavingsAnnual)}),e.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mt-1",children:"/year"}),e.jsxs("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-2",children:["vs ",s.currentPosSystem]})]})]}),e.jsxs("div",{className:"bg-gray-50 dark:bg-gray-900 rounded-lg p-4 border border-gray-200 dark:border-gray-700",children:[e.jsx("h3",{className:"font-semibold text-gray-900 dark:text-white mb-3",children:"Cost Breakdown"}),e.jsxs("div",{className:"space-y-2 text-sm",children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-gray-600 dark:text-gray-400",children:"Total Annual Savings"}),e.jsxs("span",{className:"font-semibold text-green-600",children:["+",n(s.totalSavingsAnnual)]})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-gray-600 dark:text-gray-400",children:"TillSync Cost"}),e.jsxs("span",{className:"font-semibold text-gray-900 dark:text-white",children:["-",n(s.tillsyncCostAnnual)]})]}),e.jsxs("div",{className:"flex justify-between pt-2 border-t border-gray-300 dark:border-gray-600",children:[e.jsx("span",{className:"font-semibold text-gray-900 dark:text-white",children:"Net Annual Savings"}),e.jsx("span",{className:"font-bold text-blue-600 dark:text-blue-400",children:n(s.netSavingsAnnual)})]})]})]}),e.jsxs("div",{className:"bg-blue-600 text-white rounded-lg p-6 text-center",children:[e.jsx("h3",{className:"text-xl font-bold mb-2",children:"Ready to start saving?"}),e.jsxs("p",{className:"text-blue-100 mb-4",children:["Join restaurants saving an average of ",n(36e3),"/year"]}),e.jsx("button",{className:"bg-white text-blue-600 px-6 py-3 rounded-lg font-semibold hover:bg-blue-50 transition-colors",children:"Start Free Trial"})]})]})]})}function P(){return e.jsxs("div",{className:"min-h-screen bg-gray-50 dark:bg-gray-900 transition-colors",children:[e.jsx(v,{}),e.jsxs("main",{className:"max-w-5xl mx-auto px-4 sm:px-6 lg:px-8 pt-24 pb-12",children:[e.jsxs("div",{className:"text-center mb-12",children:[e.jsx("h1",{className:"text-4xl font-bold text-gray-900 dark:text-white mb-4",children:"See How Much You Could Save with TillSync"}),e.jsx("p",{className:"text-xl text-gray-600 dark:text-gray-400 max-w-3xl mx-auto",children:"Calculate your potential savings based on your restaurant's size, revenue, and current operations. See real ROI in seconds."})]}),e.jsx(k,{})]}),e.jsx("footer",{className:"bg-white dark:bg-gray-800 border-t border-gray-200 dark:border-gray-700 mt-16",children:e.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:e.jsxs("div",{className:"text-center text-gray-600 dark:text-gray-400 text-sm",children:[e.jsx("p",{children:"© 2025 TillSync. All rights reserved."}),e.jsxs("p",{className:"mt-2",children:[e.jsx("a",{href:"/privacy",className:"hover:text-gray-900 dark:hover:text-white",children:"Privacy Policy"})," ⢠",e.jsx("a",{href:"/terms",className:"hover:text-gray-900 dark:hover:text-white",children:"Terms of Service"})]})]})})})]})}export{P as ROICalculatorPage};
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.