PageSourceSearch

https://sabhia.ai/assets/oferta-detalhe-D13zd2m9.js

js sabhia.ai collected 2026-10-05 12:33:03 UTC 45,415 bytes, 1 lines download raw bytes

1var ye=i=>{throw TypeError(i)};var le=(i,t,s)=>t.has(i)||ye("Cannot "+s);var u=(i,t,s)=>(le(i,t,"read from private field"),s?s.call(i):t.get(i)),F=(i,t,s)=>t.has(i)?ye("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(i):t.set(i,s),C=(i,t,s,r)=>(le(i,t,"write to private field"),r?r.call(i,s):t.set(i,s),s),T=(i,t,s)=>(le(i,t,"access private method"),s);import{j as e}from"./vendor-motion-CPxq9Xvn.js";import{r as j}from"./vendor-i18n-CO3kK2bH.js";import{dM as Ae,dN as me,dO as _e,dP as Be,dQ as Fe,ai as Te,dR as De,dS as Qe,dT as $e,dU as ze,dV as Me,dW as Le,dX as Ne,dY as ve,dZ as Ve,d_ as Ke,a2 as Xe,a3 as Ie,u as J,an as A,ar as oe,a as _,B as O,p as Ue,S as He,ax as we,b as Ce,Z as ne,X as Ge,Y as We,C as I,l as Ze,a8 as Se,f as he,K as ke,e as qe,k as Ye,A as Je,N as es,J as ss,a6 as ce,D as as,q as ts,aj as Z,r as Y,ay as rs,i as is,aZ as ls,a7 as re,ap as os,aa as ns,ao as cs,ab as ds,ae as xs,af as ms,ag as hs,ah as us}from"./index-CFAvyuXu.js";import{B as de}from"./badge-B9GAfHbC.js";import{S as M}from"./skeleton-qDXhNV0j.js";import{A as Pe}from"./arrow-left-DY50GvQQ.js";import{T as ps}from"./trophy-Bk4C1tet.js";import{A as gs}from"./arrow-down-CKXfmsWg.js";import{U as bs}from"./user-check-BipRjh2G.js";import{C as fs}from"./circle-question-mark-CHWMaDUy.js";import{C as ue}from"./circle-alert-CixghSwT.js";import"./vendor-react-CQmBMThG.js";function Oe(i,t){const s=new Set(t);return i.filter(r=>!s.has(r))}function js(i,t,s){const r=i.slice(0);return r[t]=s,r}var V,P,K,X,E,Q,ee,se,ae,w,pe,ge,be,fe,je,Re,ys=(Re=class extends Ae{constructor(t,s,r){super();F(this,w);F(this,V);F(this,P);F(this,K);F(this,X);F(this,E);F(this,Q);F(this,ee);F(this,se);F(this,ae,[]);C(this,V,t),C(this,X,r),C(this,K,[]),C(this,E,[]),C(this,P,[]),this.setQueries(s)}onSubscribe(){this.listeners.size===1&&u(this,E).forEach(t=>{t.subscribe(s=>{T(this,w,fe).call(this,t,s)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,u(this,E).forEach(t=>{t.destroy()})}setQueries(t,s){C(this,K,t),C(this,X,s),me.batch(()=>{const r=u(this,E),n=T(this,w,be).call(this,u(this,K));n.forEach(c=>c.observer.setOptions(c.defaultedQueryOptions));const l=n.map(c=>c.observer),x=l.map(c=>c.getCurrentResult()),m=r.length!==l.length,v=l.some((c,q)=>c!==r[q]),y=m||v,b=y?!0:x.some((c,q)=>{const d=u(this,P)[q];return!d||!_e(c,d)});!y&&!b||(y&&(C(this,ae,n),C(this,E,l)),C(this,P,x),this.hasListeners()&&(y&&(Oe(r,l).forEach(c=>{c.destroy()}),Oe(l,r).forEach(c=>{c.subscribe(q=>{T(this,w,fe).call(this,c,q)})})),T(this,w,je).call(this)))})}getCurrentResult(){return u(this,P)}getQueries(){return u(this,E).map(t=>t.getCurrentQuery())}getObservers(){return u(this,E)}getOptimisticResult(t,s){const r=T(this,w,be).call(this,t),n=r.map(l=>l.observer.getOptimisticResult(l.defaultedQueryOptions));return[n,l=>T(this,w,ge).call(this,l??n,s),()=>T(this,w,pe).call(this,n,r)]}},V=new WeakMap,P=new WeakMap,K=new WeakMap,X=new WeakMap,E=new WeakMap,Q=new WeakMap,ee=new WeakMap,se=new WeakMap,ae=new WeakMap,w=new WeakSet,pe=function(t,s){return s.map((r,n)=>{const l=t[n];return r.defaultedQueryOptions.notifyOnChangeProps?l:r.observer.trackResult(l,x=>{s.forEach(m=>{m.observer.trackProp(x)})})})},ge=function(t,s){return s?((!u(this,Q)||u(this,P)!==u(this,se)||s!==u(this,ee))&&(C(this,ee,s),C(this,se,u(this,P)),C(this,Q,Be(u(this,Q),s(t)))),u(this,Q)):t},be=function(t){const s=new Map;u(this,E).forEach(n=>{const l=n.options.queryHash;if(!l)return;const x=s.get(l);x?x.push(n):s.set(l,[n])});const r=[];return t.forEach(n=>{const l=u(this,V).defaultQueryOptions(n),m=s.get(l.queryHash)?.shift()??new Fe(u(this,V),l);r.push({defaultedQueryOptions:l,observer:m})}),r},fe=function(t,s){const r=u(this,E).indexOf(t);r!==-1&&(C(this,P,js(u(this,P),r,s)),T(this,w,je).call(this))},je=function(){if(this.hasListeners()){const t=u(this,Q),s=T(this,w,pe).call(this,u(this,P),u(this,ae)),r=T(this,w,ge).call(this,s,u(this,X)?.combine);t!==r&&me.batch(()=>{this.listeners.forEach(n=>{n(u(this,P))})})}},Re);function Ns({queries:i,...t},s){const r=Te(),n=De(),l=Qe(),x=j.useMemo(()=>i.map(f=>{const N=r.defaultQueryOptions(f);return N._optimisticResults=n?"isRestoring":"optimistic",N}),[i,r,n]);x.forEach(f=>{$e(f);const N=r.getQueryCache().get(f.queryHash);ze(f,l,N)}),Me(l);const[m]=j.useState(()=>new ys(r,x,t)),[v,y,b]=m.getOptimisticResult(x,t.combine),c=!n&&t.subscribed!==!1;j.useSyncExternalStore(j.useCallback(f=>c?m.subscribe(me.batchCalls(f)):Le,[m,c]),()=>m.getCurrentResult(),()=>m.getCurrentResult()),j.useEffect(()=>{m.setQueries(x,t)},[x,t,m]);const d=v.some((f,N)=>Ne(x[N],f))?v.flatMap((f,N)=>{const h=x[N];if(h){const k=new Fe(r,h);if(Ne(h,f))return ve(h,k,l);Ve(f,n)&&ve(h,k,l)}return[]}):[];if(d.length>0)throw Promise.all(d);const S=v.find((f,N)=>{const h=x[N];return h&&Ke({result:f,errorResetBoundary:l,throwOnError:h.throwOnError,query:r.getQueryCache().get(h.queryHash),suspense:h.suspense})});if(S?.error)throw S.error;return y(b())}let xe=null;function vs(){return xe||(xe=fetch("/api/stripe/publishable-key").then(i=>i.json()).then(i=>us(i.publishableKey||"")).catch(()=>null)),xe}function ws({orderId:i,onSuccess:t,onError:s}){const r=xs(),n=ms(),[l,x]=j.useState(!1),m=async()=>
1{if(!r||!n)return;x(!0);const{error:v}=await r.confirmPayment({elements:n,redirect:"if_required"});if(v){s(v.message||"Erro no pagamento com cartão"),x(!1);return}try{await A("POST",`/api/offers/checkout/${i}/confirm-card`,{})}catch{}t()};return e.jsxs("div",{className:"space-y-4",children:[e.jsx(hs,{options:{layout:"tabs"}}),e.jsx(O,{"data-testid":"card-confirm-pay-btn",onClick:m,disabled:l||!r||!n,className:"w-full bg-amber-500 hover:bg-amber-400 text-black font-bold py-3 rounded-xl",children:l?e.jsxs(e.Fragment,{children:[e.jsx(re,{className:"w-4 h-4 animate-spin mr-2"}),"Processando…"]}):"Confirmar pagamento"})]})}function Cs({open:i,onClose:t,preview:s,pkg:r,userCredits:n}){const{toast:l}=Ie(),x=Te(),[m,v]=j.useState("choose"),[y,b]=j.useState("pix"),[c,q]=j.useState(null),[d,S]=j.useState(!1),[f,N]=j.useState(0),[h,k]=j.useState(!1),[$,p]=j.useState(null),[B,te]=j.useState(null),z=n>=s.finalPriceCents,U=ce({mutationFn:()=>A("POST","/api/offers/checkout/pix",{packageSlug:r.slug,bookId:s.bookId}).then(o=>o.json()),onSuccess(o){q({orderId:o.orderId,brCode:o.brCode,qrCodeImage:o.qrCodeImage,finalPriceFormatted:o.finalPriceFormatted}),v("pix_pending")},onError(){l({title:"Erro ao gerar PIX",description:"Tente novamente em alguns segundos.",variant:"destructive"})}}),H=ce({mutationFn:()=>A("POST","/api/offers/checkout/card",{packageSlug:r.slug,bookId:s.bookId}).then(o=>o.json()),onSuccess(o){o.clientSecret&&o.orderId?(p(o.clientSecret),te(o.orderId),v("card_pending")):l({title:"Erro ao iniciar cartão",description:"Resposta inválida do servidor.",variant:"destructive"})},onError(){l({title:"Erro ao iniciar cartão",description:"Tente novamente.",variant:"destructive"})}}),L=ce({mutationFn:()=>A("POST","/api/offers/checkout/credits",{packageSlug:r.slug,bookId:s.bookId}).then(o=>o.json()),onSuccess(o){x.invalidateQueries({queryKey:["/api/auth/me"]}),k(!0),v("done")},onError(o){const W=o?.message||"Erro ao pagar com créditos";l({title:"Erro",description:W,variant:"destructive"})}}),{data:G}=J({queryKey:["/api/offers/checkout",c?.orderId,"status",f],queryFn:()=>A("GET",`/api/offers/checkout/${c.orderId}/status`).then(o=>o.json()),enabled:!!c?.orderId&&m==="pix_pending",refetchInterval:4e3,staleTime:0});j.useEffect(()=>{G?.paid&&m==="pix_pending"&&(k(!0),v("done"),x.invalidateQueries({queryKey:["/api/auth/me"]}))},[G,m,x]);const R=async()=>{c?.brCode&&(await navigator.clipboard.writeText(c.brCode).catch(()=>{}),S(!0),setTimeout(()=>S(!1),2e3))},a=()=>{y==="pix"?U.mutate():y==="card"?H.mutate():L.mutate()},g=()=>{v("choose"),q(null),k(!1),S(!1),N(0),p(null),te(null)},D=()=>{g(),t()};return e.jsx(as,{open:i,onOpenChange:o=>!o&&D(),children:e.jsxs(ts,{className:"bg-gray-900 border border-gray-700 text-white max-w-md w-full",children:[m==="choose"&&e.jsxs(e.Fragment,{children:[e.jsx(Z,{children:e.jsx(Y,{className:"text-white text-lg",children:"Confirmar compra"})}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"bg-gray-800/60 rounded-xl p-4 space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-300",children:[e.jsx("span",{className:"text-2xl",children:r.emoji}),e.jsxs("div",{children:[e.jsx("div",{className:"font-semibold text-white",children:r.name}),e.jsxs("div",{className:"text-gray-400 text-xs",children:["para ",e.jsx("span",{className:"text-gray-200",children:s.bookTitle})]})]})]}),e.jsxs("div",{className:"border-t border-gray-700 pt-2 mt-2",children:[s.discountCents>0&&e.jsxs("div",{className:"flex justify-between text-sm",children:[e.jsx("span",{className:"text-gray-400",children:"Desconto (já possui)"}),e.jsxs("span",{className:"text-green-400",children:["−",s.discountFormatted]})]}),e.jsxs("div",{className:"flex justify-between mt-1",children:[e.jsx("span",{className:"text-gray-200 font-medium",children:"Total"}),e.jsx("span",{className:"text-amber-400 font-extrabold text-xl",children:s.finalPriceFormatted})]}),e.jsxs("div",{className:"text-xs text-gray-500 text-right mt-0.5",children:[s.newServiceSlugs.length," serviço(s) incluído(s)"]})]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-gray-400 mb-2",children:"Forma de pagamento"}),e.jsx("div",{className:"grid grid-cols-3 gap-2",children:["pix","card","credits"].map(o=>e.jsxs("button",{"data-testid":`payment-method-${o}`,onClick:()=>b(o),className:`flex flex-col items-center gap-1 rounded-xl border px-3 py-3 text-xs font-semibold transition-all ${y===o?"border-amber-500 bg-amber-500/10 text-amber-300":"border-gray-700 bg-gray-800 text-gray-400 hover:border-gray-500"}`,children:[o==="pix"&&e.jsx(rs,{className:"w-5 h-5"}
1),o==="card"&&e.jsx(is,{className:"w-5 h-5"}),o==="credits"&&e.jsx(ls,{className:"w-5 h-5"}),e.jsx("span",{children:o==="pix"?"PIX":o==="card"?"Cartão":"Créditos"}),o==="credits"&&e.jsx("span",{className:`text-xs ${z?"text-gray-500":"text-red-400"}`,children:z?`${n}cr`:"Saldo insuf."})]},o))})]}),y==="credits"&&!z&&e.jsxs("div",{className:"flex items-start gap-2 bg-red-950/40 border border-red-800/50 rounded-lg p-3 text-sm",children:[e.jsx(ue,{className:"w-4 h-4 text-red-400 mt-0.5 flex-shrink-0"}),e.jsxs("span",{className:"text-red-300",children:["Saldo insuficiente. Você tem ",e.jsx("strong",{children:n})," créditos e precisa de"," ",e.jsx("strong",{children:s.finalPriceCents}),"."," ",e.jsx(_,{href:"/creditos",className:"underline text-red-200",children:"Comprar créditos"})]})]}),s.newServiceSlugs.includes("direito_autoral")&&!s?.hasCpf&&e.jsxs("div",{className:"flex items-start gap-2 bg-amber-950/40 border border-amber-700/50 rounded-lg p-3 text-sm",children:[e.jsx(ue,{className:"w-4 h-4 text-amber-400 mt-0.5 flex-shrink-0"}),e.jsxs("span",{className:"text-amber-200",children:["O serviço de ",e.jsx("strong",{children:"Direito Autoral"})," exige CPF cadastrado."," ",e.jsx(_,{href:"/perfil",className:"underline text-amber-100",children:"Adicione seu CPF em Perfil"})," ","antes de prosseguir."]})]}),e.jsxs(O,{"data-testid":"confirm-purchase-btn",onClick:a,disabled:U.isPending||H.isPending||L.isPending||y==="credits"&&!z,className:"w-full bg-amber-500 hover:bg-amber-400 text-black font-bold py-3 rounded-xl",children:[U.isPending||H.isPending||L.isPending?e.jsx(re,{className:"w-4 h-4 animate-spin mr-2"}):null,y==="pix"?"Gerar PIX":y==="card"?"Pagar com Cartão":"Pagar com Créditos"]})]})]}),m==="pix_pending"&&c&&e.jsxs(e.Fragment,{children:[e.jsx(Z,{children:e.jsx(Y,{className:"text-white",children:"Pague via PIX"})}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"text-center text-amber-400 font-extrabold text-2xl",children:c.finalPriceFormatted}),c.qrCodeImage&&e.jsx("div",{className:"flex justify-center",children:e.jsx("div",{className:"bg-white p-3 rounded-xl",children:e.jsx("img",{src:c.qrCodeImage,alt:"QR Code PIX",className:"w-44 h-44"})})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-gray-400 mb-1.5",children:"Código copia e cola"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("div",{className:"bg-gray-800 border border-gray-700 rounded-lg px-3 py-2 text-xs text-gray-300 flex-1 font-mono truncate",children:[c.brCode.slice(0,40),"…"]}),e.jsx(O,{size:"sm",variant:"outline",onClick:R,className:"border-gray-700 bg-gray-800 hover:bg-gray-700 text-gray-300 px-3",children:d?e.jsx(os,{className:"w-4 h-4 text-green-400"}):e.jsx(ns,{className:"w-4 h-4"})})]})]}),e.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-400",children:[e.jsx(re,{className:"w-4 h-4 animate-spin text-amber-400"}),e.jsx("span",{children:"Aguardando pagamento…"})]}),e.jsxs(O,{variant:"ghost",size:"sm",onClick:()=>N(o=>o+1),className:"w-full text-gray-500 hover:text-gray-300",children:[e.jsx(cs,{className:"w-3.5 h-3.5 mr-1.5"}),"Verificar manualmente"]})]})]}),m==="card_pending"&&$&&B&&e.jsxs(e.Fragment,{children:[e.jsx(Z,{children:e.jsx(Y,{className:"text-white",children:"Pagamento por Cartão"})}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"text-center text-amber-400 font-extrabold text-xl",children:s.finalPriceFormatted}),e.jsx(ds,{stripe:vs(),options:{clientSecret:$,appearance:{theme:"night",variables:{colorPrimary:"#f59e0b"}}},children:e.jsx(ws,{orderId:B,onSuccess:()=>{x.invalidateQueries({queryKey:["/api/auth/me"]}),x.invalidateQueries({queryKey:["/api/credits/balance"]}),k(!0),v("done")},onError:o=>{l({title:"Erro no cartão",description:o,variant:"destructive"})}})}),e.jsx(O,{variant:"ghost",size:"sm",onClick:D,className:"w-full text-gray-500",children:"Cancelar"})]})]}),m==="card_pending"&&(!$||!B)&&e.jsxs(e.Fragment,{children:[e.jsx(Z,{children:e.jsx(Y,{className:"text-white",children:"Pagamento por Cartão"})}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"bg-gray-800/60 rounded-xl p-4 text-sm text-gray-400",children:["Carregando formulário de pagamento…",e.jsx(re,{className:"w-4 h-4 animate-spin mt-2 mx-auto"})]}),e.jsx(O,{variant:"ghost",size:"sm",onClick:D,className:"w-full text-gray-500",children:"Cancelar"})]})]}),m==="done"&&e.jsxs(e.Fragment,{children:[e.jsx(Z,{children:e.jsx(Y,{className:"text-white",children:"Compra confirmada! 🎉"})}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"flex justify-center py-2",children:e.jsx("div",{className:"w-16 h-16 rounded-full bg-green-500/15 border border-green-500/30 flex items-center justify-center",children:e.jsx(I,{className:"w-8 h-8 text-green-400"})})}),e.jsx("p",{className:"text-gray-300 text-center text-sm",children:"Pagamento confirmado! A Equipe Sábhia já foi notificada e está iniciando os seus serviços. Acompanhe o progresso na área de Serviços."}),e.jsxs("div",{className:"bg-gray-800/60 rounded-xl p-4 space-y-1.5",children:[e.jsx("p",{className:"text-gray-400 text-xs font-semibold uppercase tracking-wide mb-2",children:"Serviços iniciados"}),s.newServiceSlugs.map(o=>{const W=s.services.find(ie=>ie.slug===o);return e.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-300",children:[e.jsx(I,{className:"w-3.5 h-3.5 text-green-400 flex-shrink-0"}),e.jsx("span",{children:W?`${W.emoji} ${W.title}`:o.replace(/_/g," ").replace(/\b\w/g,ie=>ie.toUpperCase())})]},o)})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(O,{asChild:!0,variant:"outline",className:"flex-1 border-gray-700 bg-gray-800 text-gray-200 hover:bg-gray-700",children:e.jsx(_,{href:"/dashboard",children:"Ir ao Dashboard"})}),e.jsx(O,{asChild:!0,className:"flex-1 bg-amber-500 hover:bg-amber-400 text-black font-bold",children:e.jsx(_,{href:"/ofertas",children:"Ver mais ofertas"})})]})]})]})]})})}function Ss(i){return i?i.startsWith("http")||i.startsWith("/")?i:`/api/covers/image/${i}`:null}const Ee={isbn_register:{headline:"Sua obra no catálogo mundial",body:"Sem ISBN, seu livro não existe para livrarias, Amazon ou bibliotecas. Com o ISBN registrado, sua obra fica disponível em qualquer loja do planeta — de São Paulo a Nova York.",fearText:"Invisível em livrarias, Amazon e bibliotecas do mundo"},ficha_catalografica:{headline:"Exigida por lei para publicar no Brasil",body:"A Ficha Catalográfica é o documento oficial da sua obra. Assinada por bibliotecária CRB certificada, ela é obrigatória para qualquer publicação brasileira séria — editoras e distribuidoras exigem.",fearText:"Publicação inválida para exigências legais brasileiras"},barcode_isbn:{headline:"Entrega imediata — pronto para vender",body:"O Código de Barras EAN-13 em alta resolução é entregue assim que o ISBN é emitido. Coloque na capa e seu livro está pronto para pontos de venda físicos e digitais.",fearText:"Recusado em pontos de venda e varejos físicos"},direito_autoral:{headline:"Seu nome na Biblioteca Nacional para sempre",body:"O Registro de Direito Autoral na FBN/EDA é a prova legal definitiva de autoria. Em disputas de plágio, é o que vale no tribunal. Sem ele, provar que você escreveu primeiro pode ser impossível.",fearText:"Sem proteção legal — qualquer um pode copiar sua obra"}};function ks({books:i,selectedBookId:t,onSelect:s,booksLoading:r,user:n,bookPreviews:l,totalServicesCount:x}){const[m,v]=j.useState({}),y=x??4;return n?r?e.jsx("div",{className:"space-y-2",children:[1,2,3].map(b=>e.jsxs("div",{className:"flex items-center gap-3 p-2.5 rounded-xl bg-gray-800/40",children:[e.jsx(M,{className:"w-9 h-[52px] bg-gray-700 rounded-md flex-shrink-0"}),e.jsxs("div",{className:"flex-1 space-y-2",children:[e.jsx(M,{className:"h-3 w-3/4 bg-gray-700 rounded"}),e.jsx(M,{className:"h-2.5 w-1/2 bg-gray-700 rounded"})]})]},b))}):i.length===0?e.jsxs("div",{className:"bg-gray-800/60 rounded-xl p-4 text-center border border-gray-700",children:[e.jsx(he,{className:"w-8 h-8 text-gray-600 mx-auto mb-2"}),e.jsx("p",{className:"text-gray-300 text-sm font-medium",children:"Nenhum livro encontrado"}),e.jsx("p",{className:"text-gray-500 text-xs mt-1 mb-3",children:"Crie seu primeiro livro para adquirir o pacote"}),e.jsx(_,{href:"/dashboard",children:e.jsx(O,{size:"sm",className:"bg-amber-500 hover:bg-amber-400 text-black font-bold",children:"Criar meu livro"})})]}):e.jsx("div",{className:"space-y-1.5 max-h-72 overflow-y-auto pr-0.5",children:i.map(b=>
1{const c=Ss(b.coverImage),q=!!c&&!m[b.id],d=t===b.id,S=l?.[b.id],f=S?.alreadyOwnedSlugs.length??0,N=S?.blockReason==="already_owned_all";let h="",k="text-gray-500";return S&&(N?(h="Todos os serviços já possuídos",k="text-green-400"):f>0?(h=`${f} de ${y} serviços já possuídos`,k="text-amber-400"):(h="Nenhum serviço adquirido ainda",k="text-gray-500")),e.jsxs("button",{"data-testid":`book-option-${b.id}`,onClick:()=>s(b.id),title:b.title||"Sem título",className:`w-full flex items-center gap-3 p-2.5 rounded-xl border-2 transition-all duration-200 focus:outline-none text-left ${d?"border-amber-500 bg-amber-500/8 shadow-[0_0_10px_rgba(245,158,11,0.2)]":N?"border-green-800/30 bg-green-950/15 opacity-75":"border-gray-700/50 bg-gray-800/30 hover:border-gray-600 hover:bg-gray-800/50"}`,children:[e.jsx("div",{className:"w-9 flex-shrink-0 rounded-md overflow-hidden bg-gray-800",style:{height:52},children:q?e.jsx("img",{src:c,alt:b.title||"Capa",onError:()=>v($=>({...$,[b.id]:!0})),className:"w-full h-full object-cover"}):e.jsx("div",{className:`w-full h-full flex items-center justify-center ${d?"bg-amber-900/30":"bg-gray-800"}`,children:e.jsx(he,{className:`w-4 h-4 ${d?"text-amber-400":"text-gray-600"}`})})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:`text-xs font-semibold leading-snug truncate ${d?"text-white":N?"text-gray-400":"text-gray-300"}`,children:b.title||"Sem título"}),h&&e.jsx("p",{className:`text-[10px] mt-0.5 leading-snug ${k}`,children:h}),!h&&e.jsx("p",{className:"text-[10px] mt-0.5 text-gray-600",children:"Carregando status…"})]}),N&&e.jsx(I,{className:"w-4 h-4 text-green-400 flex-shrink-0"}),d&&!N&&e.jsx(I,{className:"w-4 h-4 text-amber-400 flex-shrink-0"})]},b.id)})}):e.jsx(_,{href:"/login",children:e.jsx(O,{size:"sm",className:"w-full bg-amber-500 hover:bg-amber-400 text-black font-bold",children:"Fazer login para continuar"})})}function $s({params:i}){const t=i.slug,{user:s}=Xe(),[r,n]=j.useState(""),[l,x]=j.useState(!1),[m,v]=j.useState(null),y=j.useRef(null),{toast:b}=Ie(),{data:c,isLoading:q}=J({queryKey:["/api/offers/packages"],queryFn:()=>A("GET","/api/offers/packages").then(a=>a.json()),staleTime:300*1e3}),d=c?.packages.find(a=>a.slug===t)||null,{data:S,isLoading:f}=J({queryKey:["/api/books"],queryFn:()=>A("GET","/api/books").then(a=>a.json()),enabled:!!s,staleTime:6e4}),h=(Array.isArray(S)?S:S?.books||[]).filter(a=>a.title&&a.title.trim().length>0),{data:k}=J({queryKey:["/api/credits/balance"],queryFn:()=>A("GET","/api/credits/balance").then(a=>a.json()),enabled:!!s,staleTime:3e4}),$=k?.balance??0,{data:p,isLoading:B}=J({queryKey:["/api/offers/packages",t,"preview",r],queryFn:()=>A("POST",`/api/offers/packages/${t}/preview`,{bookId:r}).then(a=>a.json()),enabled:!!r&&!!s,staleTime:3e4});j.useEffect(()=>{!r&&h.length>0&&n(h[0].id)},[h,r]);const te=Ns({queries:h.map(a=>({queryKey:["/api/offers/packages",t,"preview",a.id],queryFn:()=>A("POST",`/api/offers/packages/${t}/preview`,{bookId:a.id}).then(g=>g.json()),enabled:!!s&&h.length>0,staleTime:6e4}))}),z={};h.forEach((a,g)=>{z[a.id]=te[g]?.data??null});const U=[{q:"Preciso de ISBN para publicar meu livro?",a:"Sim, para qualquer publicação séria. Livrarias, Amazon, Submarino e bibliotecas públicas exigem ISBN. Sem ele, seu livro simplesmente não é encontrado nos sistemas de catálogo."},{q:"O Registro de Direito Autoral já não é automático?",a:"O copyright existe automaticamente ao criar a obra, mas o Registro na Biblioteca Nacional (FBN/EDA) é a PROVA LEGAL com data oficial. Em disputas judiciais, é esse registro que comprova que você foi o primeiro a criar. Sem ele, provar autoria pode ser extremamente difícil."},{q:"Quanto tempo leva o processo completo?",a:"O Código de Barras é entregue imediatamente após o ISBN. O ISBN sai em até 7 dias úteis. A Ficha Catalográfica em até 5 dias úteis. O Registro de Direito Autoral segue o prazo da Biblioteca Nacional, que pode levar até 30 dias."},{q:"Posso usar para qualquer livro que tenho na plataforma?",a:"Sim! Você seleciona exatamente qual livro receberá o pacote antes de finalizar a compra. Se você já possui algum destes serviços para um livro específico, o desconto é aplicado automaticamente."},{q:"O que acontece se eu já tiver um destes serviços?",a:"Desconto automático! O valor do serviço que você já possui é abatido do preço do pacote. Você paga apenas pelos serviços que realmente precisa — sem desperdício."}];if(q)return e.jsx(oe,{children:e.jsxs("div",{className:"min-h-screen bg-gray-950 p-6 space-y-4",children:[e.jsx(M,{className:"h-8 w-48 bg-gray-800"}),e.jsx(M,{className:"h-48 w-full bg-gray-800"}),e.jsx(M,{className:"h-64 w-full bg-gray-800"})]})});if(!d)return e.jsx(oe,{children:e.jsx("div",{className:"min-h-screen bg-gray-950 flex items-center justify-center",children:e.jsxs("div",{className:"text-center space-y-3",children:[e.jsx("div",{className:"text-4xl",children:"📦"}),e.jsx("p",{className:"text-gray-400",children:"Pacote não encontrado."}),e.jsx(_,{href:"/ofertas",children:e.jsxs(O,{variant:"outline",className:"border-gray-700",children:[e.jsx(Pe,{className:"w-4 h-4 mr-2"})," Ver ofertas"]})})]})})});const H=p?.canPurchase??!1,L=p?.blockReason==="already_owned_all",G=p?.finalPriceFormatted??d.priceFormatted,R=p?.services??d.services;return e.jsxs(oe,{children:[e.jsxs("div",{className:"min-h-screen bg-gray-950",children:[e.jsx("div",{className:"bg-gray-900/80 backdrop-blur-sm border-b border-gray-800/60 px-4 sm:px-6 py-3 sticky top-0 z-10",children:e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[e.jsx(_,{href:"/ofertas",children:e.jsxs("button",{className:"flex items-center gap-1.5 text-gray-400 hover:text-gray-200 transition-colors",children:[e.jsx(Pe,{className:"w-4 h-4"}),e.jsx("span",{children:"Todas as ofertas"})]})}),e.jsx(Ue,{className:"w-3.5 h-3.5 text-gray-600 flex-shrink-0"}),e.jsx("span",{className:"text-gray-300 font-medium truncate max-w-[200px]",children:d.name})]})}),e.jsxs("div",{className:"relative overflow-hidden bg-gradient-to-b from-gray-900 via-gray-900 to-gray-950 border-b border-gray-800/40",children:[e.jsx("div",{className:"absolute inset-0 bg-[radial-gradient(ellipse_80%_50%_at_50%_0%,rgba(217,119,6,0.12),transparent)] pointer-events-none"}),e.jsxs("div",{className:"relative max-w-5xl mx-auto px-4 sm:px-6 py-10 sm:py-14",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2 mb-4",children:[e.jsxs("div",{className:"inline-flex items-center gap-1.5 bg-amber-500/15 border border-amber-500/25 rounded-full px-3 py-1",children:[e.jsx(He,{className:"w-3 h-3 text-amber-400"}),e.jsx("span",{className:"text-amber-300 text-xs font-bold uppercase tracking-widest",children:"Oferta Exclusiva Sábhia"})]}),d.highlightBadge&&e.jsx(de,{className:"bg-amber-500 text-black text-xs font-bold px-2.5",children:d.highlightBadge})]}),e.jsxs("h1",{className:"text-3xl sm:text-5xl font-extrabold text-white leading-[1.1] mb-4",children:["Do arquivo para"," ",e.jsx("span",{className:"text-amber-400",children:"o mundo."})]}),e.jsxs("p",{className:"text-gray-300 text-base sm:text-lg max-w-2xl leading-relaxed mb-7",children:["Seu livro está escrito. Agora precisa dos"," ",e.jsxs("strong",{className:"text-white",children:[R.length," registros oficiais"]})," ","que separam um documento guardado no HD de uma obra"," ",e.jsx("strong",{className:"text-white",children:"real, vendável, protegida e reconhecida no mundo todo."})," ","Tudo em um pacote, com"," ",e.jsx("span",{className:"text-amber-400 font-bold",children:d.savingsFormatted?`${d.savingsFormatted} de desconto`:"preço especial"}),"."]}),e.jsx("div",{className:"flex flex-wrap gap-2.5 mb-8",children:[{icon:e.jsx(we,{className:"w-3.5 h-3.5"}),text:`${R.length} serviços oficiais`},{icon:e.jsx(ps,{className:"w-3.5 h-3.5"}),text:d.savingsFormatted?`Economize ${d.savingsFormatted}`:"Melhor preço"},{icon:e.jsx(Ce,{className:"w-3.5 h-3.5"}),text:"Equipe certificada"},{icon:e.jsx(ne,{className:"w-3.5 h-3.5"}),text:"Inicia imediatamente"}].map(({icon:a,text:g})=>e.jsxs("div",{className:"inline-flex items-center gap-2 bg-gray-800/80 border border-gray-700/60 rounded-full px-3.5 py-1.5 text-sm text-gray-300",children:[e.jsx("span",{className:"text-amber-400",children:a}),g]},g))}),e.jsxs("button",{"data-testid":"hero-cta-btn",onClick:()=>y.current?.scrollIntoView({behavior:"smooth"}),className:"inline-flex items-center gap-2 bg-amber-500 hover:bg-amber-400 text-black font-extrabold px-7 py-3.5 rounded-xl transition-all shadow-[0_4px_24px_rgba(245,158,11,0.40)] hover:shadow-[0_4px_32px_rgba(245,158,11,0.55)] text-sm sm:text-base",children:["Quero proteger meu livro",e.
1jsx(gs,{className:"w-4 h-4"})]})]})]}),e.jsxs("div",{className:"max-w-5xl mx-auto px-4 sm:px-6 py-8 sm:py-12 grid lg:grid-cols-[1fr_360px] gap-8 items-start",children:[e.jsxs("div",{className:"space-y-10 min-w-0",children:[e.jsxs("section",{children:[e.jsxs("h2",{className:"text-white font-extrabold text-xl sm:text-2xl mb-5 flex items-center gap-2.5",children:[e.jsx(Ge,{className:"w-5 h-5 text-amber-400 flex-shrink-0"}),"O que está em jogo"]}),e.jsxs("div",{className:"grid sm:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"bg-gray-900 border border-red-900/40 rounded-2xl p-5",children:[e.jsxs("div",{className:"flex items-center gap-2.5 mb-4",children:[e.jsx("div",{className:"w-7 h-7 rounded-full bg-red-500/15 flex items-center justify-center flex-shrink-0",children:e.jsx(We,{className:"w-3.5 h-3.5 text-red-400"})}),e.jsx("span",{className:"text-red-300 font-bold text-sm",children:"Sem os registros"})]}),e.jsxs("ul",{className:"space-y-2.5",children:[R.map(a=>{const g=Ee[a.slug];return g?e.jsxs("li",{className:"flex items-start gap-2 text-sm text-red-300/80 leading-snug",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-red-500 mt-1.5 flex-shrink-0"}),g.fearText]},a.slug):null}),e.jsxs("li",{className:"flex items-start gap-2 text-sm text-red-300/80 leading-snug",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-red-500 mt-1.5 flex-shrink-0"}),"Impossível provar autoria em disputas legais"]})]})]}),e.jsxs("div",{className:"bg-gray-900 border border-green-900/40 rounded-2xl p-5",children:[e.jsxs("div",{className:"flex items-center gap-2.5 mb-4",children:[e.jsx("div",{className:"w-7 h-7 rounded-full bg-green-500/15 flex items-center justify-center flex-shrink-0",children:e.jsx(I,{className:"w-3.5 h-3.5 text-green-400"})}),e.jsxs("span",{className:"text-green-300 font-bold text-sm",children:["Com o ",d.name]})]}),e.jsx("ul",{className:"space-y-2.5",children:["Disponível em livrarias, Amazon e bibliotecas do mundo","Exigências legais brasileiras 100% cumpridas","Código de barras para varejo físico e digital","Autoria registrada na Biblioteca Nacional do Brasil","Tudo feito por especialistas — você não precisa fazer nada"].map(a=>e.jsxs("li",{className:"flex items-start gap-2 text-sm text-green-300/80 leading-snug",children:[e.jsx(I,{className:"w-3.5 h-3.5 text-green-500 mt-0.5 flex-shrink-0"}),a]},a))})]})]})]}),e.jsxs("section",{children:[e.jsxs("h2",{className:"text-white font-extrabold text-xl sm:text-2xl mb-6 flex items-center gap-2.5",children:[e.jsx(we,{className:"w-5 h-5 text-amber-400 flex-shrink-0"}),"O que está incluído"]}),e.jsx("div",{className:"grid sm:grid-cols-2 gap-3",children:R.map(a=>{const g=Ee[a.slug],D=a.status==="owned";return e.jsxs("div",{"data-testid":`service-card-${a.slug}`,className:`relative bg-gray-900 border rounded-2xl p-4 transition-all ${D?"border-green-800/30 bg-green-950/10":"border-gray-800 hover:border-amber-800/40"}`,children:[e.jsxs("div",{className:"flex items-start justify-between mb-3",children:[e.jsx("div",{className:"w-11 h-11 rounded-xl bg-amber-500/10 border border-amber-500/20 flex items-center justify-center text-xl flex-shrink-0",children:a.emoji}),D?e.jsxs(de,{className:"bg-green-900/50 text-green-300 border border-green-700/40 text-[10px] font-semibold py-0.5 px-1.5",children:[e.jsx(I,{className:"w-2.5 h-2.5 mr-1"}),"já possui"]}):e.jsx(de,{className:"bg-amber-950/50 text-amber-300 border border-amber-700/30 text-[10px] font-semibold py-0.5 px-1.5",children:"falta adquirir"})]}),e.jsx("h3",{className:`text-sm font-bold mb-1 leading-tight ${D?"text-gray-500":"text-white"}`,children:a.title}),g&&e.jsx("p",{className:"text-gray-500 text-xs leading-relaxed line-clamp-2",children:g.headline}),e.jsxs("div",{className:"flex items-center gap-3 mt-3 pt-2 border-t border-gray-800/60",children:[a.slaBusinessDays===0?e.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] text-green-400 font-medium",children:[e.jsx(ne,{className:"w-2.5 h-2.5"}),"Entrega imediata"]}):e.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] text-gray-500",children:[e.jsx(Ze,{className:"w-2.5 h-2.5"}),a.slaBusinessDays," dias úteis"]}),e.jsx("span",{className:`text-[10px] font-semibold ml-auto ${D?"text-gray-600 line-through":"text-gray-400"}`,children:a.priceFormatted})]})]},a.slug)})}),e.jsxs("div",{className:"mt-4 flex items-center justify-between bg-gray-900/40 border border-gray-800/50 rounded-xl px-5 py-3",children:[e.jsx("span",{className:"text-gray-500 text-sm",children:"Comprando separado"}),e.jsx("span",{className:"text-gray-500 text-sm line-through",children:d.standaloneTotalFormatted})]})]}),p&&p.alreadyOwnedSlugs.length>0&&!L&&e.jsxs("section",{children:[e.jsxs("h2",{className:"text-white font-extrabold text-xl sm:text-2xl mb-5 flex items-center gap-2.5",children:[e.jsx(Se,{className:"w-5 h-5 text-amber-400 flex-shrink-0"}),"Desconto inteligente: você já possui"," ",e.jsxs("span",{className:"text-amber-400",children:[p.alreadyOwnedSlugs.length," de ",R.length]})," ","serviços"]}),e.jsxs("div",{className:"bg-gray-900 border border-amber-800/25 rounded-2xl p-5",children:[e.jsxs("p",{className:"text-gray-400 text-sm mb-4 leading-relaxed",children:["Nossa plataforma verifica automaticamente quais serviços você já possui e abate o valor proporcional do pacote. Você paga ",e.jsx("strong",{className:"text-white",children:"apenas pelo que realmente precisa"})," — sem desperdício."]}),e.jsx("div",{className:"flex flex-wrap gap-2 mb-5",children:R.map(a=>e.jsxs("div",{className:`flex items-center gap-1.5 rounded-xl px-3 py-1.5 border text-xs ${a.status==="owned"?"bg-green-950/40 border-green-700/30 text-green-300":"bg-gray-800/60 border-gray-700/50 text-gray-400"}`,children:[e.jsx("span",{children:a.emoji}),e.jsx("span",{className:"font-medium",children:a.title.split(" ").slice(0,2).join(" ")}),a.status==="owned"?e.jsx(I,{className:"w-3 h-3 text-green-400"}):e.jsx("span",{className:"text-gray-600 text-[10px]",children:"falta"})]},a.slug))}),e.jsxs("div",{className:"flex items-center justify-between bg-amber-950/30 border border-amber-800/30 rounded-xl px-5 py-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-400 text-xs",children:"Desconto por serviços já possuídos"}),e.jsx("p",{className:"text-white text-sm font-bold mt-0.5",children:"Aplicado automaticamente ao comprar"})]}),e.jsxs("div",{className:"text-right flex-shrink-0 ml-4",children:[e.jsx("p",{className:"text-green-400 font-extrabold text-2xl leading-none",children:p.discountFormatted}),e.jsx("p",{className:"text-gray-500 text-xs mt-0.5",children:"de desconto extra"})]})]})]})]}),e.jsxs("section",{children:[e.jsxs("h2",{className:"text-white font-extrabold text-xl sm:text-2xl mb-6 flex items-center gap-2.5",children:[e.jsx(ne,{className:"w-5 h-5 text-amber-400 flex-shrink-0"}),"Como funciona"]}),e.jsx("div",{className:"grid sm:grid-cols-2 gap-3",children:[{step:1,icon:e.jsx(he,{className:"w-3.5 h-3.5"}),title:"Escolha o livro",desc:"Selecione o livro que deseja registrar e publicar profissionalmente na plataforma.",sub:"Qualquer livro criado na Sábhia"},{step:2,icon:e.jsx(I,{className:"w-3.5 h-3.5"}),title:"Sistema verifica seus serviços",desc:"Nossa plataforma 
1identifica automaticamente o que você já possui para aquele livro específico.",sub:"Sem pagar duas vezes"},{step:3,icon:e.jsx(Se,{className:"w-3.5 h-3.5"}),title:"Desconto é aplicado",desc:"O valor dos serviços já possuídos é descontado automaticamente do preço final do pacote.",sub:"Preço justo e transparente"},{step:4,icon:e.jsx(bs,{className:"w-3.5 h-3.5"}),title:"Equipe finaliza tudo",desc:"Nossa equipe de especialistas certificados executa cada registro com toda a atenção necessária.",sub:"Bibliotecárias CRB + despachantes"},{step:5,icon:e.jsx(ke,{className:"w-3.5 h-3.5"}),title:"Seu livro está protegido",desc:"Você recebe todos os documentos e registros. Pronto para vender em qualquer livraria do mundo.",sub:"Acompanhe o progresso em Serviços"}].map(a=>e.jsxs("div",{className:"flex gap-3.5 bg-gray-900 border border-gray-800 rounded-2xl p-4 hover:border-gray-700 transition-colors",children:[e.jsx("div",{className:"flex-shrink-0 mt-0.5",children:e.jsx("div",{className:"w-8 h-8 rounded-full bg-amber-500/15 border border-amber-500/25 flex items-center justify-center text-amber-400 font-extrabold text-sm",children:a.step})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[e.jsx("span",{className:"text-amber-400",children:a.icon}),e.jsx("h3",{className:"text-white text-sm font-bold leading-tight",children:a.title})]}),e.jsx("p",{className:"text-gray-400 text-xs leading-relaxed",children:a.desc}),e.jsx("p",{className:"text-gray-600 text-[10px] mt-1.5 font-medium",children:a.sub})]})]},a.step))})]}),e.jsxs("section",{children:[e.jsxs("h2",{className:"text-white font-extrabold text-xl sm:text-2xl mb-5 flex items-center gap-2.5",children:[e.jsx(qe,{className:"w-5 h-5 text-amber-400 flex-shrink-0"}),"O que dizem os autores"]}),e.jsx("div",{className:"space-y-4",children:[{name:"Mariana Oliveira",role:"Autora de ficção científica",text:"Nunca pensei que publicar seria tão tranquilo. A Sábhia cuidou de tudo — ISBN, ficha, código de barras — e meu livro está na Amazon há 3 meses. Sem dor de cabeça nenhuma.",av:"MO"},{name:"Carlos Eduardo Faria",role:"Escritor e coach empresarial",text:"O Registro de Direito Autoral era o que mais me preocupava. Fiz pelo pacote da Sábhia, foi tudo automatizado e recebi o comprovante da Biblioteca Nacional em menos de 3 semanas.",av:"CE"},{name:"Priscila Mendonça",role:"Terapeuta e autora de autoajuda",text:"Tinha medo de toda essa parte burocrática. Com o Pacote de Registros foi simples — escolhi meu livro, paguei e a equipe tratou de tudo. Recomendo demais.",av:"PM"}].map(a=>e.jsxs("div",{className:"bg-gray-900 border border-gray-800 rounded-2xl p-5",children:[e.jsx("div",{className:"flex items-center gap-0.5 mb-2.5",children:[1,2,3,4,5].map(g=>e.jsx(qe,{className:"w-3.5 h-3.5 text-amber-400 fill-amber-400"},g))}),e.jsxs("p",{className:"text-gray-300 text-sm leading-relaxed mb-3",children:['"',a.text,'"']}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-9 h-9 rounded-full bg-amber-500/20 border border-amber-500/30 flex items-center justify-center text-amber-300 font-bold text-xs flex-shrink-0",children:a.av}),e.jsxs("div",{children:[e.jsx("p",{className:"text-white text-sm font-semibold",children:a.name}),e.jsx("p",{className:"text-gray-500 text-xs",children:a.role})]})]})]},a.name))})]}),e.jsxs("section",{children:[e.jsxs("h2",{className:"text-white font-extrabold text-xl sm:text-2xl mb-5 flex items-center gap-2.5",children:[e.jsx(fs,{className:"w-5 h-5 text-amber-400 flex-shrink-0"}),"Dúvidas frequentes"]}),e.jsx("div",{className:"space-y-2",children:U.map((a,g)=>e.jsxs("div",{className:"bg-gray-900 border border-gray-800 rounded-xl overflow-hidden",children:[e.jsxs("button",{"data-testid":`faq-toggle-${g}`,onClick:()=>v(m===g?null:g),className:"w-full flex items-center justify-between px-5 py-4 text-left gap-4",children:[e.jsx("span",{className:"text-gray-200 font-medium text-sm leading-snug",children:a.q}),e.jsx(Ye,{className:`w-4 h-4 text-gray-500 flex-shrink-0 transition-transform duration-200 ${m===g?"rotate-180":""}`})]}),m===g&&e.jsx("div",{className:"px-5 pb-4 border-t border-gray-800",children:e.jsx("p",{className:"text-gray-400 text-sm leading-relaxed pt-3",children:a.a})})]},g))})]}),e.jsxs("div",{className:"flex items-start gap-4 bg-gray-900/40 border border-amber-900/30 rounded-2xl p-5",children:[e.jsx(ke,{className:"w-8 h-8 text-amber-400 flex-shrink-0 mt-0.5"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-white font-bold text-sm mb-1",children:"Serviço executado por especialistas certificados"}),e.jsx("p",{className:"text-gray-400 text-sm leading-relaxed",children:"Todos os serviços são realizados pela Equipe Sábhia com bibliotecárias CRB, especialistas em propriedade intelectual e despachantes credenciados. Você acompanha cada etapa na área de Serviços da plataforma."})]})]})]}),e.jsxs("div",{ref:y,className:"lg:sticky lg:top-[72px] space-y-3",children:[e.jsxs("div",{className:"bg-gray-900 border border-amber-800/40 rounded-2xl overflow-hidden shadow-2xl shadow-black/30",children:[e.jsxs("div",{className:"px-5 pt-5 pb-4 border-b border-gray-800",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[e.jsx("div",{className:"w-12 h-12 rounded-xl bg-amber-500/10 border border-amber-500/20 flex items-center justify-center text-2xl flex-shrink-0",children:d.emoji}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-white font-extrabold text-base leading-tight",children:d.name}),e.jsxs("p",{className:"text-gray-500 text-xs mt-0.5",children:[R.length," serviços incluídos"]})]})]}),e.jsxs("div",{className:"bg-gray-800/50 rounded-xl p-3 space-y-1.5 mb-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-gray-500 text-xs",children:"Total avulso"}),e.jsx("span",{className:"text-gray-500 text-xs line-through",children:d.standaloneTotalFormatted})]}),d.savingsFormatted&&e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-green-400 text-xs font-semibold",children:"Desconto do pacote"}),e.jsxs("span",{className:"text-green-400 text-xs font-bold",children:["−",d.savingsFormatted]})]}),p&&p.discountCents>0&&e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-blue-300 text-xs",children:"Serviços já possuídos"}),e.jsxs("span",{className:"text-blue-300 text-xs font-bold",children:["−",p.discountFormatted]})]})]}),e.jsxs("div",{className:"text-center",children:[B&&r?e.jsx(M,{className:"h-10 w-36 mx-auto bg-gray-800"}):e.jsx("div",{className:"text-amber-400 font-extrabold text-4xl leading-none tracking-tight",children:G}),e.jsx("p",{className:"text-gray-500 text-xs mt-1.5",children:"à vista · PIX · Cartão · Créditos"})]})]}),e.jsx("div",{className:"px-5 py-3 border-b border-gray-800",children:e.jsx("div",{className:"flex flex-wrap gap-1.5",children:R.map(a=>e.jsxs("span",{className:`inline-flex items-center gap-1 text-xs px-2 py-1 rounded-full border ${a.status==="owned"?"bg-gray-800/30 border-gray-700/20 text-gray-600 line-through":"bg-gray-800 border-gray-700/50 text-gray-300"}`,children:[e.jsx("span",{children:a.emoji}),e.jsx("span",{children:a.title.split(" ").slice(0,2).join(" ")})]},a.slug))})}),e.jsxs("div",{className:"px-5 py-4 border-b border-gray-800",children:[e.jsx("p",{className:"text-gray-400 text-xs font-bold uppercase tracking-wider mb-3",children:"Para qual livro?"}),e.jsx(ks,{books:h,selectedBookId:r,onSelect:n,booksLoading:f,user:s,bookPreviews:z,totalServicesCount:R.length}),p&&!B&&p.alreadyOwnedSlugs.length>0&&e.jsxs("div",{className:"mt-2.5 flex items-center gap-1.5 text-xs text-green-400 bg-green-950/30 border border-green-800/30 rounded-lg px-3 py-2",children:[e.jsx(I,{className:"w-3 h-3 flex-shrink-0"}),p.alreadyOwnedSlugs.length," serviço(s) já possuídos — desconto aplicad
1o"]})]}),e.jsx("div",{className:"px-5 py-5",children:L?e.jsxs("div",{className:"bg-green-950/40 border border-green-800/40 rounded-xl p-4 text-center",children:[e.jsx(I,{className:"w-5 h-5 text-green-400 mx-auto mb-1.5"}),e.jsx("p",{className:"text-green-300 text-sm font-bold",children:"Você já possui todos os serviços"}),e.jsx("p",{className:"text-gray-500 text-xs mt-0.5",children:"para este livro"})]}):e.jsxs(e.Fragment,{children:[e.jsx(O,{"data-testid":"buy-package-btn",onClick:()=>{if(!r){b({title:"Selecione um livro",description:"Escolha o livro para este pacote.",variant:"destructive"});return}if(!s){b({title:"Faça login",description:"É necessário estar logado.",variant:"destructive"});return}x(!0)},disabled:!r||B||!H&&!!p,className:"w-full bg-amber-500 hover:bg-amber-400 text-black font-extrabold py-4 rounded-xl text-base shadow-[0_4px_20px_rgba(245,158,11,0.35)] hover:shadow-[0_4px_30px_rgba(245,158,11,0.55)] transition-all disabled:opacity-50 disabled:shadow-none",children:r?B?"Calculando preço…":e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsxs("span",{children:["Quero este pacote · ",G]}),e.jsx(Je,{className:"w-4 h-4 flex-shrink-0"})]}):"Selecione um livro acima"}),e.jsxs("div",{className:"flex items-center justify-center gap-4 mt-3",children:[e.jsxs("span",{className:"flex items-center gap-1 text-xs text-gray-600",children:[e.jsx(es,{className:"w-3 h-3"})," Pagamento seguro"]}),e.jsxs("span",{className:"flex items-center gap-1 text-xs text-gray-600",children:[e.jsx(Ce,{className:"w-3 h-3"})," Equipe certificada"]})]})]})})]}),p&&p.newServiceSlugs.includes("direito_autoral")&&!p.hasCpf&&e.jsxs("div",{className:"flex items-start gap-2.5 bg-amber-950/40 border border-amber-700/40 rounded-xl p-3.5 text-sm",children:[e.jsx(ue,{className:"w-4 h-4 text-amber-400 mt-0.5 flex-shrink-0"}),e.jsxs("span",{className:"text-amber-200 leading-snug",children:["Direito Autoral exige CPF cadastrado."," ",e.jsx(_,{href:"/perfil",className:"underline text-amber-100 font-semibold",children:"Adicione em Perfil"})," ","antes de prosseguir."]})]}),e.jsxs("div",{className:"bg-gray-900 border border-gray-800 rounded-2xl p-4 flex items-center gap-3",children:[e.jsx("div",{className:"w-9 h-9 rounded-xl bg-amber-500/10 border border-amber-500/20 flex items-center justify-center flex-shrink-0",children:e.jsx(ss,{className:"w-4 h-4 text-amber-400"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-gray-200 text-sm font-semibold leading-snug",children:"Dúvidas?"}),e.jsx("p",{className:"text-gray-500 text-xs",children:"Fale com nossa equipe agora"})]}),e.jsx(_,{href:"/suporte",children:e.jsx(O,{size:"sm",variant:"outline",className:"border-gray-700 bg-gray-800/60 text-gray-300 hover:bg-gray-700 hover:text-white flex-shrink-0 text-xs",children:"Chat"})})]})]})]})]}),p&&e.jsx(Cs,{open:l,onClose:()=>x(!1),preview:p,pkg:d,userCredits:$})]})}export{$s 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.