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AC1G,QACG,mBACA,gCAAgC,EAAA,SAEnCmC,EAAAR,EAAA,EAAA,0HAAAS,EAG+HpC,CAAK,IACpI,QACG,mBACA,gCAAgC,EAAA,mBAUnCQ,EAAAyB,EAAA,aAAAI,CAAA,EASA7B,EAAA0B,EAAA,aAAAI,CAAA,IA3BuC,IAAA5B,EAAE,OAAO,EAU/C,IAAAA,EAAE,OAAO,EAUE,IAAAA,EAAE,gBAAgB,EASlB,IAAAA,EAAE,gBAAgB,QA1DhCN,CAAG,KAFI,cCnBD,SAASmC,EAAoBC,EAAgBC,EAA4B,CAC/E,OAAOC,EAAS,UAAU,QAAQF,CAAM,GAAKG,GAAQ,CAChDA,EAAI,OAAS,uBAAuBF,EAAA,CACzC,CAAC,CACF","names":["likesCount","onfilter","filterActive","shown","$.derived","navigating","$$props","div","root","button","root_1","$.set_attribute","$0","t","$.delegated","$$args","$.append","$$anchor","span","root_2","$$render","consequent","alternate","div_1","$.sibling","node","a","$.child","text","$.reset","a_1","text_1","span_1","root_3","consequent_1","div_2","a_2","a_3","$.set_class","$.get","$2","$3","onArenaLikesChanged","userId","cb","realtime","evt"],"sources":["../../../../../../src/lib/components/arena/ArenaTopBar.svelte","../../../../../../src/lib/realtime/likes.ts"],"sourcesContent":["<script lang=\"ts\">\n\timport { t } from '$lib/i18n';\n\t// RAT-420: the arena's segmented top bar — swipe | likes(N) — plus filter,\n\t// submit and dashboard. Shared by the /a deck and the /a/likes grid so the\n\t// two modes share one identity. Position-agnostic: the page wraps it.\n\timport { navigating } from '$app/state';\n\n\tinterface Props {\n\t\tactive: 'swipe' | 'likes';\n\t\tlikesCount?: number;\n\t\t/** provide to render the filter button (only the /a deck filters) */\n\t\tonfilter?: (() => void) | null;\n\t\tfilterActive?: boolean;\n\t}\n\tlet { active, likesCount = 0, onfilter = null, filterActive = false }: Props = $props();\n\n\t// RAT-420: flip the pill the moment a tab navigation STARTS, not when the\n\t// load finishes — the switch reads as instant even while data streams in.\n\tconst shown = $derived(\n\t\tnavigating.to?.url.pathname === '/a/likes'\n\t\t\t? 'likes'\n\t\t\t: navigating.to?.url.pathname === '/a'\n\t\t\t\t? 'swipe'\n\t\t\t\t: active\n\t);\n</script>\n\n<div class=\"pointer-events-auto flex items-center justify-between gap-2\">\n\t{#if onfilter}\n\t\t<button\n\t\t\ttype=\"button\"\n\t\t\tonclick={onfilter}\n\t\t\taria-label={t('filter categories')}\n\t\t\tclass=\"flex h-9 w-9 shrink-0 items-center justify-center rounded-full border border-white/25 bg-white/10 text-white backdrop-blur transition-colors hover:bg-white/[.15] {filterActive\n\t\t\t\t? 'ring-1 ring-orange/40'\n\t\t\t\t: ''}\"\n\t\t>\n\t\t\t<svg class=\"h-4 w-4\" fill=\"none\" viewBox=\"0 0 16 16\" stroke=\"currentColor\" stroke-width=\"1.5\">\n\t\t\t\t<path d=\"M2 4h12M4 8h8M6 12h4\" />\n\t\t\t</svg>\n\t\t</button>\n\t{:else}\n\t\t<span class=\"h-9 w-9 shrink-0\"></span>\n\t{/if}\n\n\t<!-- segmented swipe | likes -->\n\t<div\n\t\tclass=\"flex items-center rounded-full border border-white/15 bg-black/40 p-0.5 backdrop-blur-xl\"\n\t>\n\t\t<a\n\t\t\thref=\"/a\"\n\t\t\tdata-sveltekit-noscroll\n\t\t\tdata-sveltekit-preload-data=\"hover\"\n\t\t\tclass=\"rounded-full px-3.5 py-1.5 font-display text-[13px] font-bold no-underline transition-colors {shown ===\n\t\t\t'swipe'\n\t\t\t\t? 'bg-white text-bg'\n\t\t\t\t: 'text-white/70 hover:text-white'}\">{t('swipe')}</a\n\t\t>\n\t\t<a\n\t\t\thref=\"/a/likes\"\n\t\t\tdata-sveltekit-preload-data=\"hover\"\n\t\t\tclass=\"flex items-center gap-1.5 rounded-full px-3.5 py-1.5 font-display text-[13px] font-bold no-underline transition-colors {shown ===\n\t\t\t'likes'\n\t\t\t\t? 'bg-white text-bg'\n\t\t\t\t: 'text-white/70 hover:text-white'}\"\n\t\t>\n\t\t\t{t('likes')}\n\t\t\t{#if likesCount > 0}\n\t\t\t\t<span class=\"rounded-full bg-orange px-1.5 text-[11px] font-bold text-white\">{likesCount}</span>\n\t\t\t{/if}\n\t\t</a>\n\t</div>\n\n\t<div class=\"flex shrink-0 items-center gap-2\">\n\t\t<a\n\t\t\thref=\"/a/submit\"\n\t\t\taria-label={t('post your shot')}\n\t\t\tclass=\"flex h-9 w-9 items-center justify-center rounded-full bg-orange text-white no-underline shadow-[0_4px_14px_rgba(249,115,22,0.45)] transition-transform active:scale-95\"\n\t\t>\n\t\t\t<svg class=\"h-4 w-4\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2.5\">\n\t\t\t\t<path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M12 4.5v15m7.5-7.5h-15\" />\n\t\t\t</svg>\n\t\t</a>\n\t\t<a\n\t\t\thref=\"/a/dashboard\"\n\t\t\taria-label={t('your dashboard')}\n\t\t\tclass=\"flex h-9 w-9 items-center justify-center rounded-full border border-white/25 bg-white/10 text-white no-underline backdrop-blur transition-colors hover:bg-white/[.15]\"\n\t\t>\n\t\t\t<svg class=\"h-4 w-4\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"1.8\">\n\t\t\t\t<path\n\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t\td=\"M4 5h6v6H4zM14 5h6v6h-6zM4 15h6v6H4zM14 15h6v6h-6z\"\n\t\t\t\t/>\n\t\t\t</svg>\n\t\t</a>\n\t</div>\n</div>\n","/** RAT-420: live \"likes you\" count. The server hints `arena_likes_changed` on\n *  the `user:<id>` channel whenever a vote/rewind may have changed the viewer's\n *  likes list; subscribers refetch the real count (the event carries no data).\n */\nimport { realtime } from './client';\n\nexport function onArenaLikesChanged(userId: string, cb: () => void): () => void {\n\treturn realtime.subscribe(`user:${userId}`, (evt) => {\n\t\tif (evt.type === 'arena_likes_changed') cb();\n\t});\n}\n"],"version":3}