======================================================================== FILE: src/routes/index.tsx LANG: tsx ======================================================================== import { createFileRoute } from "@tanstack/react-router"; import { useMemo, useState, type FormEvent } from "react"; import { Check, CircleDot, Download, ExternalLink, Filter, Loader2, Play, Search, Store, Tags, TriangleAlert, } from "lucide-react"; import { cn } from "#/lib/utils"; import { BUILD_PRESETS, MARKETPLACE_OPTIONS, MARKET_META, SORT_OPTIONS, planLauncher, type Marketplace, type SortId, } from "#/lib/launcher"; import { CouponVault } from "#/components/CouponVault"; import { PartnerComparison } from "#/components/PartnerComparison"; import { PriceComparison } from "#/components/PriceComparison"; import { VerifiedListings } from "#/components/VerifiedListings"; import { CpuComparison } from "#/components/CpuComparison"; export const Route = createFileRoute("/")({ component: Home }); function TerminalSection({ no, title, sub, children, }: { no: string; title: string; sub?: string; children: React.ReactNode; }) { return (
[{no} // {title}] {sub && ( {sub} )}
{children}
); } function Home() { const [query, setQuery] = useState(""); const [market, setMarket] = useState("both"); const [sortId, setSortId] = useState("price-asc"); const plan = useMemo( () => planLauncher(query, market, sortId), [query, market, sortId], ); const hasContent = plan.positive.length > 0; const onGenerate = (e?: FormEvent) => { e?.preventDefault(); document .getElementById("launchers") ?.scrollIntoView({ behavior: "smooth", block: "start" }); }; return (
{/* System utility bar */}
[ ZEZO.EXE ] ZIAD ALMUTIRI // HARDWARE UNIT
{/* Header */}
[ راصد ومنصة صيد صفقات 11.11 ]

Zezo Deals Zezo for Premium Price

راصد ومنصة صيد صفقات 11.11

مطلق بحث ذكي: يولّد كلمات بحث دقيقة مع تصفية الملحقات (كابلات، أغطية، أداة تثبيت...) ويفتح أمازون السعودية أو علي إكسبريس بروابط بحث جاهزة. لا يعرض أسعاراً وهمية، ولا يخترع عروضاً.

{/* Control panel */}
[ 01 // QUERY + LAUNCH ] ACCURATE_URLS
{/* Quick-launch presets for Ziyad's build */}
> اختصارات تشكيل Ziyad
{BUILD_PRESETS.map((p) => ( ))}
> السوق
{MARKETPLACE_OPTIONS.map((opt) => { const active = market === opt.value; return ( ); })}
> فرز / فلتر (يُطبَّق فقط إن أمكن ترميزه في الرابط)
{SORT_OPTIONS.map((s) => { const active = sortId === s.id; return ( ); })}
{/* Keyword intel */}
[INTENT] {plan.intent.label} / {plan.intent.en}
{plan.positive.length > 0 ? ( plan.positive.map((t, i) => ( {t} )) ) : ( أدخل منتجاً أو اختر اختصاراً )}
{plan.negative.map((t, i) => ( -{t} ))}

هذه المصطلحات تُستبعَد من الاستهداف. لا تدعم أمازون وعلي إكسبريس عامل الاستبعاد "-" في الرابط، لذا تُحتسَب لصياغة كلمات موجبة أدق ولا تُدَّعى كفلتر مطبَّق.

{/* Launchers */}
{hasContent ? (
{plan.launches.map((l) => (
{l.applied ? ( ) : ( لا فرز مطبَّق )}
{l.primeNote && (

فلتر Prime غير قابل للترميز في الرابط - فعِّله يدوياً في صفحة أمازون بعد الفتح.

)} {l.url} فتح البحث في {MARKET_META[l.key].en}
))}
) : (
)}
{/* Price comparison (reference + live attempt, never a dead-end) */} {/* CPU retail prices (boxed vs tray, verified-or-unavailable) */} {plan.intent.id === "cpu" && } {/* Verified Amazon.sa listings (real observed prices, GPU) */} {plan.intent.id === "gpu" && } {/* AIB partner editions (GPU only) */} {plan.intent.id === "gpu" && ( )} {/* Coupon vault */}
); } ======================================================================== FILE: src/routes/__root.tsx LANG: tsx ======================================================================== import { createRootRoute, HeadContent, Scripts } from "@tanstack/react-router"; import appCss from "../styles.css?url"; const SITE_TITLE = "Zezo for Premium Price – راصد ومنصة صيد صفقات 11.11"; const SITE_DESCRIPTION = "Zezo for Premium Price - راصد ومنصة صيد صفقات 11.11: يولّد روابط بحث دقيقة على أمازون السعودية وعلي إكسبريس مع تصفية الملحقات وبنك الكوبونات، دون أسعار أو عروض وهمية."; // milesdobrenski 06/23/2026: DO NOT REMOVE — og:image / twitter:image below need absolute URLs. // ... Twitter's crawler silently ignores relative og:image paths. const BASE_URL = process.env.VERCEL_PROJECT_PRODUCTION_URL ? `https://${process.env.VERCEL_PROJECT_PRODUCTION_URL}` : ""; export const Route = createRootRoute({ head: () => ({ meta: [ { charSet: "utf-8" }, { name: "viewport", content: "width=device-width, initial-scale=1, viewport-fit=cover", }, { name: "robots", content: "noindex, nofollow" }, { title: SITE_TITLE }, { name: "description", content: SITE_DESCRIPTION }, { name: "theme-color", content: "#0A0A0A" }, { property: "og:title", content: SITE_TITLE }, { property: "og:description", content: SITE_DESCRIPTION }, { property: "og:type", content: "website" }, { property: "og:image", content: `${BASE_URL}/api/og` }, { property: "og:url", content: BASE_URL || "/" }, { name: "twitter:card", content: "summary_large_image" }, { name: "twitter:title", content: SITE_TITLE }, { name: "twitter:description", content: SITE_DESCRIPTION }, { name: "twitter:image", content: `${BASE_URL}/api/og` }, ], links: [ { rel: "stylesheet", href: appCss }, { rel: "icon", href: "/favicon.svg", type: "image/svg+xml" }, { rel: "icon", href: "/favicon.ico", sizes: "any" }, ], }), shellComponent: RootDocument, }); function RootDocument({ children }: { children: React.ReactNode }) { return ( {children} ); } ======================================================================== FILE: src/routes/api/og.tsx LANG: tsx ======================================================================== import { createFileRoute } from "@tanstack/react-router"; import { ImageResponse } from "@vercel/og"; // Dynamic OpenGraph card. EDIT ONLY the constants below (SITE_NAME, SITE_TAGLINE, OG_BG/OG_TEXT/OG_MUTED) // to match the site — do NOT change the JSX, font sizes, alignment, or centering below; they are tuned for // a consistent, centered card. While SITE_NAME is still the default, or if the image fails to render, we // serve the bundled Poke image at /og.jpg directly (HTTP 200, not a redirect) so the live link preview is // never empty — even on crawlers (iMessage, WhatsApp) that don't follow redirects for og:image. const SITE_NAME = "Zezo for Premium Price"; const SITE_TAGLINE = "راصد ومنصة صيد صفقات 11.11"; // The building agent sets these to match the site's actual page design. const OG_BG = "#0A0A0A"; // card background color const OG_TEXT = "#EAEAEA"; // title color const OG_MUTED = "#FF2A2A"; // tagline color // milesdobrenski 06/18/2026: generated sites are edited and redeployed often, so never cache the OG // image at the CDN — always regenerate it so link previews reflect the site's current state. const OG_CACHE_CONTROL = "no-cache, no-store, must-revalidate"; let fontsPromise: Promise<[ArrayBuffer, ArrayBuffer]> | null = null; let fallbackBytesPromise: Promise | null = null; async function fetchAsset(url: URL, timeoutMs = 5000): Promise { let lastError: unknown; for (let attempt = 0; attempt < 2; attempt++) { try { const res = await fetch(url, { signal: AbortSignal.timeout(timeoutMs) }); if (!res.ok) throw new Error(`${url.pathname} ${res.status}`); const buf = await res.arrayBuffer(); if (buf.byteLength === 0) throw new Error(`${url.pathname} empty`); return buf; } catch (error) { lastError = error; } } throw lastError; } function loadFonts(baseUrl: string): Promise<[ArrayBuffer, ArrayBuffer]> { if (!fontsPromise) { fontsPromise = Promise.all([ fetchAsset(new URL("/fonts/Exposure-static.ttf", baseUrl)), fetchAsset(new URL("/fonts/OpenRunde-Medium.ttf", baseUrl)), ]).catch((error) => { fontsPromise = null; throw error; }); } return fontsPromise; } function loadFallbackBytes(baseUrl: string): Promise { if (!fallbackBytesPromise) { fallbackBytesPromise = fetchAsset(new URL("/og.jpg", baseUrl)).catch( (error) => { fallbackBytesPromise = null; throw error; }, ); } return fallbackBytesPromise; } async function serveFallback(baseUrl: string): Promise { try { const bytes = await loadFallbackBytes(baseUrl); return new Response(bytes, { status: 200, headers: { "content-type": "image/jpeg", "cache-control": OG_CACHE_CONTROL, }, }); } catch { return Response.redirect(new URL("/og.jpg", baseUrl).toString(), 302); } } export const Route = createFileRoute("/api/og")({ server: { handlers: { GET: async ({ request }) => { if (SITE_NAME === "Poke Site" || !SITE_NAME.trim()) { return serveFallback(request.url); } try { const [exposure, openRunde] = await loadFonts(request.url); const title = SITE_NAME.length > 50 ? `${SITE_NAME.slice(0, 47)}…` : SITE_NAME; // milesdobrenski 06/18/2026: override @vercel/og's default immutable 1y cache-control so // edited-and-redeployed sites never serve a stale preview (see OG_CACHE_CONTROL). return new ImageResponse(
30 ? 64 : 84, fontWeight: 400, color: OG_TEXT, lineHeight: 1.15, textAlign: "center", maxWidth: 900, }} > {title}
{SITE_TAGLINE ? (
{SITE_TAGLINE}
) : null}
, { width: 1200, height: 630, fonts: [ { name: "Exposure", data: exposure, style: "normal", weight: 500, }, { name: "OpenRunde", data: openRunde, style: "normal", weight: 500, }, ], headers: { "cache-control": OG_CACHE_CONTROL, }, }, ); } catch { return serveFallback(request.url); } }, }, }, }); ======================================================================== FILE: src/components/AliExpressPromo.tsx LANG: tsx ======================================================================== import { CircleAlert, ExternalLink, Radar, TriangleAlert } from "lucide-react"; import { ALI_KSA_PROMO } from "#/lib/aliPromo"; export function AliExpressPromo() { const s = ALI_KSA_PROMO; return (
{/* Honest status */}
{/* Official source + checked time */}

فحص: {s.checkedAt} · المصدر المعتمد: غير موصول

{s.providerNote}

{/* Non-copyable forecast */}

{s.forecasts.map((f) => (
{f.label} ({f.en}) → خصم ${f.discountUsd} {f.note} · لا يُنسخ
))}
); } ======================================================================== FILE: src/components/CopyCodeButton.tsx LANG: tsx ======================================================================== import { useRef, useState } from "react"; import { Check, Copy } from "lucide-react"; import { cn } from "#/lib/utils"; export async function copyToClipboard(text: string): Promise { try { if (navigator.clipboard && window.isSecureContext) { await navigator.clipboard.writeText(text); return true; } } catch { /* fall through to legacy path */ } try { const ta = document.createElement("textarea"); ta.value = text; ta.setAttribute("readonly", ""); ta.style.position = "fixed"; ta.style.opacity = "0"; document.body.appendChild(ta); ta.select(); const ok = document.execCommand("copy"); ta.remove(); return ok; } catch { return false; } } type CopyCodeProps = { code: string; compact?: boolean; ghost?: boolean; className?: string; }; export function CopyCodeButton({ code, compact, ghost, className, }: CopyCodeProps) { const [copied, setCopied] = useState(false); const [failed, setFailed] = useState(false); const timer = useRef(0); const onCopy = async () => { window.clearTimeout(timer.current); const ok = await copyToClipboard(code); if (ok) { setCopied(true); setFailed(false); timer.current = window.setTimeout(() => setCopied(false), 1600); } else { setFailed(true); timer.current = window.setTimeout(() => setFailed(false), 1600); } }; return ( ); } ======================================================================== FILE: src/components/CouponVault.tsx LANG: tsx ======================================================================== import { useState } from "react"; import { CircleAlert, ShieldCheck, Timer, Wallet } from "lucide-react"; import { cn } from "#/lib/utils"; import { COUPONS_BY_STORE, STORE_META, TRENDING_OFFERS, type Coupon, type CouponKind, type CouponStatus, type StoreKey, } from "#/lib/coupons"; import { CopyCodeButton } from "./CopyCodeButton"; import { AliExpressPromo } from "./AliExpressPromo"; const STORE_TABS: { key: StoreKey; label: string; en: string }[] = [ { key: "amazon", label: "أمازون السعودية", en: "Amazon.sa" }, { key: "aliexpress", label: "علي إكسبريس", en: "AliExpress" }, ]; const KIND_TAG: Record = { bank: "BANK OFFER", card: "CARD OFFER", 1111: "11.11 CODE", }; function StatusPillCoupon({ status }: { status: CouponStatus }) { if (status === "verified") { return ( ); } if (status === "unverified") { return ( ); } return ( ); } function CouponCard({ coupon }: { coupon: Coupon }) { return (

{coupon.discount}

{coupon.en}

{coupon.hasCode && coupon.code ? ( <> {coupon.code} ) : ( NO CODE - APPLIES AT CHECKOUT )}
الأهلية
{coupon.eligibility}
{coupon.note && (
ملاحظة
{coupon.note}
)} {coupon.validity && (
الصلاحية
{coupon.validity}
)} {coupon.exclusions && (
الاستثناءات
{coupon.exclusions}
)}
المصدر
{coupon.source}
); } function TrendingBar() { return (

[ 11.11 & CARD OFFERS ]

شريط العروض / Trending
{TRENDING_OFFERS.map((c) => (
{STORE_META[c.store].en} {KIND_TAG[c.kind]}

{c.discount}

{c.hasCode && c.code ? ( <> {c.code} ) : ( NO CODE - CHECKOUT )}
))}
); } export function CouponVault() { const [tab, setTab] = useState("amazon"); const active = COUPONS_BY_STORE[tab]; return (

[ COUPON VAULT ]

بنك الكوبونات

/ Coupon & Offer Vault

{STORE_TABS.map((t) => { const isActive = tab === t.key; return ( ); })}
{STORE_META[tab].hint} {tab === "aliexpress" ? "حالة الحملة" : `${active.length} عرض`}
{tab === "aliexpress" ? ( ) : (
{active.map((c) => ( ))}
)}
); } ======================================================================== FILE: src/components/CpuComparison.tsx LANG: tsx ======================================================================== import { useState } from "react"; import { ArrowDownWideNarrow, ArrowUpNarrowWide, CircleAlert, ExternalLink, Search, ShieldQuestion, } from "lucide-react"; import { cn } from "#/lib/utils"; import { CPU_CHECKED, CPU_NO_VERIFIED_AR, CPU_NO_VERIFIED_EN, CPU_WARRANTY_AR, CONDITIONS, buildAliSearch, buildAmazonSearch, conditionTerms, findVerified, pricedCpus, sortByPrice, type CpuVerifiedListing, } from "#/lib/verifiedCpus"; export function CpuComparison({ query }: { query: string }) { const model = query.trim().replace(/\s+/g, " "); const [dir, setDir] = useState<"asc" | "desc">("asc"); const verifiedAll = findVerified(model); const priced = pricedCpus(verifiedAll); const sorted = sortByPrice(verifiedAll, dir); const showSort = priced.length > 1; return (
[06 // CPU RETAIL PRICES] أسعار المعالجات / {model.toUpperCase()}
{showSort && (
{(["asc", "desc"] as const).map((d) => ( ))}
)} {/* Warranty / condition distinction */}
{/* Condition rows: boxed vs tray */}
{CONDITIONS.map((cond) => ( l.condition === cond.id)} modelTerms={model} /> ))}

فحص القوائم: {CPU_CHECKED} · لا تُعرض أي أسعار مخترَعة، ولا تُفترض التسعيرات المقترحة كعروض قائمة.

); } function ConditionCard({ condition, verified, modelTerms, }: { condition: { id: "boxed" | "tray"; label: string; en: string; note: string }; verified: CpuVerifiedListing[]; modelTerms: string; }) { const listing = verified[0]; const links = { amazon: buildAmazonSearch(conditionTerms(modelTerms, condition.id)), aliexpress: buildAliSearch(conditionTerms(modelTerms, condition.id)), }; return (

{condition.label}

{condition.en} - {condition.note}

{condition.id === "boxed" ? "تصنيف: تجزئة" : "تصنيف: خام/OEM"}
{listing && listing.price != null ? ( ) : (

{CPU_NO_VERIFIED_EN}

فتح بحث المتجر ({condition.label}):
)}
); } function VerifiedPrice({ listing }: { listing: CpuVerifiedListing }) { return (
السعر الحالي ({listing.retailer})

{(listing.price as number).toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 2, })}{" "} ر.س

