PageSourceSearch

https://www.ativiajes.com/assets/reserva-confirmada-DBo8SHcU.js

js ativiajes.com collected 2026-10-09 01:44:10 UTC 16,349 bytes, 1 lines download raw bytes

1import{r as n,j as e}from"./vendor-framer-motion-CL2aqXak.js";import{c as ae,a as ne,L as v}from"./index-DrcenDwh.js";import{q as oe,G as ce}from"./main-CfQbnJTj.js";import{r as le,i as ie,e as z,s as D,t as I,c as H,a as de}from"./booking-checkout-helpers-B0XyclHL.js";import{z as O,E as W,a1 as me,i as G,a2 as K,V as ue,r as xe,a3 as fe,$ as he,y as Q,a4 as pe,h as ge,j as be}from"./vendor-lucide-C7G-b8HC.js";import"./vendor-radix-LMkZZgpy.js";import"./api-client-Cjvty6pi.js";const Y={"Content-Type":"application/json"};function J(p){switch(p){case"processing":return"processing";case"pending":return"pending";case"confirmed":return"confirmed";case"cancelling":return"cancelling";case"cancelled":return"cancelled";case"expired":return"expired";default:return null}}function h(){return e.jsxs("div",{className:"w-full max-w-sm bg-white rounded-2xl border border-black/[0.06] overflow-hidden",children:[e.jsx("div",{className:"px-5 py-3.5 border-b border-black/[0.05]",children:e.jsx("p",{className:"text-xs font-semibold text-foreground",children:"¿Necesitás ayuda?"})}),e.jsxs("div",{className:"px-5 py-4 space-y-3",children:[e.jsxs("a",{href:"https://wa.me/5491152194135","data-wa-source":"reserva-confirmada",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-3 w-full rounded-xl bg-[#25D366]/10 px-4 py-3 hover:bg-[#25D366]/20 transition-colors",children:[e.jsx(pe,{className:"h-4 w-4 text-[#25D366] shrink-0"}),e.jsxs("div",{className:"min-w-0",children:[e.jsxs("p",{className:"text-xs font-semibold text-[#1a9e4f]",children:["WhatsApp ",e.jsx("span",{className:"font-normal text-[#25D366]",children:"— Recomendado"})]}),e.jsx("p",{className:"text-xs text-[#25D366]/80",children:"Respuesta inmediata"})]}),e.jsx(Q,{className:"h-3.5 w-3.5 text-[#25D366] ml-auto shrink-0"})]}),e.jsxs("div",{className:"flex items-start gap-3 px-1",children:[e.jsx(ge,{className:"h-4 w-4 text-muted-foreground shrink-0 mt-0.5"}),e.jsxs("div",{className:"space-y-1 text-xs",children:[e.jsxs("a",{href:"tel:08102209009",className:"block font-semibold text-foreground hover:text-primary transition-colors",children:["0810-220-9009 ",e.jsx("span",{className:"font-normal text-muted-foreground",children:"— Nacional"})]}),e.jsxs("a",{href:"tel:+541152639077",className:"block font-semibold text-foreground hover:text-primary transition-colors",children:["(+54 11) 5263-9077 ",e.jsx("span",{className:"font-normal text-muted-foreground",children:"— Exterior"})]}),e.jsx("p",{className:"text-muted-foreground leading-snug",children:"Lun–Vie 10–18:30 · Sáb, Dom y Feriados 10–18:00"})]})]}),e.jsxs("div",{className:"flex items-center gap-3 px-1",children:[e.jsx(be,{className:"h-4 w-4 text-muted-foreground shrink-0"}),e.jsx("a",{href:"mailto:[email protected]",className:"text-xs font-semibold text-foreground hover:text-primary transition-colors",children:"[email protected]"})]})]})]})}function P({locator:p}){return p?e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Número de reserva ",e.jsx("span",{className:"font-semibold text-foreground",children:p})]}):null}function je(p,N){return new Intl.NumberFormat("es-AR",{style:"currency",currency:N,maximumFractionDigits:0}).format(p)}function _e(){const N=ae().bookingId??"";ne();const{user:m,isLoading:F}=oe(),{openAuthModal:B}=ce(),[w,L]=n.useState(null),[u,s]=n.useState("loading"),[f,$]=n.useState(null),[X,q]=n.useState(!1),R=n.useRef(null),E=n.useRef(null),o=n.useRef(null),x=n.useRef(!0),g=n.useRef(""),y=n.useRef(new Set),k=[2e3,4e3,8e3];function c(){R.current&&(clearTimeout(R.current),R.current=null),E.current&&(clearInterval(E.current),E.current=null)}function M(){for(const r of y.current)r.abort();y.current.clear()}n.useEffect(()=>()=>{x.current=!1,o.current=null,c(),M()},[]);async function A(r,t=0){if(o.current)return;s(t===0?"loading":"recovering");const i=new AbortController;o.current=i,y.current.add(i);function C(){o.current===i&&(o.current=null),y.current.delete(i)}try{const b=await fetch(`/api/hub/v1/booking/${r}`,{headers:Y,signal:i.signal});if(!b.ok){if(C(),!x.current)return;const T=ie(b.status);if(T&&t<k.length){s("recovering");const se=k[t];R.current=setTimeout(()=>{x.current&&A(r,t+1)},se)}else T&&t>=k.length?s("recoverable_error"):s("no_data");return}const a=await b.json();if(C(),!x.current||i.signal.aborted)return;
1const d=a?.status,j=z(a)||w?.ati_locator||g.current||"",_=J(d);if(_){const T={booking_id:r,ati_locator:j};g.current=j,D(r,j),L(T),s(_),_==="confirmed"?(c(),I(r)):_==="processing"?ee(r):_==="pending"?c():(c(),H(r))}else s("no_data")}catch(b){if(C(),!x.current||i.signal.aborted)return;const a=de(b);if(a&&t<k.length){s("recovering");const d=k[t];R.current=setTimeout(()=>{x.current&&A(r,t+1)},d)}else a&&t>=k.length?s("recoverable_error"):s("no_data")}}function Z(){c(),A(N,0)}n.useEffect(()=>{const r=le(N);return r?.ati_locator&&(g.current=r.ati_locator,L({booking_id:r.booking_id,ati_locator:r.ati_locator})),A(N,0),()=>{c(),M(),o.current=null}},[N]),n.useEffect(()=>{if(F||!m)return;const r=w?.ati_locator;r&&fetch(`/api/hub/auth/bookings/${encodeURIComponent(r)}`,{credentials:"include"}).then(t=>t.ok?t.json():null).then(t=>{x.current&&t&&$(t)}).catch(()=>{})},[m,F,w?.ati_locator]),n.useEffect(()=>{if(!m||F||f)return;const r=w?.ati_locator;r&&fetch(`/api/hub/auth/bookings/${encodeURIComponent(r)}`,{credentials:"include"}).then(t=>t.ok?t.json():null).then(t=>{x.current&&t&&$(t)}).catch(()=>{})},[m]);function ee(r){c(),E.current=setInterval(async()=>{if(o.current)return;const t=new AbortController;o.current=t,y.current.add(t);try{const i=await fetch(`/api/hub/v1/booking/${r}`,{headers:Y,signal:t.signal});if(!i.ok)return;const C=await i.json();if(!x.current||t.signal.aborted)return;const b=C?.status,a=J(b);if(!a)return;const d=z(C);if(d&&d!==g.current&&(g.current=d,D(r,d),L({booking_id:r,ati_locator:d})),a==="confirmed"){c();const j=d||g.current||"";g.current=j,D(r,j),L({booking_id:r,ati_locator:j}),s("confirmed"),I(r);return}if(a==="pending"){c(),s("pending");return}if(a==="cancelling"||a==="cancelled"||a==="expired"){c(),s(a),H(r);return}s(a)}catch{}finally{o.current===t&&(o.current=null),y.current.delete(t)}},4e3)}function re(){const r=w?.ati_locator||f?.ati_locator;r&&navigator.clipboard.writeText(r).then(()=>{q(!0),setTimeout(()=>q(!1),2e3)})}const l=w?.ati_locator||f?.ati_locator||"",V=f?.pricing?.balance?parseFloat(f.pricing.balance):0,te=f?.pricing?.currency??"ARS",U=V>0&&!!l&&!!m,S=(()=>{const r=f?.product?.type?.toLowerCase();return r==="hotel"||r==="stay"?{href:"/hoteles",label:"Buscar hoteles"}:r==="flight"?{href:"/vuelos",label:"Buscar vuelos"}:{href:"/",label:"Volver a buscar"}})();return u==="loading"?e.jsx("div",{className:"min-h-screen flex items-center justify-center",children:e.jsx("div",{className:"h-7 w-7 rounded-full border-2 border-primary border-t-transparent animate-spin"})}):u==="recovering"?e.jsx("div",{className:"min-h-screen bg-[#F6F7F9]",children:e.jsxs("div",{className:"max-w-2xl mx-auto px-4 py-16 flex flex-col items-center gap-6 text-center",children:[e.jsx("div",{className:"flex items-center justify-center h-20 w-20 rounded-full bg-amber-50",children:e.jsx(O,{className:"h-10 w-10 text-amber-500 animate-spin"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold text-foreground mb-2",children:"Estamos verificando el estado de tu reserva"}),e.jsx("p",{className:"text-muted-foreground text-sm max-w-sm",children:"La confirmación puede seguir en proceso. Estamos intentando consultar su estado."})]}),e.jsx(P,{locator:l}),e.jsx(h,{})]})}):u==="recoverable_error"?e.jsx("div",{className:"min-h-screen bg-[#F6F7F9]",children:e.jsxs("div",{className:"max-w-2xl mx-auto px-4 py-16 flex flex-col items-center gap-6 text-center",children:[e.jsx("div",{className:"flex items-center justify-center h-20 w-20 rounded-full bg-amber-50",children:e.jsx(W,{className:"h-10 w-10 text-amber-500"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold text-foreground mb-2",children:"No pudimos consultar el estado de tu reserva"}),e.jsx("p",{className:"text-muted-foreground text-sm max-w-sm",children:"No logramos comunicarnos con el sistema de confirmación. Tu reserva puede seguir en proceso. Podés intentar consultar el estado nuevamente."})]}),e.jsx(P,{locator:l}),e.jsxs("button",{onClick:Z,className:"flex items-center justify-center gap-2 rounded-2xl bg-primary px-6 py-3 text-sm font-semibold text-primary-foreground hover:bg-primary/90 transition-colors shadow-sm cursor-pointer",children:[e.jsx(me,{className:"h-4 w-4"}),"Reintentar consulta"]}),e.jsx(h,{})]})}):u==="processing"?e.jsx("div",{className:"min-h-screen bg-[#F6F7F9]",children:e.jsxs("div",{className:"max-w-2xl mx-auto px-4 py-16 flex flex-col items-center gap-6 text-center",children:[e.jsx("div",{className:"flex items-center justify-center h-20 w-20 rounded-full bg-amber-50",children:e.jsx(O,{className:"h-10 w-10 text-amber-500 animate-spin"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold text-foreground mb-2",children:"Estamos confirmando tu reserva"}),e.jsx("p",{className:"text-muted-foreground text-sm max-w-sm",children:"Estamos confirmando la disponibilidad de los servicios solicitados. Esto puede tardar un momento más. Por favor no cierres ni recargues esta pestaña."})]}),e.jsx(P,{locator:l}),e.jsx(h,{})]})}):u==="pending"?e.jsx("div",{className:"min-h-screen bg-[#F6F7F9]",children:e.jsxs("div",{className:"max-w-2xl mx-auto px-4 py-16 flex flex-col items-center gap-6 text-center",children:[e.jsx("div",{className:"flex items-center justify-center h-20 w-20 rounded-full bg-amber-50",children:e.jsx(G,{className:"h-10 w-10 text-amber-500"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold text-foreground mb-2",children:"Tu solicitud fue procesada"}),e.jsxs("p",{className:"text-muted-foreground text-sm max-w-sm",children:["Uno de los servicios necesita confirmación manual de nuestro equipo. Este proceso puede demorar. ",e.jsx("strong",{children:"Podés cerrar esta página"}),": te vamos a contactar apenas esté todo resuelto."]})]}),e.jsx(P,{locator:l}),e.jsx(h,{})]})}):u==="expired"?e.jsx("div",{className:"min-h-screen bg-[#F6F7F9]",children:e.jsxs("div",{className:"max-w-2xl mx-auto px-4 py-16 flex flex-col items-center gap-6 text-center",children:[e.jsx("div",{className:"flex items-center justify-center h-20 w-20 rounded-full bg-amber-50",children:e.jsx(G,{className:"h-10 w-10 text-amber-500"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold text-foreground mb-2",children:"Lamentablemente no pudimos procesar tu reserva"}),e.jsx("p",{className:"text-muted-foreground text-sm max-w-sm",children:"Pasó demasiado tiempo desde que armaste esta reserva y los precios ya no están vigentes. No se realizó ningún cargo: hacé la búsqueda de nuevo para ver la disponibilidad actual."})]}),e.jsxs(v,{href:S.href,className:"inline-flex items-center gap-2 rounded-2xl bg-primary px-6 py-3 text-sm font-medium text-white hover:bg-primary/90 transition-colors",children:["← ",S.label]}),e.jsx(h,{})]})}):u==="cancelling"||u==="cancelled"?e.jsx("div",{className:"min-h-screen bg-[#F6F7F9]",children:e.jsxs("div",{className:"max-w-2xl mx-auto px-4 py-16 flex flex-col items-center gap-6 text-center",children:[e.jsx("div",{className:"flex items-center justify-center h-20 w-20 rounded-full bg-red-50",children:e.jsx(W,{className:"h-10 w-10 text-red-500"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold text-foreground mb-2",children:"No pudimos confirmar tu reserva"}),e.jsx("p",{className:"text-muted-foreground text-sm max-w-sm",children:"Hubo un inconveniente al confirmar con el proveedor. No se realizó ningún cargo: hacé la búsqueda de nuevo para ver la disponibilidad actual."})]}),e.jsxs(v,{href:S.href,className:"inline-flex items-center gap-2 rounded-2xl bg-primary px-6 py-3 text-sm font-medium text-white hover:bg-primary/90 transition-colors",children:["← ",S.label]}),e.jsx(h,{})]})}):u==="no_data"?e.jsx("div",{className:"min-h-screen bg-[#F6F7F9]",children:e.jsxs("div",{className:"max-w-2xl mx-auto px-4 py-16 flex flex-col items-center gap-6 text-center",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-xl font-bold text-foreground mb-2",children:"Información no dis
1ponible"}),e.jsx("p",{className:"text-muted-foreground text-sm max-w-sm",children:"No encontramos los datos de esta reserva en tu sesión actual. Si ya completaste tu compra, por favor verificá tu correo electrónico (incluyendo correo no deseado) o iniciá sesión para consultar el estado."})]}),e.jsxs("div",{className:"flex flex-col gap-3 w-full max-w-xs",children:[!m&&!F&&e.jsxs("button",{onClick:()=>B(),className:"flex items-center justify-center gap-2 w-full h-11 rounded-2xl bg-primary text-primary-foreground text-sm font-semibold hover:bg-primary/90 transition-colors",children:[e.jsx(K,{className:"h-4 w-4"}),"Iniciar sesión"]}),m&&e.jsx(v,{href:"/perfil",className:"flex items-center justify-center gap-2 w-full h-11 rounded-2xl bg-primary text-primary-foreground text-sm font-semibold hover:bg-primary/90 transition-colors",children:"Ir a mis viajes"}),e.jsx(v,{href:"/",className:"text-sm text-muted-foreground hover:text-foreground transition-colors",children:"Volver al inicio"})]}),e.jsx(h,{})]})}):e.jsx("div",{className:"min-h-screen bg-[#F6F7F9]",children:e.jsxs("div",{className:"max-w-2xl mx-auto px-4 py-12 flex flex-col items-center gap-6",children:[e.jsx("div",{className:"flex items-center justify-center h-20 w-20 rounded-full bg-emerald-50",children:e.jsx(ue,{className:"h-10 w-10 text-emerald-500"})}),e.jsxs("div",{className:"text-center",children:[e.jsx("h1",{className:"text-2xl font-bold text-foreground mb-2",children:"¡Reserva confirmada!"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Tu reserva fue procesada correctamente."})]}),l&&e.jsxs("div",{className:"bg-white rounded-2xl border border-emerald-200 shadow-sm px-8 py-6 w-full max-w-sm",children:[e.jsx("p",{className:"text-xs font-semibold text-emerald-700 uppercase tracking-wider mb-2 text-center",children:"Número de reserva"}),e.jsxs("div",{className:"flex items-center justify-center gap-3",children:[e.jsx("p",{"data-testid":"text-ati-locator",className:"text-3xl font-bold text-foreground tracking-tight",children:l}),e.jsx("button",{onClick:re,className:"p-1.5 rounded-lg hover:bg-slate-100 text-muted-foreground transition-colors",title:"Copiar número de reserva",children:X?e.jsx(xe,{className:"h-4 w-4 text-emerald-500"}):e.jsx(fe,{className:"h-4 w-4"})})]})]}),f&&U&&e.jsxs("div",{className:"bg-amber-50 border border-amber-200 rounded-2xl px-5 py-4 w-full max-w-sm text-center",children:[e.jsx("p",{className:"text-sm font-semibold text-amber-800 mb-1",children:"Tenés un saldo pendiente"}),e.jsx("p",{className:"text-2xl font-bold text-amber-700 tabular-nums",children:je(V,te)})]}),e.jsxs("div",{className:"w-full max-w-sm space-y-3",children:[U&&e.jsxs(v,{href:`/pagoseguro/${l}`,className:"flex items-center justify-center gap-2 w-full h-12 rounded-2xl bg-primary text-primary-foreground text-sm font-semibold hover:bg-primary/90 transition-colors shadow-sm",children:[e.jsx(he,{className:"h-4 w-4"}),"Realizar pago"]}),m&&l&&e.jsxs(v,{href:`/reservas/${l}`,className:"flex items-center justify-center gap-2 w-full h-12 rounded-2xl border border-black/[0.12] bg-white text-sm font-semibold text-foreground hover:bg-slate-50 transition-colors",children:[e.jsx(Q,{className:"h-4 w-4"}),"Ver detalle de mi reserva"]}),!m&&!F&&e.jsxs("div",{className:"bg-white rounded-2xl border border-black/[0.06] px-5 py-4 text-center",children:[e.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"Creá tu cuenta para ver el estado de tu reserva y gestionar pagos."}),e.jsxs("button",{onClick:()=>B(),className:"flex items-center justify-center gap-2 w-full h-10 rounded-xl bg-slate-100 text-sm font-semibold text-foreground hover:bg-slate-200 transition-colors",children:[e.jsx(K,{className:"h-4 w-4"}),"Crear cuenta / Iniciar sesión"]})]}),e.jsx(v,{href:"/",className:"flex items-center justify-center w-full text-sm text-muted-foreground hover:text-foreground transition-colors py-2",children:"← Volver al inicio"}),e.jsx(h,{})]})]})})}export{_e 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.