PageSourceSearch

https://goexpired.com/assets/PriceHunter-BqAYyHHN.js

js goexpired.com collected 2026-10-09 22:42:30 UTC 13,361 bytes, 1 lines download raw bytes

1import{j as e,$ as F,B as k,r as d,b as A,s as f,ap as $,c as H,a1 as R,aq as _,a2 as I,S as U}from"./index-DocTL6Xp.js";import{C as j,b as y,a as v,c as S}from"./card-BSfcIW4Y.js";import{S as w}from"./skeleton-BQYv2aTe.js";import{C as z}from"./calendar-BwAh82ST.js";const G=()=>e.jsx("footer",{className:"py-8 px-4 border-t border-white/20",children:e.jsxs("div",{className:"max-w-6xl mx-auto text-center",children:[e.jsxs("p",{className:"text-white/60 text-sm",children:["© 2025 GoExpired",e.jsx("span",{className:"mx-2",children:"·"}),e.jsx("a",{href:"/privacy",className:"hover:text-white/80 transition-colors",children:"Privacy"}),e.jsx("span",{className:"mx-2",children:"·"}),e.jsx("a",{href:"/terms",className:"hover:text-white/80 transition-colors",children:"Terms"})]}),e.jsx("p",{className:"text-white/40 text-xs mt-6 max-w-4xl mx-auto leading-relaxed",children:"Disclaimer: GoExpired is an independent publication and is not affiliated with, endorsed by, or sponsored by Dynadot, GoDaddy, Namecheap or any other registrar. Some links are affiliate links; if you click and make a purchase, we may earn a commission at no extra cost to you. The content is for informational purposes only and is not financial, investment, legal, or tax advice. Prices, availability, and auction status can change without notice, and accuracy isn't guaranteed. Domain investing involves risk and you can lose money. Past performance is not indicative of future results. All trademarks belong to their respective owners."})]})}),O=s=>{switch(s.toLowerCase()){case"dynadot":return"https://www.dynadot.com";case"porkbun":return"https://porkbun.com";case"namesilo":return"https://www.namesilo.com";default:return`https://${s.toLowerCase()}.com`}},P=s=>{switch(s.toLowerCase()){case"dynadot":return"/lovable-uploads/5f1e061a-f745-4792-a808-950ed8364faf.png";case"porkbun":return"/lovable-uploads/77f8d999-99c2-43b7-8e07-e2d307e4e382.png";case"namesilo":return"/lovable-uploads/b09109ae-43bb-40ff-8dba-1aa11713669e.png";default:return""}},b=({data:s,isLoading:n,isBestPrice:i})=>n?e.jsxs(j,{className:"bg-card border border-border rounded-2xl shadow-[0_10px_30px_rgba(0,0,0,.25)]",children:[e.jsx(y,{className:"pb-3",children:e.jsx(w,{className:"h-6 w-20 bg-input"})}),e.jsxs(v,{children:[e.jsx(w,{className:"h-8 w-16 bg-input mb-2"}),e.jsx(w,{className:"h-4 w-12 bg-input"})]})]}):s?e.jsxs(j,{className:`bg-card border border-border rounded-2xl shadow-[0_10px_30px_rgba(0,0,0,.25)] text-foreground relative ${i?"ring-2 ring-green-400":""}`,children:[i&&e.jsx(F,{className:"absolute -top-2 left-1/2 transform -translate-x-1/2 bg-[hsl(220_24%_18%)] text-foreground border border-border rounded-full px-2 py-0.5 text-xs",children:"Best Price"}),e.jsx(y,{className:"pb-3",children:e.jsx(S,{className:"flex items-center justify-center h-10",children:P(s.registrar)?e.jsx("img",{src:P(s.registrar),alt:s.registrar,className:`${s.registrar.toLowerCase()==="namesilo"?"h-5":"h-6"} max-w-full object-contain invert contrast-125 brightness-110`}):e.jsx("span",{className:"text-foreground text-lg",children:s.registrar})})}),e.jsxs(v,{children:[e.jsxs("div",{className:"text-2xl font-bold text-foreground mb-1",children:["$",s.price]}),e.jsx("div",{className:"text-muted-foreground text-sm mb-3",children:"first year"}),e.jsx("div",{className:"text-center",children:e.jsxs("a",{href:O(s.registrar),target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:text-foreground underline text-sm transition-colors",children:["Visit ",s.registrar]})})]})]}):e.jsxs(j,{className:"bg-card border border-border rounded-2xl shadow-[0_10px_30px_rgba(0,0,0,.25)] text-foreground",children:[e.jsx(y,{className:"pb-3",children:e.jsx(S,{className:"text-foreground text-sm flex items-center justify-center",children:"Coming Soon"})}),e.jsx(v,{className:"text-center",children:e.jsx("p",{className:"text-muted-foreground text-sm",children:"Working on adding more registrars"})})]}),q=[{value:"com",label:".com"},{value:"ai",label:".ai"},{value:"net",label:".net"},{value:"org",label:".org"},{value:"io",label:".io"},{value:"xyz",label:".xyz"}],K=({selectedTld:s,onTldChange:n,isLoading:i})=>e.jsxs("div",{children:[e.jsx("h2",{className:"text-foreground text-2xl md:text-3xl font-bold text-center mb-8",children:"Choose a domain extension:"}),e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-4 max-w-4xl mx-auto",children:q.map(a=>e.jsx(k,{onClick:()=>n(a.value),disabled:i,variant:s===a.value?"default":"outline",className:`flex items-center justify-center p-6 h-16 transition-all duration-200 border ${s===a.value?"bg-primary text-primary-foreground border-transparent hover:bg-[hsl(218_100%_64%)] scale-105 focus-visible:ring-2 focus-visible:ring-ring":"bg-input border border-border text-foreground hover:bg-[hsl(220_24%_22%)] focus-visible:ring-2 focus-visible:ring-ring"} rounded-xl`,children:e.jsx("span",{className:"text-2xl font-bold",children:a.label})},a.value))})]}),V=({selectedTld:s})=>
1{const[n,i]=d.useState([]),[a,g]=d.useState(!1),{toast:t}=A();d.useEffect(()=>{l()},[s]);const l=async()=>{if(s){g(!0);try{const{data:r,error:o}=await f.from("coupons").select("*").eq("tld",s).gt("expires_at",new Date().toISOString()).order("new_price",{ascending:!0});if(o)throw o;i(r||[])}catch(r){console.error("Error fetching coupons:",r)}finally{g(!1)}}},h=r=>{navigator.clipboard.writeText(r),t({title:"Coupon copied!",description:`${r} has been copied to your clipboard.`})},m=r=>new Date(r).toLocaleDateString("en-US",{month:"2-digit",day:"2-digit",year:"2-digit",hour:"2-digit",minute:"2-digit",timeZoneName:"short"});return a||n.length===0?null:e.jsxs("div",{className:"space-y-4 mt-6",children:[e.jsxs("h3",{className:"text-foreground text-xl font-semibold text-center",children:["🎉 Active Promotions for .",s]}),n.map(r=>e.jsx(j,{className:"bg-card border border-border rounded-2xl shadow-[0_10px_30px_rgba(0,0,0,.25)]",children:e.jsx(v,{className:"p-4 md:p-6",children:e.jsxs("div",{className:"flex flex-col md:flex-row md:items-center text-foreground space-y-4 md:space-y-0 md:gap-6",children:[e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2 mb-2",children:[e.jsx("span",{className:"text-sm font-medium bg-[hsl(220_24%_18%)] text-foreground border border-border px-2 py-1 rounded",children:r.registrar}),e.jsxs("span",{className:"text-base md:text-lg font-bold",children:[".",r.tld," Domain ",r.type==="trans"?"Transfer":"Registration"]})]}),e.jsxs("div",{className:"flex items-baseline gap-2 mb-3",children:[e.jsxs("span",{className:"text-2xl md:text-3xl font-bold text-foreground",children:["$",r.new_price.toFixed(2)]}),r.original_price&&e.jsxs("span",{className:"text-base md:text-lg line-through text-muted-foreground",children:["$",r.original_price.toFixed(2)]})]}),e.jsxs("div",{className:"flex items-center gap-1 text-sm text-muted-foreground",children:[e.jsx(z,{className:"w-4 h-4"}),e.jsxs("span",{children:["Ends: ",m(r.expires_at)]})]})]}),e.jsxs("div",{className:"flex flex-col md:flex-row md:items-center gap-3 md:shrink-0",children:[e.jsx("div",{className:"text-center",children:e.jsx("div",{className:"text-lg md:text-2xl font-bold tracking-wider bg-input border border-border text-foreground px-3 md:px-4 py-2 rounded-xl inline-block",children:r.coupon_code})}),e.jsxs(k,{onClick:()=>h(r.coupon_code),variant:"secondary",size:"sm",className:"bg-input border border-border text-foreground hover:bg-[hsl(220_24%_22%)] rounded-xl focus-visible:ring-2 focus-visible:ring-ring font-medium w-full md:w-auto",children:[e.jsx($,{className:"w-4 h-4 mr-1"}),"Copy"]})]})]})})},r.id))]})},W=()=>{const[s,n]=d.useState(null),[i,a]=d.useState(!1),[g,t]=d.useState(null);return{prices:s,isLoading:i,error:g,fetchPrices:async m=>{a(!0),t(null),console.log("🔍 Starting fetchPrices for TLD:",m);try{console.log("📞 Calling Edge Function get-domain-prices...");const{data:r,error:o}=await f.functions.invoke("get-domain-prices",{body:{tld:m}});if(console.log("📥 Edge Function response:",{data:r,functionError:o}),console.log("📊 Specific Dynadot data:",r==null?void 0:r.dynadot),console.log("📊 Dynadot error:",r==null?void 0:r.error),o)throw console.error("❌ Edge Function error:",o),new Error(o.message);n(r),console.log("✅ Prices set successfully:",r),r!=null&&r.error&&(console.warn("⚠️ Data contains error:",r.error),t(r.error))}catch(r){const o=r instanceof Error?r.message:"Failed to fetch domain prices";console.error("💥 Fetch error:",r),t(o)}
1finally{a(!1),console.log("🏁 fetchPrices completed")}},getBestPrice:()=>{if(!s)return null;const m=[s.dynadot,s.porkbun,s.namesilo].filter(Boolean);return m.length===0?null:m.reduce((r,o)=>o.price<r.price?o:r)}}},Y=()=>{const s=H(),[n,i]=d.useState(null),[a,g]=d.useState("com");d.useState(!1);const{prices:t,isLoading:l,error:h,fetchPrices:m,getBestPrice:r}=W(),{favorites:o,handleSaveFavorite:Z,handleRemoveFavorite:L,favoritesLimit:E}=R(n);d.useEffect(()=>{!l&&t&&setTimeout(()=>{const c=document.getElementById("price-comparison-section");if(c){const p=c.offsetTop-64-20;window.scrollTo({top:p,behavior:"smooth"})}},200)},[l,t]),d.useEffect(()=>{f.auth.getSession().then(({data:{session:u}})=>{i((u==null?void 0:u.user)??null)});const{data:{subscription:c}}=f.auth.onAuthStateChange((u,p)=>{i((p==null?void 0:p.user)??null)});return()=>c.unsubscribe()},[]);const N=async()=>{await f.auth.signOut(),s("/")},D=async(c=a)=>{console.log("🔴 BUTTON CLICKED - handleSearchPrices started for TLD:",c);try{console.log("🟡 About to call fetchPrices with TLD:",c),await m(c),console.log("🟢 fetchPrices completed successfully")}catch(u){console.error("🔥 Error in handleSearchPrices:",u)}},T=c=>{g(c),D(c)},x=r(),C=()=>e.jsxs("div",{className:"min-h-screen bg-transparent",children:[e.jsx("section",{className:"space-y-6",children:e.jsxs("div",{className:"w-full max-w-7xl mx-auto",children:[e.jsxs("div",{className:"mb-8 mt-6",children:[e.jsx("div",{className:"relative",children:e.jsxs("h1",{className:"text-4xl font-bold text-foreground mb-4 flex items-center gap-3",children:["Price Hunter",e.jsxs("span",{className:"bg-gradient-to-r from-green-400 to-blue-500 text-white rounded-full px-2 py-0.5 shadow-[0_10px_20px_rgba(0,0,0,.25)] flex items-center gap-1 text-xs",children:[e.jsx(U,{className:"w-2.5 h-2.5"}),"BEST PRICE"]})]})}),e.jsx("p",{className:"text-muted-foreground text-sm leading-relaxed mb-6",children:"Find the best domain registration prices across multiple registrars. Compare real-time pricing and save money on your next domain purchase."})]}),e.jsx("div",{className:"mb-12 text-center",children:e.jsx(K,{selectedTld:a,onTldChange:T,isLoading:l})}),l&&e.jsx("div",{className:"text-center mb-12",children:e.jsxs("div",{className:"flex items-center justify-center space-x-2",children:[e.jsx("div",{className:"animate-spin rounded-full h-6 w-6 border-b-2 border-foreground"}),e.jsxs("span",{className:"text-muted-foreground text-lg",children:["Fetching ",a.toUpperCase()," prices..."]})]})}),h&&e.jsxs("div",{className:"mb-12 p-4 bg-card border border-border rounded-lg text-foreground text-center",children:[e.jsxs("p",{children:["⚠️ ",h]}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Showing available data below"})]}),(t||l)&&e.jsxs("div",{id:"price-comparison-section",className:"mb-16 text-center",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 max-w-6xl mx-auto",children:[e.jsx(b,{data:(t==null?void 0:t.dynadot)||null,isLoading:l,isBestPrice:(x==null?void 0:x.registrar)==="Dynadot"}),e.jsx(b,{data:(t==null?void 0:t.porkbun)||null,isLoading:l,isBestPrice:(x==null?void 0:x.registrar)==="Porkbun"}),e.jsx(b,{data:(t==null?void 0:t.namesilo)||null,isLoading:l,isBestPrice:(x==null?void 0:x.registrar)==="NameSilo"}),e.jsx(b,{data:null,isLoading:!1,isBestPrice:!1})]}),e.jsx(V,{selectedTld:a})]}),t&&e.jsxs("div",{className:"mt-8 text-muted-foreground text-sm text-center",children:[e.jsxs("p",{children:["Prices last updated: ",new Date(t.timestamp).toLocaleString("da-DK",{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit",timeZone:"Europe/Copenhagen"})," (Copenhagen time)",t.cached&&e.jsx("span",{className:"ml-2 text-emerald-300",children:"• Cached data"})]}),e.jsx("p",{className:"mt-2 text-xs text-muted-foreground",children:"Prices are automatically updated every hour around the clock to ensure maximum accuracy."}),e.jsx("p",{className:"mt-2 text-xs text-muted-foreground",children:"Please note that registrars may offer deals, bulk discounts, and coupons that are not reflected in the above prices. We are not responsible for any errors in the displayed prices."})]})]})}),e.jsx("section",{className:"pb-20",children:e.jsx(G,{})})]}),B=()=>e.jsxs("div",{className:"min-h-screen ga-theme bg-background text-foreground",children:[e.jsx(_,{user:n,onLogout:N}),e.jsx("div",{className:"relative pt-16",children:e.jsx(C,{})})]});return n?e.jsxs("div",{className:"min-h-screen ga-theme bg-background text-foreground",children:[e.jsx(_,{user:n,onLogout:N}),e.jsx(I,{user:n,onLogout:N,favoritesCount:o.length,favoritesLimit:E,favorites:o,onRemoveFavorite:L,onUpgrade:()=>s("/pricing"),contentClassName:"bg-transparent",children:e.jsx(C,{})})]}):e.jsx(B,{})};export{Y as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.