1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4393],{1465:(e,t,a)=>{"use strict";a.d(t,{Kk:()=>l,WF:()=>u,ad:()=>o,nY:()=>d,pW:()=>n,pp:()=>i});var r=a(95212);function l(e){let t=Object.values(e??{}).map(e=>e.price);return t.length?Math.min(...t):null}function i(e){let t=Object.entries(e??{});if(0===t.length)return null;let[a,r]=t.reduce((e,t)=>t[1].price<e[1].price?t:e);return{price:r.price,platform:a}}let s={pc:"PC",ps5:"PS5",ps4:"PS4",xbox:"Xbox",switch:"Switch",switch2:"Switch 2"};function n(e){return s[e]??e.toUpperCase()}function c(e,t=1,a=7){return`/api/games?q=${encodeURIComponent(e.trim())}&page=${t}&per_page=${a}`}function o(e){return e.trim().length>=2}function d(e){return`/game/${encodeURIComponent(e).replace(/%2F/g,"-")}`}function u(){let[e,t]=(0,r.useState)(""),[a,l]=(0,r.useState)([]),[i,s]=(0,r.useState)(!1),[n,d]=(0,r.useState)(!1),[u,h]=(0,r.useState)(0),[p,m]=(0,r.useState)(1),[f,x]=(0,r.useState)(-1),j=(0,r.useRef)(null),v=(0,r.useRef)(null),g=(0,r.useRef)(null),b=(0,r.useCallback)(e=>{if(t(e),x(-1),g.current&&clearTimeout(g.current),!o(e)){j.current?.abort(),v.current?.abort(),l([]),h(0),m(1),s(!1),d(!1);return}g.current=setTimeout(async()=>{j.current?.abort(),v.current?.abort();let t=new AbortController;j.current=t,s(!0);try{let a=await fetch(c(e,1,7),{signal:t.signal,headers:{"X-Rynko-Client":"web-app"}}),r=await a.json(),i=r.items??[];l(i),h("number"==typeof r.total?r.total:i.length),m(1)}catch{}finally{s(!1)}},220)},[]),w=(0,r.useCallback)(async()=>{if(i||n||!o(e))return;let t=p+1,a=new AbortController;v.current=a,d(!0);try{let r=await fetch(c(e,t,7),{signal:a.signal,headers:{"X-Rynko-Client":"web-app"}}),i=await r.json(),s=i.items??[];s.length>0&&(l(e=>{let t=new Set(e.map(e=>e.id)),a=s.filter(e=>!t.has(e.id));return[...e,...a]}),m(t)),"number"==typeof i.total&&h(i.total)}catch{}finally{d(!1)}},[i,n,p,e]),_=(0,r.useCallback)(e=>x(t=>{var r;return r=a.length,r<=0?-1:"giu"===e?(t+1)%r:(t-1+r)%r}),[a.length]),k=(0,r.useCallback)(()=>{g.current&&clearTimeout(g.current),j.current?.abort(),v.current?.abort(),t(""),l([]),h(0),m(1),x(-1),s(!1),d(!1)},[]);(0,r.useEffect)(()=>()=>{g.current&&clearTimeout(g.current),j.current?.abort(),v.current?.abort()},[]);let N=a.length<u;return{query:e,results:a,loading:i,loadingMore:n,hasMore:N,total:u,highlight:f,cerca:b,caricaAltri:w,muoviEvidenziato:_,azzera:k}}},3554:(e,t,a)=>{"use strict";a.d(t,{Ej:()=>i,fM:()=>c,iI:()=>s,lC:()=>n});var r=a(6739);async function l(){return{"Content-Type":"application/json"}}async function i(){if(!(0,r.pN)())return[];let e=await fetch("/api/auth/wishlist",{cache:"no-store"});if(!e.ok)return[];let t=await e.json();return Array.isArray(t)?t:[]}async function s(e,t){let a=await l(),r=await fetch("/api/auth/wishlist",{method:"POST",headers:a,body:JSON.stringify({game_id:e,target_price:t??null})});if(!r.ok)throw Error((await r.json().catch(()=>({}))).detail||"Impossibile aggiungere alla wishlist")}async function n(e){let t=await l(),a=await fetch(`/api/auth/wishlist/${encodeURIComponent(e)}`,{method:"DELETE",headers:t});if(!a.ok)throw Error((await a.json().catch(()=>({}))).detail||"Impossibile rimuovere dalla wishlist")}async function c(e){let t=await l(),a=await fetch("/api/auth/wishlist/import-steam",{method:"POST",headers:t,body:JSON.stringify({steam_id:e.trim()})}),r=await a.json().catch(()=>({}));if(!a.ok){let e=r.detail;throw Error("string"==typeof e?e:"Import Steam fallito")}return r}},14393:(e,t,a)=>{Promise.resolve().then(a.bind(a,18794)),Promise.resolve().then(a.t.bind(a,80044,23)),Promise.resolve().then(a.t.bind(a,19591,23)),Promise.resolve().then(a.t.bind(a,89196,23)),Promise.resolve().then(a.bind(a,71634)),Promise.resolve().then(a.t.bind(a,29699,23))},18794:(e,t,a)=>{"use strict";a.d(t,{default:()=>w});var r=a(43520),l=a(95212),i=a(29699),s=a.n(i),n=a(79412),c=a(23712),o=a(25899);let d=[5,10,20,30,60];function u(e){let t=Object.values(e);return t.length?Math.min(...t.map(e=>e.price)):null}function h(e){let t=Object.values(e);return t.length?Math.max(...t.map(e=>e.discount_pct??0)):0}let p=e=>"⬠"+e.toFixed(2).replace(".",","),m={pc:"PC",ps5:"PS5",ps4:"PS4",xbox:"XBX",switch:"NS",switch2:"NS2"},f=e=>m[e]??e.toUpperCase();function x({game:e,activePlatform:t}){let a=Object.entries(e.best);if(0===a.length)return null;let[l,i]=a.reduce((e,t)=>
1t[1].price<=e[1].price?t:e),d=(i.discount_pct??0)>=10,u=t&&e.platforms.includes(t)?t:e.platforms[0]??l;return(0,r.jsxs)("article",{className:"gc gc--light","data-morph":"game","data-title":e.title,"data-cover":e.cover_url??void 0,children:[(0,r.jsxs)("div",{className:"gc__cover",children:[(0,r.jsx)(s(),{href:`/game/${e.id}`,"aria-label":`Apri ${e.title}`,children:(0,r.jsx)(n.default,{title:e.title,coverUrl:e.cover_url,platform:u,gameId:e.id,size:"card"})}),(0,r.jsx)("div",{className:"gc__save",children:(0,r.jsx)(c.default,{gameId:e.id,compact:!0})}),i.price>0&&(0,r.jsx)("div",{className:"gc__radar",children:(0,r.jsx)(o.default,{compact:!0,gameId:e.id,gameTitle:e.title,coverUrl:e.cover_url,currentPrice:i.price,platform:l})})]}),(0,r.jsxs)("div",{className:"gc__panel",children:[(0,r.jsx)("h3",{className:"gc__title",title:e.title,children:(0,r.jsx)(s(),{href:`/game/${e.id}`,children:e.title})}),(0,r.jsx)("div",{className:"gc__plats",children:e.platforms.slice(0,4).map(t=>{let a=e.best[t],i=a&&(a.discount_pct??0)>=1?`â${a.discount_pct}%`:void 0;return(0,r.jsx)("span",{className:`gc__plat${t===l?" is-active":""}`,"data-platform-key":t,"data-now":a?0===a.price?"GRATIS":p(a.price):void 0,"data-was":a&&null!=a.msrp&&a.msrp>a.price?p(a.msrp):void 0,"data-off":i,"data-store":a?.store,"data-kind":a?"official"===a.sale_type?"store ufficiale":"key"===a.sale_type?"key shop":void 0:void 0,children:f(t)},t)})}),(0,r.jsxs)("div",{className:"gc__foot",children:[(0,r.jsxs)("div",{className:"gc__price",children:[(0,r.jsx)("span",{className:"gc__now",children:0===i.price?"GRATIS":p(i.price)}),null!=i.msrp&&i.msrp>i.price&&(0,r.jsx)("span",{className:"gc__was",children:p(i.msrp)}),d&&(0,r.jsxs)("span",{className:"gc__off",children:["â",i.discount_pct,"%"]})]}),(0,r.jsxs)("div",{className:"gc__seal",children:[(0,r.jsx)("span",{className:"gc__store",children:i.store.toUpperCase()}),(0,r.jsxs)("span",{className:"gc__for",children:["per ",f(l)]})]})]}),(0,r.jsxs)(s(),{className:"gc__cta",href:`/game/${e.id}?platform=${encodeURIComponent(l)}`,"aria-label":`Vedi l'offerta: ${e.title} a ${0===i.price?"gratis":p(i.price)} per ${f(l)}`,children:["Vedi lâofferta",(0,r.jsxs)("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,r.jsx)("path",{d:"M5 12h14"}),(0,r.jsx)("path",{d:"m12 5 7 7-7 7"})]})]})]})]})}var j=a(66644),v=a(1465);function g(){let e=(0,j.useRouter)(),[t,a]=(0,l.useState)(!1),[i,n]=(0,l.useState)(""),c=(0,v.WF)(),o=(0,l.useRef)(null);(0,l.useEffect)(()=>{let e=e=>{o.current?.contains(e.target)||a(!1)};return document.addEventListener("pointerdown",e),()=>document.removeEventListener("pointerdown",e)},[]);let d=e=>{n(e),c.cerca(e),a(!0)};return(0,r.jsxs)("div",{className:"cat-find",ref:o,children:[(0,r.jsx)("label",{htmlFor:"catalog-query",children:"Quale gioco cerchi?"}),(0,r.jsxs)("div",{className:"cat-find__field",children:[(0,r.jsxs)("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,r.jsx)("path",{d:"m21 21-4.34-4.34"}),(0,r.jsx)("circle",{cx:"11",cy:"11",r:"8"})]}),(0,r.jsx)("input",{id:"catalog-query",type:"search",placeholder:"Titolo, serie o parola chiave",autoComplete:"off",value:i,onChange:e=>d(e.target.value),onFocus:()=>a(!0),onKeyDown:t=>{"Enter"===t.key&&(0,v.ad)(i)&&e.push(`/catalogo?q=${encodeURIComponent(i.trim())}`),"ArrowDown"===t.key&&(t.preventDefault(),c.muoviEvidenziato("giu")),"ArrowUp"===t.key&&(t.preventDefault(),c.muoviEvidenziato("su")),"Escape"===t.key&&a(!1)}}),i&&(0,r.jsx)("button",{type:"button",className:"cat-find__clear","aria-label":"Cancella ricerca",onClick:()=>{d(""),a(!1)},children:(0,r.jsxs)("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,r.jsx)("path",{d:"M18 6 6 18"}),(0,r.jsx)("path",{d:"m6 6 12 12"})]})})]}),(0,r.jsxs)("p",{children:[(0,r.jsx)("kbd",{children:"Ctrl"}),(0,r.jsx)("kbd",{children:"K"})," cerca da ogni pagina. Qui i risultati cambiano mentre scrivi."]}),t&&(0,v.ad)(i)&&(0,r.jsx)("div",{className:"cat-find__results",role:"listbox",children:c.loading&&0===c.results.length?(0,r.jsx)("p",{className:"cat-find__empty",children:"Cercoâ¦"}):0===c.results.length?(0,r.jsxs)("p",{className:"cat-find__empty",children:["Nessun gioco trovato per \xab",i,"\xbb."]}):(0,r.jsxs)(r.Fragment,{children:[c.results.map((e,t)=>{let a=(0,v.Kk)(e.best);return(0,r.jsxs)(s(),{href:(0,v.nY)(e.id),className:"cat-find__row","data-hi":t===c.highlight,children:[e.cover_url&&(0,r.jsx)("img",{src:e.cover_url,alt:"",loading:"lazy"}),(0,r.jsxs)("span",{className:"cat-find__row-tx",children:[(0,r.jsx)("span",{className:"cat-find__row-t",children:e.title}),(0,r.jsx)("span",{className:"cat-find__row-m",children:null!=a?0===a?"Gratis":`da â¬${a.toFixed(2).replace(".",",")}`:"Prezzo non disponibile"})]})]},e.id)}),(0,r.jsxs)(s(),{href:`/catalogo?q=${encodeURIComponent(i.trim())}`,className:"cat-find__more",children:["Vedi tutti i risultati per \xab",i,"\xbb â"]})]})})]})}function b({label:e,options:t,current:a,onPick:l}){let i=t.find(e=>e.value===a)?.label;return(0,r.jsxs)("details",{className:"cat-filter",children:[(0,r.jsxs)("summary",{children:[i?`${e}: ${i}`:e,(0,r.jsx)("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5","aria-hidden":"true",children:(0,r.jsx)("path",{d:"m6 9 6 6 6-6"})})]}),(0,r.jsx)("div",{className:"cat-filter__panel",children:t.map(e=>e.href?(0,r.jsx)(s(),{href:e.href,"aria-current":a===e.value?"true":void 0,children:e.label},e.value):(0,r.jsx)("button",{type:"button","aria-current":a===e.value?"true":void 0,onClick:()=>l?.(a===e.value?null:e.value),children:e.label},e.value))})]})}function w({games:e,totale:t,pagina:a,pagine:i,heroTitle:n,heroLede
1:c,heroMeta:o,nav:p,locked:m}){let f=!!m?.onSale,[j,v]=(0,l.useState)("all"),[k,N]=(0,l.useState)(f),[y,C]=(0,l.useState)(0),[S,P]=(0,l.useState)("discount"),[$,E]=(0,l.useState)(!1),R=(0,l.useMemo)(()=>{let t;return t=e.filter(e=>{let t=Object.values(e.best);return!(0===t.length||"official"===j&&!t.some(e=>"official"===e.sale_type)||"key"===j&&!t.some(e=>"key"===e.sale_type)||k&&!t.some(e=>(e.discount_pct??0)>0)||y>0&&Math.min(...t.map(e=>e.price))>y)&&!0}),"discount"===S&&(t=[...t].sort((e,t)=>h(t.best)-h(e.best))),"price_asc"===S&&(t=[...t].sort((e,t)=>(u(e.best)??999)-(u(t.best)??999))),"price_desc"===S&&(t=[...t].sort((e,t)=>(u(t.best)??0)-(u(e.best)??0))),"title"===S&&(t=[...t].sort((e,t)=>e.title.localeCompare(t.title,"it"))),t},[e,j,k,y,S]),z=k&&!f,I=!!(p?.genre||p?.theme||p?.platform),T="all"!==j||z||y>0,A=+("all"!==j)+ +!!z+ +(y>0),L=()=>{v("all"),N(f),C(0)},M=!T&&!I,O=(0,l.useMemo)(()=>M?[...R].filter(e=>h(e.best)>=30).slice(0,4):[],[R,M]),U=new Set(O.map(e=>e.id)),W=R.filter(e=>!U.has(e.id)),B=[{value:"all",label:"Tutti"},{value:"official",label:"Store ufficiali"},{value:"key",label:"Key shop"}],F=d.map(e=>
1({value:String(e),label:`fino a â¬${e}`})),D=[{value:"discount",label:"Sconto maggiore"},{value:"price_asc",label:"Prezzo pi\xf9 basso"},{value:"price_desc",label:"Prezzo pi\xf9 alto"},{value:"title",label:"Titolo A-Z"}];return(0,r.jsxs)("div",{className:"cat-page",children:[(0,r.jsxs)("section",{className:"cat-head","aria-labelledby":"catalog-title",children:[(0,r.jsxs)("div",{className:"cat-shell cat-head__grid",children:[(0,r.jsxs)("div",{className:"cat-head__copy",children:[o&&o.length>0&&(0,r.jsx)("div",{className:"cat-head__meta",children:o.map((e,t)=>(0,r.jsxs)("span",{children:[t>0&&(0,r.jsx)("span",{"aria-hidden":"true",children:"\xb7"}),e]},t))}),(0,r.jsx)("h1",{id:"catalog-title",children:n}),(0,r.jsx)("p",{children:c}),(0,r.jsxs)("ul",{className:"cat-trust","aria-label":"Come funziona",children:[(0,r.jsx)("li",{children:"Compri sul negozio, al prezzo che vedi"}),(0,r.jsx)("li",{children:"Store ufficiali e key shop a confronto"}),(0,r.jsx)("li",{children:"PriceRadar: ti avvisiamo quando scende"})]})]}),(0,r.jsx)(g,{})]}),p&&(0,r.jsxs)("div",{className:"cat-shell cat-platforms",role:"group","aria-label":"Filtra per piattaforma",children:[(0,r.jsx)("span",{className:"cat-platforms__label",children:"Dove giochi?"}),p.platformOptions.map(e=>(0,r.jsx)(s(),{href:e.href??"#","aria-current":p.platform!==e.value&&(p.platform||e.value)?void 0:"page",children:e.label},e.value||"tutte"))]})]}),(0,r.jsxs)("section",{className:"cat-work","aria-labelledby":"results-title",children:[(0,r.jsx)("div",{className:"cat-toolbar",children:(0,r.jsxs)("div",{className:"cat-shell cat-toolbar__inner",children:[(0,r.jsxs)("button",{type:"button",className:"cat-mobile-filter","aria-haspopup":"dialog","aria-expanded":$,onClick:()=>E(!0),children:[(0,r.jsxs)("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,r.jsx)("path",{d:"M4 6h16"}),(0,r.jsx)("path",{d:"M7 12h10"}),(0,r.jsx)("path",{d:"M10 18h4"})]}),"Filtri ",A>0&&(0,r.jsx)("span",{children:A})]}),(0,r.jsxs)("div",{className:"cat-toolbar__filters",children:[p&&(0,r.jsx)(b,{label:"Genere",current:p.genre??null,options:p.genreOptions}),p&&(0,r.jsx)(b,{label:"Tema",current:p.theme??null,options:p.themeOptions}),(0,r.jsx)(b,{label:"Prezzo",current:y>0?String(y):null,options:F,onPick:e=>C(e?Number(e):0)}),(0,r.jsx)(b,{label:"Tipo store",current:"all"===j?null:j,options:B,onPick:e=>v(e??"all")}),!f&&(0,r.jsxs)("label",{className:"cat-sale-toggle",children:[(0,r.jsx)("input",{type:"checkbox",checked:k,onChange:e=>N(e.target.checked)}),(0,r.jsx)("span",{className:"cat-box","aria-hidden":"true",children:(0,r.jsx)("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3.5",children:(0,r.jsx)("path",{d:"M20 6 9 17l-5-5"})})}),"Solo in sconto"]})]}),(0,r.jsxs)("div",{className:"cat-sort",children:[(0,r.jsx)("select",{"aria-label":"Ordina per",value:S,onChange:e=>P(e.target.value),children:D.map(e=>(0,r.jsx)("option",{value:e.value,children:e.label},e.value))}),(0,r.jsx)("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:(0,r.jsx)("path",{d:"m6 9 6 6 6-6"})})]})]})}),(0,r.jsxs)("div",{className:"cat-shell cat-results-head",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("h2",{id:"results-title",children:I?"Risultati":"Tutti i giochi"}),(0,r.jsxs)("p",{children:[(0,r.jsx)("strong",{children:R.length}),t&&t>R.length?` di ${t.toLocaleString("it-IT")}`:""," risultati",i&&i>1?` \xb7 pagina ${a??1} di ${i}`:""]})]}),(T||I)&&(0,r.jsx)("button",{type:"button",className:"cat-reset",onClick:L,children:"Azzera filtri"})]}),T&&(0,r.jsxs)("div",{className:"cat-shell cat-active",children:[y>0&&(0,r.jsxs)("button",{type:"button",className:"cat-achip",onClick:()=>C(0),children:["fino a â¬",y," â"]}),"all"!==j&&(0,r.jsxs)("button",{type:"button",className:"cat-achip",onClick:()=>v("all"),children:[B.find(e=>e.value===j)?.label," â"]}),z&&(0,r.jsx)("button",{type:"button",className:"cat-achip",onClick:()=>N(!1),children:"In offerta â"})]}),O.length>0&&(0,r.jsxs)("div",{className:"cat-shell cat-feat",children:[(0,r.jsx)("h2",{className:"cat-feat-h",children:"In evidenza"}),(0,r.jsx)("div",{className:"cat-feat-grid",children:O.map(e=>(0,r.jsx)(_,{game:e,activePlatform:p?.platform},e.id))})]}),W.length>0?(0,r.jsx)("div",{className:"cat-shell cat-grid",children:W.map(e=>(0,r.jsx)(x,{game:e,activePlatform:p?.platform},e.id))}):0===O.length?(0,r.jsxs)("div",{className:"cat-shell cat-empty",children:[(0,r.jsx)("span",{"aria-hidden":"true",children:"0"}),(0,r.jsx)("h2",{children:"Nessun gioco corrisponde ai filtri"}),(0,r.jsx)("p",{children:"Prova a cambiare i filtri, o azzera tutto per ripartire dal catalogo
1intero."}),T&&(0,r.jsx)("button",{type:"button",onClick:L,children:"Rimuovi i filtri"})]}):null]}),$&&(0,r.jsxs)("div",{className:"cat-drawer",role:"dialog","aria-modal":"true","aria-label":"Filtri",children:[(0,r.jsx)("button",{type:"button",className:"cat-drawer__scrim","aria-label":"Chiudi",onClick:()=>E(!1)}),(0,r.jsxs)("div",{className:"cat-drawer__panel",children:[(0,r.jsxs)("header",{children:[(0,r.jsx)("h2",{children:"Filtri"}),(0,r.jsx)("button",{type:"button",onClick:()=>E(!1),"aria-label":"Chiudi",children:(0,r.jsxs)("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,r.jsx)("path",{d:"M18 6 6 18"}),(0,r.jsx)("path",{d:"m6 6 12 12"})]})})]}),p&&(0,r.jsxs)("div",{className:"cat-drawer-row",children:[(0,r.jsx)("b",{children:"Genere"}),(0,r.jsx)("div",{className:"cat-drawer-chips",children:p.genreOptions.map(e=>(0,r.jsx)(s(),{href:e.href??"#",className:"cat-drawer-opt","data-on":(p.genre??"")===e.value,children:e.label},e.value))})]}),(0,r.jsxs)("div",{className:"cat-drawer-row",children:[(0,r.jsx)("b",{children:"Prezzo"}),(0,r.jsx)("div",{className:"cat-drawer-chips",children:F.map(e=>(0,r.jsx)("button",{type:"button",className:"cat-drawer-opt","data-on":y===Number(e.value),onClick:()=>C(y===Number(e.value)?0:Number(e.value)),children:e.label},e.value))})]}),(0,r.jsxs)("div",{className:"cat-drawer-row",children:[(0,r.jsx)("b",{children:"Venditore"}),(0,r.jsx)("div",{className:"cat-drawer-chips",children:B.map(e=>(0,r.jsx)("button",{type:"button",className:"cat-drawer-opt","data-on":j===e.value,onClick:()=>v(e.value),children:e.label},e.value))})]}),(0,r.jsxs)("div",{className:"cat-drawer-row",children:[(0,r.jsx)("b",{children:"Ordina"}),(0,r.jsx)("div",{className:"cat-drawer-chips",children:D.map(e=>(0,r.jsx)("button",{type:"button",className:"cat-drawer-opt","data-on":S===e.value,onClick:()=>P(e.value),children:e.label},e.value))})]}),(0,r.jsxs)("div",{className:"cat-filter-drawer__actions",style:{display:"grid",gridTemplateColumns:"1fr 2fr",gap:10,paddingTop:6},children:[(0,r.jsx)("button",{type:"button",className:"cat-drawer-reset",onClick:L,style:{minHeight:50,borderRadius:"var(--sc-r-pill)",border:"1px solid var(--cat-line-strong)",background:"transparent",fontWeight:700},children:"Azzera"}),(0,r.jsx)("button",{type:"button",onClick:()=>E(!1),style:{minHeight:50,borderRadius:"var(--sc-r-pill)",border:0,background:"var(--sc-accent)",color:"var(--sc-accent-ink)",fontWeight:700},children:"Applica"})]})]})]})]})}function _({game:e,activePlatform:t}){let a=Object.values(e.best).sort((e,t)=>e.price-t.price)[0]??null;if(!a)return null;let l=e.platforms.slice(0,3).map(e=>e.toUpperCase()).join(" \xb7 "),i=a.msrp&&a.msrp>a.price?Math.round((1-a.price/a.msrp)*100):0,c=t&&e.platforms.includes(t)?t:e.platforms[0]??"pc";return(0,r.jsxs)(s(),{href:`/game/${e.id}`,className:"cat-feat-tile","aria-label":`${e.title} â da ${p(a.price)}`,children:[(0,r.jsx)("span",{className:"cat-feat-scene","aria-hidden":"true"}),(0,r.jsx)("span",{className:"cat-feat-case","aria-hidden":"true",children:(0,r.jsx)(n.default,{title:e.title,coverUrl:e.cover_url,platform:c,gameId:e.id,size:"card"})}),(0,r.jsxs)("span",{className:"cat-feat-body",children:[i>0&&(0,r.jsxs)("span",{className:"cat-feat-disc",children:["-",i,"%"]}),(0,r.jsx)("strong",{className:"cat-feat-title",children:e.title}),l&&(0,r.jsx)("span",{className:"cat-feat-plat",children:l}),(0,r.jsxs)("span",{className:"cat-feat-price",children:[(0,r.jsx)("b",{children:0===a.price?"GRATIS":p(a.price)}),null!=a.msrp&&a.msrp>a.price&&(0,r.jsx)("del",{children:p(a.msrp)})]})]})]})}a(98630)},19591:()=>{},23712:(e,t,a)=>{"use strict";a.d(t,{default:()=>i});var r=a(43520),l=a(83527);function i({gameId:e,className:t="",compact:a=!1}){let{isWatched:s,toggle:n}=(0,l.nU)(),c=s(e),o=a?14:16;return(0,r.jsx)("button",{type:"button",className:`wishlist-heart ${c?"active":""} ${t}`.trim(),"aria-label":c?"Rimuovi dalla wishlist":"Aggiungi alla wishlist",onClick:t=>{t.preventDefault(),t.stopPropagation(),n(e).catch(()=>{})},children:(0,r.jsx)("svg",{viewBox:"0 0 16 16",width:o,height:o,fill:c?"currentColor":"none",stroke:"currentColor",strokeWidth:"1.4",children:(0,r.jsx)("path",{d:"M8 13.5S2.5 10.2 2.5 6.4A3.4 3.4 0 0 1 8 4a3.4 3.4 0 0 1 5.5 2.4c0 3.8-5.5 7.1-5.5 7.1Z",strokeLinejoin:"round"})})})}},66644:(e,t,a)=>{"use strict";var r=a(68036);a.o(r,"usePathname")&&a.d(t,{usePathname:function(){return r.usePathname}}),a.o(r,"useRouter")&&a.d(t,{useRouter:function(){return r.useRouter}}),a.o(r,"useSearchParams")&&a.d(t,{useSearchParams:function(){return r.useSearchParams}})},80044:()=>{},83527:(e,t,a)=>{"use strict";a.d(t,{ZV:()=>o,nU:()=>d});var r=a(43520),l=a(95212),i=a(6739),s=a(3554),n=a(99411);let c=(0,l.createContext)(null);function o({children:e}
1){let[t,a]=(0,l.useState)(new Set),[d,u]=(0,l.useState)(!1),h=(0,l.useCallback)(async()=>{let e=(0,i.M3)();u(e),e?a(new Set((await (0,s.Ej)()).map(e=>e.game_id))):a(new Set((0,n.t7)()))},[]);(0,l.useEffect)(()=>{h();let e=()=>{h()};return window.addEventListener("rynko-wishlist-change",e),window.addEventListener("rynko-auth-change",e),window.addEventListener("storage",e=>{("rynko_watch"===e.key||"rynko_auth"===e.key)&&h()}),()=>{window.removeEventListener("rynko-wishlist-change",e),window.removeEventListener("rynko-auth-change",e)}},[h]);let p=(0,l.useCallback)(e=>t.has(e),[t]),m=(0,l.useCallback)(async e=>{(0,i.M3)()?t.has(e)?await (0,s.lC)(e):await (0,s.iI)(e):((0,n.yB)(e),(0,n.AR)()),await h()},[h,t]),f=(0,l.useMemo)(()=>({watchedIds:t,loggedIn:d,isWatched:p,toggle:m,refresh:h}),[t,d,p,m,h]);return(0,r.jsx)(c.Provider,{value:f,children:e})}function d(){let e=(0,l.useContext)(c);if(!e)throw Error("useWishlist must be used within WishlistProvider");return e}},89196:()=>{},98630:()=>{},99411:(e,t,a)=>{"use strict";a.d(t,{AR:()=>n,k:()=>i,t7:()=>l,yB:()=>s});let r="rynko_watch";function l(){try{let e=localStorage.getItem(r);if(!e)return[];let t=JSON.parse(e);if(!Array.isArray(t))return[];return t.filter(e=>"string"==typeof e&&e.length>0)}catch{return[]}}function i(){localStorage.removeItem(r)}function s(e){var t;let a=l(),i=a.includes(e);return t=i?a.filter(t=>t!==e):[e,...a],localStorage.setItem(r,JSON.stringify([...new Set(t)])),!i}function n(){window.dispatchEvent(new Event("rynko-wishlist-change"))}}}]);
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.