1import{A as q,c3 as T,r as i,j as e,B as V,D as z,t as H,aY as K,h as U,a$ as W,l as G,a_ as Q}from"./index-XrERYidG.js";import{u as J,H as Y}from"./HoneypotField-BaQgyXdK.js";import{C as P}from"./HomePage-UriNl1vn.js";import"./award-CnqmUJVI.js";const X=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Z=q("info",X),ee=.03,ae=.3,te=.03,se="https://kentrosistemas.atenderbem.com/webhookcapture/capture/7ed5ab15ee024fb6bb75db03b8d088d3";function n(s){if(s==="")return 0;const a=parseInt(s.replace(/\D/g,""),10);return Number.isFinite(a)&&a>=0?a:0}function oe(s){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(s.trim())}function N(s){return s.replace(/\D/g,"")}function re(s){const a=N(s).slice(0,11);return a.length<=2?a.length?`(${a}`:"":a.length<=6?`(${a.slice(0,2)}) ${a.slice(2)}`:a.length<=10?`(${a.slice(0,2)}) ${a.slice(2,6)}-${a.slice(6)}`:`(${a.slice(0,2)}) ${a.slice(2,7)}-${a.slice(7)}`}function ie(s){const a=N(s);return a.length===10||a.length===11}function me(){const s=T(),[a,x]=i.useState("month"),[u,y]=i.useState(""),[l,w]=i.useState(""),[h,$]=i.useState(""),[g,D]=i.useState(""),[r,O]=i.useState(""),[m,R]=i.useState(""),[_,I]=i.useState(!1),{honeypotRef:E,guard:F,markSubmitted:M}=J("calculadora-whatsapp"),b=oe(r),f=ie(m),L=[u,l,h,g].some(t=>n(t)>0),k=b&&f&&L&&!_,o=i.useMemo(()=>{const t=a==="day"?30:1;return{utility:n(u)*t,marketing:n(l)*t,passive:n(h)*t,service:n(g)*t}},[a,u,l,h,g]);async function B(t){if(t.preventDefault(),!k)return;const p=await F({email:r.trim(),phone:m});if(!p.ok){H.error(p.message);return}I(!0),M();const j=o.utility*ee+o.marketing*ae,C=j+o.service*te,S=C-j,A=(()=>{try{return K("kentro-calculadora-whatsapp","calculadora-whatsapp-outubro-2026")}catch{return{}}})(),d=N(m),c={source:"calculadora-whatsapp-outubro-2026",email:r.trim(),phone:d,phone_digits:d,phone_e164:`+55${d}`,period:a,inputs:{utility:n(u),marketing:n(l),passive:n(h),service:n(g)},monthly:o,calc:{custo_hoje:Number(j.toFixed(2)),custo_outubro:Number(C.toFixed(2)),aumento_mensal:Number(S.toFixed(2)),aumento_anual:Number((S*12).toFixed(2))},submitted_at:new Date().toISOString(),page_url:typeof window<"u"?window.location.href:"",pathname:typeof window<"u"?window.location.pathname:"",language:typeof navigator<"u"?navigator.language:"",user_agent:typeof navigator<"u"?navigator.userAgent:"",form_id:"kentro-calculadora-whatsapp",fields:{...A,email:r.trim(),phone:d}};U("whatsapp_calc_submit",{period:a,utility_month:o.utility,marketing_month:o.marketing,passive_month:o.passive,service_month:o.service,custo_hoje:c.calc.custo_hoje,custo_outubro:c.calc.custo_outubro,aumento_mensal:c.calc.aumento_mensal,aumento_anual:c.calc.aumento_anual,currency:"BRL",value:c.calc.aumento_mensal}),W("calculadora_whatsapp"),G({content_name:"calculadora_whatsapp",content_category:"calculadora-whatsapp-outubro-2026",source:"calculadora-whatsapp-outubro-2026",currency:"BRL",value:c.calc.aumento_mensal},{email:r.trim(),phone:`55${d}`,country:"br"}),Q({...A,email:r.trim(),phone:d,phone_e164:`+55${d}`,page_url:c.page_url});try{fetch(se,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(c),keepalive:!0}).catch(()=>{})}catch{}s({to:"/calculadora-whatsapp-outubro-2026",search:{u:o.utility,m:o.marketing,p:o.passive,s:o.service,e:r.trim()}})}return e.jsx("section",{id:"calculadora",className:"bg-secondary/30 py-20 md:py-24",children:e.jsxs("div",{className:"mx-auto max-w-6xl px-4 sm:px-6 lg:px-8",children:[e.jsxs("div",{className:"mx-auto max-w-3xl text-center",children:[e.jsxs("span",{className:"inline-flex items-center gap-2 rounded-full bg-primary/15 px-3 py-1 text-xs font-semibold uppercase tracking-wider text-primary-glow",children:[e.jsx(P,{className:"size-3.5"})," API Oficial · Outubro/2026"]}),e.jsxs("h2",{className:"mt-4 text-3xl font-bold md:text-4xl",style:{fontFamily:"var(--font-display)"},children:["Quanto sua empresa vai pagar pelo"," ",e.jsx("span",{className:"gradient-text",children:"WhatsApp a partir de outubro?"})]}),e.jsx("p",{className:"mt-3 text-muted-foreground",children:"A Meta anunciou: a partir de 1º/10/2026, as mensagens que sua empresa envi
1a na conversa com o cliente â hoje gratuitas â passam a ser cobradas por mensagem. Calcule o impacto no seu custo."})]}),e.jsxs("div",{className:"mx-auto mt-12 flex max-w-3xl flex-col gap-6",children:[e.jsxs("form",{onSubmit:B,className:"glass-card rounded-3xl p-6 sm:p-8",noValidate:!0,children:[e.jsx(Y,{id:"calculadora-whatsapp",ref:E}),e.jsxs("div",{className:"mb-6",children:[e.jsx("span",{className:"mb-2 block text-sm font-medium text-foreground/90",children:"PerÃodo"}),e.jsx("div",{role:"tablist","aria-label":"PerÃodo",className:"inline-flex rounded-full bg-white/[0.05] p-1",onKeyDown:t=>{t.key!=="ArrowLeft"&&t.key!=="ArrowRight"||(t.preventDefault(),x(a==="day"?"month":"day"))},children:["day","month"].map(t=>{const p=a===t;return e.jsx("button",{type:"button",role:"tab","aria-selected":p,tabIndex:p?0:-1,onClick:()=>x(t),className:`rounded-full px-4 py-1.5 text-xs font-semibold transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-glow ${p?"bg-primary text-white shadow-glow":"text-muted-foreground hover:text-foreground"}`,children:t==="day"?"Por dia":"Por mês"},t)})})]}),e.jsx(v,{id:"utility",label:"Atendimentos ativos de utilidade",tooltip:"Notificações, lembretes e confirmações enviadas pela empresa (templates de utilidade)",value:u,onChange:y}),e.jsx(v,{id:"marketing",label:"Atendimentos ativos de marketing (campanhas)",tooltip:"Promoções e campanhas enviadas pela empresa (templates de marketing)",value:l,onChange:w}),e.jsx(v,{id:"passive",label:"Atendimentos passivos",tooltip:"Quando o cliente chama sua empresa primeiro. Continuam gratuitos",value:h,onChange:$}),e.jsx(v,{id:"service",label:"Mensagens enviadas pela empresa nas conversas",tooltip:"Respostas enviadas dentro da janela de 24h de atendimento. à isso que a Meta passa a cobrar em outubro de 2026",value:g,onChange:D}),e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{htmlFor:"email",className:"mb-2 block text-sm font-medium text-foreground/90",children:"Email corporativo"}),e.jsx("input",{id:"email",type:"email",required:!0,autoComplete:"email",value:r,onChange:t=>O(t.target.value),placeholder:"[email protected]",className:"w-full rounded-lg border border-white/10 bg-white/[0.04] px-3 py-2 text-sm outline-none focus-visible:border-primary-glow focus-visible:ring-2 focus-visible:ring-primary-glow","aria-invalid":r.length>0&&!b,"aria-describedby":r.length>0&&!b?"email-error":void 0}),r.length>0&&!b&&e.jsx("p",{id:"email-error",className:"mt-1 text-xs text-destructive",role:"alert",children:"Informe um email válido."})]}),e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{htmlFor:"phone",className:"mb-2 block text-sm font-medium text-foreground/90",children:"WhatsApp / telefone"}),e.jsx("input",{id:"phone",type:"tel",required:!0,inputMode:"tel",autoComplete:"tel",value:m,onChange:t=>R(re(t.target.value)),placeholder:"(11) 91582-7716",className:"w-full rounded-lg border border-white/10 bg-white/[0.04] px-3 py-2 text-sm outline-none focus-visible:border-primary-glow focus-visible:ring-2 focus-visible:ring-primary-glow","aria-invalid":m.length>0&&!f,"aria-describedby":m.length>0&&!f?"phone-error":void 0}),m.length>0&&!f&&e.jsx("p",{id:"phone-error",className:"mt-1 text-xs text-destructive",role:"alert",children:"Informe um DDD + número válidos."})]}),e.jsxs(V,{type:"submit",disabled:!k,size:"lg",className:"w-full gradient-primary text-white shadow-glow focus-visible:ring-2 focus-visible:ring-primary-glow focus-visible:ring-offset-2 focus-visible:ring-offset-background","aria-describedby":"calc-submit-hint",children:[_?"Calculando...":"Calcular impacto"," ",e.jsx(z,{"aria-hidden":"true"})]}),e.jsx("p",{id:"calc-submit-hint",className:"mt-2 text-center text-[11px] text-muted-foreground",children:"Ao calcular, seus dados são enviados para a Kentro para acompanhamento."})]}),e.jsxs("div",{className:"glass-card flex flex-col items-center justify-center rounded-3xl p-6 text-center sm:p-8",children:[e.jsx(P,{className:"size-10 text-primary-glow"}),e.jsx("h3",{className:"mt-4 text-xl font-semibold",children:"Preencha os dad
1os e veja o comparativo"}),e.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:"Vamos mostrar quanto sua empresa paga hoje e quanto passará a pagar a partir de 1º/10/2026, com o aumento mensal e anual."})]})]})]})})}function v({id:s,label:a,tooltip:x,value:u,onChange:y}){const l=`${s}-hint`;return e.jsxs("div",{className:"mb-4",children:[e.jsxs("label",{htmlFor:s,className:"mb-2 flex items-center gap-1.5 text-sm font-medium text-foreground/90",children:[a,e.jsx(Z,{className:"size-3.5 text-muted-foreground","aria-hidden":"true"}),e.jsx("span",{id:l,className:"sr-only",children:x})]}),e.jsx("input",{id:s,type:"text",inputMode:"numeric",pattern:"[0-9]*",value:u,onChange:w=>y(w.target.value.replace(/\D/g,"")),placeholder:"0","aria-describedby":l,className:"w-full rounded-lg border border-white/10 bg-white/[0.04] px-3 py-2 text-sm outline-none focus-visible:border-primary-glow focus-visible:ring-2 focus-visible:ring-primary-glow"})]})}export{me as WhatsAppCostCalculator}; 2//# sourceMappingURL=WhatsAppCostCalculator-DI9AaS0c.js.map
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.