PageSourceSearch

https://sabhia.ai/assets/ativo-editorial-CqdR_VM5.js

js sabhia.ai collected 2026-10-05 12:33:10 UTC 106,224 bytes, 29 lines download raw bytes

1import{j as e}from"./vendor-motion-CPxq9Xvn.js";import{r as s}from"./vendor-i18n-CO3kK2bH.js";import{C as Be}from"./circle-x-DhBMAj3Y.js";import{n as It,d$ as Et,e0 as Pt,Y as At,a7 as H,C as Ze,ay as Rt,i as pt,aG as Tt,aa as Ot,K as Lt,ah as qt,ab as Dt,ae as Ut,af as $t,ag as Mt,e1 as zt,a2 as Vt,A as z,S as Ae,U as xt,J as et,l as Bt,bM as Ft,bN as Kt,bO as Gt,W as Ht}from"./index-CFAvyuXu.js";import{P as Jt}from"./pix-qr-image-D45mJvPS.js";import{L as ut}from"./lock-keyhole-CDiW-xK8.js";import{P as Qt,b as Xt}from"./pageContent-D_tkGcF-.js";import{F as ft}from"./file-text-DjkUcFVd.js";import{A as tt}from"./arrow-left-DY50GvQQ.js";import{M as Yt}from"./mail-B6oT_qrq.js";import{R as at}from"./rotate-ccw-yv6DhBa4.js";import"./vendor-react-CQmBMThG.js";import"./upchunk-B4A0v5W4.js";import"./save-QXxXVhhp.js";import"./eye-BcGCsLne.js";import"./pencil-DB7EhnQs.js";import"./cloud-upload-D4KUxAWd.js";import"./circle-alert-CixghSwT.js";const Wt=[["rect",{width:"18",height:"7",x:"3",y:"3",rx:"1",key:"f1a2em"}],["rect",{width:"9",height:"7",x:"3",y:"14",rx:"1",key:"jqznyg"}],["rect",{width:"5",height:"7",x:"16",y:"14",rx:"1",key:"q5h2i8"}]],ht=It("layout-template",Wt);function st({claimError:r,error:a,variant:u="dark"}){if(!r&&!a)return null;const p=u==="paper"?"mb-7 flex gap-2 border border-red-950/15 bg-red-950/[.06] p-3 text-sm text-red-950":"mb-5 flex gap-2 rounded-xl border border-red-300/20 bg-red-400/10 p-3 text-sm text-red-100";return e.jsxs("div",{"data-testid":u==="paper"?"ativo-ready-error":"ativo-entry-error",children:[r&&e.jsxs("div",{role:"alert",className:p,children:[e.jsx(Be,{className:"mt-0.5 h-4 w-4 shrink-0"}),r]}),a&&e.jsxs("div",{role:"alert",className:p,children:[e.jsx(Be,{className:"mt-0.5 h-4 w-4 shrink-0"}),a]})]})}function rt(r,a){return[403,404,410].includes(r)||r===409&&["checkout_inactive","checkout_expired","checkout_cancelled"].includes(String(a||""))}function nt(r,a="BRL"){return new Intl.NumberFormat("pt-BR",{style:"currency",currency:a}).format(r/100)}function it(r){return JSON.stringify({name:r.name.trim(),email:r.email.trim().toLowerCase(),phone:r.phone.replace(/\D/g,"")})}async function Re(r){const a=await r.json().catch(()=>({}));if(!r.ok)throw new Error(a?.message||"Não foi possível continuar o pagamento.");return a}async function te(r,a={},u=25e3){const p=new AbortController,w=window.setTimeout(()=>p.abort(),u);try{return await fetch(r,{...a,signal:p.signal})}finally{window.clearTimeout(w)}}function qe(r,a){return r instanceof DOMException&&r.name==="AbortError"?"A conexão demorou mais que o esperado. Confira sua internet e tente novamente.":r instanceof Error?r.message:a}function Zt({open:r,checkout:a,onClose:u,onInvalidCheckout:p,onPaid:w,onEvent:h,autoStartMethod:N}){const[g,J]=s.useState(null),[v,D]=s.useState({name:"",email:"",phone:""}),[U,y]=s.useState(null),[d,O]=s.useState(null),[c,X]=s.useState(null),[B,F]=s.useState(!0),[j,K]=s.useState(!1),[I,_]=s.useState(!1),[E,fe]=s.useState(!1),[Se,R]=s.useState(!1),[Te,ae]=s.useState(!0),[_e,P]=s.useState(""),[he,ne]=s.useState(null),[be,ie]=s.useState(!1),[Z,Q]=s.useState(!1),Ce=s.useRef(""),ge=s.useRef(!1),oe=s.useRef(null),le=s.useRef(null),ve=s.useRef(()=>{}),ce=s.useRef(!1),de=s.useRef(!1),ee=s.useRef(!1),me=s.useRef(a.checkoutSessionId),se=s.useRef(null),L=s.useRef(!1),q=s.useRef(null),we=s.useRef({onClose:u,preparing:j,processing:I}),re=g?.mainProduct.priceInCentavos||g?.ativoPackage.priceCents||0,$=s.useCallback(()=>{ce.current||(ce.current=!0,fe(!0),_(!1),K(!1),h?.("ativo_editorial_payment_confirmed",{checkout_session_id:a.checkoutSessionId,package_id:a.packageId}),w(),se.current=window.setTimeout(()=>{window.location.assign(`/obrigado?checkoutId=${encodeURIComponent(a.checkoutSessionId)}&token=${encodeURIComponent(a.magicToken)}`)},1400))},[a,h,w]);s.useEffect(()=>{we.current={onClose:u,preparing:j,processing:I}},[u,j,I]),s.useEffect(()=>{if(!r)return;const o=Et("ativo-editorial-inline-payment"),m=Pt(),x=window.visualViewport,f=()=>{const T=x?.height;T&&q.current&&q.current.style.setProperty("--ativo-dialog-height",`${Math.max(0,T-16)}px`)};f();const S=T=>{if(T.key==="Escape"&&!we.current.preparing&&!we.current.processing){we.current.onClose();return}if(T.key!=="Tab")return;const k=Array.from(q.current?.querySelectorAll('button:not([disabled]), a[href], input
1:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])')||[]);if(!k.length)return;const M=k[0],Pe=k[k.length-1];T.shiftKey&&document.activeElement===M?(T.preventDefault(),Pe.focus()):!T.shiftKey&&document.activeElement===Pe&&(T.preventDefault(),M.focus())};return window.addEventListener("keydown",S),x?.addEventListener("resize",f),x?.addEventListener("scroll",f),window.requestAnimationFrame(()=>q.current?.querySelector('[aria-label="Fechar pagamento"]')?.focus()),()=>{m(),o(),window.removeEventListener("keydown",S),x?.removeEventListener("resize",f),x?.removeEventListener("scroll",f),q.current?.style.removeProperty("--ativo-dialog-height")}},[r]),s.useEffect(()=>()=>{se.current&&window.clearTimeout(se.current)},[]),s.useEffect(()=>{if(!r)return;let o=!1;return te(`/api/ativo-editorial/greenn/status?checkoutSessionId=${encodeURIComponent(a.checkoutSessionId)}&token=${encodeURIComponent(a.magicToken)}`,{},15e3).then(m=>m.ok?m.json():{enabled:!1}).then(m=>{o||ie(!!m?.enabled)}).catch(()=>{}),()=>{o=!0}},[r,a.checkoutSessionId,a.magicToken]);async function pe(){if(!(Z||j||I)){Q(!0),P(""),h?.("ativo_editorial_greenn_start",{checkout_session_id:a.checkoutSessionId,package_id:a.packageId});try{await Ie();const o=await te("/api/ativo-editorial/greenn/start",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({checkoutSessionId:a.checkoutSessionId,token:a.magicToken})},25e3),m=await Re(o);if(!m?.url||typeof m.url!="string")throw new Error("O checkout externo não está disponível agora.");window.location.assign(m.url)}catch(o){Q(!1),P(qe(o,"Não foi possível abrir o checkout externo."))}}}s.useEffect(()=>{if(!r)return;let o=!1;return F(!0),P(""),te(`/api/checkout/${a.checkoutSessionId}?token=${encodeURIComponent(a.magicToken)}`,{credentials:"include"},2e4).then(async m=>{const x=await m.json().catch(()=>({}));if(rt(m.status,x?.code))return o||p(),null;if(!m.ok)throw new Error(x?.message||"Não foi possível carregar o checkout.");return x}).then(m=>{if(!m||o)return;if(["cancelled","expired"].includes(m.session.status)){p();return}const x={name:m.session.userName||"",email:m.session.email||"",phone:m.session.phone||""};Ce.current=it(x),D(x),J(m),(m.session.status==="paid"||m.session.status==="delivered")&&$()}).catch(m=>{o||P(qe(m,"Não foi possível carregar o checkout."))}).finally(()=>{o||F(!1)}),()=>{o=!0}},[a.checkoutSessionId,a.magicToken,$,p,r]),s.useEffect(()=>{if(!r||E||!g)return;const o=window.setInterval(async()=>{try{const m=await te(`/api/checkout/${a.checkoutSessionId}/status?token=${encodeURIComponent(a.magicToken)}`,{credentials:"include"},1e4);if(!m.ok)return;const x=await m.json();(x.status==="paid"||x.status==="delivered")&&$(),x.status==="card_failed"&&x.terminal&&(_(!1),P(x.message||"O cartão não foi aprovado. Revise os dados e tente novamente."))}catch{}},3e3);return()=>window.clearInterval(o)},[g,a.checkoutSessionId,a.magicToken,$,r,E]);const Ie=s.useCallback(async()=>{if(v.name.trim().length<2)throw new Error("Informe seu nome para continuar.");if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(v.email.trim()))throw new Error("Informe um e-mail válido para receber a entrega.");if(v.phone.replace(/\D/g,"").length<10)throw new Error("Informe um WhatsApp com DDD para continuar.");const o=it(v);if(o===Ce.current)return;const m=await te(`/api/checkout/${a.checkoutSessionId}/contact`,{method:"PATCH",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:a.magicToken,name:v.name.trim(),email:v.email.trim().toLowerCase(),phone:v.phone.replace(/\D/g,"")})},2e4);await Re(m),Ce.current=o},[a.checkoutSessionId,a.magicToken,v]),G=s.useCallback(async(o,m=!1)=>{const x={method:o,resume:m};if(!E){if(ge.current){const f=oe.current;(!f||f.method!==x.method||f.resume!==x.resume)&&(le.current=x);return}oe.current=x,ge.current=!0,K(!0),y(o),O(null),X(null),ne(null),P("");try{m||await Ie();const f=await te(`/api/chat-checkout/${a.checkoutSessionId}/prepare-payment`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:a.magicToken,acceptedBumpIds:[],paymentMethod:o})},45e3),S=await f.json().catch(()=>({}));if(rt(f.status,S?.code)){p();return}if(!f.ok)throw new Error(S?.message||"Não foi possível continuar o pagamento.");
1if(S.alreadyPaid||S.status==="paid"){$();return}if(o==="pix")O({qrCode:S.pixData?.qrCode||"",imageUrl:S.pixData?.imageUrl||null});else{if(g?.cardProvider!=="stripe")throw new Error("O cartão deste checkout não está configurado na Stripe.");const T=await te("/api/stripe/publishable-key",{},15e3),k=await Re(T);if(!S.clientSecret||!S.paymentIntentId||!k.publishableKey)throw new Error("A Stripe não retornou os dados necessários para o pagamento.");X({clientSecret:S.clientSecret,paymentIntentId:S.paymentIntentId,publishableKey:k.publishableKey})}ae(!1),h?.("ativo_editorial_payment_pending",{checkout_session_id:a.checkoutSessionId,package_id:a.packageId,payment_method:o})}catch(f){y(null),O(null),X(null),ae(!0),ne(o),P(qe(f,"Não foi possível preparar o pagamento."))}finally{ge.current=!1,oe.current=null,K(!1);const f=le.current;le.current=null,f&&!ce.current&&window.setTimeout(()=>ve.current(f.method,f.resume),0)}}},[g?.cardProvider,a,$,h,p,E,Ie]);s.useEffect(()=>{ve.current=(o,m)=>{G(o,m)}},[G]),s.useEffect(()=>{const o=g?.session.paymentMethod;!r||!o||E||de.current||(de.current=!0,G(o,!0))},[g?.session.paymentMethod,r,E,G]),s.useEffect(()=>{!r||!N||!g||E||g.session.paymentMethod||de.current||ee.current||ce.current||(ee.current=!0,h?.("ativo_editorial_payment_method_selected",{checkout_session_id:a.checkoutSessionId,package_id:a.packageId,payment_method:N,auto:!0}),G(N))},[r,N,g,E,G,a,h]),s.useEffect(()=>{me.current!==a.checkoutSessionId&&(me.current=a.checkoutSessionId,ee.current=!1),r||(ee.current=!1)},[r,a.checkoutSessionId]);function Ee(o){ne(null),h?.("ativo_editorial_payment_method_selected",{checkout_session_id:a.checkoutSessionId,package_id:a.packageId,payment_method:o}),G(o)}function xe(){le.current=null,y(null),O(null),X(null),_(!1),ae(!0),ne(null),P("")}async function je(){if(d?.qrCode)try{if(!navigator.clipboard?.writeText)throw new Error("clipboard_unavailable");await navigator.clipboard.writeText(d.qrCode),R(!0),window.setTimeout(()=>R(!1),2500)}catch{P("Não foi possível copiar automaticamente. Toque e segure o código PIX para copiá-lo.")}}return s.useEffect(()=>{if(!c||L.current||E)return;const o=new URL(window.location.href),m=o.searchParams.get("payment_intent"),x=o.searchParams.get("redirect_status");if(!(!m&&!x)){if(L.current=!0,["payment_intent","payment_intent_client_secret","redirect_status"].forEach(f=>o.searchParams.delete(f)),window.history.replaceState({},"",`${o.pathname}${o.search}${o.hash}`),x&&x!=="succeeded"){P("A autenticação do cartão não foi concluída. Tente novamente.");return}if(m&&m!==c.paymentIntentId){P("O retorno do cartão não pertence a este checkout.");return}_(!0),te(`/api/checkout/${a.checkoutSessionId}/confirm-card-payment`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:a.magicToken,paymentIntentId:c.paymentIntentId})},3e4).then(Re).then(f=>{f.status==="paid"?$():P("O pagamento está sendo processado. Esta tela será atualizada automaticamente.")}).catch(f=>{_(!1),P(qe(f,"Não foi possível confirmar o retorno do cartão."))})}},[c,a.checkoutSessionId,a.magicToken,$,E]),r?e.jsx("div",{className:"fixed inset-0 z-[110] flex items-end justify-center bg-[#041b20]/85 p-2 pb-[calc(env(safe-area-inset-bottom)+8px)] backdrop-blur-sm sm:items-center sm:p-5","data-app-overlay-open":"true","data-scroll-lock-owner":"ativo-editorial-inline-payment",role:"dialog","aria-modal":"true","aria-labelledby":"ativo-payment-title","data-testid":"dialog-ativo-inline-payment",children:e.jsxs("div",{ref:q,style:{maxHeight:"var(--ativo-dialog-height, calc(100dvh - 16px))"},className:"relative flex min-h-0 w-full max-w-3xl flex-col overflow-hidden rounded-t-[28px] rounded-b-2xl border border-[#9af4e5]/25 bg-[#072932] text-white shadow-[0_26px_110px_rgba(0,12,16,.7)] sm:max-h-[calc(100dvh-40px)] sm:rounded-[28px]",children:[e.jsxs("header",{className:"relative shrink-0 border-b border-white/10 px-5 pb-5 pt-7 pr-16 sm:px-8 sm:pt-8",children:[e.jsx("button",{type:"button",onClick:u,disabled:j||I,"aria-label":"Fechar pagamento",className:"absolute right-4 top-4 flex h-11 w-11 items-center justify-center rounded-full border border-white/15 bg-white/5 text-[#d9efea] transition hover:border-[#f5cc62]/50 hover:text-[#fff0b5] focus-visible:outline-none focus-visible:ring-4 focus-visible:ring-[#f5cc62]/30 disabled:opacity-50",children:e.jsx(At,{className:"h-5 w-5","aria-hidden":"true"})}),e.jsx("p",{className:"text-[10px] font-black uppercase tracking-[.18em] text-[#9af4e5]",children:"Checkout seguro"}),e.jsx("h2",{id:"ativo-payment-title",className:"mt-2 text-2xl font-black tracking-[-.04em] sm:text-3xl",children:"Escolha como prefere pagar"}),g?.ativoPackage&&e.jsxs("div",{className:"mt-4 flex items-start justify-between gap-4 roun
1ded-2xl border border-[#f5cc62]/25 bg-[#f5cc62]/8 px-4 py-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-[9px] font-black uppercase tracking-[.14em] text-[#f5cc62]",children:"Pacote escolhido"}),e.jsx("p",{className:"mt-1 text-sm font-bold leading-5 text-[#f5fdf9]",children:g.ativoPackage.title}),e.jsx("p",{className:"mt-1 truncate text-xs text-[#96b8b4]",children:g.session.bookTitle})]}),e.jsx("strong",{className:"shrink-0 text-xl font-black text-[#f5cc62]",children:nt(re,g.session.currency)})]})]}),e.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto overscroll-contain px-4 py-5 pb-[calc(env(safe-area-inset-bottom)+20px)] sm:px-8 sm:py-7",children:[B&&e.jsxs("div",{className:"flex min-h-52 items-center justify-center gap-3 text-sm text-[#a7c8c3]",children:[e.jsx(H,{className:"h-5 w-5 animate-spin text-[#f5cc62]"})," Carregando checkout..."]}),!B&&E&&e.jsxs("div",{className:"py-10 text-center","data-testid":"ativo-payment-success",children:[e.jsx("span",{className:"mx-auto flex h-20 w-20 items-center justify-center rounded-full bg-emerald-400/15 ring-8 ring-emerald-400/5",children:e.jsx(Ze,{className:"h-10 w-10 text-emerald-300","aria-hidden":"true"})}),e.jsx("h3",{className:"mt-6 text-2xl font-black",children:"Pagamento confirmado"}),e.jsx("p",{className:"mx-auto mt-2 max-w-md text-sm leading-6 text-[#a8c8c3]",children:"Seu livro e todas as entregas do pacote já entraram no fluxo de produção."}),e.jsx("p",{className:"mt-5 text-xs font-bold uppercase tracking-[.12em] text-[#f5cc62]",children:"Abrindo sua continuidade segura..."})]}),!B&&!E&&g&&e.jsxs("div",{className:"space-y-5",children:[e.jsxs("section",{className:"rounded-2xl border border-white/10 bg-white/[.025] p-4 sm:p-5","aria-labelledby":"ativo-payment-contact",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("h3",{id:"ativo-payment-contact",className:"text-sm font-black",children:"Seus dados"}),e.jsx("p",{className:"mt-1 text-xs text-[#8fb2ad]",children:"Usados para identificar e entregar sua compra."})]}),!Te&&!U&&e.jsx("button",{type:"button",onClick:xe,className:"text-xs font-bold text-[#9af4e5] underline underline-offset-4",children:"Corrigir"})]}),Te?e.jsxs("div",{className:"mt-4 grid gap-3 sm:grid-cols-2",children:[e.jsxs("label",{className:"text-xs font-bold text-[#b8d6d1] sm:col-span-2",children:["Nome",e.jsx("input",{type:"text",inputMode:"text",enterKeyHint:"next",value:v.name,onChange:o=>D(m=>({...m,name:o.target.value})),autoComplete:"name",className:"mt-1.5 h-11 w-full rounded-xl border border-white/12 bg-[#041d24] px-3 text-sm text-white outline-none transition focus:border-[#9af4e5] focus:ring-4 focus:ring-[#9af4e5]/10"})]}),e.jsxs("label",{className:"text-xs font-bold text-[#b8d6d1]",children:["E-mail",e.jsx("input",{type:"email",inputMode:"email",enterKeyHint:"next",value:v.email,onChange:o=>D(m=>({...m,email:o.target.value})),autoComplete:"email",className:"mt-1.5 h-11 w-full rounded-xl border border-white/12 bg-[#041d24] px-3 text-sm text-white outline-none transition focus:border-[#9af4e5] focus:ring-4 focus:ring-[#9af4e5]/10"})]}),e.jsxs("label",{className:"text-xs font-bold text-[#b8d6d1]",children:["WhatsApp",e.jsx("input",{type:"tel",inputMode:"tel",enterKeyHint:"done",value:v.phone,onChange:o=>D(m=>({...m,phone:o.target.value})),autoComplete:"tel",className:"mt-1.5 h-11 w-full rounded-xl border border-white/12 bg-[#041d24] px-3 text-sm text-white outline-none transition focus:border-[#9af4e5] focus:ring-4 focus:ring-[#9af4e5]/10"})]})]}):e.jsxs("p",{className:"mt-3 text-xs leading-5 text-[#c7ddd8]",children:[v.name," · ",v.email," · ",v.phone]})]}),!U&&e.jsxs("section",{"aria-labelledby":"ativo-payment-methods",children:[e.jsx("h3",{id:"ativo-payment-methods",className:"text-sm font-black",children:"Forma de pagamento"}),e.jsxs("div",{className:"mt-3 grid gap-3 sm:grid-cols-2",children:[e.jsxs("button",{type:"button",onClick:()=>Ee("pix"),disabled:j,className:"group rounded-2xl border border-[#9af4e5]/30 bg-[#0a3b41] p-5 text-left transition hover:-translate-y-0.5 hover:border-[#9af4e5]/70 focus-visible:outline-none focus-visible:ring-4 focus-visible:ring-[#9af4e5]/20 disabled:opacity-60","data-testid":"ativo-select-pix",children:[e.jsx("span",{className:"flex h-11 w-11 items-center justify-center rounded-xl bg-[#9af4e5]/12 text-[#9af4e5]",children:e.jsx(Rt,{className:"h-5 w-5","aria-hidden":"true"})}),e.jsx("strong",{className:"mt-4 block text-base",children:"PIX"}),e.jsx("span",{className:"mt-1 block text-xs leading-5 text-[#91b4af]",children:"QR Code e copia-e-cola. Confirmação automática."})]}),e.jsxs("button",{type:"button",onClick:()=>Ee("card"),disabled:j,className:"group rounded-2xl border border-[#f5cc62]/35 bg-[#4b3d1d]/35 p-5 text-left transition hover:-translate-y-0.5 hover:border-[#f5cc62]/75 focus-visible:outline-none focus-visible:ring-4 focus-visible:ring-[#f5cc62]/20 disabled:opacity-60","data-testid":"ativo-select-card",children:[e.jsx("span",{className:"flex h-11 w-11 items-center justify-center rounded-xl bg-[#f5cc62]/12 text-[#f5cc62]",children:e.jsx(pt,{className:"h-5 w-5","aria-hidden":"true"})}),e.jsx("strong",{className:"mt-4 block text-base",children:"Cartão de Crédito"}),e.jsx("span",{className:"mt-1 block text-xs leading-5 text-[#bcae83]",children:"Processado com segurança pela Stripe."})]}),be&&e.jsxs("button",{type:"button",onClick:pe,disabled:j||Z,className:"group rounded-2xl border border-white/15 bg-white/[.03] p-5 text-left transition hover:-translate-y-0.5 hover:border-white/40 focus-visible:outline-none focus-visible:ring-4 focus-visible:ring-white/15 disabled:opacity-60 sm:col-span-2","data-testid":"ativo-select-greenn",children:[e.jsx("span",{className:"flex h-11 w-11 items-center justify-center rounded-xl bg-white/10 text-white",children:Z?e.jsx(H,{className:"h-5 w-5 animate-spin","aria-hidden":"true"}):e.jsx(Tt,{className:"h-5 w-5","aria-hidden":"true"})}),e.jsx("strong",{className:"mt-4 block text-base",children:Z?"Abrindo checkout seguro...":"Pagar na Greenn"}),e.jsx("span",{className:"mt-1 block text-xs leading-5 text-[#9db8b3]",children:"Cartão parcelado ou boleto em ambiente externo seguro. A confirmação é automática."})]})]})]}),j&&e.jsxs("div",{className:"flex min-h-32 items-center justify-center gap-3 rounded-2xl border border-white/10 bg-white/[.02] text-sm text-[#a7c8c3]",children:[e.jsx(H,{className:"h-5 w-5 animate-spin text-[#f5cc62]"})," Preparando pagamento..."]}),!j&&U==="pix"&&d&&e.jsxs("section",{className:"rounded-2xl border border-[#9af4e5]/20 bg-[#061f27] p-4 sm:p-6","data-testid":"ativo-pix-payment",children:[e.jsx("div",{className:"mx-auto flex h-52 w-52 items-center justify-center rounded-2xl bg-white p-4 shadow-xl",children:e.jsx(Jt,{brCode:d.qrCode,qrCodeImage:d.imageUrl||void 0,className:"h-full w-full object-contain",testId:"ativo-pix-qr"})}),e.jsx("p",{className:"mt-4 text-center text-sm text-[#b4d0cb]",children:"Escaneie o QR Code ou copie o código PIX."}),e.jsxs("button",{type:"button",onClick:je,className:"mt-4 flex min-h-12 w-full items-center justify-between gap-3 rounded-xl border border-white/10 bg-white/[.035] px-4 text-left text-xs text-[#d6e8e4] transition hover:bg-white/[.06]","data-testid":"ativo-copy-pix",children:[e.jsx("span",{className:"truncate font-mono",children:d.qrCode}),e.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1.5 font-black text-[#9af4e5]",children:[Se?e.jsx(Ze,{className:"h-4 w-4"}):e.jsx(Ot,{className:"h-4 w-4"}),Se?"Copiado":"Copiar"]})]}),e.jsxs("p",{className:"mt-4 flex items-center justify-center gap-2 text-xs text-[#86aaa5]",children:[e.jsx(H,{className:"h-3.5 w-3.5 animate-spin"})," Aguardando confirmação do banco"]})]}),!j&&U==="card"&&c&&e.jsx(ea,{cardData:c,amountLabel:nt(re,g.session.currency),processing:I,setProcessing:_,onError:P,onConfirmed:$,checkout:a}),_e&&e.jsxs("div",{role:"alert",className:"rounded-xl border border-red-300/25 bg-red-950/55 px-4 py-3 text-center text-xs font-bold leading-5 text-red-100",children:[e.jsx("p",{children:_e}),he&&!j&&e.jsxs("button",{type:"button",onClick:()=>Ee(he),className:"mt-3 inline-flex min-h-10 items-center justify-center rounded-xl border border-red-100/30 px-4 py-2 text-xs font-black text-white underline underline-offset-4 transition hover:bg-white/10 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/70",children:["Tentar ",he==="pix"?"PIX":"cartão"," novamente"]})]}),e.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-x-5 gap-y-2 pt-1 text-[10px] font-bold uppercase tracking-[.08em] text-[#789f9a]",children:[e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx(Lt,{className:"h-3.5 w-3.5 text-[#9af4e5]"})," Dados protegidos"]}),e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx(ut,{className:"h-3.5 w-3.5 text-[#f5cc62]"})," Cobrança validada no servidor"]})]})]})]})]})}):null}function ea({cardData:r,amountLabel:a,processing:u,setProcessing:p,onError:w,onConfirmed:h,checkout:N}){const g=s.useMemo(()=>qt(r.publishableKey),[r.publishableKey]);return e.jsx(Dt,{stripe:g,options:{clientSecret:r.clientSecret,appearance:{theme:"night",labels:"floating",variables:{colorPrimary:"#f5cc62",colorBackgroun
1d:"#061f27",colorText:"#effcf7",colorDanger:"#ff9f91",borderRadius:"12px"}}},children:e.jsx(ta,{cardData:r,amountLabel:a,processing:u,setProcessing:p,onError:w,onConfirmed:h,checkout:N})},r.clientSecret)}function ta({cardData:r,amountLabel:a,processing:u,setProcessing:p,onError:w,onConfirmed:h,checkout:N}){const g=Ut(),J=$t();async function v(){for(let U=0;U<3;U+=1){const y=await te(`/api/checkout/${N.checkoutSessionId}/confirm-card-payment`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:N.magicToken,paymentIntentId:r.paymentIntentId})},3e4),d=await Re(y);if(d.status==="paid")return!0;if(d.status!=="processing")return!1;await new Promise(O=>window.setTimeout(O,2e3))}return!1}async function D(U){if(U.preventDefault(),!(!g||!J||u)){p(!0),w("");try{const y=await g.confirmPayment({elements:J,confirmParams:{return_url:window.location.href},redirect:"if_required"});if(y.error)throw new Error(y.error.message||"O cartão não foi aprovado.");if(await v()){h();return}w("O pagamento está sendo processado. Esta tela será atualizada automaticamente.")}catch(y){p(!1),w(y instanceof Error?y.message:"Não foi possível confirmar o cartão.")}}}return e.jsxs("form",{onSubmit:D,className:"rounded-2xl border border-[#f5cc62]/20 bg-[#061f27] p-4 sm:p-6","data-testid":"ativo-stripe-payment",children:[e.jsx(Mt,{options:{layout:"tabs",fields:zt(!1),paymentMethodOrder:["card"]}}),e.jsx("button",{type:"submit",disabled:!g||!J||u,className:"mt-5 inline-flex min-h-14 w-full items-center justify-center gap-2 rounded-2xl bg-[#f5cc62] px-5 text-sm font-black text-[#173538] shadow-[0_14px_34px_rgba(245,204,98,.2)] transition hover:bg-[#ffe39a] focu
1s-visible:outline-none focus-visible:ring-4 focus-visible:ring-[#f5cc62]/35 disabled:cursor-wait disabled:opacity-60","data-testid":"ativo-confirm-card",children:u?e.jsxs(e.Fragment,{children:[e.jsx(H,{className:"h-4 w-4 animate-spin"})," Processando cartão..."]}):e.jsxs(e.Fragment,{children:[e.jsx(pt,{className:"h-4 w-4"})," Pagar ",a]})}),e.jsxs("p",{className:"mt-3 flex items-center justify-center gap-1.5 text-[10px] font-bold uppercase tracking-[.08em] text-[#86aaa5]",children:[e.jsx(ut,{className:"h-3.5 w-3.5"})," Cartão processado pela Stripe"]})]})}const aa="/assets/gabriel_fundador_ativo-D5R36BP7.webp",sa=2e6,Ke="ativo-editorial-plan-token",Ge="ativo-editorial-inline-checkout",Fe="ativo-editorial-plan-start-request-key";let ye="";const De=["Conte o que você sabe, viveu ou quer ensinar. Vamos transformar isso em um livro.","Nós escrevemos seu livro, criamos a capa, publicamos na ÁPICE Books e entregamos uma página de vendas para você colocar sua obra no mercado.","Me conte sua ideia. Seu planejamento gratuito começa agora."];function ot(){try{return new URLSearchParams(window.location.search).get("resume")||sessionStorage.getItem(Ke)||""}catch{return""}}function Ve(r){try{sessionStorage.setItem(Ke,r)}catch{}}function lt(){try{sessionStorage.removeItem(Ke)}catch{}}function ra(){try{const r=localStorage.getItem(Fe);if(r)return r;const a=ye||crypto.randomUUID();return ye=a,localStorage.setItem(Fe,a),a}catch{return ye||(ye=crypto.randomUUID()),ye}}function na(){ye="";try{localStorage.removeItem(Fe)}catch{}}function ct(r){if(!r)return null;const a=new Date(r);return Number.isFinite(a.getTime())?a.toLocaleTimeString("pt-BR",{hour:"2-digit",minute:"2-digit"}):null}function dt(r){try{const a=JSON.parse(sessionStorage.getItem(Ge)||"null");if(a?.planToken!==r)return null;const u=a?.checkout;return!u?.checkoutSessionId||!u?.magicToken||u.packageId!=="apice"&&u.packageId!=="complete"?null:u}catch{return null}}function mt(){try{sessionStorage.removeItem(Ge)}catch{}}function A(r,a={}){try{window.gtag?.("event",r,{event_category:"ativo_editorial_entry",transport_type:"beacon",...a})}catch{}try{window.fbq?.("trackCustom","AtivoEditorialEntryOffer",{entry_event:r,...a})}catch{}}function ia(){const r=new URLSearchParams(window.location.search),a=new URLSearchParams({src:"ativo_editorial"});for(const u of["utm_source","utm_medium","utm_campaign","utm_content","utm_term","fbclid"]){const p=r.get(u);p&&a.set(u,p)}window.location.assign(`/create-my-book?${a.toString()}`)}function oa(r){return r?.name?r.email?r.phone?"processing":"whatsapp":"email":"name"}function la(r){const a=r.muxPlaybackId||r.playbackUrl?.match(/stream\.mux\.com\/([^/.]+)/i)?.[1];if(a)return`https://image.mux.com/${encodeURIComponent(a)}/thumbnail.jpg?time=1&width=720&height=1280&fit_mode=crop`}function ca({value:r,label:a,index:u}){const p=s.useRef(null),[w,h]=s.useState(!1),N=la(r);async function g(){h(!0);try{await p.current?.play()}catch{}}return e.jsxs("article",{className:"group mx-auto w-full max-w-[300px]",children:[e.jsxs("div",{className:"relative aspect-[9/16] overflow-hidden rounded-[30px] border border-[#9af4e5]/35 bg-[#071c25] shadow-[0_24px_55px_rgba(0,0,0,.32)] transition duration-300 group-hover:-translate-y-1 group-hover:border-[#9af4e5]/70",children:[e.jsx("video",{ref:p,src:r.playbackUrl,poster:N,controls:w,preload:"none",playsInline:!0,onPlay:()=>h(!0),className:"absolute inset-0 h-full w-full object-cover"}),!w&&e.jsxs(e.Fragment,{children:[e.jsx("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 bg-gradient-to-t from-[#03151d]/90 via-[#03151d]/10 to-transparent"}),e.jsx("button",{type:"button",onClick:g,className:"absolute inset-0 flex items-center justify-center focus-visible:outline-none focus-visible:ring-4 focus-visible:ring-[#9af4e5]/60","aria-label":`Reproduzir ${a}`,children:e.jsx("span",{className:"flex h-16 w-16 items-center justify-center rounded-full border border-white/70 bg-[#9af4e5]/95 pl-1 text-[#063440] shadow-[0_12px_32px_rgba(0,0,0,.35)] transition duration-300 group-hover:scale-110",children:e.jsx(Ht,{className:"h-7 w-7 fill-current","aria-hidden":"true"})})}),e.jsxs("div",{className:"pointer-events-none absolute inset-x-0 bottom-0 p-5",children:[e.jsxs("span",{className:"inline-flex rounded-full border border-white/25 bg-[#041821]/55 px-2.5 py-1 text-[9px] font-black uppercase tracking-[.14em] text-[#eafff9] backdrop-blur",children:["História real ",String(u+1).padStart(2,"0")]}),e.jsx("p",{className:"mt-2 text-sm font-bold text-white",children:a})]})]})]}),e.jsx("p",{className:"mt-3 text-center text-[10px] font-black uppercase tracking-[.16em] text-[#9af4e5]",children:"Vídeo vertical · toque para assistir"})]})}function da({onCta:r}){const a=[["customer_video_01","Vídeo de cliente 01"],["customer_video_02","Vídeo de cliente 02"],["customer_video_03","Vídeo de cliente 03"],["customer_video_04","Vídeo de cliente 04"]],u=[{title:"Ansible for DevOps",copies:"87.234 cópias",result:"mais de US$ 300 mil",coverStyle:"linear-gradient(145deg,#e34b45 0%,#8d171b 62%,#350c12 100%)",source:"Jeff Geerling · jeffgeerling.com/blog/2023/self-publishing-technical-book-10-years/",href:"https://www.jeffgeerling.com/blog/2023/self-publishing-technical-book-10-years/"},{title:"100 Days of Growth",copies:"40.000 cópias",result:"resultado compartilhado pelo autor",coverStyle:"linear-gradient(145deg,#f5cc62 0%,#df7a4f 55%,#76314d 100%)",source:"Sujan Patel · sujanpatel.com/marketing/ebook-sales/",href:"https://sujanpatel.com/marketing/ebook-sales/"},{title:"The Pathless Path",copies:"50.000 cópias",result:"resultado compartilhado pelo autor",coverStyle:"linear-gradient(145deg,#a8e5d9 0%,#3d8987 56%,#15394d 100%)",source:"Paul Millerd · newsletter.pathlesspath.com/p/i-sold-50k-books-and-i-didnt-predict",href:"https://newsletter.pathlesspath.com/p/i-sold-50k-books-and-i-didnt-predict"}];return e.jsxs("div",{id:"ativo-historia",className:"ativo-deferred mt-24 scroll-mt-8 space-y-24 border-t border-[#8ff1e1]/15 pt-20",children:[e.jsxs("section",{className:"grid items-end gap-10 lg:grid-cols-[.86fr_1.14fr]",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] font-black uppercase tracking-[.25em] text-[#f5cc62]",children:"Uma mensagem do fundador"}),e.jsx("h2",{className:"mt-4 max-w-xl text-4xl font-semibold leading-[.95] tracking-[-.06em] text-[#f3fffc] sm:text-6xl",children:"Eu sei a distância entre ter conhecimento e conseguir vender um livro."}),e.jsxs("p",{className:"mt-6 max-w-lg text-base leading-8 text-[#b5d0d0]",children:["Antes da IA, investi mais de ",e.jsx("strong",{className:"text-white",children:"R$ 20 mil e um ano de trabalho"})," para preparar o texto do meu primeiro livro. E, mesmo com o texto pronto, ainda faltavam capa, publicação e uma estrutura para apresentar aquela obra ao mercado."]}),e.jsx("p",{className:"mt-4 max-w-lg text-base leading-8 text-[#b5d0d0]",children:"Criei a SÁBHIA para reunir essas etapas. Seu livro continua sendo sua voz;
1 nós entregamos a estrutura para ele deixar de ficar parado e poder ser publicado, apresentado e colocado à venda."}),e.jsxs("button",{type:"button",onClick:r,className:"ativo-cta ativo-flow-cta ativo-sheen relative mt-8 inline-flex items-center gap-3 overflow-hidden rounded-2xl px-6 py-4 text-sm font-black text-[#063440] transition hover:-translate-y-0.5",children:[e.jsx("span",{className:"relative z-10",children:"COMEÇAR MEU LIVRO PARA VENDER"}),e.jsx(z,{className:"relative z-10 h-4 w-4"})]})]}),e.jsxs("figure",{className:"relative overflow-hidden rounded-[32px] border border-[#9af4e5]/20 bg-[#0b3038] shadow-[0_30px_90px_rgba(0,0,0,.35)]",children:[e.jsx("img",{src:aa,alt:"Gabriel Rockenbach, fundador da SÁBHIA",loading:"lazy",decoding:"async",className:"aspect-[4/3] w-full object-cover object-[center_22%] grayscale-[.12]"}),e.jsxs("figcaption",{className:"absolute inset-x-0 bottom-0 bg-gradient-to-t from-[#061c27] via-[#061c27]/90 to-transparent px-6 pb-6 pt-20",children:[e.jsx("span",{className:"block text-sm font-semibold text-[#eafcf8]",children:"Gabriel Rockenbach · fundador da SÁBHIA"}),e.jsx("span",{className:"mt-2 block text-[10px] font-black uppercase tracking-[.14em] text-[#9af4e5]",children:"100 mil+ autores · 140 mil+ livros criados em 2 anos"})]})]})]}),e.jsxs("section",{children:[e.jsxs("div",{className:"max-w-2xl",children:[e.jsx("p",{className:"text-[10px] font-black uppercase tracking-[.25em] text-[#86eadc]",children:"Veja antes de decidir"}),e.jsx("h2",{className:"mt-4 text-4xl font-semibold leading-none tracking-[-.06em] text-white sm:text-6xl",children:"O livro é o começo. A oferta pronta é o que muda o jogo."}),e.jsx("p",{className:"mt-5 text-base leading-7 text-[#b5d0d0]",children:"Aqui entram histórias reais de autores e do caminho entre uma ideia, uma obra publicada e uma página pronta para apresentá-la a compradores."})]}),e.jsx("div",{className:"mt-9 grid items-start gap-6 sm:grid-cols-2",children:a.map(([p,w],h)=>e.jsx(Xt,{blockId:p,children:N=>N?.status==="ready"&&N.playbackUrl?e.jsx(ca,{value:N,label:w,index:h}):e.jsxs("div",{className:"mx-auto flex w-full max-w-[300px] aspect-[9/16] flex-col justify-between rounded-[30px] border border-dashed border-[#9af4e5]/25 bg-[#0a2a34] p-5",children:[e.jsxs("span",{className:"text-[10px] font-black uppercase tracking-[.22em] text-[#86eadc]",children:["Vídeo ",String(h+1).padStart(2,"0")]}),e.jsxs("div",{children:[e.jsx("div",{className:"mb-4 h-12 w-12 rounded-full border border-[#f5cc62]/60 bg-[#f5cc62]/10"}),e.jsx("p",{className:"text-xl font-semibold leading-tight text-white",children:w}),e.jsx("p",{className:"mt-2 text-xs leading-5 text-[#9bbaba]",children:"Espaço reservado para uma história real de publicação."})]})]})},p))}),e.jsx("div",{className:"mt-8 text-center",children:e.jsxs("button",{type:"button",onClick:r,className:"ativo-cta ativo-flow-cta ativo-sheen relative inline-flex items-center gap-3 overflow-hidden rounded-2xl px-6 py-4 text-sm font-black text-[#063440] transition hover:-translate-y-0.5",children:[e.jsx("span",{className:"relative z-10",children:"COMEÇAR MEU LIVRO PARA VENDER"}),e.jsx(z,{className:"relative z-10 h-4 w-4"})]})})]}),e.jsxs("section",{className:"rounded-[32px] border border-[#f5cc62]/25 bg-[#112f35] p-6 sm:p-10",children:[e.jsxs("div",{className:"grid gap-10 lg:grid-cols-[.8fr_1.2fr]",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] font-black uppercase tracking-[.25em] text-[#f5cc62]",children:"A estrutura que normalmente falta"}),e.jsx("h2",{className:"mt-4 text-4xl font-semibold leading-[.96] tracking-[-.06em] text-white sm:text-5xl",children:"A partir de R$ 99,99, você não compra só um texto. Você recebe um livro pronto para ir ao mercado."}),e.jsx("p",{className:"mt-5 text-sm leading-7 text-[#bad1cd]",children:"Livro, capa, publicação e página de vendas em um só pacote. A divulgação e os resultados dependem do autor, do tema e do público — mas a estrutura para começar a vender já vem pronta."}),e.jsxs("button",{type:"button",onClick:r,className:"ativo-cta ativo-flow-cta ativo-sheen relative mt-7 inline-flex items-center gap-3 overflow-hidden rounded-2xl px-5 py-3.5 text-sm font-black text-[#063440] transition hover:-translate-y-0.5",children:[e.jsx("span",{className:"relative z-10",children:"CRIAR MEU PLANEJAMENTO GRATUITO"}),e.jsx(z,{className:"relative z-10 h-4 w-4"})]})]}),e.jsxs("div",{className:"grid gap-3 sm:grid-cols-3",children:[e.jsxs("div",{className:"rounded-2xl border border-white/10 bg-[#0a252e] p-5",children:[e.jsx("span",{className:"text-[9px] font-black uppercase tracking-[.16em] text-[#91afaf]",children:"A experiência do fundador"}),e.jsx("p",{className:"mt-8 text-2xl font-black leading-none text-white",children:"1 ano + R$ 20 mil"}),e.jsx("p",{className:"mt-3 text-xs leading-5 text-[#91afaf]",children:"Investidos apenas na preparação do texto do primeiro livro."})]}),e.jsxs("div",{className:"rounded-2xl border border-white/10 bg-[#0a252e] p-5",children:[e.jsx("span",{className:"text-[9px] font-black uppercase tracking-[.16em] text-[#91afaf]",children:"O que ainda faltava"}),e.jsx("p",{className:"mt-8 text-2xl font-black leading-none text-white",children:"Capa + publicação + venda"}),e.jsx("p",{className:"mt-3 text-xs leading-5 text-[#91afaf]",children:"Um texto sozinho não resolve a etapa de colocar uma obra diante de compradores."})]}),e.jsxs("div",{className:"rounded-2xl border border-[#f5cc62]/50 bg-[linear-gradient(145deg,rgba(245,204,98,.17),rgba(10,37,46,.92))] p-5 shadow-[0_18px_42px_rgba(0,0,0,.25)]",children:[e.jsx("span",{className:"text-[9px] font-black uppercase tracking-[.16em] text-[#f5cc62]",children:"Ativo Editorial ÁPICE"}),e.jsx("p",{className:"mt-8 text-3xl font-black leading-none text-[#f5cc62]",children:"R$ 99,99"}),e.jsx("p",{className:"mt-3 text-xs leading-5 text-[#e8ddba]",children:"Livro, capa, publicação, página de vendas e experiência de leitura."})]})]})]}),e.jsx("p",{className:"mt-5 text-center text-[10px] leading-5 text-[#829f9f]",children:"Valores de serviços tradicionais variam por profissional e escopo. A comparação usa a experiência relatada pelo fundador e referências editoriais apresentadas nesta página. Reembolso dis
1ponível em até 7 dias, conforme os termos aplicáveis."})]}),e.jsxs("section",{children:[e.jsx("p",{className:"text-[10px] font-black uppercase tracking-[.25em] text-[#86eadc]",children:"Referências públicas independentes"}),e.jsxs("div",{className:"mt-4 flex flex-col justify-between gap-5 sm:flex-row sm:items-end",children:[e.jsx("h2",{className:"max-w-2xl text-4xl font-semibold leading-none tracking-[-.06em] text-white sm:text-5xl",children:"Livros podem virar receita quando são tratados como um produto."}),e.jsx("p",{className:"max-w-xs text-xs leading-5 text-[#91afaf]",children:"Exemplos de mercado, não resultados ou promessa da SÁBHIA."})]}),e.jsx("div",{className:"mt-9 grid gap-4 lg:grid-cols-3",children:u.map(p=>e.jsxs("article",{className:"group flex min-h-[310px] flex-col overflow-hidden rounded-[26px] border border-[#9af4e5]/15 bg-[#092932] p-6 transition hover:-translate-y-1 hover:border-[#9af4e5]/45",children:[e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsx("p",{className:"text-[10px] font-black uppercase tracking-[.18em] text-[#f5cc62]",children:"Caso público independente"}),e.jsx("div",{"aria-hidden":"true",className:"relative h-28 w-20 shrink-0 rotate-3 rounded-r-sm p-3 shadow-[-8px_7px_0_rgba(4,24,31,.72),0_16px_26px_rgba(0,0,0,.35)] transition duration-500 group-hover:rotate-0",style:{background:p.coverStyle},children:e.jsx("span",{className:"block border-t border-white/50 pt-3 text-[7px] font-black uppercase leading-tight tracking-[.12em] text-white/90",children:p.title})})]}),e.jsx("h3",{className:"mt-4 text-2xl font-bold text-white",children:p.title}),e.jsx("p",{className:"mt-auto text-3xl font-black tracking-[-.04em] text-[#9af4e5]",children:p.copies}),e.jsx("p",{className:"mt-1 text-xs font-semibold text-[#bdd5d0]",children:p.result}),e.jsx("a",{href:p.href,target:"_blank",rel:"noreferrer",className:"mt-5 text-[11px] leading-5 text-[#86eadc] underline decoration-[#86eadc]/30 underline-offset-4",children:p.source})]},p.title))}),e.jsx("p",{className:"mt-5 text-center text-xs leading-5 text-[#89a8a8]",children:"Estes são resultados de terceiros, em contextos específicos. Vendas e receita dependem de tema, preço, divulgação, audiência e execução; eles não representam promessa de resultado da SÁBHIA."})]}),e.jsxs("section",{className:"pb-12 text-center",children:[e.jsx("h2",{className:"mx-auto max-w-3xl text-4xl font-semibold leading-none tracking-[-.06em] text-white sm:text-6xl",children:"Sua ideia não precisa continuar parada. Ela pode virar uma oferta de verdade."}),e.jsxs("button",{type:"button",onClick:r,className:"ativo-cta ativo-flow-cta ativo-sheen relative mt-8 inline-flex items-center gap-3 overflow-hidden rounded-2xl px-7 py-4 text-sm font-black text-[#063440] transition hover:-translate-y-0.5",children:[e.jsx("span",{className:"relative z-10",children:"COMEÇAR MEU LIVRO PARA VENDER"}),e.jsx(z,{className:"relative z-10 h-4 w-4"})]})]})]})}function ma({status:r,phase:a,resultQuality:u,attempts:p,queuedAt:w,startedAt:h,idea:N,title:g,aiChoosingTitle:J}){const v=[{label:"Livro escrito",detail:"estrutura, capítulos e texto com direção editorial",icon:ft},{label:"Capa profissional",detail:"uma primeira impressão pronta para representar sua obra",icon:ht},{label:"Publicação na ÁPICE BOOKS / SÁBHIA",detail:"seu livro preparado para entrar na vitrine",icon:Ae},{label:"Página de vendas",detail:"uma apresentação clara para ajudar leitores a decidir",icon:z},{label:"Aplicativo e comunidade de leitores",detail:"uma experiência para ler, compartilhar e acompanhar",icon:xt}],[D,U]=s.useState(0),[y,d]=s.useState(!1);s.useEffect(()=>{const I=window.matchMedia("(prefers-reduced-motion: reduce)"),_=()=>d(I.matches);return _(),I.addEventListener?.("change",_),()=>{I.removeEventListener?.("change",_)}},[]),s.useEffect(()=>{if(y)return;const I=window.setInterval(()=>U(_=>(_+1)%v.length),3e3);return()=>window.clearInterval(I)},[v.length,y]);const O=v[D],c=O.icon,X=String(a||r||"processing").toLowerCase(),B=["queued","pending","waiting"].includes(X)?"Na fila segura de produção":["processing","generating","generation","running","planning","drafting","retrying"].includes(X)?"Produção editorial em andamento":"Finalizando os últimos detalhes",F=ct(w),j=ct(h),K=[a?`Etapa: ${a.replace(/[_-]+/g," ")}`:null,u?`Qualidade: ${u.replace(/[_-]+/g," ")}`:null,typeof p=="number"&&p>0?`Tentativas: ${p}`:null,F?`Na fila desde ${F}`:null,j?`Em produção desde ${j}
1`:null].filter(Boolean);return e.jsx("div",{className:"ativo-rise py-1 sm:py-5",role:"status","aria-live":"polite","aria-atomic":"false",children:e.jsxs("div",{className:"relative overflow-hidden rounded-[22px] border border-[#9af4e5]/25 bg-[linear-gradient(145deg,rgba(13,61,68,.96),rgba(6,30,40,.96))] px-4 py-5 text-left shadow-[0_24px_70px_rgba(0,0,0,.28)] sm:rounded-[28px] sm:px-8 sm:py-8",children:[e.jsx("div",{"aria-hidden":"true",className:"pointer-events-none absolute -right-20 -top-24 h-56 w-56 rounded-full bg-[#9af4e5]/10 blur-3xl"}),e.jsxs("div",{className:"relative",children:[e.jsxs("div",{className:"flex items-start gap-3 sm:gap-4",children:[e.jsxs("div",{className:"relative mt-0.5 flex h-9 w-9 shrink-0 items-center justify-center rounded-xl border border-[#9af4e5]/35 bg-[#9af4e5]/10 text-[#9af4e5] sm:h-11 sm:w-11 sm:rounded-2xl",children:[e.jsx("span",{className:"absolute inset-1 rounded-xl border border-[#9af4e5]/20","aria-hidden":"true"}),e.jsx(H,{className:`relative h-5 w-5 ${y?"":"animate-spin"}`,"aria-hidden":"true"})]}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-[10px] font-black uppercase tracking-[.2em] text-[#9af4e5]",children:"Seu ativo editorial está sendo preparado"}),e.jsx("h1",{className:"mt-1.5 text-[21px] font-bold leading-[1.08] tracking-[-.04em] text-white sm:mt-2 sm:text-[32px]",children:"Sua ideia já entrou em produção."}),e.jsx("p",{className:"mt-2 max-w-xl text-xs leading-5 text-[#b7d8d4] sm:mt-3 sm:text-sm sm:leading-6",children:"Estamos transformando o que você trouxe no planejamento estratégico do seu livro. Quando ele ficar pronto, você verá o mapa da obra e poderá decidir se quer produzir o pacote completo."})]})]}),e.jsxs("div",{className:"mt-4 rounded-2xl border border-[#9af4e5]/20 bg-[#041f29]/60 p-3 sm:mt-6 sm:p-4",children:[e.jsx("p",{className:"text-[9px] font-black uppercase tracking-[.16em] text-[#86eadc]",children:"Base confirmada"}),e.jsx("p",{className:"mt-1 line-clamp-2 text-sm font-bold text-white",children:J?"A IA está escolhendo o título mais forte para esta ideia":g||"Título em preparação"}),e.jsx("p",{className:"mt-1 line-clamp-2 text-[11px] leading-4 text-[#9ebbb9]",children:N})]}),e.jsxs("div",{className:"mt-4 rounded-2xl border border-[#f5cc62]/30 bg-[#f5cc62]/[.08] p-3 sm:mt-7 sm:p-5",children:[e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsx("p",{className:"text-[10px] font-black uppercase tracking-[.16em] text-[#f5cc62]",children:B}),e.jsx("span",{className:"shrink-0 text-[10px] font-bold uppercase tracking-[.12em] text-[#c9dfd9]",children:"Atualização automática"})]}),e.jsx("div",{className:"mt-3 h-1.5 overflow-hidden rounded-full bg-[#092f38]","aria-hidden":"true",children:e.jsx("div",{className:"ativo-progress h-full w-2/5 rounded-full bg-[#f5cc62]"})}),e.jsx("p",{className:"mt-2 text-[11px] leading-4 text-[#c9deda] sm:mt-3 sm:text-xs sm:leading-5",children:"Pode manter esta página aberta. O plano aparecerá aqui automaticamente."}),K.length>0&&e.jsx("p",{className:"mt-2 text-[10px] font-bold uppercase tracking-[.1em] text-[#9ebbb9]",children:K.join(" · ")})]}),e.jsxs("div",{className:"mt-5 hidden gap-4 sm:grid sm:grid-cols-[1fr_auto] sm:items-end",children:[e.jsxs("div",{className:"min-h-[88px]",children:[e.jsx("p",{className:"text-[10px] font-black uppercase tracking-[.16em] text-[#8fb9b8]",children:"O que o Pacote ÁPICE reúne"}),e.jsxs("div",{className:`mt-3 flex items-start gap-3 ${y?"":"ativo-benefit-enter"}`,children:[e.jsx(c,{className:"mt-0.5 h-5 w-5 shrink-0 text-[#9af4e5]","aria-hidden":"true"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-lg font-bold leading-tight text-white",children:O.label}),e.jsx("p",{className:"mt-1 text-xs leading-5 text-[#a8c7c4]",children:O.detail})]})]},D)]}),e.jsxs("div",{className:"rounded-2xl border border-[#9af4e5]/20 bg-[#082b34]/70 px-4 py-3 sm:min-w-[190px]",children:[e.jsx("p",{className:"text-[10px] font-black uppercase tracking-[.14em] text-[#8fb9b8]",children:"Valor reunido"}),e.jsx("p",{className:"mt-1 text-2xl font-black leading-none text-[#f5cc62]",children:"aprox. R$ 5.000"}),e.jsx("p",{className:"mt-1 text-[11px] font-bold text-[#d4e7df]",children:"por 12x R$ 9,99"}),e.jsx("p",{className:"text-[11px] font-bold text-[#d4e7df]",children:"pacotes a partir de R$ 99,99"})]})]}),e.jsx("div",{className:"mt-6 hidden flex-wrap gap-x-4 gap-y-2 border-t border-white/10 pt-4 text-[10px] font-bold uppercase tracking-[.1em] text-[#8fb9b8] sm:flex",children:v.map((I,_)=>e.jsxs("span",{className:_===D?"text-[#f5cc62]":"",children:[String(_+1).padStart(2,"0")," · ",I.label]},I.label))}),e.jsx("p",{className:"mt-3 text-[10px] leading-4 text-[#9ebbb9] sm:mt-4 sm:text-[11px] sm:leading-5",children:"Se decidir continuar, a produção e a entrega normalmente acontecem em menos de uma hora."})]})]})})}function Pa(){const{user:r}=Vt(),[a,u]=s.useState(""),[p,w]=s.useState(""),[h,N]=s.useState(!1),[g,J]=s.useState(""),[v,D]=s.useState(""),[U,y]=s.useState(""),[d,O]=s.useState(ot),[c,X]=s.useState(null),[B,F]=s.useState(d?"processing":"idea"),[j,K]=s.useState("idea"),[I,_]=s.useState(!1),[E,fe]=s.useState(!1),[Se,R]=s.useState(""),[Te,ae]=s.useState(!!ot()),[_e,P]=s.useState(!1),[he,ne]=s.useState(""),[be,ie]=s.useState(!1),[Z,Q]=s.useState(""),[Ce,ge]=s.useState(!1),[oe,le]=s.useState(!1),[ve,ce]=s.useState(null),[de,ee]=s.useState(!1),[me,se]=s.useState(null),[L,q]=s.useState("idle"),[we,re]=s.useState(""),[$,pe]=s.useState(!0),[Ie,G]=s.useState(!1),[Ee,xe]=s.useState(!1),[je,o]=s.useState(!1),m=s.useRef(!1),x=s.useRef(!1),f=s.useRef(0),S=s.useRef(null),T=s.useRef(!1),k=c?.checkoutReady===!0&&c.status==="ready",M=!!(c?.contact?.name&&c.contact.email&&c.contact.phone),Pe=s.useMemo(()=>c?.plan.synopsis||c?.plan.premise||"",[c]),Y=L!=="idle";s.useEffect(()=>{r&&(J(t=>t||r.name?.trim()||""),D(t=>t||r.email?.trim()||""),y(t=>t||r.phone?.trim()||""))},[r]),s.useEffect(()=>{if(!k){o(!1);return}if(window.matchMedia("(min-width: 640px)").matches){o(!0);return}const t=window.setTimeout(()=>
1o(!0),7e3);return()=>window.clearTimeout(t)},[k,c?.title]),s.useEffect(()=>{d||m.current||(m.current=!0,A("entry_offer_viewed"))},[d]);async function Ue(t){const n=await fetch(`/api/ativo-editorial/landing/plan/${encodeURIComponent(t)}`),i=await n.json().catch(()=>({}));if(!n.ok)throw new Error(i?.message||"Este planejamento expirou. Comece novamente.");return X(i),_(i.status!=="ready"&&i.status!=="failed"),i}s.useEffect(()=>{const t=new URL(window.location.href),n=t.searchParams.get("resume");n&&(Ve(n),t.searchParams.delete("resume"),window.history.replaceState({},"",`${t.pathname}${t.search}${t.hash}`))},[]),s.useEffect(()=>{const t=new URLSearchParams(window.location.search).get("claim");if(!t)return;let n=!1;return P(!0),ne(""),fetch(`/api/ativo-editorial/landing/claim/${encodeURIComponent(t)}`,{method:"POST",credentials:"same-origin"}).then(async i=>{const l=await i.json().catch(()=>({}));if(!i.ok)throw new Error(l?.message||"Não foi possível abrir seu planejamento seguro.");if(n)return;Ve(l.resumeToken||t),O(l.resumeToken||t);const b=new URL(window.location.href);b.searchParams.delete("claim"),window.history.replaceState({},"",`${b.pathname}${b.search}${b.hash}`)}).catch(i=>{n||(ne(i?.message||"Este link de acesso expirou. Solicite um novo e-mail."),ae(!1))}).finally(()=>{n||P(!1)}),()=>{n=!0}},[]),s.useEffect(()=>{if(!d){ae(!1);return}let t=!1;return Ue(d).then(n=>{t||F(oa(n.contact))}).catch(n=>{t||(lt(),O(""),F("idea"),R(n.message))}).finally(()=>{t||ae(!1)}),()=>{t=!0}},[d]),s.useEffect(()=>{if(!d||!I)return;const t=window.setInterval(()=>{Ue(d).catch(()=>{})},3e3);return()=>window.clearInterval(t)},[d,I]),s.useEffect(()=>()=>{f.current+=1,S.current?.abort()},[]),s.useEffect(()=>{if(!(!d&&j==="idea"&&!a&&!Y&&$))return;if(window.matchMedia("(prefers-reduced-motion: reduce)").matches){re(De[0]);return}let i=!1;const l=C=>new Promise(V=>window.setTimeout(V,C));async function b(){re(""),await l(480);let C=0;for(;!i;){const V=De[C];for(let W=1;W<=V.length;W+=1){if(i)return;re(V.slice(0,W)),await l(22)}await l(1700);for(let W=V.length-1;W>=0;W-=2){if(i)return;re(V.slice(0,Math.max(0,W))),await l(13)}await l(320),C=(C+1)%De.length}}return b(),()=>{i=!0}},[j,Y,a,$,d]);function ue(){f.current+=1,S.current?.abort(),S.current=null,q("idle")}async function bt(t){if(!T.current){T.current=!0,R(""),fe(!0),A("title_submitted");try{const n=t?.idea??a,i=t?t.title:h?void 0:p,l=ra(),b=await fetch("/api/ativo-editorial/landing/start",{method:"POST",headers:{"Content-Type":"application/json","Idempotency-Key":l},body:JSON.stringify({idea:n,...i?{title:i}:{},resumeToken:d||void 0,requestKey:l})}),C=await b.json().catch(()=>({}));if(!b.ok)throw new Error(C?.message||"Não foi possível iniciar seu planejamento.");const V=String(C?.resumeToken||"");if(!V)throw new Error("Não foi possível retomar seu planejamento. Tente novamente.");na(),Ve(V),O(V),F("name"),_(!0),q("idle")}catch(n){R(n?.message||"Não foi possível iniciar seu planejamento."),q("idle")}finally{T.current=!1,fe(!1)}}}async function gt(t){t.preventDefault(),await bt()}async function $e(t,n){return await new Promise(i=>window.setTimeout(i,n)),f.current===t}async function He(t,n,i){if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return n(t),f.current===i;n("");const b=t.length>300?3:2;for(let C=b;C<t.length+b;C+=b)if(f.current!==i||(n(t.slice(0,C)),!await $e(i,22)))return!1;return!0}async function vt(){if(Y||T.current)return;ue();const t=f.current,n=new AbortController;S.current=n,R(""),pe(!1),u(""),w(""),N(!1),G(!1),xe(!1),K("idea"),q("requesting"),A("guided_idea_requested");try{const i=await fetch("/api/ativo-editorial/landing/idea-suggestion",{method:"POST",headers:{"Content-Type":"application/json"},signal:n.signal}),l=await i.json().catch(()=>({}));if(!i.ok)throw new Error(l?.message||"A IA não conseguiu criar uma ideia agora.");const b=String(l?.idea||"").trim(),C=String(l?.title||"").trim();if(b.length<20||C.length<3)throw new Error("A IA retornou uma sugestão incompleta. Tente novamente.");if(f.current!==t||(q("typing_idea"),!await He(b,u,t))||(G(!0),!await $e(t,480))||(K("title"),q("typing_title"),!await $e(t,260))||!await He(C,w,t))return;xe(!0),q("idle"),A("guided_suggestion_ready")}catch(i){if(i?.name==="AbortError")return;f.current===t&&(R(i?.message||"A IA não conseguiu criar uma ideia agora. Você pode escrever a sua."),q("idle"))}finally{S.current===n&&(S.current=null)}}async function Me(t,n,i){if(t.preventDefault(),!!d){R(""),fe(!0);try{const l=await fetch(`/api/ativo-editorial/landing/contact/${encodeURIComponent(d)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)}),b=await l.json().catch(()=>({}));if(!l.ok)throw new Error(b?.message||"Não foi possível salvar este dado.");F(i),await Ue(d)}catch(l){R(l?.message||"Não foi possível salvar este dado.")}finally{fe(!1)}}}s.useEffect(()=>{if(!k||!M){ge(!1);return}let t=!1;return fetch("/api/ativo-editorial/greenn/visibility",{credentials:"include"}).then(n=>n.ok?n.json():{enabled:!1}).then(n=>{t||ge(!!n?.enabled)}).catch(()=>{}),()=>{t=!0}},[k,M]),s.useEffect(()=>{if(!k||!M||!je||!d){ce(null);return}const t=`ativo-plan-offer-deadline:${d}`;let n=0;try{n=Number(sessionStorage.getItem(t))||0,(!Number.isFinite(n)||n<Date.now()-6e4)&&(n=Date.now()+1080*1e3,sessionStorage.setItem(t,String(n)))}catch{n=Date.now()+1080*1e3}const i=()=>ce(Math.max(0,Math.ceil((n-Date.now())/1e3)));i();const l=window.setInterval(i,1e3);return()=>window.clearInterval(l)},[k,M,je,d]);function wt(t){if(d){try{sessionStorage.setItem(Ge,JSON.stringify({planToken:d,checkout:t}))}catch{}se(t)}}async function Je(t,n){const i=Ft(),l=await fetch("/api/chat-checkout/start",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({flowId:n.flowId,nodeId:n.nodeId,chatSessionId:n.chatSessionId,landingResumeToken:d,packageId:t,email:n.email,bookTitle:n.title,bookSubtitle:n.subtitle,audie
1nce:c?.plan.targetAudience,userName:n.name||void 0,phone:n.phone||void 0,bookVars:n.bookVars,utmSource:i.utm_source||void 0,utmMedium:i.utm_medium||void 0,utmCampaign:i.utm_campaign||void 0,utmContent:i.utm_content||void 0,utmTerm:i.utm_term||void 0,fbclid:i.fbclid||void 0,gclid:i.gclid||void 0,gbraid:i.gbraid||void 0,wbraid:i.wbraid||void 0,gadCampaignId:i.gad_campaignid||void 0,fbp:Gt()||void 0,fbc:Kt()||void 0})}),b=await l.json().catch(()=>({}));if(!l.ok||!b?.checkoutSessionId||!b?.magicToken)throw new Error(b?.message||"Não foi possível iniciar o checkout.");return b}async function jt(){if(!(!d||x.current||oe)){x.current=!0,le(!0),Q("");try{const t=me||dt(d);let n=t?.checkoutSessionId||"",i=t?.magicToken||"",l=t?.packageId||"";if(!n||!i){const V=await fetch(`/api/ativo-editorial/landing/checkout/${encodeURIComponent(d)}`),W=await V.json().catch(()=>({}));if(!V.ok)throw new Error(W?.message||"Não foi possível abrir o checkout.");const Le=W;if(!Array.isArray(Le.packages)||Le.packages.length===0)throw new Error("Nenhum pacote está disponível agora.");const We=Le.defaultPackageId,ke=await Je(We,Le);n=ke.checkoutSessionId,i=ke.magicToken,l=ke.ativoPackageId==="apice"||ke.ativoPackageId==="complete"?ke.ativoPackageId:We,A("publication_offer_clicked"),A(`package_selected_${l}`,{package_id:l}),A("ativo_editorial_package_selected",{package_id:l}),A("ativo_editorial_checkout_started",{package_id:l,checkout_session_id:n,reused:ke.reused===!0,checkout_surface:"greenn_direct"}),wt({checkoutSessionId:n,magicToken:i,packageId:l})}const b=await fetch("/api/ativo-editorial/greenn/start",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({checkoutSessionId:n,token:i})}),C=await b.json().catch(()=>({}));if(!b.ok||typeof C?.url!="string")throw new Error(C?.message||"O checkout externo não está disponível agora.");A("ativo_editorial_greenn_start",{checkout_session_id:n,package_id:l||void 0,checkout_surface:"plan_page"}),window.location.assign(C.url)}catch(t){Q(t?.message||"Não foi possível abrir o checkout externo.")}finally{x.current=!1,le(!1)}}}async function Nt(){if(!d||x.current)return;const t=me||dt(d);if(t){se(t),ee(!0);return}x.current=!0,ie(!0),Q(""),R("");try{const n=await fetch(`/api/ativo-editorial/landing/checkout/${encodeURIComponent(d)}`),i=await n.json().catch(()=>({}));if(!n.ok)throw new Error(i?.message||"Não foi possível abrir o checkout.");const l=i;if(!Array.isArray(l.packages)||l.packages.length===0)throw new Error("Nenhum pacote está disponível agora.");await kt(l.defaultPackageId,l,!0)}catch(n){const i=n?.message||"Não foi possível abrir o checkout.";Q(i),R(i)}finally{x.current=!1,ie(!1)}}async function kt(t,n,i=!1){if(!(!n||!i&&x.current)){x.current=!0,ie(!0),Q("");try{const l=await Je(t,n);A("publication_offer_clicked"),A(`package_selected_${t}`,{package_id:t}),A("ativo_editorial_package_selected",{package_id:t});const b=l.ativoPackageId==="apice"||l.ativoPackageId==="complete"?l.ativoPackageId:t;A("ativo_editorial_checkout_started",{package_id:b,checkout_session_id:l.checkoutSessionId,reused:l.reused===!0,checkout_surface:"canonical"}),window.location.assign(`/checkout/${encodeURIComponent(l.checkoutSessionId)}?token=${encodeURIComponent(l.magicToken)}`)}catch(l){const b=l?.message||"Não foi possível abrir o checkout.";Q(b),R(b)}finally{x.current=!1,ie(!1)}}}function yt(t){t.preventDefault(),R(""),K("title"),A("idea_started")}function St(){R(""),F(t=>t==="whatsapp"?"email":t==="email"?"name":t),window.scrollTo({top:0,behavior:"smooth"})}function Qe(){ue(),lt(),mt(),O(""),X(null),u(""),w(""),N(!1),J(r?.name?.trim()||""),D(r?.email?.trim()||""),y(r?.phone?.trim()||""),R(""),F("idea"),_(!1),ae(!1),K("idea"),x.current=!1,ie(!1),Q(""),se(null),ee(!1),re(""),pe(!0),G(!1),xe(!1),o(!1)}function _t(){mt(),se(null),ee(!1),Q("O checkout anterior expirou. Escolha o pacote novamente para gerar um pagamento seguro.")}function Ct(){A("complete_planner_opened"),ia()}function Xe(){A("deliverables_cta_clicked"),pe(!1),document.getElementById("ativo-idea-form")?.scrollIntoView({behavior:"smooth",block:"center"}),window.setTimeout(()=>document.querySelector('[data-testid="ativo-idea-input"]')?.focus(),420)}const ze="mt-2.5 w-full rounded-2xl border border-[#8ee8df]/20 bg-[#071d27]/80 px-4 py-3 text-[16px] text-[#effffb] outline-none placeholder:text-[#789ca3] transition focus:border-[#84f0e4] focus:ring-4 focus:ring-[#55ded2]/15 sm:mt-3 sm:py-3.5 sm:text-[15px]",Ne="ativo-cta ativo-flow-cta ativo-sheen relative mt-4 flex min-h-[56px] w-full items-center justify-center gap-2 overflow-hidden rounded-[18px] px-5 py-3 text-sm font-black text-[#063440] transition duration-300 hover:-translate-y-0.5 active:translate-y-0 focus-visible:outline-none focus-visible:ring-4 focus-visible:ring-[#9af4e5]/45 disabled:cursor-not-allowed disabled:opacity-60 sm:mt-5 sm:min-h-[64px] sm:rou
1nded-[20px] sm:py-4",Oe=c?.title?.trim()||"",Ye=Oe?`QUERO QUE MEU LIVRO ${Oe} SEJA ESCRITO E PUBLICADO!`:"QUERO QUE MEU LIVRO SEJA ESCRITO E PUBLICADO!";return Te||_e?e.jsxs("main",{className:"ativo-shell flex min-h-[100dvh] items-center justify-center px-5 text-center text-[#7ddcda]",children:[e.jsx(H,{className:"h-6 w-6 animate-spin"}),e.jsx("p",{className:"ml-3 text-sm",children:_e?"Validando seu acesso seguro":"Retomando seu planejamento"})]}):e.jsx(Qt,{pageKey:"ativo_editorial",children:e.jsxs("main",{className:"ativo-shell min-h-[100dvh] overflow-x-hidden px-3 py-3 text-[#f6f8ff] sm:px-6 sm:py-8",children:[e.jsx("style",{children:`
2        .ativo-shell{font-family:"Inter",sans-serif;background:#06222c;background-image:radial-gradient(ellipse 70% 55% at 82% 2%,rgba(83,222,206,.26),transparent 70%),radial-gradient(ellipse 60% 50% at 0% 75%,rgba(17,107,130,.42),transparent 70%),linear-gradient(120deg,#061c27 0%,#052732 46%,#07323a 100%)}
3        .ativo-shell:before{content:"";position:fixed;inset:0;pointer-events:none;opacity:.18;background-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.52'/%3E%3C/svg%3E")}
4        @keyframes ativo-rise{from{opacity:0;transform:translateY(18px)}to{opacity:1;transform:translateY(0)}}
5        @keyframes ativo-glow{0%,100%{opacity:.45;transform:scale(.96)}50%{opacity:.8;transform:scale(1.05)}}
6        @keyframes ativo-float{0%,100%{transform:translateY(0) rotate(-6deg)}50%{transform:translateY(-10px) rotate(-4deg)}}
7        @keyframes ativo-sheen{0%,12%{transform:translateX(-155%)}46%,100%{transform:translateX(165%)}}
8        @keyframes ativo-offer-pulse{0%,100%{box-shadow:0 14px 50px rgba(0,0,0,.58),0 0 0 1px rgba(245,204,98,.26),0 0 28px rgba(245,204,98,.12)}50%{box-shadow:0 18px 60px rgba(0,0,0,.68),0 0 0 1px rgba(255,226,154,.5),0 0 48px rgba(245,204,98,.28)}}
9        @keyframes ativo-offer-nudge{0%,82%,100%{transform:translateX(0)}88%{transform:translateX(5px)}94%{transform:translateX(-1px)}}
10        @keyframes ativo-progress{0%{transform:translateX(-110%)}100%{transform:translateX(280%)}}
11        @keyframes ativo-benefit-enter{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}
12        @keyframes ativo-caret{0%,45%{opacity:1}46%,100%{opacity:0}}
13        @keyframes ativo-cta-pulse{0%,100%{box-shadow:0 14px 34px rgba(0,0,0,.3),0 0 0 0 rgba(154,244,229,0),0 0 30px rgba(154,244,229,.2)}50%{box-shadow:0 20px 46px rgba(0,0,0,.4),0 0 0 6px rgba(154,244,229,.11),0 0 48px rgba(154,244,229,.34)}}
14        @keyframes ativo-purchase-float{0%,100%{transform:translateY(0)}50%{transform:translateY(-5px)}}
15        @keyframes ativo-purchase-pulse{0%,100%{box-shadow:0 16px 38px rgba(0,0,0,.42),0 0 0 1px rgba(220,255,249,.8),0 0 34px rgba(91,241,218,.42)}50%{box-shadow:0 22px 52px rgba(0,0,0,.5),0 0 0 7px rgba(141,255,237,.12),0 0 58px rgba(91,241,218,.68)}}
16        @keyframes ativo-gold-pulse{0%,100%{box-shadow:0 14px 32px rgba(0,0,0,.24),0 0 0 0 rgba(245,204,98,0)}50%{box-shadow:0 18px 42px rgba(0,0,0,.34),0 0 0 5px rgba(245,204,98,.1),0 0 34px rgba(245,204,98,.2)}}
17        .ativo-rise{animation:ativo-rise .62s cubic-bezier(.2,.8,.2,1) both}.ativo-glow{animation:ativo-glow 5s ease-in-out infinite}.ativo-book{animation:ativo-float 6s ease-in-out infinite}.ativo-sheen:after{content:"";position:absolute;z-index:1;inset:-2px;border-radius:inherit;pointer-events:none;background:linear-gradient(110deg,transparent 32%,rgba(255,255,255,.08) 40%,rgba(255,255,255,.72) 49%,rgba(255,255,255,.16) 57%,transparent 68%);animation:ativo-sheen 4.2s cubic-bezier(.3,.65,.35,1) infinite}
18        .ativo-progress{animation:ativo-progress 2.4s ease-in-out infinite}
19        .ativo-benefit-enter{animation:ativo-benefit-enter .45s cubic-bezier(.2,.8,.2,1) both}
20        .ativo-offer-card{animation:ativo-offer-pulse 2.8s ease-in-out infinite}.ativo-offer-arrow{animation:ativo-offer-nudge 2.4s ease-in-out infinite}
21         .ativo-cta{border:1px solid rgba(211,255,246,.72);font-family:"Inter",sans-serif;letter-spacing:-.015em}.ativo-flow-cta{isolation:isolate;background:linear-gradient(105deg,#76e8d8 0%,#a7f8e9 42%,#77eadb 100%);animation:ativo-cta-pulse 2.7s ease-in-out infinite}.ativo-flow-cta:hover{background:linear-gradient(105deg,#a8fff0 0%,#d4fff7 48%,#9af4e5 100%);box-shadow:0 22px 48px rgba(0,0,0,.4),0 0 52px rgba(154,244,229,.42)}.ativo-flow-cta:disabled{animation:none;box-shadow:0 10px 24px rgba(0,0,0,.2)}.ativo-flow-cta:disabled:after{display:none}.ativo-primary-cta{letter-spacing:-.025em}.ativo-secondary-flow-cta{isolation:isolate;animation:ativo-gold-pulse 3.1s ease-in-out infinite}
22        .ativo-purchase-dock{animation:ativo-purchase-float 2.8s ease-in-out infinite}.ativo-purchase-button{animation:ativo-purchase-pulse 2.35s ease-in-out infinite}
23        @media (prefers-reduced-motion:reduce){.ativo-purchase-dock,.ativo-purchase-button{animation:none}}
24        .ativo-plan-paper{background-color:#f4f1ea;box-shadow:0 4px 6px rgba(0,0,0,.2),0 30px 60px -10px rgba(0,0,0,.6),inset 0 0 40px rgba(0,0,0,.02)}
25         .ativo-deferred{content-visibility:auto;contain-intrinsic-size:1px 1800px}
26         .ativo-display{font-family:"Quicksand",sans-serif;font-weight:700}
27         .ativo-type-caret{animation:ativo-caret .82s steps(1,end) infinite}
28          @media (prefers-reduced-motion:reduce){.ativo-rise,.ativo-glow,.ativo-book,.ativo-sheen:after,.ativo-offer-card,.ativo-offer-arrow,.ativo-flow-cta,.ativo-secondary-flow-cta,.ativo-progress,.ativo-benefit-enter,.ativo-type-caret{animation:none}}
29      `}),e.jsxs("div",{className:`mx-auto flex min-h-[calc(100dvh-1.5rem)] ${k?"max-w-[960px] pb-[220px] sm:pb-[230px] lg:pb-[190px]":!d&&j==="idea"?"max-w-[1240px]":"max-w-[620px]"} flex-col ${!d&&j==="idea"?"justify-start":"justify-center"}`,children:[e.jsxs("header",{className:"mb-3 flex items-center justify-between gap-4 px-1 sm:mb-8",children:[e.jsx("a",{href:"/","aria-label":"SÁBHIA",className:"inline-flex rounded-xl border border-white/10 bg-[#041923]/35 px-3 py-2 shadow-[0_0_30px_rgba(17,200,199,.1)] transition hover:scale-[1.02] hover:border-white/20 hover:bg-[#082b34]/55",children:e.jsx("img",{src:"/logo-light.png",alt:"SÁBHIA",className:"h-5 w-auto brightness-0 invert sm:h-6"})}),e.jsx("span",{className:"max-w-[170px] text-right text-[8px] font-bold uppercase leading-3 tracking-[.14em] text-[#7ddcda] sm:max-w-none sm:text-[10px] sm:leading-4 sm:tracking-[.16em]",children:"VAMOS VENDER SEU LIVRO?"})]}),e.jsxs("section",{className:k&&M?"hidden":"ativo-rise relative overflow-hidden rounded-[22px] border border-[#66d9d5]/15 bg-[#0a1c24]/95 p-3.5 shadow-[0_30px_90px_rgba(0,0,0,.38)] sm:rou
29nded-[30px] sm:p-8",children:[e.jsx("div",{"aria-hidden":"true",className:"ativo-glow pointer-events-none absolute -right-24 -top-32 h-72 w-72 rounded-full bg-[#11c8c7]/15 blur-3xl"}),e.jsx(st,{claimError:he,error:Se}),!d&&j==="idea"&&e.jsxs("div",{className:"relative",children:[e.jsxs("div",{className:"grid items-center gap-4 sm:gap-9 lg:grid-cols-[1.12fr_.88fr] lg:gap-14",children:[e.jsxs("div",{className:"contents lg:block",children:[e.jsxs("div",{className:"order-1",children:[e.jsxs("div",{className:"inline-flex max-w-full items-center gap-2 rounded-full border border-[#a1fff0]/25 bg-[#a1fff0]/[.08] px-2.5 py-1.5 text-[7.5px] font-black uppercase tracking-[.13em] text-[#b5fff2] min-[390px]:px-3 min-[390px]:text-[8px] min-[390px]:tracking-[.15em] sm:text-[9px] sm:tracking-[.17em]",children:[e.jsx("span",{className:"h-1.5 w-1.5 shrink-0 rounded-full bg-[#b5fff2]"}),"SEU LIVRO PUBLICADO EM MENOS DE 1 HORA!"]}),e.jsxs("h1",{className:"ativo-display mt-2.5 max-w-3xl text-[27px] leading-[.98] tracking-[-.052em] text-[#f8fffd] min-[390px]:text-[29px] sm:mt-5 sm:text-[52px] lg:text-[62px]",children:["Da ideia ao ",e.jsx("span",{className:"text-[#9af4e5]",children:"LIVRO"}),", com ",e.jsx("span",{className:"text-[#f5cc62]",children:"CAPA"}),", ",e.jsx("span",{className:"text-[#9af4e5]",children:"PUBLICADO E VENDENDO"}),", em menos de ",e.jsx("span",{className:"text-[#f5cc62]",children:"1 hora!"})]})]}),e.jsxs("div",{className:"order-3 hidden max-w-2xl rounded-[24px] border border-[#9effed]/25 bg-gradient-to-r from-[#104650]/90 to-[#0a313b]/90 p-5 shadow-[0_16px_44px_rgba(0,0,0,.2)] sm:p-6 lg:mt-7 lg:block",children:[e.jsx("p",{className:"text-[10px] font-black uppercase tracking-[.2em] text-[#91f5e5]",children:"Não é só um livro"}),e.jsxs("h2",{className:"ativo-display mt-2 text-[25px] leading-tight text-white sm:text-[30px]",children:["É o seu ativo ",e.jsx("span",{className:"text-[#f5cc62]",children:"PRONTO PARA O MERCADO:"})]}),e.jsx("ul",{className:"mt-4 space-y-2.5 text-sm font-bold text-[#e9fffa] sm:text-[15px]",children:["Livro completo","Capa profissional","Publicação na ÁPICE Books","Página de vendas pronta","Leitura e comunidade"].map(t=>e.jsxs("li",{className:"flex items-center gap-3",children:[e.jsx("span",{"aria-hidden":"true",className:"flex h-5 w-5 shrink-0 items-center justify-center rounded-full bg-[#9af4e5] text-sm font-black text-[#063440]",children:"+"}),t]},t))}),e.jsxs("p",{className:"mt-4 text-xs leading-5 text-[#b7d8d4] sm:text-sm",children:["Você não recebe apenas um texto: recebe o ",e.jsx("strong",{className:"text-white",children:"LIVRO, A PUBLICAÇÃO E A PÁGINA DE VENDAS"})," para apresentar sua obra e começar a colocá-la à venda."]})]}),e.jsxs("div",{className:"order-4 hidden flex-wrap items-center gap-x-5 gap-y-2 text-[11px] font-bold uppercase tracking-[.1em] text-[#b7d7d7] lg:mt-5 lg:flex",children:[e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-[#8ff1e1]"}),"Planejamento primeiro"]}),e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-[#8ff1e1]"}),"Sem compromisso"]}),e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-[#8ff1e1]"}),"Você decide depois"]})]})]}),e.jsxs("form",{id:"ativo-idea-form",onSubmit:yt,className:"relative order-2 rounded-[20px] border border-[#b2fff2]/50 bg-[linear-gradient(155deg,rgba(5,36,46,.99),rgba(7,25,34,.99))] p-3.5 shadow-[0_32px_90px_rgba(0,10,15,.58),0_0_0_1px_rgba(154,244,229,.08),0_0_70px_rgba(17,200,199,.12)] backdrop-blur sm:rounded-[30px] sm:p-6 lg:sticky lg:top-8",children:[e.jsx("div",{"aria-hidden":"true",className:"pointer-events-none absolute -inset-px -z-10 rounded-[26px] bg-gradient-to-br from-[#9af4e5]/25 via-transparent to-[#f5cc62]/20 blur-xl sm:rounded-[30px]"}),e.jsx("h2",{id:"ativo-idea-question",className:"ativo-display max-w-full break-words text-[18px] font-semibold leading-tight tracking-[-.045em] text-white min-[390px]:text-[20px] sm:mt-4 sm:text-2xl",children:"Sobre o que será seu livro?"}),e.jsx("p",{className:"mt-1 text-xs leading-4 text-[#a8c7c8] sm:mt-1.5 sm:text-sm sm:leading-5",children:"Conte do seu jeito — ou peça para a IA criar a ideia."}),e.jsxs("div",{className:"relative mt-3",children:[e.jsx("textarea",{"aria-labelledby":"ativo-idea-question","aria-describedby":"ativo-idea-capacity","aria-live":L==="typing_idea"?"polite":void 0,"data-testid":"ativo-idea-input",required:!0,minLength:20,maxLength:sa,value:a,onFocus:()=>pe(!1),onChange:t=>{pe(!1),Y&&ue(),G(!1),u(t.target.value)},placeholder:L==="requesting"?"A IA está buscando uma ideia com potencial comercial...":$?"":De[0],className:`${ze} !mt-0 min-h-[112px] resize-none border-[#8ee8df]/35 bg-[#041a23]/95 leading-5 shadow-inner sm:min-h-36 sm:leading-6`}),$&&!a&&L==="idle"&&e.jsxs("div",{"aria-hidden":"true","data-testid":"ativo-idea-animated-prompt",className:"pointer-events-none absolute inset-x-4 top-3.5 max-h-[140px] overflow-hidden whitespace-pre-wrap text-[15px] leading-6 text-[#789ca3] sm:max-h-[116px]",children:[we,e.jsx("span",{className:"ativo-type-caret ml-0.5 inline-block h-[1.05em] w-px translate-y-[2px] bg-[#9af4e5]"})]})]}),e.jsxs("p",{id:"ativo-idea-capacity",className:"mt-2 text-[11px] leading-4 text-[#8fb4b7] sm:text-xs",children:["Você pode colar até 2 livros completos — máximo de 2.000.000 de caracteres."," ",a.length.toLocaleStr
29ing("pt-BR")," usados."]}),Ie&&e.jsxs("p",{className:"mt-2 flex items-center gap-2 text-[11px] font-bold text-[#9af4e5]",children:[e.jsx("span",{className:"flex h-4 w-4 items-center justify-center rounded-full bg-[#9af4e5] text-[9px] text-[#063440]",children:"✓"}),"Ideia criada pela IA — você pode editar antes de continuar."]}),e.jsxs("button",{className:`${Ne} ativo-primary-cta !px-6 text-[14px] sm:!mt-5 sm:!py-4 sm:text-base`,disabled:Y,children:[e.jsx("span",{className:"relative z-10",children:"COMEÇAR MEU LIVRO PARA VENDER"}),e.jsx(z,{className:"relative z-10 h-5 w-5"})]}),e.jsxs("div",{className:"my-3 flex items-center gap-3","aria-hidden":"true",children:[e.jsx("span",{className:"h-px flex-1 bg-white/10"}),e.jsx("span",{className:"text-[9px] font-black uppercase tracking-[.2em] text-[#789ca3]",children:"ou"}),e.jsx("span",{className:"h-px flex-1 bg-white/10"})]}),Y?e.jsxs("div",{role:"status","aria-live":"polite",className:"rounded-2xl border border-[#f5cc62]/45 bg-[#f5cc62]/10 p-4 text-center",children:[e.jsxs("div",{className:"flex items-center justify-center gap-2 text-sm font-black text-[#fff0b7]",children:[e.jsx(H,{className:"h-4 w-4 animate-spin"}),L==="requesting"&&"Buscando uma oportunidade de livro...",L==="typing_idea"&&"Transformando a oportunidade em uma ideia...",L==="typing_title"&&"Agora, criando um título forte...",L==="starting"&&"Ideia pronta. Abrindo os dados do autor..."]}),e.jsx("button",{type:"button",onClick:ue,className:"mt-3 text-xs font-bold text-[#f8df91] underline decoration-[#f8df91]/35 underline-offset-4",children:"Interromper e editar manualmente"})]}):e.jsxs("button",{type:"button","data-testid":"ativo-guided-idea-button",onClick:vt,className:"ativo-secondary-flow-cta ativo-sheen group relative flex w-full items-center justify-between gap-3 overflow-hidden rounded-2xl border border-[#f5cc62]/70 bg-[linear-gradient(120deg,rgba(245,204,98,.2),rgba(245,204,98,.08))] px-4 py-3 text-left text-[#fff3c5] transition hover:-translate-y-0.5 hover:border-[#ffe29a] hover:bg-[#f5cc62]/20 focus-visible:outline-none focus-visible:ring-4 focus-visible:ring-[#f5cc62]/35",children:[e.jsxs("span",{className:"relative z-10 flex min-w-0 items-center gap-3",children:[e.jsx("span",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-xl bg-[#f5cc62] text-[#473500]",children:e.jsx(Ae,{className:"h-4 w-4"})}),e.jsxs("span",{children:[e.jsx("strong",{className:"block text-sm font-black leading-tight",children:"Estou sem ideia — ajude-me a encontrar uma"}),e.jsx("span",{className:"mt-0.5 block text-[11px] leading-4 text-[#decf9b]",children:"A IA sugere um tema e cria um título para você começar."})]})]}),e.jsx(z,{className:"relative z-10 h-4 w-4 shrink-0 transition group-hover:translate-x-1"})]}),e.jsx("p",{className:"mt-2 text-center text-[10px] leading-4 text-[#87a6aa]",children:"Seu planejamento é gratuito. Você decide pela produção completa depois de ver o caminho."}),e.jsx("button",{type:"button",onClick:Ct,className:"mt-0.5 w-full text-center text-[11px] font-medium text-[#9ab5b9] transition hover:text-white",children:"Prefiro usar o planejador completo"})]})]}),e.jsxs("section",{"data-testid":"ativo-deliverables",className:"mt-14 border-t border-[#8ff1e1]/15 pt-11",children:[e.jsxs("div",{className:"mx-auto max-w-4xl text-center",children:[e.jsx("p",{className:"text-[10px] font-black uppercase tracking-[.26em] text-[#86eadc]",children:"A estrutura que faltava para vender"}),e.jsx("h2",{className:"mt-3 text-[32px] font-black uppercase leading-[.98] tracking-[-.045em] text-white sm:text-[52px]",children:"Seu livro deixa de ser só um manuscrito"}),e.jsxs("p",{className:"mx-auto mt-4 max-w-2xl text-sm leading-6 text-[#a9c8c9] sm:text-base",children:["Não entregamos apenas texto. Você recebe o ",e.jsx("strong",{className:"text-[#e9fffa]",children:"LIVRO COMPLETO, PUBLICADO E COM PÁGINA DE VENDAS"})," para transformar o que sabe em uma oferta de verdade."]}
29)]}),e.jsxs("div",{className:"mt-8 grid gap-4 lg:grid-cols-12",children:[e.jsxs("article",{className:"group relative min-h-[290px] overflow-hidden rounded-[28px] border border-[#91ede1]/20 bg-[#092d37]/90 p-5 transition duration-300 hover:-translate-y-1 hover:border-[#91ede1]/50 sm:p-6 lg:col-span-5",children:[e.jsxs("div",{className:"absolute -right-5 top-7 h-44 w-32 rotate-3 rounded-sm bg-[#f1dfbd] shadow-[-12px_10px_0_#cb936f,-24px_20px_0_rgba(4,24,31,.65)] transition duration-500 group-hover:rotate-1",children:[e.jsx("div",{className:"mx-5 mt-8 h-2 bg-[#75483f]/55"}),e.jsx("div",{className:"mx-5 mt-3 h-1 bg-[#75483f]/25"}),e.jsx("div",{className:"mx-5 mt-2 h-1 bg-[#75483f]/25"}),e.jsx("div",{className:"mx-5 mt-2 h-1 bg-[#75483f]/25"}),e.jsx("div",{className:"mx-5 mt-8 text-[7px] font-black uppercase tracking-widest text-[#75483f]/55",children:"Capítulo 01"})]}),e.jsx("span",{className:"inline-flex h-10 w-10 items-center justify-center rounded-2xl bg-[#8ff1e1]/10 text-[#8ff1e1]",children:e.jsx(ft,{className:"h-5 w-5"})}),e.jsx("p",{className:"mt-7 text-[10px] font-black uppercase tracking-[.16em] text-[#8ff1e1]",children:"Entrega 01"}),e.jsx("h3",{className:"mt-2 max-w-[62%] text-2xl font-bold leading-tight text-white",children:"Livro completo que sustenta sua autoridade"}),e.jsx("p",{className:"mt-3 max-w-[62%] text-xs leading-5 text-[#a8c5c6]",children:"Prefácio, sumário, capítulos e encerramento. Uma obra completa para materializar o que você sabe — não apenas um plano."})]}),e.jsxs("article",{className:"group relative min-h-[290px] overflow-hidden rounded-[28px] border border-[#91ede1]/20 bg-gradient-to-br from-[#123640] to-[#242d47] p-5 transition duration-300 hover:-translate-y-1 hover:border-[#91ede1]/50 sm:p-6 lg:col-span-3",children:[e.jsxs("div",{className:"mx-auto mt-1 h-36 w-24 -rotate-6 rounded-r-sm bg-gradient-to-b from-[#f28d6d] via-[#ca4860] to-[#592e61] shadow-[-9px_8px_0_#163743,0_18px_30px_rgba(0,0,0,.35)] transition duration-500 group-hover:-rotate-3",children:[e.jsx("div",{className:"mx-4 pt-7 text-center text-[6px] font-black uppercase tracking-[.2em] text-[#ffe8be]",children:"O seu livro"}),e.jsx("div",{className:"mx-auto mt-5 h-8 w-8 rounded-full border border-[#ffe8be]/50"})]}),e.jsx("p",{className:"mt-6 text-[10px] font-black uppercase tracking-[.16em] text-[#8ff1e1]",children:"Entrega 02"}),e.jsx("h3",{className:"mt-2 text-xl font-bold text-white",children:"Capa que posiciona seu livro"}),e.jsx("p",{className:"mt-2 text-xs leading-5 text-[#a8c5c6]",children:"Identidade visual criada para a obra ser levada a sério desde o primeiro contato."})]}),e.jsxs("article",{className:"group relative min-h-[290px] overflow-hidden rounded-[28px] border border-[#91ede1]/20 bg-[#0b333a] p-5 transition duration-300 hover:-translate-y-1 hover:border-[#91ede1]/50 sm:p-6 lg:col-span-4",children:[e.jsxs("div",{className:"rounded-xl border border-[#a6f4e8]/20 bg-[#061f28] p-3 shadow-2xl",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-[#f07f68]"}),e.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-[#f3c66e]"}),e.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-[#8ff1e1]"})]}),e.jsx("div",{className:"mt-3 h-2 w-16 rounded bg-[#8ff1e1]"}),e.jsxs("div",{className:"mt-4 grid grid-cols-3 gap-2",children:[e.jsx("span",{className:"h-16 rounded bg-gradient-to-b from-[#ec8b69] to-[#803c5b]"}),e.jsx("span",{className:"h-16 rounded bg-gradient-to-b from-[#81b7c7] to-[#395671]"}),e.jsx("span",{className:"h-16 rounded bg-gradient-to-b from-[#c2d37c] to-[#5f7758]"})]})]}),e.jsx("p",{className:"mt-5 text-[10px] font-black uppercase tracking-[.16em] text-[#8ff1e1]",children:"Entrega 03"}),e.jsx("h3",{className:"mt-2 text-xl font-bold text-white",children:"Seu livro publicado na ÁPICE Books"}),e.jsx("p",{className:"mt-2 text-xs leading-5 text-[#a8c5c6]",children:"Sua obra entra em uma vitrine real, com uma presença profissional para ser apresentada ao público."})]}),e.jsxs("article",{className:"group relative min-h-[260px] overflow-hidden rounded-[28px] border border-[#91ede1]/20 bg-[#0b3038] p-5 transition duration-300 hover:-translate-y-1 hover:border-[#91ede1]/50 sm:p-6 lg:col-span-6",children:[e.jsxs("div",{className:"absolute right-5 top-6 w-[44%] rounded-xl border border-[#a6f4e8]/20 bg-[#e9f5ef] p-3 shadow-2xl sm:right-8 sm:w-[46%]",children:[e.jsx("div",{className:"h-2 w-16 rounded bg-[#174f59]"}),e.jsxs("div",{className:"mt-3 h-16 rounded bg-gradient-to-r from-[#184b59] to-[#2f7a78] p-3",children:[e.jsx("div",{className:"h-2 w-2/3 rounded bg-white/80"}
29),e.jsx("div",{className:"mt-2 h-1 w-1/2 rounded bg-white/40"})]}),e.jsx("div",{className:"mt-3 h-5 w-16 rounded bg-[#e58063]"})]}),e.jsx(ht,{className:"h-5 w-5 text-[#8ff1e1]"}),e.jsx("p",{className:"mt-8 text-[10px] font-black uppercase tracking-[.16em] text-[#8ff1e1]",children:"Entrega 04"}),e.jsx("h3",{className:"mt-2 max-w-[48%] text-2xl font-bold leading-tight text-white",children:"Página de vendas pronta para vender sua obra"}),e.jsx("p",{className:"mt-3 max-w-[48%] text-xs leading-5 text-[#a8c5c6]",children:"Uma página que explica a proposta do livro, apresenta seu valor e dá ao interessado um caminho claro para comprar."})]}),e.jsxs("article",{className:"group relative min-h-[260px] overflow-hidden rounded-[28px] border border-[#91ede1]/20 bg-gradient-to-br from-[#103e43] to-[#0a2935] p-5 transition duration-300 hover:-translate-y-1 hover:border-[#91ede1]/50 sm:p-6 lg:col-span-6",children:[e.jsxs("div",{className:"absolute right-7 top-5 h-44 w-24 rounded-[18px] border-[5px] border-[#a9eee3] bg-[#061f28] p-3 shadow-2xl transition duration-500 group-hover:-translate-y-1",children:[e.jsx("div",{className:"h-1.5 w-9 rounded bg-[#8ff1e1]"}),e.jsxs("div",{className:"mt-5 space-y-2",children:[e.jsx("div",{className:"h-1 rounded bg-white/35"}),e.jsx("div",{className:"h-1 rounded bg-white/25"}),e.jsx("div",{className:"h-1 rounded bg-white/25"}),e.jsx("div",{className:"h-1 w-10 rounded bg-white/25"})]}),e.jsxs("div",{className:"mt-7 flex -space-x-1",children:[e.jsx("span",{className:"h-4 w-4 rounded-full border border-[#061f28] bg-[#e98a69]"}),e.jsx("span",{className:"h-4 w-4 rounded-full border border-[#061f28] bg-[#8cbccb]"}),e.jsx("span",{className:"h-4 w-4 rounded-full border border-[#061f28] bg-[#c4d681]"})]})]}),e.jsx(xt,{className:"h-5 w-5 text-[#8ff1e1]"}),e.jsx("p",{className:"mt-8 text-[10px] font-black uppercase tracking-[.16em] text-[#8ff1e1]",children:"Entrega 05"}),e.jsx("h3",{className:"mt-2 max-w-[55%] text-2xl font-bold leading-tight text-white",children:"Experiência de leitura e comunidade"}),e.jsx("p",{className:"mt-3 max-w-[55%] text-xs leading-5 text-[#a8c5c6]",children:"Leitura digital inspirada no Kindle, com um espaço para aproximar autor e leitores dentro da obra."})]})]}),e.jsx("div",{className:"mt-6 overflow-hidden rounded-[28px] border border-[#9effed]/25 bg-gradient-to-r from-[#104650] via-[#0d3b45] to-[#0a303a] p-5 sm:p-7",children:e.jsxs("div",{className:"grid items-center gap-5 sm:grid-cols-[1fr_auto]",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] font-black uppercase tracking-[.2em] text-[#90f0e2]",children:"Livro, publicação e estrutura de vendas. Dois níveis de entrega."}),e.jsxs("p",{className:"mt-2 text-2xl font-bold leading-tight text-white sm:text-3xl",children:["Seu livro completo, publicado e com ",e.jsx("span",{className:"text-[#9af4e5]",children:"página de vendas"})," a partir de ",e.jsx("span",{className:"text-[#9af4e5]",children:"R$ 99,99"}),"."]}),e.jsx("p",{className:"mt-2 text-xs leading-5 text-[#a9c9ca]",children:"Comece pelo planejamento gratuito. Você só escolhe entre ÁPICE e Completo quando enxergar o caminho da sua obra."})]}),e.jsxs("button",{type:"button",onClick:Xe,className:"ativo-cta ativo-flow-cta ativo-sheen relative flex min-w-[280px] items-center justify-center gap-2 overflow-hidden rounded-2xl px-6 py-4 text-sm font-black text-[#063440] transition hover:-translate-y-0.5",children:[e.jsx("span",{className:"relative z-10",children:"CRIAR MEU PLANEJAMENTO GRATUITO"}),e.jsx(z,{className:"relative z-10 h-4 w-4"})]})]})})]})]}),!d&&j==="title"&&e.jsxs("form",{onSubmit:gt,className:"ativo-rise relative mx-auto max-w-[540px]",children:[e.jsxs("button",{type:"button",onClick:()=>{ue(),K("idea")},className:"mb-4 inline-flex min-h-11 items-center gap-2 text-xs font-bold uppercase tracking-[.1em] text-[#9af4e5] transition hover:text-white sm:mb-7",children:[e.jsx(tt,{className:"h-4 w-4"})," Voltar para a ideia"]}),e.jsx("div",{className:"mb-6 h-1 overflow-hidden rounded-full bg-white/[.06]",children:e.jsx("div",{className:"h-full w-full rounded-full bg-[#11c8c7]"})}),e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsx("p",{className:"text-[10px] font-bold uppercase tracking-[.2em] text-[#7ddcda]",children:"Agora, dê um nome a ela"}),e.jsx("span",{className:"text-[9px] font-bold uppercase tracking-[.15em] text-[#789398]",children:"Passo 2 de 2"})]}),e.jsx("h1",{id:"ativo-title-question",className:"mt-3 text-3xl font-semibold tracking-[-.04em] sm:text-[38px]",children:"Qual será o título do seu livro?"}),e.jsx("p",{id:"ativo-title-help",className:"mt-3 text-sm leading-6 text-[#a9c4c8]",children:"Você pode dar um nome provisório ou deixar a IA encontrar o título mais forte para sua obra."}),e.jsx("input",{"aria-labelledby":"ativo-title-question","aria-describedby":"ativo-title-help","aria-live":L==="typing_title"?"polite":void 0,"data-testid":"ativo-title-input",type:"text",inputMode:"text",enterKeyHint:"go",autoComplete:"off",required:!h,minLength:h?void 0:3,maxLength:160,disabled:h,value:h?"":p,onChange:t=>{Y&&ue(),xe(!1),w(t.target.value)},placeholder:h?"A IA vai criar um título para você":"Digite o título do seu livro",className:`${ze} disabled:cursor-not-allowed disabled:border-[#f5cc62]/55 disabled:bg-[#f5cc62]/10 disabled:text-[#fff2bd] disabled:opacity-100`}),Ee&&!h&&e.jsxs("p",{className:"mt-2 flex items-center gap-2 rounded-xl border border-[#9af4e5]/25 bg-[#9af4e5]/10 px-3 py-2 text-[11px] font-bold text-[#bafff3]",children:[e.jsx("span",{className:"flex h-4 w-4 items-center justify-center rounded-full bg-[#9af4e5] text-[9px] text-[#063440]",children:"✓"}),"Título criado pela IA. Leia e ajuste se quiser antes de continuar."]}),Y&&e.jsxs("div",{role:"status","aria-live":"polite",className:"mt-3 flex items-center justify-between gap-3 rounded-2xl border border-[#f5cc62]/40 bg-[#f5cc62]/10 px-4 py-3 text-xs font-bold text-[#f8e7a9]",children:[e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(H,{className:"h-4 w-4 animate-spin"}),L==="typing_title"?"A IA está escrevendo o título...":"Preparando seu planejamento..."]}),L==="typing_title"&&e.jsx("button",{type:"button",onClick:ue,className:"shrink-0 underline underline-offset-4",children:"Editar"})]}),e.jsxs("button",{type:"button",disabled:Y,onClick:()=>N(t=>{const n=!t;return xe(n),n}),"aria-pressed":h,className:`mt-3 flex w-full items-center justify-between gap-3 rounded-2xl border px-4 py-3.5 text-left transition disabled:cursor-not-allowed disabled:opacity-50 ${h?"border-[#f5cc62]/80 bg-[#f5cc62]/15 text-[#fff6cf]":"border-[#f5cc62]/35 bg-[#f5cc62]/[.07] text-[#ffedaa] hover:border-[#f5cc62]/70 hover:bg-[#f5cc62]/12"}`,children:[e.jsxs("span",{className:"flex min-w-0 items-center gap-3",children:[e.jsx(Ae,{className:"h-4 w-4 shrink-0"}),e.jsxs("span",{children:[e.jsx("span",{className:"block text-sm font-black",children:"Deixar a IA decidir o título"}),e.jsx("span",{className:"mt-0.5 block text-[11px] font-medium leading-4 text-[#decf9b]",children:"Ela cria uma opção estratég
29ica para a sua ideia."})]})]}),e.jsx("span",{className:"shrink-0 rounded-full bg-[#f5cc62] px-2 py-1 text-[8px] font-black uppercase tracking-[.1em] text-[#4a3500] sm:px-2.5 sm:text-[9px]",children:"IA"})]}),h&&e.jsxs("p",{className:"mt-2 flex items-center gap-2 rounded-xl border border-[#f5cc62]/25 bg-[#f5cc62]/10 px-3 py-2 text-xs font-bold leading-5 text-[#fff0b7]",children:[e.jsx("span",{className:"flex h-4 w-4 shrink-0 items-center justify-center rounded-full bg-[#f5cc62] text-[10px] font-black text-[#4a3500]",children:"✓"}),"IA assumirá o título: você verá a escolha no planejamento."]}),e.jsx("button",{className:Ne,disabled:E||Y,children:E||L==="starting"?e.jsxs(e.Fragment,{children:[e.jsx(H,{className:"relative z-10 h-4 w-4 animate-spin"})," ",e.jsx("span",{className:"relative z-10",children:"Preparando seu livro..."})]}):e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"relative z-10",children:h?"Deixar a IA criar meu título":"Criar meu planejamento grátis"})," ",e.jsx(z,{className:"relative z-10 h-4 w-4"})]})}),e.jsx("p",{className:"mt-4 text-center text-xs leading-5 text-[#789398]",children:"Em poucos instantes, você verá o mapa editorial da sua obra."})]}),d&&!M&&e.jsxs("div",{className:"ativo-rise relative mx-auto max-w-[540px]",children:[B!=="name"&&e.jsxs("button",{type:"button",onClick:St,className:"mb-3 inline-flex min-h-11 items-center gap-2 text-xs font-bold uppercase tracking-[.1em] text-[#9af4e5]",children:[e.jsx(tt,{className:"h-4 w-4"})," Voltar"]}),e.jsxs("div",{className:"mb-4 flex items-center gap-3 sm:mb-6",children:[e.jsx("span",{className:"flex h-8 w-8 items-center justify-center rounded-full bg-[#123a40] text-xs font-bold text-[#75e2dc]",children:B==="name"?"1":B==="email"?"2":"3"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-semibold",children:"Seu livro já começou a ganhar forma."}),e.jsx("p",{className:"mt-0.5 text-xs text-[#91afb3]",children:"Agora precisamos saber para quem entregar essa criação."})]})]}),B==="name"&&e.jsxs("form",{onSubmit:t=>Me(t,{name:g},"email"),children:[e.jsxs("label",{className:"text-sm font-medium",children:["Qual é o nome do autor?",e.jsx("input",{required:!0,minLength:2,type:"text",inputMode:"text",enterKeyHint:"next",autoComplete:"name",value:g,onChange:t=>J(t.target.value),placeholder:"Nome que aparecerá no livro",className:ze})]}),e.jsx("p",{className:"mt-2 text-xs leading-4 text-[#789398] sm:mt-3 sm:leading-5",children:"Usaremos este nome na autoria, capa e publicação."}),e.jsxs("button",{className:Ne,disabled:E,children:[e.jsx("span",{className:"relative z-10",children:"Continuar meu livro"})," ",e.jsx(z,{className:"relative z-10 h-4 w-4"})]})]}),B==="email"&&e.jsxs("form",{onSubmit:t=>Me(t,{email:v},"whatsapp"),children:[e.jsxs("label",{className:"text-sm font-medium",children:["Qual é o seu melhor e-mail?",e.jsxs("span",{className:"relative mt-2.5 block overflow-hidden rounded-[20px] border border-[#8ee8df]/25 bg-[linear-gradient(145deg,rgba(8,44,52,.95),rgba(5,27,37,.92))] p-3.5 transition focus-within:border-[#84f0e4] focus-within:ring-4 focus-within:ring-[#55ded2]/15 sm:mt-3 sm:rounded-[24px] sm:p-4",children:[e.jsx("span",{className:"mb-2 flex h-9 w-9 items-center justify-center rounded-xl border border-[#f5cc62]/35 bg-[#f5cc62]/10 text-[#f5cc62] sm:mb-3 sm:h-11 sm:w-11 sm:rounded-2xl",children:e.jsx(Yt,{className:"h-5 w-5","aria-hidden":"true"})}),e.jsx("span",{className:"block text-[9px] font-black uppercase tracking-[.2em] text-[#86eadc]",children:"E-mail para continuar"}),e.jsx("input",{required:!0,type:"email",inputMode:"email",enterKeyHint:"next",autoComplete:"email",value:v,onChange:t=>D(t.target.value),placeholder:"[email protected]",className:"mt-1 w-full border-0 border-b border-[#8ee8df]/25 bg-transparent px-0 pb-1 pt-1 text-[17px] text-[#effffb] outline-none placeholder:text-[#789ca3] focus:border-[#f5cc62]"})]})]}),e.jsx("p",{className:"mt-2 text-xs leading-4 text-[#789398] sm:mt-3 sm:leading-5",children:"Serve também para recuperar seu planejamento."}),e.jsxs("button",{className:Ne,disabled:E,children:[e.jsx("span",{className:"relative z-10",children:"Continuar meu livro"})," ",e.jsx(z,{className:"relative z-10 h-4 w-4"})]})]}),B==="whatsapp"&&e.jsxs("form",{onSubmit:t=>Me(t,{phone:U},"processing"),children:[e.jsxs("label",{className:"text-sm font-medium",children:["Seu WhatsApp",e.jsxs("span",{className:"relative mt-2.5 block overflow-hidden rounded-[20px] border border-[#8ee8df]/25 bg-[linear-gradient(145deg,rgba(8,44,52,.95),rgba(5,27,37,.92))] p-3.5 transition focus-within:border-[#84f0e4] focus-within:ring-4 focus-within:ring-[#55ded2]/15 sm:mt-3 sm:rounded-[24px] sm:p-4",children:[e.jsx("span",{className:"mb-2 flex h-9 w-9 items-center justify-center rounded-xl border border-[#9af4e5]/35 bg-[#9af4e5]/10 text-[#9af4e5] sm:mb-3 sm:h-11 sm:w-11 sm:rounded-2xl",children:e.jsx(et,{className:"h-5 w-5","aria-hidden":"true"})}),e.jsx("span",{className:"block text-[9px] font-black uppercase tracking-[.2em] text-[#86eadc]",children:"WhatsApp para receber atualizações"}),e.jsx("input",{required:!0,type:"tel",inputMode:"tel",enterKeyHint:"done",autoComplete:"tel",value:U,onChange:t=>y(t.target.value),placeholder:"(11) 99999-9999",className:"mt-1 w-full border-0 border-b border-[#8ee8df]/25 bg-transparent px-0 pb-1 pt-1 text-[17px] text-[#effffb] outline-none placeholder:text-[#789ca3] focus:border-[#f5cc62]"})]})]}),e.jsxs("p",{className:"mt-2 flex gap-2 text-xs leading-4 text-[#789398] sm:mt-3 sm:leading-5",children:[e.jsx(et,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-[#75e2dc]"}),"Usaremos este canal para entregar a continuidade."]}),e.jsxs("button",{className:Ne,disabled:E,children:[e.jsx("span",{className:"relative z-10",children:"Ver meu planejamento"})," ",e.jsx(z,{className:"relative z-10 h-4 w-4"})]})]})]}),d&&M&&!k&&c?.status!=="failed"&&e.jsx(ma,{status:c?.status||"processing",phase:c?.phase,resultQuality:c?.resultQuality,attempts:c?.attempts,queuedAt:c?.queuedAt,startedAt:c?.startedAt,idea:a,title:p,aiChoosingTitle:h}),c?.status==="failed"&&e.jsxs("div",{className:"py-3 text-center",children:[e.jsx(Be,{className:"mx-auto h-7 w-7 text-red-200"}),e.jsx("h1",{className:"mt-4 text-xl font-semibold",children:"Não concluímos esta leitura."}),e.jsx("p",{className:"mt-2 text-sm leading-6 text-[#9ab5b9]",children:"Sua ideia não foi perdida. Você pode tentar novamente."}),e.jsxs("button",{onClick:Qe,className:Ne,children:[e.jsx(at,{className:"relative z-10 h-4 w-4"})," ",e.jsx("span",{className:"relative z-10",children:"Começar de novo"})]})]})]}),k&&M&&e.jsxs("section",{className:"ativo-plan-paper ativo-rise relative mt-3 rounded-[2px] p-4 text-[#333] sm:mt-5 sm:p-10 md:p-14",children:[e.jsxs("header",{className:"mb-8 border-b border-black/10 pb-6 sm:mb-12",children:[e.jsxs("div",{className:"flex justify-between gap-4 text-[10px] font-bold uppercase tracking-[.18em] text-black/45",children:[e.jsx("span",{children:"Planejamento editorial"}),e.jsx("span",{children:"Plano pronto"})]}),e.jsx("h1",{className:"mt-4 break-words text-2xl font-bold uppercase leading-tight tracking-tighter sm:text-4xl",children:c.title}),e.jsx("p",{className:"mt-3 text-xs italic text-black/55 sm:text-sm",children:"Planejado a partir da sua ideia & SÁBHIA"}),c.subtitle&&e.jsx("p",{className:"mt-2 text-xs text-black/50 sm:text-sm",children:c.subtitle})]}),e.jsx(st,{claimError:he,error:Se,variant:"paper"}),c.plan.premise&&e.jsxs("section",{className:"border-b border-black/5 pb-6",children:[e.jsx("p",{className:"text-[10px] font-bold uppercase tracking-[.2em] text-black/40",children:"Premissa"}),e.jsx("p",{className:"mt-3 text-sm leading-relaxed text-black/85 sm:text-base",children:c.plan.premise})]}),(c.plan.targetAudience||c.plan.toneAndStyle)&&e.jsxs("section",{className:"mt-8 grid gap-6 border-b border-black/5 pb-6 sm:grid-cols-2",children:[c.plan.targetAudience&&e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] font-bold uppercase tracking-[.2em] text-black/40",children:"Público-alvo"}),e.jsx("p",{className:"mt-3 text-xs leading-relaxed text-black/75 sm:text-sm",children:c.plan.targetAudience})]}),c.plan.toneAndStyle&&e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] font-bold uppercase tracking-[.2em] text-black/40",children:"Tom e estilo"}),e.jsx("p",{className:"mt-3 text-xs leading-relaxed text-black/75 sm:text-sm",children:c.plan.toneAndStyle})]})]}),(c.plan.centralThemes||[]).length>0&&e.jsxs("section",{className:"mt-8 border-b border-black/5 pb-6",children:[e.jsx("p",{className:"text-[10px] font-bold uppercase tracking-[.2em] text-black/40",children:"Temas centrais"}),e.jsx("div",{className:"mt-3 flex flex-wrap gap-2",children:c.plan.centralThemes.map(t=>e.jsx("span",{className:"border border-black/5 bg-black/[.05] px-3 py-1.5 text-xs text-black/75",children:t},t))})]}),Pe&&e.jsxs("section",{className:"mt-8 border-b border-black/5 pb-6",children:[e.jsx("p",{className:"text-[10px] font-bold uppercase tracking-[.2em] text-black/40",children:"Sinopse editorial"}),e.jsx("p",{className:"mt-3 whitespace-pre-line text-sm italic leading-7 text-black/80 sm:text-base",children:Pe})]}),c.plan.narrativeArc&&e.jsxs("section",{className:"mt-8 border-b border-black/5 pb-6",children:[e.jsx("p",{className:"text-[10px] font-bold uppercase tracking-[.2em] text-black/40",children:"Arco editorial"}),e.jsx("p",{className:"mt-3 text-xs leading-relaxed text-black/75 sm:text-sm",children:c.plan.narrativeArc})]}),(c.plan.characters||[]).length>0&&e.jsxs("section",{className:"mt-8 border-b border-black/5 pb-6",children:[e.jsx("p",{className:"mb-4 text-[10px] font-bold uppercase tracking-[.2em] text-black/40",children:"Personagens e vozes"}),e.jsx("div",{className:"space-y-6",children:c.plan.characters.map((t,n)=>e.jsxs("div",{className:"border-l-2 border-black/10 pl-4",children:[e.jsxs("p",{className:"text-sm font-bold uppercase tracking-wide",children:[t.name,t.role?e.jsx("span",{className:"ml-2 bg-black/[.05] px-2 py-0.5 text-[10px] font-normal text-black/50",children:t.role}):null]}),t.description&&e.jsx("p",{className:"mt-1 text-xs leading-relaxed text-black/70 sm:text-sm",children:t.description}),t.arc&&e.jsxs("p",{className:"mt-2 text-[10px] italic text-black/50",children:["Arco: ",t.arc]}),(t.keyTraits||[]).length>0&&e.jsxs("p",{className:"mt-2 text-[10px] uppercase tracking-wider text-black/45",children:["Traços: ",t.keyTraits.join(" · ")]})]},`${t.name}-${n}`))})]}),(c.plan.chapters||[]).length>0&&e.jsxs("section",{className:"mt-8",children:[e.jsxs("div",{className:"mb-8 flex items-center gap-3 border-b border-black/10 pb-3 text-[10px] font-bold uppercase tracking-wider text-black/40 sm:gap-4",children:[e.jsx("span",{className:"w-10 shrink-0 sm:w-14",children:"Cap."}),e.jsx("span",{className:"min-w-0 flex-1",children:"Estrutura do capítulo"}),e.jsx("span",{className:"w-12 shrink-0 text-right sm:w-16",children:"Págs."})]}),e.jsx("div",{className:"space-y-8 sm:space-y-10",children:c.plan.chapters.map((t,n)=>e.jsxs("article",{children:[e.jsxs("div",{className:"flex items-baseline gap-2 sm:gap-4",children:[e.jsx("span",{className:"w-10 shrink-0 text-sm font-bold text-black/30 sm:w-14 sm:text-lg",children:String(t.number||n+1).padStart(2,"0")}),e.jsx("h2",{className:"min-w-0 flex-1 break-words text-sm font-bold uppercase leading-tight tracking-wide sm:text-base",children:t.title}),e.jsxs("span",{className:"w-12 shrink-0 text-right text-[10px] text-black/30 sm:w-16",children:["~",t.estimatedPages||"—","p"]})]}),e.jsxs("div",{className:"ml-3 mt-2 space-y-2 border-l border-black/10 pl-9 text-xs leading-relaxed text-black/75 sm:ml-[18px] sm:pl-[54px] sm:text-sm",children:[t.summary&&e.jsx("p",{className:"break-words",children:t.summary}),(t.keyPoints||[]).length>0&&e.jsx("ul",{className:"space-y-1 text-[10px] text-black/55 sm:text-xs",children:t.keyPoints.map((i,l)=>e.jsxs("li",{className:"flex gap-2",children:[e.jsx("span",{children:"•"}),e.jsx("span",{className:"min-w-0 break-words",children:i})]},`${i}-${l}`))}),t.narrativePurpose&&e.jsxs("p",{className:"text-[10px] italic text-black/45",children:["Função no livro: ",t.narrativePurpose]}),(t.sourceReferences||[]).length>0&&e.jsxs("p",{className:"break-words text-[10px] text-black/45",children:["Fontes vinculadas: ",t.sourceReferences.join(" · ")]})]})]},`${t.number}-${t.title}-${n}`))})]}),(c.plan.researchNotes||[]).length>0&&e.jsxs("section",{className:"mt-8 border-t border-black/10 pt-6",children:[e.jsx("p",{className:"text-[10px] font-bold uppercase tracking-[.2em] text-black/40",children:"Notas de pesquisa"}),e.jsx("ul",{className:"mt-3 space-y-2 text-xs leading-relaxed text-black/65 sm:text-sm",children:c.plan.researchNotes.map((t,n)=>e.jsxs("li",{className:"flex gap-2",children:[e.jsx("span",{children:"•"}),e.jsx("span",{children:t})]},`${t}-${n}`))})]}),c.plan.estimatedTotalPages?e.jsxs("p",{className:"mt-8 text-center text-[10px] uppercase tracking-widest text-black/35",children:["Extensão editorial estimada: ",c.plan.estimatedTotalPages," páginas"]}):null]}),k&&M&&e.jsx(e.Fragment,{children:me&&e.jsx(Zt,{open:de,checkout:me,onClose:()=>ee(!1),onInvalidCheckout:_t,onPaid:()=>{},onEvent:A})}),k&&M&&!de&&!je&&e.jsx("div",{className:"fixed inset-x-3 bottom-[calc(env(safe-area-inset-bottom)+12px)] z-[65] mx-auto max-w-[520px] rounded-2xl border border-white/15 bg-[#082b34]/95 px-4 py-3 text-center text-[11px] font-bold leading-4 text-[#d5efea] shadow-2xl backdrop-blur sm:hidden",role:"status",children:"Seu plano está pronto. Leia o título e os primeiros pontos — a opção de produção aparecerá em instantes."}),k&&M&&!de&&je&&e.jsxs("aside",{"aria-label":"Oferta para publicar seu livro",className:"ativo-purchase-dock pointer-events-none fixed inset-x-0 bottom-3 z-[70] px-3 pb-[calc(env(safe-area-inset-bottom)+10px)] sm:bottom-4 sm:px-5 sm:pb-4",children:[ve!==null&&e.jsxs("div",{role:"timer","data-testid":"ativo-plan-offer-countdown",className:"pointer-events-auto mx-auto mb-2 flex w-fit items-center justify-center gap-2 rounded-full border border-[#f5cc62]/45 bg-[#082b34]/95 px-4 py-1.5 text-[11px] font-black uppercase tracking-[.08em] text-[#f8df91] shadow-lg backdrop-blur",children:[e.jsx(Bt,{className:"h-3.5 w-3.5","aria-hidden":"true"}),"4 descontos foram desbloqueados para você, expiram em ",String(Math.floor(ve/60)).padStart(2,"0"),":",String(ve%60).padStart(2,"0")]}),Ce?e.jsxs("button",{type:"button",onClick:jt,disabled:oe||be,"data-testid":"ativo-plan-purchase-bar","aria-label":"Pagar agora e receber meu livro completo, publicado, em menos de 1 hora!",title:"Pagar agora e receber meu livro completo, publicado, em menos de 1 hora!",className:"ativo-purchase-button ativo-sheen pointer-events-auto group relative mx-auto flex min-h-[62px] w-full max-w-[820px] cursor-pointer items-center justify-center gap-2.5 overflow-hidden rounded-[22px] border-2 border-[#6ADAD8] bg-[linear-gradient(105deg,#0A667E_0%,#0EBBB5_42%,#3CCBC6_68%,#0A667E_100%)] px-5 py-4 text-center font-sans text-white shadow-[0_18px_44px_rgba(10,103,126,.55),0_0_46px_rgba(14,187,181,.4)] transition duration-300 min-[360px]:min-h-[74px] hover:-translate-y-1 hover:scale-[1.012] hover:brightness-110 hover:shadow-[0_26px_60px_rgba(4,38,48,.6),0_0_72px_rgba(14,187,181,.78)] focus-visible:outline-none focus-visible:ring-4 focus-visible:ring-[#6ADAD8]/60 active:translate-y-0 active:scale-[.99] disabled:cursor-wait disabled:opacity-90 sm:min-h-[80px] sm:rou
29nded-[24px] sm:px-7",children:[e.jsx("span",{"aria-hidden":"true",className:"absolute -right-10 -top-16 h-40 w-40 rounded-full bg-[#6ADAD8]/35 blur-3xl transition duration-500 group-hover:bg-[#6ADAD8]/55"}),e.jsx(Ae,{className:"relative z-10 hidden h-5 w-5 shrink-0 drop-shadow-sm min-[360px]:block","aria-hidden":"true"}),e.jsx("strong",{className:"relative z-10 line-clamp-2 min-w-0 text-xs font-black uppercase leading-[1.2] tracking-[-.01em] [text-shadow:0_1px_3px_rgba(3,40,48,.5)] min-[380px]:text-[13px] sm:text-[15px]",children:"Pagar agora e receber meu livro completo, publicado, em menos de 1 hora!"}),oe||be?e.jsx(H,{className:"relative z-10 h-5 w-5 shrink-0 animate-spin","aria-hidden":"true"}):e.jsx(z,{className:"ativo-offer-arrow relative z-10 h-6 w-6 shrink-0 drop-shadow-sm","aria-hidden":"true"}),Z&&e.jsxs("span",{role:"alert",className:"absolute bottom-full left-1/2 mb-2 w-[min(92vw,520px)] -translate-x-1/2 rounded-xl border border-red-200/25 bg-red-950/95 px-3 py-2 text-center text-[11px] font-bold text-red-100 shadow-xl",children:[Z," Clique novamente para tentar."]})]}):e.jsxs("button",{type:"button",onClick:Nt,disabled:be,"data-testid":"ativo-plan-purchase-bar","aria-label":Ye,title:Ye,className:"ativo-purchase-button ativo-sheen pointer-events-auto group relative mx-auto flex min-h-[58px] w-full max-w-[820px] cursor-pointer items-center justify-center gap-2.5 overflow-hidden rounded-[22px] border-2 border-[#e4fff9] bg-[linear-gradient(105deg,#61dfcd_0%,#bdfff2_48%,#61dfcd_100%)] px-5 py-3.5 text-center font-sans text-[#053842] transition duration-300 min-[360px]:min-h-[70px] hover:-translate-y-1 hover:scale-[1.012] hover:brightness-110 hover:shadow-[0_24px_58px_rgba(0,0,0,.52),0_0_64px_rgba(109,255,232,.72)] focus-visible:outline-none focus-visible:ring-4 focus-visible:ring-[#9af4e5]/60 active:translate-y-0 active:scale-[.99] disabled:cursor-wait disabled:opacity-90 sm:min-h-[76px] sm:rounded-[24px] sm:px-7",children:[e.jsx("span",{"aria-hidden":"true",className:"absolute -right-10 -top-16 h-40 w-40 rounded-full bg-white/35 blur-3xl transition duration-500 group-hover:bg-white/50"}),e.jsx(Ae,{className:"relative z-10 hidden h-5 w-5 shrink-0 drop-shadow-sm min-[360px]:block","aria-hidden":"true"}),e.jsxs("strong",{className:"relative z-10 line-clamp-2 min-w-0 text-xs font-black uppercase leading-[1.2] tracking-[-.015em] min-[380px]:text-[13px] sm:text-[15px]",children:["QUERO QUE MEU LIVRO ",Oe?e.jsx("span",{className:"break-words text-[#0a5960]",children:Oe}):null," SEJA ESCRITO E PUBLICADO!"]}),be?e.jsx(H,{className:"relative z-10 h-5 w-5 shrink-0 animate-spin","aria-hidden":"true"}):e.jsx(z,{className:"ativo-offer-arrow relative z-10 h-6 w-6 shrink-0 drop-shadow-sm","aria-hidden":"true"}),Z&&e.jsxs("span",{role:"alert",className:"absolute bottom-full left-1/2 mb-2 w-[min(92vw,520px)] -translate-x-1/2 rounded-xl border border-red-200/25 bg-red-950/95 px-3 py-2 text-center text-[11px] font-bold text-red-100 shadow-xl",children:[Z," Clique novamente para tentar."]})]})]}),d&&e.jsxs("button",{onClick:Qe,className:"mx-auto mt-6 inline-flex items-center gap-1.5 text-xs text-[#91afb3] transition hover:text-white",children:[e.jsx(at,{className:"h-3.5 w-3.5"})," Começar outro livro"]}),!d&&j==="idea"&&e.jsx(da,{onCta:Xe})]})]})})}export{Pa as default};

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.