PageSourceSearch

https://dotweekly.com/assets/SedoWatch-iyh-4d9x.js

js dotweekly.com collected 2026-10-02 10:24:58 UTC 18,398 bytes, 5 lines download raw bytes

1import{f as re,i as le,j as e,e as w}from"./index-BzPsVFMX.js";import{a as x,b5 as ie,aT as ce,ac as oe,ab as P,aM as U,aq as de,T as xe,n as me,S as he,ar as ue}from"./icons-CJQVGBFB.js";const q="Asia/Kuala_Lumpur",o=(s,a)=>fetch(s,{method:"POST",headers:{"content-type":"application/json"},body:a?JSON.stringify(a):void 0}).then(l=>l.json()),Y=s=>{if(!s)return"—";const a=Math.max(0,(Date.now()-new Date(s).getTime())/1e3);return a<90?"just now":a<5400?Math.round(a/60)+"m ago":a<172800?Math.round(a/3600)+"h ago":Math.round(a/86400)+"d ago"},k=s=>s.toLocaleString("en-US",{timeZone:q,weekday:"short",month:"short",day:"numeric",hour:"numeric",minute:"2-digit"}),R=s=>new Date(Date.UTC(2026,0,1,s,0)).toLocaleString("en-US",{timeZone:q,hour:"numeric",minute:"2-digit"}),ge=(()=>{const s=new Date;return s.getFullYear()+"-"+String(s.getMonth()+1).padStart(2,"0")+"-"+String(s.getDate()).padStart(2,"0")})(),I=s=>{const a=Math.max(0,Math.round(s/6e4));return a<1?"under a minute":a<60?a+"m":Math.floor(a/60)+"h "+a%60+"m"},be=s=>{if(!s)return null;const a={bought:"bg-emerald-500/20 text-emerald-300 border-emerald-500/50",buying:"bg-sky-500/20 text-sky-300 border-sky-500/50",failed:"bg-rose-500/20 text-rose-300 border-rose-500/50",uncertain:"bg-amber-500/20 text-amber-300 border-amber-500/50"},l={bought:"bought",buying:"buying...",failed:"buy failed — buy manually",uncertain:"verify manually"};return e.jsx("span",{className:`inline-block px-1.5 py-0.5 rounded text-[11px] border ${a[s]||"bg-gray-600/20 text-gray-400 border-gray-600/40"}`,children:l[s]||s})},pe=s=>({bin_flip:"flip (alert)",autobuy_start:"auto-buy started",autobuy_bought:"bought",autobuy_failed:"buy failed",autobuy_uncertain:"uncertain"})[s]||s;function we(){const s=re(),{data:a,refetch:l,isFetching:H}=le({queryKey:["/api/sedo-watch"],queryFn:async()=>{const t=await fetch("/api/sedo-watch");if(t.status===403)return{forbidden:!0};if(!t.ok)throw new Error(String(t.status));return t.json()},enabled:s.authenticated,refetchInterval:15e3}),[_,j]=x.useState(""),[n,c]=x.useState(null),[C,S]=x.useState(""),[A,F]=x.useState(!1);x.useEffect(()=>{a&&!a.forbidden&&n===null&&(c(a.config),j(a.list.filter(t=>t.active).map(t=>t.domain).join(`
2`)))},[a]);const[,J]=x.useState(0);if(x.useEffect(()=>{const t=setInterval(()=>J(r=>r+1),3e4);return()=>clearInterval(t)},[]),s.loading)return e.jsx(w,{children:e.jsx("div",{className:"min-h-screen bg-[#0f1420] flex items-center justify-center text-gray-400",children:"Loading…"})});if(!s.authenticated)return e.jsx(w,{children:e.jsx("div",{className:"min-h-screen bg-[#0f1420] flex items-center justify-center px-4",children:e.jsxs("div",{className:"text-center",children:[e.jsx("h1",{className:"text-2xl font-bold text-white mb-2",children:"Please log in"}),e.jsx("p",{className:"text-gray-400",children:"Sign in to use Sedo Watch."})]})})});if(a?.forbidden)return e.jsx(w,{children:e.jsx("div",{className:"min-h-screen bg-[#0f1420] flex items-center justify-center px-4",children:e.jsxs("div",{className:"text-center",children:[e.jsx("h1",{className:"text-2xl font-bold text-white mb-2",children:"No access"}),e.jsx("p",{className:"text-gray-400",children:"Your account does not have access to Sedo Watch. Ask Jamie to grant it."})]})})});const i=t=>{S(t),setTimeout(()=>S(""),6e3)},K=async()=>{const t=await o("/api/sedo-watch/list",{domains:_});i(t.ok?`Saved — now watching ${t.count} domain${t.count===1?"":"s"}.`:"Save failed"),l()},Z=async()=>{const t=await o("/api/sedo-watch/config",n);i(t.ok?"Settings saved.":"Save failed"),l()},Q=async()=>{const t=await o("/api/sedo-watch/test-alert");i(t.ok?`Test email sent to ${t.sent.email} recipient${t.sent.email===1?"":"s"} — check your inbox.`:"Test failed")},z=async()=>{F(!0),i("Checking current prices…");const t=await o("/api/sedo-watch/check-now");i(t.ok?`Checked ${t.checked} domain${t.checked===1?"":"s"} just now.`:"Check failed"),F(!1),l()},G=async()=>{if(!window.confirm("Clear the entire watch list? This stops watching all of these domains."))return;j("");const t=await o("/api/sedo-watch/list",{domains:[]});i(t.ok?"Watch list cleared.":"Clear failed"),l()},V=async()=>{const t=!(n?.enabled??!0);(await o("/api/sedo-watch/enabled",{enabled:t})).ok&&n&&c({...n,enabled:t}),i(t?"Watching started.":"Watching stopped — no checks until you start it again."),l()},X=async()=>{const t=!(n?.auto_buy_enabled??!0),r=n?.price_target??198;if(t&&!window.confirm(`Turn auto-buy ON?
3
4When a watched domain flips to exactly €${r}, the tool buys it automatically on AB's Sedo account (clicks PayPal; AB finishes payment). Real money — only watch-list domains at €${r}.`))return;(await o("/api/sedo-watch/auto-buy",{enabled:t})).ok&&n&&c({...n,auto_buy_enabled:t}),i(t?"Auto-buy ON — watched flips are bought automatically.":"Auto-buy OFF — you'll get an email to buy manually."),l()},ee=async(t,r)=>{await o("/api/sedo-watch/flip-date",{domain:t,flip_date:r}),i(r?`${t} set to flip ${r}.`:`${t} date cleared.`),l()},m=(a?.list||[]).filter(t=>t.active),b=m.length>0&&m.every(t=>t.purchase_status),u=!!a?.inWindow,d=n?.enabled??a?.config?.enabled??!0,N=d&&u&&!b,g=n?.auto_buy_enabled??a?.config?.auto_buy_enabled??!0,v=n?.price_target??198,te=Math.round(v*1.036*100)/100,T=n?.window_start_utc??a?.config?.window_start_utc??21,E=n?.window_end_utc??a?.config?.window_end_utc??3,h=new Date,D=(()=>{const t=new Date;return t.setUTCHours(T,0,0,0),t<=h&&t.setUTCDate(t.getUTCDate()+1),t})(),M=(()=>{const t=new Date;return t.setUTCHours(E,0,0,0),t<=h&&t.setUTCDate(t.getUTCDate()+1),t})(),$=u?M.getTime()-h.getTime():D.getTime()-h.getTime(),p=R(T),y=R(E),ae=k(h),se=h.toLocaleStr
4ing([],{weekday:"short",hour:"numeric",minute:"2-digit"}),f=a?.config?.last_poll_at??null,W=f?(Date.now()-new Date(f).getTime())/1e3:null,L=W==null||W>300,O=(a?.config?.alert_emails||[]).join(", ");return e.jsx(w,{children:e.jsx("div",{className:"min-h-screen bg-[#0f1420] text-white",children:e.jsxs("div",{className:"max-w-6xl mx-auto px-4 py-6",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[e.jsx("div",{className:"p-2 bg-[#0C2C55]/30 rounded-lg",children:e.jsx(ie,{className:"w-6 h-6 text-[#629FAD]"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold text-white",children:"Sedo Watch"}),e.jsxs("p",{className:"text-sm text-gray-400",children:["Auto-buys a watched domain the instant it drops to a €",v," buy-now on Sedo."]})]})]}),e.jsx("div",{className:"mb-4 rounded-xl border border-[#1E3A5F]/60 bg-gradient-to-br from-[#0C2C55]/40 to-[#0D1B2E]/70 p-5",children:e.jsxs("div",{className:"flex flex-wrap items-center gap-x-6 gap-y-4",children:[e.jsxs("div",{className:"flex items-center gap-3.5 flex-1 min-w-[280px]",children:[d?b?e.jsx("span",{className:"w-3.5 h-3.5 rounded-full bg-emerald-400 shrink-0"}):u?e.jsxs("span",{className:"relative flex h-3.5 w-3.5 shrink-0",children:[e.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-emerald-400 opacity-60"}),e.jsx("span",{className:"relative inline-flex rounded-full h-3.5 w-3.5 bg-emerald-400"})]}):e.jsx("span",{className:"w-3.5 h-3.5 rounded-full bg-amber-400 shrink-0"}):e.jsx("span",{className:"w-3.5 h-3.5 rounded-full bg-rose-500 shrink-0"}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xl font-bold leading-tight",children:d?b?e.jsx("span",{className:"text-emerald-300",children:"All domains purchased — idle for today"}):u?e.jsxs("span",{className:"text-emerald-300",children:["Active now",g?" — auto-buy armed":" — checking"]}):e.jsxs("span",{className:"text-amber-200",children:["Next check in ",I($)]}):e.jsx("span",{className:"text-rose-300",children:"Stopped — not checking"})}),e.jsx("div",{className:"text-[13px] text-gray-300 mt-1",children:d?b?e.jsxs(e.Fragment,{children:["All ",m.length," watched domain",m.length===1?"":"s"," bought/handled — the watcher is idle. Add domains and it wakes automatically. Runs daily ",p,"–",y," MYT."]}):u?e.jsxs(e.Fragment,{children:[e.jsx("b",{className:"text-white",children:I($)})," left — running until ",e.jsxs("b",{className:"text-white",children:[k(M)," MYT"]})]}):e.jsxs(e.Fragment,{children:["Activates ",e.jsxs("b",{className:"text-white",children:[k(D)," MYT"]})," · daily ",p,"–",y," MYT"]}):e.jsxs(e.Fragment,{children:["Press ",e.jsx("b",{className:"text-white",children:"Start"})," to resume the daily ",p,"–",y," MYT check."]})})]})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("div",{className:"text-right hidden sm:block",children:[e.jsx("div",{className:"text-[10px] uppercase tracking-wide text-gray-500",children:"Malaysia now"}),e.jsx("div",{className:"text-sm font-semibold text-gray-200",children:ae}),e.jsxs("div",{className:"text-[10px] text-gray-600",children:["your time ",se]})]}),e.jsxs("div",{className:`flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg border text-xs ${L?"bg-rose-500/15 text-rose-300 border-rose-500/40":N?"bg-emerald-500/10 text-emerald-300 border-emerald-500/40":"bg-gray-500/10 text-gray-400 border-gray-600/40"}`,title:f?"Watcher process heartbeat "+Y(f):"No heartbeat yet",children:[e.jsx(ce,{className:"w-3.5 h-3.5"})," ",L?"down":N?"live":"idle"]}),e.jsx("button",{onClick:V,title:d?"Turn the watcher off completely (won't auto-resume)":"Turn the watcher on",className:`flex items-center gap-1.5 px-4 py-2 rounded-lg text-sm font-semibold ${d?N?"bg-rose-600 hover:bg-rose-500 text-white":"bg-transparent border border-gray-600/60 text-gray-300 hover:bg-gray-700/40":"bg-emerald-600 hover:bg-emerald-500 text-white"}`,children:d?e.jsxs(e.Fragment,{children:[e.jsx(oe,{className:"w-4 h-4"})," Stop"]}):e.jsxs(e.Fragment,{children:[e.jsx(P,{className:"w-4 h-4"})," Start"]})})]})]})}),C&&e.jsx("div",{className:"mb-3 px-3 py-2 rounded bg-emerald-500/10 border border-emerald-500/30 text-emerald-200 text-sm",children:C}),e.jsxs("div",{className:"grid lg:grid-cols-3 gap-4",children:[e.jsxs("div",{className:"lg:col-span-2 bg-[#0D1B2E] border border-[#1E3A5F]/40 rounded-lg p-4",children:[e.jsx("h2",{className:"font-semibold text-white mb-1",children:"Domains to watch"}),e.jsxs("p",{className:"text-[11px] text-gray-500 mb-2",children:["One per line — just the domains flipping in the window. (Optional: add a date, e.g. ",e.jsx("span",{className:"font-mono",children:"mydomain.com 2026-09-22"}),".)"]}
4),e.jsx("textarea",{value:_,onChange:t=>j(t.target.value),placeholder:`mytowel.com
5saprestige.com`,rows:5,className:"w-full bg-[#0b1424] border border-[#1E3A5F]/60 rounded p-2 text-sm text-gray-200 font-mono"}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2 mt-2",children:[e.jsxs("button",{onClick:K,className:"flex items-center gap-1.5 px-3 py-1.5 bg-sky-600 hover:bg-sky-500 rounded text-sm font-medium",children:[e.jsx(U,{className:"w-3.5 h-3.5"})," Save watch list"]}),e.jsxs("button",{onClick:X,className:`flex items-center gap-1.5 px-3 py-1.5 rounded text-sm font-semibold text-white ${g?"bg-emerald-600 hover:bg-emerald-500":"bg-gray-600 hover:bg-gray-500"}`,title:g?"Auto-buy is ON — click to turn off":"Auto-buy is OFF — click to turn on",children:[e.jsx(de,{className:"w-3.5 h-3.5"})," Auto-buy: ",g?"ON":"OFF"]}),e.jsxs("button",{onClick:z,disabled:A,className:"flex items-center gap-1.5 px-3 py-1.5 bg-[#0C2C55]/60 hover:bg-[#0C2C55]/90 border border-[#1E3A5F]/60 rounded text-sm disabled:opacity-50",children:[e.jsx(P,{className:`w-3.5 h-3.5 ${A?"animate-pulse":""}`})," Check now"]}),e.jsxs("button",{onClick:G,className:"flex items-center gap-1.5 px-3 py-1.5 bg-rose-900/40 hover:bg-rose-900/70 border border-rose-700/50 rounded text-sm text-rose-200",children:[e.jsx(xe,{className:"w-3.5 h-3.5"})," Clear"]}),e.jsx("button",{onClick:()=>l(),className:"ml-auto p-1.5 bg-[#0C2C55]/50 hover:bg-[#0C2C55]/80 border border-[#1E3A5F]/60 rounded",title:"Refresh",children:e.jsx(me,{className:`w-3.5 h-3.5 ${H?"animate-spin":""}`})})]}),e.jsx("p",{className:"text-[11px] text-gray-500 mt-1.5",children:g?e.jsxs(e.Fragment,{children:[e.jsx("b",{className:"text-emerald-400",children:"Auto-buy ON"})," — a watched domain that hits €",v," is bought automatically (clicks PayPal; AB finishes payment; ~€",te," total with the express fee)."]}):e.jsxs(e.Fragment,{children:[e.jsx("b",{className:"text-gray-400",children:"Auto-buy OFF"})," — a flip just emails ",O?e.jsx("span",{className:"text-sky-300",children:O}):"you"," to buy it manually."]})}),m.length>0&&e.jsx("div",{className:"mt-4 divide-y divide-[#1E3A5F]/20",children:m.map(t=>{const r=t.last_forsale&&t.last_price!=null&&t.last_price>0,B=t.flip_date&&t.flip_date<ge&&t.purchase_status!=="bought";return e.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 py-2",children:[e.jsx("a",{href:t.last_listing||`https://sedo.com/search/details/?domain=${t.domain}&partnerid=33366`,target:"_blank",rel:"noopener noreferrer",className:"text-sm font-medium text-gray-200 hover:text-sky-300 min-w-[130px]",children:t.domain}),t.last_checked_at==null?e.jsx("span",{className:"text-gray-600 text-[11px]",children:"not checked yet"}):r?e.jsxs("span",{className:"px-1.5 py-0.5 rounded text-[11px] bg-emerald-500/15 text-emerald-300 border border-emerald-500/40",children:["buy-now ",t.last_currency," ",t.last_price]}):t.last_forsale?e.jsx("span",{className:"px-1.5 py-0.5 rounded text-[11px] bg-amber-500/15 text-amber-300 border border-amber-500/40",children:"make offer"}):e.jsx("span",{className:"px-1.5 py-0.5 rounded text-[11px] bg-gray-600/20 text-gray-400 border border-gray-600/40",children:"not listed"}),t.purchase_status&&e.jsx("span",{title:t.purchase_note||void 0,children:be(t.purchase_status)}),e.jsxs("label",{className:"ml-auto flex items-center gap-1 text-[10px] text-gray-500",title:"Expected flip date (optional — checking runs daily regardless)",children:[e.jsx("span",{className:"hidden sm:inline",children:"flips"}),e.jsx("input",{type:"date",value:t.flip_date?t.flip_date.slice(0,10):"",onChange:ne=>ee(t.domain,ne.target.value),style:{colorScheme:"dark"},className:"bg-[#0b1424] border border-[#1E3A5F]/60 rounded px-1 py-0.5 text-[11px] text-gray-300"})]}),e.jsx("span",{className:"text-[10px] text-gray-500 w-full sm:w-auto sm:min-w-[70px] sm:text-right",children:Y(t.last_checked_at)}),B&&e.jsxs("span",{className:"text-[10px] text-amber-400 w-full",children:["expected ",t.flip_date," — hasn’t flipped; still checking daily"]})]},t.domain)})})]}),e.jsxs("div",{className:"bg-[#0D1B2E] border border-[#1E3A5F]/40 rounded-lg p-4 space-y-3",children:[e.jsx("h2",{className:"font-semibold text-white",children:"Alert settings"}),n&&e.jsxs(e.Fragment,{children:[e.jsxs("label",{className:"block text-xs text-gray-400",children:["Email alerts to (comma separated)",e.jsx("input",{value:(n.alert_emails||[]).join(", "),onChange:t=>c({...n,alert_emails:t.target.value.split(/[\s,;
5]+/).filter(Boolean)}),className:"w-full mt-1 bg-[#0b1424] border border-[#1E3A5F]/60 rounded p-1.5 text-sm text-gray-200"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsxs("label",{className:"block text-xs text-gray-400",children:["Buy at exactly (€) ",e.jsx("input",{type:"number",value:n.price_target,onChange:t=>c({...n,price_target:Number(t.target.value)}),className:"w-full mt-1 bg-[#0b1424] border border-[#1E3A5F]/60 rounded p-1.5 text-sm text-gray-200"})]}),e.jsxs("label",{className:"block text-xs text-gray-400",children:["Currency ",e.jsx("input",{value:n.currency,onChange:t=>c({...n,currency:t.target.value.toUpperCase()}),className:"w-full mt-1 bg-[#0b1424] border border-[#1E3A5F]/60 rounded p-1.5 text-sm text-gray-200"})]}),e.jsxs("label",{className:"block text-xs text-gray-400",children:["Window start ",e.jsx("input",{type:"number",value:n.window_start_utc,onChange:t=>c({...n,window_start_utc:Number(t.target.value)}),className:"w-full mt-1 bg-[#0b1424] border border-[#1E3A5F]/60 rounded p-1.5 text-sm text-gray-200"}),e.jsxs("span",{className:"text-[10px] text-gray-600",children:["= ",p," MYT"]})]}),e.jsxs("label",{className:"block text-xs text-gray-400",children:["Window end ",e.jsx("input",{type:"number",value:n.window_end_utc,onChange:t=>c({...n,window_end_utc:Number(t.target.value)}),className:"w-full mt-1 bg-[#0b1424] border border-[#1E3A5F]/60 rounded p-1.5 text-sm text-gray-200"}),e.jsxs("span",{className:"text-[10px] text-gray-600",children:["= ",y," MYT"]})]})]}),e.jsxs("div",{className:"flex flex-wrap gap-2 pt-1",children:[e.jsxs("button",{onClick:Z,className:"flex items-center gap-1.5 px-3 py-1.5 bg-sky-600 hover:bg-sky-500 rounded text-sm font-medium",children:[e.jsx(U,{className:"w-3.5 h-3.5"})," Save settings"]}),e.jsxs("button",{onClick:Q,className:"flex items-center gap-1.5 px-3 py-1.5 bg-[#0C2C55]/60 hover:bg-[#0C2C55]/90 border border-[#1E3A5F]/60 rounded text-sm",children:[e.jsx(he,{className:"w-3.5 h-3.5"})," Test email"]})]}),e.jsxs("p",{className:"text-[11px] text-gray-600 flex items-start gap-1.5",children:[e.jsx(ue,{className:"w-3.5 h-3.5 mt-0.5 shrink-0 text-[#8FD0DE]"})," Window hours are in Malaysia time. Emails come from [email protected] — add it to contacts so they don’t hit spam."]})]})]})]}),e.jsxs("div",{className:"bg-[#0D1B2E] border border-[#1E3A5F]/40 rounded-lg p-4 mt-4",children:[e.jsx("h2",{className:"font-semibold text-white mb-2",children:"Recent activity"}),(a?.events||[]).length===0?e.jsx("p",{className:"text-sm text-gray-500",children:"Nothing yet. When a domain flips it appears here and an email goes out."}):e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"text-left text-[11px] uppercase tracking-wide text-gray-500 border-b border-[#1E3A5F]/40",children:[e.jsx("th",{className:"py-1.5",children:"When"}),e.jsx("th",{children:"Domain"}),e.jsx("th",{children:"Price"}),e.jsx("th",{children:"Event"}),e.jsx("th",{children:"Emailed"})]})}),e.jsx("tbody",{children:(a?.events||[]).map((t,r)=>e.jsxs("tr",{className:"border-b border-[#1E3A5F]/20",children:[e.jsx("td",{className:"py-1.5 text-gray-400 text-[11px]",children:new Date(t.at).toLocaleString()}),e.jsx("td",{className:"text-gray-200",children:t.domain}),e.jsxs("td",{className:"text-emerald-300",children:[t.currency," ",t.price]}),e.jsx("td",{className:"text-[11px] text-gray-400",children:pe(t.event)}),e.jsx("td",{children:t.alerted?"✅":"—"})]},r))})]})]})]})})})}export{we 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.