1import{aD as Vs,cy as As,cz as fe,u as W,r as P,p as Hs,cg as Us,cA as ns,Z as Ds,j as s,Q as be,a4 as ye,cd as $s,aH as ke,bT as Ue,cj as De,a7 as O,a3 as G,U as _,cB as Fs,cq as Ks,cC as Ls,V as Bs,cr as zs,Y as Ys,y as Ws,M as Xs,F as qs}from"./index-C1toZImK.js";import{u as Js}from"./use-impression-CCluiIpj.js";import{g as X,a as q,U as ps,R as M,b as te,W as ms,c as re,f as ce,S as ve,d as gs,K as hs,e as Me,h as Qs,i as xs,P as Zs,j as er,k as sr}from"./price-advantage-aGOfmFk8.js";import{D as $e}from"./data-table-DTpHiZgq.js";function me(e,r,n){Vs("pricing_calculator",{action:e,locale:r,scenario:n})}const Ne=1e3,rr=1e3,ir=1e6,se={serviceTierId:"starter",serviceCount:1,serviceHours:730,postgresTierId:null,postgresCount:1,postgresHours:730,keyValueTierId:null,keyValueCount:1,keyValueHours:730,buildMinutes:100,outboundGib:10,storageGbMonths:0};function I(e){return Ke(e,rr,!0)}function R(e){return Ke(e,q,!1)}function N(e){return Ke(e,ir,!1)}function nr(e){const r={serviceTierId:e.serviceTierId,serviceCount:I(e.serviceCount),serviceHours:R(e.serviceHours),postgresTierId:e.postgresTierId??"",postgresCount:I(e.postgresCount),postgresHours:R(e.postgresHours),keyValueTierId:e.keyValueTierId??"",keyValueCount:I(e.ke
1yValueCount),keyValueHours:R(e.keyValueHours),buildMinutes:N(e.buildMinutes),outboundGib:N(e.outboundGib),storageGbMonths:N(e.storageGbMonths)},n=[];Ee(n,"service",r.serviceTierId,r.serviceCount,r.serviceHours),Ee(n,"postgres",r.postgresTierId,r.postgresCount,r.postgresHours),Ee(n,"keyValue",r.keyValueTierId,r.keyValueCount,r.keyValueHours),Ge(n,"build",r.buildMinutes),Ge(n,"bandwidth",r.outboundGib),Ge(n,"storage",r.storageGbMonths);const t=n.reduce((o,a)=>o+a.amountTenThousandthCents,0);return{input:r,lines:n,totalTenThousandthCents:t,totalCents:Math.round(t/1e4)}}function Ee(e,r,n,t,o){const a=X(r,n);if(!a||t===0||o===0)return;const l=Math.round(a.monthlyCents*1e4*t*Le(o)/(q*Ne));l!==0&&e.push({kind:r,tierId:n,count:t,hours:o,amountTenThousandthCents:l})}function Ge(e,r,n){if(n===0)return;const t=ps.find(a=>a.id===r);if(!t)return;const o=Math.round(t.rateTenThousandthCents*Le(n)/Ne);o!==0&&e.push({kind:r,quantity:n,amountTenThousandthCents:o})}function Ke(e,r,n){const t=typeof e=="number"?e:Number(e??0);if(!Number.isFinite(t)||t<=0)return 0;const o=Math.min(t,r);return n?Math.floor(o):Le(o)/Ne}function Le(e){return Math.round(e*Ne)}const je=["workspace","service","postgres","keyValue","build","bandwidth","storage","disk"],tr=["service","postgres","keyValue"];function le(){return Object.fromEntries(je.map(e=>[e,0]))}function fs(e){return Object.values(e).reduce((r,n)=>r+(n??0),0)}function Oe(e){return{amounts:e,totalCents:Math.round(fs(e)/1e4)}}function Ce(e,r){return e.find(n=>n.id===r)??e[0]}const Be=2**30/10**9;function we(e){const[r,n]=e.split(" ");return n==="MiB"?Number(r)/1024:Number(r)}function bs(e){return we(e)*1024}function Pe(e){return tr.flatMap(r=>{const n=e[`${r}TierId`],t=e[`${r}Count`],o=e[`${r}Hours`];return n&&t>0&&o>0?[{family:r,tierId:n,count:t,hours:o}]:[]})}function Y(e,r,n){return Math.round(e*1e6*r*n/q)}function z(e){return Math.round(e*1e6)}function ze(e){return e*1e4}const ae="2026-09-26",Ye={shared:{perVcpuSecond:75e-8,includedGbPerVcpu:.25,maxGbPerVcpu:2,counts:[1,2,4,8]},performance:{perVcpuSecond:1196e-8,includedGbPerVcpu:2,maxGbPerVcpu:8,counts:[1,2,4,8]}},or=193e-8,ys=Object.keys(Ye),ar={"na-eu":.02,"apac-sa":.04,"africa-india":.12},We=[{id:"iad",city:"Ashburn",markup:1,egress:"na-eu"},{id:"ord",city:"Chicago",markup:1.25,egress:"na-eu"},{id:"sjc",city:"San Jose",markup:1.1923,egress:"na-eu"},{id:"ams",city:"Amsterdam",markup:1.0385,egress:"na-eu"},{id:"fra",city:"Frankfurt",markup:1.1538,egress:"na-eu"},{id:"lhr",city:"London",markup:1.1346,egress:"na-eu"},{id:"sin",city:"Singapore",markup:1.2692,egress:"apac-sa"},{id:"syd",city:"Sydney",markup:1.2692,egress:"apac-sa"},{id:"nrt",city:"Tokyo",markup:1.3077,egress:"apac-sa"},{id:"gru",city:"São Paulo",markup:1.6154,egress:"apac-sa"},{id:"jnb",city:"Johannesburg",markup:1.3029,egress:"africa-india"}],_e={plan:"Basic",monthly:38,storagePerGbMonth:.28},cr=[{plan:"Fixed 250MB",memoryMb:250,monthly:10},{plan:"Fixed 1GB",memoryMb:1024,monthly:20}],lr=.15;function dr(e){return e in Ye?e:"shared"}function ur(e,r,n,t){const o=Ye[e],a=o.counts.find(h=>h>=r&&h*o.maxGbPerVcpu>=n);if(a===void 0)return;const l=Math.max(0,n-a*o.includedGbPerVcpu),u=(a*o.perVcpuSecond+l*or)*t.markup;return{vcpus:a,memoryGb:n,perSecond:u}}const pr=[{labelKey:"pricing.provider.source.flyPricing",url:"https://fly.io/pricing",checkedOn:ae,locator:"Machines, Volumes, Managed Postgres, data transfer"},{labelKey:"pricing.provider.source.flyDocs",url:"https://docs.fly.io/about/pricing/",checkedOn:ae,locator:"Compute (per-second rates and region pricing), Data transfer pricing"},{labelKey:"pricing.provider.source.flyPostgres",url:"https://docs.fly.io/postgres",checkedOn:ae,locator:"Pricing â plans and storage billed on usage"},{labelKey:"pricing.provider.source.flyUpstash",url:"https://docs.fly.io/upstash/redis/",checkedOn:ae,locator:"Pricing â fixed plans"}],mr={id:"fly",name:"Fly.io",checkedOn:ae,sources:pr,calculate({input:e,diskGbMonths:r},n){const t=Ce(We,n.flyRegion),o=dr(n.flyCpuKind),a=le(),l=[];let u=!1;for(const{family:y,tierId:g,count:d,hours:p}of Pe(e)){const b=X(y,g);
1if(!b){u=!0;continue}if(y==="service"){const x=ur(o,Number(b.cpu),we(b.memory),t);if(!x){a.service=null;continue}a.service=z(x.perSecond*p*3600*d),l.push({key:`pricing.provider.fly.note.machine.${o}`,params:{vcpus:String(x.vcpus),memory:b.memory,region:`${t.city} (${t.id})`}})}else if(y==="postgres")a.postgres=Y(_e.monthly,d,p),l.push({key:"pricing.provider.fly.note.postgres",params:{plan:_e.plan}});else{const x=cr.find(v=>v.memoryMb>=bs(b.memory));if(!x){a.keyValue=null;continue}a.keyValue=Y(x.monthly,d,p),l.push({key:"pricing.provider.fly.note.keyValue",params:{plan:x.plan}})}}a.build=null;const h=e.outboundGib*Be,c=ar[t.egress];return a.bandwidth=z(h*c),a.storage=e.postgresTierId?z(e.storageGbMonths*_e.storagePerGbMonth):0,a.disk=z(r*lr),l.push({key:"pricing.provider.fly.note.egress",params:{rate:`$${c.toFixed(2)}`,region:`${t.city} (${t.id})`}}),{amounts:a,issue:u?"unknownTier":null,figures:{outboundGb:h,egressRate:c,markup:t.markup},notes:l}}},V="2026-09-26",gr=[{id:"Basic",memoryGb:.5,monthly:7},{id:"Standard-1X",memoryGb:.5,monthly:25},{id:"Standard-2X",memoryGb:1,monthly:50},{id:"Performance-M",memoryGb:2.5,monthly:250},{id:"Performance-L",memoryGb:14,monthly:500},{id:"Performance-L-RAM",memoryGb:30,monthly:500},{id:"Performance-XL",memoryGb:62,monthly:750},{id:"Performance-2XL",memoryGb:126,monthly:1500}],hr=[{id:"Essential-0",storageGb:1,monthly:5},{id:"Essential-1",storageGb:10,monthly:9},{id:"Essential-2",storageGb:32,monthly:20},{id:"Standard-0",storageGb:64,monthly:50},{id:"Standard-2",storageGb:256,monthly:200}],xr=[{id:"Premium 2",memoryMb:250,monthly:60},{id:"Premium 3",memoryMb:500,monthly:120},{id:"Premium 5",memoryMb:1024,monthly:200},{id:"Premium 7",memoryMb:7168,monthly:750}],fr=2e3,br=[{labelKey:"pricing.provider.source.herokuPricing",url:"https://www.heroku.com/pricing",checkedOn:V,locator:"Dyno, Postgres and Key-Value Store plan tables"},{labelKey:"pricing.provider.source.herokuDynos",url:"https://devcenter.heroku.com/articles/dyno-types",checkedOn:V,locator:"Common Runtime â memory and max price per dyno"},{labelKey:"pricing.provider.source.herokuBilling",url:"https://devcenter.heroku.com/articles/usage-and-billing",checkedOn:V,locator:"Dyno Usage and Costs â prorated to the second"},{labelKey:"pricing.provider.source.herokuPostgres",url:"https://devcenter.heroku.com/articles/heroku-postgres-plans",checkedOn:V,locator:"Essential Tier and Standard Tier â storage limits"},{labelKey:"pricing.provider.source.herokuLimits",url:"https://devcenter.heroku.com/articles/limits",checkedOn:V,locator:"Network Bandwidth â soft limited at 2TB per app per month"},{labelKey:"pricing.provider.source.herokuDisks",url:"https://devcenter.heroku.com/articles/dynos",checkedOn:V,locator:"Ephemeral Filesystem"},{labelKey:"pricing.provider.source.herokuTeams",url:"https://www.heroku.com/teams",checkedOn:V,locator:"Free for up to 25 users"}],yr={id:"heroku",name:"Heroku",checkedOn:V,sources:br,calculate({input:e,diskGbMonths:r}){const n=le(),t=[];let o=null;for(const{family:u,tierId:h,count:c,hours:y}of Pe(e)){const g=X(u,h);if(!g){o="unknownTier";continue}if(g.free){o="freeTiers";continue}if(u==="service"){const d=gr.find(p=>p.memoryGb>=we(g.memory));if(!d){n.service=null;continue}n.service=Y(d.monthly,c,y),t.push({key:"pricing.provider.heroku.note.dyno",params:{dyno:d.id,memory:g.memory}})}else if(u==="postgres"){const d=e.storageGbMonths/c,p=Math.max(g.storageGb??0,d),b=hr.find(x=>x.storageGb>=p);if(!b){n.postgres=null,n.storage=null;continue}n.postgres=Y(b.monthly,c,y),t.push({key:"pricing.provider.heroku.note.postgres",params:{plan:b.id,storage:String(b.storageGb)}})}else{const d=xr.find(p=>p.memoryMb>=bs(g.memory));if(!d){n.keyValue=null;continue}n.keyValue=Y(d.monthly,c,y),t.push({key:"pricing.provider.heroku.note.keyValue",params:{plan:d.id,memory:g.memory}})}}n.build=null;const a=e.outboundGib*Be,l=fr*Math.max(1,e.serviceCount);return n.bandwidth=a>l?null:0,n.disk=r>0?null:0,t.push({key:"pricing.provider.heroku.note.included"}),{amounts:n,issue:o,figures:{outboundGb:a,softLimitGb:l},notes:t}}},he="2026-09-26",Xe=[{id:"hobby",name:"Hobby",monthlyCents:500,maxReplicaCpu:8,maxReplicaMemoryGb:8},{id:"pro",name:"Pro",monthlyCents:2e3,maxReplicaCpu:24,maxReplicaMemoryGb:24}],oe={cpuPerVcpuMonth:20,memoryPerGbMonth:10,volumePerGbMonth:.15,egressPerGib:.05},ks=100;function Te(e){const r=Math.round(N(e));return r>=1&&r<=100?r:ks}const kr=[{labelKey:"pricing.provider.source.railwayPlans",url:"https://docs.railway.com/pricing/plans",checkedOn:he,locator:"Subscription pricing, Included usage, Resource usage pricing"},{labelKey:"pricing.provider.source.railwayPricing",url:"https://railway.com/pricing",checkedOn:he,locator:"Hobby and Pro â per
1-replica vCPU and RAM limits"},{labelKey:"pricing.provider.source.railwayVolumes",url:"https://docs.railway.com/volumes/reference",checkedOn:he,locator:"Pricing â charged for the storage used"}],vr={id:"railway",name:"Railway",checkedOn:he,sources:kr,calculate({input:e,diskGbMonths:r},n){const t=Ce(Xe,n.railwayPlanId),o=Te(n.railwayUtilization),a=o/100,l=le();let u=null;for(const{family:y,tierId:g,count:d,hours:p}of Pe(e)){const b=X(y,g);if(!b){u="unknownTier";continue}const x=Number(b.cpu),v=we(b.memory);if(x>t.maxReplicaCpu||v>t.maxReplicaMemoryGb){u="railwayReplicaLimit";continue}const k=(x*oe.cpuPerVcpuMonth+v*oe.memoryPerGbMonth)*a;l[y]=Y(k,d,p)}l.build=0,l.bandwidth=z(e.outboundGib*oe.egressPerGib),l.storage=e.postgresTierId?z(e.storageGbMonths*oe.volumePerGbMonth):0,l.disk=z(r*oe.volumePerGbMonth);const h=fs(l),c=ze(t.monthlyCents);return l.workspace=Math.max(0,c-h),{amounts:l,issue:u,figures:{utilization:o,usage:h,fee:c},notes:[{key:"pricing.provider.railway.note.utilization",params:{percent:String(o)}},{key:"pricing.provider.railway.note.plan",params:{plan:t.name,fee:`$${t.monthlyCents/100}`}},{key:"pricing.provider.railway.note.caveat"}]}}},qe=[{id:"hobby",name:"Hobby",monthlyCents:0,includedGb:5,includedMinutes:500},{id:"pro",name:"Pro",monthlyCents:2500,includedGb:25,includedMinutes:1e3},{id:"scale",name:"Scale",monthlyCents:49900,includedGb:1e3,includedMinutes:5e3}],jr=25;function vs(e){return Ce(qe,e)}function Se(e){const r=N(e);return r<=1?1:Math.ceil(r/5)*5}const Nr=M.sources.map(e=>({...e,checkedOn:M.verifiedDate})),Cr={id:"render",name:"Render",checkedOn:M.verifiedDate,sources:Nr,calculate({input:e,diskGbMonths:r},n){const t=vs(n.renderPlanId),o=Se(n.renderPostgresGb),a=le();a.workspace=ze(t.monthlyCents);let l=null;const u=Pe(e);for(const{family:p,tierId:b,count:x,hours:v}of u){const k=X(p,b);if(!k){l="unknownTier";continue}if(k.free){l="freeTiers";continue}const U=te[p][b];if(U===void 0){l="unknownTier";continue}a[p]=Y(U/100,x,v)}const h=u.reduce((p,b)=>p+b.count,0);t.id==="hobby"&&h>jr&&(l="hobbyLimit");const c=e.outboundGib*Be,y=Math.max(0,c-t.includedGb),g=Math.max(0,e.buildMinutes-t.includedMinutes),d=e.postgresTierId&&e.postgresTierId!=="free"?o*e.postgresCount*e.postgresHours/q:0;return a.bandwidth=Math.round(y*te.bandwidthPerGb),a.build=Math.round(g*te.buildPerMinute),a.storage=Math.round(d*te.storagePerGbMonth),a.disk=Math.round(r*te.diskPerGbMonth),{amounts:a,issue:l,figures:{outboundGb:c,billableGb:y,billableMinutes:g,postgresGb:o,storageGbMonths:d},notes:[{key:"pricing.compare.billable",params:{gb:y.toFixed(3),minutes:String(g),storage:d.toFixed(3)}},{key:"pricing.compare.method.units"},{key:"pricing.compare.method.build"}]}}},Je=[Cr,yr,vr,mr],js=Je.map(e=>e.id),ie=["render"],Qe=ms.filter(e=>e.monthlyCents!==null).map(({id:e,name:r,monthlyCents:n}
1)=>({id:e,name:r,monthlyCents:n})),H={bexPlanId:"hobby",diskGbMonths:0,renderPlanId:"hobby",renderPostgresGb:1,railwayPlanId:"hobby",railwayUtilization:ks,flyRegion:"iad",flyCpuKind:"shared"},wr=175e3;function Pr(e,r=H,n=ie){const t=nr(e),o=N(r.diskGbMonths),a=le();for(const c of t.lines)a[c.kind]+=c.amountTenThousandthCents;a.workspace=ze(Ce(Qe,r.bexPlanId).monthlyCents),a.disk=Math.round(o*wr);const l=Oe(a),u={input:t.input,diskGbMonths:o},h=Je.filter(c=>n.includes(c.id)).map(c=>{const{amounts:y,...g}=c.calculate(u,r),d={...g,estimate:g.issue?null:Oe(y)},p=d.estimate?.amounts,b=p?je.filter(C=>p[C]===null&&l.amounts[C]!==0):[],x=p&&b.length>0?Oe(Object.fromEntries(je.map(C=>[C,p[C]===null?0:l.amounts[C]]))).totalCents:l.totalCents,v=d.estimate?.totalCents,k=v===void 0?null:v-x;return{id:c.id,name:c.name,checkedOn:c.checkedOn,sources:c.sources,result:d,notCompared:b,differenceCents:k,savingsPercent:v!==void 0&&v>0&&k!==null?Math.round(k/v*1e3)/10:null}});return{bex:l,providers:h}}const Ze=2,Tr=new Set([1,2]),Sr=1024,Ns=new Set(["app","database","bandwidth","custom"]),Ir=new Set(js),es=[{key:"bexPlanId",wire:"bp",since:1,ids:Qe.map(e=>e.id),kind:"bexPlan"},{key:"renderPlanId",wire:"rp",since:1,ids:qe.map(e=>e.id),kind:"renderPlan"},{key:"railwayPlanId",wire:"ry",since:2,ids:Xe.map(e=>e.id),kind:"railwayPlan"},{key:"flyRegion",wire:"fr",since:2,ids:We.map(e=>e.id),kind:"flyRegion"},{key:"flyCpuKind",wire:"fc",since:2,ids:ys,kind:"flyCpuKind"}],Rr=Object.fromEntries(es.map(e=>[e.kind,e.key]));function Mr(e){let r="";for(const n of e)r+=String.fromCharCode(n);return btoa(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function Er(e){try{const r=e.replace(/-/g,"+").replace(/_/g,"/"),n=r.length%4===0?"":"=".repeat(4-r.length%4),t=atob(r+n),o=new Uint8Array(t.length);for(let a=0;a<t.length;a++)o[a]=t.charCodeAt(a);return o}catch{return null}}function Gr(e){const r=JSON.stringify(e);return Mr(new TextEncoder().encode(r))}function Or(e){const r=Er(e);if(!r)return null;try{const n=JSON.parse(new TextDecoder().decode(r));return!n||typeof n!="object"||Array.isArray(n)?null:n}catch{return null}}function Fe(e){return typeof e=="number"&&Number.isFinite(e)}function _r(e,r){return r==null||r===""?{id:null,unsupported:!1,changed:!1}:typeof r!="string"?{id:null,unsupported:!0,changed:!0}:X(e,r)?{id:r,unsupported:!1,changed:!1}:{id:r,unsupported:!0,changed:!1}}function Vr(e){return typeof e!="string"||!e?{id:se.serviceTierId,unsupported:!0}:X("service",e)?{id:e,unsupported:!1}:{id:e,unsupported:!0}}function Ar(e,r,n){return typeof e!="string"||!e?{id:r,unsupported:!0}:n.includes(e)?{id:e,unsupported:!1}:{id:e,unsupported:!0}}function ts(e,r){if(!Fe(e)||e<0)return{value:r(0),changed:!0};const n=r(e);return{value:n,changed:n!==e}}function Hr(e){const r={serviceTierId:String(e.workload.serviceTierId||""),serviceCount:I(e.workload.serviceCount),serviceHours:R(e.workload.serviceHours),postgresTierId:e.workload.postgresTierId?String(e.workload.postgresTierId):null,postgresCount:I(e.workload.postgresCount),postgresHours:R(e.workload.postgresHours),keyValueTierId:e.workload.keyValueTierId?String(e.workload.keyValueTierId):null,keyValueCount:I(e.workload.keyValueCount),keyValueHours:R(e.workload.keyValueHours),buildMinutes:N(e.workload.buildMinutes),outboundGib:N(e.workload.outboundGib),storageGbMonths:N(e.workload.storageGbMonths)},n={v:Ze,ps:e.priceSheetVersion??re,...e.scenario&&Ns.has(e.scenario)?{s:e.scenario}:{},w:{st:r.serviceTierId,sc:r.serviceCount,sh:r.serviceHours,pt:r.postgresTierId,pc:r.postgresCount,ph:r.postgresHours,kt:r.keyValueTierId,kc:r.keyValueCount,kh:r.keyValueHours,bm:r.buildMinutes,ob:r.outboundGib,sg:r.storageGbMonths},o:{...Object.fromEntries(es.map(({key:t,wire:o})=>[o,String(e.options[t]||H[t])])),pg:Se(e.options.renderPostgresGb),dk:N(e.options.diskGbMonths),ru:Te(e.options.railwayUtilization)},p:[...new Set(e.providers??ie)]};return Gr(n)}function os(e,r){const n={...e};return r?n[fe]=r:delete n[fe],n}const Ur=[["sc",I],["sh",R],["pc",I],["ph",R],["kc",I],["kh",R],["bm",N],["ob",N],["sg",N]],Dr=[["postgresTier","postgres","pt"],["keyValueTier","keyValue","kt"]];function $r(e){const r=j=>({status:"invalid",reason:j,notices:["defaultsApplied"]}),n=As(e,fe);if(n.length===0)return{status:"absent"};if(n.length>1)return r("duplicate");const t=n[0];if(typeof t!="string"||!t)return r("malformed");if(t.length>Sr)return r("oversized");const o=Or(t);if(!o||typeof o.v!="number")return r("malformed");if(!Tr.has(o.v))return r("unknownVersion");if(typeof o.ps!="string"||!o.ps||!o.w||!o.o)return r("malformed");const a=[];o.ps!==re&&a.push("catalogChanged");const l=[];let u=!1;const h=j=>{l.push(j)},c=j=>{j&&(u=!0)},y=Vr(o.w.st);y.unsupported&&h("serviceTier");const g={};for(const[j,F,K]of Dr){const L=_r(F,o.w[K]);g[K]=L,L.unsupported&&h(j),c(L.changed)}const d={};for(const[j,F]of Ur)d[j]=ts(o.w[j],F),c(d[j].changed);const p={};for(const{key:j,wire:F,since:K,ids:L,kind:T}of es){if(o.v<K){p[j]=H[j];continue}const J=Ar(o.o[F],H[j],L);J.unsupported&&h(T),p[j]=J.id}const b=o.v>=2,x=b?o.o.ru:H.railwayUtilization,v=Te(Fe(x)?x:0);c(v!==x);const k=b?Fr(o.p):{ids:[...ie],unsupported:!1,changed:!1};k.unsupported&&h("provider"),c(k.changed);const C=Fe(o.o.pg)?o.o.pg:1,U=Se(C);c(U!==C);const D=ts(o.o.dk,N);c(D.changed),u&&a.push("normalized");const de=typeof o.s=="string"&&Ns.has(o.s)?o.s:"custom",$={schemaVersion:Ze,priceSheetVersion:o.ps,currentPriceSheetVersion:re,renderVerifiedDate:M.verifiedDate,scenario:de,workload:{serviceTierId:y.id,serviceCount:d.sc.value,serviceHours:d.sh.value,postgresTierId:g.pt.id,postgresCount:d.pc.value,postgresHours:d.ph.value,keyValueTierId:g.kt.id,keyValueCount:d.kc.value,keyValueHours:d.kh.value,buildMinutes:d.bm.value,outboundGib:d.ob.value,storageGbMonths:d.sg.value},options:{...p,diskGbMonths:D.value,renderPostgresGb:U,railwayUtilization:v},providers:k.ids};return l.length>0?{status:"unsupported",state:$,unsupported:l,notices:a}:{status:"ok",state:$,notices:a}}function Fr(e){if(!Array.isArray(e))return{ids:[...ie],unsupported:!0,changed:!0};if(e.length===0)return{ids:[],unsupported:!1,changed:!1};const r=e.filter(o=>
1typeof o=="string"&&Ir.has(o)),n=[...new Set(r)],t=r.length<e.length;return n.length===0?{ids:[...ie],unsupported:!0,changed:!0}:{ids:n,unsupported:t,changed:n.length<r.length}}function Cs(){return{schemaVersion:Ze,priceSheetVersion:re,currentPriceSheetVersion:re,renderVerifiedDate:M.verifiedDate,scenario:"app",workload:{...se},options:{...H},providers:[...ie]}}function ws(e){return Object.fromEntries(Object.entries(e).map(([r,n])=>[r,n==null?"":String(n)]))}const xe=e=>ws(e),ss=e=>ws(e),as=ss(H);function Kr(e){return{serviceTierId:e.serviceTierId,serviceCount:e.serviceCount,serviceHours:e.serviceHours,postgresTierId:e.postgresTierId||null,postgresCount:e.postgresCount,postgresHours:e.postgresHours,keyValueTierId:e.keyValueTierId||null,keyValueCount:e.keyValueCount,keyValueHours:e.keyValueHours,buildMinutes:e.buildMinutes,outboundGib:e.outboundGib,storageGbMonths:e.storageGbMonths}}function cs(e){const r=$r(e),n=r.status==="ok"||r.status==="unsupported"?r.state:Cs();return{parsed:r,form:xe(n.workload),options:ss(n.options),providers:n.providers,scenario:n.scenario,blockTotals:r.status==="unsupported"}}function Lr(e,r,n){const t={...e},o={...r};for(const a of n)if(a==="serviceTier")t.serviceTierId=se.serviceTierId;else if(a==="postgresTier")t.postgresTierId="";else if(a==="keyValueTier")t.keyValueTierId="";else{const l=Rr[a];l&&(o[l]=H[l])}return{form:t,options:o}}const Br=[{id:"app",workload:se},{id:"database",workload:{...se,postgresTierId:"basic-256mb",storageGbMonths:1}},{id:"bandwidth",workload:{...se,serviceTierId:"standard",outboundGib:1e3,buildMinutes:1e3}}],ls={workspace:"pricing.compare.workspace",service:"pricing.product.service",postgres:"pricing.product.postgres",keyValue:"pricing.product.keyValue",build:"pricing.meter.build",bandwidth:"pricing.meter.bandwidth",storage:"pricing.compare.storage",disk:"pricing.compare.disks"};function zr(){const{t:e,locale:r}=W(),n=P.useId(),t=Hs(),o=Us(),a=ns({select:i=>i.location.search}),l=ns({select:i=>i.location.pathname}),u=P.useRef(!1),h=P.useMemo(()=>cs(a),[]),[c,y]=P.useState(()=>h.form),[g,d]=P.useState(()=>h.options),[p,b]=P.useState(()=>h.providers),[x,v]=P.useState(()=>h.scenario),[k,C]=P.useState(()=>h.parsed),[U,D]=P.useState(()=>h.blockTotals),[de,$]=P.useState(null),{copied:j,copy:F}=Ds(),K=P.useRef(null),L=Js(`pricing:${r}`,()=>me("view",r,x)),T=P.useMemo(()=>Pr(c,g,p),[c,g,p]),J=vs(g.renderPlanId),rs=i=>{(a[fe]??null)!==i&&(u.current=!0,t({to:".",search:m=>os({...m},i),replace:!0}))},ue=(i,m,f,w=p)=>{const ne=Hr({scenario:f,workload:Kr(i),options:m,providers:w});return rs(ne),ne};P.useEffect(()=>{if(u.current){u.current=!1;return}const i=cs(a);y(i.form),d(i.options),b(i.providers),v(i.scenario),C(i.parsed),D(i.blockTotals),$(null)},[a]);const pe=i=>{K.current!==r&&(K.current=r,me("use",r,i))},S=(i,m)=>{pe("custom"),v("custom"),y(f=>f[i]===m?f:{...f,[i]:m})},Q=(i,m)=>{pe("custom"),v("custom"),d(f=>f[i]===m?f:{...f,[i]:m})},Ps=(i,m)=>{pe("custom");const f=m?js.filter(w=>w===i||p.includes(w)):p.filter(w=>w!==i);b(f),ue(c,g,x,f)},Ie=(i,m)=>{d(f=>{const w=String(m(f[i]));return f[i]===w?f:{...f,[i]:w}})},E=(i,m)=>{y(f=>{const w=String(m(f[i]));return f[i]===w?f:{...f,[i]:w}})},Ts=async()=>{const i=ue(c,g,x),m=new URLSearchParams,f=os({...a},i);for(const[_s,is]of Object.entries(f))typeof is=="string"&&m.set(_s,is);const w=`${l}${m.size?`?${m}`:""}`,ne=o&&typeof window<"u"?`${window.location.origin}${w}`:w,Os=await F(ne);$(Os==="failed"?ne:null)},Ss=()=>{const i=Cs();y(xe(i.workload)),d(ss(i.options)),b(i.providers),v("app"),C({status:"absent"}),D(!1),$(null),rs(null)},Is=()=>{if(k.status!=="unsupported")return;const i=Lr(c,g,k.unsupported);y(i.form),d(i.options),v("custom"),D(!1),C({status:"absent"}),ue(i.form,i.options,"custom")},Z=T.providers.length===1?T.providers[0]:null,ee=Z?.differenceCents??null,Rs=ds(ee),Ms=new Intl.ListFormat(r,{type:"conjunction"}),Es=i=>e("pricing.compare.notCompared",{items:Ms.format(i.map(m=>e(ls[m])))}),Gs=Math.max(1,T.bex.totalCents,...T.providers.map(i=>i.result.estimate?.totalCents??0)),Re=[{id:"bex",name:"Bex",estimate:T.bex,notCompared:[]},...T.providers.map(i=>({id:i.id,name:i.name,estimate:i.result.estimate,notCompared:i.notCompared}))];return s.jsxs("div",{className:"grid items-start gap-6 lg:grid-cols-[minmax(0,1.15fr)_minmax(0,1fr)]",children:[s.jsxs("form",{id:"comparison-inputs",onSubmit:i=>i.preventDefault(),className:"min-w-0 rounded-2xl border border-border/70 bg-card p-5 sm:p-7",children:[(k.status==="invalid"||k.status==="unsupported"||k.status==="ok"&&k.notices.includes("catalogChanged"))&&s.jsxs("div",{role:"status",className:"mb-5 rounded-xl border border-border bg-muted/40 px-4 py-3 text-sm leading-relaxed text-foreground",children:[k.status==="invalid"&&s.jsx("p",{children:e("pricing.share.invali
1d")}),k.status==="unsupported"&&s.jsx("p",{children:e("pricing.share.unsupported")}),k.status==="ok"&&k.notices.includes("catalogChanged")&&s.jsx("p",{children:e("pricing.share.catalogChanged",{current:k.state.currentPriceSheetVersion,date:be(k.state.renderVerifiedDate,r,"long")})}),s.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[k.status==="unsupported"&&s.jsx("button",{type:"button",onClick:Is,className:"min-h-11 rounded-lg border border-border bg-background px-4 text-sm font-medium hover:border-primary/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:e("pricing.share.fixUnsupported")}),s.jsx("button",{type:"button",onClick:Ss,className:"min-h-11 rounded-lg border border-border bg-background px-4 text-sm font-medium hover:border-primary/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:e("pricing.share.reset")})]})]}),s.jsxs("div",{ref:L,className:"mb-7 border-b border-border/60 pb-6",children:[s.jsx("p",{className:"hp-mono text-xs text-muted-foreground",children:e("pricing.design.examples")}),s.jsx("div",{className:"mt-3 flex flex-wrap gap-2",children:Br.map(i=>s.jsx("button",{type:"button","aria-pressed":x===i.id,onClick:()=>{pe(i.id),me("scenario",r,i.id),v(i.id),y(xe(i.workload)),d(as),D(!1),C({status:"absent"}),ue(xe(i.workload),as,i.id)},className:"min-h-11 rounded-lg border border-border bg-background px-4 text-sm font-medium hover:border-primary/60 aria-pressed:border-primary aria-pressed:bg-primary/10 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:e(`pricing.design.example.${i.id}`)},i.id))}),s.jsxs("div",{className:"mt-4 flex flex-wrap items-center gap-2",children:[s.jsx("button",{type:"button","data-testid":"pricing-share",onClick:()=>{Ts()},className:"min-h-11 rounded-lg border border-border bg-background px-4 text-sm font-medium hover:border-primary/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:e(j?"pricing.share.copied":"pricing.share.copy")}),s.jsx("a",{href:"#comparison-results",className:"inline-flex min-h-11 items-center gap-2 text-sm font-medium text-primary underline underline-offset-4 lg:hidden",children:e("pricing.compare.viewResult")})]}),de&&s.jsxs("div",{className:"mt-3 grid gap-2",children:[s.jsxs("p",{className:"text-sm text-muted-foreground",children:[e("pricing.share.failed")," ",e("pricing.share.manualHint")]}),s.jsxs("label",{className:"grid gap-1 text-sm font-medium",children:[s.jsx("span",{children:e("pricing.share.manualLabel")}),s.jsx("input",{readOnly:!0,value:de,onFocus:i=>i.currentTarget.select(),className:"h-11 w-full min-w-0 rounded-lg border border-input bg-background px-3 font-mono text-xs focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"})]})]})]}),s.jsxs("div",{className:"grid gap-7",children:[s.jsxs("fieldset",{"data-testid":"compare-providers",children:[s.jsx("legend",{className:"mb-2 text-lg font-semibold",children:e("pricing.compare.providers.legend")}),s.jsx("p",{className:"mb-4 text-xs leading-relaxed text-muted-foreground",children:e("pricing.compare.providers.help")}),s.jsx("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-4",children:Je.map(i=>s.jsxs("label",{className:"pricing-provider-option",children:[s.jsx("input",{type:"checkbox",name:"compare-provider",value:i.id,checked:p.includes(i.id),onChange:m=>Ps(i.id,m.target.checked),className:"accent-primary"}),i.name]},i.id))})]}),s.jsxs("fieldset",{children:[s.jsx("legend",{className:"mb-4 text-lg font-semibold",children:e("pricing.compare.workspace")}),s.jsx("div",{className:"grid gap-4 sm:grid-cols-2",children:[["bex",Qe],["render",qe],["railway",Xe]].filter(([i])=>i==="bex"||p.includes(i)).map(([i,m])=>s.jsx(Ae,{id:`${n}-${i}-plan`,label:e(`pricing.compare.${i}Plan`),value:g[`${i}PlanId`],onChange:f=>Q(`${i}PlanId`,f),choices:m.map(f=>({value:f.id,label:`${f.name} â ${ce(f.monthlyCents)}`}))},i))}),p.includes("render")&&s.jsx("p",{className:"mt-3 text-xs leading-relaxed text-muted-foreground",children:e("pricing.compare.allowance",{plan:J.name,bandwidth:String(J.includedGb),minutes:String(J.includedMinutes)})}),s.jsx("p",{className:"mt-1 text-xs leading-relaxed text-muted-foreground",children:e("pricing.compare.bexAllowance")})]}),(p.includes("railway")||p.includes("fly"))&&s.jsxs("fieldset",{"data-testid":"provider-assumptions",children:[s.jsx("legend",{className:"mb-4 text-lg font-semibold",children:e("pricing.compare.assumptions")}),s.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[p.includes("railway")&&s.jsxs("div",{className:"grid gap-2 sm:col-span-2",children:[s.jsx(A,{id:`${n}-railway-utilization`,label:e("pricing.compare.railwayUtilization"),value:g.railwayUtilization,onChange:i=>Q("railwayUtilization",i),onBlur:()=>Ie("railwayUtilization",Te),integer:!0,max:100}),s.jsx("p",{className:"text-xs leading-relaxed text-muted-foreground",children:e("pricing.compare.railwayUtilizationHelp")})]}),p.includes("fly")&&s.jsxs(s.Fragment,{children:[s.jsx(Ae,{id:`${n}-fly-region`,label:e("pricing.compare.flyRegion"),value:g.flyRegion,onChange:i=>Q("flyRegion",i),choices:We.map(i=>({value:i.id,label:`${i.city} (${i.id})`}))}),s.jsx(Ae,{id:`${n}-fly-cpu`,label:e("pricing.compare.flyCpuKind"),value:g.flyCpuKind,onChange:i=>Q("flyCpuKind",i),choices:ys.map(i=>({value:i,label:e(`pricing.compare.flyCpu.${i}`)}))})]})]})]}),s.jsx(Ve,{legend:e("pricing.estimator.service"),id:`${n}-service`,tiers:ve,tierValue:c.serviceTierId,countValue:c.serviceCount,hoursValue:c.serviceHours,onTier:i=>S("serviceTierId",i),onCount:i=>S("serviceCount",i),onHours:i=>S("serviceHours",i),onCountBlur:()=>E("serviceCount",I),onHoursBlur:()=>E("serviceHours",R)}),s.jsx(Ve,{legend:e("pricing.estimator.postgres"),id:`${n}-postgres`,tiers:gs,optional:!0,tierValue:c.postgresTierId,countValue:c.postgresCount,hoursValue:c.postgresHours,onTier:i=>S("postgresTierId",i),onCount:i=>S("postgresCount",i),onHours:i=>S("postgresHours",i),onCountBlur:()=>E("postgresCount",I),onHoursBlur:()=>E("postgresHours",R)}),s.jsx(Ve,{legend:e("pricing.estimator.keyValue"),id:`${n}-key-value`,tiers:hs,optional:!0,tierValue:c.keyValueTierId,countValue:c.keyValueCount,hoursValue:c.keyValueHours,onTier:i=>S("keyValueTierId",i),onCount:i=>S("keyValueCount",i),onHours:i=>S("keyValueHours",i),onCountBlur:()=>E("keyValueCount",I),onHoursBlur:()=>E("keyValueHours",R)}),s.jsxs("fieldset",{children:[s.jsx("legend",{className:"mb-4 text-lg font-semibold",children:e("pricing.estimator.usage")}),s.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[s.jsx(A,{id:`${n}-build`,label:e("pricing.estimator.buildMinutes"),value:c.buildMinutes,onChange:i=>S("buildMinutes",i),onBlur:()=>
1E("buildMinutes",N)}),s.jsx(A,{id:`${n}-egress`,label:e("pricing.estimator.outboundGib"),value:c.outboundGib,onChange:i=>S("outboundGib",i),onBlur:()=>E("outboundGib",N)})]})]}),s.jsxs("fieldset",{children:[s.jsx("legend",{className:"mb-4 text-lg font-semibold",children:e("pricing.compare.storage")}),s.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[s.jsx(A,{id:`${n}-storage`,label:e("pricing.estimator.storageGbMonths"),value:c.storageGbMonths,onChange:i=>S("storageGbMonths",i),onBlur:()=>E("storageGbMonths",N)}),p.includes("render")&&s.jsx(A,{id:`${n}-render-storage`,label:e("pricing.compare.renderStorage"),value:g.renderPostgresGb,onChange:i=>Q("renderPostgresGb",i),onBlur:()=>Ie("renderPostgresGb",Se),disabled:!c.postgresTierId||c.postgresTierId==="free",integer:!0})]}),s.jsx("p",{className:"mt-3 text-xs leading-relaxed text-muted-foreground",children:e("pricing.compare.storageHelp")}),s.jsx("div",{className:"mt-4",children:s.jsx(A,{id:`${n}-disks`,label:e("pricing.compare.diskQuantity"),value:g.diskGbMonths,onChange:i=>Q("diskGbMonths",i),onBlur:()=>Ie("diskGbMonths",N)})})]})]})]}),s.jsxs("aside",{id:"comparison-results",className:"pricing-estimate min-w-0 rounded-2xl p-5 sm:p-7 lg:sticky lg:top-24","aria-labelledby":`${n}-results-title`,children:[s.jsx("h3",{id:`${n}-results-title`,className:"text-sm font-medium text-muted-foreground",children:e("pricing.compare.resultTitle")}),s.jsx("div",{role:"status","aria-live":"polite","aria-atomic":"true",className:"mt-5",children:U?s.jsx("p",{className:"text-sm leading-relaxed text-muted-foreground",children:e("pricing.share.unsupported")}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"grid grid-cols-2 gap-3 sm:gap-5",children:Re.map(i=>{const m=i.estimate?.totalCents;return s.jsxs("div",{className:"min-w-0",children:[s.jsx("p",{className:"text-sm font-semibold",children:i.name}),s.jsx("strong",{"data-estimate":i.id,className:"hp-display mt-2 block break-words text-3xl xl:text-4xl",children:m===void 0?"â":Me(m)}),s.jsx("div",{className:"mt-3 h-1.5 overflow-hidden rounded-full bg-white/10","aria-hidden":"true",children:s.jsx("div",{className:i.id==="bex"?"h-full rounded-full bg-[oklch(0.82_0.17_138.3)]":"h-full rounded-full bg-white/60",style:{width:`${(m??0)/Gs*100}%`}})}),i.notCompared.length>0&&s.jsx("p",{className:"mt-2 text-xs leading-relaxed text-muted-foreground",children:Es(i.notCompared)})]},i.id)})}),s.jsxs("div",{className:"mt-6 rounded-xl border border-white/15 bg-white/5 p-4",children:[Z||T.providers.length===0?s.jsxs(s.Fragment,{children:[s.jsx("p",{className:"text-sm font-medium",children:e(`pricing.compare.difference.${Rs}`)}),ee!==null&&ee!==0&&s.jsx("strong",{className:"mt-1 block text-2xl font-semibold tabular-nums",children:Me(Math.abs(ee))}),ee!==null&&ee>0&&Z?.savingsPercent!=null&&s.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:e("pricing.compare.percent",{percent:String(Z.savingsPercent)})}),Z?.result.issue&&s.jsx("p",{className:"mt-2 text-sm leading-relaxed text-muted-foreground",children:e(`pricing.compare.issue.${Z.result.issue}`)})]}):s.jsx("ul",{className:"space-y-2 text-sm","data-testid":"provider-differences",children:T.providers.map(i=>s.jsxs("li",{children:[s.jsx("span",{className:"font-medium",children:e(`pricing.compare.vs.${ds(i.differenceCents)}`,{provider:i.name,amount:Me(Math.abs(i.differenceCents??0))})}),i.result.issue&&s.jsx("span",{className:"block text-muted-foreground",children:e(`pricing.compare.issue.${i.result.issue}`)})]},i.id))}),T.providers.some(i=>i.notCompared.length>0)&&s.jsx("p",{className:"mt-2 text-xs leading-relaxed text-muted-foreground",children:e("pricing.compare.comparedOnly")})]})]})}),s.jsx("p",{className:"mt-4 text-xs leading-relaxed text-muted-foreground",children:e("pricing.estimator.perPricingMonth")}),s.jsx("p",{className:"mt-2 text-xs leading-relaxed text-muted-foreground",children:e("pricing.compare.scope")}),s.jsxs(ye,{href:ke.dashboard.signup,variant:"solid",size:"sm",className:"pricing-button mt-6 w-full text-sm",...$s,onClick:()=>me("signup",r,x),children:[e("pricing.cta.start"),s.jsx(Ue,{size:16,"aria-hidden":"true"})]}),s.jsxs("details",{className:"pricing-comparison mt-7 border-t border-white/15 pt-3",children:[s.jsxs("summary",{className:"flex min-h-11 cursor-pointer list-none items-center justify-between gap-3 text-sm font-semibold",children:[e("pricing.estimator.breakdown"),s.jsx(De,{className:"pricing-comparison-icon shrink-0",size:16,"aria-hidden":"true"})]}),s.jsxs("table",{className:"w-full table-fixed text-left text-xs sm:text-sm",children:[s.jsx("caption",{className:"sr-only",children:e("pricing.estimator.breakdown")}),s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-white/15 text-muted-foreground",children:[s.jsx("th",{className:"w-[46%] pb-3 font-normal",scope:"col",children:e("pricing.table.meter")}),Re.map(i=>s.jsx("th",{className:"pb-3 text-right font-normal",scope:"col",children:i.name},i.id))]})}),s.jsx("tbody",{children:je.map(i=>s.jsxs("tr",{className:"border-b border-white/10",children:[s.jsx("th",{scope:"row",className:"break-words py-3 pr-2 font-normal",children:e(ls[i])}),Re.map(m=>{const f=m.estimate?.amounts[i];return s.jsx("td",{className:"break-words py-3 pl-1 text-right tabular-nums",children:f==null?"â":Qs(f)},m.id)})]},i))})]})]}),s.jsxs("details",{className:"pricing-comparison mt-6 text-xs leading-relaxed text-muted-foreground",children:[s.jsxs("summary",{className:"flex min-h-11 cursor-pointer list-none items-center justify-between gap-3 font-semibold",children:[e("pricing.compare.method.title"),s.jsx(De,{className:"pricing-comparison-icon shrink-0",size:16,"aria-hidden":"true"})]}),s.jsxs("div",{className:"mt-3 space-y-3",children:[s.jsx("p",{children:e("pricing.compare.method.plans")}),s.jsx("p",{children:e("pricing.compare.method.runtime")}),T.providers.map(i=>s.jsxs("section",{className:"space-y-2","data-provider-method":i.id,children:[s.jsx("h4",{className:"font-semibold text-foreground",children:i.name}),i.result.notes.map((m,f)=>s.jsx("p",{children:e(m.key,m.params)},f)),s.jsx("p",{children:e("pricing.compare.method.checked",{provider:i.name,date:be(i.checkedOn,r,"short")})}),s.jsx("p",{className:"flex flex-wrap gap-x-4 gap-y-2",children:i.sources.map(m=>s.jsx("a",{href:m.url,target:"_blank",rel:"noreferrer",className:"underline underline-offset-4",children:e(m.labelKey)},m.url))})]},i.id)),s.jsx("p",{children:s.jsx("a",{href:xs,target:"_blank",rel:"noreferrer",className:"underline underline-offset-4",children:e("pricing.compare.method.bexSource")})})]})]}),s.jsx("a",{href:"#comparison-inputs",className:"mt-3 inline-flex min-h-11 items-center text-sm font-medium underline underline-offset-4 lg:hidden",children:e("pricing.compare.editInputs")})]})]})}function ds(e){return e===null?"unavailable":e>0?"lower":e<0?"higher":"equal"}function Ve({legend:e,id:r,tiers:n,optional:t=!1,tierValue:o,countValue:a,hoursValue:l,onTier:u,onCount:h,onHours:c,onCountBlur:y,onHoursBlur:g}){const{t:d}=W(),p=t&&o==="",b=n.find(x=>x.id===o);return s.jsxs("fieldset",{children:[s.jsx("legend",{className:"mb-4 text-lg font-semibold",children:e}),s.jsxs("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3",children:[s.jsxs("label",{className:`col-span-2 grid min-w-0 gap-2 text-sm font-medium ${p?"sm:col-span-3":"sm:col-span-1"}`,htmlFor:`${r}-tier`,children:[s.jsx("span",{id:`${r}-tier-label`,children:d("pricing.estimator.tier")}),s.jsxs("select",{id:`${r}-tier`,"aria-labelledby":`${r}-tier-label`,value:o,onChange:x=>u(x.target.value),className:"h-11 w-full min-w-0 rounded-lg border border-input bg-background px-3 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[t&&s.jsx("option",{value:"",children:d("pricing.estimator.none")}),n.map(x=>s.jsxs("option",{value:x.id,children:[d(x.labelKey)," â ",ce(x.monthlyCents)]},x.id))]})]}),!p&&s.jsxs(s.Fragment,{children:[s.jsx(A,{id:`${r}-count`,label:d("pricing.estimator.count"),value:a,onChange:h,onBlur:y,integer:!0,max:1e3}),s.jsx(A,{id:`${r}
1-hours`,label:d("pricing.estimator.runtimeHours"),value:l,onChange:c,onBlur:g,max:q})]})]}),b&&s.jsxs("p",{className:"mt-2 text-xs text-muted-foreground",children:[b.cpu," CPU · ",b.memory]})]})}function Ae({id:e,label:r,value:n,onChange:t,choices:o}){return s.jsxs("label",{className:"grid min-w-0 gap-2 text-sm font-medium",htmlFor:e,children:[r,s.jsx("select",{id:e,value:n,onChange:a=>t(a.target.value),className:"h-11 w-full min-w-0 rounded-lg border border-input bg-background px-3 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:o.map(a=>s.jsx("option",{value:a.value,children:a.label},a.value))})]})}function A({id:e,label:r,value:n,onChange:t,onBlur:o,disabled:a=!1,integer:l=!1,max:u=1e6}){return s.jsxs("label",{className:"grid gap-2 text-sm font-medium",htmlFor:e,children:[r,s.jsx("input",{id:e,type:"number",inputMode:l?"numeric":"decimal",min:0,max:u,step:l?1:"any",value:n,disabled:a,onChange:h=>t(h.target.value),onBlur:o,className:"h-11 min-w-0 rounded-xl border border-input bg-background px-3 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50"})]})}const Yr="mailto:[email protected]",Wr="/compare",Xr="/compare/render",qr="/compare/heroku",Jr="/compare/fly-io",Qr="/compare/railway",Zr="/compare/vercel",ei="/compare/digitalocean-app-platform",si=[{href:"#calculator",labelKey:"pricing.estimator.kicker"},{href:"#workspace-plans",labelKey:"pricing.workspace.kicker"},{href:"#compute",labelKey:"pricing.compute.kicker"},{href:"#datastores",labelKey:"pricing.datastore.kicker"},{href:"#meters",labelKey:"pricing.meters.kicker"},{href:"#faq",labelKey:"pricing.faq.kicker"}];function ri(){const{t:e,locale:r}=W();return s.jsxs(s.Fragment,{children:[s.jsx(ni,{}),s.jsx(Zs,{surface:"pricing"}),s.jsx(O,{id:"calculator",variant:"muted",rhythm:"compact",hairline:!0,children:s.jsxs(G,{children:[s.jsx(B,{kicker:e("pricing.estimator.kicker"),title:e("pricing.estimator.title"),desc:e("pricing.estimator.description")}),s.jsx(zr,{})]})}),s.jsx(O,{rhythm:"compact",hairline:!0,children:s.jsx(G,{children:s.jsxs("div",{className:"grid gap-8 lg:grid-cols-[minmax(0,1fr)_minmax(0,1.8fr)] lg:gap-12",children:[s.jsx(B,{kicker:e("pricing.billing.kicker"),title:e("pricing.billing.title"),desc:e("pricing.billing.description"),flush:!0}),s.jsxs("div",{children:[s.jsx("ol",{className:"grid gap-px overflow-hidden rounded-2xl border border-border/60 bg-border/60 sm:grid-cols-3",children:[1,2,3].map(n=>s.jsxs("li",{className:"bg-card p-5",children:[s.jsxs("span",{className:"hp-kicker text-primary",children:["0",n]}),s.jsx("h3",{className:"mt-3 text-sm font-semibold",children:e(`pricing.billing.step${n}.title`)}),s.jsx("p",{className:"mt-1.5 text-sm leading-relaxed text-muted-foreground",children:e(`pricing.billing.step${n}.body`)})]},n))}),s.jsx("p",{className:"mt-3 text-xs text-muted-foreground",children:e("pricing.billing.monthNote")})]})]})})}),s.jsx(O,{id:"workspace-plans",rhythm:"compact",hairline:!0,children:s.jsx(G,{children:s.jsxs("div",{className:"grid gap-8 lg:grid-cols-[minmax(0,1fr)_minmax(0,1.8fr)] lg:gap-12",children:[s.jsx(B,{kicker:e("pricing.workspace.kicker"),title:e("pricing.workspace.title"),desc:e("pricing.workspace.description"),foot:e("pricing.workspace.note"),flush:!0}),s.jsx($e,{caption:e("pricing.workspace.kicker"),className:"pricing-rates",head:[e("pricing.table.tier"),e("pricing.table.monthly")],rows:ms.map(n=>({key:n.id,header:n.name,cells:[s.jsx("span",{className:"tabular-nums",children:n.monthlyCents===null?e("pricing.workspace.custom"):ce(n.monthlyCents)},"price")]}))})]})})}),s.jsx(O,{id:"compute",variant:"muted",rhythm:"compact",hairline:!0,children:s.jsx(G,{children:s.jsxs("div",{className:"grid gap-8 lg:grid-cols-[minmax(0,1fr)_minmax(0,1.8fr)] lg:gap-12",children:[s.jsx(B,{kicker:e("pricing.compute.kicker"),title:e("pricing.compute.title"),desc:e("pricing.compute.description"),foot:e("pricing.catalog.provenance",{date:be(er,r,"short"),hours:String(q)}),flush:!0}),s.jsx(He,{tiers:ve,caption:e("pricing.compute.kicker")})]})})}),s.jsx(O,{id:"datastores",rhythm:"compact",hairline:!0,children:s.jsxs(G,{children:[s.jsx(B,{kicker:e("pricing.datastore.kicker"),title:e("pricing.datastore.title"),desc:e("pricing.datastore.description")}),s.jsxs("div",{className:"grid min-w-0 grid-cols-1 gap-8 xl:grid-cols-2",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("h3",{className:"hp-display mb-3 text-xl",children:"Postgres"}),s.jsx(He,{tiers:gs,caption:"Postgres"})]}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("h3",{className:"hp-display mb-3 text-xl",children:e("pricing.product.keyValue")}),s.jsx(He,{tiers:hs,caption:e("pricing.product.keyValue")})]})]})]})}),s.jsx(O,{id:"meters",variant:"muted",rhythm:"compact",hairline:!0,children:s.jsx(G,{children:s.jsxs("div",{className:"grid gap-8 lg:grid-cols-[minmax(0,1fr)_minmax(0,1.8fr)] lg:gap-12",children:[s.jsx(B,{kicker:e("pricing.meters.kicker"),title:e("pricing.meters.title"),desc:e("pricing.meters.description"),foot:e("pricing.meters.storageNote"),flush:!0}),s.jsx($e,{caption:e("pricing.meters.title"),className:"pricing-rates",head:[e("pricing.table.meter"),e("pricing.table.rate"),e("pricing.table.unit")],rows:ps.map(n=>({key:n.labelKey,cells:[s.jsx("span",{className:"font-medium",children:e(n.labelKey)},"label"),s.jsx("span",{className:"tabular-nums",children:sr(n.rateTenThousandthCents)},"rate"),e(n.unitKey)]}))})]})})}),s.jsx(O,{rhythm:"compact",hairline:!0,children:s.jsx(G,{children:s.jsxs("details",{className:"pricing-comparison",children:[s.jsxs("summary",{className:"flex cursor-pointer list-none items-center justify-between gap-4 text-lg font-semibold hover:text-primary",children:[e("pricing.design.comparison"),s.jsx(De,{className:"pricing-comparison-icon shrink-0",size:20,"aria-hidden":"true"})]}),s.jsxs("div",{className:"pt-8",children:[s.jsx(B,{kicker:e("pricing.comparison.kicker"),title:e("pricing.comparison.title"),desc:e("pricing.comparison.description")}),s.jsxs("div",{className:"grid gap-px overflow-hidden rounded-2xl border border-border/60 bg-border/60 sm:grid-cols-2 lg:grid-cols-4",children:[s.jsx(ge,{title:e("pricing.comparison.compute"),percent:M.compute.savingsPercent,basis:e("pricing.comparison.computeBasis")}),s.jsx(ge,{title:e("pricing.comparison.build"),percent:M.build.savingsPercent,basis:e("pricing.comparison.buildBasis")}),s.jsx(ge,{title:e("pricing.comparison.storage"),percent:M.postgresStorage.savingsPercent,basis:e("pricing.comparison.storageBasis")}),s.jsx(ge,{title:e("pricing.comparison.bandwidth"),percent:M.bandwidth.savingsPercent,basis:e("pricing.comparison.bandwidthBasis")})]}),s.jsxs("p",{className:"mt-3 text-xs leading-relaxed text-muted-foreground",children:[s.jsx("span",{className:"font-medium text-foreground",children:e("pricing.comparison.verified",{date:be(M.verifiedDate,r,"short")})})," ",e("pricing.comparison.caveat")," ",M.sources.map((n,t)=>s.jsxs("span",{children:[t>0&&" · ",s.jsx("a",{href:n.url,target:"_blank",rel:"noreferrer",className:"font-medium text-primary underline underline-offset-2 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:e(n.labelKey)})]},n.url))]}),s.jsxs("p",{className:"mt-4 flex flex-wrap items-center gap-x-4 gap-y-1 text-sm",children:[s.jsx(_,{to:Xr,className:"font-medium text-primary underline underline-offset-2 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:e("pricing.comparison.compareLink")}),s.jsx(_,{to:qr,className:"font-medium text-primary underline underline-offset-2 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:"bex vs Heroku"}),s.jsx(_,{to:Jr,className:"font-medium text-primary underline underline-offset-2 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:"bex vs Fly.io"}),s.jsx(_,{to:Qr,className:"font-medium text-primary underline underline-offset-2 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:"bex vs Railway"}),s.jsx(_,{to:Zr,className:"font-medium text-primary underline underline-offset-2 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:"bex vs Vercel"}),s.jsx(_,{to:ei,className:"font-medium text-primary underline underline-offset-2 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:"bex vs DigitalOcean App Platform"}),s.jsx(_,{to:Wr,className:"text-muted-foreground underline underline-offset-2 transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:e("compare.heading")})]})]})]})})}),s.jsx("div",{id:"faq",children:s.jsx(Fs,{surface:"pricing",title:e("pricing.faq.title"),description:e("pricing.faq.description")})}),s.jsx(O,{variant:"olive",rhythm:"compact",hairline:!0,children:s.jsxs(G,{className:"text-center py-6",children:[s.jsx("h2",{className:"hp-display mx-auto max-w-3xl text-3xl sm:text-4xl",children:e("pricing.final.title")}),s.jsx("p",{className:"mx-auto mt-4 max-w-2xl hp-olive-muted",children:e("pricing.final.description")}),s.jsxs("div",{className:"mt-7 flex flex-col items-center justify-center gap-3 sm:flex-row",children:[s.jsx(ye,{href:ke.dashboard.signup,target:"_blank",rel:"noreferrer",variant:"on-olive",size:"lg",className:"pricing-button",children:e("pricing.cta.start")}),s.jsx(ye,{href:Yr,variant:"on-olive-outline",size:"lg",className:"pricing-button",children:e("pricing.cta.contact")})]})]})})]})}const ii=[{key:"free",tier:ve.find(e=>e.free),icon:Ks},{key:"paid",tier:ve.find(e=>e.id==="starter"),icon:Ls}];function ni(){const{t:e}=W();return s.jsx("section",{id:"pricing-overview",className:"pricing-hero border-b border-border/60",children:s.jsxs(G,{className:"pt-16 pb-8 sm:pt-20",children:[s.jsxs("div",{className:"mx-auto max-w-3xl text-center",children:[s.jsx("p",{className:"hp-kicker mb-6 text-primary",children:e("pricing.hero.kicker")}),s.jsxs("h1",{className:"hp-display pricing-hero-title",children:[e("pricing.hero.title")," ",s.jsx("span",{className:"block text-primary",children:e("pricing.design.heroAccent")})]}),s.jsx("p",{className:"mx-auto mt-5 max-w-2xl text-base leading-relaxed text-muted-foreground sm:text-lg",children:e("pricing.hero.subtitle")}),s.jsx("p",{className:"mt-4 text-sm leading-relaxed text-muted-foreground",children:e("pricing.hero.note")})]}),s.jsxs("div",{className:"mt-12 grid gap-5 lg:grid-cols-3",children:[ii.map(({key:r,tier:n,icon:t})=>s.jsxs("article",{className:`pricing-option flex min-w-0 flex-col p-6 sm:p-8 ${r==="free"?"pricing-option-featured":""}`,children:[s.jsxs("div",{className:"mb-6 flex items-center justify-between gap-3",children:[s.jsx(t,{size:24,strokeWidth:1.5,className:"text-primary","aria-hidden":"true"}),s.jsx("span",{className:"hp-mono text-[11px] text-muted-foreground",children:e("pricing.design.hosted")})]}),s.jsx("h2",{className:"text-lg font-semibold",children:e(`pricing.design.${r}.title`)}),s.jsxs("div",{className:"mt-4 flex flex-wrap items-baseline gap-x-2 gap-y-1",children:[s.jsx("p",{className:"hp-display text-5xl",children:ce(n.monthlyCents)}),s.jsx("span",{className:"text-xs text-muted-foreground",children:e("pricing.design.serviceMonth")})]}),s.jsxs("p",{className:"hp-mono mt-3 text-sm text-muted-foreground",children:[n.cpu," CPU · ",n.memory]}),s.jsx("p",{className:"mt-5 text-sm leading-relaxed text-muted-foreground",children:e(`pricing.design.${r}.body`)}),s.jsx("div",{className:"mt-auto pt-7",children:s.jsxs(ye,{href:r==="free"?ke.dashboard.signup:"#calculator",variant:r==="free"?"solid":"outline",size:"sm",className:"pricing-button w-full text-sm",children:[e(r==="free"?"pricing.cta.start":"pricing.cta.estimate"),s.jsx(Bs,{size:16,"aria-hidden":"true"})]})})]},r)),s.jsxs("article",{className:"pricing-option flex min-w-0 flex-col p-6 sm:p-8",children:[s.jsxs("div",{className:"mb-6 flex items-center justify-between gap-3",children:[s.jsx(zs,{size:24,strokeWidth:1.5,className:"text-primary","aria-hidden":"true"}),s.jsx("span",{className:"hp-mono text-[11px] text-muted-foreground",children:e("pricing.design.openSource")})]}),s.jsx("h2",{className:"text-lg font-semibold",children:e("pricing.design.selfHost.t
1itle")}),s.jsx("p",{className:"hp-display mt-4 text-4xl leading-tight",children:"Apache-2.0"}),s.jsx("p",{className:"hp-mono mt-3 text-sm text-muted-foreground",children:e("pricing.design.selfHost.license")}),s.jsx("p",{className:"mt-5 text-sm leading-relaxed text-muted-foreground",children:e("pricing.estimator.selfHosted")}),s.jsx("div",{className:"mt-auto pt-7",children:s.jsxs(_,{to:ke.selfHostQuickstart,className:Ys("outline","sm","pricing-button w-full text-sm"),children:[e("pricing.design.selfHost.action"),s.jsx(Ue,{size:16,"aria-hidden":"true"})]})})]})]}),s.jsxs("div",{className:"mt-6 flex flex-col justify-between gap-4 text-xs leading-relaxed text-muted-foreground lg:flex-row",children:[s.jsx("p",{className:"max-w-3xl",children:e("pricing.design.scope",{hours:String(q)})}),s.jsxs("a",{href:xs,target:"_blank",rel:"noopener noreferrer",className:"inline-flex shrink-0 items-center gap-1.5 self-start text-primary underline underline-offset-4",children:[e("pricing.design.source",{version:re}),s.jsx(Ue,{size:13,"aria-hidden":"true"})]})]}),s.jsx("nav",{"aria-label":e("pricing.jump.label"),className:"mt-8 flex flex-wrap items-center justify-center gap-2 border-t border-border/60 pt-6 text-sm",children:si.map(r=>s.jsx("a",{href:r.href,className:"inline-flex min-h-11 items-center rounded-lg border border-border/70 px-4 text-muted-foreground transition-colors hover:border-primary/50 hover:text-primary",children:e(r.labelKey)},r.href))})]})})}function B({kicker:e,title:r,desc:n,foot:t,flush:o=!1}){return s.jsxs("div",{className:o?"max-w-2xl":"mb-8 max-w-2xl",children:[s.jsxs("p",{className:"hp-kicker mb-3 flex items-center gap-3 text-primary",children:[s.jsx("span",{className:"h-px w-8 bg-primary/50"}),e]}),s.jsx("h2",{className:"hp-display text-2xl sm:text-3xl",children:r}),s.jsx("p",{className:"mt-2 text-sm leading-relaxed text-muted-foreground sm:text-base",children:n}),t&&s.jsx("p",{className:"mt-3 text-xs leading-relaxed text-muted-foreground",children:t})]})}function He({tiers:e,caption:r}){const{t:n}=W(),t=e.some(u=>u.storageGb!==void 0),o=e.some(u=>u.backup!==void 0),a=e.some(u=>u.persistent!==void 0),l=[n("pricing.table.tier"),n("pricing.table.monthly"),"CPU",n("pricing.spec.memory")];return t&&l.push(n("pricing.spec.storageFloor")),o&&l.push(n("pricing.spec.backups")),a&&l.push(n("pricing.spec.persistence")),s.jsx($e,{caption:r,className:"pricing-rates",head:l,rows:e.map(u=>{const h=[s.jsxs("span",{className:"font-medium",children:[n(u.labelKey),u.free&&s.jsx("span",{className:"ml-2 rounded-full bg-muted px-2 py-0.5 text-xs font-medium text-muted-foreground",children:n("pricing.tier.freeLabel")})]},"label"),s.jsx("span",{className:"tabular-nums",children:ce(u.monthlyCents)},"monthly"),s.jsx("span",{className:"tabular-nums",children:u.cpu},"cpu"),u.memory];return t&&h.push(`${u.storageGb} GB`),o&&h.push(s.jsx(us,{value:u.backup===!0},"backup")),a&&h.push(s.jsx(us,{value:u.persistent===!0},"persistent")),{key:u.labelKey,cells:h}})})}function us({value:e}){const{t:r}=W();return e?s.jsx(s.Fragment,{children:r("pricing.value.included")}):s.jsxs(s.Fragment,{children:[s.jsx("span",{"aria-hidden":!0,className:"text-muted-foreground",children:"â"}),s.jsx("span",{className:"sr-only",children:r("pricing.value.notIncluded")})]})}function ge({title:e,percent:r,basis:n}){const{t}=W();return s.jsxs("article",{className:"bg-card p-5",children:[s.jsx("h3",{className:"text-sm font-semibold",children:e}),s.jsx("p",{className:"hp-display mt-2 text-2xl text-primary",children:t("pricing.comparison.lowerBy",{percent:String(r)})}),s.jsx("p",{className:"mt-1.5 text-xs leading-relaxed text-muted-foreground",children:n})]})}function li(){return s.jsxs("div",{className:"pricing-page min-h-screen bg-background text-foreground",children:[s.jsx(Ws,{}),s.jsx("main",{id:Xs,children:s.jsx(ri,{})}),s.jsx(qs,{})]})}export{li as P};
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.