"use strict";exports.id=6384,exports.ids=[6384],exports.modules={36384:(e,t,o)=>{o.d(t,{Cz:()=>r,LS:()=>i,ke:()=>n,r$:()=>s,sendWelcomeEmail:()=>p});let a=o(56742).createTransport({host:process.env.SMTP_HOST,port:parseInt(process.env.SMTP_PORT||"587"),secure:!1,auth:{user:process.env.SMTP_USER,pass:process.env.SMTP_PASS}});async function r(e){try{let t=await a.sendMail({from:`"${process.env.FROM_NAME}" <${process.env.FROM_EMAIL}>`,to:e.to,subject:e.subject,html:e.html,text:e.text});return console.log("Email sent successfully:",t.messageId),{success:!0,messageId:t.messageId}}catch(e){throw console.error("Error sending email:",e),e}}async function n(e){let{to:t,subject:o,message:r,companyName:n}=e,i=`
    <!DOCTYPE html>
    <html lang="en">
    <head>
      <meta charset="UTF-8">
      <meta name="viewport" content="width=device-width, initial-scale=1.0">
      <title>${o} - ${n}</title>
      <style>
        body {
          font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
          line-height: 1.6;
          color: #1f2937;
          background-color: #f9fafb;
          margin: 0;
          padding: 0;
        }
        .container {
          max-width: 600px;
          margin: 0 auto;
          background-color: #ffffff;
          border-radius: 12px;
          overflow: hidden;
          box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
        }
        .header {
          background: linear-gradient(135deg, #a855f7 0%, #0ea5e9 100%);
          padding: 40px 30px;
          text-align: center;
          color: white;
        }
        .header h1 {
          margin: 0;
          font-size: 28px;
          font-weight: 700;
          letter-spacing: -0.025em;
        }
        .header p {
          margin: 8px 0 0 0;
          font-size: 16px;
          opacity: 0.9;
        }
        .content {
          padding: 40px 30px;
        }
        .message-box {
          background-color: #f3f4f6;
          border-radius: 8px;
          padding: 24px;
          margin: 24px 0;
          border-left: 4px solid #a855f7;
        }
        .message-content {
          white-space: pre-wrap;
          line-height: 1.6;
          color: #374151;
          margin: 0;
        }
        .footer {
          background-color: #f9fafb;
          padding: 30px;
          text-align: center;
          border-top: 1px solid #e5e7eb;
        }
        .footer p {
          margin: 0;
          color: #6b7280;
          font-size: 14px;
        }
        .footer a {
          color: #7c3aed;
          text-decoration: none;
          font-weight: 500;
        }
        .footer a:hover {
          text-decoration: underline;
        }
        .company-info {
          background: linear-gradient(135deg, rgba(168, 85, 247, 0.1) 0%, rgba(14, 165, 233, 0.1) 100%);
          border-radius: 8px;
          padding: 20px;
          margin: 20px 0;
          text-align: center;
        }
        .company-name {
          font-size: 18px;
          font-weight: 600;
          color: #7c3aed;
          margin: 0;
        }
        @media (max-width: 600px) {
          .container {
            margin: 10px;
            border-radius: 8px;
          }
          .header {
            padding: 30px 20px;
          }
          .header h1 {
            font-size: 24px;
          }
          .content {
            padding: 30px 20px;
          }
        }
      </style>
    </head>
    <body>
      <div class="container">
        <div class="header">
          <h1>📧 Message from ${n}</h1>
          <p>You have received an important message</p>
        </div>

        <div class="content">
          <div class="company-info">
            <p class="company-name">${n}</p>
            <p style="color: #6b7280; margin: 4px 0 0 0; font-size: 14px;">Property Management Team</p>
          </div>

          <div class="message-box">
            <div class="message-content">${r}</div>
          </div>

          <p>If you have any questions or need assistance, please don't hesitate to contact us.</p>
        </div>

        <div class="footer">
          <p>
            This message was sent by ${n}.<br>
            Please reply to this email if you need to get in touch with us.
          </p>
          <p style="margin-top: 10px; font-size: 12px; color: #9ca3af;">
            \xa9 ${new Date().getFullYear()} ${n}. All rights reserved.
          </p>
        </div>
      </div>
    </body>
    </html>
  `,s=0,p=0,d=[];for(let e of t)try{let t={from:`"${process.env.FROM_NAME||n}" <${process.env.FROM_EMAIL}>`,to:`"${e.name}" <${e.email}>`,subject:o,html:i};await a.sendMail(t),s++}catch(t){console.error(`Failed to send email to ${e.email}:`,t.message),d.push(`Failed to send to ${e.email}: ${t.message}`),p++}return{success:0===p,sentCount:s,failedCount:p,errors:d}}async function i(e,t){let o=`${process.env.NEXTAUTH_URL||"http://localhost:3000"}/auth/reset-password?token=${t}`;return r({to:e,subject:"Password Reset Request - PropMaster",html:`
    <!DOCTYPE html>
    <html lang="en">
    <head>
      <meta charset="UTF-8">
      <meta name="viewport" content="width=device-width, initial-scale=1.0">
      <title>Password Reset - PropMaster</title>
      <style>
        body {
          font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
          line-height: 1.6;
          color: #1f2937;
          background-color: #f9fafb;
          margin: 0;
          padding: 0;
        }
        .container {
          max-width: 600px;
          margin: 0 auto;
          background-color: #ffffff;
          border-radius: 12px;
          overflow: hidden;
          box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
        }
        .header {
          background: linear-gradient(135deg, #a855f7 0%, #0ea5e9 100%);
          padding: 40px 30px;
          text-align: center;
          color: white;
        }
        .header h1 {
          margin: 0;
          font-size: 28px;
          font-weight: 700;
          letter-spacing: -0.025em;
        }
        .header p {
          margin: 8px 0 0 0;
          font-size: 16px;
          opacity: 0.9;
        }
        .content {
          padding: 40px 30px;
        }
        .reset-box {
          background: linear-gradient(135deg, rgba(168, 85, 247, 0.1) 0%, rgba(14, 165, 233, 0.1) 100%);
          border: 1px solid rgba(168, 85, 247, 0.2);
          border-radius: 8px;
          padding: 24px;
          margin: 24px 0;
          text-align: center;
        }
        .reset-icon {
          font-size: 48px;
          margin-bottom: 16px;
        }
        .reset-title {
          font-size: 20px;
          font-weight: 600;
          color: #7c3aed;
          margin: 0 0 8px 0;
        }
        .reset-message {
          color: #6b7280;
          margin: 0;
          font-size: 16px;
        }
        .warning-box {
          background-color: #fef3c7;
          border: 1px solid #f59e0b;
          border-radius: 8px;
          padding: 16px;
          margin: 20px 0;
          text-align: center;
        }
        .warning-text {
          color: #92400e;
          font-weight: 500;
          margin: 0;
        }
        .footer {
          background-color: #f9fafb;
          padding: 30px;
          text-align: center;
          border-top: 1px solid #e5e7eb;
        }
        .footer p {
          margin: 0;
          color: #6b7280;
          font-size: 14px;
        }
        .footer a {
          color: #7c3aed;
          text-decoration: none;
          font-weight: 500;
        }
        .footer a:hover {
          text-decoration: underline;
        }
        .button {
          display: inline-block;
          background: linear-gradient(135deg, #a855f7 0%, #0ea5e9 100%);
          color: white;
          text-decoration: none;
          padding: 14px 28px;
          border-radius: 8px;
          font-weight: 600;
          font-size: 16px;
          margin: 16px 0;
          transition: transform 0.2s ease;
          box-shadow: 0 4px 15px rgba(168, 85, 247, 0.3);
        }
        .button:hover {
          transform: translateY(-2px);
          box-shadow: 0 8px 25px rgba(168, 85, 247, 0.4);
        }
        .secondary-text {
          color: #6b7280;
          font-size: 14px;
          margin: 16px 0;
        }
        @media (max-width: 600px) {
          .container {
            margin: 10px;
            border-radius: 8px;
          }
          .header {
            padding: 30px 20px;
          }
          .header h1 {
            font-size: 24px;
          }
          .content {
            padding: 30px 20px;
          }
        }
      </style>
    </head>
    <body>
      <div class="container">
        <div class="header">
          <h1>🔐 Password Reset Request</h1>
          <p>Reset your PropMaster account password</p>
        </div>

        <div class="content">
          <p>Hello,</p>

          <p>You have requested to reset your password for your PropMaster account. Click the button below to create a new password:</p>

          <div class="reset-box">
            <div class="reset-icon">🔑</div>
            <div class="reset-title">Reset Your Password</div>
            <div class="reset-message">Click the button below to securely reset your password. This link will expire in 1 hour.</div>
          </div>

          <div style="text-align: center; margin: 30px 0;">
            <a href="${o}" class="button">
              Reset Password
            </a>
          </div>

          <div class="warning-box">
            <p class="warning-text">⚠️ This link will expire in 1 hour for security reasons.</p>
          </div>

          <p class="secondary-text">
            If you didn't request this password reset, please ignore this email. Your password will remain unchanged.
          </p>

          <p>If the button above doesn't work, you can copy and paste this link into your browser:</p>
          <p style="word-break: break-all; color: #7c3aed; font-size: 14px;">${o}</p>

          <p>For security reasons, this link can only be used once and will expire in 1 hour.</p>

          <p>Best regards,<br>The PropMaster Team</p>
        </div>

        <div class="footer">
          <p>
            This is an automated password reset email from PropMaster.<br>
            Need help? <a href="mailto:support@propmaster.io">Contact our support team</a>
          </p>
          <p style="margin-top: 10px; font-size: 12px; color: #9ca3af;">
            \xa9 ${new Date().getFullYear()} PropMaster. All rights reserved.
          </p>
        </div>
      </div>
    </body>
    </html>
  `})}async function s(e){let{email:t,firstName:o,lastName:a}=e,n=`${o} ${a}`.trim();return r({to:t,subject:"Password Changed Successfully - PropMaster",html:`
    <!DOCTYPE html>
    <html lang="en">
    <head>
      <meta charset="UTF-8">
      <meta name="viewport" content="width=device-width, initial-scale=1.0">
      <title>Password Changed - PropMaster</title>
      <style>
        body {
          font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
          line-height: 1.6;
          color: #1f2937;
          background-color: #f9fafb;
          margin: 0;
          padding: 0;
        }
        .container {
          max-width: 600px;
          margin: 0 auto;
          background-color: #ffffff;
          border-radius: 12px;
          overflow: hidden;
          box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
        }
        .header {
          background: linear-gradient(135deg, #a855f7 0%, #0ea5e9 100%);
          padding: 40px 30px;
          text-align: center;
          color: white;
        }
        .header h1 {
          margin: 0;
          font-size: 28px;
          font-weight: 700;
          letter-spacing: -0.025em;
        }
        .header p {
          margin: 8px 0 0 0;
          font-size: 16px;
          opacity: 0.9;
        }
        .content {
          padding: 40px 30px;
        }
        .alert-box {
          background: linear-gradient(135deg, rgba(168, 85, 247, 0.1) 0%, rgba(14, 165, 233, 0.1) 100%);
          border: 1px solid rgba(168, 85, 247, 0.2);
          border-radius: 8px;
          padding: 24px;
          margin: 24px 0;
          text-align: center;
        }
        .alert-icon {
          font-size: 48px;
          margin-bottom: 16px;
        }
        .alert-title {
          font-size: 20px;
          font-weight: 600;
          color: #7c3aed;
          margin: 0 0 8px 0;
        }
        .alert-message {
          color: #6b7280;
          margin: 0;
          font-size: 16px;
        }
        .security-tips {
          background-color: #f3f4f6;
          border-radius: 8px;
          padding: 24px;
          margin: 24px 0;
        }
        .security-tips h3 {
          margin: 0 0 16px 0;
          color: #374151;
          font-size: 18px;
          font-weight: 600;
        }
        .tips-list {
          list-style: none;
          padding: 0;
          margin: 0;
        }
        .tips-list li {
          padding: 8px 0;
          color: #6b7280;
          position: relative;
          padding-left: 24px;
        }
        .tips-list li:before {
          content: '✓';
          color: #10b981;
          font-weight: bold;
          position: absolute;
          left: 0;
        }
        .footer {
          background-color: #f9fafb;
          padding: 30px;
          text-align: center;
          border-top: 1px solid #e5e7eb;
        }
        .footer p {
          margin: 0;
          color: #6b7280;
          font-size: 14px;
        }
        .footer a {
          color: #7c3aed;
          text-decoration: none;
          font-weight: 500;
        }
        .footer a:hover {
          text-decoration: underline;
        }
        .button {
          display: inline-block;
          background: linear-gradient(135deg, #a855f7 0%, #0ea5e9 100%);
          color: white;
          text-decoration: none;
          padding: 12px 24px;
          border-radius: 8px;
          font-weight: 600;
          font-size: 16px;
          margin: 16px 0;
          transition: transform 0.2s ease;
        }
        .button:hover {
          transform: translateY(-1px);
        }
        @media (max-width: 600px) {
          .container {
            margin: 10px;
            border-radius: 8px;
          }
          .header {
            padding: 30px 20px;
          }
          .header h1 {
            font-size: 24px;
          }
          .content {
            padding: 30px 20px;
          }
        }
      </style>
    </head>
    <body>
      <div class="container">
        <div class="header">
          <h1>🔐 Password Updated</h1>
          <p>Your account security has been enhanced</p>
        </div>

        <div class="content">
          <p>Hello ${n},</p>

          <p>Your password has been successfully changed. This email confirms that your account security has been updated.</p>

          <div class="alert-box">
            <div class="alert-icon">✅</div>
            <div class="alert-title">Password Change Confirmed</div>
            <div class="alert-message">Your new password is now active and ready to use.</div>
          </div>

          <div class="security-tips">
            <h3>🔒 Security Best Practices</h3>
            <ul class="tips-list">
              <li>Use a strong, unique password for your account</li>
              <li>Enable two-factor authentication when available</li>
              <li>Never share your password with others</li>
              <li>Regularly update your passwords</li>
              <li>Log out of shared devices</li>
            </ul>
          </div>

          <p>If you did not make this change, please contact our support team immediately to secure your account.</p>

          <p>For your security, we recommend reviewing your account settings and recent activity.</p>

          <div style="text-align: center; margin: 30px 0;">
            <a href="${process.env.NEXTAUTH_URL||"https://app.propmaster.io"}/dashboard" class="button">
              Access Your Dashboard
            </a>
          </div>

          <p>Thank you for keeping your account secure!</p>

          <p>Best regards,<br>The PropMaster Team</p>
        </div>

        <div class="footer">
          <p>
            This is an automated message from PropMaster. Please do not reply to this email.<br>
            Need help? <a href="mailto:support@propmaster.io">Contact our support team</a>
          </p>
          <p style="margin-top: 10px; font-size: 12px; color: #9ca3af;">
            \xa9 ${new Date().getFullYear()} PropMaster. All rights reserved.
          </p>
        </div>
      </div>
    </body>
    </html>
  `})}async function p(e){let{email:t,firstName:o,lastName:a,role:n,companyName:i,unitInfo:s}=e,p=`${o} ${a}`.trim();return r({to:t,subject:`Welcome to PropMaster${i?` - ${i}`:""}!`,html:`
    <!DOCTYPE html>
    <html lang="en">
    <head>
      <meta charset="UTF-8">
      <meta name="viewport" content="width=device-width, initial-scale=1.0">
      <title>Welcome to PropMaster</title>
      <style>
        body {
          font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
          line-height: 1.6;
          color: #1f2937;
          background-color: #f9fafb;
          margin: 0;
          padding: 0;
        }
        .container {
          max-width: 600px;
          margin: 0 auto;
          background-color: #ffffff;
          border-radius: 12px;
          overflow: hidden;
          box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
        }
        .header {
          background: linear-gradient(135deg, #a855f7 0%, #0ea5e9 100%);
          padding: 40px 30px;
          text-align: center;
          color: white;
        }
        .header h1 {
          margin: 0;
          font-size: 28px;
          font-weight: 700;
          letter-spacing: -0.025em;
        }
        .header p {
          margin: 8px 0 0 0;
          font-size: 16px;
          opacity: 0.9;
        }
        .content {
          padding: 40px 30px;
        }
        .welcome-message {
          background: linear-gradient(135deg, rgba(168, 85, 247, 0.1) 0%, rgba(14, 165, 233, 0.1) 100%);
          border-radius: 8px;
          padding: 24px;
          margin: 24px 0;
          text-align: center;
          border-left: 4px solid #a855f7;
        }
        .welcome-icon {
          font-size: 48px;
          margin-bottom: 16px;
        }
        .welcome-title {
          font-size: 20px;
          font-weight: 600;
          color: #7c3aed;
          margin: 0 0 8px 0;
        }
        .welcome-text {
          color: #6b7280;
          margin: 0;
          font-size: 16px;
        }
        ${s?`
        .unit-details {
          background-color: #f3f4f6;
          border-radius: 8px;
          padding: 24px;
          margin: 24px 0;
          border-left: 4px solid #0ea5e9;
        }
        .unit-row {
          display: flex;
          justify-content: space-between;
          margin-bottom: 12px;
          padding-bottom: 8px;
          border-bottom: 1px solid rgba(14, 165, 233, 0.2);
        }
        .unit-row:last-child {
          border-bottom: none;
          margin-bottom: 0;
          padding-bottom: 0;
        }
        .unit-label {
          font-weight: 600;
          color: #374151;
        }
        .unit-value {
          color: #0369a1;
          font-weight: 500;
        }
        `:""}
        .getting-started {
          background-color: #f0f9ff;
          border-radius: 8px;
          padding: 24px;
          margin: 24px 0;
          border-left: 4px solid #0ea5e9;
        }
        .getting-started h3 {
          margin: 0 0 16px 0;
          color: #0369a1;
          font-size: 18px;
          font-weight: 600;
        }
        .steps-list {
          list-style: none;
          padding: 0;
          margin: 0;
        }
        .steps-list li {
          padding: 8px 0;
          color: #374151;
          position: relative;
          padding-left: 32px;
        }
        .steps-list li:before {
          content: counter(step-counter);
          counter-increment: step-counter;
          position: absolute;
          left: 0;
          top: 8px;
          background: #0ea5e9;
          color: white;
          width: 20px;
          height: 20px;
          border-radius: 50%;
          display: flex;
          align-items: center;
          justify-content: center;
          font-size: 12px;
          font-weight: bold;
        }
        .footer {
          background-color: #f9fafb;
          padding: 30px;
          text-align: center;
          border-top: 1px solid #e5e7eb;
        }
        .footer p {
          margin: 0;
          color: #6b7280;
          font-size: 14px;
        }
        .footer a {
          color: #7c3aed;
          text-decoration: none;
          font-weight: 500;
        }
        .footer a:hover {
          text-decoration: underline;
        }
        .button {
          display: inline-block;
          background: linear-gradient(135deg, #a855f7 0%, #0ea5e9 100%);
          color: white;
          text-decoration: none;
          padding: 12px 24px;
          border-radius: 8px;
          font-weight: 600;
          font-size: 16px;
          margin: 16px 0;
          transition: transform 0.2s ease;
          box-shadow: 0 4px 15px rgba(168, 85, 247, 0.3);
        }
        .button:hover {
          transform: translateY(-2px);
          box-shadow: 0 8px 25px rgba(168, 85, 247, 0.4);
        }
        .secondary-button {
          display: inline-block;
          background: transparent;
          color: #7c3aed;
          border: 2px solid #7c3aed;
          text-decoration: none;
          padding: 10px 22px;
          border-radius: 8px;
          font-weight: 600;
          font-size: 16px;
          margin: 16px 8px;
          transition: all 0.3s ease;
        }
        .secondary-button:hover {
          background: #7c3aed;
          color: white;
          transform: translateY(-1px);
        }
        @media (max-width: 600px) {
          .container {
            margin: 10px;
            border-radius: 8px;
          }
          .header {
            padding: 30px 20px;
          }
          .header h1 {
            font-size: 24px;
          }
          .content {
            padding: 30px 20px;
          }
          .unit-row {
            flex-direction: column;
            gap: 4px;
          }
        }
      </style>
    </head>
    <body style="counter-reset: step-counter;">
      <div class="container">
        <div class="header">
          <h1>🎉 Welcome to PropMaster!</h1>
          <p>Your property management journey begins here</p>
        </div>

        <div class="content">
          <p>Hello ${p},</p>

          <p>Welcome to PropMaster! We're excited to have you join our community of property managers and tenants across Uganda.</p>

          <div class="welcome-message">
            <div class="welcome-icon">🏠</div>
            <div class="welcome-title">Account Created Successfully</div>
            <div class="welcome-text">Your ${n.replace("_"," ")} account is now active and ready to use.</div>
          </div>

          ${s?`
          <div class="unit-details">
            <h3 style="margin: 0 0 16px 0; color: #0369a1; font-size: 18px; font-weight: 600;">Your Unit Information</h3>
            <div class="unit-row">
              <span class="unit-label">Unit Number:</span>
              <span class="unit-value">${s.unitNumber}</span>
            </div>
            <div class="unit-row">
              <span class="unit-label">Property:</span>
              <span class="unit-value">${s.propertyName}</span>
            </div>
            <div class="unit-row">
              <span class="unit-label">Estate:</span>
              <span class="unit-value">${s.estateName}</span>
            </div>
            <div class="unit-row">
              <span class="unit-label">Monthly Rent:</span>
              <span class="unit-value">UGX ${s.monthlyRent.toLocaleString()}</span>
            </div>
          </div>
          `:""}

          <div class="getting-started">
            <h3>🚀 Getting Started</h3>
            <ol class="steps-list">
              <li>Log in to your dashboard using your email and password</li>
              <li>Complete your profile information</li>
              <li>Explore your dashboard and available features</li>
              <li>Contact support if you need any assistance</li>
            </ol>
          </div>

          <p>PropMaster is designed to make property management simple and efficient. Whether you're managing properties or paying rent, our platform provides all the tools you need.</p>

          <div style="text-align: center; margin: 30px 0;">
            <a href="${process.env.NEXTAUTH_URL||"https://app.propmaster.io"}/${"tenant"===n?"tenant":"dashboard"}" class="button">
              Access Your Dashboard
            </a>
            ${"tenant"===n?`
            <a href="${process.env.NEXTAUTH_URL||"https://app.propmaster.io"}/tenant/messages" class="secondary-button">
              Contact Support
            </a>
            `:""}
          </div>

          <p>If you have any questions or need assistance getting started, don't hesitate to reach out to our support team.</p>

          <p>Welcome aboard!</p>

          <p>Best regards,<br>The PropMaster Team</p>
        </div>

        <div class="footer">
          <p>
            This is an automated welcome message from PropMaster.<br>
            Need help? <a href="mailto:support@propmaster.io">Contact our support team</a>
          </p>
          <p style="margin-top: 10px; font-size: 12px; color: #9ca3af;">
            \xa9 ${new Date().getFullYear()} ${i||"PropMaster"}. All rights reserved.
          </p>
        </div>
      </div>
    </body>
    </html>
  `})}}};