1import{r as x,j as e,x as P,L as w,p as b,l as y,_ as I,t as L,z as $}from"./index-NjMgXgUF.js";import{u as D,a as V,F as W,b as t,c as n,d as c,e as i,f as l,C as O,g as R,h as z,i as T,j as U,k as B,l as _,S as q,t as G}from"./usePartnerStores-DiWiiYYX.js";import M from"./Footer-Cy_mXuNJ.js";import{I as d}from"./input-CkveMB6S.js";import{P as H,a as J,b as K}from"./popover-DEljWI63.js";import{l as Q}from"./BitcoinTracker-eQblcOiC.js";import{C as A}from"./circle-alert-DbyxJKzf.js";import{C as X}from"./circle-check-big-xUHyRUPz.js";import{o as Y,s as m}from"./schemas-CgprjQY8.js";import"./label-DxviUXEG.js";import"./index-CdnraITV.js";import"./dialog-BgwGS2d4.js";import"./x-CEhdj1x0.js";import"./useQuery-BICCf8pc.js";import"./ReclameAquiSeal-DpHf-CMA.js";import"./appDownload-q6pRjOxD.js";import"./metaTracking-ChMeaaHd.js";import"./smartphone-DMqSJRtF.js";import"./message-circle-6oWzbAHq.js";import"./instagram-Bcvu4EFb.js";import"./circle-help-BG1VX3g1.js";import"./trending-down-XMnGpzLM.js";const Z=Y({name:m().min(2,"Nome deve ter pelo menos 2 caracteres").max(100),email:m().email("Email inválido").max(255),store:m().min(1,"Selecione a loja parceira").max(100),purchaseDate:m().min(1,"Informe a data da compra"),orderNumber:m().min(1,"Informe o número do pedido ou código da reserva").max(100),purchaseValue:m().min(1,"Informe o valor da compra")}),Ce=()=>{const[g,f]=x.useState(!1),[N,h]=x.useState("idle"),[v,C]=x.useState(!1),[S,E]=x.useState(null),{data:u,isLoading:k}=D(),s=V({resolver:G(Z),defaultValues:{name:"",email:"",store:"",purchaseDate:"",orderNumber:"",purchaseValue:""}}),F=async a=>{f(!0),h("idle");const j=`https://wa.me/552731914433?text=${encodeURIComponent(`Olá! Preciso de ajuda com meu cashback. 2 3*Nome:* ${a.name} 4*Email:* ${a.email} 5*Loja:* ${a.store} 6*Data da compra:* ${a.purchaseDate} 7*Número do pedido:* ${a.orderNumber} 8*Valor da compra:* R$ ${a.purchaseValue}`)}`;E(j);const o=window.open("about:blank","_blank");try{const{error:p}=await $.functions.invoke("cashback-support",{body:{...a,language:"pt"}});if(p)throw p;h("success"),o&&!o.closed?o.location.href=j:window.location.href=j}catch(p){console.error("Error submitting form:",p),h("error"),o==null||o.close()}finally{f(!1)}};return e.jsxs(e.Fragment,{children:[e.jsx(P,{title:"Ajuda com Cashback | SATS Capital",description:"Abra um pedido de ajuda para cashback não recebido. Nossa equipe irá analisar seu caso.",canonicalPath:"/ajuda-cashback",keywords:"cashback, suporte, ajuda, bitcoin, sats",language:"pt",alternateLanguagePath:"/en/cashback-help"}),e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx("header",{className:"border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60",children:e.jsxs("div",{className:"container mx-auto px-4 py-4 flex items-center justify-between",children:[e.jsx(w,{to:"/",children:e.jsx("img",{src:Q,alt:"SATS Capital",className:"h-8 md:h-10"})}),e.jsx(w,{to:"/contato",className:"text-sm text-muted-foreground hover:text-primary transition-colors",children:"Contato"})]})}),e.jsx("main",{className:"container mx-auto px-4 py-8 md:py-12",children:e.jsxs("div",{className:"max-w-2xl mx-auto",children:[e.jsxs("div",{className:"text-center mb-8",children:[e.jsx("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-full bg-primary/10 mb-4",children:e.jsx(A,{className:"w-8 h-8 text-primary"})}),e.jsx("h1",{className:"text-2xl md:text-3xl font-bold mb-2",children:"Ajuda com Cashback Não Recebido"}),e.jsx("p",{className:"text-muted-foreground",children:"Preencha o formulário abaixo para abrir um pedido de ajuda. Após enviar, você será redirecionado para o WhatsApp para acompanhar seu caso."})]}),N==="success"&&e.jsxs("div",{className:"mb-6 p-4 rounded-lg bg-green-500/10 border border-green-500/20 flex items-start gap-3",children:[e.jsx(X,{className:"w-5 h-5 text-green-500 shrink-0 mt-0.5"}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-green-500",children:"Solicitação enviada com sucesso!"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Abrindo o WhatsApp para você acompanhar seu caso. Se não abrir automaticamente, use o botão abaixo."})]}),S&&e.jsx(b,{asChild:!0,variant:"outline",size:"sm",children:e.jsx("a",{href:S,target:"_blank",rel:"noopener noreferrer",children:"Abrir WhatsApp"})})]})]}),N==="error"&&e.jsxs("div",{className:"mb-6 p-4 rounded-lg bg-destructive/10 border border-destructive/20 flex items-center gap-3",children:[e.jsx(A,{className:"w-5 h-5 text-destructive shrink-0"}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-destructive",children:"Erro ao enviar solicitação"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Por favor, tente novamente ou entre em contato pelo WhatsApp."})]})]}),e.jsx("div",{className:"bg-card rounded-xl border p-6 md:p-8 shadow-sm",children:e.jsx(W,{...s,children:e.jsxs("form",{onSubmit:s.handleSubmit(F),className:"space-y-6",children:[e.jsx(t,{control:s.control,name:"name",render:({field:a})=>e.jsxs(n,{children:[e.jsx(c,{children:"Nome*"}),e.jsx(i,{children:e.jsx(d,{placeholder:"Seu nome completo",...a})}),e.jsx(l,{})]})}),e.jsx(t,{control:s.control,name:"email",render:({field:a})=>e.jsxs(n,{children:[e.jsx(c,{children:"Email cadastrado no app da
8SATS*"}),e.jsx(i,{children:e.jsx(d,{type:"email",placeholder:"[email protected]",...a})}),e.jsx(l,{})]})}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsx(t,{control:s.control,name:"store",render:({field:a})=>e.jsxs(n,{children:[e.jsx(c,{children:"Loja Parceira*"}),e.jsxs(H,{open:v,onOpenChange:C,children:[e.jsx(J,{asChild:!0,children:e.jsx(i,{children:e.jsxs(b,{variant:"outline",role:"combobox","aria-expanded":v,className:y("w-full justify-between font-normal h-10",!a.value&&"text-muted-foreground"),disabled:k,children:[k?"Carregando lojas...":a.value||"Selecione a loja",e.jsx(O,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})})}),e.jsx(K,{className:"w-[300px] p-0 bg-popover border shadow-md z-50",align:"start",children:e.jsxs(R,{children:[e.jsx(z,{placeholder:"Buscar loja..."}),e.jsxs(T,{children:[e.jsx(U,{children:"Nenhuma loja encontrada."}),e.jsx(B,{className:"max-h-[300px] overflow-y-auto",children:u==null?void 0:u.map(r=>e.jsxs(_,{value:r.name,onSelect:()=>{a.onChange(r.name),C(!1)},children:[e.jsx(I,{className:y("mr-2 h-4 w-4",a.value===r.name?"opacity-100":"opacity-0")}),r.name]},r.name))})]})]})})]}),e.jsx(l,{})]})}),e.jsx(t,{control:s.control,name:"purchaseDate",render:({field:a})=>e.jsxs(n,{children:[e.jsx(c,{children:"Data da compra*"}),e.jsx(i,{children:e.jsx(d,{type:"date",className:"h-10",...a})}),e.jsx(l,{})]})})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsx(t,{control:s.control,name:"orderNumber",render:({field:a})=>e.jsxs(n,{children:[e.jsx(c,{children:"Número do Pedido ou Cód da Reserva*"}),e.jsx(i,{children:e.jsx(d,{placeholder:"Ex: 123456789",className:"h-10",...a})}),e.jsx(l,{})]})}),e.jsx(t,{control:s.control,name:"purchaseValue",render:({field:a})=>e.jsxs(n,{children:[e.jsx(c,{children:"Valor da Compra*"}),e.jsx(i,{children:e.jsx(d,{type:"text",placeholder:"Ex: 150,00",className:"h-10",...a})}),e.jsx(l,{})]})})]}),e.jsx("div",{className:"p-4 rounded-lg bg-muted/50 border border-muted",children:e.jsxs("p",{className:"text-sm text-muted-foreground",children:[e.jsx("strong",{children:"Importante:"})," Após enviar este formulário, você será redirecionado para o WhatsApp."]})}),e.jsx(b,{type:"submit",size:"lg",className:"w-full",disabled:g,children:g?e.jsxs(e.Fragment,{children:[e.jsx(L,{className:"w-4 h-4 mr-2 animate-spin"}),"Enviando..."]}):e.jsxs(e.Fragment,{children:[e.jsx(q,{className:"w-4 h-4 mr-2"}),"Enviar e Abrir WhatsApp"]})})]})})})]})}),e.jsx(M,{})]})]})};export{Ce 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.