(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const e of document.querySelectorAll('link[rel="modulepreload"]'))o(e);new MutationObserver(e=>{for(const t of e)if(t.type==="childList")for(const a of t.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&o(a)}).observe(document,{childList:!0,subtree:!0});function c(e){const t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin==="use-credentials"?t.credentials="include":e.crossOrigin==="anonymous"?t.credentials="omit":t.credentials="same-origin",t}function o(e){if(e.ep)return;e.ep=!0;const t=c(e);fetch(e.href,t)}})();const i="https://aftermarketapi.namecheap.com/client/api",d=`${i}/landing-page-auctions`,l=`${i}/track`;function u(r){try{const n=new URLSearchParams({event:"parkingLanded",source:"parking"});r&&n.set("tld",r),navigator.sendBeacon(l,n)}catch{}}async function f(){const r=await fetch(d);if(!r.ok)throw new Error(`API error: ${r.status}`);const n=await r.json();p(n)}function m(r){const n=new Date,o=new Date(r)-n;if(o<=0)return"Ended";const e=Math.floor(o/(1e3*60*60*24)),t=Math.floor(o%(1e3*60*60*24)/(1e3*60*60));return e>0?`Ends in ${e}d ${t}h`:`Ends in ${t}h`}function p(r){const n=document.querySelector("#auction-list"),c=document.createElement("table"),o=document.createElement("tbody");r.forEach(e=>{const t=document.createElement("tr"),a=`https://www.namecheap.com/market/${e.name}/?utm_source=parkingpage&utm_medium=referral&utm_campaign=nc_market`;t.dataset.url=a,t.innerHTML=` ${e.name} $${e.price.toLocaleString()} ${m(e.endDate)} Bid now `,t.addEventListener("click",s=>{s.target.closest("a")||(window.location.href=a)}),o.appendChild(t)}),c.appendChild(o),n.innerHTML="",n.appendChild(c)}document.addEventListener("DOMContentLoaded",async()=>{const r=window.location.hostname.split("."),n=r.slice(-2).join(".");u(r[r.length-1]),document.title=`${n} is registered at Namecheap`;const c=document.querySelector("h1");c&&(c.textContent=n),document.querySelectorAll(".js-domain").forEach(e=>{e.textContent=n});const o=document.querySelector("#auction-list");o&&(o.innerHTML='
');try{await f()}catch(e){console.error("Failed to fetch auctions:",e),o&&(o.innerHTML="")}});