{"version":3,"file":"shared-lib.Bi_HR7sE.mjs","names":[],"sources":["https:/framerusercontent.com/modules/s0iihMglSKc3qhwnyrKg/fJEmhQkphn8OHfDdakPI/siteMetadata.js"],"sourcesContent":["// Generated by Framer (074c765)\nexport default function metadata(params,activeLocale){return{customHTMLBodyEnd:'<script>\\n/*! mc-widget.js v1.1.0 - Embeddable mortgage calculator web component.\\n   - Payment tab: P&I, taxes, insurance, PMI (auto-stop @80% LTV), HOA; amortization preview.\\n   - Affordability tab: Solve max home price by DTI. Presets for conservative/moderate/aggressive.\\n*/\\n(function(){\\n  const tpl = document.createElement(\\'template\\');\\n  tpl.innerHTML = `\\n    <style>\\n      :host{ all: initial; contain: content; }\\n      .mc{ font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, \"Apple Color Emoji\",\"Segoe UI Emoji\"; color: var(--mc-text,#111827); }\\n      .mc *{ box-sizing: border-box; }\\n      .wrap{ border:1px solid var(--mc-border,#e5e7eb); border-radius:12px; padding:16px; background: var(--mc-bg,#fff); max-width: 920px; }\\n      h3{ margin:0 0 8px; font-size:18px; color: var(--mc-primary,#002A4E); }\\n      .tabs{ display:flex; gap:8px; margin:8px 0 12px; }\\n      .tab{ padding:8px 12px; border:1px solid var(--mc-border,#e5e7eb); border-radius:999px; background:#f5f7fb; cursor:pointer; font-size:13px; }\\n      .tab.active{ background: var(--mc-primary,#002A4E); border-color: var(--mc-primary,#002A4E); color:white; }\\n      .grid{ display:grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap:12px; }\\n      .row{ display:flex; gap:12px; align-items:center; flex-wrap: wrap; }\\n      label{ font-size:12px; color:#6b7280; display:block; margin:0 0 4px; }\\n      input, select{ width:100%; padding:10px 12px; border:1px solid var(--mc-border,#e5e7eb); border-radius:10px; font-size:14px; background:#fff; color:inherit; }\\n      input[type=\\\\\"checkbox\\\\\"]{ width:auto; }\\n      .pill{ display:inline-flex; gap:8px; align-items:center; padding:8px 10px; border-radius:999px; background: #f5f7fb; font-size:12px; color:#374151; border:1px solid var(--mc-border,#e5e7eb); cursor:pointer; }\\n      .results{ margin-top:14px; padding:12px; border-radius:12px; background:#f9fafb; border:1px dashed var(--mc-border,#e5e7eb); }\\n      .results .big{ font-weight:700; font-size:24px; color: var(--mc-primary,#002A4E); }\\n      .bar{ height:10px; border-radius:6px; overflow:hidden; display:flex; background:#e5e7eb; margin-top:8px; }\\n      .bar > i{ display:block; height:100%; }\\n      .legend{ display:flex; flex-wrap: wrap; gap:8px; margin-top:8px; font-size:12px; }\\n      .legend i{ width:10px; height:10px; border-radius:2px; display:inline-block; margin-right:6px; }\\n      .flex{ display:flex; gap:16px; flex-wrap:wrap; align-items:center; }\\n      .cta{ appearance:none; border:0; background: var(--mc-accent,#F58025); color:white; padding:10px 14px; border-radius:10px; font-weight:600; cursor:pointer; }\\n      .disclaimer{ margin-top:8px; font-size:11px; color:#6b7280; }\\n      details{ margin-top:12px; }\\n      table{ width:100%; border-collapse:collapse; font-size:12px; }\\n      th,td{ padding:8px; border-bottom:1px solid #eee; text-align:right; }\\n      th:first-child, td:first-child{ text-align:left; }\\n      .hidden{ display:none !important; }\\n      @media (max-width:720px){ .grid{ grid-template-columns: 1fr; } }\\n    </style>\\n    <div class=\"mc\">\\n      <div class=\"wrap\">\\n        <h3>Mortgage Calculator</h3>\\n        <div class=\"tabs\">\\n          <button class=\"tab active\" data-tab=\"payment\">Payment</button>\\n          <button class=\"tab\" data-tab=\"afford\">Affordability</button>\\n        </div>\\n\\n        <section id=\"tab-payment\">\\n          <div class=\"grid\">\\n            <div>\\n              <label>Calculation Mode</label>\\n              <div class=\"row\">\\n                <label class=\"pill\"><input type=\"radio\" name=\"mode\" value=\"price\" checked> Use Home Price</label>\\n                <label class=\"pill\"><input type=\"radio\" name=\"mode\" value=\"loan\"> Use Loan Amount</label>\\n              </div>\\n            </div>\\n            <div></div>\\n            <div data-field=\"priceWrap\">\\n              <label>Home Price</label>\\n              <input id=\"price\" type=\"number\" min=\"0\" step=\"1000\" value=\"400000\">\\n            </div>\\n            <div data-field=\"loanWrap\" class=\"hidden\">\\n              <label>Loan Amount</label>\\n              <input id=\"loan\" type=\"number\" min=\"0\" step=\"1000\" value=\"320000\">\\n            </div>\\n            <div>\\n              <label>Down Payment (%)</label>\\n              <input id=\"downPct\" type=\"number\" min=\"0\" max=\"100\" step=\"0.1\" value=\"20\">\\n            </div>\\n            <div>\\n              <label>Interest Rate (annual %)</label>\\n              <input id=\"rate\" type=\"number\" min=\"0\" step=\"0.01\" value=\"6.5\">\\n            </div>\\n            <div>\\n              <label>Term (years)</label>\\n              <select id=\"term\">\\n                <option value=\"30\">30</option>\\n                <option value=\"20\">20</option>\\n                <option value=\"15\">15</option>\\n                <option value=\"10\">10</option>\\n              </select>\\n            </div>\\n            <div>\\n              <label>Property Tax (% of price / yr)</label>\\n              <input id=\"taxPct\" type=\"number\" min=\"0\" step=\"0.01\" value=\"1.00\">\\n            </div>\\n            <div>\\n              <label>Homeowners Insurance ($/yr)</label>\\n              <input id=\"insAnnual\" type=\"number\" min=\"0\" step=\"50\" value=\"1500\">\\n            </div>\\n            <div>\\n              <label>PMI (annual %, auto-stops at 80% LTV)</label>\\n              <input id=\"pmiPct\" type=\"number\" min=\"0\" step=\"0.05\" value=\"0.60\">\\n            </div>\\n            <div>\\n              <label>HOA ($/mo)</label>\\n              <input id=\"hoa\" type=\"number\" min=\"0\" step=\"10\" value=\"0\">\\n            </div>\\n          </div>\\n\\n          <div class=\"results\" aria-live=\"polite\">\\n            <div class=\"flex\">\\n              <div>\\n                <div>Estimated Monthly Payment</div>\\n                <div class=\"big\" id=\"total\">$0</div>\\n              </div>\\n              <div>\\n                <div class=\"legend\">\\n                  <span><i style=\"background:#3b82f6\"></i>P&I</span>\\n                  <span><i style=\"background:#10b981\"></i>Taxes</span>\\n                  <span><i style=\"background:#f59e0b\"></i>Insurance</span>\\n                  <span><i style=\"background:#ef4444\"></i>PMI</span>\\n                  <span><i style=\"background:#6b7280\"></i>HOA</span>\\n                </div>\\n                <div class=\"bar\" id=\"bar\"></div>\\n              </div>\\n              <button class=\"cta\" id=\"ctaBtn\">Get Pre-Approved</button>\\n            </div>\\n            <div id=\"breakdown\"></div>\\n            <div class=\"disclaimer\">Estimates only. Not a commitment to lend. Taxes/insurance/PMI are placeholders; confirm with a loan officer.</div>\\n          </div>\\n\\n          <details id=\"amDetails\">\\n            <summary>Amortization & PMI Schedule</summary>\\n            <div id=\"amTable\"></div>\\n          </details>\\n        </section>\\n\\n        <section id=\"tab-afford\" class=\"hidden\">\\n          <div class=\"grid\">\\n            <div>\\n              <label>Gross Monthly Income ($)</label>\\n              <input id=\"af_income\" type=\"number\" min=\"0\" step=\"100\" value=\"8500\">\\n            </div>\\n            <div>\\n              <label>Other Monthly Debts ($)</label>\\n              <input id=\"af_debts\" type=\"number\" min=\"0\" step=\"25\" value=\"500\">\\n            </div>\\n            <div>\\n              <label>Target DTI (%)</label>\\n              <input id=\"af_dti\" type=\"number\" min=\"10\" max=\"60\" step=\"0.5\" value=\"40\">\\n            </div>\\n            <div>\\n              <label>Quick Presets</label>\\n              <div class=\"row\">\\n                <button type=\"button\" class=\"pill\" data-dti=\"33\">Conservative (33%)</button>\\n                <button type=\"button\" class=\"pill\" data-dti=\"40\">Moderate (40%)</button>\\n                <button type=\"button\" class=\"pill\" data-dti=\"45\">Aggressive (45%)</button>\\n              </div>\\n            </div>\\n\\n            <div>\\n              <label>Down Payment (%)</label>\\n              <input id=\"af_downPct\" type=\"number\" min=\"0\" max=\"100\" step=\"0.1\" value=\"20\">\\n            </div>\\n            <div>\\n              <label>Interest Rate (annual %)</label>\\n              <input id=\"af_rate\" type=\"number\" min=\"0\" step=\"0.01\" value=\"6.5\">\\n            </div>\\n            <div>\\n              <label>Term (years)</label>\\n              <select id=\"af_term\">\\n                <option value=\"30\">30</option>\\n                <option value=\"20\">20</option>\\n                <option value=\"15\">15</option>\\n                <option value=\"10\">10</option>\\n              </select>\\n            </div>\\n            <div>\\n              <label>Property Tax (% of price / yr)</label>\\n              <input id=\"af_taxPct\" type=\"number\" min=\"0\" step=\"0.01\" value=\"1.00\">\\n            </div>\\n            <div>\\n              <label>Homeowners Insurance ($/yr)</label>\\n              <input id=\"af_insAnnual\" type=\"number\" min=\"0\" step=\"50\" value=\"1500\">\\n            </div>\\n            <div>\\n              <label>PMI (annual %)</label>\\n              <input id=\"af_pmiPct\" type=\"number\" min=\"0\" step=\"0.05\" value=\"0.60\">\\n            </div>\\n            <div>\\n              <label>HOA ($/mo)</label>\\n              <input id=\"af_hoa\" type=\"number\" min=\"0\" step=\"10\" value=\"0\">\\n            </div>\\n          </div>\\n\\n          <div class=\"results\" aria-live=\"polite\">\\n            <div class=\"flex\">\\n              <div>\\n                <div>Max Home Price</div>\\n                <div class=\"big\" id=\"af_price\">$0</div>\\n                <div><small>At your DTI target</small></div>\\n              </div>\\n              <div>\\n                <div class=\"legend\">\\n                  <span><i style=\"background:#3b82f6\"></i>P&I</span>\\n                  <span><i style=\"background:#10b981\"></i>Taxes</span>\\n                  <span><i style=\"background:#f59e0b\"></i>Insurance</span>\\n                  <span><i style=\"background:#ef4444\"></i>PMI</span>\\n                  <span><i style=\"background:#6b7280\"></i>HOA</span>\\n                </div>\\n                <div class=\"bar\" id=\"af_bar\"></div>\\n              </div>\\n              <button class=\"cta\" id=\"af_ctaBtn\">Get Pre-Approved</button>\\n            </div>\\n            <div id=\"af_breakdown\"></div>\\n            <div class=\"disclaimer\">Affordability is based on your inputs and a target DTI. Actual qualifying may vary by program and underwriting.</div>\\n          </div>\\n        </section>\\n      </div>\\n    </div>\\n  `;\\n\\n  class MortgageCalculator extends HTMLElement{\\n    constructor(){\\n      super();\\n      this.attachShadow({mode:\\'open\\'}).appendChild(tpl.content.cloneNode(true));\\n      const $ = sel => this.shadowRoot.querySelector(sel);\\n      this.$ = $;\\n      this.inputs = {\\n        mode: () => this.shadowRoot.querySelector(\\'input[name=\"mode\"]:checked\\').value,\\n        price: $(\\'#price\\'),\\n        loan: $(\\'#loan\\'),\\n        downPct: $(\\'#downPct\\'),\\n        rate: $(\\'#rate\\'),\\n        term: $(\\'#term\\'),\\n        taxPct: $(\\'#taxPct\\'),\\n        insAnnual: $(\\'#insAnnual\\'),\\n        pmiPct: $(\\'#pmiPct\\'),\\n        hoa: $(\\'#hoa\\'),\\n      };\\n      this.af = {\\n        income: $(\\'#af_income\\'),\\n        debts: $(\\'#af_debts\\'),\\n        dti: $(\\'#af_dti\\'),\\n        downPct: $(\\'#af_downPct\\'),\\n        rate: $(\\'#af_rate\\'),\\n        term: $(\\'#af_term\\'),\\n        taxPct: $(\\'#af_taxPct\\'),\\n        insAnnual: $(\\'#af_insAnnual\\'),\\n        pmiPct: $(\\'#af_pmiPct\\'),\\n        hoa: $(\\'#af_hoa\\'),\\n      };\\n      this.ui = {\\n        priceWrap: this.shadowRoot.querySelector(\\'[data-field=\"priceWrap\"]\\'),\\n        loanWrap: this.shadowRoot.querySelector(\\'[data-field=\"loanWrap\"]\\'),\\n        total: $(\\'#total\\'),\\n        breakdown: $(\\'#breakdown\\'),\\n        bar: $(\\'#bar\\'),\\n        amTable: $(\\'#amTable\\'),\\n        ctaBtn: $(\\'#ctaBtn\\'),\\n        tabs: this.shadowRoot.querySelectorAll(\\'.tab\\'),\\n        sectionPayment: this.shadowRoot.querySelector(\\'#tab-payment\\'),\\n        sectionAfford: this.shadowRoot.querySelector(\\'#tab-afford\\'),\\n        af_price: $(\\'#af_price\\'),\\n        af_breakdown: $(\\'#af_breakdown\\'),\\n        af_bar: $(\\'#af_bar\\'),\\n        af_ctaBtn: $(\\'#af_ctaBtn\\'),\\n      };\\n      this.config = { \\n        currency:\\'USD\\', \\n        brand:{}, \\n        cta:{ text:\\'Get Pre-Approved\\', href:\\'#\\' }, \\n        options:{ showAmortization:true, autoStopPMI:true, showAffordability:true } \\n      };\\n    }\\n\\n    connectedCallback(){\\n      this.#applyConfig();\\n      this.#bind();\\n      this.#renderPayment();\\n      if(this.config.options?.showAffordability!==false) this.#renderAfford();\\n    }\\n\\n    #applyConfig(){\\n      try{\\n        const cfgAttr = this.getAttribute(\\'data-config\\');\\n        if(cfgAttr){ Object.assign(this.config, JSON.parse(cfgAttr)); }\\n      }catch(e){ /* ignore */ }\\n      const b = this.config.brand || {};\\n      this.style.setProperty(\\'--mc-primary\\', b.primary || \\'#002A4E\\');\\n      this.style.setProperty(\\'--mc-accent\\',  b.accent  || \\'#F58025\\');\\n      this.style.setProperty(\\'--mc-text\\',    b.text    || \\'#111827\\');\\n      this.style.setProperty(\\'--mc-bg\\',      b.bg      || \\'#fff\\');\\n      this.style.setProperty(\\'--mc-border\\',  b.border  || \\'#e5e7eb\\');\\n      const d = this.config.defaults || {};\\n      const setIf = (el, key, fallback) => el && (el.value = (d[key] ?? el.value ?? fallback));\\n      setIf(this.inputs.price, \\'price\\', 400000);\\n      setIf(this.inputs.loan, \\'loan\\', 320000);\\n      setIf(this.inputs.downPct, \\'downPct\\', 20);\\n      setIf(this.inputs.rate, \\'rate\\', 6.5);\\n      setIf(this.inputs.term, \\'termYears\\', 30);\\n      setIf(this.inputs.taxPct, \\'taxPct\\', 1.0);\\n      setIf(this.inputs.insAnnual, \\'insAnnual\\', 1500);\\n      setIf(this.inputs.pmiPct, \\'pmiAnnualPct\\', 0.6);\\n      setIf(this.inputs.hoa, \\'hoaMonthly\\', 0);\\n      setIf(this.af.income, \\'income\\', 8500);\\n      setIf(this.af.debts, \\'debts\\', 500);\\n      setIf(this.af.dti, \\'dtiLimitPct\\', 40);\\n      setIf(this.af.downPct, \\'downPct\\', this.inputs.downPct.value);\\n      setIf(this.af.rate, \\'rate\\', this.inputs.rate.value);\\n      setIf(this.af.term, \\'termYears\\', this.inputs.term.value);\\n      setIf(this.af.taxPct, \\'taxPct\\', this.inputs.taxPct.value);\\n      setIf(this.af.insAnnual, \\'insAnnual\\', this.inputs.insAnnual.value);\\n      setIf(this.af.pmiPct, \\'pmiAnnualPct\\', this.inputs.pmiPct.value);\\n      setIf(this.af.hoa, \\'hoaMonthly\\', this.inputs.hoa.value);\\n      const ctaText = (this.config.cta && this.config.cta.text) || \\'Get Pre-Approved\\';\\n      this.ui.ctaBtn.textContent = ctaText;\\n      this.ui.af_ctaBtn.textContent = ctaText;\\n      const ctaClick = () => {\\n        const activeTab = [...this.ui.tabs].find(t => t.classList.contains(\\'active\\'))?.dataset.tab;\\n        const detail = activeTab===\\'afford\\' ? { mode:\\'affordability\\', ...this.#afState() } : { mode:\\'payment\\', ...this.#paymentState() };\\n        this.dispatchEvent(new CustomEvent(\\'mc:cta\\', { detail, bubbles:true }));\\n        if(this.config.cta && this.config.cta.href){ window.location.href = this.config.cta.href; }\\n      };\\n      this.ui.ctaBtn.addEventListener(\\'click\\', ctaClick);\\n      this.ui.af_ctaBtn.addEventListener(\\'click\\', ctaClick);\\n      if(this.config.options?.showAffordability===false){\\n        this.shadowRoot.querySelector(\\'[data-tab=\"afford\"]\\').classList.add(\\'hidden\\');\\n      }\\n    }\\n\\n    #bind(){\\n      this.ui.tabs.forEach(btn => {\\n        btn.addEventListener(\\'click\\', () => {\\n          this.ui.tabs.forEach(b => b.classList.remove(\\'active\\'));\\n          btn.classList.add(\\'active\\');\\n          const tab = btn.dataset.tab;\\n          this.ui.sectionPayment.classList.toggle(\\'hidden\\', tab!==\\'payment\\');\\n          this.ui.sectionAfford.classList.toggle(\\'hidden\\', tab!==\\'afford\\');\\n          if(tab===\\'payment\\'){ this.#renderPayment(); }\\n          else { this.#renderAfford(); }\\n        });\\n      });\\n      const on = (el, ev=\\'input\\') => el && el.addEventListener(ev, () => this.#renderPayment());\\n      [\\'price\\',\\'loan\\',\\'downPct\\',\\'rate\\',\\'term\\',\\'taxPct\\',\\'insAnnual\\',\\'pmiPct\\',\\'hoa\\'].forEach(k => on(this.inputs[k]));\\n      this.shadowRoot.querySelectorAll(\\'input[name=\\\\\"mode\\\\\"]\\').forEach(r => r.addEventListener(\\'change\\', () => {\\n        const mode = this.inputs.mode();\\n        this.ui.priceWrap.classList.toggle(\\'hidden\\', mode!==\\'price\\');\\n        this.ui.loanWrap.classList.toggle(\\'hidden\\', mode!==\\'loan\\');\\n        this.#renderPayment();\\n      }));\\n      const afOn = (el, ev=\\'input\\') => el && el.addEventListener(ev, () => this.#renderAfford());\\n      [\\'income\\',\\'debts\\',\\'dti\\',\\'downPct\\',\\'rate\\',\\'term\\',\\'taxPct\\',\\'insAnnual\\',\\'pmiPct\\',\\'hoa\\'].forEach(k => afOn(this.af[k]));\\n      this.shadowRoot.querySelectorAll(\\'button[data-dti]\\').forEach(btn => btn.addEventListener(\\'click\\', () => {\\n        this.af.dti.value = btn.getAttribute(\\'data-dti\\');\\n        this.#renderAfford();\\n      }));\\n    }\\n\\n    #fmt(n, frac=0){\\n      try{\\n        return new Intl.NumberFormat(undefined,{style:\\'currency\\',currency:this.config.currency||\\'USD\\',maximumFractionDigits:frac}).format(n||0);\\n      }catch{ return \\'$\\' + (n||0).toFixed(frac); }\\n    }\\n    #piPayment(P, ratePct, years){\\n      const r = (Number(ratePct)/100)/12;\\n      const n = Number(years)*12;\\n      if(r===0) return P/n;\\n      const f = Math.pow(1+r,n);\\n      return P * r * f / (f - 1);\\n    }\\n    #paymentBreakdown({price, loanAmount, ratePct, years, taxPct, insAnnual, pmiAnnualPct, hoa, autoStopPMI}){\\n      const tax = ( (taxPct/100) * price ) / 12;\\n      const ins = (insAnnual/12);\\n      const pi = this.#piPayment(loanAmount, ratePct, years);\\n      let pmi = 0;\\n      if ((loanAmount/price) > 0.80) { pmi = (pmiAnnualPct/100) * loanAmount / 12; }\\n      const total = pi + tax + ins + pmi + hoa;\\n      return { pi, tax, ins, pmi, hoa, total };\\n    }\\n    #solvePriceByDTI({income, debts, dtiPct, downPct, ratePct, years, taxPct, insAnnual, pmiAnnualPct, hoa}){\\n      const allowed = Math.max(0, income * (dtiPct/100) - debts);\\n      let lo = 0, hi = 5_000_000, best = 0, loops = 0;\\n      while (lo <= hi && loops++ < 80){\\n        const mid = (lo + hi) / 2;\\n        const loan = mid * (1 - downPct/100);\\n        const bd = this.#paymentBreakdown({ price: mid, loanAmount: loan, ratePct, years, taxPct, insAnnual, pmiAnnualPct, hoa, autoStopPMI:true });\\n        if (bd.total <= allowed){ best = mid; lo = mid + 1; } else { hi = mid - 1; }\\n      }\\n      const loan = best * (1 - downPct/100);\\n      const bd = this.#paymentBreakdown({ price: best, loanAmount: loan, ratePct, years, taxPct, insAnnual, pmiAnnualPct, hoa, autoStopPMI:true });\\n      return { price: best, loanAmount: loan, breakdown: bd, allowed };\\n    }\\n\\n    #paymentState(){\\n      const mode = this.inputs.mode();\\n      const price = Number(this.inputs.price.value||0);\\n      const downPct = Number(this.inputs.downPct.value||0);\\n      const rate = Number(this.inputs.rate.value||0);\\n      const termYears = Number(this.inputs.term.value||30);\\n      const taxPct = Number(this.inputs.taxPct.value||0);\\n      const insAnnual = Number(this.inputs.insAnnual.value||0);\\n      const pmiPct = Number(this.inputs.pmiPct.value||0);\\n      const hoa = Number(this.inputs.hoa.value||0);\\n      let loanAmount = mode===\\'price\\' ? Math.max(0, price - (price * (downPct/100))) : Number(this.inputs.loan.value||0);\\n      const effPrice = (mode===\\'price\\') ? price : (loanAmount / (1 - (downPct/100) || 1));\\n      return { mode, price: effPrice, downPct, loanAmount, rate, termYears, taxPct, insAnnual, pmiPct, hoa };\\n    }\\n    #afState(){\\n      return {\\n        income: Number(this.af.income.value||0),\\n        debts: Number(this.af.debts.value||0),\\n        dtiPct: Number(this.af.dti.value||0),\\n        downPct: Number(this.af.downPct.value||0),\\n        rate: Number(this.af.rate.value||0),\\n        termYears: Number(this.af.term.value||30),\\n        taxPct: Number(this.af.taxPct.value||0),\\n        insAnnual: Number(this.af.insAnnual.value||0),\\n        pmiPct: Number(this.af.pmiPct.value||0),\\n        hoa: Number(this.af.hoa.value||0),\\n      };\\n    }\\n\\n    #renderPayment(){\\n      const S = this.#paymentState();\\n      const bd = this.#paymentBreakdown({ price:S.price, loanAmount:S.loanAmount, ratePct:S.rate, years:S.termYears, taxPct:S.taxPct, insAnnual:S.insAnnual, pmiAnnualPct:S.pmiPct, hoa:S.hoa, autoStopPMI:(this.config.options?.autoStopPMI!==false) });\\n      this.ui.total.textContent = this.#fmt(bd.total);\\n      this.ui.breakdown.innerHTML = `\\n        <div class=\"grid\" style=\"margin-top:8px;\">\\n          <div><strong>P&I:</strong> ${this.#fmt(bd.pi)}</div>\\n          <div><strong>Taxes:</strong> ${this.#fmt(bd.tax)}</div>\\n          <div><strong>Insurance:</strong> ${this.#fmt(bd.ins)}</div>\\n          <div><strong>PMI:</strong> ${this.#fmt(bd.pmi)}</div>\\n          <div><strong>HOA:</strong> ${this.#fmt(bd.hoa)}</div>\\n          <div><strong>Loan Amount:</strong> ${this.#fmt(S.loanAmount)}</div>\\n        </div>`;\\n      const sum = bd.pi + bd.tax + bd.ins + bd.pmi + bd.hoa || 1;\\n      const pct = v => (v/sum*100).toFixed(2)+\\'%\\';\\n      this.ui.bar.innerHTML = `\\n        <i style=\"width:${pct(bd.pi)};background:#3b82f6\"></i>\\n        <i style=\"width:${pct(bd.tax)};background:#10b981\"></i>\\n        <i style=\"width:${pct(bd.ins)};background:#f59e0b\"></i>\\n        <i style=\"width:${pct(bd.pmi)};background:#ef4444\"></i>\\n        <i style=\"width:${pct(bd.hoa)};background:#6b7280\"></i>\\n      `;\\n      if(this.config.options?.showAmortization!==false){\\n        const rows = this.#amortPreviewRows(S);\\n        let html = \\'<table><thead><tr><th>Month</th><th>Principal</th><th>Interest</th><th>PMI</th><th>Balance</th><th>Total</th></tr></thead><tbody>\\';\\n        html += rows.map(r => `<tr><td>${r.m}</td><td>${this.#fmt(r.principal)}</td><td>${this.#fmt(r.interest)}</td><td>${this.#fmt(r.pmi)}</td><td>${this.#fmt(r.balance)}</td><td>${this.#fmt(r.total)}</td></tr>`).join(\\'\\');\\n        html += \\'</tbody></table>\\';\\n        this.ui.amTable.innerHTML = html;\\n      }\\n      this.dispatchEvent(new CustomEvent(\\'mc:calculate\\', { detail: { mode:\\'payment\\', ...S, monthly: bd }, bubbles:true }));\\n    }\\n\\n    #amortPreviewRows(S){\\n      const r = (S.rate/100)/12;\\n      const n = S.termYears*12;\\n      const tax = ( (S.taxPct/100) * S.price ) / 12;\\n      const ins = (S.insAnnual/12);\\n      const pi = this.#piPayment(S.loanAmount, S.rate, S.termYears);\\n      let bal = S.loanAmount;\\n      const out = [];\\n      for(let m=1; m<=Math.min(12,n); m++){\\n        const interest = bal * r;\\n        const principal = pi - interest;\\n        bal = Math.max(0, bal - principal);\\n        const ltv = bal / S.price;\\n        let pmi = 0;\\n        if ((S.loanAmount/S.price) > 0.80 && (!(this.config.options?.autoStopPMI!==false) || ltv > 0.80)) {\\n          pmi = (S.pmiPct/100) * bal / 12;\\n        }\\n        const total = pi + tax + ins + pmi + S.hoa;\\n        out.push({ m, principal, interest, pmi, balance: bal, total });\\n      }\\n      const totalPayments = n;\\n      const last = out[out.length-1];\\n      out.push({ m: totalPayments, principal: last?.principal||0, interest: last?.interest||0, pmi: 0, balance: 0, total: pi + tax + ins + S.hoa });\\n      return out;\\n    }\\n\\n    #renderAfford(){\\n      if(this.config.options?.showAffordability===false){ return; }\\n      const A = this.#afState();\\n      const sol = this.#solvePriceByDTI({ income:A.income, debts:A.debts, dtiPct:A.dtiPct, downPct:A.downPct, ratePct:A.rate, years:A.termYears, taxPct:A.taxPct, insAnnual:A.insAnnual, pmiAnnualPct:A.pmiPct, hoa:A.hoa });\\n      this.ui.af_price.textContent = this.#fmt(sol.price);\\n      const bd = sol.breakdown;\\n      this.ui.af_breakdown.innerHTML = `\\n        <div class=\"grid\" style=\"margin-top:8px;\">\\n          <div><strong>Allowed Payment (DTI):</strong> ${this.#fmt(sol.allowed)}</div>\\n          <div><strong>Est. Monthly Total:</strong> ${this.#fmt(bd.total)}</div>\\n          <div><strong>P&I:</strong> ${this.#fmt(bd.pi)}</div>\\n          <div><strong>Taxes:</strong> ${this.#fmt(bd.tax)}</div>\\n          <div><strong>Insurance:</strong> ${this.#fmt(bd.ins)}</div>\\n          <div><strong>PMI:</strong> ${this.#fmt(bd.pmi)}</div>\\n          <div><strong>HOA:</strong> ${this.#fmt(bd.hoa)}</div>\\n          <div><strong>Loan Amount:</strong> ${this.#fmt(sol.loanAmount)}</div>\\n        </div>`;\\n      const sum = bd.pi + bd.tax + bd.ins + bd.pmi + bd.hoa || 1;\\n      const pct = v => (v/sum*100).toFixed(2)+\\'%\\';\\n      this.ui.af_bar.innerHTML = `\\n        <i style=\"width:${pct(bd.pi)};background:#3b82f6\"></i>\\n        <i style=\"width:${pct(bd.tax)};background:#10b981\"></i>\\n        <i style=\"width:${pct(bd.ins)};background:#f59e0b\"></i>\\n        <i style=\"width:${pct(bd.pmi)};background:#ef4444\"></i>\\n        <i style=\"width:${pct(bd.hoa)};background:#6b7280\"></i>\\n      `;\\n      this.dispatchEvent(new CustomEvent(\\'mc:calculate\\', { detail: { mode:\\'affordability\\', ...A, solved: sol }, bubbles:true }));\\n    }\\n  }\\n\\n  customElements.define(\\'mortgage-calculator\\', MortgageCalculator);\\n})();\\n</script>',description:\"Get your dream home with LoKation Mortgage. Competitive rates, same-day pre-approvals, no hidden fees. FHA, VA, Jumbo & refinance options tailored to you.\",favicon:\"https://framerusercontent.com/assets/7tw5MpihkcYlG9LJJDs77Hd7dM.png\",robots:\"max-image-preview:large\",socialImage:\"https://framerusercontent.com/assets/4fvjN9zK5jm14aR0Td1WVGTAtUU.jpg\",title:\"LoKation Mortgage | Home Loans, Refinancing & Fast Pre-Approvals\"};}export const metadataVersion=1;\nexport const __FramerMetadata__ = {\"exports\":{\"metadataVersion\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"default\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}"],"mappings":"2DACA,SAAwB,EAAS,EAAO,EAAa,CAAC,MAAM,CAAC,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAA8uxB,YAAY,6JAA6J,QAAQ,sEAAsE,OAAO,0BAA0B,YAAY,uEAAuE,MAAM,mEAAmE"}