1import{r,j as e}from"./app-B0LAPjbu.js";import"./paypal-js-c7UYulfR.js";import{B as v}from"./Button-B8IzboFJ.js";import"./LoginController-B83tSgMb.js";import"./ClientProfileController-B-i96EOg.js";import{E as P,d as C,s as D}from"./EmailResultModal-CKpa9HPL.js";import{E as F}from"./EmailInputModal-5y7J9GAw.js";import{C as S,a as O}from"./circle-check-CJVJMpT0.js";import{H as L}from"./hash-Dk8bxXlI.js";import{U as T}from"./user-hx4GMNP9.js";import{P as _}from"./phone-BTnZktbp.js";import{c as x}from"./createLucideIcon-Cz66Tp46.js";import{C as I}from"./check-BaxYhvai.js";import"./app-Ci0Z6NIf.js";import"./Modal-BlYJluVD.js";const $=[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]],R=x("Download",$);const q=[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]],z=x("Mail",q);const H=[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]],U=x("Smartphone",H);function V(t=new Date){return new Intl.DateTimeFormat("es-MX",{weekday:"long",day:"numeric",month:"long",year:"numeric",hour:"2-digit",minute:"2-digit"}).format(t)}function B(t,c,a=`${c}s`){return t===1?c:a}
1function te({title:t="¡Vinculación exitosa!",description:c="Tu lÃnea telefónica ha sido vinculada correctamente.",folios:a=[],msisdns:d,curp:f,setCompleted:h,email:u}){const[N,i]=r.useState(!1),[y,n]=r.useState("success"),[b,o]=r.useState(""),[w,p]=r.useState(!1);r.useEffect(()=>{h(!0)},[h]);const m=r.useMemo(()=>{if(a.length===0)return{};const s={};return a.forEach(l=>{l.msisdn&&l.guid&&(s[l.msisdn]={guid:l.guid,msisdn:l.msisdn})}),s},[a]),k=async()=>{try{if(Object.keys(m).length===0){n("error"),o("No hay folios disponibles para generar el PDF"),i(!0);return}await C(m,"Persona fÃsica",f)}catch(s){console.error("Error descargando PDF:",s),n("error"),o(s?.message||"Error al descargar el PDF. Por favor, intenta nuevamente."),i(!0)}},E=()=>{u?j(u):p(!0)},j=async s=>{try{if(Object.keys(m).length===0){n("error"),o("No hay folios disponibles para enviar"),i(!0);return}await D(m,s,"Persona fÃsica",f),n("success"),o("El correo electrónico ha sido enviado exitosamente."),i(!0)}catch(l){console.error("Error enviando correo:",l),n("error"),o(l?.message||"Error al enviar el correo. Por favor, intenta nuevamente."),i(!0)}},g=r.useMemo(()=>a.length>0?a.map(s=>({msisdn:s.msisdn,folio:s.folio})):(d??[]).map(s=>({msisdn:s,folio:""})),[a,d]),M=g.length>0;return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"mb-8 rounded-2xl bg-white p-8 shadow-xl",children:[e.jsxs("div",{className:"mb-8 text-center",children:[e.jsx(S,{className:"mx-auto mb-4 h-24 w-24 text-[#00c951]"}),e.jsx("h2",{className:"mb-2 text-xl font-semibold text-[#018336]",children:t}),e.jsx("p",{className:"text-gray-600",children:c})]}),M&&e.jsxs("div",{className:"mb-6 rounded-xl bg-primary p-6 text-white",children:[e.jsxs("div",{className:"mb-3 flex items-center gap-3",children:[e.jsx(L,{className:"h-5 w-5"}),e.jsx("span",{className:"text-white/80",children:"Folios de vinculación"})]}),e.jsx("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between",children:e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"text-white/80",children:"LÃneas vinculadas"}),e.jsx("div",{className:"mt-2 max-h-56 overflow-auto pr-1",children:e.jsx("ul",{className:"space-y-2",children:g.map(s=>e.jsx("li",{className:"rounded-lg bg-white/10 px-3 py-2",children:e.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-start sm:justify-between",children:[e.jsx("div",{className:"font-mono text-base sm:text-lg break-all",children:s.msisdn}),e.jsxs("div",{className:"shrink-0 sm:text-right",children:[e.jsx("div",{className:"text-white/80 text-xs sm:text-sm",children:"Folio"}),e.jsx("div",{className:"mt-1 font-mono text-base sm:text-lg break-all",children:s.folio?s.folio:"â"})]})]})},`${s.msisdn}-${s.folio||"nofolio"}`))})})]})})]}),e.jsxs("div",{className:"grid grid-cols-2 grid-rows-6 gap-4",children:[e.jsx("div",{className:"h-full w-full rounded-lg bg-[#f7faf9] px-4 py-2",children:e.jsxs("div",{className:"items-left flex h-full w-full flex-col justify-center",children:[e.jsxs("div",{className:"mb-2",children:[e.jsx(T,{className:"mr-1 inline-block"})," Tipo de perfil"]}),e.jsx("span",{children:"Persona fÃsica"})]})}),e.jsx("div",{className:"h-full w-full rounded-lg bg-[#f7faf9] px-4 py-2",children:e.jsxs("div",{className:"items-left flex h-full w-full flex-col justify-center",children:[e.jsxs("div",{className:"mb-2",children:[e.jsx(_,{className:"mr-1 inline-block"})," LÃneas vinculadas"]}),e.jsxs("span",{children:[d.length," ",B(d.length,"lÃnea","lÃneas")]})]})}),e.jsx("div",{className:"col-span-2 h-full w-full rounded-lg bg-[#f7faf9] px-4 py-2",children:e.jsxs("div",{className:"items-left flex h-full w-full flex-col justify-center",children:[e.jsxs("div",{className:"mb-2",children:[e.jsx(O,{className:"mr-1 inline-block"})," Fecha y hora del trámite"]}),e.jsx("span",{className:"capitalize",children:V()})]})}),e.jsx("div",{className:"col-span-2 row-start-3 h-full w-full rounded-lg bg-[#f7faf9] px-4 py-2",children:e.jsxs("div",{className:"items-left flex h-full w-full flex-col justify-center",children:[e.jsx("div",{className:"mb-2",children:"CURP:"}),e.jsx("span",{className:"break-all",children:f})]})}),e.jsx("div",{className:"row-start-4 h-15 w-full",children:e.jsxs(v,{variant:"solid",className:"h-full w-full rounded-lg bg-primary",onClick:k,disabled:a.length===0,type:"button",children:[e.jsx(R,{className:"mr-2"}),"Descargar PDF"]})}),e.jsx("div",{className:"row-start-4 h-15 w-full",children:e.jsxs(v,{variant:"solid",className:"h-full w-full rounded-lg",onClick:E,disabled:a.length===0,type:"button",children:[e.jsx(z,{className:"mr-2"}),"Enviar por correo"]})}),e.jsxs("div",{className:"col-span-2 -mt-4 flex h-full w-full flex-row rounded-xl border border-[#bfdaff] bg-[#f0f7ff] px-4 py-2 text-[#183db8]",children:[e.jsx("div",{children:e.jsx(U,{className:"mr-2"})}),"Guarda tus folios de vinculación. Los necesitarás para cualquier trámite relacionado con estas lÃneas."]}),e.jsxs("div",{className:"col-span-2 row-start-6 -mt-2 flex h-full w-full flex-row rounded-xl border border-[#b9f8cf] bg-[#f1fcf4] px-4 py-2 text-[#006730]",children:[e.jsx("div",{children:e.jsx(I,{className:"mr-2"})}),"Tu lÃnea ya está activa y vinculada. No requieres realizar ningún trámite adicional."]})]})]}),e.jsx(F,{open:w,onClose:()=>p(!1),onSubmit:j}),e.jsx(P,{open:N,onClose:()=>i(!1),type:y,message:b})]})}
1export{te 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.