(()=>{var e={};e.id=314,e.ids=[314],e.modules={10846:e=>{"use strict";e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},14985:e=>{"use strict";e.exports=require("dns")},21820:e=>{"use strict";e.exports=require("os")},26409:(e,r,t)=>{"use strict";t.r(r),t.d(r,{patchFetch:()=>x,routeModule:()=>p,serverHooks:()=>u,workAsyncStorage:()=>c,workUnitAsyncStorage:()=>l});var s={};t.r(s),t.d(s,{POST:()=>d});var i=t(96559),o=t(48088),a=t(37719),n=t(49526);async function d(e){try{let r;let{email:t,subject:s,message:i,department:o}=await e.json();if(!s||!i||!o)return new Response(JSON.stringify({error:"Subject and message are mandatory fields."}),{status:400});switch(o.toLowerCase()){case"otogas":r=process.env.OTOGAS_EMAIL;break;case"bulk":r=process.env.BULK_EMAIL;break;case"cylinders":r=process.env.CYLINDERS_EMAIL;break;case"contact":r=process.env.CONTACT_EMAIL;break;default:return new Response(JSON.stringify({error:"Invalid department specified."}),{status:400})}let a=n.createTransport({host:"smtp.office365.com",port:587,secure:!1,auth:{user:process.env.EMAIL_USER,pass:process.env.EMAIL_PASS}}),d={from:process.env.EMAIL_USER,to:r,subject:s,text:`Email: ${t}
Subject: ${s}
Message: ${i}`,html:`
        <!DOCTYPE html>
        <html>
        <head>
          <meta charset="UTF-8">
          <title>${s}</title>
          <style>
            body {
              font-family: 'Arial', sans-serif;
              line-height: 1.6;
              color: #333;
              max-width: 600px;
              margin: 0 auto;
              padding: 20px;
            }
            .header {
              background-color: #12173E;
              padding: 20px;
              text-align: center;
              border-radius: 8px 8px 0 0;
            }
            .header h1 {
              color: white;
              margin: 0;
              font-size: 24px;
            }
            .content {
              padding: 25px;
              background-color: #f9f9f9;
              border-left: 1px solid #ddd;
              border-right: 1px solid #ddd;
            }
            .footer {
              background-color: #12173E;
              padding: 15px;
              text-align: center;
              border-radius: 0 0 8px 8px;
              color: white;
              font-size: 12px;
            }
            .button {
              display: inline-block;
              padding: 10px 20px;
              background-color: #DA4767;
              color: white;
              text-decoration: none;
              border-radius: 4px;
              margin-top: 15px;
            }
            .divider {
              border-top: 2px solid #DA4767;
              margin: 20px 0;
            }
            .info-label {
              color: #12173E;
              font-weight: bold;
              margin-bottom: 5px;
            }
            .info-value {
              margin-bottom: 15px;
            }
          </style>
        </head>
        <body>
          <div class="header">
            <h1>New Message from ${o} Department</h1>
          </div>
          
          <div class="content">
            <div class="info-label">From:</div>
            <div class="info-value">${t||"Not provided"}</div>
            
            <div class="info-label">Subject:</div>
            <div class="info-value">${s}</div>
            
            <div class="divider"></div>
            
            <div class="info-label">Message:</div>
            <div class="info-value">
              <p>${i.replace(/\n/g,"<br>")}</p>
            </div>
            
            <div class="divider"></div>
            
            <p>Please respond to this inquiry at your earliest convenience.</p>
            
            <center>
              <a href="mailto:${t}" class="button">Reply to Sender</a>
            </center>
          </div>
          
          <div class="footer">
            <p>\xa9 ${new Date().getFullYear()} Otogas. All rights reserved.</p>
            <p>This is an automated message from protoenegy.com website - please do not reply directly to this email.</p>
          </div>
        </body>
        </html>
      `};return await a.sendMail(d),new Response(JSON.stringify({message:"Feedback submitted successfully"}),{status:200})}catch(e){return console.error("Error sending email:",e),new Response(JSON.stringify({error:"Failed to send feedback. Please try again later."}),{status:500})}}let p=new i.AppRouteRouteModule({definition:{kind:o.RouteKind.APP_ROUTE,page:"/api/mailer/route",pathname:"/api/mailer",filename:"route",bundlePath:"app/api/mailer/route"},resolvedPagePath:"/Users/kb/Documents/dev/pro/next-website/src/app/api/mailer/route.js",nextConfigOutput:"",userland:s}),{workAsyncStorage:c,workUnitAsyncStorage:l,serverHooks:u}=p;function x(){return(0,a.patchFetch)({workAsyncStorage:c,workUnitAsyncStorage:l})}},27910:e=>{"use strict";e.exports=require("stream")},28354:e=>{"use strict";e.exports=require("util")},29021:e=>{"use strict";e.exports=require("fs")},29294:e=>{"use strict";e.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:e=>{"use strict";e.exports=require("path")},34631:e=>{"use strict";e.exports=require("tls")},44870:e=>{"use strict";e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},55511:e=>{"use strict";e.exports=require("crypto")},55591:e=>{"use strict";e.exports=require("https")},63033:e=>{"use strict";e.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},74075:e=>{"use strict";e.exports=require("zlib")},78335:()=>{},79551:e=>{"use strict";e.exports=require("url")},79646:e=>{"use strict";e.exports=require("child_process")},81630:e=>{"use strict";e.exports=require("http")},91645:e=>{"use strict";e.exports=require("net")},94735:e=>{"use strict";e.exports=require("events")},96487:()=>{}};var r=require("../../../webpack-runtime.js");r.C(e);var t=e=>r(r.s=e),s=r.X(0,[719,167],()=>t(26409));module.exports=s})();