1import{r,j as e}from"./query-vendor-Dp9tfhuh.js";import{I as m}from"./input-go5takyh.js";import{u as h,L as n}from"./index-CgOeqv80.js";import{S as c}from"./slider-BJvr272o.js";import{u as N}from"./useCurrency-BJBh1UrQ.js";import"./react-vendor-DfslLuwi.js";import"./ui-vendor-DW4RoVmg.js";import"./chart-vendor-BoynbIzZ.js";import"./index-BdQq_4o_.js";const D=()=>{const{t}=h(),{formatCurrency:i}=N(),[l,d]=r.useState(45e3),[o,u]=r.useState(300),[a,x]=r.useState(400),p=o>0?l/o:0,j=a>0?o/a*100:0,v=a>0?l/a:0;return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"grid gap-6 md:grid-cols-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(n,{children:t("tools.str.totalRoomRevenue","Total Room Revenue")}),e.jsx(m,{type:"number",value:l,onChange:s=>d(Number(s.target.value)),className:"font-medium"}),e.jsx(c,{value:[l],onValueChange:([s])=>d(s),min:0,max:5e5,step:1e3,className:"mt-2"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(n,{children:t("tools.str.roomsSold","Rooms Sold (Occupied Nights)")}),e.jsx(m,{type:"number",value:o,onChange:s=>u(Number(s.target.value)),className:"font-medium"}),e.jsx(c,{value:[o],onValueChange:([s])=>u(s),min:0,max:1e4,step:10,className:"mt-2"})]}),e.jsxs("div",{className:"space-y-2 md:col-span-2",children:[e.jsx(n,{children:t("tools.str.totalAvailableRooms","Total Available Room-Nights")}),e.jsx(m,{type:"number",value:a,onChange:s=>x(Number(s.target.value)),className:"font-medium"}),e.jsx(c,{value:[a],onValueChange:([s])=>x(s),min:0,max:1e4,step:10,className:"mt-2"})]})]}),e.jsxs("div",{className:"mt-8 space-y-4 rounded-lg bg-muted p-6",children:[e.jsxs("div",{className:"flex items-center justify-between border-b pb-4",children:[e.jsx("span",{className:"text-muted-foreground",children:t("tools.str.adrValue","Average Daily Rate (ADR)")}),e.jsx("span",{className:"text-3xl font-bold text-primary",children:i(p)})]}),e.jsxs("div",{className:"flex items-center justify-between border-b pb-4",children:[e.jsx("span",{className:"text-muted-foreground",children:t("tools.str.occupancyRateResult","Occupancy Rate")}),e.jsxs("span",{className:"text-xl font-semibold",children:[j.toFixed(1),"%"]})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-muted-foreground",children:t("tools.str.revparResult","RevPAR")}),e.jsx("span",{className:"text-xl font-semibold",children:i(v)})]}),e.jsx("p",{className:"text-sm text-muted-foreground pt-2",children:t("tools.str.adrFormula","ADR = Total Room Revenue ÷ Rooms Sold")})]})]})};export{D as ADRCalculator};
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.