PageSourceSearch

https://katalis.ai/_next/static/chunks/0r1_uixmtydak.js

js katalis.ai collected 2026-10-05 12:07:53 UTC 88,658 bytes, 100 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,95163,e=>{e.v({className:"dm_sans_be572740-module__LZGd-W__className",variable:"dm_sans_be572740-module__LZGd-W__variable"})},75617,e=>{e.v({className:"dm_mono_bf2972ab-module__Js-A1a__className",variable:"dm_mono_bf2972ab-module__Js-A1a__variable"})},27176,e=>{e.v({className:"instrument_serif_26afec75-module__ctVwAW__className",variable:"instrument_serif_26afec75-module__ctVwAW__variable"})},6884,e=>{"use strict";var t=e.i(47167),a=e.i(43476),n=e.i(95163);let s={className:n.default.className,style:{fontFamily:"'DM Sans', 'DM Sans Fallback'",fontStyle:"normal"}};null!=n.default.variable&&(s.variable=n.default.variable);var r=e.i(75617);let l={className:r.default.className,style:{fontFamily:"'DM Mono', 'DM Mono Fallback'",fontStyle:"normal"}};null!=r.default.variable&&(l.variable=r.default.variable);var o=e.i(27176);let i={className:o.default.className,style:{fontFamily:"'Instrument Serif', 'Instrument Serif Fallback'",fontWeight:400,fontStyle:"italic"}};null!=o.default.variable&&(i.variable=o.default.variable);var c=e.i(88653),d=e.i(46932),p=e.i(71164),x=e.i(38544),m=e.i(71645);function f(){p.hasReducedMotionListener.current||(0,x.initPrefersReducedMotion)();let[e]=(0,m.useState)(p.prefersReducedMotion.current);return e}let u="#3e92cc",h="#ff6b35",b="#6c5ce7",g="#22d3ee";function y(e,t){let a,{r:n,g:s,b:r}={r:Number.parseInt((a=e.replace("#","")).slice(0,2),16),g:Number.parseInt(a.slice(2,4),16),b:Number.parseInt(a.slice(4,6),16)};return`rgba(${n},${s},${r},${t})`}let v={"--pc-bg":"#ffffff","--pc-surface":"#edf6ff","--pc-surface2":"#ffffff","--pc-border":"#cad1db","--pc-border2":"rgba(10, 36, 99, 0.14)","--pc-text":"#0a2463","--pc-text2":"rgba(10, 36, 99, 0.72)","--pc-text3":"rgba(10, 36, 99, 0.48)","--pc-red":"#e53935"},w={ID:{accent:u,accent2:y(u,.12)},MY:{accent:b,accent2:y(b,.12)},SG:{accent:h,accent2:y(h,.12)},US:{accent:g,accent2:y(g,.14)}},j=[{id:"fashion",label:"Fashion",icon:"👗",bm:{disc:"Discounts 8–18% (voucher-heavy category)",cm1:"CM1 target: 55–70% — fashion margins vary widely",cm2:"CM2 target: 35–50%",cm3:"CM3 target: 15–30%",ebitda:"EBITDA 8–18% for growth-stage fashion brands"}},{id:"beauty",label:"Beauty / Skincare",icon:"✨",bm:{disc:"Discounts 5–15% of gross",cm1:"CM1 target: 65–80% — high-margin category",cm2:"CM2 target: 42–55%",cm3:"CM3 target: 22–35%",ebitda:"EBITDA 12–22% for beauty brands"}},{id:"food",label:"Food & Bev",icon:"🍜",bm:{disc:"Discounts 3–10% — lower in food",cm1:"CM1 target: 45–65% — food COGS are higher",cm2:"CM2 target: 30–48%",cm3:"CM3 target: 12–25%",ebitda:"EBITDA 8–15% for food brands"}},{id:"homeliving",label:"Home Living",icon:"🏠",bm:{disc:"Discounts 5–12% of gross",cm1:"CM1 target: 55–72%",cm2:"CM2 target: 38–52%",cm3:"CM3 target: 18–30%",ebitda:"EBITDA 10–18%"}},{id:"electronics",label:"Electronics",icon:"📱",bm:{disc:"Discounts 2–8% — price-sensitive category",cm1:"CM1 target: 20–45% — thin margins, high volume",cm2:"CM2 target: 15–35%",cm3:"CM3 target: 8–20%",ebitda:"EBITDA 5–12%"}},{id:"mombaby",label:"Mom & Baby",icon:"🍼",bm:{disc:"Discounts 5–12%",cm1:"CM1 target: 60–78% — loyal repeat buyers",cm2:"CM2 target: 40–54%",cm3:"CM3 target: 20–33%",ebitda:"EBITDA 12–20%"}},{id:"health",label:"Health / Wellness",icon:"💊",bm:{disc:"Discounts 5–12%",cm1:"CM1 target: 60–78%",cm2:"CM2 target: 40–54%",cm3:"CM3 target: 20–32%",ebitda:"EBITDA 12–20%"}},{id:"other",label:"Other",icon:"📦",bm:{disc:"Discounts typically 5–15% of gross",cm1:"Healthy CM1: 55–75%",cm2:"Healthy CM2: 38–52%",cm3:"Healthy CM3: 18–32%",ebitda:"EBITDA target: 10–18%"}}],N={ID:{sym:"Rp",locale:"id-ID",accent:"#00a888",accent2:"rgba(0,168,136,0.10)",platforms:[{id:"shopee",name:"Shopee",color:"#ee4d2d",commission:8}
1,{id:"tiktok",name:"TikTok Shop",color:"#010101",commission:5},{id:"tokopedia",name:"Tokopedia",color:"#00AA5B",commission:7},{id:"lazada",name:"Lazada",color:"#F5002C",commission:6},{id:"blibli",name:"Blibli",color:"#0095DA",commission:7},{id:"zalora",name:"Zalora",color:"#1a1a1a",commission:20},{id:"shopify",name:"Shopify D2C",color:"#95BF47",commission:2}],def:"shopee",roasHint:"e.g. 3.5 = Rp3.5 per Rp1 spent"},MY:{sym:"RM",locale:"ms-MY",accent:"#0052cc",accent2:"rgba(0,82,204,0.10)",platforms:[{id:"shopee",name:"Shopee",color:"#ee4d2d",commission:8},{id:"lazada",name:"Lazada",color:"#F5002C",commission:6},{id:"tiktok",name:"TikTok Shop",color:"#010101",commission:5},{id:"zalora",name:"Zalora",color:"#1a1a1a",commission:20},{id:"amazon",name:"Amazon MY",color:"#FF9900",commission:15},{id:"shopify",name:"Shopify D2C",color:"#95BF47",commission:2}],def:"shopee",roasHint:"e.g. 3.5 = RM3.5 per RM1 spent"},SG:{sym:"S$",locale:"en-SG",accent:"#c8102e",accent2:"rgba(200,16,46,0.10)",platforms:[{id:"shopee",name:"Shopee",color:"#ee4d2d",commission:8},{id:"lazada",name:"Lazada",color:"#F5002C",commission:6},{id:"amazon",name:"Amazon SG",color:"#FF9900",commission:15}
1,{id:"tiktok",name:"TikTok Shop",color:"#010101",commission:5},{id:"zalora",name:"Zalora",color:"#1a1a1a",commission:20},{id:"shopify",name:"Shopify D2C",color:"#95BF47",commission:2}],def:"shopee",roasHint:"e.g. 3.5 = S$3.5 per S$1 spent"},US:{sym:"$",locale:"en-US",accent:"#7c3aed",accent2:"rgba(124,58,237,0.10)",platforms:[{id:"amazon",name:"Amazon",color:"#FF9900",commission:15},{id:"shopify",name:"Shopify D2C",color:"#95BF47",commission:2},{id:"tiktok",name:"TikTok Shop",color:"#010101",commission:5},{id:"walmart",name:"Walmart",color:"#0071CE",commission:8},{id:"etsy",name:"Etsy",color:"#F1641E",commission:6.5},{id:"ebay",name:"eBay",color:"#E53238",commission:12}],def:"amazon",roasHint:"e.g. 3.5 = $3.5 per $1 spent"}},k={disc:"Discounts typically 5–15% of gross",cm1:"Healthy CM1: 55–75%",cm2:"Healthy CM2: 38–52%",cm3:"Healthy CM3: 18–32%",ebitda:"EBITDA target: 10–18%"};function C(e){let t={},a={};for(let n of e.platforms)t[n.id]=0,a[n.id]=n.commission;return{revenues:t,commissions:a}}let S={ID:"Indonesia",MY:"Malaysia",SG:"Singapore",US:"United States"},_={beauty:"increase monthly sales by 4x while doubling their ROAS",fashion:"scale GMV 3x in a season while tightening margin on hero SKUs",food:"cut blended CAC by over a third while improving repeat purchase rate",homeliving:"lift AOV with a catalog-led bundle strategy without hurting conversion",electronics:"improve contribution margin after rightsizing ad spend to high-margin SKUs",mombaby:"double repeat orders from the same cohort within 90 days",health:"grow subscribe-and-save revenue without diluting margin",other:"restructure channel mix to recover EBITDA while protecting top-line"},M="restructure costs and channel mix to improve EBITDA without giving up growth";function A(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function $(e,t){let a=A(e);return`<div style="max-width: 600px; margin: 20px auto; background-color: #ffffff; border: 1px solid #e2e8f0; border-radius: 12px; overflow: hidden;"><!-- Header -->
2<div style="background-color: #1d4ed8; color: #ffffff; padding: 24px; text-align: center;"><!-- <img src="YOUR_LOGO_URL" alt="Katalis Logo" style="max-width: 150px; margin-bottom: 10px;"> -->
3<h1 style="font-size: 28px; margin: 0; color: #ffffff;">Your Request is in!</h1>
4</div>
5<!-- Body -->
6<div style="padding: 32px; line-height: 1.7; color: #334155; font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;">
7<h2 style="font-size: 22px; color: #1e293b; margin: 0 0 16px; font-weight: 600;">Hi ${a},</h2>
8<p style="margin: 0 0 16px; font-size: 15px; line-height: 1.7; color: #334155;">Thank you for using the Katalis profit calculator! We have received your submission and are excited to help you grow.</p>
9<!-- This is where the formatted HTML table goes -->
10${t}
11<p style="margin: 16px 0; font-size: 15px; line-height: 1.7; color: #334155;"><strong>What's next?</strong> Our team is now reviewing your information to prepare your free, no-obligation store audit. We will reach out with your personalized results and next steps within 1-2 business days.</p>
12<p style="margin: 0 0 24px; font-size: 15px; line-height: 1.7; color: #334155;">While you wait, feel free to explore our resources to learn more about how we help businesses like yours succeed.</p>
13<!-- Call to Action: table + align=center for Outlook/Gmail -->
14<table role="presentation" cellpadding="0" cellspacing="0" border="0" width="100%" style="margin: 8px 0 32px; border-collapse: collapse;">
15<tr>
16<td align="center" style="padding: 0 8px;">
17<a href="https://zcal.co/michellefno/konsul" target="_blank" rel="noopener" style="display: inline-block; background-color: #2563eb; color: #ffffff !important; padding: 14px 32px; text-decoration: none; border-radius: 8px; font-weight: 700; font-size: 16px; line-height: 1.35; font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; mso-padding-alt: 14px 32px;">Free Consultation</a>
18</td>
19</tr>
20</table>
21<p style="margin: 0 0 16px; font-size: 15px; line-height: 1.7; color: #334155;">Questions? Just reply to this email or <a style="color: #2563eb; text-decoration: underline; font-weight: 500;
21" href="https://api.whatsapp.com/send?phone=6287777286895&amp;text=Hi%20Katalis!%20I%20just%20submitted%20my%20P%26L%20calculator%20and%20I%27d%20love%20to%20see%20my%20results%20and%20book%20a%20free%20consultation." target="_blank" rel="noopener">WhatsApp</a>. We're here to help.</p>
22<p style="margin: 24px 0 0; font-size: 15px; line-height: 1.7; color: #334155;">All the best,<br><strong style="color: #1e293b;">Vinay Kamal</strong></p>
23</div>
24<!-- Footer -->
25<div style="background-color: #f1f5f9; padding: 24px; text-align: center; font-size: 14px; color: #64748b;">
26<p style="margin: 0;">&copy; 2026 Katalis.ai. All rights reserved.</p>
27</div>
28</div>`}function D(e){let t=e.trim();return!!t&&/^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/i.test(t)}function F(e){return window.grecaptcha?.enterprise?new Promise(t=>{window.grecaptcha.enterprise.ready(async()=>{try{let a=await window.grecaptcha.enterprise.execute(e,{action:"profit_calculator_unlock"});t(a||null)}catch{t(null)}})}):Promise.resolve(null)}var I=e.i(47163),E=e.i(22016),T=e.i(72520),B=e.i(83850),R=e.i(75215),P=e.i(67881),z=e.i(89088),O=e.i(58249);let L=({children:e,delay:t=0,className:n})=>z.FEATURE_FLAGS.ENABLE_BLUR_FADE_ANIMATIONS?(0,a.jsx)(B.BlurFade,{delay:t,className:n,children:e}):(0,a.jsx)("div",{className:n,children:e}),G=(0,m.memo)(function(){let e=f();return(0,a.jsxs)("section",{className:"relative overflow-hidden bg-linear-to-b from-[#0a2463] via-[#0a2463] to-[#3e92cc] font-sans antialiased",children:[(0,a.jsx)("div",{className:"pointer-events-none absolute right-[-15%] top-[-18%] h-[min(420px,90vw)] w-[min(420px,90vw)] rounded-full bg-[radial-gradient(circle_at_center,rgba(255,255,255,0.14)_0%,transparent_68%)]","aria-hidden":!0}),(0,a.jsx)("div",{className:"pointer-events-none absolute bottom-[-22%] left-[-12%] h-[min(400px,85vw)] w-[min(400px,85vw)] rounded-full bg-[radial-gradient(circle_at_center,rgba(65,171,255,0.35)_0%,transparent_70%)]","aria-hidden":!0}),(0,a.jsx)("div",{className:"mx-auto w-full max-w-[1440px] px-5 py-8 lg:px-20 lg:py-16",children:(0,a.jsxs)("div",{className:"flex max-w-[820px] flex-col gap-6",children:[(0,a.jsx)(L,{children:(0,a.jsxs)("div",{className:"relative inline-flex items-center",children:[(0,a.jsx)("div",{className:"absolute -inset-[2px] rounded-full",style:{borderRadius:"16777200px",border:"2px solid #EC4899",boxShadow:"0 10px 15px -3px rgba(0, 0, 0, 0.10), 0 4px 6px -4px rgba(0, 0, 0, 0.10)"}}),(0,a.jsxs)("div",{className:"relative inline-flex items-center gap-0 px-4 py-2 text-sm font-bold text-white sm:px-7 sm:py-2",children:[(0,a.jsx)("span",{className:"h-2 w-2 rounded-full bg-linear-to-b from-[#EC4899] to-[#9333EA] animate-pulse-dot"}),(0,a.jsx)("span",{className:"px-4 py-1",children:"E-commerce P&L Calculator"})]})]})}),(0,a.jsx)(L,{delay:.08,children:(0,a.jsxs)("h1",{className:"max-w-[820px] text-[40px] font-semibold leading-[1.15] tracking-[-0.03em] text-white lg:text-[clamp(2.5rem,4.5vw,4.875rem)]",children:["Know your ",(0,a.jsx)("span",{className:"text-[#5dade2]",children:"real"})," margin.",(0,a.jsx)("br",{}),"Before it's too late."]})}),(0,a.jsx)(L,{delay:.12,children:(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsx)("div",{className:"h-1 w-24 rounded-full bg-linear-to-r from-[#ff6b35] to-[#5dade2]"}),(0,a.jsx)("p",{className:"max-w-[720px] text-base leading-7 text-white/80 sm:text-lg",children:"Most brands chase GMV while quietly losing money. This calculator shows your true profitability from gross revenue down to EBITDA — across every platform you sell on."})]})}),(0,a.jsx)(L,{delay:.16,children:(0,a.jsxs)("div",{className:"relative max-sm:mx-auto inline-flex w-fit rounded-full",children:[(0,a.jsx)(P.Button,{asChild:!0,variant:"brandHero",size:"pill-lg",className:"group",onClick:()=>(0,O.trackNavEvent)("cta_click","Book Free Consultation - P&L Calculator Hero"),children:(0,a.jsxs)(E.default,{href:"https://api.whatsapp.com/send?phone=6287777286895&text=Hello%20Katalis%20AI%20team%2C%20I%27m%20interested%20in%20your%20AI%20marketing%20solutions%20and%20would%20like%20to%20know%20how%20they%20can%20work%20for%20my%20brand.",target:"_blank",rel:"noopener noreferrer",children:["Book Free Consultation",(0,a.jsx)("span",{className:"flex h-5 w-5 items-center justify-center rounded-full bg-white/20",children:(0,a.jsx)(T.ArrowRight,{className:"h-4 w-4"})})]})}),e?(0,a.jsx)("span",{className:"pointer-events-none absolute inset-0 rounded-[inherit] ring-1 ring-white/25","aria-hidden":!0}):(0,a.jsx)(R.BorderBeam,{size:100,duration:7,borderWidth:3,colorFrom:"#006bff",colorTo:"#41abff"})]})})]})})]})});var W=e.i(75254);let U=(0,W.default)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);function V({hasData:e,tailReady:t,isUnlocked:n,fmt:s,netRev:r,cm2
28:l,ebitda:o,freeRows:i,lockedRows:c,gateSuccess:d,cm3:p,gName:x,gEmail:f,gWa:u,onGNameChange:h,onGEmailChange:b,onGWaChange:g,onUnlockResults:y,unlockSubmitting:v,showLeadPanel:w,leadFormHidden:j,leadSubText:N,leadSent:k,leadOkText:C,ln:S,le:_,lw:M,onLnChange:A,onLeChange:$,onLwChange:F,onSubmitLead:E}){let[T,B]=(0,m.useState)({}),[R,P]=(0,m.useState)({}),z=(0,m.useCallback)(e=>{B(t=>{if(void 0===t[e])return t;let a={...t};return delete a[e],a})},[]),O=(0,m.useCallback)(e=>{P(t=>{if(void 0===t[e])return t;let a={...t};return delete a[e],a})},[]),L=async()=>{if(v)return;let e=x.trim(),t=f.trim(),a=u.trim(),n={};((!e||e.length<2)&&(n.name="Please enter your name (at least 2 characters)."),t?D(t)||(n.email="Please enter a valid email address."):n.email="Email is required.",a?a.replace(/\s/g,"").length<8&&(n.whatsapp="Please enter your full number with country code (e.g. +62 …)."):n.whatsapp="WhatsApp is required.",Object.keys(n).length>0)?B(n):(B({}),await y())},G=r>0?(o/r*100).toFixed(1):"0.0",W="rounded-[18px] border border-(--pc-border) bg-(--pc-surface) px-4 py-3.5";return(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:(0,I.cn)("mb-3 grid grid-cols-2 gap-2.5 max-[520px]:grid-cols-1",!e&&"hidden"),children:[(0,a.jsxs)("div",{className:W,children:[(0,a.jsx)("div",{className:(0,I.cn)("mb-1.5 font-(family-name:--font-pc-mono) text-[9px] uppercase tracking-[0.08em] text-(--pc-text3)"),children:"Net revenue"}),(0,a.jsx)("div",{className:(0,I.cn)("font-(family-name:--font-pc-mono) text-xl font-medium tracking-tight"),children:s(r)}),(0,a.jsx)("div",{className:"mt-0.5 text-[11px] text-(--pc-text3)",children:"after discounts & refunds"})]}),(0,a.jsxs)("div",{className:W,children:[(0,a.jsx)("div",{className:(0,I.cn)("mb-1.5 font-(family-name:--font-pc-mono) text-[9px] uppercase tracking-[0.08em] text-(--pc-text3)"),children:"CM2 · Operating margin"}),(0,a.jsx)("div",{className:(0,I.cn)("font-(family-name:--font-pc-mono) text-xl font-medium tracking-tight",l>=0?"text-(--pc-accent)":"text-(--pc-red)"),children:s(l)}),(0,a.jsx)("div",{className:"mt-0.5 text-[11px] text-(--pc-text3)",children:l>=0?"looking healthy":"negative — check costs"})]}),t?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:W,children:[(0,a.jsx)("div",{className:(0,I.cn)("mb-1.5 font-(family-name:--font-pc-mono) text-[9px] uppercase tracking-[0.08em] text-(--pc-text3)"),children:"EBITDA"}),(0,a.jsx)("div",{className:(0,I.cn)("font-(family-name:--font-pc-mono) text-xl font-medium tracking-tight",n?o>=0?"text-(--pc-accent)":"text-(--pc-red)":"select-none blur-xs text-(--pc-text2)"),children:s(o)}),(0,a.jsx)("div",{className:"mt-0.5 text-[11px] text-(--pc-text3)",children:n?o>=0?"profitable ✓":"loss this month":"unlock below"})]}),(0,a.jsxs)("div",{className:W,children:[(0,a.jsx)("div",{className:(0,I.cn)("mb-1.5 font-(family-name:--font-pc-mono) text-[9px] uppercase tracking-[0.08em] text-(--pc-text3)"),children:"EBITDA margin"}),(0,a.jsx)("div",{className:(0,I.cn)("font-(family-name:--font-pc-mono) text-xl font-medium tracking-tight",n?(r>0?o/r*100:0)>=0?"text-(--pc-accent)":"text-(--pc-red)":"select-none blur-xs text-(--pc-text2)"),children:`${G}%`}),(0,a.jsx)("div",{className:"mt-0.5 text-[11px] text-(--pc-text3)",children:"% of net revenue"})]})]}):null]}),(0,a.jsxs)("div",{className:(0,I.cn)("mb-3 rounded-[18px] border border-(--pc-border) bg-(--pc-surface) px-[22px] py-5"),children:[(0,a.jsx)("div",{className:(0,I.cn)("mb-4 font-(family-name:--font-pc-mono) text-[9px] uppercase tracking-widest text-(--pc-text3)"),children:"P&L waterfall — where your revenue goes"}),(0,a.jsx)("div",{className:"flex flex-col",children:e?(0,a.jsxs)(a.Fragment,{children:[i,t&&n?c:null,t&&!n?(0,a.jsxs)("div",{className:(0,I.cn)("relative isolate mt-2 overflow-hidden rounded-[14px]","ring-1 ring-(--pc-border2)/90 bg-(--pc-surface2)/30"),children:[(0,a.jsx)("div",{className:(0,I.cn)("flex flex-col select-none transform:translateZ(0)","pointer-events-none scale-[0.99]","blur-[10px]"),"aria-hidden":!0,children:c}),(0,a.jsx)("div",{className:(0,I.cn)("pointer-events-none absolute inset-0","bg-linear-to-b from-transparent via-(--pc-surface)/40 to-(--pc-surface)/90")})]}):null]}):(0,a.jsxs)("div",{className:(0,I.cn)("px-4 py-12 text-center text-[13px] leading-relaxed text-(--pc-text3)","[&_strong]:mb-1.5 [&_strong]:block [&_strong]:text-[15px] [&_strong]:text-(--pc-text2)"),children:[(0,a.jsx)("strong",{children:"Your P&L will appear here"}),"Select your category and platforms above, then fill in your numbers."]})})]}),e&&t&&!n?(0,a.jsxs)("div",{className:"mb-3",children:[(0,a.jsxs)("div",{className:"my-3.5 mb-3 flex items-center gap-2.5",children:[(0,a.jsx)("div",{className:"h-px flex-1 bg-(--pc-border2)"}),(0,a.jsx)("span",{className:(0,I.cn)("whitespace-nowrap font-(family-name:--font-pc-mono) text-[9px] uppercase tracking-[0.08em] text-(--pc-text3)"),children:"🔒 your results are ready"}),(0,a.jsx)("div",{className:"h-px flex-1 bg-(--pc-border2)"})]}),(0,a.jsxs)("div",{className:(0,I.cn)("rounded-[18px] bg-(--pc-text) px-5 py-[18px]"),children:[(0,a.jsxs)("div",{className:"mb-3 flex items-center gap-3",children:[(0,a.jsx)("div",{className:(0,I.cn)("flex h-[34px] w-[34px] shrink-0 items-center justify-center rounded-[9px] bg-white/10 text-base"),children:"📊"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:(0,I.cn)("mb-0.5 text-base leading-snug text-white"),children:"Your marketing margin & EBITDA are ready"}),(0,a.jsx)("div",{className:"text-[11px] leading-snug text-white/45",children:"Enter your details to unlock and get a free store audit + 5% off Katalis services."})]})]}),(0,a.jsx)("div",{className:(0,I.cn)("mb-3 overflow-hidden rounded-xl bg-white/6"),"aria-hidden":!0,
28children:(0,a.jsxs)("div",{className:(0,I.cn)("flex flex-col gap-2 px-3 py-3 select-none","pointer-events-none blur-md"),children:[(0,a.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,a.jsx)("span",{className:(0,I.cn)("font-(family-name:--font-pc-mono) text-[11px] text-white/50"),children:"CM3 · Marketing margin"}),(0,a.jsx)("span",{className:(0,I.cn)("font-(family-name:--font-pc-mono) text-xs font-medium tracking-wide text-white/80"),children:s(p)})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,a.jsx)("span",{className:(0,I.cn)("font-(family-name:--font-pc-mono) text-[11px] text-white/50"),children:"EBITDA"}),(0,a.jsx)("span",{className:(0,I.cn)("font-(family-name:--font-pc-mono) text-xs font-medium tracking-wide text-white/80"),children:s(o)})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,a.jsx)("span",{className:(0,I.cn)("font-(family-name:--font-pc-mono) text-[11px] text-white/50"),children:"EBITDA margin"}),(0,a.jsxs)("span",{className:(0,I.cn)("font-(family-name:--font-pc-mono) text-xs font-medium tracking-wide text-white/80"),children:[G,"%"]})]})]})}),d?(0,a.jsx)("div",{className:"py-1.5 text-center text-xs text-(--pc-accent)",children:"✓ Done! Our team will reach out within 24 hours."}):(0,a.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("input",{className:(0,I.cn)("w-full rounded-xl border bg-white/[0.07] px-2.5 py-2 text-xs text-white outline-none transition-colors","[font-family:var(--font-pc-sans),system-ui,sans-serif]","placeholder:text-white/25 focus:border-(--pc-accent) focus:bg-white/10",v&&"pointer-events-none opacity-60",T.name?"border-red-400/55":"border-white/15"),type:"text",placeholder:"Your name",value:x,disabled:v,autoComplete:"name","aria-invalid":!!T.name||void 0,"aria-describedby":T.name?"pc-gate-name-err":void 0,onChange:e=>{h(e.target.value),z("name")}}),T.name?(0,a.jsx)("p",{id:"pc-gate-name-err",className:"mt-1 text-xs text-red-400/90",role:"alert",children:T.name}):null]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("input",{className:(0,I.cn)("w-full rounded-xl border bg-white/[0.07] px-2.5 py-2 text-xs text-white outline-none transition-colors","[font-family:var(--font-pc-sans),system-ui,sans-serif]","placeholder:text-white/25 focus:border-(--pc-accent) focus:bg-white/10",v&&"pointer-events-none opacity-60",T.email?"border-red-400/55":"border-white/15"),type:"email",placeholder:"Email address",value:f,disabled:v,autoComplete:"email","aria-invalid":!!T.email||void 0,"aria-describedby":T.email?"pc-gate-email-err":void 0,onChange:e=>{b(e.target.value),z("email")}}),T.email?(0,a.jsx)("p",{id:"pc-gate-email-err",className:"mt-1 text-xs text-red-400/90",role:"alert",children:T.email}):null]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("input",{className:(0,I.cn)("w-full rounded-xl border bg-white/[0.07] px-2.5 py-2 text-xs text-white outline-none transition-colors","[font-family:var(--font-pc-sans),system-ui,sans-serif]","placeholder:text-white/25 focus:border-(--pc-accent) focus:bg-white/10",v&&"pointer-events-none opacity-60",T.whatsapp?"border-red-400/55":"border-white/15"),type:"tel",placeholder:"WhatsApp (with country code)",value:u,disabled:v,autoComplete:"tel","aria-invalid":!!T.whatsapp||void 0,"aria-describedby":T.whatsapp?"pc-gate-wa-err":void 0,onChange:e=>{g(e.target.value),z("whatsapp")}}),T.whatsapp?(0,a.jsx)("p",{id:"pc-gate-wa-err",className:"mt-1 text-xs text-red-400/90",role:"alert",children:T.whatsapp}):null]}),(0,a.jsx)("button",{type:"button",className:(0,I.cn)("mt-0.5 inline-flex w-full cursor-pointer items-center justify-center gap-2 rounded-xl border-0 bg-(--pc-accent) py-2.5 text-[13px] font-semibold text-white transition-all","[font-family:var(--font-pc-sans),system-ui,sans-serif] hover:brightness-110","disabled:cursor-not-allowed disabled:opacity-80"),onClick:()=>void L(),disabled:v,"aria-busy":v,children:v?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(U,{className:"size-4 shrink-0 animate-spin","aria-hidden":!0}),"Sending…"]}):"Unlock my results + claim free audit →"})]})]})]}):null,w?(0,a.jsxs)("div",{className:(0,I.cn)("mb-3 rounded-[18px] bg-(--pc-text) px-[22px] py-[22px]"),children:[(0,a.jsx)("div",{className:(0,I.cn)("mb-1 font-(family-name:--font-pc-serif) text-[19px] italic text-white"),children:"Want a full PDF margin report?"}),(0,a.jsx)("div",{className:"mb-3.5 text-xs leading-relaxed text-white/50",children:N}),j?(0,a.jsx)("div",{className:"mt-2 text-center text-xs text-(--pc-accent)",children:C}):(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"mb-1.5",children:[(0,a.jsx)("input",{className:(0,I.cn)("w-full rounded-xl border bg-white/8 px-3 py-2.5 text-[13px] text-white outline-none transition-colors","[font-family:var(--font-pc-sans),system-ui,sans-serif]","placeholder:text-white/30 focus:border-(--pc-accent)",R.name?"border-red-400/55":"border-white/15"),type:"text",placeholder:"Your name",value:S,autoComplete:"name","aria-invalid":!!R.name||void 0,"aria-describedby":R.name?"pc-lead-name-err":void 0,onChange:e=>{A(e.target.value),O("name")}}),R.name?(0,a.jsx)("p",{id:"pc-lead-name-err",className:"mt-1 text-xs text-red-400/90",role:"alert",children:R.name}):null]}),(0,a.jsxs)("div",{className:"mb-1.5",children:[(0,a.jsx)("input",{className:(0,I.cn)("w-full rounded-xl border bg-white/8 px-3 py-2.5 text-[13px] text-white outline-none transition-colors","[font-family:var(--font-pc-sans),system-ui,sans-serif]","placeholder:text-white/30 focus:border-(--pc-accent)",R.email?"border-red-400/55":"border-white/15"),type:"email",placeholder:"Email address",value:_,autoComplete:"email","aria-invalid":!!R.email||void 0,"aria-describedby":R.email?"pc-lead-email-err":void 0,onChange:e=>{$(e.target.value),O("email")}}),R.email?(0,a.jsx)("p",{id:"pc-lead-email-err",className:"mt-1 text-xs text-red-400/90",role:"alert",children:R.email}):null]}),(0,a.jsxs)("div",{className:"mb-1.5",children:[(0,a.jsx)("input",{className:(0,I.cn)("w-full rounded-xl border bg-white/8 px-3 py-2.5 text-[13px] text-white outline-none transition-colors","[font-family:var(--font-pc-sans),system-ui,sans-serif]","placeholder:text-white/30 focus:border-(--pc-accent)",R.whatsapp?"border-red-400/55":"border-white/15"),type:"tel",placeholder:"WhatsApp (with country code)",value:M,autoComplete:"tel","aria-invalid":!!R.whatsapp||void 0,"aria-describedby":R.whatsapp?"pc-lead-wa-err":void 0,onChange:e=>{F(e.target.value),O("whatsapp")}}),R.whatsapp?(0,a.jsx)("p",{id:"pc-lead-wa-err",className:"mt-1 text-xs text-red-400/90",role:"alert",children:R.whatsapp}):null]}),(0,a.jsx)("button",{type:"button",className:(0,I.cn)("mt-0.5 w-full cursor-pointer rounded-xl border-0 bg-(--pc-accent) py-3 text-sm font-semibold text-white transition-all","[font-family:var(--font-pc-sans),system-ui,sans-serif] hover:brightness-110 disabled:cursor-not-allowed disabled:opacity-50"),onClick:()=>
28{if(k)return;let e=S.trim(),t=_.trim(),a=M.trim(),n={};((!e||e.length<2)&&(n.name="Please enter your name (at least 2 characters)."),t?D(t)||(n.email="Please enter a valid email address."):n.email="Email is required.",a?a.replace(/\s/g,"").length<8&&(n.whatsapp="Please enter your full number with country code (e.g. +62 …)."):n.whatsapp="WhatsApp is required.",Object.keys(n).length>0)?P(n):(P({}),E())},disabled:k,children:k?"Sent ✓":"Send me the report"}),k?(0,a.jsx)("div",{className:"mt-2 text-center text-xs text-(--pc-accent)",children:C}):null]})]}):null]})}var H=e.i(78745),H=H;let Y=[{title:"Category",hint:"Brand vertical"},{title:"Platforms",hint:"Channels & revenue"},{title:"Revenue",hint:"Discounts & refunds"},{title:"CM1",hint:"Product cost"},{title:"CM2",hint:"Operations"},{title:"CM3",hint:"Marketing"},{title:"EBITDA",hint:"Fixed costs"},{title:"Result",hint:"P&L waterfall"}],K=Y.length,q=(0,m.memo)(function({activeStep:e,onStepChange:t,isStepComplete:n}){let s=Y.length-1;return(0,a.jsxs)("nav",{className:(0,I.cn)("sticky top-[88px] self-start rounded-[18px] border border-(--pc-border) bg-(--pc-bg)","px-4 py-5 mt-8 lg:mt-0 pl-4 shadow-[0_8px_28px_rgba(10,36,99,0.05)]","max-[900px]:static max-[900px]:px-3.5 max-[900px]:py-3.5"),"aria-label":"Calculator steps",children:[(0,a.jsx)("p",{className:(0,I.cn)("mb-[18px] ml-1 font-(family-name:--font-pc-mono) text-[9px] uppercase tracking-[0.14em]","text-(--pc-text3) max-[900px]:mb-2.5"),children:"Your P&L path"}),(0,a.jsx)("ol",{className:(0,I.cn)("relative m-0 list-none p-0 max-[900px]:flex max-[900px]:flex-row max-[900px]:gap-1.5 max-[900px]:overflow-x-auto max-[900px]:pb-1.5"),children:Y.map((r,l)=>{let o=n(l),i=e===l,c=!i&&!o,d=l<s;return(0,a.jsxs)("li",{className:"relative m-0 max-[900px]:shrink-0 p-0",children:[d?(0,a.jsx)("span",{className:(0,I.cn)("pointer-events-none absolute z-0 max-[900px]:hidden","left-[24px]","-translate-x-1/2","top-13.5 w-px h-4 rounded-full sm:w-[2px]","bottom-0","bg-(--pc-accent)/25","transition-colors duration-300 ease-out motion-reduce:transition-none"),"aria-hidden":!0}):null,(0,a.jsxs)("button",{type:"button",className:(0,I.cn)("relative z-1 mb-0 flex w-full cursor-pointer items-start gap-3.5 rounded-xl border-0 py-3.5 pl-2 pr-3 text-left","font-inherit text-inherit","transition-[background-color,box-shadow] duration-300 ease-out motion-reduce:transition-none","max-[900px]:min-w-[76px] max-[900px]:flex-col max-[900px]:items-center max-[900px]:gap-2 max-[900px]:p-2.5 max-[900px]:text-center"),onClick:()=>t(l),"aria-current":i?"step":void 0,children:[(0,a.jsx)("span",{className:(0,I.cn)("relative z-2 flex w-8 shrink-0 flex-col items-center max-[900px]:w-auto max-[900px]:flex-row"),children:(0,a.jsx)("span",{className:(0,I.cn)("flex h-8 w-8 shrink-0 items-center justify-center rounded-full border-2 font-(family-name:--font-pc-mono) text-xs font-semibold","shadow-[0_0_0_2px_var(--pc-bg)]","transition-[border-color,background-color,color,box-shadow,transform] duration-300 ease-out motion-reduce:transition-none",i&&"scale-[1.04] motion-reduce:scale-100",o&&"border-(--pc-accent) bg-(--pc-accent) text-white",i&&!o&&"border-(--pc-accent) bg-(--pc-accent) text-white",c&&"border-(--pc-border) bg-(--pc-bg) text-(--pc-text3) hover:bg-(--pc-accent2)/60"),children:o?(0,a.jsx)(H.default,{className:"h-4 w-4",strokeWidth:2.5,"aria-hidden":!0}):(0,a.jsx)("span",{className:"tabular-nums",children:l+1})})}),(0,a.jsxs)("span",{className:(0,I.cn)("flex min-w-0 flex-col gap-0.5 pt-0.5 max-[900px]:items-center max-[900px]:pt-0"),children:[(0,a.jsx)("span",{className:(0,I.cn)("text-sm font-semibold leading-tight max-[900px]:text-[11px]","transition-colors duration-300 ease-out motion-reduce:transition-none",i&&"text-(--pc-accent)",o&&!i&&"text-(--pc-text)",c&&"text-(--pc-text3)"),children:r.title}),(0,a.jsx)("span",{className:(0,I.cn)("text-[11px] leading-snug max-[900px]:hidden","transition-colors duration-300 ease-out motion-reduce:transition-none",i&&"font-medium text-(--pc-accent)",o&&!i&&"text-(--pc-text3)",c&&"text-(--pc-text3)"),children:r.hint})]})]})]},r.title)})})]})});function Z({currentCategory:e,onCategoryChange:t}){return(0,a.jsxs)("div",{className:"m-0 max-w-none border-0 bg-transparent p-0",children:[(0,a.jsx)("div",{className:(0,I.cn)("mb-3 font-(family-name:--font-pc-mono) text-[9px] uppercase tracking-widest text-(--pc-text3)"),children:"What category is your brand?"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-[7px]",children:j.map(n=>(0,a.jsxs)("button",{type:"button",className:(0,I.cn)("flex cursor-pointer items-center gap-[7px] rounded-xl border border-(--pc-border2) bg-(--pc-surface2) px-3 py-1.5","text-[13px] text-(--pc-text2) transition-all [font-family:var(--font-pc-sans),system-ui,sans-serif]","hover:border-(--pc-accent) hover:text-(--pc-accent)",e===n.id&&"border-(--pc-accent) bg-(--pc-accent2) font-medium text-(--pc-accent)"),onClick:()=>t(n.id),children:[(0,a.jsx)("span",{className:"text-[15px] leading-none",children:n.icon}),n.label]},n.id))})]})}function X(e){if(0===e)return"";let t=Math.trunc(Math.abs(e));return Number.isFinite(t)?Math.min(t,Number.MAX_SAFE_INTEGER).toString().replace(/\B(?=(\d{3})+(?!\d))/g,"."):""}function J({value:e,onValueChange:t,min:n=0,max:s=Number.MAX_SAFE_INTEGER,className:r,...l}){let o=(0,m.useRef)(null),i=X(e);return(0,a.jsx)("input",{ref:o,...l,type:"text",inputMode:"numeric",autoComplete:"off",className:r,value:i,onChange:e=>{t(Math.min(s,Math.max(n,function(e){let t=e.replace(/\D/g,"");if(""===t)return 0;let a=Number(t);return(!Number.isFinite(a)||a>Number.MAX_SAFE_INTEGER)&&(a=Number.MAX_SAFE_INTEGER),Math.max(0,Math.trunc(a))}(e.target.value)))),queueMicrotask(()=>{let e=o.current;if(e&&document.activeElement===e){let t=e.value.length;e.setSelectionRange(t,t)}})}})}let Q="w-full rounded-xl border border-(--pc-border) bg-(--pc-surface2) py-2 pl-8 pr-8 font-(family-name:--font-pc-mono) text-xs text-(--pc-text) outline-none transition-all placeholder:text-(--pc-text3) focus:border-(--pc-accent) focus:bg-white focus:shadow-[0_0_0_3px_var(--pc-accent2)]";function ee({benchmarkCm1:e,sym:t,cogsU:n,units:s,freight:r,onCogsUChange:l,onUnitsChange:o,onFreightChange:i}){return(0,a.jsxs)("div",{className:"mb-0 rounded-none border-0 bg-transparent shadow-none",children:[(0,a.jsxs)("div",{className:"flex items-start justify-between gap-3 px-[18px] pt-0",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:(0,I.cn)("mb-0.5 font-(family-name:--font-pc-mono) text-[9px] uppercase tracking-widest text-(--pc-text3)"),children:"CM1"}),(0,a.jsx)("div",{className:"text-[15px] font-medium text-(--pc-text)",children:"Product cost"})]}),(0,a.jsx)("span",{className:(0,I.cn)("mt-0.5 whitespace-nowrap rounded-full border border-(--pc-border2) bg-(--pc-surface2) px-2.5 py-0.5","font-(family-name:--font-pc-mono) text-[9px] text-(--pc-text2)"),children:"gross profit"})]}),(0,a.jsxs)("div",{className:"px-[18px] pb-4 pt-3.5",children:[(0,a.jsxs)("div",{className:(0,I.cn)("mb-3.5 rounded-br-md rounded-tr-md border-l-2 border-(--pc-border2) bg-(--pc-surface2) px-3 py-2.5","text-[11px] leading-relaxed text-(--pc-text2) [&_strong]:font-medium [&_strong]:text-(--pc-text)"),children:[(0,a.jsx)("strong",{children:"CM1 (Contribution Margin 1)"})," = Net Revenue minus the direct cost of making your product — how profitable each unit is before distribution or marketing costs.",(0,a.jsx)("br",{}),(0,a.jsx)("span",{className:(0,I.cn)("mt-1 inline-flex items-center gap-1 rounded px-[7px] py-0.5 font-(family-name:--font-pc-mono) text-[10px] text-(--pc-accent)","bg-(--pc-accent2)"),children:e})]}),(0,a.jsxs)("div",{className:(0,I.cn)("mb-2.5 rounded-xl border border-dashed border-(--pc-border2) bg-(--pc-surface2) px-2.5 py-2.5","text-[11px] leading-relaxed text-(--pc-text2) [&_strong]:font-medium [&_strong]:text-(--pc-text)"),children:[(0,a.jsx)("strong",{children:"Selling multiple SKUs?"})," Use your"," ",(0,a.jsx)("strong",{children:"hero product"}),", or a blended average: total COGS ÷ total units sold."]}),(0,a.jsxs)("div",{className:"mb-2.5 last:mb-0",children:[(0,a.jsxs)("label",{className:(0,I.cn)("mb-1 flex justify-between text-[11px] text-(--pc-text2)"),children:["Average COGS per unit"," ",(0,a.jsx)("span",{className:(0,I.cn)("font-(family-name:--font-pc-mono) text-[10px] text-(--pc-text3)"),children:"materials + packaging + production"})]}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("span",{className:(0,I.cn)("pointer-events-none absolute left-2 top-1/2 -translate-y-1/2 font-(family-name:--font-pc-mono) text-[11px] text-(--pc-text3)"),children:t}),(0,a.jsx)(J,{className:Q,placeholder:"0",min:0,value:n,onValueChange:l})]})]}),(0,a.jsxs)("div",{className:"mb-2.5 last:mb-0",children:[(0,a.jsxs)("label",{className:(0,I.cn)("mb-1 flex justify-between text-[11px] text-(--pc-text2)"),children:["Total units sold this month"," ",(0,a.jsx)("span",{className:(0,I.cn)("font-(family-name:--font-pc-mono) text-[10px] text-(--pc-text3)"),children:"all platforms combined"})]}),(0,a.jsx)("div",{className:"relative",children:(0,a.jsx)(J,{className:"w-full rounded-xl border border-(--pc-border) bg-(--pc-surface2) py-2 pl-2.5 pr-8 font-(family-name:--font-pc-mono) text-xs text-(--pc-text) outline-none transition-all placeholder:text-(--pc-text3) focus:border-(--pc-accent) focus:bg-white focus:shadow-[0_0_0_3px_var(--pc-accent2)]",placeholder:"0",min:0,value:s,onValueChange:o})})]}),(0,a.jsxs)("div",{className:"mb-2.5 last:mb-0",children:[(0,a.jsxs)("label",{className:(0,I.cn)("mb-1 flex justify-between text-[11px] text-(--pc-text2)"),children:["Inbound freight & import tax"," ",(0,a.jsx)("span",{className:(0,I.cn)("font-(family-name:--font-pc-mono) text-[10px] text-(--pc-text3)"),children:"factory to warehouse delivery"})]}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("span",{className:(0,I.cn)("pointer-events-none absolute left-2 top-1/2 -translate-y-1/2 font-(family-name:--font-pc-mono) text-[11px] text-(--pc-text3)"),children:t}),(0,a.jsx)(J,{className:Q,placeholder:"0",min:0,value:r,onValueChange:i})]})]})]})]})}let et="w-full rounded-xl border border-(--pc-border) bg-(--pc-surface2) py-2 pl-8 pr-8 font-(family-name:--font-pc-mono) text-xs text-(--pc-text) outline-none transition-all placeholder:text-(--pc-text3) focus:border-(--pc-accent) focus:bg-white focus:shadow-[0_0_0_3px_var(--pc-accent2)] read-only:cursor-not-allowed read-only:bg-(--pc-surface2) read-only:text-(--pc-text3)";function ea({benchmarkCm2:e,sym:t,platFee:n,affPct:s,fulfill:r,onAffPctChange:l,onFulfillChange:o}){return(0,a.jsxs)("div",{className:"mb-0 rounded-none border-0 bg-transparent shadow-none",children:[(0,a.jsxs)("div",{className:"flex items-start justify-between gap-3 px-[18px] pt-0",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:(0,I.cn)("mb-0.5 font-(family-name:--font-pc-mono) text-[9px] uppercase tracking-widest text-(--pc-text3)"),children:"CM2"}),(0,a.jsx)("div",{className:"text-[15px] font-medium text-(--pc-text)",children:"Operations cost"})]}),(0,a.jsx)("span",{className:(0,I.cn)("mt-0.5 whitespace-nowrap rounded-full border border-(--pc-border2) bg-(--pc-surface2) px-2.5 py-0.5","font-(family-name:--font-pc-mono) text-[9px] text-(--pc-text2)"),children:"operating margin"})]}),(0,a.jsxs)("div",{className:"px-[18px] pb-4 pt-3.5",children:[(0,a.jsxs)("div",{className:(0,I.cn)("mb-3.5 rounded-br-md rounded-tr-md border-l-2 border-(--pc-border2) bg-(--pc-surface2) px-3 py-2.5","text-[11px] leading-relaxed text-(--pc-text2) [&_strong]:font-medium [&_strong]:text-(--pc-text)"),children:[(0,a.jsx)("strong",{children:"CM2"})," = CM1 minus the cost of selling on platforms."," ",(0,a.jsx)("strong",{children:"If CM2 is negative, you're losing money before spending a cent on ads."}),(0,a.jsx)("br",{}),(0,a.jsx)("span",{className:(0,I.cn)("mt-1 inline-flex items-center gap-1 rounded px-[7px] py-0.5 font-(family-name:--font-pc-mono) text-[10px] text-(--pc-accent)","bg-(--pc-accent2)"),children:e})]}),(0,a.jsxs)("div",{className:"mb-2.5 last:mb-0",children:[(0,a.jsxs)("label",{className:(0,I.cn)("mb-1 flex justify-between text-[11px] text-(--pc-text2)"),children:["Platform fees"," ",(0,a.jsx)("span",{className:(0,I.cn)("font-(family-name:--font-pc-mono) text-[10px] text-(--pc-text3)"),children:"auto-calculated from platform (step 2)"})]}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("span",{className:(0,I.cn)("pointer-events-none absolute left-2 top-1/2 -translate-y-1/2 font-(family-name:--font-pc-mono) text-[11px] text-(--pc-text3)"),children:t}),(0,a.jsx)("input",{className:et,readOnly:!0,value:X(Math.round(n)),placeholder:"0"})]})]}),(0,a.jsxs)("div",{className:"mb-2.5 last:mb-0",children:[(0,a.jsxs)("label",{className:(0,I.cn)("mb-1 flex justify-between text-[11px] text-(--pc-text2)"),children:["Affiliate commissions"," ",(0,a.jsx)("span",{className:(0,I.cn)("font-(family-name:--font-pc-mono) text-[10px] text-(--pc-text3)"),children:"% paid to creators / KOLs"})]}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("input",{className:(0,I.cn)("w-full rounded-xl border border-(--pc-border) bg-(--pc-surface2) py-2 pl-2.5 pr-8 font-(family-name:--font-pc-mono) text-xs text-(--pc-text) outline-none transition-all placeholder:text-(--pc-text3) focus:border-(--pc-accent) focus:bg-white focus:shadow-[0_0_0_3px_var(--pc-accent2)]","pr-26"),type:"number",placeholder:"0",min:0,max:100,value:s||"",onChange:e=>l(Math.max(0,Number(e.target.value)||0))}),(0,a.jsx)("span",{className:(0,I.cn)("pointer-events-none absolute right-2 top-1/2 -translate-y-1/2 font-(family-name:--font-pc-mono) text-[10px] text-(--pc-text3) whitespace-nowrap"),children:"% of net rev"})]})]}),(0,a.jsxs)("div",{className:"mb-2.5 last:mb-0",children:[(0,a.jsxs)("label",{className:(0,I.cn)("mb-1 flex justify-between text-[11px] text-(--pc-text2)"),children:["Fulfillment & shipping"," ",(0,a.jsx)("span",{className:(0,I.cn)("font-(family-name:--font-pc-mono) text-[10px] text-(--pc-text3)"),children:"packaging + last-mile courier"})]}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("span",{className:(0,I.cn)("pointer-events-none absolute left-2 top-1/2 -translate-y-1/2 font-(family-name:--font-pc-mono) text-[11px] text-(--pc-text3)"),children:t}),(0,a.jsx)(J,{className:et,placeholder:"0",min:0,value:r,onValueChange:o})]})]})]})]})}let en="w-full rounded-xl border border-(--pc-border) bg-(--pc-surface2) py-2 pl-8 pr-8 font-(family-name:--font-pc-mono) text-xs text-(--pc-text) outline-none transition-all placeholder:text-(--pc-text3) focus:border-(--pc-accent) focus:bg-white focus:shadow-[0_0_0_3px_var(--pc-accent2)]";function es({benchmarkCm3:e,sym:t,roasHint:n,adMode:s,onAdModeChange:r,ads:l,adSales:o,roasVal:i,adSpend:c,fmt:d,creative:p,samples:x,onAdsChange:m,onAdSalesChange:f,onRoasValChange:u,onCreativeChange:h,onSamplesChange:b}){return(0,a.jsxs)("div",{className:"mb-0 rounded-none border-0 bg-transparent shadow-none",children:[(0,a.jsxs)("div",{className:"flex items-start justify-between gap-3 px-[18px] pt-0",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:(0,I.cn)("mb-0.5 font-(family-name:--font-pc-mono) text-[9px] uppercase tracking-widest text-(--pc-text3)"),children:"CM3"}),(0,a.jsx)("div",{className:"text-[15px] font-medium text-(--pc-text)",children:"Marketing cost"})]}),(0,a.jsx)("span",{className:(0,I.cn)("mt-0.5 whitespace-nowrap rounded-full border border-(--pc-border2) bg-(--pc-surface2) px-2.5 py-0.5","font-(family-name:--font-pc-mono) text-[9px] text-(--pc-text2)"),children:"marketing margin"})]}),(0,a.jsxs)("div",{className:"px-[18px] pb-4 pt-3.5",children:[(0,a.jsxs)("div",{className:(0,I.cn)("mb-3.5 rounded-br-md rounded-tr-md border-l-2 border-(--pc-border2) bg-(--pc-surface2) px-3 py-2.5","text-[11px] leading-relaxed text-(--pc-text2) [&_strong]:font-medium [&_strong]:text-(--pc-text)"),children:[(0,a.jsx)("strong",{children:"CM3"})," = CM2 minus all marketing spend. A positive CM3 means your marketing is profitable. Negative means ads cost more than they generate.",(0,a.jsx)("br",{}),(0,a.jsx)("span",{className:(0,I.cn)("mt-1 inline-flex items-center gap-1 rounded px-[7px] py-0.5 font-(family-name:--font-pc-mono) text-[10px] text-(--pc-accent)","bg-(--pc-accent2)"),children:e})]}),(0,a.jsxs)("div",{className:"mb-3 flex
28 gap-1.5",children:[(0,a.jsx)("button",{type:"button",className:(0,I.cn)("flex-1 cursor-pointer rounded-xl border border-(--pc-border) bg-transparent py-1.5 text-center text-xs text-(--pc-text2) transition-all","[font-family:var(--font-pc-sans),system-ui,sans-serif]","spend"===s&&"border-(--pc-text) bg-(--pc-text) text-white"),onClick:()=>r("spend"),children:"I know my ad spend"}),(0,a.jsx)("button",{type:"button",className:(0,I.cn)("flex-1 cursor-pointer rounded-xl border border-(--pc-border) bg-transparent py-1.5 text-center text-xs text-(--pc-text2) transition-all","[font-family:var(--font-pc-sans),system-ui,sans-serif]","roas"===s&&"border-(--pc-text) bg-(--pc-text) text-white"),onClick:()=>r("roas"),children:"I know my ROAS"})]}),"spend"===s?(0,a.jsxs)("div",{className:"mb-2.5 last:mb-0",children:[(0,a.jsxs)("label",{className:(0,I.cn)("mb-1 flex justify-between text-[11px] text-(--pc-text2)"),children:["Total paid ads spend"," ",(0,a.jsx)("span",{className:(0,I.cn)("font-(family-name:--font-pc-mono) text-[10px] text-(--pc-text3)"),children:"all platforms combined"})]}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("span",{className:(0,I.cn)("pointer-events-none absolute left-2 top-1/2 -translate-y-1/2 font-(family-name:--font-pc-mono) text-[11px] text-(--pc-text3)"),children:t}),(0,a.jsx)(J,{className:en,placeholder:"0",min:0,value:l,onValueChange:m})]})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"mb-2.5 last:mb-0",children:[(0,a.jsx)("label",{className:(0,I.cn)("mb-1 flex justify-between text-[11px] text-(--pc-text2)"),children:"Ad-attributed sales"}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("span",{className:(0,I.cn)("pointer-events-none absolute left-2 top-1/2 -translate-y-1/2 font-(family-name:--font-pc-mono) text-[11px] text-(--pc-text3)"),children:t}),(0,a.jsx)(J,{className:en,placeholder:"0",min:0,value:o,onValueChange:f})]})]}),(0,a.jsxs)("div",{className:"mb-2.5 last:mb-0",children:[(0,a.jsxs)("label",{className:(0,I.cn)("mb-1 flex justify-between text-[11px] text-(--pc-text2)"),children:["Your ROAS"," ",(0,a.jsx)("span",{className:(0,I.cn)("font-(family-name:--font-pc-mono) text-[10px] text-(--pc-text3)"),children:n})]}),(0,a.jsx)("div",{className:"relative",children:(0,a.jsx)("input",{className:"w-full rounded-xl border border-(--pc-border) bg-(--pc-surface2) py-2 pl-2.5 pr-8 font-(family-name:--font-pc-mono) text-xs text-(--pc-text) outline-none transition-all placeholder:text-(--pc-text3) focus:border-(--pc-accent) focus:bg-white focus:shadow-[0_0_0_3px_var(--pc-accent2)]",type:"number",placeholder:"3.0",step:.1,min:.
281,value:i||"",onChange:e=>u(Math.max(.1,Number(e.target.value)||.1))})})]}),(0,a.jsxs)("div",{className:(0,I.cn)("mb-2.5 rounded-xl border border-(--pc-accent)/25 bg-(--pc-accent2) px-3 py-2.5"),children:[(0,a.jsx)("div",{className:(0,I.cn)("mb-1 font-(family-name:--font-pc-mono) text-[9px] uppercase tracking-[0.08em] text-(--pc-accent)"),children:"Implied ad spend"}),(0,a.jsx)("div",{className:(0,I.cn)("font-(family-name:--font-pc-mono) text-base font-medium text-(--pc-accent)"),children:d(c)})]})]}),(0,a.jsxs)("div",{className:"mb-2.5 last:mb-0",children:[(0,a.jsxs)("label",{className:(0,I.cn)("mb-1 flex justify-between text-[11px] text-(--pc-text2)"),children:["Content & creative production"," ",(0,a.jsx)("span",{className:(0,I.cn)("font-(family-name:--font-pc-mono) text-[10px] text-(--pc-text3)"),children:"videos, photoshoots, design"})]}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("span",{className:(0,I.cn)("pointer-events-none absolute left-2 top-1/2 -translate-y-1/2 font-(family-name:--font-pc-mono) text-[11px] text-(--pc-text3)"),children:t}),(0,a.jsx)(J,{className:en,placeholder:"0",min:0,value:p,onValueChange:h})]})]}),(0,a.jsxs)("div",{className:"mb-2.5 last:mb-0",children:[(0,a.jsxs)("label",{className:(0,I.cn)("mb-1 flex justify-between text-[11px] text-(--pc-text2)"),children:["Affiliate samples"," ",(0,a.jsx)("span",{className:(0,I.cn)("font-(family-name:--font-pc-mono) text-[10px] text-(--pc-text3)"),children:"product COGS sent to creators"})]}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("span",{className:(0,I.cn)("pointer-events-none absolute left-2 top-1/2 -translate-y-1/2 font-(family-name:--font-pc-mono) text-[11px] text-(--pc-text3)"),children:t}),(0,a.jsx)(J,{className:en,placeholder:"0",min:0,value:x,onValueChange:b})]})]})]})]})}let er="w-full rounded-xl border border-(--pc-border) bg-(--pc-surface2) py-2 pl-8 pr-8 font-(family-name:--font-pc-mono) text-xs text-(--pc-text) outline-none transition-all placeholder:text-(--pc-text3) focus:border-(--pc-accent) focus:bg-white focus:shadow-[0_0_0_3px_var(--pc-accent2)]";function el({benchmarkEbitda:e,sym:t,salaries:n,rent:s,mgmt:r,subs:l,other:o,onSalariesChange:i,onRentChange:c,onMgmtChange:d,onSubsChange:p,onOtherChange:x}){return(0,a.jsxs)("div",{className:"mb-0 rounded-none border-0 bg-transparent shadow-none",children:[(0,a.jsxs)("div",{className:"flex items-start justify-between gap-3 px-[18px] pt-0",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:(0,I.cn)("mb-0.5 font-(family-name:--font-pc-mono) text-[9px] uppercase tracking-widest text-(--pc-text3)"),children:"EBITDA"}),(0,a.jsx)("div",{className:"text-[15px] font-medium text-(--pc-text)",children:"Fixed costs"})]}),(0,a.jsx)("span",{className:(0,I.cn)("mt-0.5 whitespace-nowrap rounded-full border border-(--pc-border2) bg-(--pc-surface2) px-2.5 py-0.5","font-(family-name:--font-pc-mono) text-[9px] text-(--pc-text2)"),children:"your real profit"})]}),(0,a.jsxs)("div",{className:"px-[18px] pb-4 pt-3.5",children:[(0,a.jsxs)("div",{className:(0,I.cn)("mb-3.5 rounded-br-md rounded-tr-md border-l-2 border-(--pc-border2) bg-(--pc-surface2) px-3 py-2.5","text-[11px] leading-relaxed text-(--pc-text2) [&_strong]:font-medium [&_strong]:text-(--pc-text)"),children:[(0,a.jsx)("strong",{children:"EBITDA"})," = CM3 minus all fixed monthly costs. These exist whether you sell 1 unit or 10,000 — which is why"," ",(0,a.jsx)("strong",{children:"scale is the most powerful lever in e-commerce."}),(0,a.jsx)("br",{}),(0,a.jsx)("span",{className:(0,I.cn)("mt-1 inline-flex items-center gap-1 rounded px-[7px] py-0.5 font-(family-name:--font-pc-mono) text-[10px] text-(--pc-accent)","bg-(--pc-accent2)"),children:e})]}),(0,a.jsxs)("div",{className:"mb-2.5 last:mb-0",children:[(0,a.jsxs)("label",{className:(0,I.cn)("mb-1 flex justify-between text-[11px] text-(--pc-text2)"),children:["Salaries"," ",(0,a.jsx)("span",{className:(0,I.cn)("font-(family-name:--font-pc-mono) text-[10px] text-(--pc-text3)"),children:"brand's allocated headcount share"})]}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("span",{className:(0,I.cn)("pointer-events-none absolute left-2 top-1/2 -translate-y-1/2 font-(family-name:--font-pc-mono) text-[11px] text-(--pc-text3)"),children:t}),(0,a.jsx)(J,{className:er,placeholder:"0",min:0,value:n,onValueChange:i})]})]}),(0,a.jsxs)("div",{className:"mb-2.5 last:mb-0",children:[(0,a.jsxs)("label",{className:(0,I.cn)("mb-1 flex justify-between text-[11px] text-(--pc-text2)"),children:["Rent & utilities"," ",(0,a.jsx)("span",{className:(0,I.cn)("font-(family-name:--font-pc-mono) text-[10px] text-(--pc-text3)"),children:"office / warehouse allocated share"})]}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("span",{className:(0,I.cn)("pointer-events-none absolute left-2 top-1/2 -translate-y-1/2 font-(family-name:--font-pc-mono) text-[11px] text-(--pc-text3)"),children:t}),(0,a.jsx)(J,{className:er,placeholder:"0",min:0,value:s,onValueChange:c})]})]}),(0,a.jsxs)("div",{className:"mb-2.5 last:mb-0",children:[(0,a.jsxs)("label",{className:(0,I.cn)("mb-1 flex justify-between text-[11px] text-(--pc-text2)"),children:["Agency / management fee"," ",(0,a.jsx)("span",{className:(0,I.cn)("font-(family-name:--font-pc-mono) text-[10px] text-(--pc-text3)"),children:"Katalis or other performance agency"})]}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("span",{className:(0,I.cn)("pointer-events-none absolute left-2 top-1/2 -translate-y-1/2 font-(family-name:--font-pc-mono) text-[11px] text-(--pc-text3)"),children:t}),(0,a.jsx)(J,{className:er,placeholder:"0",min:0,value:r,onValueChange:d})]})]}),(0,a.jsxs)("div",{className:"mb-2.5 last:mb-0",children:[(0,a.jsxs)("label",{className:(0,I.cn)("mb-1 flex justify-between text-[11px] text-(--pc-text2)"),children:["Subscriptions & tools"," ",(0,a.jsx)("span",{className:(0,I.cn)("font-(family-name:--font-pc-mono) text-[10px] text-(--pc-text3)"),children:"Shopify, software, SaaS tools"})]}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("span",{className:(0,I.cn)("pointer-events-none absolute left-2 top-1/2 -translate-y-1/2 font-(family-name:--font-pc-mono) text-[11px] text-(--pc-text3)"),children:t}),(0,a.jsx)(J,{className:er,placeholder:"0",min:0,value:l,onValueChange:p})]})]}),(0,a.jsxs)("div",{className:"mb-2.5 last:mb-0",children:[(0,a.jsx)("label",{className:(0,I.cn)("mb-1 flex justify-between text-[11px] text-(--pc-text2)"),children:"Other fixed costs"}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("span",{className:(0,I.cn)("pointer-events-none absolute left-2 top-1/2 -translate-y-1/2 font-(family-name:--font-pc-mono) text-[11px] text-(--pc-text3)"),children:t}),(0,a.jsx)(J,{className:er,placeholder:"0",min:0,value:o,onValueChange:x})]})]})]})]})}let eo=(0,W.default)("earth",[["path",{d:"M21.54 15H17a2 2 0 0 0-2 2v4.54",key:"1djwo0"}],["path",{d:"M7 3.34V5a3 3 0 0 0 3 3a2 2 0 0 1 2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.1.9-2 2-2h3.17",key:"1tzkfa"}],["path",{d:"M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05",key:"14pb5j"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]),ei=[{code:"ID",flag:"🇮🇩",name:"Indonesia",currency:"IDR"},{code:"MY",flag:"🇲🇾",name:"Malaysia",currency:"MYR"},{code:"SG",flag:"🇸🇬",name:"Singapore",currency:"SGD"},{code:"US",flag:"🌐",name:"Global",currency:"USD"}],ec=(0,m.memo)(function({currentMarket:e,onMarketChange:t}){return(0,a.jsx)("div",{className:"border-b border-[#e6eefc] bg-white",children:(0,a.jsxs)("div",{className:"mx-auto flex w-full max-w-[1120px] flex-col gap-4 px-5 py-4 sm:flex-row sm:items-center sm:justify-between sm:gap-6 lg:px-8",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("span",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-xl bg-[#edf6ff] text-[#3e92cc] ring-1 ring-[#e6eefc]",children:(0,a.jsx)(eo,{className:"h-5 w-5",strokeWidth:2,"aria-hidden":!0})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("p",{className:"text-[11px] font-semibold uppercase tracking-[0.16em] text-[#0a2463]/55",children:"Market"}),(0,a.jsx)("h2",{id:"market-bar-heading",className:"mt-0.5 text-sm font-medium text-[#0a2463]/50",children:"Choose country or region"})]})]}),(0,a.jsx)("div",{className:"flex gap-1 overflow-x-auto pb-0.5 [-ms-overflow-style:none] [scrollbar-width:none] sm:flex-wrap sm:overflow-visible sm:pb-0 [&::-webkit-scrollbar]:hidden",children:(0,a.jsx)("div",{role:"radiogroup","aria-labelledby":"market-bar-heading",className:"flex min-w-min overflow-hidden rounded-xl border border-[#d4deef] bg-[#edf6ff] p-0.5 shadow-[inset_0_1px_2px_rgba(10,36,99,0.06)]",children:ei.map(({code:n,flag:s,name:r,currency:l},o)=>{let i=e===n,c=0===o,d=o===ei.length-1;return(0,a.jsxs)("button",{type:"button",role:"radio","aria-checked":i,className:(0,I.cn)("relative flex min-w-max shrink-0 cursor-pointer items-center gap-2.5 px-4 py-2 text-left transition-all duration-200 sm:min-w-max sm:flex-1","focus-visible:z-10 focus-visible:outline-2 focus-visible:-outline-offset-2px focus-visible:outline-[#3e92cc]",c&&"rounded-l-[10px]",d&&"rounded-r-[10px]",!c&&!d&&"rounded-none",!c&&(i?"border-l border-white/25":"border-l border-[#0a2463]/10"),i?"z-1 bg-(--pc-accent) text-white shadow-md ring-1 ring-black/6":"text-[#0a2463]/85 hover:bg-white/90 hover:text-[#0a2463]"),onClick:()=>t(n),children:[(0,a.jsx)("span",{className:"text-lg leading-none","aria-hidden":!0,
28children:s}),(0,a.jsxs)("span",{className:"flex min-w-max flex-col gap-0.5",children:[(0,a.jsx)("span",{className:(0,I.cn)("whitespace-nowrap text-sm font-semibold leading-tight",i?"text-white":"text-[#0a2463]"),children:r}),(0,a.jsx)("span",{className:(0,I.cn)("whitespace-nowrap text-[10px] font-semibold uppercase tracking-[0.12em]",i?"text-white/75":"text-[#0a2463]/45"),children:l})]})]},n)})})})]})})});function ed({market:e,selected:t,onTogglePlat:n,platRevenues:s,onPlatRevenueChange:r,platCommissions:l,onPlatCommissionChange:o,platFees:i,totalRev:c,totalFee:d,fmt:p}){return(0,a.jsxs)("div",{className:"m-0 max-w-none border-0 bg-transparent p-0",children:[(0,a.jsx)("div",{className:(0,I.cn)("mb-3 font-(family-name:--font-pc-mono) text-[9px] uppercase tracking-widest text-(--pc-text3)"),children:"Select the platforms you sell on"}),(0,a.jsx)("div",{className:"mb-3.5 flex flex-wrap gap-[7px]",children:e.platforms.map(e=>{let s=t.includes(e.id);return(0,a.jsxs)("button",{type:"button",className:(0,I.cn)("flex cursor-pointer items-center gap-[7px] rounded-xl border border-(--pc-border2) bg-(--pc-surface2) px-3 py-1.5","text-[13px] text-(--pc-text2) transition-all [font-family:var(--font-pc-sans),system-ui,sans-serif]","hover:border-(--pc-accent) hover:text-(--pc-accent)",s&&"border-(--pc-accent) bg-(--pc-accent2) text-(--pc-accent)"),onClick:()=>n(e.id),children:[s&&(0,a.jsx)("span",{className:(0,I.cn)("flex h-3.5 w-3.5 shrink-0 items-center justify-center rounded-full bg-(--pc-accent) text-[9px] font-semibold text-white opacity-0 transition-opacity",s&&"opacity-100"),"aria-hidden":!0,children:"✓"}),e.name]},e.id)})}),(0,a.jsx)("div",{className:(0,I.cn)(t.length>0?"block":"hidden"),children:(0,a.jsx)("div",{className:"overflow-x-auto",children:(0,a.jsxs)("div",{className:"min-w-[520px]",children:[(0,a.jsxs)("div",{className:"mb-1.5 grid grid-cols-[140px_1fr_100px_160px] items-center gap-2",children:[(0,a.jsx)("span",{className:(0,I.cn)("font-(family-name:--font-pc-mono) text-[9px] uppercase tracking-[0.06em] text-(--pc-text3)"),children:"Platform"}),(0,a.jsx)("span",{className:(0,I.cn)("font-(family-name:--font-pc-mono) text-[9px] uppercase tracking-[0.06em] text-(--pc-text3)"),children:"Gross revenue (this month)"}),(0,a.jsx)("span",{className:(0,I.cn)("font-(family-name:--font-pc-mono) text-[9px] uppercase tracking-[0.06em] text-(--pc-text3)"),children:"Commission %"}),(0,a.jsx)("span",{className:(0,I.cn)("font-(family-name:--font-pc-mono) text-[9px] uppercase tracking-[0.06em] text-(--pc-text3)"),children:"Platform fee"})]}),(0,a.jsx)("div",{children:t.map(t=>{let n=e.platforms.find(e=>e.id===t);if(!n)return null;let c=void 0!==l[t]?l[t]:n.commission,d=i[t]??0;return(0,a.jsxs)("div",{className:"mb-2 grid grid-cols-[140px_1fr_100px_160px] items-center gap-2",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1.5 text-[13px] font-medium text-(--pc-text)",children:[(0,a.jsx)("div",{className:"h-2 w-2 shrink-0 rounded-full",style:{background:n.color}}),n.name]}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("span",{className:(0,I.cn)("pointer-events-none absolute left-2 top-1/2 -translate-y-1/2 font-(family-name:--font-pc-mono) text-[11px] text-(--pc-text3)"),children:e.sym}),(0,a.jsx)(J,{className:"w-full rounded-xl border border-(--pc-border) bg-(--pc-surface2) py-2 pl-9 pr-2.5 font-(family-name:--font-pc-mono) text-xs text-(--pc-text) outline-none transition-all placeholder:text-(--pc-text3) focus:border-(--pc-accent) focus:bg-white focus:shadow-[0_0_0_3px_var(--pc-accent2)]",placeholder:"0",min:0,value:s[t]??0,onValueChange:e=>r(t,e)})]}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("input",{className:"w-full rounded-xl border border-(--pc-border) bg-(--pc-surface2) py-2 pl-2.5 pr-7 font-(family-name:--font-pc-mono) text-xs text-(--pc-text) outline-none transition-all focus:border-(--pc-accent) focus:bg-white",type:"number",placeholder:String(n.commission),min:0,max:100,step:.1,value:c,onChange:e=>{o(t,Math.max(0,Number(e.target.value)||0))}}),(0,a.jsx)("span",{className:(0,I.cn)("pointer-events-none absolute right-2 top-1/2 -translate-y-1/2 text-[11px] text-(--pc-text3)"),children:"%"})]}),(0,a.jsxs)("div",{className:(0,I.cn)("text-left font-(family-name:--font-pc-mono) text-xs text-(--pc-text3)"),children:["- ",p(d)]})]},t)})}),(0,a.jsxs)("div",{className:(0,I.cn)("mt-2.5 grid grid-cols-[140px_1fr_100px_160px] items-center gap-2 border-t border-(--pc-border) py-2.5 sm:pt-2.5 "),children:[(0,a.jsx)("div",{className:"text-xs font-medium text-(--pc-text2)",children:"Total"}),(0,a.jsx)("div",{className:(0,I.cn)("font-(family-name:--font-pc-mono) text-[13px] font-medium text-(--pc-text)"),children:p(c)}),(0,a.jsx)("div",{}),(0,a.jsxs)("div",{className:(0,I.cn)("font-(family-name:--font-pc-mono) text-xs text-(--pc-red)"),children:["− ",p(d)]})]})]})})})]})}let ep="w-full rounded-xl border border-(--pc-border) bg-(--pc-surface2) py-2 pl-8 pr-8 font-(family-name:--font-pc-mono) text-xs text-(--pc-text) outline-none transition-all placeholder:text-(--pc-text3) focus:border-(--pc-accent) focus:bg-white focus:shadow-[0_0_0_3px_var(--pc-accent2)]";function ex({benchmarkDisc:e,sym:t,discounts:n,refunds:s,onDiscountsChange:r,onRefundsChange:l}){return(0,a.jsxs)("div",{className:"mb-0 rounded-none border-0 bg-transparent shadow-none",children:[(0,a.jsxs)("div",{className:"flex items-start justify-between gap-3 px-[18px] pt-0",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:(0,I.cn)("mb-0.5 font-(family-name:--font-pc-mono) text-[9px] uppercase tracking-widest text-(--pc-text3)"),children:"Revenue"}),(0,a.jsx)("div",{className:"text-[15px] font-medium text-(--pc-text)",children:"Deductions from gross"})]}),(0,a.jsx)("span",{className:(0,I.cn)("mt-0.5 whitespace-nowrap rounded-full border border-(--pc-border2) bg-(--pc-surface2) px-2.5 py-0.5","font-(family-name:--font-pc-mono) text-[9px] text-(--pc-text2)"),children:"net revenue"})]}),(0,a.jsxs)("div",{className:"px-[18px] pb-4 pt-3.5",children:[(0,a.jsxs)("div",{className:(0,I.cn)("mb-3.5 rounded-br-md rounded-tr-md border-l-2 border-(--pc-border2) bg-(--pc-surface2) px-3 py-2.5","text-[11px] leading-relaxed text-(--pc-text2) [&_strong]:font-medium [&_strong]:text-(--pc-text)"),children:[(0,a.jsx)("strong",{children:"Gross revenue"})," is pulled from your platform selections above. Deduct vouchers and refunds to arrive at"," ",(0,a.jsx)("strong",{children:"Net Revenue"}),"— the real starting point of your P&L.",(0,a.jsx)("br",{}),(0,a.jsx)("span",{className:(0,I.cn)("mt-1 inline-flex items-center gap-1 rounded px-[7px] py-0.5 font-(family-name:--font-pc-mono) text-[10px] text-(--pc-accent)","bg-(--pc-accent2)"),children:e})]}),(0,a.jsxs)("div",{className:"mb-2.5 last:mb-0",children:[(0,a.jsxs)("label",{className:(0,I.cn)("mb-1 flex justify-between text-[11px] text-(--pc-text2)"),children:["Discounts & vouchers"," ",(0,a.jsx)("span",{className:(0,I.cn)("font-(family-name:--font-pc-mono) text-[10px] text-(--pc-text3)"),children:"platform 
28+ seller vouchers combined"})]}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("span",{className:(0,I.cn)("pointer-events-none absolute left-2 top-1/2 -translate-y-1/2 font-(family-name:--font-pc-mono) text-[11px] text-(--pc-text3)"),children:t}),(0,a.jsx)(J,{className:ep,placeholder:"0",min:0,value:n,onValueChange:r})]})]}),(0,a.jsxs)("div",{className:"mb-2.5 last:mb-0",children:[(0,a.jsxs)("label",{className:(0,I.cn)("mb-1 flex justify-between text-[11px] text-(--pc-text2)"),children:["Refunds"," ",(0,a.jsx)("span",{className:(0,I.cn)("font-(family-name:--font-pc-mono) text-[10px] text-(--pc-text3)"),children:"settled/approved refunds this month"})]}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("span",{className:(0,I.cn)("pointer-events-none absolute left-2 top-1/2 -translate-y-1/2 font-(family-name:--font-pc-mono) text-[11px] text-(--pc-text3)"),children:t}),(0,a.jsx)(J,{className:ep,placeholder:"0",min:0,value:s,onValueChange:l})]})]})]})]})}function em({label:e,value:t,variant:n,showPct:s,isDeduction:r,labelClassName:l,valueClassName:o,maxV:i,base:c,percentBase:d,fmt:p,showBar:x=!0}){var m,f;let u,h,b="subtotal"===n,g="ebitda"===n,y="Gross revenue"===e,v=Math.abs(t);if(!b&&!g&&0===v)return null;let w=t>=0,{barColor:j,valueColor:N}=(m=!!r,u="subtotal"===n,{barColor:(h="ebitda"===n)?w?"var(--pc-accent)":"var(--pc-red)":u?w?"color-mix(in srgb, var(--pc-accent) 30%, transparent)":"rgba(229,57,53,0.3)":m?"rgba(229,57,53,0.2)":w?"color-mix(in srgb, var(--pc-accent) 25%, transparent)":"rgba(229,57,53,0.2)",valueColor:h||u?w?"var(--pc-accent)":"var(--pc-red)":m?"var(--pc-red)":w?"var(--pc-accent)":"var(--pc-red)"}),k=Math.min(100,v/i*100).toFixed(1);return(0,a.jsxs)("div",{className:(0,I.cn)("grid grid-cols-[130px_1fr] sm:grid-cols-[130px_1fr_160px] items-center gap-2 py-1",b&&"pt-3","new-section"===n&&"mt-4 border-t border-(--pc-border) pt-3",g&&"-mx-2.5 my-1.5 rounded-xl bg-(--pc-surface2) px-2.5 py-2"),children:[(0,a.jsx)("div",{className:(0,I.cn)("pr-1 text-left sm:text-right text-[11px] leading-snug text-(--pc-text2)",b&&"text-[13px] font-medium text-(--pc-text)",g&&"text-[13px] font-semibold text-(--pc-text)",l),children:e}),x?(0,a.jsx)("div",{className:"hidden sm:block relative h-[18px] overflow-hidden rounded bg-(--pc-surface2)",children:(0,a.jsx)("div",{className:"absolute top-0 h-full rounded transition-[width] duration-500 ease-[cubic-bezier(0.22,1,0.36,1)]",style:{width:100===d?"100%":`${k}%`,background:y?"color-mix(in srgb, var(--pc-accent) 50%, transparent)":j}})}):(0,a.jsx)("div",{}),(0,a.jsxs)("div",{className:(0,I.cn)("text-right",g&&"mt-4"),children:[(0,a.jsxs)("div",{className:(0,I.cn)("font-(family-name:--font-pc-mono) text-xs font-medium",b&&"text-sm",g&&"text-md font-semibold tracking-wide",o),style:{color:N},children:[r?"- ":"",t>0?"":"-"," ",p(v)]}),s?(0,a.jsx)("div",{className:(0,I.cn)("font-(family-name:--font-pc-mono) text-[10px] text-(--pc-text3)"),children:!(f=d??
28c)||Number.isNaN(t/f)?"":100===f?"100%":`${(t/f*100).toFixed(1)}%`}):null]})]})}function ef(e,t,a,n,s){let r=e;return a<=t||(r=Math.max(r,t),a===s&&t===n&&(r=Math.max(r,s))),r}e.s(["default",0,function(){let e=f(),[n,r]=(0,m.useState)("ID"),[o,p]=(0,m.useState)(null),[x,u]=(0,m.useState)(["shopee"]),[h,b]=(0,m.useState)(()=>{let{revenues:e}=C(N.ID);return e}),[g,y]=(0,m.useState)(()=>{let{commissions:e}=C(N.ID);return e}),[E,T]=(0,m.useState)(0),[B,R]=(0,m.useState)(0),[P,z]=(0,m.useState)(0),[O,L]=(0,m.useState)(0),[W,U]=(0,m.useState)(0),[H,Y]=(0,m.useState)(0),[X,J]=(0,m.useState)(0),[Q,et]=(0,m.useState)("spend"),[en,er]=(0,m.useState)(0),[eo,ei]=(0,m.useState)(0),[ep,eu]=(0,m.useState)(3),[eh,eb]=(0,m.useState)(0),[eg,ey]=(0,m.useState)(0),[ev,ew]=(0,m.useState)(0),[ej,eN]=(0,m.useState)(0),[ek,eC]=(0,m.useState)(0),[eS,e_]=(0,m.useState)(0),[eM,eA]=(0,m.useState)(0),[e$,eD]=(0,m.useState)(!1),[eF,eI]=(0,m.useState)(!1),[eE,eT]=(0,m.useState)(!1),[eB,eR]=(0,m.useState)(!1),[eP,ez]=(0,m.useState)(!1),[eO,eL]=(0,m.useState)("Get a detailed breakdown sent to you plus a free 30-min review with our team. We work with 50+ brands across SEA."),[eG,eW]=(0,m.useState)(!1),[eU,eV]=(0,m.useState)("✓ Done! Our team will reach out within 24 hours."),[eH,eY]=(0,m.useState)(""),[eK,eq]=(0,m.useState)(""),[eZ,eX]=(0,m.useState)(""),[eJ,eQ]=(0,m.useState)(""),[e0,e1]=(0,m.useState)(""),[e2,e5]=(0,m.useState)(""),[e3,e8]=(0,m.useState)(0),[e4,e6]=(0,m.useState)(-1),[e9,e7]=(0,m.useState)({0:!0}),te=(0,m.useCallback)(e=>{e7(t=>t[e]?t:{...t,[e]:!0})},[]),tt=N[n],ta=j.find(e=>e.id===o),tn=ta?.bm??k,ts=(0,m.useCallback)(e=>{let t=tt.sym,a=tt.locale,n=Math.abs(e);return`${e<0?"−":""}${t} ${n.toLocaleString(a)}`},[tt.sym,tt.locale]),tr=(0,m.useMemo)(()=>{let e=0,t=0,a={};for(let n of x){let s=tt.platforms.find(e=>e.id===n);if(!s)continue;let r=h[n]??0,l=r*(void 0!==g[n]?g[n]:s.commission)/100;e+=r,t+=l,a[n]=l}return{totalRev:e,totalFee:t,fees:a}},[x,h,g,tt.platforms]),{gross:tl,netRev:to,cogs:ti,cm1:tc,platFee:td,affFee:tp,cm2:tx,adSpend:tm,cm3:tf,ebitda:tu}=(0,m.useMemo)(()=>{let{totalRev:e,totalFee:t}=tr,a=Math.max(0,e-E-B),n=P*O,s=a-n-W,r=a*H/100,l=s-t-r-X,o=0,i=l-(o="spend"===Q?en:eo/Math.max(.1,ep||1))-eh-eg,c=ev+ej+ek+eS+eM;return{gross:e,netRev:a,cogs:n,cm1:s,platFee:t,affFee:r,cm2:l,adSpend:o,cm3:i,opEx:c,ebitda:i-c,freight:W}},[tr,E,B,P,O,W,H,X,Q,en,eo,ep,eh,eg,ev,ej,ek,eS,eM]),th=tl>0,tb=tl||1,tg=tl||1,ty=null!==o&&x.length>0&&tl>0,tv=K-1,tw=K-2,tj=(0,m.useCallback)(e=>0===e?null!==o:1===e?x.length>0&&tl>0:!!ty&&(e===tv?e4>=tv:!(e<2)&&!(e>tw)&&!!e9[e]&&(2===e||(3===e?O>0||P>0||W>0:4===e||(5===e?"spend"===Q?en>0||eh>0||eg>0:eo>0||eh>0||eg>0:6===e&&(ev>0||ej>0||ek>0||eS>0||eM>0||e4>=tv))))),[o,x.length,tl,ty,e4,tv,tw,e9,O,P,W,Q,en,eo,eh,eg,ev,ej,ek,eS,eM]),tN=(0,m.useMemo)(()=>0===e3?null===o:1===e3&&(0===x.length||tl<=0),[e3,o,x.length,tl]),tk=(0,m.useCallback)(e=>{e8(t=>(e>t&&e6(a=>ef(a,t,e,tw,tv)),e)),te(e)},[tw,tv,te]),tC=(0,m.useCallback)(e=>{let t=N[e],{revenues:a,commissions:n}=C(t);r(e),u([t.def]),b(a),y(n)},[]),tS=async()=>{let e=eH.trim(),a=eK.trim(),s=eZ.trim();if(!e||e.length<2)return void window.alert("Please enter your name (at least 2 characters).");if(!a)return void window.alert("Please enter your email.");if(!D(a))return void window.alert("Please enter a valid email address.");if(!s)return void window.alert("Please enter your WhatsApp number.");if(s.replace(/\s/g,"").length<8)return void window.alert("Please enter your full WhatsApp number with country code.");eI(!0);try{let r="https://api.katalis.ai".replace(/\/$/,"");if(!r)return void window.alert("This form is not configured (missing API URL). Please contact us directly.");let l="",i="",c="6LcGyrssAAAAAEYSMyhFNYi3WkIaG0hjN_DZjFD5";{let e=await F(c);if(!e)return void window.alert("Security check could not run. Please refresh the page and try again.");l=e;let t=await F(c);if(!t)return void window.alert("Security check could not complete. Please refresh the page and try again.");i=t}let d=function(e){var a,n,s,r;let l,o,i,{fmt:c,contact:d,currentMarket:p,currentCategory:x,market:m,selected:f,platRevenues:u,platCommissions:h,platTotals:b,discounts:g,refunds:y,cogsU:v,units:w,freight:N,affPct:k,fulfill:C,adMode:D,ads:F,adSales:I,roasVal:E,creative:T,samples:B,salaries:R,rent:P,mgmt:z,subs:O,other:L,gross:G,netRev:W,cm1:U,cm2:V,cm3:H,ebitda:Y,adSpend:K}=e,q=v*w,Z=b.totalFee,X=j.find(e=>e.id===x)?.label??x??"—",{name:J,email:Q,whatsapp:ee}=d,et=(a=m.sym,n=m.locale,l=Y<0?"−":"",(o=Math.abs(Y))>=1e9?`${l}${a}
28 ${(o/1e9).toLocaleString(n,{maximumFractionDigits:1,minimumFractionDigits:0})}B`:o>=1e6?`${l}${a} ${(o/1e6).toLocaleString(n,{maximumFractionDigits:1,minimumFractionDigits:0})}M`:o>=1e5?`${l}${a} ${(o/1e3).toLocaleString(n,{maximumFractionDigits:1,minimumFractionDigits:0})}K`:`${l}${a} ${o.toLocaleString(n)}`),{label:ea,maxAmount:en}=function(e){let t=[{label:"ad spend",amount:e.adSpend},{label:"product COGS",amount:e.cogs},{label:"freight & inbound",amount:e.freight},{label:"platform fees",amount:e.platFee},{label:"affiliate commissions",amount:e.affFee},{label:"fulfillment / ops",amount:e.fulfill},{label:"creative & content",amount:e.creative},{label:"affiliate samples",amount:e.samples},{label:"salaries",amount:e.salaries},{label:"rent & utilities",amount:e.rent},{label:"agency / management",amount:e.mgmt},{label:"subscriptions / software",amount:e.subs},{label:"other fixed costs",amount:e.other}],a=t[0];for(let e of t)e.amount>a.amount&&(a=e);return{label:a.label,maxAmount:a.amount}}({cogs:q,freight:N,platFee:Z,affFee:W*k/100,fulfill:C,adSpend:K,creative:T,samples:B,salaries:R,rent:P,mgmt:z,subs:O,other:L}),es=Y<0?en>0?`Your largest expense is ${ea} — that's where we usually find the fastest wins before you scale spend or add channels.`:"From the inputs so far, no single cost line dominates — we can help you sanity-check allocations and benchmarks next.":Y>0?"Your store is profitable and you're starting from a good place. But there's still room to grow and improve your margins — that's the next lever we help brands pull.":"You're around break-even on EBITDA — there's room to tighten costs and improve margins.",er=(i=f.map(e=>m.platforms.find(t=>t.id===e)?.name).filter(e=>!!e),0===i.length?"—":1===i.length?i[0]:2===i.length?`${i[0]} and ${i[1]}`:`${i.slice(0,-1).join(", ")}, and ${i[i.length-1]}`),el=x?_[x]??M:M,eo=(s=e.bookingLink,s?.trim()?s.trim():t.default.env.NEXT_PUBLIC_PROFIT_CALC_BOOKING_LINK?.trim()||"https://cal.com"),ei=(r=e.senderName,r?.trim()?r.trim():t.default.env.NEXT_PUBLIC_PROFIT_CALC_SENDER_NAME?.trim()||"Vinay Kamal"),ec=`<div style="font-family:system-ui,-apple-system,sans-serif;line-height:1.7;color:#334155;font-size:15px;">
29<p style="margin:0 0 14px;">Based on what you entered, your EBITDA is ${A(et)}. ${A(es)}</p>
30<p style="margin:0 0 14px;">You're in ${A(X)}, selling on ${A(er)}. Teams in similar situations have seen brands ${A(el)}. We'd love to explore what that could look like for you in a short session.</p>
31<hr style="border:none;border-top:1px solid #e2e8f0;margin:18px 0;" />
32</div>`,ed=f.map(e=>{let t=m.platforms.find(t=>t.id===e);if(!t)return null;let a=u[e]??0,n=void 0!==h[e]?h[e]:t.commission;return`<li style="margin:4px 0;">${A(t.name)}: gross ${A(c(a))} \xb7 commission ${A(String(n))}%</li>`}).filter(e=>null!=e).join(""),ep=ed?`<ul style="margin:6px 0 10px;padding-left:22px;">${ed}</ul>
33<p style="margin:4px 0;"><strong>Total gross revenue:</strong> ${A(c(b.totalRev))}</p>
34<p style="margin:4px 0;"><strong>Total platform fees (calc):</strong> ${A(c(b.totalFee))}</p>`:`<p style="margin:6px 0;color:#64748b;">(none selected)</p>
35<p style="margin:4px 0;"><strong>Total gross revenue:</strong> ${A(c(b.totalRev))}</p>
36<p style="margin:4px 0;"><strong>Total platform fees (calc):</strong> ${A(c(b.totalFee))}</p>`,ex="spend"===D?`<p style="margin:4px 0;"><strong>Ad spend:</strong> ${A(c(F))}</p>`:`<p style="margin:4px 0;"><strong>Ad sales:</strong> ${A(c(I))}</p>
37<p style="margin:4px 0;"><strong>ROAS target:</strong> ${A(String(E))}</p>`,em=`<div style="font-family:system-ui,-apple-system,sans-serif;line-height:1.7;color:#334155;font-size:14px;">
38<h2 style="font-size:18px;margin:20px 0 12px;font-weight:600;color:#1e293b;">Profit calculator — full submission (all wizard data)</h2>
39
40<h3 style="font-size:13px;margin:16px 0 8px;color:#1d4ed8;text-transform:uppercase;letter-spacing:0.04em;">Unlock form</h3>
41<table role="presentation" cellpadding="0" cellspacing="0" style="border-collapse:collapse;width:100%;max-width:560px;border:1px solid #e2e8f0;">
42<tr><td style="padding:8px 10px;border:1px solid #e2e8f0;background:#f8fafc;width:38%;"><strong>Name</strong></td><td style="padding:8px 10px;border:1px solid #e2e8f0;">${A(J)}</td></tr>
43<tr><td style="padding:8px 10px;border:1px solid #e2e8f0;background:#f8fafc;"><strong>Email</strong></td><td style="padding:8px 10px;border:1px solid #e2e8f0;">${A(Q||"—")}</td></tr>
44<tr><td style="padding:8px 10px;border:1px solid #e2e8f0;background:#f8fafc;"><strong>WhatsApp</strong></td><td style="padding:8px 10px;border:1px solid #e2e8f0;">${A(ee||"—")}</td></tr>
45</table>
46
47<h3 style="font-size:13px;margin:16px 0 8px;color:#1d4ed8;text-transform:uppercase;letter-spacing:0.04em;">Market bar (currency / region)</h3>
48<p style="margin:0 0 12px;">${A(`${p} — ${S[p]} (${m.sym})`)}</p>
49
50<h3 style="font-size:13px;margin:16px 0 8px;color:#1d4ed8;text-transform:uppercase;letter-spacing:0.04em;">Step \xb7 Category</h3>
51<p style="margin:0 0 12px;">${A(`Category: ${X}${x?` (id: ${x})`:""}`)}</p>
52
53<h3 style="font-size:13px;margin:16px 0 8px;color:#1d4ed8;text-transform:uppercase;letter-spacing:0.04em;">Step \xb7 Platforms</h3>
54${ep}
55
56<h3 style="font-size:13px;margin:16px 0 8px;color:#1d4ed8;text-transform:uppercase;letter-spacing:0.04em;">Step \xb7 Revenue</h3>
57<table role="presentation" cellpadding="0" cellspacing="0" style="border-collapse:collapse;width:100%;max-width:560px;border:1px solid #e2e8f0;margin-bottom:12px;">
58<tr><td style="padding:8px 10px;border:1px solid #e2e8f0;background:#f8fafc;width:38%;"><strong>Discounts</strong></td><td style="padding:8px 10px;border:1px solid #e2e8f0;">${A(c(g))}</td></tr>
59<tr><td style="padding:8px 10px;border:1px solid #e2e8f0;background:#f8fafc;"><strong>Refunds</strong></td><td style="padding:8px 10px;border:1px solid #e2e8f0;">${A(c(y))}</td></tr>
60</table>
61
62<h3 style="font-size:13px;margin:16px 0 8px;color:#1d4ed8;text-transform:uppercase;letter-spacing:0.04em;">Step \xb7 CM1</h3>
63<table role="presentation" cellpadding="0" cellspacing="0" style="border-collapse:collapse;width:100%;max-width:560px;border:1px solid #e2e8f0;margin-bottom:12px;">
64<tr><td style="padding:8px 10px;border:1px solid #e2e8f0;background:#f8fafc;width:38%;"><strong>COGS per unit</strong></td><td style="padding:8px 10px;border:1px solid #e2e8f0;">${A(c(v))}</td></tr>
65<tr><td style="padding:8px 10px;border:1px solid #e2e8f0;background:#f8fafc;"><strong>Units sold</strong></td><td style="padding:8px 10px;border:1px solid #e2e8f0;">
65${A(w.toLocaleString(m.locale))}</td></tr>
66<tr><td style="padding:8px 10px;border:1px solid #e2e8f0;background:#f8fafc;"><strong>Freight / inbound</strong></td><td style="padding:8px 10px;border:1px solid #e2e8f0;">${A(c(N))}</td></tr>
67</table>
68
69<h3 style="font-size:13px;margin:16px 0 8px;color:#1d4ed8;text-transform:uppercase;letter-spacing:0.04em;">Step \xb7 CM2</h3>
70<table role="presentation" cellpadding="0" cellspacing="0" style="border-collapse:collapse;width:100%;max-width:560px;border:1px solid #e2e8f0;margin-bottom:12px;">
71<tr><td style="padding:8px 10px;border:1px solid #e2e8f0;background:#f8fafc;width:38%;"><strong>Affiliate % of net revenue</strong></td><td style="padding:8px 10px;border:1px solid #e2e8f0;">${A(String(k))}%</td></tr>
72<tr><td style="padding:8px 10px;border:1px solid #e2e8f0;background:#f8fafc;"><strong>Fulfillment / ops</strong></td><td style="padding:8px 10px;border:1px solid #e2e8f0;">${A(c(C))}</td></tr>
73</table>
74
75<h3 style="font-size:13px;margin:16px 0 8px;color:#1d4ed8;text-transform:uppercase;letter-spacing:0.04em;">Step \xb7 CM3</h3>
76<p style="margin:4px 0;"><strong>Input mode:</strong> ${"spend"===D?"Direct ad spend":"ROAS / ad sales"}</p>
77${ex}
78<p style="margin:4px 0;"><strong>Creative &amp; content:</strong> ${A(c(T))}</p>
79<p style="margin:4px 0 12px;"><strong>Affiliate samples:</strong> ${A(c(B))}</p>
80
81<h3 style="font-size:13px;margin:16px 0 8px;color:#1d4ed8;text-transform:uppercase;letter-spacing:0.04em;">Step \xb7 EBITDA</h3>
82<table role="presentation" cellpadding="0" cellspacing="0" style="border-collapse:collapse;width:100%;max-width:560px;border:1px solid #e2e8f0;margin-bottom:12px;">
83<tr><td style="padding:8px 10px;border:1px solid #e2e8f0;background:#f8fafc;width:38%;"><strong>Salaries</strong></td><td style="padding:8px 10px;border:1px solid #e2e8f0;">${A(c(R))}</td></tr>
84<tr><td style="padding:8px 10px;border:1px solid #e2e8f0;background:#f8fafc;"><strong>Rent &amp; utilities</strong></td><td style="padding:8px 10px;border:1px solid #e2e8f0;">${A(c(P))}</td></tr>
85<tr><td style="padding:8px 10px;border:1px solid #e2e8f0;background:#f8fafc;"><strong>Agency / management</strong></td><td style="padding:8px 10px;border:1px solid #e2e8f0;">${A(c(z))}</td></tr>
86<tr><td style="padding:8px 10px;border:1px solid #e2e8f0;background:#f8fafc;"><strong>Subscriptions / software</strong></td><td style="padding:8px 10px;border:1px solid #e2e8f0;">${A(c(O))}</td></tr>
87<tr><td style="padding:8px 10px;border:1px solid #e2e8f0;background:#f8fafc;"><strong>Other fixed</strong></td><td style="padding:8px 10px;border:1px solid #e2e8f0;">${A(c(L))}</td></tr>
88</table>
89
90<h3 style="font-size:13px;margin:16px 0 8px;color:#1d4ed8;text-transform:uppercase;letter-spacing:0.04em;">Derived totals</h3>
91<table role="presentation" cellpadding="0" cellspacing="0" style="border-collapse:collapse;width:100%;max-width:560px;border:1px solid #e2e8f0;">
92<tr><td style="padding:8px 10px;border:1px solid #e2e8f0;background:#f8fafc;width:38%;"><strong>Gross revenue</strong></td><td style="padding:8px 10px;border:1px solid #e2e8f0;">${A(c(G))}</td></tr>
93<tr><td style="padding:8px 10px;border:1px solid #e2e8f0;background:#f8fafc;"><strong>Net revenue</strong></td><td style="padding:8px 10px;border:1px solid #e2e8f0;">${A(c(W))}</td></tr>
94<tr><td style="padding:8px 10px;border:1px solid #e2e8f0;background:#f8fafc;"><strong>CM1</strong></td><td style="padding:8px 10px;border:1px solid #e2e8f0;">${A(c(U))}</td></tr>
95<tr><td style="padding:8px 10px;border:1px solid #e2e8f0;background:#f8fafc;"><strong>CM2</strong></td><td style="padding:8px 10px;border:1px solid #e2e8f0;">${A(c(V))}</td></tr>
96<tr><td style="padding:8px 10px;border:1px solid #e2e8f0;background:#f8fafc;"><strong>Implied ad spend</strong></td><td style="padding:8px 10px;border:1px solid #e2e8f0;">${A(c(K))}</td></tr>
97<tr><td style="padding:8px 10px;border:1px solid #e2e8f0;background:#f8fafc;"><strong>CM3</strong></td><td style="padding:8px 10px;border:1px solid #e2e8f0;">${A(c(H))}</td></tr>
98<tr><td style="padding:8px 10px;border:1px solid #e2e8f0;background:#eff6ff;"><strong>EBITDA</strong></td><td style="padding:8px 10px;border:1px solid #e2e8f0;background:#eff6ff;"><strong>${A(c(Y))}</strong></td></tr>
99</table>
100</div>`;return{intro:$(J,ec),message:$(J,ec+em),ebitda_value:et,top_cost_driver:en>0?ea:"—",category:X,platform:er,case_study_stat:el,booking_link:eo,sender_name:ei}}({fmt:ts,contact:{name:e,email:a,whatsapp:s},currentMarket:n,currentCategory:o,market:tt,selected:x,platRevenues:h,platCommissions:g,platTotals:tr,discounts:E,refunds:B,cogsU:P,units:O,freight:W,affPct:H,fulfill:X,adMode:Q,ads:en,adSales:eo,roasVal:ep,creative:eh,samples:eg,salaries:ev,rent:ej,mgmt:ek,subs:eS,other:eM,gross:tl,netRev:to,cm1:tc,cm2:tx,
100cm3:tf,ebitda:tu,adSpend:tm}),p=("[email protected]".trim()||"[email protected]").split(",").map(e=>e.trim()).filter(Boolean),m="".trim()||`P&L calculator — ${e}`,f=e=>fetch(`${r}/v1/email/send`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});try{let e=await f({type:"pl_calculator_report",send_to:[a],subject:"Your P&L Calculator Report",recaptcha_token:l,html:d.intro});if(!e.ok){let t="";try{t=await e.text()}catch{}console.error("[Profit calculator] email API error (user):",e.status,t),window.alert("Could not send your details. Please try again in a moment.");return}let t=await f({type:"pl_calculator_report",send_to:p,subject:m,recaptcha_token:i,html:d.message});if(!t.ok){let e="";try{e=await t.text()}catch{}console.error("[Profit calculator] email API error (team):",t.status,e),window.alert("Your report was emailed to you. Our team did not receive the full copy automatically — please email [email protected] if you need a follow-up.")}}catch(e){console.error(e),window.alert("Could not send your details. Please try again in a moment.");return}eT(!0),eQ(e),e1(a),e5(s),window.setTimeout(()=>{eD(!0),eR(!0),ez(!0),eL("Your results are above. We'll also send a PDF — and our team will follow up with a free 30-min margin review."),eV("✓ Sent! Expect to hear from us soon."),eW(!0)},1200)}finally{eI(!1)}},t_=(0,m.useCallback)((e,t,n,s,r,l)=>(0,a.jsx)(em,{label:e,value:t,variant:n,showPct:s,isDeduction:r,labelClassName:l?.labelClassName,valueClassName:l?.valueClassName,showBar:l?.showBar,maxV:tb,base:tg,percentBase:l?.percentBase,fmt:ts},e),[tb,tg,ts]),tM=(0,m.useMemo)(()=>th?[E>0||B>0?t_("Gross revenue",tl,"flow",void 0,void 0,{labelClassName:"text-sm font-medium text-(--pc-text)",valueClassName:"text-sm"}):null,E>0?t_("- Discounts",E,"flow",!1,!0):null,B>0?t_("- Refunds",B,"flow",!1,!0):null,t_("Net revenue",to,"flow",!0,void 0,{labelClassName:"text-sm font-medium text-(--pc-text)",valueClassName:"text-sm",percentBase:100}),ti>0?t_("- COGS",ti,"new-section",!1,!0):null,W>0?t_("- Freight",W,"flow",!1,!0):null,t_("CM1 · Gross profit",tc,"subtotal",!0),td>0?t_("- Platform fees",td,"new-section",!1,!0):null,tp>0?t_("- Affiliate comms",tp,"flow",!1,!0):null,X>0?t_("- Fulfillment",X,"flow",!1,!0):null,t_("CM2 · Operating Margin",tx,"subtotal",!0)].filter(Boolean):[],[th,t_,tl,E,B,to,ti,tc,td,tp,X,tx,W]),tA=(0,m.useMemo)(()=>th?[tm>0?t_("- Ad spend",tm,"new-section",!1,!0):null,eh>0?t_("- Creative & content",eh,"flow",!1,!0):null,eg>0?t_("- Affiliate samples",eg,"flow",!1,!0):null,t_("CM3 · Marketing margin",tf,"subtotal",!0),ev>0?t_("- Salaries",ev,"new-section",!1,!0):null,ej>0?t_("- Rent & utilities",ej,"flow",!1,!0):null,ek>0?t_("- Agency fee",ek,"flow",!1,!0):null,eS>0?t_("- Subscriptions",eS,"flow",!1,!0):null,eM>0?t_("- Other fixed",eM,"flow",!1,!0):null,t_("EBITDA",tu,"ebitda",!0)].filter(Boolean):[],[th,t_,tm,eh,eg,tf,ev,ej,ek,eS,eM,tu]),t$=`${s.variable} ${l.variable} ${i.variable}`,tD=w[n],tF=e4>=tv,tI=(0,a.jsx)(V,{hasData:th,tailReady:tF,isUnlocked:e$,fmt:ts,netRev:to,cm2:tx,ebitda:tu,freeRows:tM,lockedRows:tA,gateSuccess:eE,cm3:tf,gName:eH,gEmail:eK,gWa:eZ,onGNameChange:eY,onGEmailChange:eq,onGWaChange:eX,onUnlockResults:tS,unlockSubmitting:eF,onSkipGate:()=>{eD(!0),eR(!0),ez(!1)},showLeadPanel:eB,leadFormHidden:eP,leadSubText:eO,leadSent:eG,leadOkText:eU,ln:eJ,le:e0,lw:e2,onLnChange:eQ,onLeChange:e1,onLwChange:e5,onSubmitLead:()=>{eW(!0),eV("✓ Done! Our team will reach out within 24 hours.")}});return(0,a.jsxs)("div",{className:(0,I.cn)("bg-(--pc-bg) text-(--pc-text) text-sm leading-normal antialiased","[font-family:var(--font-pc-sans),system-ui,sans-serif]","**:box-border [&_*::before]:box-border [&_*::after]:box-border",t$),style:{...v,"--pc-accent":tD.accent,"--pc-accent2":tD.accent2},children:[(0,a.jsx)(G,{}),(0,a.jsx)(ec,{currentMarket:n,onMarketChange:tC}),(0,a.jsxs)("div",{className:(0,I.cn)("mx-auto grid max-w-[1120px] gap-x-9 gap-y-7 px-8 py-8","max-[900px]:grid-cols-1 max-[900px]:gap-5 max-[900px]:px-4 max-[900px]:pb-16 max-[900px]:pt-0","min-[901px]:grid-cols-[minmax(220px,260px)_minmax(0,1fr)]"),children:[(0,a.jsx)(q,{activeStep:e3,onStepChange:tk,isStepComplete:tj}),(0,a.jsx)("div",{className:(0,I.cn)("flex min-w-0 flex-col gap-6"),children:(0,a.jsxs)("div",{className:(0,I.cn)("flex flex-col rounded-[18px] border min-h-0 border-(--pc-border) bg-(--pc-surface) px-6 pb-5 pt-[22px]","shadow-[0_12px_40px_rgba(10,36,99,0.06)]","flex-1"),children:[(0,a.jsx)("div",{className:"flex min-w-0 min-h-0 flex-1 flex-col",children:(0,a.jsx)(c.AnimatePresence,{mode:"wait",children:(0,a.jsxs)(d.motion.div,{layout:!1,className:"min-w-0 overflow-visible",initial:!e&&{opacity:0,y:10}
100,animate:{opacity:1,y:0},exit:e?{opacity:1,y:0}:{opacity:0,y:-8},transition:{duration:e?.01:.25,ease:[.25,.1,.25,1]},children:[0===e3?(0,a.jsx)(Z,{currentCategory:o,onCategoryChange:p}):null,1===e3?(0,a.jsx)(ed,{market:tt,selected:x,onTogglePlat:e=>{u(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},platRevenues:h,onPlatRevenueChange:(e,t)=>b(a=>({...a,[e]:t})),platCommissions:g,onPlatCommissionChange:(e,t)=>y(a=>({...a,[e]:t})),platFees:tr.fees,totalRev:tr.totalRev,totalFee:tr.totalFee,fmt:ts}):null,2===e3?(0,a.jsx)(ex,{benchmarkDisc:tn.disc,sym:tt.sym,discounts:E,refunds:B,onDiscountsChange:T,onRefundsChange:R}):null,3===e3?(0,a.jsx)(ee,{benchmarkCm1:tn.cm1,sym:tt.sym,cogsU:P,units:O,freight:W,onCogsUChange:z,onUnitsChange:L,onFreightChange:U}):null,4===e3?(0,a.jsx)(ea,{benchmarkCm2:tn.cm2,sym:tt.sym,platFee:td,affPct:H,fulfill:X,onAffPctChange:Y,onFulfillChange:J}):null,5===e3?(0,a.jsx)(es,{benchmarkCm3:tn.cm3,sym:tt.sym,roasHint:tt.roasHint,adMode:Q,onAdModeChange:et,ads:en,adSales:eo,roasVal:ep,adSpend:tm,fmt:ts,creative:eh,samples:eg,onAdsChange:er,onAdSalesChange:ei,onRoasValChange:eu,onCreativeChange:eb,onSamplesChange:ey}):null,6===e3?(0,a.jsx)(el,{benchmarkEbitda:tn.ebitda,sym:tt.sym,salaries:ev,rent:ej,mgmt:ek,subs:eS,other:eM,onSalariesChange:ew,onRentChange:eN,onMgmtChange:eC,onSubsChange:e_,onOtherChange:eA}):null,7===e3?(0,a.jsx)("div",{id:"pc-calculator-results",className:"min-w-0 scroll-mt-8",children:tI}):null]},e3)})}),(0,a.jsxs)("div",{className:(0,I.cn)("mt-6 flex shrink-0 items-center gap-3 border-t border-(--pc-border) pt-5",e3<tv?"justify-between":"justify-start"),children:[(0,a.jsx)("button",{type:"button",className:(0,I.cn)("cursor-pointer rounded-xl border border-(--pc-border2) bg-(--pc-surface2) px-5 py-2.5","text-[13px] font-semibold text-(--pc-text) transition-colors","[font-family:var(--font-pc-sans),system-ui,sans-serif]","hover:border-(--pc-accent) hover:text-(--pc-accent)","disabled:cursor-not-allowed disabled:opacity-40"),disabled:0===e3,onClick:()=>e8(e=>Math.max(0,e-1)),children:"Back"}),e3<tv?(0,a.jsx)("button",{type:"button",className:(0,I.cn)("cursor-pointer rounded-xl border border-(--pc-border2) bg-(--pc-surface2) px-5 py-2.5","text-[13px] font-semibold text-(--pc-text) transition-colors","[font-family:var(--font-pc-sans),system-ui,sans-serif]","hover:border-(--pc-accent) hover:text-(--pc-accent)","disabled:cursor-not-allowed disabled:opacity-40","border-(--pc-accent) bg-(--pc-accent) text-white","hover:brightness-[1.06] hover:text-white","disabled:opacity-45"),disabled:tN,onClick:()=>{if(e3>=tv||tN)return;let e=e3+1;e6(t=>ef(t,e3,e,tw,tv)),te(e),e8(e)},children:"Continue"}):null]})]})})]})]})}],6884)}]);

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.