1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,10289,27612,e=>{"use strict";var t=e.i(75254);let s=(0,t.default)("bug",[["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z",key:"uouzyp"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M21 21a4 4 0 0 0-3.81-4",key:"1b0z45"}],["path",{d:"M21 5a4 4 0 0 1-3.55 3.97",key:"5cxbf6"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M3 21a4 4 0 0 1 3.81-4",key:"1fjd4g"}],["path",{d:"M3 5a4 4 0 0 0 3.55 3.97",key:"1d7oge"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M9 7.13V6a3 3 0 1 1 6 0v1.13",key:"1vgav8"}]]);e.s(["Bug",()=>s],10289);let a=(0,t.default)("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);e.s(["Trash2",()=>a],27612)},15837,e=>{"use strict";var t=e.i(47167),s=e.i(43476),a=e.i(71645),r=e.i(74080),n=e.i(57688),l=e.i(18566),i=e.i(55436),o=e.i(37727),d=e.i(12696),c=e.i(90261),x=e.i(30647),u=e.i(62998),m=e.i(86104),h=e.i(34124),p=e.i(57237),b=e.i(51987),g=e.i(55035),f=e.i(49865),j=e.i(39661),w=e.i(40681),v=e.i(49120),N=e.i(74539);let y=(0,e.i(75254).default)("settings",[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);var k=e.i(64659),C=e.i(55900),S=e.i(10289),P=e.i(83086),z=e.i(27612),M=e.i(43531),O=e.i(31278),$=e.i(75299),A=e.i(22146);function E(){let e=(0,l.useRouter)(),t=(0,l.usePathname)(),n=(0,l.useSearchParams)(),[i,d]=(0,a.useState)(!1),c=(0,a.useRef)(null),[x,u]=(0,a.useState)(null),[m,h]=(0,a.useState)("idle"),[p,b]=(0,a.useState)(null),{enabled:g,setEnabled:f,aiSearchEnabled:j,setAiSearchEnabled:w,aiSearchCacheEnabled:v,setAiSearchCacheEnabled:N,mismatches:E}=(0,$.useDebugSafe)(),T=n.get("debug");(0,a.useEffect)(()=>{f("true"===T)},[T,f]);let L=n.get("aiSearch");(0,a.useEffect)(()=>{w("false"!==L)},[L,w]);let R=n.get("aiSearchCache");(0,a.useEffect)(()=>{N("false"!==R)},[R,N]),(0,a.useLayoutEffect)(()=>{if(!i||!c.current)return;let e=()=>{let e=c.current.getBoundingClientRect();u({top:e.bottom+8,right:window.innerWidth-e.right})};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[i]),(0,a.useEffect)(()=>{if(!i)return;let e=()=>d(!1);return window.addEventListener("scroll",e,!0),()=>window.removeEventListener("scroll",e,!0)},[i]);let I=n.get("region")||"GB",B="false"!==n.get("hideNoPrices"),D="false"!==n.get("dedupe"),F=(0,a.useCallback)(s=>{let a=new URLSearchParams(n.toString());Object.entries(s).forEach(([e,t])=>{null===t||""===t?a.delete(e):a.set(e,t)}),e.push(`${t}?${a.toString()}`)},[e,n,t]),U=async()=>{h("pending"),b(null);try{let e=await fetch(`${(0,A.getBrowserShopBasePath)()}/api/dev/clear-cache`,{method:"POST"}),t=await e.json().catch(()=>({}));if(!e.ok)throw Error(t?.error??`Request failed (${e.status})`);h("done")}catch(e){h("error"),b(e instanceof Error?e.message:"Failed to clear cache")}finally{setTimeout(()=>h("idle"),4e3)}};return(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsxs)("button",{ref:c,onClick:()=>d(!i),className:"flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium text-slate-600 bg-amber-50 border border-amber-200 rounded-lg hover:bg-amber-100 transition-colors",children:[(0,s.jsx)(y,{size:14,className:"text-amber-600"}),(0,s.jsx)("span",{className:"hidden sm:inline",children:"Dev Toggles"}),i?(0,s.jsx)(C.ChevronUp,{size:14}):(0,s.jsx)(k.ChevronDown,{size:14})]}),i&&x&&"undefined"!=typeof document&&(0,r.createPortal)((0,s.jsxs)("div",{className:"fixed w-64 bg-white border border-slate-200 rounded-lg shadow-lg z-[70] p-4",style:{to
1p:x.top,right:x.right},children:[(0,s.jsxs)("div",{className:"text-xs font-bold text-amber-600 uppercase tracking-wide mb-3 flex items-center gap-1.5",children:[(0,s.jsx)(y,{size:12}),"Developer Toggles"]}),(0,s.jsxs)("div",{className:"mb-4",children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-slate-500 mb-2",children:"Region Filter"}),(0,s.jsx)("div",{className:"flex flex-wrap gap-1",children:["ALL","US","GB","AU"].map(e=>(0,s.jsx)("button",{onClick:()=>{F({region:"GB"===e?null:e,territory:null})},className:`px-2.5 py-1 text-xs font-medium rounded transition-all ${I===e?"bg-radar-blue text-white":"bg-slate-100 text-slate-600 hover:bg-slate-200"}`,children:"ALL"===e?"All":"GB"===e?"ð¬ð§ UK":"US"===e?"ðºð¸ US":"ð¦ðº AUS"},e))})]}),(0,s.jsx)("div",{children:(0,s.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer",children:[(0,s.jsx)("input",{type:"checkbox",checked:B,onChange:()=>{F({hideNoPrices:B?"false":null})},className:"w-4 h-4 rounded border-slate-300 text-radar-blue focus:ring-radar-blue"}),(0,s.jsx)("span",{className:"text-xs font-medium text-slate-600",children:"Hide products without prices"})]})}),(0,s.jsxs)("div",{className:"mt-4",children:[(0,s.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer",children:[(0,s.jsx)("input",{type:"checkbox",checked:j,onChange:e=>{let t=e.target.checked;w(t),F({aiSearch:t?null:"false"})},className:"w-4 h-4 rounded border-slate-300 text-violet-500 focus:ring-violet-500"}),(0,s.jsxs)("span",{className:"text-xs font-medium text-slate-600 flex items-center gap-1.5",children:[(0,s.jsx)(P.Sparkles,{size:12,className:"text-violet-500"}),"AI search"]})]}),(0,s.jsx)("p",{className:"text-[10px] text-slate-400 mt-1.5 ml-6",children:"Off = standard search (no AI recommendations)"})]}),(0,s.jsxs)("div",{className:"mt-4",children:[(0,s.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer",children:[(0,s.jsx)("input",{type:"checkbox",checked:v,onChange:e=>{let t=e.target.checked;N(t),F({aiSearchCache:t?null:"false"})},className:"w-4 h-4 rounded border-slate-300 text-violet-500 focus:ring-violet-500"}),(0,s.jsx)("span",{className:"text-xs font-medium text-slate-600",children:"AI search cache"})]}),(0,s.jsx)("p",{className:"text-[10px] text-slate-400 mt-1.5 ml-6",children:"Off = always call Product Service/Hawk/OpenAI fresh (no read or write)"})]}),(0,s.jsxs)("div",{className:"mt-4",children:[(0,s.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer",children:[(0,s.jsx)("input",{type:"checkbox",checked:D,onChange:e=>{F({dedupe:e.target.checked?null:"false"})},className:"w-4 h-4 rounded border-slate-300 text-radar-blue focus:ring-radar-blue"}),(0,s.jsx)("span",{className:"text-xs font-medium text-slate-600",children:"Deduplication"})]}),(0,s.jsx)("p",{className:"text-[10px] text-slate-400 mt-1.5 ml-6",children:"Off = show all Product Service rows unmerged"})]}),(0,s.jsxs)("div",{className:"mt-4 pt-3 border-t border-slate-100",children:[(0,s.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer",children:[(0,s.jsx)("input",{type:"checkbox",checked:g,onChange:e=>{f(e.target.checked),F({debug:e.target.checked?"true":null})},className:"w-4 h-4 rounded border-slate-300 text-orange-500 focus:ring-orange-500"}),(0,s.jsxs)("span",{className:"text-xs font-medium text-slate-600 flex items-center gap-1.5",children:[(0,s.jsx)(S.Bug,{size:12,className:"text-orange-500"}),"API Debug Panel",E.length>0&&(0,s.jsx)("span",{className:"bg-orange-500 text-white text-[10px] font-bold px-1.5 py-0.5 rounded-full",children:E.length})]})]}),g&&(0,s.jsx)("p",{className:"text-[10px] text-slate-400 mt-1.5 ml-6",children:"Shows API calls, responses & mismatches"})]}),(0,s.jsxs)("div",{className:"mt-4 pt-3 border-t border-slate-100",children:[(0,s.jsxs)("button",{onClick:U,disabled:"pending"===m,className:"w-full flex items-center justify-center gap-1.5 px-2.5 py-1.5 text-xs font-medium rounded transition-colors bg-red-50 text-red-600 border border-red-200 hover:bg-red-100 disabled:opacity-60 disabled:cursor-not-allowed",children:["pending"===m?(0,s.jsx)(O.Loader2,{size:12,className:"animate-spin"}):"done"===m?(0,s.jsx)(M.Check,{size:12}):"error"===m?(0,s.jsx)(o.X,{size:12}):(0,s.jsx)(z.Trash2,{size:12}),"pending"===m?"Clearingâ¦":"done"===m?"Cache cleared":"error"===m?"Failed to clear":"Clear all cache"]}),"error"===m&&p&&(0,s.jsx)("p",{className:"text-[10px] text-red-500 mt-1.5",children:p}),(0,s.jsx)("p",{className:"text-[10px] text-slate-400 mt-1.5",children:"Flushes category listings, Hawk pricing & AI search caches â next request everywhere starts cold"})]}),(0,s.jsx)("div",{className:"mt-4 pt-3 border-t border-slate-100",children:(0,s.jsxs)("div",{className:"text-[10px] text-slate-400 font-mono",children:["region: ",I," | hideNoPrices: ",B?"true":"false"," | dedupe: ",D?"on":"off"," | aiSearch: ",j?"on":"off"," | aiSearchCache: ",v?"on":"off"," | debug: ",g?"on":"off"]})})]}),document.body)]})}var T=e.i(56918),L=e.i(81859);let R={fontFamily:"var(--font-brand-sans), ui-sans-serif, sans-serif"},I="transition-all hover:underline hover:decoration-2 hover:underline-offset-4";function B(e){return e.filter(e=>"utility"!==e.slot)}function D(e){var t;(0,T.trackElementInteraction)({id:(t=e.label,`nav-${t.toLowerCase().replace(/\s+/g,"-")}`),name:e.label,label:"Nav Link",url:e.href})}function F({isOpen:e}){return(0,s.jsxs)("div",{className:`brand-mobile-nav-burger-icon flex h-5 w-5 flex-col items-center justify-center transition-transform duration-200 ${e?"rotate-90":""}`,children:[(0,s.jsx)("span",{className:"brand-mobile-nav-burger-line block w-5 bg-current"}),(0,s.jsx)("span",{className:"brand-mobile-nav-burger-line block w-5 bg-current"}),(0,s.jsx)("span",{className:"brand-mobile-nav-burger-line block w-5 bg-current"})]})}function U({isOpen:e,onNavigate:t}){let{brand:a}=(0,d.useBrand)();return e?(0,s.jsx)("div",{className:"brand-mobile-nav-dropdown [@media(min-width:1200px)]:hidden",style:R,children:(0,s.jsx)("nav",{className:"brand-mobile-nav text-[15px] font-semibold",children:(0,s.jsxs)("ul",{className:"flex flex-col",children:[(0,s.jsx)("li",{children:(0,s.jsx)("a",{href:a.homeUrl,className:"brand-mobile-nav-home flex items-center px-4 py-3",onClick:t,children:(0,s.jsx)(L.default,{className:"h-[18px] w-[18px] text-current"})})}),a.navItems.map(e=>(0,s.jsx)("li",{children:(0,s.jsxs)("a",{href:e.href,className:function(e){switch(e.variant){case"savings-squad":return"flex items-center justify-center bg-accent-green px-4 py-3 text-[rgb(10,10,10)]";case"forums":return"flex items-center justify-center bg-[rgb(140,43,94)] px-4 py-3";default:return"brand-mobile-nav-link flex items-center justify-between px-4 py-3"}}(e),onClick:()=>{D(e),t()},children:[e.label,!e.variant&&(0,s.jsx)(k.ChevronDown,{className:"brand-mobile-nav-chevron h-4 w-4 -rotate-90"})]})},e.label))]})})}):null}function q({items:e}){return 0===e.length?null:(0,s.jsx)("nav",{className:"brand-header-utility-nav hidden items-center [@media(min-width:1200px)]:flex",style:R,"aria-label":"Utility navigation",children:(0,s.jsx)("ul",{className:"flex items-center",children:e.map(e=>(0,s.jsx)("li",{children:(0,s.jsx)("a",{href:e.href,className:"brand-header-utility-link whitespace-nowrap",onClick:()=>D(e),children:e.label})},e.label))})})}function _({isOpen:e,onToggle:t,label:a}){let r=!!a;return(0,s.jsxs)("button",{type:"button",onClick:()=>{(0,T.trackElementInteraction)({id:"nav-burger",name:e?"Close menu":"Open menu",label:"Nav Menu"}),t()},className:`brand-mobile-nav-burger [@media(min-width:1200px)]:hidden shrink-0 ${r?"brand-mobile-nav-burger-with-label":"rounded p-1"}`,"aria-label":e?"Close menu":"Open menu","aria-expanded":e,children:[(0,s.jsx)(F,{isOpen:e}),r&&(0,s.jsx)("span",{className:"brand-mobile-nav-burger-label",children:a})]})}function G({items:e,placement:t="bar",showHomeLink:a=!0}){let{brand:r}=(0,d.useBrand)(),n=e??B(r.navItems),l="header"===t;return(0,s.jsx)("nav",{className:l?"brand-header-nav hidden h-full min-w-0 flex-1 text-[15px] font-semibold tracking-normal [@media(min-width:1200px)]:block":"brand-nav hidden h-[44px] text-[15px] font-semibold tracking-normal [@media(min-width:1200px)]:block",style:R,"aria-label":"Primary navigation",children:(0,s.jsx)("div",{className:l?"flex h-full w-full min-w-0 justify-center":"mx-auto flex h-full w-full max-w-[1116px] justify-start",children:(0,s.jsxs)("ul",{className:l?"flex h-full min-w-0 items-center justify-center":"-ml-[11.2px] flex h-full items-center",children:[a&&(0,s.jsx)("li",{className:"h-full",children:(0,s.jsx)("a",{href:r.homeUrl,className:l?`brand-header-nav-link flex h-full items-center justify-center ${I}`:`brand-nav-link flex h-full items-center justify-center px-[11.2px] ${I} hover:decoration-white`,"aria-label":"home",children:(0,s.jsx)(L.default,{className:"h-[18px] w-[18px] text-current"})})}),n.map(e=>(0,s.jsx)("li",{className:`h-full${"savings-squad"===e.variant?" ml-8":""}`,children:(0,s.jsx)("a",{href:e.href,className:function(e,t){let s="header"===t?`brand-header-nav-link flex h-full items-center whitespace-nowrap ${I}
1`:`flex h-full items-center whitespace-nowrap px-[11.2px] ${I}`;switch(e.variant){case"savings-squad":return`${s} bg-accent-green text-[rgb(10,10,10)] hover:decoration-[rgb(10,10,10)]`;case"forums":return`${s} bg-[rgb(140,43,94)] hover:decoration-white`;default:return"header"===t?s:`${s} brand-nav-link hover:decoration-white`}}(e,t),onClick:()=>D(e),children:e.label})},e.label))]})})})}function V(){return(0,s.jsx)(G,{})}let H=g.PRODUCT_FINDER_SEARCH_PROMPTS.filter(e=>["Best value TV","Best TV for sports","Gaming portable laptop","Gaming desktop","Budget value earbuds","Streaming VPN"].includes(e.label));function J({showDevTools:e,initialHeaderLandingOptions:g=null}={}){let{brand:y,assetPath:k,landingBasePath:C}=(0,d.useBrand)(),S=(0,l.useRouter)(),P=(0,l.usePathname)(),z=(0,c.useCategoryDefinition)(),M=e??"true"===t.default.env.NEXT_PUBLIC_SHOW_DEV_TOOLS,[O,$]=(0,a.useState)(!1),[A,T]=(0,a.useState)(!1),[L,R]=(0,a.useState)(!0),[I,D]=(0,a.useState)(!1),[F,Y]=(0,a.useState)(""),[K,X]=(0,a.useState)(null),[W,Z]=(0,a.useState)(null),[Q,ee]=(0,a.useTransition)(),et=(0,a.useMemo)(()=>(0,h.applyBrandToLandingOptions)((0,h.buildRegisteredLandingCategoryDropdownOptions)(),y),[y]),[es,ea]=(0,a.useState)(g),[er,en]=(0,a.useState)(g?y.id:null),el=z.siteCategoryLabel||z.displayNamePlural||"Car insurance",ei=y.header?.layout??"stacked",eo="single-row"===ei,ed=y.header?.signInVariant??"button",ec=y.header?.showHomeLinkInDesktopNav??!0,ex=y.header?.showDesktopNavBar??!0,eu=y.header?.mobileMenuPosition??"start",em=y.header?.mobileMenuLabel,eh=B(y.navItems),ep=y.navItems.filter(e=>"utility"===e.slot),eb=k(y.logos.onDarkSrc??y.logos.defaultSrc),eg=P===C||P.startsWith(`${C}/`),ef=!y.logos.onDarkSrc||y.logos.onDarkSrc===y.logos.defaultSrc,ej=(0,a.useRef)(0),ew=(0,a.useRef)(null),ev=(0,a.useRef)(0),eN=(0,a.useRef)(!1),ey=(0,a.useRef)(null),ek=(0,a.useRef)(null),eC=er===y.id&&null!==es?es:et,eS=(0,a.useMemo)(()=>(0,h.getLinkableLandingCategoryCandidates)(eC),[eC]),eP=(0,a.useMemo)(()=>(0,p.buildViewAllCategoryGroups)(eC,b.STATIC_CATEGORY_IMAGES,v.default),[eC]),ez=eg&&I,eM=(0,a.useCallback)(()=>{$(e=>!e)},[]),eO=(0,a.useCallback)(()=>{$(!1)},[]),e$=(0,a.useCallback)(()=>{T(!1),X(null),Z(null)},[]),eA=(0,a.useCallback)(()=>{T(!0),X(null)},[]),eE=(0,a.useCallback)(()=>{null!==ey.current&&(window.clearTimeout(ey.current),ey.current=null)},[]),eT=(0,a.useCallback)(()=>{eE(),ey.current=window.setTimeout(()=>{eN.current&&R(!1)},6e3)},[eE]),eL=(0,a.useCallback)(()=>{let e=(0,j.sanitiseString)(F).trim();if(X(null),!e)return;if(e.length<3)return void X("Enter at least 3 characters to search.");let t=(0,f.matchLandingCategoryReference)(e,eS),s=t?`${t.basePath}?q=${encodeURIComponent(e)}`:`${C}?q=${encodeURIComponent(e)}`;ee(()=>{e$(),S.push(s)})},[e$,eS,F,C,S]),eR=(0,a.useCallback)(e=>{var t,s;let a,r;Y(e.query),X(null),Z(e.shortLabel??e.label);let n=`${(t=y.shopBasePath,s=e.urlPath,a=t.replace(/\/+$/,"")||"/",!(r=s.replace(/^\/+|\/+$/g,""))?a:`${"/"===a?"":a}/${r}`)}?q=${encodeURIComponent(e.query)}`;ee(()=>{e$(),S.push(n)})},[y.shopBasePath,e$,S]),eI=(0,s.jsx)(_,{isOpen:O,onToggle:eM,label:em});return(0,a.useEffect)(()=>{if(!A)return;let e=document.body.style.overflow;document.body.style.overflow="hidden";let t=window.requestAnimationFrame(()=>{ek.current?.focus()});return()=>{document.body.style.overflow=e,window.cancelAnimationFrame(t)}},[A]),(0,a.useEffect)(()=>{if(!eg){let e=window.requestAnimationFrame(()=>{D(!1),R(!0),eN.current=!1,ew.current=null,ev.current=0,eE()});return()=>{window.cancelAnimationFrame(e)}}let e=null,t=0,s=0,a=0,r=e=>{if(!eN.current){eE(),R(!0),ej.current=e,ew.current=null,ev.current=e;return}let t=ej.current,s=e>t?"down":e<t?"up":null;s&&s!==ew.current&&(ew.current=s,ev.current=e);let a=e-ev.current;R(t=>e<=8||O||A?(eE(),!0):"up"===ew.current&&a<=-12?(eT(),!0):"down"===ew.current&&a>=24?(eE(),!1):t),ej.current=e,"down"===ew.current&&a>=24&&(ev.current=e),"up"===ew.current&&a<=-12&&(ev.current=e)},n=()=>{0===a&&(a=window.requestAnimationFrame(()=>{a=0,r(window.scrollY)}))},l=()=>{let a=document.getElementById("product-finder-search");if(!a){if(D(!1),R(!0),s>=120){eN.current=!0,D(!0),r(window.scrollY);return}s+=1,t=window.requestAnimationFrame(l);return}(e=new IntersectionObserver(([e])=>{let t=e.boundingClientRect.bottom<=0||window.scrollY>8&&eN.current;eN.current=t,D(e=>e===t?e:t),r(window.scrollY)},{threshold:0})).observe(a);let n=a.getBoundingClientRect().bottom<=0||window.scrollY>8;eN.current=n,D(n),r(window.scrollY)};return ej.current=window.scrollY,ew.current=null,ev.current=window.scrollY,t=window.requestAnimationFrame(l),window.addEventListener("scroll",n,{passive:!0}),()=>{eE(),e&&e.disconnect(),window.removeEventListener("scroll",n),window.cancelAnimationFrame(t),window.cancelAnimationFrame(a)}},[eE,eg,O,P,A,eT]),(0,a.useEffect)(()=>
1{if(er===y.id)return;let e=!1;return(async()=>{let t=await (0,w.listCategoryTags)("tomsguide");e||(t.length>0&&ea((0,h.applyBrandToLandingOptions)((0,h.buildLandingCategoryDropdownOptionsFromTags)(t),y)),en(y.id))})(),()=>{e=!0}},[y,er]),(0,s.jsxs)("header",{className:"brand-header sticky top-0 z-50 w-full text-foreground","data-header-layout":ei,children:[(0,s.jsxs)("div",{className:`overflow-hidden transition-[opacity,transform] duration-250 ease-in-out will-change-[opacity,transform] ${L?"translate-y-0 opacity-100":"pointer-events-none max-h-0 -translate-y-1 opacity-0"}`,children:[(0,s.jsx)("div",{className:"brand-header-border",children:(0,s.jsxs)("div",{className:"brand-header-inner mx-auto max-w-[1116px] px-4 sm:px-6 lg:px-8",children:[(0,s.jsxs)("div",{className:eo?"flex min-w-0 items-center gap-3":"flex min-w-0 flex-1 items-center gap-3",children:["start"===eu&&eI,(0,s.jsxs)("a",{href:y.homeUrl,className:"brand-header-logo-link",children:[(0,s.jsx)(N.default,{className:"brand-header-logo-img",showStrapline:!0}),(0,s.jsx)("h1",{className:"brand-header-heading brand-heading min-w-0 truncate text-base font-bold leading-none text-[var(--brand-text-primary)] sm:text-lg",children:el})]})]}),eo&&(0,s.jsx)(G,{items:eh,placement:"header",showHomeLink:ec}),(0,s.jsxs)("div",{className:"brand-header-actions flex items-center gap-3",children:[eo&&(0,s.jsx)(q,{items:ep}),y.showSignInButton&&y.signInUrl&&(0,s.jsxs)("a",{href:y.signInUrl,className:`brand-header-signin brand-header-signin-${ed}`,"aria-label":"Sign in",children:[(0,s.jsx)("span",{className:"brand-header-signin-icon","aria-hidden":!0,children:(0,s.jsxs)("svg",{className:"h-4 w-4",viewBox:"0 0 120 120",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:[(0,s.jsx)("g",{clipPath:"url(#signin-icon-clip)",children:(0,s.jsx)("path",{d:"M0 120c0-33.137 26.863-60 60-60s60 26.863 60 60M60 0C45.088 0 33 12.088 33 27s12.088 27 27 27 27-12.088 27-27S74.912 0 60 0Z"})}),(0,s.jsx)("defs",{children:(0,s.jsx)("clipPath",{id:"signin-icon-clip",children:(0,s.jsx)("rect",{width:"120",height:"120"})})})]})}),(0,s.jsx)("span",{children:"Sign In"})]}),M&&(0,s.jsx)(a.Suspense,{fallback:(0,s.jsx)("div",{className:"h-8 w-24 animate-pulse rounded-lg bg-amber-50"}),children:(0,s.jsx)(E,{})}),"end"===eu&&eI]})]})}),(0,s.jsx)(U,{isOpen:O,onNavigate:eO}),!eo&&ex&&(0,s.jsx)(V,{})]}),eg?(0,s.jsx)("div",{className:`overflow-hidden bg-[var(--brand-primary)] text-white shadow-[0_8px_24px_rgba(15,23,42,0.18)] transition-[opacity,transform] duration-250 ease-in-out ${ez?"max-h-[59px] translate-y-0 opacity-100":"pointer-events-none max-h-0 -translate-y-1 opacity-0"}`,children:(0,s.jsxs)("div",{role:"button",tabIndex:0,onClick:eA,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),eA())},className:"brand-product-finder-trigger relative mx-auto flex h-[59px] w-full max-w-[1116px] items-center px-4 text-left sm:px-6 lg:px-8","aria-haspopup":"dialog","aria-expanded":A,"aria-label":`Open ${y.productFinderName} menu`,children:[(0,s.jsxs)("span",{className:"brand-product-finder-branding flex min-w-0 gap-2 text-white",children:[(0,s.jsx)(n.default,{src:eb,alt:y.displayName,width:121,height:20,className:`brand-product-finder-logo h-5 w-auto shrink-0 ${ef?"brightness-0 invert":""}`,unoptimized:!0}),(0,s.jsx)("span",{className:"brand-product-finder-title brand-product-finder-title-bar truncate font-bold",children:y.productFinderName})]}),(0,s.jsxs)("div",{className:"hidden h-full items-center text-sm font-medium [@media(min-width:1200px)]:flex",children:[(0,s.jsx)("span",{className:"flex h-full items-center px-4 text-white/95 transition-colors hover:text-white",children:"Categories"}),(0,s.jsx)("span",{className:"h-8 w-px bg-white/35","aria-hidden":!0}),(0,s.jsxs)("span",{className:"flex h-full items-center gap-2 px-4 text-white/95 transition-colors hover:text-white",children:[(0,s.jsx)(i.Search,{className:"h-4 w-4"}),"Search"]})]}),(0,s.jsx)("span",{className:"absolute right-4 top-1/2 flex h-10 w-10 -translate-y-1/2 items-center justify-center rounded-md text-white transition-colors hover:bg-white/10 sm:right-6 [@media(min-width:1200px)]:hidden","aria-label":"Search Product Finder",children:(0,s.jsx)(i.Search,{className:"h-6 w-6"})})]})}):null,A&&"undefined"!=typeof document?(0,r.createPortal)((0,s.jsx)("div",{className:"fixed inset-0 z-[70] overflow-y-auto bg-[var(--brand-primary)] text-white",children:(0,s.jsxs)("div",{className:"min-h-full px-4 pb-8 pt-4 sm:px-6 lg:px-8",children:[(0,s.jsxs)("div",{className:"mx-auto mb-5 flex max-w-[1280px] items-center justify-between gap-4",children:[(0,s.jsxs)("div",{className:"brand-product-finder-branding flex min-w-0 gap-3",children:[(0,s.jsx)(n.default,{src:eb,alt:y.displayName,width:121,height:20,className:`brand-product-finder-logo h-5 w-auto shrink-0 ${ef?"brightness-0 invert":""}`,unoptimized:!0}),(0,s.jsx)("span",{className:"brand-product-finder-title brand-product-finder-title-popup truncate font-semibold",children:y.productFinderName})]}),(0,s.jsx)("button",{type:"button",onClick:e$,className:"flex h-10 w-10 items-center justify-center rounded-md text-white/90 transition-colors hover:bg-white/10 hover:text-white","aria-label":"Close Product Finder menu",children:(0,s.jsx)(o.X,{className:"h-6 w-6"})})]}),(0,s.jsxs)("div",{className:"mx-auto max-w-[1280px]",children:[(0,s.jsx)(u.default,{value:F,onChange:e=>{Y(e),X(null)},onSubmit:eL,onClear:()=>{Y(""),X(null)},placeholder:"Search TVs, computing, gaming, wellness, laptops, peripherals, GPUs, and more.",ariaLabel:"Search Product Finder",isPending:Q,submitDisabled:Q||F.trim().length<3,showClearButton:!!F,inputRef:ek}),(0,s.jsx)("div",{className:"mt-3 flex gap-2 overflow-x-auto pb-1 pr-4 sm:flex-wrap sm:overflow-visible sm:pr-0",children:H.map(e=>(0,s.jsx)(x.default,{as:"button",tone:"outline",icon:e.icon,label:e.shortLabel??e.label,className:"min-w-fit px-3",loading:Q&&W===(e.shortLabel??e.label),disabled:Q,onClick:()=>eR(e)},e.label))}),K?(0,s.jsx)("p",{className:"mt-2 text-sm text-white/85",children:K}):null]}),(0,s.jsx)("div",{className:"mt-5",children:(0,s.jsx)(m.default,{groups:eP,className:"mx-auto max-w-[1280px]",onLinkClick:e$})})]})}),document.body):null]})}e.s(["default",()=>J],15837)},31094,e=>{"use strict";var t=e.i(43476),s=e.i(71645),a=e.i(18566),r=e.i(75299),n=e.i(10289),l=e.i(37727),i=e.i(64659),o=e.i(63059),d=e.i(75254);let c=(0,d.default)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),x=(0,d.default)("circle-check-big",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]),u=(0,d.default)("clock",[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]),m=(0,d.default)("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);var h=e.i(27612),p=e.i(74886);let b=(0,d.default)("minimize-2",[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]]);var g=e.i(98361),f=e.i(16715),j=e.i(58041);function w({status:e}){let{icon:s,color:a,label:r}={pending:{icon:u,color:"text-amber-600 bg-amber-50 border-amber-200",label:"Loading"},success:{icon:x,color:"text-emerald-600 bg-emerald-50 border-emerald-200",label:"OK"},error:{icon:m,color:"text-red-600 bg-red-50 border-red-200",label:"Error"},"no-data":{icon:c,color:"text-orange-600 bg-orange-50 border-orange-200",label:"No Data"}}[e];return(0,t.jsxs)("span",{className:`inline-flex items-center gap-1 px-2 py-0.5 text-[10px] font-bold uppercase rounded border ${a}`,children:[(0,t.jsx)(s,{size:10}),r]})}function v({type:e}){return(0,t.jsx)("span",{className:`px-2 py-0.5 text-[10px] font-bold uppercase rounded ${{pricing:"bg-blue-100 text-blue-700","price-history":"bg-purple-100 text-purple-700","product-service":"bg-green-100 text-green-700","ai-search":"bg-indigo-100 text-indigo-800","hawk-widget":"bg-sky-100 text-sky-800","app-api":"bg-amber-100 text-amber-900"}[e]}`,children:e})}function N({call:e}
1){let[a,r]=(0,s.useState)(!1),[n,l]=(0,s.useState)(!1),d=e=>{navigator.clipboard.writeText(e),l(!0),setTimeout(()=>l(!1),2e3)};return(0,t.jsxs)("div",{className:`border rounded-lg overflow-hidden ${e.hasMismatch?"border-orange-300 bg-orange-50/50":"border-slate-200 bg-white"}`,children:[(0,t.jsxs)("button",{onClick:()=>r(!a),className:"w-full px-3 py-2 flex items-center gap-2 hover:bg-slate-50 transition-colors text-left",children:[a?(0,t.jsx)(i.ChevronDown,{size:14}):(0,t.jsx)(o.ChevronRight,{size:14}),(0,t.jsx)("span",{className:"text-[10px] text-slate-400 font-mono w-20 shrink-0",children:e.timestamp.toLocaleTimeString("en-GB",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit",fractionalSecondDigits:3})}),(0,t.jsx)(v,{type:e.type}),(0,t.jsx)(w,{status:e.status}),e.hasMismatch&&(0,t.jsxs)("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 text-[10px] font-bold uppercase rounded bg-orange-100 text-orange-700 border border-orange-300",children:[(0,t.jsx)(c,{size:10}),"Mismatch"]}),(0,t.jsx)("span",{className:"flex-1 text-xs font-mono text-slate-600 truncate",children:e.productName||e.endpoint}),e.responseTime&&(0,t.jsxs)("span",{className:"text-[10px] text-slate-400 shrink-0",children:[e.responseTime,"ms"]})]}),a&&(0,t.jsxs)("div",{className:"border-t border-slate-200 p-3 space-y-3 bg-slate-50",children:[e.hasMismatch&&(0,t.jsx)("div",{className:"p-3 bg-orange-100 border border-orange-300 rounded-lg",children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(c,{size:16,className:"text-orange-600 shrink-0 mt-0.5"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"font-bold text-orange-800 text-sm",children:"Model Mismatch Detected"}),(0,t.jsx)("div",{className:"text-orange-700 text-xs mt-1",children:e.mismatchReason||"Product name did not return pricing data from Hawk API"}),e.productName&&(0,t.jsxs)("div",{className:"mt-2 font-mono text-[11px] bg-
1orange-50 p-2 rounded border border-orange-200",children:[(0,t.jsx)("strong",{children:"Product:"})," ",e.productName]})]})]})}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,t.jsx)("span",{className:"text-[10px] font-bold text-slate-500 uppercase",children:e.upstreamEndpoint?"App endpoint":"Endpoint"}),(0,t.jsx)("button",{onClick:t=>{t.stopPropagation(),d(e.endpoint)},className:"text-[10px] text-slate-400 hover:text-slate-600 flex items-center gap-1",children:n?"Copied!":(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(p.Copy,{size:10})," Copy"]})})]}),(0,t.jsx)("div",{className:"flex flex-wrap items-center gap-2 mb-1",children:e.method&&(0,t.jsx)("span",{className:"text-[10px] font-mono bg-slate-200 text-slate-700 px-1.5 py-0.5 rounded",children:e.method})}),(0,t.jsx)("code",{className:"block text-[11px] font-mono bg-white p-2 rounded border border-slate-200 text-slate-700 break-all",children:e.endpoint})]}),(e.upstreamEndpoint||e.upstreamParams||e.upstreamNote)&&(0,t.jsxs)("div",{className:"rounded-lg border border-slate-300 bg-slate-100/80 p-2 space-y-2",children:[(0,t.jsx)("div",{className:"text-[10px] font-bold text-slate-600 uppercase tracking-wide",children:"Upstream (server)"}),e.upstreamNote&&(0,t.jsx)("p",{className:"text-[11px] text-slate-600 leading-snug",children:e.upstreamNote}),e.upstreamEndpoint&&(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-[10px] font-bold text-slate-500 uppercase block mb-1",children:"Upstream URL"}),(0,t.jsxs)("code",{className:"block text-[11px] font-mono bg-white p-2 rounded border border-slate-200 text-slate-800 break-all",children:[e.upstreamMethod&&(0,t.jsx)("span",{className:"text-slate-500 mr-2",children:e.upstreamMethod}),e.upstreamEndpoint]})]}),e.upstreamParams&&Object.keys(e.upstreamParams).length>0&&(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,t.jsx)("span",{className:"text-[10px] font-bold text-slate-500 uppercase",children:"Upstream params / body"}),(0,t.jsxs)("button",{type:"button",onClick:t=>{t.stopPropagation(),d(JSON.stringify(e.upstreamParams,null,2))},className:"text-[10px] text-slate-400 hover:text-slate-600 flex items-center gap-1",children:[(0,t.jsx)(p.Copy,{size:10})," Copy JSON"]})]}),(0,t.jsx)("pre",{className:"text-[11px] font-mono bg-white p-2 rounded border border-slate-200 text-slate-700 overflow-x-auto max-h-40",children:JSON.stringify(e.upstreamParams,null,2)})]})]}),Object.keys(e.requestParams).length>0&&(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,t.jsx)("span",{className:"text-[10px] font-bold text-slate-500 uppercase",children:"Request Parameters"}),(0,t.jsxs)("button",{onClick:t=>{t.stopPropagation(),d(JSON.stringify(e.requestParams,null,2))},className:"text-[10px] text-slate-400 hover:text-slate-600 flex items-center gap-1",children:[(0,t.jsx)(p.Copy,{size:10})," Copy JSON"]})]}),(0,t.jsx)("pre",{className:"text-[11px] font-mono bg-white p-2 rounded border border-slate-200 text-slate-700 overflow-x-auto max-h-32",children:JSON.stringify(e.requestParams,null,2)})]}),void 0!==e.response&&(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,t.jsx)("span",{className:"text-[10px] font-bold text-slate-500 uppercase",children:"Response"}),(0,t.jsxs)("button",{onClick:t=>{t.stopPropagation(),d(JSON.stringify(e.response,null,2))},className:"text-[10px] text-slate-400 hover:text-slate-600 flex items-center gap-1",children:[(0,t.jsx)(p.Copy,{size:10})," Copy JSON"]})]}),(0,t.jsx)("pre",{className:"text-[11px] font-mono bg-white p-2 rounded border border-slate-200 text-slate-700 overflow-x-auto max-h-48",children:String(JSON.stringify(e.response,null,2))})]}),e.error&&(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-[10px] font-bold text-red-500 uppercase block mb-1",children:"Error"}),(0,t.jsx)("pre",{className:"text-[11px] font-mono bg-red-50 p-2 rounded border border-red-200 text-red-700 overflow-x-auto",children:e.error})]})]})]})}function y(){let e=(0,a.useSearchParams)(),{enabled:i,setEnabled:o,apiCalls:d,clearLogs:x,mismatches:u,triggerFetch:m,isFetching:p}
1=(0,r.useDebugSafe)(),[w,v]=(0,s.useState)(!1),[y,k]=(0,s.useState)(!1),[C,S]=(0,s.useState)("all");if((0,s.useEffect)(()=>{"true"===e.get("debug")&&o(!0)},[e,o]),!i)return null;let P="mismatches"===C?u:d;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("button",{onClick:()=>v(!w),className:`fixed bottom-4 right-4 z-50 p-3 rounded-full shadow-lg transition-all ${u.length>0?"bg-orange-500 hover:bg-orange-600 text-white":"bg-slate-800 hover:bg-slate-700 text-white"}`,title:"Toggle API Debug Panel",children:[(0,t.jsx)(n.Bug,{size:20}),u.length>0&&(0,t.jsx)("span",{className:"absolute -top-1 -right-1 bg-red-500 text-white text-[10px] font-bold w-5 h-5 rounded-full flex items-center justify-center",children:u.length})]}),w&&(0,t.jsxs)("div",{className:`fixed z-50 bg-white border border-slate-300 shadow-2xl rounded-lg overflow-hidden transition-all ${y?"bottom-16 right-4 w-80 h-12":"bottom-16 right-4 w-[600px] max-w-[calc(100vw-2rem)] h-[70vh] max-h-[600px]"}`,children:[(0,t.jsxs)("div",{className:"bg-slate-800 text-white px-4 py-2 flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(n.Bug,{size:16}),(0,t.jsx)("span",{className:"font-bold text-sm",children:"API Debug Panel"}),d.length>0&&(0,t.jsxs)("span",{className:"text-[10px] bg-slate-600 px-2 py-0.5 rounded",children:[d.length," calls"]}),u.length>0&&(0,t.jsxs)("span",{className:"text-[10px] bg-orange-500 px-2 py-0.5 rounded font-bold",children:[u.length," mismatches"]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsxs)("button",{onClick:m,disabled:p,className:"flex items-center gap-1.5 px-2.5 py-1 text-[11px] font-bold bg-green-600 hover:bg-green-500 disabled:bg-green-800 disabled:opacity-60 rounded transition-colors",title:"Fetch products via API to capture in debug panel",children:[(0,t.jsx)(f.RefreshCw,{size:12,className:p?"animate-spin":""}),p?"Fetching...":"Fetch Products"]}),(0,t.jsx)("div",{className:"w-px h-4 bg-slate-600"}),(0,t.jsx)("button",{onClick:x,className:"p-1.5 hover:bg-slate-700 rounded transition-colors",title:"Clear logs",children:(0,t.jsx)(h.Trash2,{size:14})}),(0,t.jsx)("button",{onClick:()=>k(!y),className:"p-1.5 hover:bg-slate-700 rounded transition-colors",title:y?"Maximize":"Minimize",children:y?(0,t.jsx)(g.Maximize2,{size:14}):(0,t.jsx)(b,{size:14})}),(0,t.jsx)("button",{onClick:()=>o(!1),className:"p-1.5 hover:bg-slate-700 rounded transition-colors",title:"Disable debug mode",children:(0,t.jsx)(l.X,{size:14})})]})]}),!y&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"border-b border-slate-200 flex",children:[(0,t.jsxs)("button",{onClick:()=>S("all"),className:`flex-1 px-4 py-2 text-xs font-bold uppercase transition-colors ${"all"===C?"text-slate-900 border-b-2 border-radar-blue bg-slate-50":"text-slate-500 hover:text-slate-700"}`,children:["All Calls (",d.length,")"]}),(0,t.jsx)("button",{onClick:()=>S("mismatches"),className:`flex-1 px-4 py-2 text-xs font-bold uppercase transition-colors ${"mismatches"===C?"text-orange-700 border-b-2 border-orange-500 bg-orange-50":"text-slate-500 hover:text-slate-700"}`,children:(0,t.jsxs)("span",{className:"flex items-center justify-center gap-1.5",children:[(0,t.jsx)(c,{size:12}),"Mismatches (",u.length,")"]})})]}),(0,t.jsxs)("div",{className:"px-3 py-2 bg-blue-50 border-b border-blue-100 text-xs text-blue-700 flex items-center gap-2",children:[(0,t.jsx)(j.Database,{size:12}),(0,t.jsxs)("span",{children:[(0,t.jsx)("strong",{children:"Product data"})," is fetched via SSR (server-side). The first log line includes the request shape; on ",(0,t.jsx)("strong",{children:"?guide=â¦"})," pages that is the article-scoped query (SCOPE_PRODUCTS + article id). Click ",(0,t.jsx)("strong",{children:"Fetch Products"})," to repeat the same call client-side and see timing and full JSON (",(0,t.jsx)("code",{className:"text-[10px] bg-blue-100 px-1 rounded",children:"_debug"}),")."]})]}),(0,t.jsx)("div",{className:"overflow-y-auto p-3 space-y-2",style:{height:"calc(100% - 120px)"},children:0===P.length?(0,t.jsxs)("div",{className:"text-center py-8 text-slate-400",children:[(0,t.jsx)(n.Bug,{size:32,className:"mx-auto mb-2 opacity-30"}),(0,t.jsx)("p",{className:"text-sm",children:"mismatches"===C?"No mismatches detected":"No API calls logged yet"}),(0,t.jsx)("p",{className:"text-xs mt-1",children:"all"===C&&"Click 'Fetch Products' to capture Product Service API calls"})]}):P.map(e=>(0,t.jsx)(N,{call:e},e.id))})]})]})]})}e.s(["default",()=>y],31094)}]);
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.