فُحص {listing.checkedAt}
{(listing.stock || listing.delivery) && (

{listing.stock && المخزون: {listing.stock} · } {listing.delivery && التوصيل: {listing.delivery}}

)}
); } function StoreLink({ href, label }: { href: string; label: string }) { return ( ); } ======================================================================== FILE: src/components/PartnerComparison.tsx LANG: tsx ======================================================================== import { useState } from "react"; import { ArrowDownWideNarrow, ArrowUpNarrowWide, CircleAlert, ExternalLink, Store, Wallet, } from "lucide-react"; import { cn } from "#/lib/utils"; import { analyzePartner, buildPartnerLink, partnerVendors, sortEditions, type Edition, } from "#/lib/partners"; export function PartnerComparison({ query, intentId, }: { query: string; intentId: string; }) { const [vendor, setVendor] = useState("all"); const [dir, setDir] = useState<"asc" | "desc">("asc"); const data = analyzePartner(query, intentId); if (!data) return null; const vendors = partnerVendors(data.editions); const sorted = sortEditions(data.editions, dir, vendor); return (
[07 // PARTNER COMPARISON] مقارنة نسخ الشركات المصنعة / {data.model}
{/* Controls */}
{vendors.map((v) => ( ))}
{(["asc", "desc"] as const).map((d) => ( ))}
{/* Edition list */}
{sorted.map((e) => ( ))}

الترتيب حسب "رتبة تقديرية" بين الإصدارات (أساسها فئة المبرد/النسخة داخل العائلة) وليس سعراً مرصوداً. أي بيانات مواصفات (تردد Boost/مروحة) لن تُعرض إلا بدعم من مصدر بيانات.

); } function EditionRow({ edition }: { edition: Edition }) { const est = edition.price.estimate; const verifiedPrice = edition.price.live; const msrp = edition.price.msrp; return (
{est ? (est.maxRank - est.rank + 1) : "—"}

{edition.brand} {edition.edition}

{edition.tier}

{(edition.boostClock || edition.cooling) ? (

{edition.boostClock && Boost: {edition.boostClock} · } {edition.cooling && التبريد: {edition.cooling}}

) : (

المواصفات (تردد Boost / تبريد): غير مؤكدة من مصدر حي.

)} {/* explicit live / MSRP status, always shown so the distinction is visible */}

{verifiedPrice ? ( سعر حي متحقّق · {verifiedPrice.amount} {verifiedPrice.currency} · {verifiedPrice.source} · {verifiedPrice.updatedAt} ) : ( سعر حي: غير متصل / لا مصدر )} {msrp ? ( MSRP: {msrp.amount} {msrp.currency} · {msrp.source} ) : ( MSRP: غير موثَّق / لا مصدر )}

); } function EditionPrice({ edition }: { edition: Edition }) { const est = edition.price.estimate; return (
تقدير السعر {est ? ( ) : ( تقدير غير متاح )}
); } function LaunchBtn({ market, terms }: { market: "amazon" | "aliexpress"; terms: string }) { const url = buildPartnerLink(market, terms); return ( ); } ======================================================================== FILE: src/components/PriceComparison.tsx LANG: tsx ======================================================================== import { useMemo, useState } from "react"; import { ArrowDownWideNarrow, ArrowUpNarrowWide, CircleAlert, ExternalLink, Loader2, Radar, Search, Store, } from "lucide-react"; import { cn } from "#/lib/utils"; import { NO_VERIFIED_AR, NO_VERIFIED_EN, PARTNER_EDITIONS, REFERENCE_FAMILIES, buildModelLink, sortFamilies, } from "#/lib/referencePrices"; import { LOADING_AR, groupByBrand, sortItems, type LiveScanResult, } from "#/lib/livePricesShared"; import { queryLivePrices } from "#/lib/livePrices"; export type LiveFetcher = (q: string) => Promise; const USD = (n: number) => `$${n.toLocaleString("en-US")}`; function retailerLinks(query: string) { const q = encodeURIComponent(query.trim()); return { amazon: `https://www.amazon.sa/s?k=${q}`, aliexpress: `https://www.aliexpress.com/wholesale?SearchText=${q}`, }; } export function PriceComparison({ query, intentId, fetcher = queryLivePrices, }: { query: string; intentId: string; fetcher?: LiveFetcher; }) { const [loading, setLoading] = useState(false); const [live, setLive] = useState(null); const [liveNote, setLiveNote] = useState(null); const [dir, setDir] = useState<"asc" | "desc">("asc"); const [liveDir, setLiveDir] = useState<"asc" | "desc">("asc"); const isGpu = intentId === "gpu"; const families = useMemo( () => sortFamilies(REFERENCE_FAMILIES, dir), [dir], ); const links = useMemo(() => retailerLinks(query), [query]); const canScan = query.trim().length > 0; const onScan = async () => { if (!canScan || loading) return; setLoading(true); setLive(null); setLiveNote(null); try { const res = await fetcher(query); if (res.items.length > 0) { setLive(res); } else if (res.status === "no_provider") { setLiveNote( "لا يوجد مصدر أسعار حية مُعرّف بمفتاح موفر معتمد - تُعرض البيانات المرجعية وروابط المتجر (وليس سعراً مُخترَعاً).", ); } else { setLiveNote( "لم يرجع مصدر الأسعار الحية نتائج معتمدة حاليًا - تُعرض البيانات المرجعية وروابط المتجر.", ); } } finally { setLoading(false); } }; const liveGrouped = useMemo( () => groupByBrand(sortItems(live?.items ?? [], liveDir)), [live, liveDir], ); return (
[05 // PRICE COMPARISON] مقارنة الأسعار المرجعية {isGpu ? "/ GPU" : ""}
{/* Actions */}
{(["asc", "desc"] as const).map((d) => ( ))} فرز حسب MSRP
{loading && (
)} {liveNote && (

ملاحظة: {liveNote}

)} {/* Live items (only when a permitted source returned them) */} {live && live.items.length > 0 && (
نتائج حية من مصدر معتمد · فُحص {live.checkedAt}
{(["asc", "desc"] as const).map((d) => ( ))}
{liveGrouped.map((g) => (
[{g.brand}]
{g.items.map((it) => (

{it.title}

{it.seller && (

البائع: {it.seller}

)}
{it.price && ( {it.price.amount.toLocaleString()} {it.price.currency} )} {it.url && ( فتح )}
))}
))}
)} {/* Reference cards (GPU) or generic fallback */} {isGpu ? (
{families.map((f) => (
{f.model} {f.msrp ? ( MSRP: {USD(f.msrp.amount)} ) : ( لا يوجد سعر موثّق )}
النوع
MSRP عند الإطلاق (تاريخي - ليس سعر السوق الحالي)
العملة
USD سعر الإطلاق الأمريكي - دون تحويل موثوق
{f.msrp && (
المصدر
{f.msrp.source}
)}
السعر الحالي
{NO_VERIFIED_AR}
{/* AIB / partner editions */}
{PARTNER_EDITIONS.map((p) => { const terms = `${f.search} ${p.brand} ${p.edition}`; return (
{p.brand} {p.edition}
); })}
بحث الطراز:
))}
) : (

{NO_VERIFIED_AR}

{canScan && (
افتح بحث المتجر:
)}
)}
); } function MarketBtn({ market, terms }: { market: "amazon" | "aliexpress"; terms: string }) { const url = buildModelLink(market, terms); return ( ); } ======================================================================== FILE: src/components/VerifiedListings.tsx LANG: tsx ======================================================================== import { useState } from "react"; import { ArrowDownWideNarrow, ArrowUpNarrowWide, CircleAlert, ExternalLink, Search, Truck, } from "lucide-react"; import { cn } from "#/lib/utils"; import { VERIFIED_LISTINGS, formatSAR, outOfStockListings, sortByPrice, type VerifiedListing, } from "#/lib/verifiedListings"; const SNAPSHOT_AR = "لقطات أسعار موثّقة من قوائم Amazon.sa بتاريخ فحص 2026-10-29. الأسعار قابلة للتغيّر، والبيانات تُعرض كما رُصدت دون اعتبار أي سعر «متوسط سوق»."; const SNAPSHOT_EN = "Verified price snapshots from Amazon.sa listings, checked 2026-10-29. Prices change; shown as observed, never called a market average."; export function VerifiedListings() { const [dir, setDir] = useState<"asc" | "desc">("asc"); const priced = sortByPrice(VERIFIED_LISTINGS, dir); const unavailable = outOfStockListings(VERIFIED_LISTINGS); return (
[06 // VERIFIED AMAZON KSA LISTINGS] قوائم موثّقة بأسعار فعلية من Amazon.sa
{/* Priced, sorted numerically */}
بأسعار معلومة ({priced.length})
{(["asc", "desc"] as const).map((d) => ( ))}
{priced.map((l) => ( ))}
{/* Out of stock / unavailable - separate, no price, NOT sorted with prices */} {unavailable.length > 0 && (
غير متوفر حالياً (بدون سعر) - آخر فحص
{unavailable.map((l) => ( ))}
)}

ملاحظة: بعض نتائج البحث (مثل Acer Nitro RX 7800 XT بسعر شاذ منخفض، وعروض حرّاج المستعملة) لم تُعرض لأنها غير مؤكدة كقوائم متاجر جديدة.

); } function ListingRow({ listing }: { listing: VerifiedListing }) { return (

{listing.brand} {listing.model} {listing.variant}

Amazon.sa {listing.availability === "observed" && listing.caveat && ( {listing.caveat} )} {listing.rating != null && ( {listing.rating.toFixed(1)}★{listing.reviews != null ? ` (${listing.reviews})` : ""} )} {listing.stock && المخزون: {listing.stock}} {listing.delivery && {listing.delivery}} {listing.freeShipping && ( )}

فُحص {listing.checkedAt} · {listing.source}

{listing.price != null ? formatSAR(listing.price) : "—"} {listing.url && ( {listing.urlExact ? "القائمة" : "بحث أمازون"} )}
); } function UnavailableRow({ listing }: { listing: VerifiedListing }) { return (

{listing.brand}{" "} {listing.model} {listing.variant}

{listing.specs && (

{listing.specs.join(" · ")}

)}

فُحص {listing.checkedAt} · {listing.source}

{listing.url && ( )}
); } ======================================================================== FILE: src/lib/aliPromo.ts LANG: ts ======================================================================== export type AliForecast = { label: string; en: string; thresholdUsd: number; discountUsd: number; note: string; }; export type AliPromoState = { statusLabel: string; en: string; checkedAt: string; officialUrl: string; officialLabel: string; providerConnected: boolean; providerNote: string; forecastIntro: string; forecasts: AliForecast[]; }; /** * Honest AliExpress KSA 11.11 promo state. As of the checked date there is NO * official/current source confirming any Saudi 11.11 code as active. The USD * thresholds below are the user's PROPOSED forecast tiers for a future campaign * only - they are NOT confirmed, NOT copyable, and NOT presented as working. */ export const ALI_KSA_PROMO: AliPromoState = { statusLabel: "لم تُعلن / لم يتم التحقق من أكواد 11.11 للسعودية بعد (حتى تاريخ الفحص). لا تُعرض أكواد قديمة أو مكررة أو من دول أخرى ككواد سارية.", en: "No announced or verified KSA 11.11 codes yet (as of the checked date). Stale, duplicated, or non-KSA codes are not shown as active.", checkedAt: "2026-10-29", officialUrl: "https://www.aliexpress.com/", officialLabel: "صفحة علي إكسبريس الرسمية (اختر المنطقة السعودية)", providerConnected: false, providerNote: "تحديث الأكواد يتطلب مصدراً معتمداً (حملة رسمية/API أو تحقق من إتمام الدفع). خلية الأكواد الحية غير موصولة حالياً، لذا لا يُدَّعى رصد تلقائي.", forecastIntro: "إطار توقعي غير مؤكد (نطاقات إنفاق مقترحة لحملة مستقبلية) - عرض توعوي فقط، وليس كوداً سارياً ولا يُنسخ ولا يُعتد به كعرض. القيم بالدولار الإطارية دون تحويل موثوق للريال.", forecasts: [ { label: "إنفاق 39 دولار", en: "spend $39", thresholdUsd: 39, discountUsd: 5, note: "غير مؤكد / للتوقع فقط" }, { label: "إنفاق 79 دولار", en: "spend $79", thresholdUsd: 79, discountUsd: 10, note: "غير مؤكد / للتوقع فقط" }, { label: "إنفاق 119 دولار", en: "spend $119", thresholdUsd: 119, discountUsd: 15, note: "غير مؤكد / للتوقع فقط" }, { label: "إنفاق 229 دولار", en: "spend $229", thresholdUsd: 229, discountUsd: 30, note: "غير مؤكد / للتوقع فقط" }, { label: "إنفاق 349 دولار", en: "spend $349", thresholdUsd: 349, discountUsd: 50, note: "غير مؤكد / للتوقع فقط" }, ], }; ======================================================================== FILE: src/lib/coupons.ts LANG: ts ======================================================================== export type StoreKey = "amazon" | "aliexpress"; export type CouponKind = "bank" | "card" | "1111"; export type CouponStatus = "verified" | "unverified" | "sample"; export type Coupon = { id: string; store: StoreKey; kind: CouponKind; issuer: string; en: string; code?: string; // literal promo code (only present when hasCode is true) hasCode: boolean; discount: string; eligibility: string; validity?: string; exclusions?: string; /** Honesty note about how the offer applies (e.g. bank = at checkout, no code). */ note?: string; source: string; status: CouponStatus; verified: boolean; }; export const STORE_META: Record = { amazon: { label: "أمازون السعودية", en: "Amazon.sa", hint: "عروض البنوك عند الدفع" }, aliexpress: { label: "علي إكسبريس", en: "AliExpress", hint: "حالة حملة 11.11 (أكواد غير محققة)" }, }; export const COUPONS_BY_STORE: Record = { amazon: [ { id: "am-rajhi", store: "amazon", kind: "bank", issuer: "الراجحي / Al Rajhi", en: "Al Rajhi card offer at checkout", hasCode: false, discount: "خصم 20% لغاية 150 ر.س لبطاقة الراجحي الائتمانية", eligibility: "حامل بطاقة الراجحي الائتمانية", validity: "خلال حملة 11.11", note: "عرض يُفَعَّل تلقائياً من خيار الدفع على أمازون - لا يوجد كود لإدخاله.", source: "مثال - ليس من مصدر حي", status: "sample", verified: false, }, { id: "am-snb", store: "amazon", kind: "bank", issuer: "البنك الأهلي / SNB", en: "SNB card offer at checkout", hasCode: false, discount: "خصم 15% لغاية 100 ر.س لبطاقات سنب الائتمانية", eligibility: "بطاقات سنب الائتمانية", validity: "حتى نهاية فعالية 11.11", note: "عرض يُفَعَّل تلقائياً عند الدفع - لا يوجد كود لإدخاله.", source: "مثال - ليس من مصدر حي", status: "sample", verified: false, }, { id: "am-alinma", store: "amazon", kind: "bank", issuer: "مصرف الإنماء / Alinma", en: "Alinma card offer at checkout", hasCode: false, discount: "خصم 10% لبطاقة الإنماء الائتمانية على طلبات مختارة", eligibility: "حامل بطاقة الإنماء الائتمانية", validity: "خلال حملة 11.11", note: "عرض يُفَعَّل تلقائياً عند الدفع - لا يوجد كود لإدخاله.", source: "مثال - ليس من مصدر حي", status: "sample", verified: false, }, { id: "am-qitaf", store: "amazon", kind: "card", issuer: "قيتاف / Qitaf", en: "Qitaf rewards at checkout", hasCode: false, discount: "إمكانية استخدام نقاط قيتاف للخصم أو استرداد عند الدفع", eligibility: "حساب قيتاف مفعّل مع بطاقة مؤهلة", validity: "حسب العروض الحالية", note: "يُستخدم من خانة قيتاف أثناء الدفع - لا يوجد كود لإدخاله.", source: "مثال - ليس من مصدر حي", status: "sample", verified: false, }, ], // AliExpress: NO fabricated codes. KSA 11.11 codes are not confirmed/verified, // so the store exposes zero copyable codes. See src/lib/aliPromo.ts for the // honest campaign status + non-copyable forecast and the dedicated UI. aliexpress: [], }; export const ALL_COUPONS: Coupon[] = [ ...COUPONS_BY_STORE.amazon, ...COUPONS_BY_STORE.aliexpress, ]; export const TRENDING_OFFERS: Coupon[] = [ COUPONS_BY_STORE.amazon[0], COUPONS_BY_STORE.amazon[1], COUPONS_BY_STORE.amazon[3], COUPONS_BY_STORE.amazon[2], ]; ======================================================================== FILE: src/lib/launcher.ts LANG: ts ======================================================================== export type Marketplace = "amazon" | "aliexpress" | "both"; export type MarketKey = "amazon" | "aliexpress"; export type SortId = "price-asc" | "price-desc" | "rating" | "orders"; export type ProductIntent = { id: string; label: string; en: string; positive: string[]; negative: string[]; }; export const MARKETPLACE_OPTIONS: { value: Marketplace; label: string; en: string; }[] = [ { value: "amazon", label: "أمازون السعودية", en: "Amazon.sa" }, { value: "aliexpress", label: "علي إكسبريس", en: "AliExpress" }, { value: "both", label: "الاثنان معاً", en: "Amazon + AliExpress" }, ]; export const MARKET_META: Record = { amazon: { label: "أمازون السعودية", en: "Amazon.sa" }, aliexpress: { label: "علي إكسبريس", en: "AliExpress" }, }; // Filters that the destination search URL can actually encode. A marketplace // with no value for a given filter simply does not offer it (never claimed). export const SORT_OPTIONS: { id: SortId; label: string; en: string; amazon?: string; aliexpress?: string; }[] = [ { id: "price-asc", label: "السعر: من الأقل للأعلى", en: "Price: low to high", amazon: "s=price-asc-rank", aliexpress: "SortType=priceAsc", }, { id: "price-desc", label: "السعر: من الأعلى للأقل", en: "Price: high to low", amazon: "s=price-desc-rank", aliexpress: "SortType=priceDesc", }, { id: "rating", label: "الأعلى تقييماً", en: "Highest rating", amazon: "s=review-rank", aliexpress: undefined, }, { id: "orders", label: "الأكثر طلباً", en: "Most ordered", amazon: undefined, aliexpress: "SortType=salesDesc", }, ]; const DEFAULT_ACCESSORY_NEGATIVES = [ "cable", "cables", "cover", "adapter", "adapters", "keychain", "keychains", "sticker", "stickers", "bracket", ]; const INTENTS: ProductIntent[] = [ { id: "motherboard", label: "لوحة أم", en: "Motherboard", positive: ["Motherboard", "AMD AM5", "Socket AM5"], negative: [...DEFAULT_ACCESSORY_NEGATIVES, "stand", "screw", "riser", "frame"], }, { id: "cpu", label: "معالج", en: "CPU", positive: ["CPU", "Processor", "Desktop"], negative: [...DEFAULT_ACCESSORY_NEGATIVES, "cooler", "case", "tray", "holder"], }, { id: "ram", label: "ذاكرة RAM", en: "RAM", positive: ["DDR5", "RAM", "Memory", "Desktop"], negative: [...DEFAULT_ACCESSORY_NEGATIVES, "cooler", "case", "heatspreader", "rgb"], }, { id: "cooler", label: "مبرد معالج", en: "CPU Cooler", positive: ["CPU Cooler", "Air Cooler"], negative: [...DEFAULT_ACCESSORY_NEGATIVES, "liquid", "pump", "water block", "mount"], }, { id: "psu", label: "مزود طاقة", en: "PSU", positive: ["Power Supply", "PSU"], negative: [...DEFAULT_ACCESSORY_NEGATIVES, "sleeve", "extension", "tester", "mount"], }, { id: "gpu", label: "كرت شاشة", en: "Graphics Card", positive: ["Graphics Card", "GPU"], negative: [...DEFAULT_ACCESSORY_NEGATIVES, "riser", "vertical mount", "backplate", "miner"], }, { id: "ssd", label: "قرص تخزين", en: "SSD / NVMe", positive: ["NVMe", "SSD", "M.2"], negative: [...DEFAULT_ACCESSORY_NEGATIVES, "enclosure", "usb", "external", "caddy"], }, { id: "phone", label: "هاتف / جوال", en: "Phone", positive: [], negative: [ "case", "cover", "tempered glass", "screen protector", "film", "cable", "cables", "charger", "charging cable", "stand", "pop socket", "keychain", ], }, { id: "laptop", label: "لابتوب", en: "Laptop", positive: ["Laptop"], negative: [ "case", "sleeve", "bag", "cover", "stand", "battery", "charging cable", "adapter", "screen protector", ], }, { id: "generic", label: "عام", en: "Generic", positive: [], negative: DEFAULT_ACCESSORY_NEGATIVES, }, ]; function detectByRegex(query: string): ProductIntent | null { const q = ` ${query.toLowerCase()} `; // Unicode-aware word boundaries (ASCI \b does not work around Arabic chars). const L = "(? new RegExp(`${L}(${body})${R}`, ""); const rules: [RegExp, string][] = [ [rx("rtx ?\\d+|rtx|rx ?\\d+|gpu|graphics card|كرت شاشة|بطاقة رسومات"), "gpu"], [rx("b\\d{3,4}|x\\d{2,3}e?|am5|mobo|motherboard|ماذربورد|لوحة أم|لوحة ام|بورد"), "motherboard"], [ rx( "ryzen|[0-9]+x3d|core i\\d+|intel core|cpu|processor|معالج|7(?:6|7|8)00x?|5[67]00x?|9(?:6|7|9)00x?", ), "cpu", ], [rx("ddr5|ddr4|hynix|trident|ram|ذاكرة|تخزين وصول"), "ram"], [rx("ps120|peerless assassin|pa120|thermalright|aio|air cooler|مبرد|برج تبريد"), "cooler"], [rx("psu|power supply|مزود طاقة|titan|seasonic|corsair rmx|rm\\d+x"), "psu"], [rx("nvme|ssd|\\d+tb|\\d+gb|تخزين|قرص صلب"), "ssd"], [ rx( "iphone|أيفون|ايفون|samsung galaxy|سامسونج|s[0-9]{2}|redmi|xiaomi|poco|realme|honor|phone|جوال|هاتف|موبايل", ), "phone", ], [rx("laptop|notebook|لابتوب|لابتوبات"), "laptop"], ]; for (const [re, id] of rules) { if (re.test(q)) { return INTENTS.find((i) => i.id === id) ?? null; } } return null; } export function detectIntent(query: string): ProductIntent { const trimmed = query.trim(); if (!trimmed) return INTENTS.find((i) => i.id === "generic")!; return detectByRegex(trimmed) ?? INTENTS.find((i) => i.id === "generic")!; } export function buildPositiveTerms(query: string, intent: ProductIntent): string[] { const base = query .trim() .split(/\s+/) .filter((t) => t.length > 0); const seen = new Set(); const out: string[] = []; for (const term of [...base, ...intent.positive]) { const key = term.toLowerCase(); if (seen.has(key)) continue; seen.add(key); out.push(term); } return out; } export type LaunchUrl = { url: string; applied: string | null; primeNote?: boolean; }; export function buildLaunchUrl( market: MarketKey, positive: string[], // already encoded terms (safe: encode at build) negative: string[], sortId: SortId, ): LaunchUrl { const encode = encodeURIComponent(positive.join(" ")); const sort = SORT_OPTIONS.find((s) => s.id === sortId); const sortParam = sort ? sort[market] : undefined; if (market === "amazon") { const base = `https://www.amazon.sa/s?k=${encode}`; return { url: sortParam ? `${base}&${sortParam}` : base, applied: sortParam ? (sort ? sort.label : null) : null, primeNote: true, // Prime cannot be encoded in the URL; must be toggled in store UI. }; } const base = `https://www.aliexpress.com/wholesale?SearchText=${encode}`; return { url: sortParam ? `${base}&${sortParam}` : base, applied: sortParam ? (sort ? sort.label : null) : null, }; } export type LauncherPlan = { intent: ProductIntent; positive: string[]; negative: string[]; launches: { key: MarketKey; url: string; applied: string | null; primeNote?: boolean }[]; }; export function planLauncher( query: string, market: Marketplace, sortId: SortId | null, ): LauncherPlan { const intent = detectIntent(query); const positive = buildPositiveTerms(query, intent); const keys: MarketKey[] = market === "both" ? ["amazon", "aliexpress"] : [market]; const launches = keys.map((key) => { const u = buildLaunchUrl(key, positive, intent.negative, sortId ?? "price-asc"); return { key, url: u.url, applied: u.applied, primeNote: u.primeNote }; }); return { intent, positive, negative: intent.negative, launches }; } export const BUILD_PRESETS: { id: string; label: string; en: string; query: string }[] = [ { id: "cpu", label: "Ryzen 7 9800X3D", en: "CPU", query: "Ryzen 7 9800X3D" }, { id: "mobo", label: "Gigabyte B650 Eagle AX", en: "Motherboard", query: "Gigabyte B650 Eagle AX" }, { id: "ram", label: "32GB Hynix A-die 6000MHz CL30", en: "RAM", query: "32GB Hynix A-die 6000MHz CL30" }, { id: "cooler", label: "Thermalright PS120 / PA120SE", en: "Cooler", query: "Thermalright Peerless Assassin 120 SE" }, { id: "psu", label: "Lian Li / Majesty Titan PSU", en: "PSU", query: "Lian Li PSU" }, { id: "ssd", label: "1TB / 2TB NVMe", en: "SSD", query: "2TB NVMe M.2 SSD" }, ]; ======================================================================== FILE: src/lib/livePrices.ts LANG: ts ======================================================================== import { createServerFn } from "@tanstack/react-start"; import { providerConfigured, NO_PROVIDER_AR, NO_PROVIDER_EN } from "./livePricesShared"; import type { LiveScanResult } from "./livePricesShared"; /** * Queries an authorized retailer price provider. Credentials are read ONLY on * the server (never sent to the browser). If no authorized provider/key is * configured, we return a transparent "no provider" result and NEVER fabricate * listings or pretend live scanning succeeded. */ export const queryLivePrices = createServerFn({ method: "POST", }) .validator((d: { query: string; market: string }) => d) .handler(async ({ data }): Promise => { const provider = process.env.PRICE_PROVIDER; const key = process.env.PRICE_PROVIDER_KEY; const checkedAt = new Date().toISOString(); if (!providerConfigured(provider, key)) { return { ok: false, status: "no_provider", items: [], checkedAt, message: { code: "no_provider", ar: NO_PROVIDER_AR, en: NO_PROVIDER_EN, }, }; } // A working, permitted integration would live here. Because no authorized // source is integrated, we return an honest error instead of mock data. return { ok: false, status: "error", items: [], checkedAt, message: { code: "error", ar: "موفّر الأسعار الموجود في بيئة التشغيل غير مدعوم في هذه النسخة، لذا لا تُعرض بيانات مُنشأة ولا أسعار مزيّفة.", en: "The configured provider is not an integrated, permitted source in this build; no data is fabricated or shown.", }, }; }); ======================================================================== FILE: src/lib/livePricesShared.ts LANG: ts ======================================================================== export type Market = "amazon" | "aliexpress"; export type LiveItem = { id: string; title: string; market: Market; price: { amount: number; currency: string } | null; seller?: string; rating?: number; reviews?: number; delivery?: string; checkedAt: string; url?: string; brand?: string; }; export type LiveScanStatus = "ok" | "no_provider" | "error" | "empty"; export type LiveScanResult = { ok: boolean; status: LiveScanStatus; items: LiveItem[]; checkedAt: string; message: ProviderMessage; }; export type ProviderMessage = { code: "loading" | "no_provider" | "error" | "empty" | "ok"; ar: string; en: string; }; export const LOADING_AR = "جاري رصد وفحص الأسعار الحية من المتاجر..."; export const LOADING_EN = "Scanning live retailer prices..."; export const NO_PROVIDER_AR = "لا يمكن عرض أسعار حية حالياً: ميزة رصد الأسعار تتطلب مفتاح موفر/API معتمد (مثل Amazon PA-API أو مزود أسعار مرخّص) بأهلية صحيحة. لم يُربط أي مصدر، لذا لا تُعرض أسعار مخترَعة أو مقدَّرة كأنها حقيقية. استخدم أزرار البحث أدناه للاطلاع على الأسعار الرسمية في المتاجر."; export const NO_PROVIDER_EN = "No real prices can be shown: live price scanning needs an authorized provider/API key (e.g. Amazon PA-API or a licensed price source). No source is connected, so no fabricated or estimated prices are presented as real. Use the store search links below for official prices."; export function providerConfigured( provider?: string, key?: string, ): boolean { return Boolean(provider && key && provider.length > 0 && key.length > 0); } export function groupByBrand( items: LiveItem[], ): { brand: string; items: LiveItem[] }[] { const map = new Map(); for (const it of items) { const brand = it.brand && it.brand.trim() ? it.brand.trim() : "غير مصنف"; const arr = map.get(brand) ?? []; arr.push(it); map.set(brand, arr); } return Array.from(map.entries()).map(([brand, its]) => ({ brand, items: its })); } export function sortItems(items: LiveItem[], dir: "asc" | "desc"): LiveItem[] { const withPrice = items.filter((i) => i.price && i.price.amount != null); const noPrice = items.filter((i) => !(i.price && i.price.amount != null)); const sorted = [...withPrice].sort((a, b) => { const d = a.price!.amount - b.price!.amount; return dir === "asc" ? d : -d; }); return [...sorted, ...noPrice]; } ======================================================================== FILE: src/lib/partners.ts LANG: ts ======================================================================== export type PriceKind = "live" | "estimate" | "msrp" | "none"; export type LivePrice = { amount: string; currency: string; source: string; updatedAt: string; }; export type Estimate = { band: string; basis: string; rank: number; maxRank: number; }; export type EditionPrice = { kind: PriceKind; live?: LivePrice; // source-verified, only ever set from a real feed/API estimate?: Estimate; // clearly labeled target/estimate, never an observed price msrp?: { amount: string; currency: string; source: string }; // official launch MSRP, only when sourced }; export type Edition = { id: string; brand: string; edition: string; tier: string; // qualitative build/cooler tier (structural identity, not a measured spec) linkTerms: string; /** Populated only when a real data source supports it; otherwise undefined. */ boostClock?: string; cooling?: string; price: EditionPrice; verified: boolean; // true ONLY when price.kind === "live" }; export type VendorEditionTemplate = { brand: string; editions: { edition: string; tier: string; tierKey: "basic" | "mid" | "premium" }[]; }; const TIER_BAND: Record<"basic" | "mid" | "premium", { band: string; rank: number }> = { basic: { band: "فئة الدخول (مبرد هواء أساسي)", rank: 1 }, mid: { band: "فئة متوسطة (مبرد هواء أكبر)", rank: 2 }, premium: { band: "فئة متميزة (مبرد هواء/سائل)", rank: 3 }, }; const GPU_PARTNERS: VendorEditionTemplate[] = [ { brand: "ASUS", editions: [ { edition: "TUF Gaming", tier: "مبرد هواء كبير", tierKey: "mid" }, { edition: "ROG Strix", tier: "مبرد هواء متميز", tierKey: "premium" }, { edition: "Prime", tier: "مبرد هواء أساسي", tierKey: "basic" }, ], }, { brand: "ASRock", editions: [ { edition: "Phantom Gaming", tier: "مبرد هواء متميز", tierKey: "premium" }, { edition: "Steel Legend", tier: "مبرد هواء كبير", tierKey: "mid" }, { edition: "Challenger", tier: "مبرد هواء أساسي", tierKey: "basic" }, ], }, { brand: "XFX", editions: [ { edition: "Speedster MERC", tier: "مبرد هواء متميز", tierKey: "premium" }, { edition: "Speedster QICK", tier: "مبرد هواء كبير", tierKey: "mid" }, { edition: "Speedster SWFT", tier: "مبرد هواء أساسي", tierKey: "basic" }, ], }, { brand: "Sapphire", editions: [ { edition: "Nitro+", tier: "مبرد هواء متميز", tierKey: "premium" }, { edition: "Pure", tier: "مبرد هواء كبير", tierKey: "mid" }, { edition: "Pulse", tier: "مبرد هواء أساسي", tierKey: "basic" }, ], }, { brand: "Gigabyte", editions: [ { edition: "Gaming OC", tier: "مبرد هواء متميز", tierKey: "premium" }, { edition: "Windforce", tier: "مبرد هواء كبير", tierKey: "mid" }, { edition: "Eagle", tier: "مبرد هواء أساسي", tierKey: "basic" }, ], }, ]; const CPU_EDITIONS: { edition: string; tier: string; tierKey: "basic" | "mid" }[] = [ { edition: "Boxed (تجزئة)", tier: "نسخة التجزئة الصندوقية", tierKey: "mid" }, { edition: "OEM / Tray (خام)", tier: "نسخة خام بدون علبة تبريد", tierKey: "basic" }, ]; const ESTIMATE_BASIS = "تقدير هرمي حسب فئة المبرد/النسخة داخل العائلة وليس سعراً مرصوداً ولا MSP موثقاً"; function estimateFor(tierKey: "basic" | "mid" | "premium", maxRank: number): Estimate { const base = TIER_BAND[tierKey]; return { band: base.band, basis: ESTIMATE_BASIS, rank: base.rank, maxRank }; } function normalizeModel(query: string): string { return query.trim().replace(/\s+/g, " ").toUpperCase(); } export function buildPartnerLink(market: "amazon" | "aliexpress", terms: string): string { const encoded = encodeURIComponent(terms); return market === "amazon" ? `https://www.amazon.sa/s?k=${encoded}` : `https://www.aliexpress.com/wholesale?SearchText=${encoded}`; } export function analyzePartner( query: string, intentId: string, ): { isCpu: boolean; model: string; modelTerms: string; editions: Edition[]; note: string } | null { if (intentId !== "gpu" && intentId !== "cpu") return null; if (!query.trim()) return null; const isCpu = intentId === "cpu"; const modelTerms = query.trim().replace(/\s+/g, " "); const model = normalizeModel(query); const editions: Edition[] = []; if (isCpu) { for (const ed of CPU_EDITIONS) { const maxRank = 2; editions.push({ id: `cpu-${ed.edition}`, brand: "AMD", edition: ed.edition, tier: ed.tier, linkTerms: `${modelTerms} ${ed.edition}`, price: { kind: "estimate", estimate: estimateFor(ed.tierKey, maxRank) }, verified: false, }); } } else { for (const vendor of GPU_PARTNERS) { for (const ed of vendor.editions) { editions.push({ id: `${vendor.brand}-${ed.edition}`, brand: vendor.brand, edition: ed.edition, tier: ed.tier, linkTerms: `${modelTerms} ${vendor.brand} ${ed.edition}`, price: { kind: "estimate", estimate: estimateFor(ed.tierKey, 3) }, verified: false, }); } } } return { isCpu, model, modelTerms, editions, note: isCpu ? "نسخ المعالج: التجزئة (Boxed) مقابل الخام (OEM/Tray)." : "نسخ المصنعين (AIB): توزيع كل شريك على إصداراته من الشركة المصنعة فقط.", }; } export function sortEditions( editions: Edition[], dir: "asc" | "desc", vendor: string, ): Edition[] { const filtered = vendor === "all" ? editions : editions.filter((e) => e.brand === vendor); const rank = (e: Edition): number => e.price.estimate?.rank ?? 0; return [...filtered].sort((a, b) => (dir === "asc" ? rank(a) - rank(b) : rank(b) - rank(a))); } export function partnerVendors(editions: Edition[]): string[] { return Array.from(new Set(editions.map((e) => e.brand))); } ======================================================================== FILE: src/lib/referencePrices.ts LANG: ts ======================================================================== export type Provenance = | "verified_live" // only ever set from a working, permitted live source | "historical_msrp" // documented official launch MSRP | "estimate" // clearly labeled, defensible estimate/range | "none"; // no verified price available export type MsrpReference = { amount: number; currency: "USD"; // kept in USD; no reliable SAR conversion asserted label: string; source: string; provenance: "historical_msrp"; }; export type RefFamily = { id: string; model: string; search: string; // canonical search terms (model) msrp?: MsrpReference; // undefined => "no verified price available" }; // Official US launch MSRPs (widely documented AMD / NVIDIA launch prices). // These are HISTORICAL references, explicitly NOT current market prices. const MSRP_SOURCE = "سعر الإطلاق الأمريكي الرسمي الموثق (AMD/NVIDIA) - مرجع تاريخي وليس سعر السوق الحالي"; const msrp = (amount: number, label: string): MsrpReference => ({ amount, currency: "USD", label, source: MSRP_SOURCE, provenance: "historical_msrp", }); export const REFERENCE_FAMILIES: RefFamily[] = [ { id: "rx6800xt", model: "RX 6800 XT", search: "RX 6800 XT", msrp: msrp(649, "RX 6800 XT") }, { id: "rx7800xt", model: "RX 7800 XT", search: "RX 7800 XT", msrp: msrp(499, "RX 7800 XT") }, { id: "rx7900xt", model: "RX 7900 XT", search: "RX 7900 XT", msrp: msrp(899, "RX 7900 XT") }, { id: "rx7900xtx", model: "RX 7900 XTX", search: "RX 7900 XTX", msrp: msrp(999, "RX 7900 XTX") }, { id: "rtx4070super", model: "RTX 4070 SUPER", search: "RTX 4070 Super", msrp: msrp(599, "RTX 4070 SUPER") }, { id: "rtx4070tisuper", model: "RTX 4070 Ti SUPER", search: "RTX 4070 Ti Super", msrp: msrp(799, "RTX 4070 Ti SUPER") }, { id: "rtx4080super", model: "RTX 4080 SUPER", search: "RTX 4080 Super", msrp: msrp(999, "RTX 4080 SUPER") }, { id: "rtx4090", model: "RTX 4090", search: "RTX 4090", msrp: msrp(1599, "RTX 4090") }, ]; /** AIB / board-partner editions shown per GPU family (real product lines, for search/linking). */ export const PARTNER_EDITIONS: { brand: string; edition: string }[] = [ { brand: "ASUS", edition: "TUF Gaming" }, { brand: "ASRock", edition: "Steel Legend" }, { brand: "XFX", edition: "Speedster QICK" }, { brand: "XFX", edition: "Speedster MERC" }, { brand: "Sapphire", edition: "Nitro+" }, { brand: "Gigabyte", edition: "Gaming OC" }, ]; export const NO_VERIFIED_AR = "لا يوجد سعر موثّق متاح: بيانات السوق الحالية لا تصل عبر مصدر معتمد. استخدم روابط البحث أدناه لسعر المتجر الرسمي."; export const NO_VERIFIED_EN = "No verified price available: current market data is not reached through an authorized source. Use the search links below for the store's official price."; export function sortFamilies(families: RefFamily[], dir: "asc" | "desc"): RefFamily[] { const withMsrp = families.filter((f) => f.msrp); const noMsrp = families.filter((f) => !f.msrp); const sorted = [...withMsrp].sort((a, b) => { const d = a.msrp!.amount - b.msrp!.amount; return dir === "asc" ? d : -d; }); return [...sorted, ...noMsrp]; } export function buildModelLink(market: "amazon" | "aliexpress", terms: string): string { const encoded = encodeURIComponent(terms); return market === "amazon" ? `https://www.amazon.sa/s?k=${encoded}` : `https://www.aliexpress.com/wholesale?SearchText=${encoded}`; } ======================================================================== FILE: src/lib/utils.ts LANG: ts ======================================================================== export function cn( ...classes: Array ): string { return classes.filter(Boolean).join(" "); } ======================================================================== FILE: src/lib/verifiedCpus.ts LANG: ts ======================================================================== export type CpuCondition = "boxed" | "tray"; export type CpuVerifiedListing = { id: string; model: string; condition: CpuCondition; price: number | null; // null => no verified price (none are confirmed in this run) currency: "SAR"; retailer: string; boxed: boolean; // true = retail boxed; false = OEM/Tray url: string; urlExact: boolean; stock?: string; delivery?: string; checkedAt: string; source: string; }; export const CPU_CHECKED = "2026-10-29"; export const CPU_NO_VERIFIED_AR = "السعر الحالي غير متاح من مصدر موثوق: لم تُعِد حسابات القوائم برقم سعر مؤكد لهذا المعالج في الفحص الحالي."; export const CPU_NO_VERIFIED_EN = "Current price unavailable from a reliable source: this run did not return a confirmed price for this CPU."; export const CPU_WARRANTY_AR = "النسخة الصندوقية (Boxed) قد تحمل ضمان البائع/الوكيل؛ النسخة الخام (OEM/Tray) عادةً بدون تغليف المستهلك وقد لا تحمل نفس الضمان - لا يُفترض التكافؤ."; export const CONDITIONS: { id: CpuCondition; label: string; en: string; note: string }[] = [ { id: "boxed", label: "Boxed / تجزئة", en: "Boxed retail", note: "نسخة التجزئة الصندوقية بتغليف رسمي للمستهلك.", }, { id: "tray", label: "OEM / Tray (خام)", en: "OEM / Tray", note: "نسخة خام/علبة خشب بدون تغليف المستهلك.", }, ]; // No confirmed current SAR price for the named CPUs was found in this run, so // VERIFIED_CPUS intentionally holds zero entries. We never invent prices here. export const VERIFIED_CPUS: CpuVerifiedListing[] = []; export function buildAmazonSearch(terms: string): string { return `https://www.amazon.sa/s?k=${encodeURIComponent(terms)}`; } export function buildAliSearch(terms: string): string { return `https://www.aliexpress.com/wholesale?SearchText=${encodeURIComponent(terms)}`; } export function conditionTerms(model: string, condition: CpuCondition): string { return condition === "boxed" ? `${model} Boxed` : `${model} OEM Tray`; } export function findVerified(model: string): CpuVerifiedListing[] { const n = model.trim().toLowerCase().replace(/\s+/g, ""); return VERIFIED_CPUS.filter((c) => c.model.toLowerCase().replace(/\s+/g, "").includes(n), ); } export function pricedCpus(listings: CpuVerifiedListing[]): CpuVerifiedListing[] { return listings.filter((l) => l.price != null); } export function sortByPrice( listings: CpuVerifiedListing[], dir: "asc" | "desc", ): CpuVerifiedListing[] { const priced = pricedCpus(listings); return [...priced].sort((a, b) => { const d = (a.price as number) - (b.price as number); return dir === "asc" ? d : -d; }); } ======================================================================== FILE: src/lib/verifiedListings.ts LANG: ts ======================================================================== export type ListingAvailability = "in_stock" | "out_of_stock" | "observed"; export type VerifiedListing = { id: string; model: string; brand: string; variant: string; price: number | null; // null => no verified price (e.g. out of stock). Never fabricated. currency: "SAR"; retailer: string; availability: ListingAvailability; url: string; urlExact: boolean; // true = validated exact product URL; false = retailer search link (observed) freeShipping?: boolean; stock?: string; delivery?: string; rating?: number; reviews?: number; specs?: string[]; caveat?: string; // e.g. single observed listing, not market average source: string; checkedAt: string; }; const CHECKED = "2026-10-29"; function amazonSearch(terms: string): string { return `https://www.amazon.sa/s?k=${encodeURIComponent(terms)}`; } // Verified, confirmed current in-stock listings from Amazon.sa (checked 2026-10-29). const IN_STOCK: VerifiedListing[] = [ { id: "sapphire-7900xt", model: "RX 7900 XT", brand: "Sapphire", variant: "21323-01-20G AMD Radeon RX 7900 XT 20GB GDDR6", price: 4145.61, currency: "SAR", retailer: "Amazon.sa", availability: "in_stock", url: "https://www.amazon.sa/-/en/Sapphire-21323-01-20G-Radeon-Graphics/dp/B0BQNCSW3X", urlExact: true, freeShipping: true, rating: 4.4, reviews: 64, source: "Amazon.sa قائمة موثقة (نفس صفحة المنتج)", checkedAt: CHECKED, }, { id: "asrock-9070xt-steellegend", model: "RX 9070 XT", brand: "ASRock", variant: "Steel Legend 16GB", price: 4449.95, currency: "SAR", retailer: "Amazon.sa", availability: "in_stock", url: amazonSearch("ASRock RX 9070 XT Steel Legend 16GB"), urlExact: false, freeShipping: true, stock: "2 متبقي", delivery: "توصيل السبت 31 أكتوبر", rating: 4.6, reviews: 469, source: "رصد قائمة Amazon.sa عبر بحث (لا يوجد رابط مباشر موثق)", checkedAt: CHECKED, }, { id: "asus-9070xt-prime", model: "RX 9070 XT", brand: "ASUS", variant: "Prime Radeon RX 9070 XT White OC", price: 4642.0, currency: "SAR", retailer: "Amazon.sa", availability: "in_stock", url: amazonSearch("ASUS Prime Radeon RX 9070 XT White OC"), urlExact: false, freeShipping: true, stock: "3 متبقي", rating: 4.6, reviews: 68, source: "رصد قائمة Amazon.sa عبر بحث (لا يوجد رابط مباشر موثق)", checkedAt: CHECKED, }, { id: "powercolor-9070xt-hellhound", model: "RX 9070 XT", brand: "PowerColor", variant: "Hellhound Reva", price: 4436.61, currency: "SAR", retailer: "Amazon.sa", availability: "in_stock", url: amazonSearch("PowerColor Hellhound RX 9070 XT"), urlExact: false, freeShipping: true, stock: "3 متبقي", delivery: "توصيل 8-10 نوفمبر", rating: 4.6, reviews: 30, source: "رصد قائمة Amazon.sa عبر بحث (لا يوجد رابط مباشر موثق)", checkedAt: CHECKED, }, { id: "gigabyte-9060xt-ice", model: "RX 9060 XT", brand: "Gigabyte", variant: "Gaming OC Ice 16GB", price: 3618.8, currency: "SAR", retailer: "Amazon.sa", availability: "in_stock", url: amazonSearch("Gigabyte RX 9060 XT Gaming OC Ice 16GB"), urlExact: false, freeShipping: true, delivery: "يُشحن خلال 13-14 يوم", rating: 4.6, reviews: 150, source: "رصد قائمة Amazon.sa عبر بحث (لا يوجد رابط مباشر موثق)", checkedAt: CHECKED, }, ]; // A single observed listing price - NOT a market average. const OBSERVED: VerifiedListing[] = [ { id: "powercolor-7900xtx-hellhound", model: "RX 7900 XTX", brand: "PowerColor", variant: "Hellhound", price: 9172.51, currency: "SAR", retailer: "Amazon.sa", availability: "observed", url: amazonSearch("PowerColor Hellhound RX 7900 XTX"), urlExact: false, caveat: "رصد قائمة واحدة فقط - وليس متوسط السوق", source: "رصد قائمة Amazon.sa (سعر مرتفع لقائمة واحدة)", checkedAt: CHECKED, }, ]; // Out of stock / unavailable - kept separate, NO price, not sorted with prices. const OUT_OF_STOCK: VerifiedListing[] = [ { id: "asrock-7900xt-phantom-white", model: "RX 7900 XT", brand: "ASRock", variant: "Phantom Gaming White 20GB OC", price: null, currency: "SAR", retailer: "Amazon.sa", availability: "out_of_stock", url: "https://www.amazon.sa/-/en/Asrock-Radeon-Phantom-Gaming-White/dp/B0CST1D8CD", urlExact: true, rating: 4.3, reviews: 72, specs: ["Boost 2.45GHz", "3 مراوح", "2x8-pin"], source: "Amazon.sa قائمة موثقة (غير متوفر حالياً)", checkedAt: CHECKED, }, ]; export const VERIFIED_LISTINGS: VerifiedListing[] = [ ...IN_STOCK, ...OBSERVED, ...OUT_OF_STOCK, ]; /** Only listings that actually have a price (in-stock + single observed). */ export function pricedListings(listings: VerifiedListing[]): VerifiedListing[] { return listings.filter((l) => l.price != null); } export function outOfStockListings(listings: VerifiedListing[]): VerifiedListing[] { return listings.filter((l) => l.availability === "out_of_stock"); } /** Numeric sort over known prices only; null-price listings are never included. */ export function sortByPrice( listings: VerifiedListing[], dir: "asc" | "desc", ): VerifiedListing[] { const priced = pricedListings(listings); return [...priced].sort((a, b) => { const d = (a.price as number) - (b.price as number); return dir === "asc" ? d : -d; }); } export function formatSAR(amount: number): string { return `${amount.toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 2, })} ر.س`; } ======================================================================== FILE: src/styles.css LANG: css ======================================================================== @import "./poke-defaults.css"; @import "tailwindcss"; * { box-sizing: border-box; } html, body, #app { min-height: 100%; } body { margin: 0; } /* Poke page anchor — keep LAST in this file so it wins over the token block above. */ :root, .dark { --background: var(--surface); --foreground: var(--ink); } /* ===== Cyberpunk tactical substrate (single-page tool: forced dark) ===== */ :root { color-scheme: dark; --surface: #0B0D10; --ink: #EAEAEA; --muted: #9AA0A6; --line: rgba(234, 234, 234, 0.16); --background: #0B0D10; --foreground: #EAEAEA; } html { background: #0A0A0A; } body { background: #0A0A0A; color: var(--ink); } /* CRT scanlines for telemetry panels */ .scanlines { background-image: repeating-linear-gradient( 0deg, transparent, transparent 2px, rgba(0, 0, 0, 0.22) 2px, rgba(0, 0, 0, 0.22) 4px ); } /* Hairline technical frame used for section compartments */ .crt-frame { border: 1px solid rgba(234, 234, 234, 0.18); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02); } @media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } } ======================================================================== FILE: src/poke-defaults.css LANG: css ======================================================================== /* Poke default style: Exposure display + OpenRunde text + Poke backgrounds. Keep this file. */ @font-face { font-family: "Exposure"; src: url("/fonts/Exposure-205TF-VAR.woff2") format("woff2"); font-style: normal; } @font-face { font-family: "Exposure"; src: url("/fonts/Exposure-205TF-VAR-Italic.woff2") format("woff2"); font-style: italic; } @font-face { font-family: "OpenRunde"; src: url("/fonts/OpenRunde-Regular.woff2") format("woff2"); font-weight: 400; } @font-face { font-family: "OpenRunde"; src: url("/fonts/OpenRunde-Medium.woff2") format("woff2"); font-weight: 500; } @font-face { font-family: "JetBrains Mono"; src: url("/fonts/JetBrainsMono-Variable.woff2") format("woff2"); font-weight: 100 800; } :root { color-scheme: light dark; --surface: #FFFDFA; --ink: #171717; --muted: #737373; --line: rgba(23, 23, 23, 0.14); --accent: #3b6ea5; } .dark { --surface: #0E0E11; --ink: #f5f5f5; --muted: #9a9a9a; --line: rgba(255, 255, 255, 0.16); --accent: #7aa7d6; } @media (prefers-color-scheme: dark) { :root:not(.light) { --surface: #0E0E11; --ink: #f5f5f5; --muted: #9a9a9a; --line: rgba(255, 255, 255, 0.16); --accent: #7aa7d6; } } /* Type scale + font families — use these instead of ad-hoc text-[..px]/font-[..] values. */ @theme { --font-sans: "OpenRunde", system-ui, sans-serif; --font-mono: "JetBrains Mono", ui-monospace, monospace; --text-eyebrow: 13px; --text-eyebrow--line-height: 1.5; --text-meta: 12px; --text-meta--line-height: 1.2; --text-label: 15px; --text-label--line-height: 1.2; --text-body: 15px; --text-body--line-height: 1.6; --text-heading: 18px; --text-heading--line-height: 1.4; --text-name: 24px; --text-name--line-height: 1.3; } html { font-family: "OpenRunde", system-ui, sans-serif; background: var(--surface); color: var(--ink); overscroll-behavior: none; } h1 { font-family: "Exposure", "OpenRunde", sans-serif; font-weight: 500; font-variation-settings: "EXPO" -10; line-height: 1.2; text-wrap: pretty; } h2, h3 { font-family: "OpenRunde", system-ui, sans-serif; font-weight: 500; line-height: 1.3; text-wrap: pretty; } /* Display face for non-heading display text (stat numbers, pull quotes). Use only at >= 24px / text-name. */ .font-display { font-family: "Exposure", "OpenRunde", sans-serif; font-weight: 500; font-variation-settings: "EXPO" -10; } h4, h5, h6 { font-family: "OpenRunde", system-ui, sans-serif; font-weight: 500; text-wrap: pretty; } a[href], button:not(:disabled), [role="button"]:not(:disabled), [role="link"], label[for], select:not(:disabled), summary { cursor: pointer; } code, pre, kbd, samp { font-family: "JetBrains Mono", ui-monospace, monospace; } ======================================================================== FILE: src/router.tsx LANG: tsx ======================================================================== import { createRouter as createTanStackRouter } from "@tanstack/react-router"; import { routeTree } from "./routeTree.gen"; export function getRouter() { const router = createTanStackRouter({ routeTree, scrollRestoration: true, defaultPreload: "intent", defaultPreloadStaleTime: 0, }); return router; } declare module "@tanstack/react-router" { interface Register { router: ReturnType; } }