module.exports=[70406,(e,i,o)=>{i.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},88712,(e,i,o)=>{i.exports=e.x("nodemailer",()=>require("nodemailer"))},10318,e=>{"use strict";var i=e.i(26747),o=e.i(90406),a=e.i(44898),t=e.i(62950),r=e.i(88712);async function d(e,i){if("POST"!==e.method)return i.status(405).end();console.log("🔍 EMAIL_USER:",process.env.EMAIL_USER?"CONFIGURADO ✅":"FALTA ❌"),console.log("🔍 EMAIL_PASS:",process.env.EMAIL_PASS?"CONFIGURADO ✅":"FALTA ❌");let{nombre:o,apellidoPaterno:a,apellidoMaterno:t,tipoDocumento:d,numeroDocumento:s,correo:l,telefono:n,pais:c,direccion:p,tipoProducto:v,monto:u,descripcion:f,motivo:m,detalle:x,comprobante:g}=e.body,b=r.default.createTransport({service:"Gmail",auth:{user:process.env.EMAIL_USER_BOOK,pass:process.env.EMAIL_PASS_BOOK}});try{let e=await b.sendMail({from:process.env.EMAIL_USER,replyTo:l,to:process.env.EMAIL_USER,subject:`📋 ${"reclamo"===m?"RECLAMO":"QUEJA"} - ${o} ${a}`,html:`
        <!DOCTYPE html>
        <html>
          <head>
            <meta charset="utf-8">
            <style>
              body { font-family: Arial, sans-serif; line-height: 1.6; color: #333; margin: 0; padding: 0; background-color: #f4f4f4; }
              .container { max-width: 600px; margin: 20px auto; background: white; border-radius: 10px; overflow: hidden; box-shadow: 0 2px 10px rgba(0,0,0,0.1); }
              .logo-section { background: white; padding: 20px; text-align: center; border-bottom: 3px solid #575151; }
              .logo-section img { max-width: 150px; height: auto; }
              .header { background: linear-gradient(135deg, #F2F2D0 0%, #F2F2D0 100%); color: #575151; padding: 30px; text-align: center; }
              .header h1 { margin: 0; font-size: 24px; }
              .content { background: #f9f9f9; padding: 30px; }
              .section-title { background: #FF8112; color: white; padding: 10px 15px; margin: 20px 0 15px 0; border-radius: 5px; font-weight: bold; }
              .field { background: white; margin: 10px 0; padding: 15px; border-radius: 8px; border-left: 4px solid #575151; }
              .field-label { color: #FF8112; font-weight: bold; font-size: 12px; text-transform: uppercase; margin-bottom: 5px; }
              .field-value { color: #333; font-size: 16px; word-break: break-word; }
              .message-box { background: white; padding: 20px; border-radius: 8px; margin-top: 15px; border: 2px solid #575151; }
              .footer { text-align: center; padding: 20px; background: #333; color: white; }
              .footer a { color: #FAF5E8; text-decoration: none; }
              .badge { display: inline-block; background: ${"reclamo"===m?"#dc3545":"#ffc107"}; color: white; padding: 5px 15px; border-radius: 20px; font-size: 12px; margin-top: 10px; font-weight: bold; }
              .alert-box { background: #fff3cd; border-left: 4px solid #ffc107; padding: 15px; margin: 15px 0; border-radius: 5px; }
            </style>
          </head>
          <body>
            <div class="container">
              <div class="logo-section">
                <img src="https://www.kataalpaca.com/en/img/logo/logo-kata-alpaca.png" alt="KATA ALPACA Logo">
              </div>
              
              <div class="header">
                <h1>📋 Libro de Reclamaciones</h1>
                <div class="badge">${"reclamo"===m?"RECLAMO":"QUEJA"}</div>
              </div>
              
              <div class="content">
                <div class="section-title">👤 DATOS DEL CONSUMIDOR</div>
                
                <div class="field">
                  <div class="field-label">Nombre Completo</div>
                  <div class="field-value">${o} ${a} ${t}</div>
                </div>
                
                <div class="field">
                  <div class="field-label">Documento de Identidad</div>
                  <div class="field-value">${d.toUpperCase()}: ${s}</div>
                </div>

                <div class="section-title">📞 DATOS DE CONTACTO</div>
                
                <div class="field">
                  <div class="field-label">📧 Correo Electr\xf3nico</div>
                  <div class="field-value"><a href="mailto:${l}" style="color: #575151; text-decoration: none;">${l}</a></div>
                </div>
                
                <div class="field">
                  <div class="field-label">📱 Tel\xe9fono</div>
                  <div class="field-value"><a href="tel:${n}" style="color: #575151; text-decoration: none;">${n}</a></div>
                </div>
                
                <div class="field">
                  <div class="field-label">🌍 Pa\xeds</div>
                  <div class="field-value">${c}</div>
                </div>
                
                <div class="field">
                  <div class="field-label">📍 Direcci\xf3n</div>
                  <div class="field-value">${p}</div>
                </div>

                <div class="section-title">🛍️ IDENTIFICACI\xd3N DEL PRODUCTO/SERVICIO</div>
                
                <div class="field">
                  <div class="field-label">Tipo</div>
                  <div class="field-value">${"producto"===v?"Producto":"Servicio"}</div>
                </div>
                
                <div class="field">
                  <div class="field-label">💰 Monto</div>
                  <div class="field-value">${u}</div>
                </div>
                
                <div class="message-box">
                  <div class="field-label">📝 Descripci\xf3n del Producto/Servicio</div>
                  <div class="field-value" style="margin-top: 10px; white-space: pre-wrap;">${f||"No proporcionada"}</div>
                </div>

                <div class="section-title">⚠️ DETALLE DEL ${"reclamo"===m?"RECLAMO":"QUEJA"}</div>
                
                <div class="alert-box">
                  <strong>${"reclamo"===m?"🔴 RECLAMO":"🟡 QUEJA"}:</strong>
                  ${"reclamo"===m?"Disconformidad relacionada a los productos o servicios":"Disconformidad no relacionada a los productos o servicios; o, malestar o descontento respecto a la atención al público"}
                </div>
                
                <div class="message-box">
                  <div class="field-label">Detalle Completo</div>
                  <div class="field-value" style="margin-top: 10px; white-space: pre-wrap;">${x}</div>
                </div>
                
                <div class="field">
                  <div class="field-label">🧾 Comprobante de Pago</div>
                  <div class="field-value">${g}</div>
                </div>
                
                <div style="text-align: center; margin-top: 20px; padding: 15px; background: white; border-radius: 8px;">
                  <p style="color: #666; font-size: 12px; margin: 5px 0;">Recibido el ${new Date().toLocaleString("es-PE",{dateStyle:"full",timeStyle:"short"})}</p>
                  <p style="color: #999; font-size: 11px; margin: 5px 0;">La empresa dar\xe1 respuesta en un plazo m\xe1ximo de 30 d\xedas calendario</p>
                </div>
              </div>
              
              <div class="footer">
                <p style="margin: 5px 0;"><strong>KATA ALPACA</strong></p>
                <p style="margin: 5px 0; font-size: 12px;">Libro de Reclamaciones</p>
                <p style="margin: 5px 0; font-size: 12px;">
                  <a href="mailto:${process.env.EMAIL_USER}">${process.env.EMAIL_USER}</a>
                </p>
              </div>
            </div>
          </body>
        </html>
      `,text:`
        KATA ALPACA - LIBRO DE RECLAMACIONES
        ${"reclamo"===m?"RECLAMO":"QUEJA"}
        
        === DATOS DEL CONSUMIDOR ===
        Nombre: ${o} ${a} ${t}
        Documento: ${d.toUpperCase()} - ${s}
        
        === DATOS DE CONTACTO ===
        Email: ${l}
        Tel\xe9fono: ${n}
        Pa\xeds: ${c}
        Direcci\xf3n: ${p}
        
        === IDENTIFICACI\xd3N DEL PRODUCTO/SERVICIO ===
        Tipo: ${"producto"===v?"Producto":"Servicio"}
        Monto: ${u}
        Descripci\xf3n: ${f||"No proporcionada"}
        
        === DETALLE DEL ${"reclamo"===m?"RECLAMO":"QUEJA"} ===
        ${x}
        
        Comprobante: ${g}
        
        Recibido el ${new Date().toLocaleString("es-PE")}
      `});return console.log("✅ Correo enviado exitosamente:",e.messageId),i.status(200).json({success:!0,messageId:e.messageId,debug:"Correo enviado correctamente"})}catch(e){return console.error("❌ Error al enviar correo:",e),i.status(500).json({error:"Error al enviar el correo",details:{message:e.message,code:e.code,command:e.command,response:e.response,responseCode:e.responseCode}})}}e.s(["default",()=>d],37446);var s=e.i(37446),l=e.i(7031),n=e.i(81927),c=e.i(46432);let p=(0,t.hoist)(s,"default"),v=(0,t.hoist)(s,"config"),u=new a.PagesAPIRouteModule({definition:{kind:o.RouteKind.PAGES_API,page:"/api/complaintBook",pathname:"/api/complaintBook",bundlePath:"",filename:""},userland:s,distDir:".next",relativeProjectDir:""});async function f(e,o,a){u.isDev&&(0,c.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let t="/api/complaintBook";t=t.replace(/\/index$/,"")||"/";let r=await u.prepare(e,o,{srcPage:t});if(!r){o.statusCode=400,o.end("Bad Request"),null==a.waitUntil||a.waitUntil.call(a,Promise.resolve());return}let{query:d,params:s,prerenderManifest:p,routerServerContext:v}=r;try{let i=e.method||"GET",a=(0,l.getTracer)(),r=a.getActiveScopeSpan(),c=u.instrumentationOnRequestError.bind(u),f=async r=>u.render(e,o,{query:{...d,...s},params:s,allowedRevalidateHeaderKeys:[],multiZoneDraftMode:!1,trustHostHeader:!1,previewProps:p.preview,propagateError:!1,dev:u.isDev,page:"/api/complaintBook",internalRevalidate:null==v?void 0:v.revalidate,onError:(...i)=>c(e,...i)}).finally(()=>{if(!r)return;r.setAttributes({"http.status_code":o.statusCode,"next.rsc":!1});let e=a.getRootSpanAttributes();if(!e)return;if(e.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${e.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let d=e.get("next.route");if(d){let e=`${i} ${d}`;r.setAttributes({"next.route":d,"http.route":d,"next.span_name":e}),r.updateName(e)}else r.updateName(`${i} ${t}`)});r?await f(r):await a.withPropagatedContext(e.headers,()=>a.trace(n.BaseServerSpan.handleRequest,{spanName:`${i} ${t}`,kind:l.SpanKind.SERVER,attributes:{"http.method":i,"http.target":e.url}},f))}catch(e){if(u.isDev)throw e;(0,i.sendError)(o,500,"Internal Server Error")}finally{null==a.waitUntil||a.waitUntil.call(a,Promise.resolve())}}e.s(["config",0,v,"default",0,p,"handler",()=>f],10318)}];

//# sourceMappingURL=%5Broot-of-the-server%5D__16575cac._.js.map