aboutsummaryrefslogtreecommitdiffstats
path: root/web/dist/v3/assets
diff options
context:
space:
mode:
authorAdam Mathes <adam@adammathes.com>2026-02-28 16:17:43 -0800
committerGitHub <noreply@github.com>2026-02-28 16:17:43 -0800
commit5785d164eb54ae87d2f831a649fb1d4d10cca970 (patch)
tree020cbd30711b1ee7eea3d077389ec381eded4a4e /web/dist/v3/assets
parent81c35390da64a061a9a8867c497eb992f05340bc (diff)
parentdf5e7d93963f0256285b13ddf750761930797e78 (diff)
downloadneko-5785d164eb54ae87d2f831a649fb1d4d10cca970.tar.gz
neko-5785d164eb54ae87d2f831a649fb1d4d10cca970.tar.bz2
neko-5785d164eb54ae87d2f831a649fb1d4d10cca970.zip
Merge pull request #24 from adammathes/claude/agents-file-mobile-stars-2nj6yHEADmaster
Fix item ID type coercion in star/read toggles
Diffstat (limited to 'web/dist/v3/assets')
-rw-r--r--web/dist/v3/assets/index-CMv6mNQe.js (renamed from web/dist/v3/assets/index-BwswC14C.js)16
1 files changed, 8 insertions, 8 deletions
diff --git a/web/dist/v3/assets/index-BwswC14C.js b/web/dist/v3/assets/index-CMv6mNQe.js
index 8a534a2..c43c178 100644
--- a/web/dist/v3/assets/index-BwswC14C.js
+++ b/web/dist/v3/assets/index-CMv6mNQe.js
@@ -1,4 +1,4 @@
-(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const r of o.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&i(r)}).observe(document,{childList:!0,subtree:!0});function n(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function i(s){if(s.ep)return;s.ep=!0;const o=n(s);fetch(s.href,o)}})();function C(e){const n=`; ${document.cookie}`.split(`; ${e}=`);if(n.length===2)return n.pop()?.split(";").shift()}async function m(e,t){const n=t?.method?.toUpperCase()||"GET",i=["POST","PUT","DELETE"].includes(n),s=new Headers(t?.headers||{});if(i){const o=C("csrf_token");o&&s.set("X-CSRF-Token",o)}return fetch(e,{...t,headers:s,credentials:"include"})}function P(){const e=document.cookie.split("; ").find(t=>t.startsWith("neko_sidebar="));return e?e.split("=")[1]==="1":null}function H(e){document.cookie=`neko_sidebar=${e?"1":"0"}; path=/; max-age=31536000; SameSite=Lax`}function M(){const e=P();return e!==null?e:window.innerWidth>1024}class D extends EventTarget{feeds=[];tags=[];items=[];activeFeedId=null;activeTagName=null;filter="unread";searchQuery="";loading=!1;hasMore=!0;theme=localStorage.getItem("neko-theme")||"light";fontTheme=localStorage.getItem("neko-font-theme")||"default";headingFontTheme=localStorage.getItem("neko-heading-font-theme")||"default";styleTheme=localStorage.getItem("neko-style-theme")||"default";sidebarVisible=M();setFeeds(t){this.feeds=t,this.emit("feeds-updated")}setTags(t){this.tags=t,this.emit("tags-updated")}setItems(t,n=!1){n?this.items=[...this.items,...t]:this.items=t,this.emit("items-updated")}setActiveFeed(t){this.activeFeedId=t,this.activeTagName=null,this.emit("active-feed-updated")}setActiveTag(t){this.activeTagName=t,this.activeFeedId=null,this.emit("active-tag-updated")}setFilter(t){this.filter!==t&&(this.filter=t,this.emit("filter-updated"))}setSearchQuery(t){this.searchQuery!==t&&(this.searchQuery=t,this.emit("search-updated"))}setLoading(t){this.loading=t,this.emit("loading-state-changed")}setHasMore(t){this.hasMore=t}setTheme(t){this.theme=t,localStorage.setItem("neko-theme",t),this.emit("theme-updated")}setFontTheme(t){this.fontTheme=t,localStorage.setItem("neko-font-theme",t),this.emit("theme-updated")}setHeadingFontTheme(t){this.headingFontTheme=t,localStorage.setItem("neko-heading-font-theme",t),this.emit("theme-updated")}setStyleTheme(t){this.styleTheme=t,localStorage.setItem("neko-style-theme",t),this.emit("style-theme-updated")}setSidebarVisible(t){this.sidebarVisible=t,H(t),this.emit("sidebar-toggle")}toggleSidebar(){this.setSidebarVisible(!this.sidebarVisible)}emit(t,n){this.dispatchEvent(new CustomEvent(t,{detail:n}))}on(t,n){this.addEventListener(t,n)}}const a=new D;class O extends EventTarget{constructor(){super(),window.addEventListener("popstate",()=>this.handleRouteChange())}handleRouteChange(){this.dispatchEvent(new CustomEvent("route-changed",{detail:this.getCurrentRoute()}))}getCurrentRoute(){const t=new URL(window.location.href),i=t.pathname.replace(/^\/v3\//,"").split("/").filter(Boolean);let s="/";const o={};return i[0]==="feed"&&i[1]?(s="/feed",o.feedId=i[1]):i[0]==="tag"&&i[1]?(s="/tag",o.tagName=decodeURIComponent(i[1])):i[0]==="settings"&&(s="/settings"),{path:s,params:o,query:t.searchParams}}navigate(t,n){let i=`/v3${t}`;if(n){const s=new URLSearchParams(n);i+=`?${s.toString()}`}window.history.pushState({},"",i),this.handleRouteChange()}updateQuery(t){const n=new URL(window.location.href);for(const[i,s]of Object.entries(t))s?n.searchParams.set(i,s):n.searchParams.delete(i);window.history.pushState({},"",n.toString()),this.handleRouteChange()}}const d=new O;function q(e){const t=new Date(e.publish_date).toLocaleDateString();return`
+(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const r of o.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&i(r)}).observe(document,{childList:!0,subtree:!0});function n(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function i(s){if(s.ep)return;s.ep=!0;const o=n(s);fetch(s.href,o)}})();function B(e){const n=`; ${document.cookie}`.split(`; ${e}=`);if(n.length===2)return n.pop()?.split(";").shift()}async function f(e,t){const n=t?.method?.toUpperCase()||"GET",i=["POST","PUT","DELETE"].includes(n),s=new Headers(t?.headers||{});if(i){const o=B("csrf_token");o&&s.set("X-CSRF-Token",o)}return fetch(e,{...t,headers:s,credentials:"include"})}function C(){const e=document.cookie.split("; ").find(t=>t.startsWith("neko_sidebar="));return e?e.split("=")[1]==="1":null}function P(e){document.cookie=`neko_sidebar=${e?"1":"0"}; path=/; max-age=31536000; SameSite=Lax`}function H(){const e=C();return e!==null?e:window.innerWidth>1024}class M extends EventTarget{feeds=[];tags=[];items=[];activeFeedId=null;activeTagName=null;filter="unread";searchQuery="";loading=!1;hasMore=!0;theme=localStorage.getItem("neko-theme")||"light";fontTheme=localStorage.getItem("neko-font-theme")||"default";headingFontTheme=localStorage.getItem("neko-heading-font-theme")||"default";styleTheme=localStorage.getItem("neko-style-theme")||"default";sidebarVisible=H();setFeeds(t){this.feeds=t,this.emit("feeds-updated")}setTags(t){this.tags=t,this.emit("tags-updated")}setItems(t,n=!1){n?this.items=[...this.items,...t]:this.items=t,this.emit("items-updated")}setActiveFeed(t){this.activeFeedId=t,this.activeTagName=null,this.emit("active-feed-updated")}setActiveTag(t){this.activeTagName=t,this.activeFeedId=null,this.emit("active-tag-updated")}setFilter(t){this.filter!==t&&(this.filter=t,this.emit("filter-updated"))}setSearchQuery(t){this.searchQuery!==t&&(this.searchQuery=t,this.emit("search-updated"))}setLoading(t){this.loading=t,this.emit("loading-state-changed")}setHasMore(t){this.hasMore=t}setTheme(t){this.theme=t,localStorage.setItem("neko-theme",t),this.emit("theme-updated")}setFontTheme(t){this.fontTheme=t,localStorage.setItem("neko-font-theme",t),this.emit("theme-updated")}setHeadingFontTheme(t){this.headingFontTheme=t,localStorage.setItem("neko-heading-font-theme",t),this.emit("theme-updated")}setStyleTheme(t){this.styleTheme=t,localStorage.setItem("neko-style-theme",t),this.emit("style-theme-updated")}setSidebarVisible(t){this.sidebarVisible=t,P(t),this.emit("sidebar-toggle")}toggleSidebar(){this.setSidebarVisible(!this.sidebarVisible)}emit(t,n){this.dispatchEvent(new CustomEvent(t,{detail:n}))}on(t,n){this.addEventListener(t,n)}}const a=new M;class D extends EventTarget{constructor(){super(),window.addEventListener("popstate",()=>this.handleRouteChange())}handleRouteChange(){this.dispatchEvent(new CustomEvent("route-changed",{detail:this.getCurrentRoute()}))}getCurrentRoute(){const t=new URL(window.location.href),i=t.pathname.replace(/^\/v3\//,"").split("/").filter(Boolean);let s="/";const o={};return i[0]==="feed"&&i[1]?(s="/feed",o.feedId=i[1]):i[0]==="tag"&&i[1]?(s="/tag",o.tagName=decodeURIComponent(i[1])):i[0]==="settings"&&(s="/settings"),{path:s,params:o,query:t.searchParams}}navigate(t,n){let i=`/v3${t}`;if(n){const s=new URLSearchParams(n);i+=`?${s.toString()}`}window.history.pushState({},"",i),this.handleRouteChange()}updateQuery(t){const n=new URL(window.location.href);for(const[i,s]of Object.entries(t))s?n.searchParams.set(i,s):n.searchParams.delete(i);window.history.pushState({},"",n.toString()),this.handleRouteChange()}}const d=new D;function O(e){const t=new Date(e.publish_date).toLocaleDateString();return`
<li class="feed-item ${e.read?"read":"unread"}" data-id="${e._id}">
<div class="item-header">
<a href="${e.url}" target="_blank" rel="noopener noreferrer" class="item-title" data-action="open">
@@ -20,7 +20,7 @@
</div>
`:""}
</li>
- `}const x=new URLSearchParams(window.location.search),L=x.has("debug");function y(...e){L&&console.log("[NEKO-DEBUG]",...e)}typeof window<"u"&&(window.app=window.app||{},window.app.debug=()=>{const e=new URL(window.location.href);e.searchParams.set("debug","1"),window.location.href=e.toString()});const N=["default","refined","terminal","codex","sakura"];function $(e){const t=document.getElementById("style-theme-link");if(t&&t.remove(),e==="default")return;const n=document.createElement("link");n.id="style-theme-link",n.rel="stylesheet",n.href=`/v3/themes/${e}.css`,document.head.appendChild(n)}let f=null,g=null;function U(){g=document.querySelector("#app"),g&&(g.className=`theme-${a.theme} font-${a.fontTheme} heading-font-${a.headingFontTheme}`,g.innerHTML=`
+ `}const q=new URLSearchParams(window.location.search),L=q.has("debug");function y(...e){L&&console.log("[NEKO-DEBUG]",...e)}typeof window<"u"&&(window.app=window.app||{},window.app.debug=()=>{const e=new URL(window.location.href);e.searchParams.set("debug","1"),window.location.href=e.toString()});const x=["default","refined","terminal","codex","sakura"];function $(e){const t=document.getElementById("style-theme-link");if(t&&t.remove(),e==="default")return;const n=document.createElement("link");n.id="style-theme-link",n.rel="stylesheet",n.href=`/v3/themes/${e}.css`,document.head.appendChild(n)}let m=null,g=null;function U(){g=document.querySelector("#app"),g&&(g.className=`theme-${a.theme} font-${a.fontTheme} heading-font-${a.headingFontTheme}`,g.innerHTML=`
<div class="layout ${a.sidebarVisible?"sidebar-visible":"sidebar-hidden"}">
<button class="sidebar-toggle" id="sidebar-toggle-btn" title="Toggle Sidebar">🐱</button>
<div class="sidebar-backdrop" id="sidebar-backdrop"></div>
@@ -75,18 +75,18 @@
<div id="content-area"></div>
</main>
</div>
- `,j())}function j(){document.getElementById("search-input")?.addEventListener("input",s=>{const o=s.target.value;d.updateQuery({q:o})}),document.getElementById("logo-link")?.addEventListener("click",()=>d.navigate("/")),document.getElementById("logout-button")?.addEventListener("click",s=>{s.preventDefault(),K()}),document.querySelectorAll(".sidebar-theme-btn").forEach(s=>{s.addEventListener("click",()=>{const o=s.getAttribute("data-theme");o&&a.setTheme(o)})}),document.querySelectorAll(".sidebar-style-btn").forEach(s=>{s.addEventListener("click",()=>{const o=s.getAttribute("data-style-theme");o&&a.setStyleTheme(o)})}),document.getElementById("sidebar-toggle-btn")?.addEventListener("click",()=>{a.toggleSidebar()}),document.getElementById("sidebar-backdrop")?.addEventListener("click",()=>{a.setSidebarVisible(!1)}),document.querySelectorAll(".sidebar-section.collapsible h3").forEach(s=>{s.addEventListener("click",()=>{s.parentElement?.classList.toggle("collapsed")})}),document.getElementById("sidebar")?.addEventListener("click",s=>{const o=s.target,r=o.closest("a");if(!r){o.classList.contains("logo")&&(s.preventDefault(),d.navigate("/",{}));return}const h=r.getAttribute("data-nav"),u=Object.fromEntries(d.getCurrentRoute().query.entries());if(h==="filter"){s.preventDefault();const l=r.getAttribute("data-value");d.getCurrentRoute().path==="/settings"?d.navigate("/",{...u,filter:l}):d.updateQuery({filter:l})}else if(h==="tag"){s.preventDefault();const l=r.getAttribute("data-value");d.navigate(`/tag/${encodeURIComponent(l)}`,u)}else if(h==="feed"){s.preventDefault();const l=r.getAttribute("data-value"),c=d.getCurrentRoute();a.activeFeedId===parseInt(l)&&c.path!=="/settings"?d.navigate("/",u):d.navigate(`/feed/${l}`,u)}else h==="settings"&&(s.preventDefault(),d.getCurrentRoute().path==="/settings"?d.navigate("/",u):d.navigate("/settings",u));window.innerWidth<=768&&a.setSidebarVisible(!1)}),document.getElementById("content-area")?.addEventListener("click",s=>{const o=s.target,r=o.closest('[data-action="toggle-star"]');if(r){const c=r.closest("[data-id]");if(c){const b=parseInt(c.getAttribute("data-id"));G(b)}return}const h=o.closest('[data-action="scrape"]');if(h){const c=h.closest("[data-id]");if(c){const b=parseInt(c.getAttribute("data-id"));J(b)}return}const u=o.closest('[data-action="open"]'),l=o.closest(".feed-item");if(l&&!u){const c=parseInt(l.getAttribute("data-id"));f=c;const b=a.items.find(B=>B._id===c);b&&!b.read&&p(c,{read:!0})}})}function F(){const{feeds:e,activeFeedId:t}=a,n=document.getElementById("feed-list");n&&(n.innerHTML=e.map(i=>`
+ `,j())}function j(){document.getElementById("search-input")?.addEventListener("input",s=>{const o=s.target.value;d.updateQuery({q:o})}),document.getElementById("logo-link")?.addEventListener("click",()=>d.navigate("/")),document.getElementById("logout-button")?.addEventListener("click",s=>{s.preventDefault(),K()}),document.querySelectorAll(".sidebar-theme-btn").forEach(s=>{s.addEventListener("click",()=>{const o=s.getAttribute("data-theme");o&&a.setTheme(o)})}),document.querySelectorAll(".sidebar-style-btn").forEach(s=>{s.addEventListener("click",()=>{const o=s.getAttribute("data-style-theme");o&&a.setStyleTheme(o)})}),document.getElementById("sidebar-toggle-btn")?.addEventListener("click",()=>{a.toggleSidebar()}),document.getElementById("sidebar-backdrop")?.addEventListener("click",()=>{a.setSidebarVisible(!1)}),document.querySelectorAll(".sidebar-section.collapsible h3").forEach(s=>{s.addEventListener("click",()=>{s.parentElement?.classList.toggle("collapsed")})}),document.getElementById("sidebar")?.addEventListener("click",s=>{const o=s.target,r=o.closest("a");if(!r){o.classList.contains("logo")&&(s.preventDefault(),d.navigate("/",{}));return}const h=r.getAttribute("data-nav"),u=Object.fromEntries(d.getCurrentRoute().query.entries());if(h==="filter"){s.preventDefault();const l=r.getAttribute("data-value");d.getCurrentRoute().path==="/settings"?d.navigate("/",{...u,filter:l}):d.updateQuery({filter:l})}else if(h==="tag"){s.preventDefault();const l=r.getAttribute("data-value");d.navigate(`/tag/${encodeURIComponent(l)}`,u)}else if(h==="feed"){s.preventDefault();const l=r.getAttribute("data-value"),c=d.getCurrentRoute();a.activeFeedId===parseInt(l)&&c.path!=="/settings"?d.navigate("/",u):d.navigate(`/feed/${l}`,u)}else h==="settings"&&(s.preventDefault(),d.getCurrentRoute().path==="/settings"?d.navigate("/",u):d.navigate("/settings",u));window.innerWidth<=768&&a.setSidebarVisible(!1)}),document.getElementById("content-area")?.addEventListener("click",s=>{const o=s.target,r=o.closest('[data-action="toggle-star"]');if(r){const c=r.closest("[data-id]");if(c){const b=parseInt(c.getAttribute("data-id"));G(b)}return}const h=o.closest('[data-action="scrape"]');if(h){const c=h.closest("[data-id]");if(c){const b=parseInt(c.getAttribute("data-id"));J(b)}return}const u=o.closest('[data-action="open"]'),l=o.closest(".feed-item");if(l&&!u){const c=parseInt(l.getAttribute("data-id"));m=c;const b=a.items.find(N=>Number(N._id)===Number(c));b&&!b.read&&p(c,{read:!0})}})}function F(){const{feeds:e,activeFeedId:t}=a,n=document.getElementById("feed-list");n&&(n.innerHTML=e.map(i=>`
<li class="${i._id===t?"active":""}">
<a href="/v3/feed/${i._id}" data-nav="feed" data-value="${i._id}">
${i.title||i.url}
</a>
</li>
- `).join(""))}function R(){}function A(){const{filter:e}=a,t=document.getElementById("filter-list");t&&t.querySelectorAll("li").forEach(n=>{n.classList.toggle("active",n.getAttribute("data-filter")===e)})}function S(){const{items:e,loading:t}=a,n=document.getElementById("content-area");if(!n||d.getCurrentRoute().path==="/settings")return;if(t&&e.length===0){n.innerHTML='<p class="loading">Loading items...</p>';return}if(e.length===0){n.innerHTML='<p class="empty">No items found.</p>';return}n.innerHTML=`
+ `).join(""))}function R(){}function _(){const{filter:e}=a,t=document.getElementById("filter-list");t&&t.querySelectorAll("li").forEach(n=>{n.classList.toggle("active",n.getAttribute("data-filter")===e)})}function S(){const{items:e,loading:t}=a,n=document.getElementById("content-area");if(!n||d.getCurrentRoute().path==="/settings")return;if(t&&e.length===0){n.innerHTML='<p class="loading">Loading items...</p>';return}if(e.length===0){n.innerHTML='<p class="empty">No items found.</p>';return}n.innerHTML=`
<ul class="item-list">
- ${e.map(s=>q(s)).join("")}
+ ${e.map(s=>O(s)).join("")}
</ul>
${a.hasMore?'<div id="load-more-sentinel" class="loading-more">Loading more...</div>':""}
- `;const i=document.getElementById("main-content");if(i){let s=null;const o=()=>{!a.loading&&a.hasMore&&i.scrollHeight>i.clientHeight&&i.scrollHeight-i.scrollTop-i.clientHeight<200&&w(),s===null&&(s=window.setTimeout(()=>{_(i),s=null},250))};i.onscroll=o,window.onscroll=o}}function _(e){const n=(e||document.getElementById("main-content")||document.documentElement).getBoundingClientRect();y("checkReadItems start",{containerTop:n.top});const i=document.querySelectorAll(".feed-item.unread");for(const s of i){const o=s.getAttribute("data-id");if(!o)continue;const r=parseInt(o);if(a.items.find(c=>c._id===r)?.read)continue;const u=s.getBoundingClientRect(),l=u.bottom<n.top+5;L&&y(`Item ${r} check`,{rectBottom:u.bottom,containerTop:n.top,isPast:l}),l&&(y(`Marking as read (scrolled past): ${r}`),p(r,{read:!0}))}}typeof window<"u"&&setInterval(()=>{const e=document.getElementById("main-content");if(e&&_(e),a.loading||!a.hasMore)return;if(e&&e.scrollHeight>e.clientHeight&&e.scrollHeight-e.scrollTop-e.clientHeight<200){w();return}const t=document.documentElement.scrollHeight||document.body.scrollHeight,n=window.innerHeight,i=window.scrollY||document.documentElement.scrollTop;t>n&&t-n-i<200&&w()},1e3);function v(){const e=document.getElementById("content-area");if(!e)return;e.innerHTML=`
+ `;const i=document.getElementById("main-content");if(i){let s=null;const o=()=>{!a.loading&&a.hasMore&&i.scrollHeight>i.clientHeight&&i.scrollHeight-i.scrollTop-i.clientHeight<200&&w(),s===null&&(s=window.setTimeout(()=>{A(i),s=null},250))};i.onscroll=o,window.onscroll=o}}function A(e){const n=(e||document.getElementById("main-content")||document.documentElement).getBoundingClientRect();y("checkReadItems start",{containerTop:n.top});const i=document.querySelectorAll(".feed-item.unread");for(const s of i){const o=s.getAttribute("data-id");if(!o)continue;const r=parseInt(o);if(a.items.find(c=>Number(c._id)===Number(r))?.read)continue;const u=s.getBoundingClientRect(),l=u.bottom<n.top+5;L&&y(`Item ${r} check`,{rectBottom:u.bottom,containerTop:n.top,isPast:l}),l&&(y(`Marking as read (scrolled past): ${r}`),p(r,{read:!0}))}}typeof window<"u"&&setInterval(()=>{const e=document.getElementById("main-content");if(e&&A(e),a.loading||!a.hasMore)return;if(e&&e.scrollHeight>e.clientHeight&&e.scrollHeight-e.scrollTop-e.clientHeight<200){w();return}const t=document.documentElement.scrollHeight||document.body.scrollHeight,n=window.innerHeight,i=window.scrollY||document.documentElement.scrollTop;t>n&&t-n-i<200&&w()},1e3);function v(){const e=document.getElementById("content-area");if(!e)return;e.innerHTML=`
<div class="settings-view">
<h2>Settings</h2>
@@ -124,7 +124,7 @@
<h3>Style</h3>
<div class="settings-group">
<div class="theme-options" id="style-theme-options">
- ${N.map(i=>`<button class="${a.styleTheme===i?"active":""}" data-style-theme="${i}">${i.charAt(0).toUpperCase()+i.slice(1)}</button>`).join(`
+ ${x.map(i=>`<button class="${a.styleTheme===i?"active":""}" data-style-theme="${i}">${i.charAt(0).toUpperCase()+i.slice(1)}</button>`).join(`
`)}
</div>
</div>
@@ -179,4 +179,4 @@
</ul>
</section>
</div>
- `,document.getElementById("theme-options")?.addEventListener("click",i=>{const s=i.target.closest("button");s&&(a.setTheme(s.getAttribute("data-theme")),v())}),document.getElementById("style-theme-options")?.addEventListener("click",i=>{const s=i.target.closest("button");s&&a.setStyleTheme(s.getAttribute("data-style-theme"))}),document.getElementById("heading-font-selector")?.addEventListener("change",i=>{a.setHeadingFontTheme(i.target.value)}),document.getElementById("font-selector")?.addEventListener("change",i=>{a.setFontTheme(i.target.value)}),document.getElementById("add-feed-btn")?.addEventListener("click",async()=>{const i=document.getElementById("new-feed-url"),s=i.value.trim();s&&(await Q(s)?(i.value="",alert("Feed added successfully!"),T()):alert("Failed to add feed."))});let t="opml";const n=document.getElementById("import-file");document.querySelectorAll(".import-btn").forEach(i=>{i.addEventListener("click",s=>{t=s.currentTarget.getAttribute("data-format")||"opml",n.click()})}),n?.addEventListener("change",async i=>{const s=i.target.files?.[0];s&&(await V(s,t)?(alert(`Import (${t}) started! check logs.`),T()):alert("Failed to import.")),n.value=""}),document.querySelectorAll(".delete-feed-btn").forEach(i=>{i.addEventListener("click",async s=>{const o=parseInt(s.target.getAttribute("data-id"));confirm("Delete this feed?")&&(await X(o),await T(),v())})})}async function Q(e){try{return(await m("/api/feed",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:e})})).ok}catch(t){return console.error("Failed to add feed",t),!1}}async function V(e,t){try{const n=new FormData;n.append("file",e),n.append("format",t);const i=document.cookie.split("; ").find(o=>o.startsWith("csrf_token="))?.split("=")[1];return(await fetch("/api/import",{method:"POST",headers:{"X-CSRF-Token":i||""},body:n})).ok}catch(n){return console.error("Failed to import",n),!1}}async function X(e){try{return(await m(`/api/feed/${e}`,{method:"DELETE"})).ok}catch(t){return console.error("Failed to delete feed",t),!1}}async function G(e){const t=a.items.find(n=>n._id===e);t&&p(e,{starred:!t.starred})}async function J(e){if(a.items.find(n=>n._id===e))try{const n=await m(`/api/item/${e}/content`);if(n.ok){const i=await n.json();i.full_content&&p(e,{full_content:i.full_content})}}catch(n){console.error("Failed to fetch full content",n)}}async function p(e,t){const n=String(e);y("updateItem called",n,t);try{if((await m(`/api/item/${n}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})).ok){const s=a.items.find(o=>String(o._id)===n);if(s){Object.assign(s,t);const o=document.querySelector(`.feed-item[data-id="${e}"]`);if(o){if(t.read!==void 0&&(o.classList.toggle("read",t.read),o.classList.toggle("unread",!t.read)),t.starred!==void 0){const r=o.querySelector(".star-btn");r&&(r.classList.toggle("is-starred",t.starred),r.classList.toggle("is-unstarred",!t.starred),r.setAttribute("title",t.starred?"Unstar":"Star"))}t.full_content&&S()}}}}catch(i){console.error("Failed to update item",i)}}async function T(){const e=await m("/api/feed/");if(e.ok){const t=await e.json();a.setFeeds(t)}}async function W(){const e=await m("/api/tag");if(e.ok){const t=await e.json();a.setTags(t)}}async function E(e,t,n=!1){a.setLoading(!0);try{const i=new URLSearchParams;e&&i.append("feed_id",e),t&&i.append("tag",t),a.searchQuery&&i.append("q",a.searchQuery),(a.filter==="starred"||a.filter==="all")&&i.append("read_filter","all"),a.filter==="starred"&&i.append("starred","true"),n&&a.items.length>0&&i.append("max_id",String(a.items[a.items.length-1]._id));const s=await m(`/api/stream?${i.toString()}`);if(s.ok){const o=await s.json();a.setHasMore(o.length>0),a.setItems(o,n)}}finally{a.setLoading(!1)}}async function w(){const e=d.getCurrentRoute();E(e.params.feedId,e.params.tagName,!0)}async function K(){await m("/api/logout",{method:"POST"}),window.location.href="/login/"}function I(){const e=d.getCurrentRoute(),t=e.query.get("filter");a.setFilter(t||"unread");const n=e.query.get("q");if(n!==null&&a.setSearchQuery(n),e.path==="/settings"){v();return}if(e.path==="/feed"&&e.params.feedId){const i=parseInt(e.params.feedId);a.setActiveFeed(i),E(e.params.feedId),document.getElementById("section-feeds")?.classList.remove("collapsed")}else e.path==="/tag"&&e.params.tagName?(a.setActiveTag(e.params.tagName),E(void 0,e.params.tagName),document.getElementById("section-tags")?.classList.remove("collapsed")):(a.setActiveFeed(null),a.setActiveTag(null),E())}window.addEventListener("keydown",e=>{if(!["INPUT","TEXTAREA"].includes(e.target.tagName))switch(e.key){case"j":k(1);break;case"k":k(-1);break;case"r":if(f){const t=a.items.find(n=>n._id===f);t&&p(t._id,{read:!t.read})}break;case"s":if(f){const t=a.items.find(n=>n._id===f);t&&p(t._id,{starred:!t.starred})}break;case"/":e.preventDefault(),document.getElementById("search-input")?.focus();break}});function k(e){if(a.items.length===0)return;const t=a.items.findIndex(i=>i._id===f);let n;if(t===-1?n=e>0?0:a.items.length-1:n=t+e,n>=0&&n<a.items.length){f=a.items[n]._id;const i=document.querySelector(`.feed-item[data-id="${f}"]`);i&&i.scrollIntoView({block:"start",behavior:"instant"}),a.items[n].read||p(f,{read:!0})}}a.on("feeds-updated",F);a.on("tags-updated",R);a.on("active-feed-updated",F);a.on("active-tag-updated",R);a.on("filter-updated",A);a.on("search-updated",()=>{const e=document.getElementById("search-input");e&&e.value!==a.searchQuery&&(e.value=a.searchQuery),I()});a.on("theme-updated",()=>{g||(g=document.querySelector("#app")),g&&(g.className=`theme-${a.theme} font-${a.fontTheme} heading-font-${a.headingFontTheme}`),document.querySelectorAll(".sidebar-theme-btn").forEach(e=>{e.classList.toggle("active",e.getAttribute("data-theme")===a.theme)}),d.getCurrentRoute().path==="/settings"&&v()});a.on("sidebar-toggle",()=>{const e=document.querySelector(".layout");e&&(a.sidebarVisible?(e.classList.remove("sidebar-hidden"),e.classList.add("sidebar-visible")):(e.classList.remove("sidebar-visible"),e.classList.add("sidebar-hidden")))});a.on("style-theme-updated",()=>{$(a.styleTheme),document.querySelectorAll(".sidebar-style-btn").forEach(e=>{e.classList.toggle("active",e.getAttribute("data-style-theme")===a.styleTheme)}),d.getCurrentRoute().path==="/settings"&&v()});a.on("items-updated",S);a.on("loading-state-changed",S);d.addEventListener("route-changed",I);window.app={navigate:e=>d.navigate(e)};async function Y(){const e=await m("/api/auth");if(!e||e.status===401){window.location.href="/login/";return}U(),$(a.styleTheme),A();try{await Promise.all([T(),W()])}catch(t){console.error("Initial fetch failed",t)}I()}typeof window<"u"&&!window.__VITEST__&&Y();
+ `,document.getElementById("theme-options")?.addEventListener("click",i=>{const s=i.target.closest("button");s&&(a.setTheme(s.getAttribute("data-theme")),v())}),document.getElementById("style-theme-options")?.addEventListener("click",i=>{const s=i.target.closest("button");s&&a.setStyleTheme(s.getAttribute("data-style-theme"))}),document.getElementById("heading-font-selector")?.addEventListener("change",i=>{a.setHeadingFontTheme(i.target.value)}),document.getElementById("font-selector")?.addEventListener("change",i=>{a.setFontTheme(i.target.value)}),document.getElementById("add-feed-btn")?.addEventListener("click",async()=>{const i=document.getElementById("new-feed-url"),s=i.value.trim();s&&(await Q(s)?(i.value="",alert("Feed added successfully!"),T()):alert("Failed to add feed."))});let t="opml";const n=document.getElementById("import-file");document.querySelectorAll(".import-btn").forEach(i=>{i.addEventListener("click",s=>{t=s.currentTarget.getAttribute("data-format")||"opml",n.click()})}),n?.addEventListener("change",async i=>{const s=i.target.files?.[0];s&&(await V(s,t)?(alert(`Import (${t}) started! check logs.`),T()):alert("Failed to import.")),n.value=""}),document.querySelectorAll(".delete-feed-btn").forEach(i=>{i.addEventListener("click",async s=>{const o=parseInt(s.target.getAttribute("data-id"));confirm("Delete this feed?")&&(await X(o),await T(),v())})})}async function Q(e){try{return(await f("/api/feed",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:e})})).ok}catch(t){return console.error("Failed to add feed",t),!1}}async function V(e,t){try{const n=new FormData;n.append("file",e),n.append("format",t);const i=document.cookie.split("; ").find(o=>o.startsWith("csrf_token="))?.split("=")[1];return(await fetch("/api/import",{method:"POST",headers:{"X-CSRF-Token":i||""},body:n})).ok}catch(n){return console.error("Failed to import",n),!1}}async function X(e){try{return(await f(`/api/feed/${e}`,{method:"DELETE"})).ok}catch(t){return console.error("Failed to delete feed",t),!1}}async function G(e){const t=a.items.find(n=>Number(n._id)===Number(e));t&&p(e,{starred:!t.starred})}async function J(e){if(a.items.find(n=>Number(n._id)===Number(e)))try{const n=await f(`/api/item/${e}/content`);if(n.ok){const i=await n.json();i.full_content&&p(e,{full_content:i.full_content})}}catch(n){console.error("Failed to fetch full content",n)}}async function p(e,t){const n=String(e);y("updateItem called",n,t);try{if((await f(`/api/item/${n}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})).ok){const s=a.items.find(o=>String(o._id)===n);if(s){Object.assign(s,t);const o=document.querySelector(`.feed-item[data-id="${e}"]`);if(o){if(t.read!==void 0&&(o.classList.toggle("read",t.read),o.classList.toggle("unread",!t.read)),t.starred!==void 0){const r=o.querySelector(".star-btn");r&&(r.classList.toggle("is-starred",t.starred),r.classList.toggle("is-unstarred",!t.starred),r.setAttribute("title",t.starred?"Unstar":"Star"))}t.full_content&&S()}}}}catch(i){console.error("Failed to update item",i)}}async function T(){const e=await f("/api/feed/");if(e.ok){const t=await e.json();a.setFeeds(t)}}async function W(){const e=await f("/api/tag");if(e.ok){const t=await e.json();a.setTags(t)}}async function E(e,t,n=!1){a.setLoading(!0);try{const i=new URLSearchParams;e&&i.append("feed_id",e),t&&i.append("tag",t),a.searchQuery&&i.append("q",a.searchQuery),(a.filter==="starred"||a.filter==="all")&&i.append("read_filter","all"),a.filter==="starred"&&i.append("starred","true"),n&&a.items.length>0&&i.append("max_id",String(a.items[a.items.length-1]._id));const s=await f(`/api/stream?${i.toString()}`);if(s.ok){const o=await s.json();for(const r of o)r._id=Number(r._id);a.setHasMore(o.length>0),a.setItems(o,n)}}finally{a.setLoading(!1)}}async function w(){const e=d.getCurrentRoute();E(e.params.feedId,e.params.tagName,!0)}async function K(){await f("/api/logout",{method:"POST"}),window.location.href="/login/"}function I(){const e=d.getCurrentRoute(),t=e.query.get("filter");a.setFilter(t||"unread");const n=e.query.get("q");if(n!==null&&a.setSearchQuery(n),e.path==="/settings"){v();return}if(e.path==="/feed"&&e.params.feedId){const i=parseInt(e.params.feedId);a.setActiveFeed(i),E(e.params.feedId),document.getElementById("section-feeds")?.classList.remove("collapsed")}else e.path==="/tag"&&e.params.tagName?(a.setActiveTag(e.params.tagName),E(void 0,e.params.tagName),document.getElementById("section-tags")?.classList.remove("collapsed")):(a.setActiveFeed(null),a.setActiveTag(null),E())}window.addEventListener("keydown",e=>{if(!["INPUT","TEXTAREA"].includes(e.target.tagName))switch(e.key){case"j":k(1);break;case"k":k(-1);break;case"r":if(m){const t=a.items.find(n=>Number(n._id)===Number(m));t&&p(t._id,{read:!t.read})}break;case"s":if(m){const t=a.items.find(n=>Number(n._id)===Number(m));t&&p(t._id,{starred:!t.starred})}break;case"/":e.preventDefault(),document.getElementById("search-input")?.focus();break}});function k(e){if(a.items.length===0)return;const t=a.items.findIndex(i=>Number(i._id)===Number(m));let n;if(t===-1?n=e>0?0:a.items.length-1:n=t+e,n>=0&&n<a.items.length){m=a.items[n]._id;const i=document.querySelector(`.feed-item[data-id="${m}"]`);i&&i.scrollIntoView({block:"start",behavior:"instant"}),a.items[n].read||p(m,{read:!0})}}a.on("feeds-updated",F);a.on("tags-updated",R);a.on("active-feed-updated",F);a.on("active-tag-updated",R);a.on("filter-updated",_);a.on("search-updated",()=>{const e=document.getElementById("search-input");e&&e.value!==a.searchQuery&&(e.value=a.searchQuery),I()});a.on("theme-updated",()=>{g||(g=document.querySelector("#app")),g&&(g.className=`theme-${a.theme} font-${a.fontTheme} heading-font-${a.headingFontTheme}`),document.querySelectorAll(".sidebar-theme-btn").forEach(e=>{e.classList.toggle("active",e.getAttribute("data-theme")===a.theme)}),d.getCurrentRoute().path==="/settings"&&v()});a.on("sidebar-toggle",()=>{const e=document.querySelector(".layout");e&&(a.sidebarVisible?(e.classList.remove("sidebar-hidden"),e.classList.add("sidebar-visible")):(e.classList.remove("sidebar-visible"),e.classList.add("sidebar-hidden")))});a.on("style-theme-updated",()=>{$(a.styleTheme),document.querySelectorAll(".sidebar-style-btn").forEach(e=>{e.classList.toggle("active",e.getAttribute("data-style-theme")===a.styleTheme)}),d.getCurrentRoute().path==="/settings"&&v()});a.on("items-updated",S);a.on("loading-state-changed",S);d.addEventListener("route-changed",I);window.app={navigate:e=>d.navigate(e)};async function Y(){const e=await f("/api/auth");if(!e||e.status===401){window.location.href="/login/";return}U(),$(a.styleTheme),_();try{await Promise.all([T(),W()])}catch(t){console.error("Initial fetch failed",t)}I()}typeof window<"u"&&!window.__VITEST__&&Y();