PageSourceSearch

https://elnacional.ec/assets/index-bgEE2LYW.js

js elnacional.ec collected 2026-09-25 01:28:44 UTC 22,339 bytes, 1 lines download raw bytes

1import{a,ax as b,ay as ze,bJ as Ae,j as e,L as Ie,aB as M,D as Pe}from"./index-CwVyvtfi.js";import{H as $e}from"./index-5lWAF95d.js";import{F as qe}from"./index-C1RvHk76.js";import{F as Z}from"./ShoppingBagIcon-B_ZrN7mb.js";import{F as oe}from"./PlusIcon-DKB3PgQ2.js";import{F as Le}from"./TrashIcon-DnYyjM2_.js";import"./icon-min-DdAHcYcJ.js";import"./useQuery-D0scIw9r.js";import"./logo_ms_min-Ce1ogrOb.js";import"./EnvelopeIcon-BOMuJvBW.js";import"./MapPinIcon-w_KY-csr.js";function Oe({title:n,titleId:i,...x},o){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:o,"aria-labelledby":i},x),n?a.createElement("title",{id:i},n):null,a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.25 9V5.25A2.25 2.25 0 0 1 10.5 3h6a2.25 2.25 0 0 1 2.25 2.25v13.5A2.25 2.25 0 0 1 16.5 21h-6a2.25 2.25 0 0 1-2.25-2.25V15M12 9l3 3m0 0-3 3m3-3H2.25"}))}const de=a.forwardRef(Oe);function Be({title:n,titleId:i,...x},o){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:o,"aria-labelledby":i},x),n?a.createElement("title",{id:i},n):null,a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 12h14"}))}const pe=a.forwardRef(Be),f=`${ze.API_PATH}admin/store`,v={getCategories:()=>b.request("get",`${f}/categories`),getProducts:n=>b.request("get",`${f}/products`,null,{params:n}),getProduct:n=>b.request("get",`${f}/products/${n}`),getShippingCities:()=>b.request("get",`${f}/shipping-cities`),getBillingProfiles:()=>b.request("get",`${f}/billing-profiles`),quote:n=>b.request("post",`${f}/quote`,n),checkout:n=>{const i=new FormData;return n.items.forEach((x,o)=>{i.append(`items[${o}][product_id]`,String(x.product_id)),i.append(`items[${o}][quantity]`,String(x.quantity))}),i.append("shipping_type",n.shipping_type),i.append("payment_gateway",n.payment_gateway),n.shipping_address&&i.append("shipping_address",n.shipping_address),n.shipping_city_id&&i.append("shipping_city_id",String(n.shipping_city_id)),n.shipping_city_name&&i.append("shipping_city_name",n.shipping_city_name),n.delivery_instructions&&i.append("delivery_instructions",n.delivery_instructions),n.billing_profile_id?i.append("billing_profile_id",String(n.billing_profile_id)):n.billing&&Object.entries(n.billing).forEach(([x,o])=>{i.append(`billing[${x}]`,String(o))}),n.voucher&&i.append("voucher",n.voucher),b.request("post",`${f}/checkout`,i)}},ue="elnacional_tienda_carrito",De=()=>{try{return JSON.parse(localStorage.getItem(ue)||"[]")}catch{return[]}},c=n=>`$${Number(n??0).toFixed(2)}`,Xe=()=>{const n=!!Ae()?.token,[i,x]=a.useState([]),[o,xe]=a.useState([]),[w,H]=a.useState(null),[me,he]=a.useState(n),[r,A]=a.useState(null),[K,J]=a.useState(!1),[d,I]=a.useState(null),[k,P]=a.useState(1),[p,_]=a.useState(De),[Q,C]=a.useState(!1),[F,$]=a.useState(!1),[u,ge]=a.useState("PICKUP"),[W,be]=a.useState([]),[j,fe]=a.useState(null),[q,ve]=a.useState(""),[L,je]=a.useState(""),[G,ye]=a.useState(""),[m,Ne]=a.useState("RES_COBRANZAS"),[S,we]=a.useState(null),[O,ke]=a.useState([]),[X,ee]=a.useState(null),[E,R]=a.useState(!1),[l,y]=a.useState({business_name:"",document_type:"CEDULA",document_number:"",address:"",phone:"",email:""}),[g,_e]=a.useState(null),[B,te]=a.useState(!1),[se,z]=a.useState(""),[D,ae]=a.useState(null);a.useEffect(()=>{localStorage.setItem(ue,JSON.stringify(p))},[p]),a.useEffect(()=>{n&&Promise.all([v.getCategories(),v.getProducts()]).then(([t,s])=>{t.satisfactory&&t.data&&x(t.data),s.satisfactory&&s.data&&xe(s.data.data??[])}).catch(()=>{}).finally(()=>he(!1))},[]);const ne=a.useMemo(()=>{if(w===null)return o;const t=i.find(s=>s.id===w)?.name;return o.filter(s=>s.category===t)},[o,w,i]),ie=p.reduce((t,s)=>t+s.quantity,0),T=p.reduce((t,s)=>t+s.unitPrice*s.quantity,0),Ce=async t=>{J(!0),P(1),I(null);const s=await v.getProduct(t.id).catch(()=>null);J(!1),s?.satisfactory&&s.data&&(A(s.data),s.data.variants.length===1&&I(s.data.variants[0]))},Fe=()=>{if(!r)return;const t=r.variants.length>0;if(t&&!d)return;const s=t?d.id:r.id,V=t?d.price:r.price,h=t&&[d.color,d.size].filter(
1Boolean).join(" · ")||null,Re=t&&d.file_url||r.file_url;_(Y=>Y.find(N=>N.productId===s)?Y.map(N=>N.productId===s?{...N,quantity:N.quantity+k}:N):[...Y,{productId:s,name:r.name,variantLabel:h,unitPrice:V,quantity:k,imageUrl:Re}]),A(null),C(!0)},re=(t,s)=>{_(V=>V.map(h=>h.productId===t?{...h,quantity:h.quantity+s}:h).filter(h=>h.quantity>0))},le=p.map(t=>({product_id:t.productId,quantity:t.quantity})),Se=async()=>{C(!1),$(!0),z("");const[t,s]=await Promise.all([v.getShippingCities().catch(()=>null),v.getBillingProfiles().catch(()=>null)]);t?.satisfactory&&t.data&&be(t.data),s?.satisfactory&&s.data?(ke(s.data),s.data.length>0?ee(s.data[0].id):R(!0)):R(!0)};a.useEffect(()=>{!F||p.length===0||v.quote({items:le,shipping_type:u,shipping_city_id:u==="DELIVERY"?j:null,payment_gateway:m}).then(t=>{t.satisfactory&&t.data&&_e(t.data)}).catch(()=>{})},[F,u,j,m,p]);const U=W.find(t=>t.id===j)||null,ce=p.length>0&&(u==="PICKUP"||j!==null&&L.trim().length>4&&(!U?.is_other||q.trim().length>2))&&(m==="RES_COBRANZAS"||S!==null)&&(!E||l.business_name&&l.document_number&&l.email),Ee=async()=>{if(!(!ce||B)){te(!0),z("");try{const t=await v.checkout({items:le,shipping_type:u,payment_gateway:m,shipping_address:u==="DELIVERY"?L.trim():null,shipping_city_id:u==="DELIVERY"?j:null,shipping_city_name:u==="DELIVERY"&&U?.is_other?q.trim():null,delivery_instructions:u==="DELIVERY"&&G.trim()||null,billing_profile_id:E?null:X,billing:E?l:null,voucher:m==="TRANSFER"?S:null});if(!t.satisfactory||!t.data){z(t.message||"No se pudo completar la compra.");return}if(m==="RES_COBRANZAS"){const s=t.data.link_rescobranzas??t.data.payment_url;if(s){_([]),window.location.assign(s);return}}_([]),$(!1),ae({tracking:t.data.tracking_number,total:Number(t.data.total??T)})}catch(t){z(t?.message||"No se pudo completar la compra.")}finally{te(!1)}}};return e.jsxs("div",{className:"flex min-h-screen flex-col bg-navy-900 text-white",children:[e.jsx($e,{action:n?void 0:{to:"/login",label:"Acceso Socios",icon:e.jsx(de,{className:"size-4 shrink-0"})}}),e.jsxs("section",{className:"relative overflow-hidden px-4 pt-16 pb-10 text-center",children:[e.jsx("div",{className:"pointer-events-none absolute top-0 left-1/2 size-[460px] -translate-x-1/2 -translate-y-1/3 rounded-full bg-app-red/15 blur-[130px]"}),e.jsx("p",{className:"text-xs font-black tracking-[0.3em] text-app-red uppercase",children:"Ropa y artículos oficiales"}),e.jsx("h1",{className:"mt-3 text-4xl font-black tracking-tight uppercase sm:text-5xl",children:"Tienda Oficial"}),e.jsxs("div",{className:"mx-auto mt-5 flex h-1 w-24 overflow-hidden rounded-full",children:[e.jsx("span",{className:"flex-1 bg-[#FFD100]"}),e.jsx("span",{className:"flex-1 bg-[#0E1C46]"}),e.jsx("span",{className:"flex-1 bg-app-red"})]})]}),e.jsx("main",{className:"mx-auto w-full max-w-6xl flex-1 px-4 pb-24",children:n?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"mb-8 flex flex-wrap items-center justify-center gap-2",children:[e.jsx("button",{onClick:()=>H(null),className:`rounded-full border px-5 py-2 text-xs font-bold tracking-wide uppercase transition ${w===null?"border-app-red bg-app-red text-white":"border-white/15 bg-white/5 text-white/70 hover:border-white/40"}`,children:"Todos"}),i.map(t=>e.jsx("button",{onClick:()=>H(t.id),className:`rounded-full border px-5 py-2 text-xs font-bold tracking-wide uppercase transition ${w===t.id?"border-app-red bg-app-red text-white":"border-white/15 bg-white/5 text-white/70 hover:border-white/40"}`,children:t.name},t.id))]}),me?e.jsx("div",{className:"grid grid-cols-2 gap-5 sm:grid-cols-3 lg:grid-cols-4",children:Array.from({length:8}).map((t,s)=>e.jsx("div",{className:"h-72 animate-pulse rounded-3xl bg-white/5"},s))}):e.jsxs("div",{className:"grid grid-cols-2 gap-5 sm:grid-cols-3 lg:grid-cols-4",children:[ne.map(t=>e.jsxs("button",{onClick:()=>Ce(t),className:"group overflow-hidden rounded-3xl border border-white/10 bg-white text-left text-navy-900 transition hover:-translate-y-1 hover:shadow-2xl hover:shadow-app-red/20",children:[e.jsxs("div",{className:"relative aspect-square overflow-hidden bg-[#F2F4F9]",children:[t.file_url?e.jsx("img",{src:t.file_url,alt:t.name,className:"size-full object-cover transition duration-500 group-hover:scale-105",loading:"lazy"}):e.jsx("div",{className:"flex size-full items-center justify-center",children:e.jsx(Z,{className:"size-10 text-navy-900/20"})}),!t.in_stock&&e.jsx("span",{className:"absolute top-3 left-3 rounded-full bg-navy-900/80 px-3 py-1 text-[10px] font-bold text-white uppercase",children:"Agotado"})]}),e.jsxs("div",{className:"p-4",children:[e.jsx("p",{className:"text-[10px] font-bold tracking-widest text-app-red uppercase",children:t.category??"Oficial"}),e.jsx("h3",{className:"mt-1 line-clamp-2 text-sm leading-snug font-extrabold",children:t.name}),e.jsx("p",{className:"mt-2 text-base font-black text-[#A87A0B]",children:t.price_from===t.price_to?c(t.price_from):`${c(t.price_from)} – ${c(t.price_to)}`})]})]},t.id)),ne.length===0&&e.jsx("p",{className:"col-span-full py-20 text-center text-sm text-white/50",children:"No hay productos en esta categoría todavía."})]})]}):e.jsxs("div",{className:"mx-auto max-w-xl rounded-3xl border border-white/10 bg-white/5 p-10 text-center",children:[e.jsx(Z,{className:"mx-auto 
1size-12 text-app-red"}),e.jsx("h2",{className:"mt-4 text-2xl font-black uppercase",children:"Solo para la familia criolla"}),e.jsx("p",{className:"mt-3 text-sm text-white/70",children:"Inicia sesión con tu cuenta de socio o hincha para ver el catálogo oficial y comprar con entrega a domicilio o retiro en el club."}),e.jsxs(Ie,{to:"/login",className:"mt-8 inline-flex items-center gap-2 rounded-2xl bg-app-red px-8 py-3 text-sm font-black tracking-wide uppercase transition hover:brightness-110",children:[e.jsx(de,{className:"size-4"}),"Iniciar sesión"]})]})}),n&&ie>0&&!Q&&!F&&e.jsxs("button",{onClick:()=>C(!0),className:"fixed right-6 bottom-6 z-40 flex items-center gap-2 rounded-full bg-app-red px-5 py-3 font-black shadow-2xl shadow-app-red/40 transition hover:brightness-110",children:[e.jsx(Z,{className:"size-5"}),ie," · ",c(T)]}),(r||K)&&e.jsx("div",{className:"fixed inset-0 z-50 flex items-end justify-center bg-black/70 p-4 sm:items-center",children:e.jsx("div",{className:"w-full max-w-lg overflow-hidden rounded-3xl bg-white text-navy-900",children:K||!r?e.jsx("div",{className:"h-80 animate-pulse bg-black/5"}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"relative aspect-[4/3] bg-[#F2F4F9]",children:[(d?.file_url||r.file_url)&&e.jsx("img",{src:d?.file_url||r.file_url||void 0,alt:r.name,className:"size-full object-cover"}),e.jsx("button",{onClick:()=>A(null),className:"absolute top-4 right-4 rounded-full bg-white/90 p-2 shadow",children:e.jsx(M,{className:"size-5"})})]}),e.jsxs("div",{className:"max-h-[45vh] overflow-y-auto p-6",children:[e.jsx("p",{className:"text-[10px] font-bold tracking-widest text-app-red uppercase",children:r.category??"Oficial"}),e.jsx("h2",{className:"mt-1 text-xl font-black",children:r.name}),r.description&&e.jsx("p",{className:"mt-2 text-sm text-navy-900/60",children:r.description}),r.variants.length>0&&e.jsxs("div",{className:"mt-4",children:[e.jsx("p",{className:"text-xs font-bold tracking-wide text-navy-900/60 uppercase",children:"Elige tu variante"}),e.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:r.variants.map(t=>e.jsxs("button",{disabled:t.quantity_available<=0,onClick:()=>I(t),className:`rounded-xl border px-4 py-2 text-xs font-bold transition disabled:opacity-35 ${d?.id===t.id?"border-app-red bg-app-red/10 text-app-red":"border-navy-900/15 hover:border-navy-900/40"}`,children:[[t.color,t.size].filter(Boolean).join(" · ")||"Única"," ·"," ",c(t.price)]},t.id))})]}),e.jsxs("div",{className:"mt-6 flex items-center justify-between gap-4",children:[e.jsxs("div",{className:"flex items-center gap-3 rounded-2xl border border-navy-900/15 px-3 py-2",children:[e.jsx("button",{onClick:()=>P(t=>Math.max(1,t-1)),children:e.jsx(pe,{className:"size-4"})}),e.jsx("span",{className:"w-6 text-center font-black",children:k}),e.jsx("button",{onClick:()=>P(t=>t+1),children:e.jsx(oe,{className:"size-4"})})]}),e.jsxs("button",{onClick:Fe,disabled:r.variants.length>0&&!d,className:"flex-1 rounded-2xl bg-app-red py-3 text-sm font-black tracking-wide text-white uppercase transition hover:brightness-110 disabled:opacity-40",children:["Agregar ·"," ",c((d?.price??r.price)*k)]})]})]})]})})}),Q&&e.jsx("div",{className:"fixed inset-0 z-50 flex justify-end bg-black/70",children:e.jsxs("div",{className:"flex h-full w-full max-w-md flex-col bg-white text-navy-900",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-navy-900/10 p-5",children:[e.jsx("h2",{className:"text-lg font-black uppercase",children:"Tu carrito"}),e.jsx("button",{onClick:()=>C(!1),children:e.jsx(M,{className:"size-6"})})]}),e.jsx("div",{className:"flex-1 overflow-y-auto p-5",children:p.length===0?e.jsx("p",{className:"py-16 text-center text-sm text-navy-900/50",children:"Tu carrito está vacío."}):p.map(t=>e.jsxs("div",{className:"mb-4 flex gap-3 rounded-2xl border border-navy-900/10 p-3",children:[e.jsx("div",{className:"size-16 shrink-0 overflow-hidden rounded-xl bg-[#F2F4F9]",children:t.imageUrl&&e.jsx("img",{src:t.imageUrl,alt:t.name,className:"size-full object-cover"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"truncate text-sm font-extrabold",children:t.name}),t.variantLabel&&e.jsx("p",{className:"text-xs text-navy-900/50",children:t.variantLabel}),e.jsxs("div",{className:"mt-1 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-navy-900/15 px-2 py-1",children:[e.jsx("button",{onClick:()=>re(t.productId,-1),children:t.quantity===1?e.jsx(Le,{className:"size-3.5 text-app-red"}):e.jsx(pe,{className:"size-3.5"})}),e.jsx("span",{className:"w-5 text-center text-xs font-black",children:t.quantity}),e.jsx("button",{onClick:()=>re(t.productId,1),children:e.jsx(oe,{className:"size-3.5"})})]}),e.jsx("p",{className:"text-sm font-black",children:c(t.unitPrice*t.quantity)})]})]})]},t.productId))}),p.length>0&&e.jsxs("div",{className:"border-t border-navy-900/10 p-5",children:[e.jsxs("div",{className:"mb-4 flex items-center justify-between text-sm",children:[e.jsx("span",{className:"font-bold text-navy-900/60 uppercase",children:"Subtotal"}),e.jsx("span",{className:"text-lg font-black",children:c(T)})]}),e.jsx("button",{onClick:Se,className:"w-full rounded-2xl bg-app-red py-3.5 text-sm font-black tracking-wide text-white uppercase transition hover:brightness-110",children:"Finalizar compra"})]})]})}),F&&e.jsx("div",{className:"fixed inset-0 z-50 flex items-end justify-center bg-black/70 p-4 sm:items-center",children:e.jsxs("div",{className:"flex max-h-[92vh] w-full max-w-xl flex-col overflow-hidden rounded-3xl bg-white text-navy-900",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-navy-900/10 p-5",children:[e.jsx("h2",{className:"text-lg font-black uppercase",children:"Finalizar compra"}),e.jsx("button",{onClick:()=>$(!1),children:e.jsx(M,{className:"size-6"})})]}),e.jsxs("div",{className:"flex-1 space-y-6 overflow-y-auto p-5",children:[e.jsxs("div",{children:[e.jsx("p",{className:"mb-2 text-xs font-black tracking-wide text-navy-900/60 uppercase",children:"Entrega"}),e.jsx("div",{className:"grid grid-cols-2 gap-2",children:[["PICKUP","Retiro en el club"],["DELIVERY","Envío a domicilio"]].map(([t,s])=>e.jsx("button",{onClick:()=>ge(t),className:`rounded-2xl border px-4 py-3 text-sm font-bold transition ${u===t?"border-app-red bg-app-red/10 text-app-red":"border-navy-900/15"}`,children:s},t))}),u==="DELIVERY"&&e.jsxs("div",{className:"mt-3 space-y-3",children:[e.jsxs("select",{value:j??"",onChange:t=>fe(t.target.value?Number(t.target.value):null),className:"w-full rounded-2xl border border-navy-900/15 bg-[#F2F4F9] px-4 py-3 text-sm",children:[e.jsx("option",{value:"",children:"Ciudad de entrega…"}),W.map(t=>e.jsxs("option",{value:t.id,children:[t.name," ",Number(t.price)>0?`(+${c(Number(t.price))})`:""]},t.id))]}),U?.is_other&&e.jsx("input",{value:q,onChange:t=>ve(t.target.value),placeholder:"¿Cuál ciudad?",className:"w-full rounded-2xl border border-navy-900/15 bg-[#F2F4F9] px-4 py-3 text-sm"}),e.jsx("input",{value:L,onChange:t=>je(t.target.value),placeholder:"Dirección exacta",className:"w-full rounded-2xl border border-navy-900/15 bg-[#F2F4F9] px-4 py-3 text-sm"}),e.jsx("input",{value:G,onChange:t=>ye(t.target.value),placeholder:"Indicaciones para la entrega (opcional)",className:"w-full rounded-2xl border border-navy-900/15 bg-[#F2F4F9] px-4 py-3 text-sm"})]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"mb-2 text-xs font-black tracking-wide text-navy-900/60 uppercase",children:"Pago"}),e.jsx("div",{className:"grid grid-cols-2 gap-2",children:[["RES_COBRANZAS","Pago en línea"],["TRANSFER","Transferencia"]].map(([t,s])=>e.jsx("button",{onClick:()=>Ne(t),className:`rounded-2xl border px-4 py-3 text-sm font-bold transition ${m===t?"border-app-red bg-app-red/10 text-app-red":"border-navy-900/15"}`,children:s},t))}),m==="TRANSFER"&&e.jsxs("label",{className:"mt-3 block cursor-pointer rounded-2xl border border-dashed border-navy-900/25 bg-[#F2F4F9] px-4 py-4 text-center text-sm font-semibold text-navy-900/60",children:[S?S.name:"Subir comprobante de transferencia",e.jsx("input",{type:"file",accept:"image/*,.pdf",className:"hidden",onChange:t=>we(t.target.files?.[0]??null)})]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"mb-2 text-xs font-black tracking-wide text-navy-900/60 uppercase",children:"Facturación"}),O.length>0&&!E?e.jsxs("div",{className:"space-y-2",children:[O.map(t=>e.jsxs("button",{onClick:()=>ee(t.id),className:`w-full rounded-2xl border px-4 py-3 text-left text-sm transition ${X===t.id?"border-app-red bg-app-red/10":"border-navy-900/15"}`,children:[e.jsx("span",{className:"font-extrabold",children:t.business_name}),e.jsxs("span",{className:"block text-xs text-navy-900/50",children:[t.document_number," · ",t.email]})]},t.id)),e.jsx("button",{onClick:()=>R(!0),className:"text-xs font-bold text-app-red uppercase",children:"+ Usar otros datos"})]}):e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsx("input",{value:l.business_name,onChange:t=>y({...l,business_name:t.target.value}),placeholder:"Nombre / Razón social",className:"col-span-2 rounded-2xl border border-navy-900/15 bg-[#F2F4F9] px-4 py-3 text-sm"}
1),e.jsxs("select",{value:l.document_type,onChange:t=>y({...l,document_type:t.target.value}),className:"rounded-2xl border border-navy-900/15 bg-[#F2F4F9] px-4 py-3 text-sm",children:[e.jsx("option",{value:"CEDULA",children:"Cédula"}),e.jsx("option",{value:"RUC",children:"RUC"}),e.jsx("option",{value:"PASSPORT",children:"Pasaporte"})]}),e.jsx("input",{value:l.document_number,onChange:t=>y({...l,document_number:t.target.value}),placeholder:"N° documento",className:"rounded-2xl border border-navy-900/15 bg-[#F2F4F9] px-4 py-3 text-sm"}),e.jsx("input",{value:l.email,onChange:t=>y({...l,email:t.target.value}),placeholder:"Correo",className:"rounded-2xl border border-navy-900/15 bg-[#F2F4F9] px-4 py-3 text-sm"}),e.jsx("input",{value:l.phone,onChange:t=>y({...l,phone:t.target.value}),placeholder:"Teléfono",className:"rounded-2xl border border-navy-900/15 bg-[#F2F4F9] px-4 py-3 text-sm"}),e.jsx("input",{value:l.address,onChange:t=>y({...l,address:t.target.value}),placeholder:"Dirección",className:"col-span-2 rounded-2xl border border-navy-900/15 bg-[#F2F4F9] px-4 py-3 text-sm"}),O.length>0&&e.jsx("button",{onClick:()=>R(!1),className:"col-span-2 text-left text-xs font-bold text-app-red uppercase",children:"← Usar datos guardados"})]})]}),g&&e.jsxs("div",{className:"rounded-2xl bg-[#F2F4F9] p-4 text-sm",children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-navy-900/60",children:"Subtotal"}),e.jsx("span",{className:"font-bold",children:c(g.subtotal)})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-navy-900/60",children:"Envío"}),e.jsx("span",{className:"font-bold",children:c(g.shipping)})]}),g.charges.map(t=>e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-navy-900/60",children:t.name}),e.jsx("span",{className:"font-bold",children:c(t.amount)})]},t.name)),e.jsxs("div",{className:"mt-2 flex justify-between border-t border-navy-900/10 pt-2 text-base",children:[e.jsx("span",{className:"font-black uppercase",children:"Total"}),e.jsx("span",{className:"font-black text-app-red",children:c(g.total)})]})]}),se&&e.jsx("p",{className:"rounded-2xl bg-app-red/10 p-3 text-sm font-semibold text-app-red",children:se})]}),e.jsx("div",{className:"border-t border-navy-900/10 p-5",children:e.jsx("button",{onClick:Ee,disabled:!ce||B,className:"w-full rounded-2xl bg-app-red py-3.5 text-sm font-black tracking-wide text-white uppercase transition hover:brightness-110 disabled:opacity-40",children:B?"Procesando…":m==="RES_COBRANZAS"?`Pagar ${g?c(g.total):""}`:"Enviar pedido"})})]})}),D&&e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/70 p-4",children:e.jsxs("div",{className:"w-full max-w-md rounded-3xl bg-white p-8 text-center text-navy-900",children:[e.jsx(Pe,{className:"mx-auto size-14 text-emerald-500"}),e.jsx("h2",{className:"mt-3 text-xl font-black uppercase",children:"¡Pedido recibido!"}),e.jsxs("p",{className:"mt-2 text-sm text-navy-900/60",children:["Tu número de seguimiento es"," ",e.jsx("span",{className:"font-black text-navy-900",children:D.tracking})," por un total de ",e.jsx("span",{className:"font-black",children:c(D.total)}),". Te avisaremos cuando esté listo."]}),e.jsx("button",{onClick:()=>ae(null),className:"mt-6 w-full rounded-2xl bg-app-red py-3 text-sm font-black tracking-wide text-white uppercase",children:"Seguir comprando"})]})}),e.jsx(qe,{})]})};export{Xe 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.