import"./chunks/modulepreload-polyfill-B5Qt9EMX.js";import{b as O,g as se,r as ne,a as re,m as ie}from"./chunks/db-DRCaoMWR.js";import{T as oe}from"./chunks/topics-wkZ4msF6.js";const H=100,B=10;let I=[],x=new Set,P=[],k=[],C=0,E=B,R=null,U=0;function W(e){if(!e.length)return[];const s=[],t=new Set(e);for(const n of oe)if(t.has(n.id))for(const r of n.keywords)s.push(r.toLowerCase());return s}function ce(e){if(x.size>0&&e.topicIds&&e.topicIds.length>0){for(const s of e.topicIds)if(x.has(s))return!0}if(P.length>0&&(!e.topicIds||e.topicIds.length===0)){const s=e.title.toLowerCase();for(const t of P)if(s.includes(t))return!0}if(k.length>0){const s=e.title.toLowerCase();for(const t of k)if(s.includes(t))return!0}return!1}const $=new Worker(new URL("/assets/ml-worker-lwm5PbtZ.js",import.meta.url),{type:"module"}),y=new Worker(new URL("/assets/scraper-worker-CUgj4hV0.js",import.meta.url),{type:"module"}),o={currentPage:1,articles:[],activeArticleId:null,hideRead:!0,hideLow:!0,loading:!1,modelReady:!1,digestMode:!1,_scrapeRequested:!1,_showLoading:!0,_scoreTimer:null,_preScoring:!1,_retrainPending:!1},g=document.getElementById("article-list"),ae=document.getElementById("stats-bar"),v=document.getElementById("rec-indicator"),z=document.getElementById("robot-mascot"),q=document.getElementById("toggle-hide-read"),V=document.getElementById("toggle-hide-low"),b=document.getElementById("btn-refresh"),Z=document.getElementById("refresh-countdown"),j=document.getElementById("refresh-countdown-fill");function u(e){$.postMessage(e)}function L(e,s=15e3){return new Promise((t,n)=>{const r=setTimeout(()=>{$.removeEventListener("message",i),n(new Error(`ML worker timeout waiting for ${e}`))},s),i=c=>{c.data.type===e&&(clearTimeout(r),$.removeEventListener("message",i),t(c.data))};$.addEventListener("message",i)})}async function G(e){if(e.length===0)return e;try{u({type:"score",articles:e});const s=await L("score:done",6e4);if(s.type==="score:done")return s.articles}catch(s){console.warn(`[sidepanel] score failed: ${s instanceof Error?s.message:String(s)}`)}return e}let d=[];async function h(e=1,s=!1,t=!0){if(!s&&d.length>0){o.currentPage=e,o.articles=f(e),p(),M();return}o._showLoading=t,s&&u({type:"retrain"}),o.currentPage=e,ue(),y.postMessage({type:"loadFromDB",page:1,pageSize:9999,hideRead:!1})}function f(e){const s=(e-1)*H;return d.slice(s,s+H)}y.onmessage=async e=>{const s=e.data;if(s.type==="loadFromDB:done"){if(o._preScoring)return;if(C=s.totalCount,o._showLoading){const t=s.articles.length,n=o._retrainPending?t:s.articles.filter(a=>a.recScore===0||!a.topicIds||a.topicIds.length===0).length,r=n===0?`${t.toLocaleString()}개 게시글 준비 완료`:n<t?`${n.toLocaleString()}개 새 게시글 점수 계산 중...`:`${t.toLocaleString()}개 게시글 점수 계산 중...`;g.innerHTML=`
        <div class="empty-state">
          <div class="empty-icon">🤖</div>
          <div class="empty-title">추천 점수를 계산하고 있습니다</div>
          <div class="empty-desc">${r}</div>
          <div class="scrape-progress" id="score-progress">
            <div class="scrape-progress-bar"><div class="scrape-progress-fill" id="score-progress-fill" style="width:0%;transition:width 1s linear"></div></div>
            <div class="scrape-progress-text" id="score-progress-text">모델 준비 중...</div>
          </div>
        </div>`;let i=0;const c=setInterval(()=>{i=Math.min(i+3,90);const a=document.getElementById("score-progress-fill"),l=document.getElementById("score-progress-text");a&&(a.style.width=`${i}%`),l&&(l.textContent=`점수 계산 중... ${i}%`),i>=90&&clearInterval(c)},1e3);o._scoreTimer=c}de(s.articles),w()}else s.type==="loadFromDB:error"?(g.innerHTML=`
      <div class="empty-state">
        <div class="empty-icon">⚠️</div>
        <div class="empty-title">로드 실패</div>
        <div class="empty-desc">${m(s.error)}</div>
      </div>`,M(),w()):s.type==="scrape:done"&&w()};async function le(){console.log("[sidepanel] Pre-scoring in background..."),o._preScoring=!0,u({type:"retrain"});const e=await new Promise(r=>{const i=c=>{c.data.type==="loadFromDB:done"?(y.removeEventListener("message",i),C=c.data.totalCount,r(c.data.articles)):c.data.type==="loadFromDB:error"&&(y.removeEventListener("message",i),r([]))};y.addEventListener("message",i),y.postMessage({type:"loadFromDB",page:1,pageSize:9999,hideRead:!1})});if(e.length===0)return;const s=e.filter(r=>r.recScore!==0&&r.topicIds&&r.topicIds.length>0),t=e.filter(r=>r.recScore===0||!r.topicIds||r.topicIds.length===0);let n;if(t.length>0){const r=await G(t),i=new Map;for(const c of s)c.id&&i.set(c.id,c);for(const c of r)c.id&&i.set(c.id,c);n=e.map(c=>c.id&&i.has(c.id)?i.get(c.id):c),O(r).catch(()=>{})}else n=e;d=n,o.articles=f(o.currentPage);try{u({type:"getStats"});const r=await L("stats:done",1e4);o.modelReady=r.type==="stats:done"?r.stats.modelReady:!1}catch{}o._preScoring=!1,p(),M(),w(),D(),console.log("[sidepanel] Pre-score complete, list updated")}async function de(e){const s=o._retrainPending;o._retrainPending=!1;const t=s?[]:e.filter(i=>i.recScore!==0&&i.topicIds&&i.topicIds.length>0),n=s?e:e.filter(i=>i.recScore===0||!i.topicIds||i.topicIds.length===0);let r;if(n.length>0){const i=await G(n),c=new Map;for(const a of t)a.id&&c.set(a.id,a);for(const a of i)a.id&&c.set(a.id,a);r=e.map(a=>a.id&&c.has(a.id)?c.get(a.id):a),O(i).catch(()=>{})}else r=e;d=r,o.articles=f(o.currentPage),o._scoreTimer&&(clearInterval(o._scoreTimer),o._scoreTimer=null);try{u({type:"getStats"});const i=await L("stats:done",1e4);o.modelReady=i.type==="stats:done"?i.stats.modelReady:!1}catch{}p(),M(),w()}$.onmessage=e=>{};async function pe(e=1){if(d.length>0){o.currentPage=e,o.articles=f(e),p(),M();return}h(e)}function X(e){return e.id===o.activeArticleId?!0:!(o.hideRead&&e.isRead||o.hideLow&&o.modelReady&&e.recScore>0&&e.recScore<=.04||I.length>0&&I.includes(e.sourceSite)||ce(e))}function p(){const e=o.articles.filter(X);if(e.length===0){const t=C===0,n=t?`<div class="empty-state">
           <div class="empty-icon">📡</div>
           <div class="empty-title">게시글을 수집하고 있습니다</div>
           <div class="empty-desc">백그라운드에서 커뮤니티 사이트를 수집 중입니다.</div>
           <div class="scrape-progress" id="scrape-progress">
             <div class="scrape-progress-bar"><div class="scrape-progress-fill" id="scrape-progress-fill"></div></div>
             <div class="scrape-progress-text" id="scrape-progress-text">준비 중...</div>
           </div>
         </div>`:`<div class="empty-state">
           <div class="empty-icon">✨</div>
           <div class="empty-title">새 게시글이 없습니다</div>
           <div class="empty-desc">필터 설정을 변경하거나 잠시 후 다시 확인해 주세요.</div>
         </div>`;g.innerHTML=n,t&&!o._scrapeRequested&&(o._scrapeRequested=!0,console.log("[sidepanel] Empty state — requesting immediate scrape"),chrome.runtime.sendMessage({type:"trigger-scrape-now"}).catch(()=>{}));return}const s=e.map(t=>{const n=t.id===o.activeArticleId,r=t.recScore||0,i=o.modelReady&&r>0?r>=.15?"score-high":r<=.04?"score-low":"":"",c=["article-item",n?"active":"",t.isRead?"read":"",i].filter(Boolean).join(" "),a=n?'<span class="active-arrow" title="읽는 중">▶</span>':t.recommended?'<span class="rec-arrow" title="추천">➤</span>':"",l=t.publishedAt?ye(t.publishedAt):"";return`
        <div class="${c}" role="listitem" tabindex="0"
             data-id="${t.id}">
          <div class="article-rec">${a}</div>
          <div class="article-rank">${t.rank||""}</div>
          <div class="article-body">
            <div class="article-title">${m(t.title)}</div>
            <div class="article-meta">
              <span class="source-badge" data-source="${m(t.sourceSite)}">${m(t.sourceSite)}</span>
              ${t.commentCount>0?`<span class="comment-count">[${t.commentCount}]</span>`:""}
              ${t.viewCount>0?`<span class="view-count">${ve(t.viewCount)} 조회</span>`:""}
              ${l?`<span>${l}</span>`:""}
              ${t.author?`<span class="author-name">${m(t.author)}<button class="btn-block-author" data-author="${m(t.author)}" title="이 작성자 차단">❌</button></span>`:""}
            </div>
          </div>
          <button class="btn-reject" data-reject-id="${t.id}" title="관심없음">👎</button>
        </div>`}).join("");g.innerHTML=s}async function J(e){const s=o.articles.find(n=>n.id===e);if(!s)return;o.activeArticleId=e,p(),ie(e,s.recommended||!1,s.recScore||null).then(()=>{s.isRead=!0,p(),w(),u({type:"recordOutcome",wasRecommended:s.recommended||!1,wasClicked:!0})}).catch(n=>console.warn("[click] mark-read failed",n.message));const t=s.originalUrl||s.issueLinkUrl;try{const[n]=await chrome.tabs.query({active:!0,currentWindow:!0});n?.id&&chrome.tabs.update(n.id,{url:t})}catch{console.warn("[click] tabs.update failed, opening new tab"),chrome.tabs.create({url:t})}}async function w(){let e;try{u({type:"getStats"}),e=await L("stats:done",3e4)}catch(r){console.warn(`[sidepanel] stats load failed: ${r instanceof Error?r.message:String(r)}`);return}if(e.type!=="stats:done")return;const{stats:s}=e;ae.textContent=`${s.totalReads}/${s.totalArticles}`;const t=document.getElementById("btn-digest"),n=s.recommendationAccuracy;if(s.modelReady)if(z.style.display="none",n.totalRecs>0){const r=(n.accuracy*100).toFixed(0),i=n.autoModeEligible;v.textContent=`모델: 활성 | 정확도: ${r}%${i?" | 자동":""}`,v.style.color=i?"var(--success)":"var(--text-muted)",t&&(t.style.display=i?"inline-block":"none")}else v.textContent="모델: 활성 | 추천 클릭 대기 중",v.style.color="var(--text-muted)",t&&(t.style.display="none");else{z.style.display="inline-block";const r=30-(s.totalReads||0);r>0?v.textContent=`학습 중… ${r}개 더 읽어주세요`:v.textContent="학습 완료! 새로고침을 눌러주세요",t&&(t.style.display="none")}}function ge(){return Math.max(1,Math.ceil(C/H))}function M(){const e=document.getElementById("pagination"),s=ge();let t="";for(let n=1;n<=s;n++){const r=n===o.currentPage,i=f(n),c=d.length>0&&i.length===0,a=["btn-page-num",r?"active":"",c?"empty":""].filter(Boolean).join(" ");t+=`<button class="${a}" data-page="${n}">${n}</button>`}e.innerHTML=t}function ue(){document.querySelectorAll(".btn-page-num").forEach(e=>{const s=e,t=parseInt(s.dataset.page||"0",10);s.classList.toggle("active",t===o.currentPage);const n=f(t);d.length>0&&n.length===0?s.classList.add("empty"):s.classList.remove("empty")})}document.getElementById("pagination").addEventListener("click",e=>{const s=e.target.closest("[data-page]");if(!s)return;const t=parseInt(s.dataset.page||"0",10);isNaN(t)||t===o.currentPage||(pe(t),g.scrollTop=0)});q.addEventListener("change",()=>{o.hideRead=q.checked,p()});V.addEventListener("change",()=>{o.hideLow=V.checked,p()});const S=document.getElementById("report-modal"),F=document.getElementById("report-body");document.getElementById("btn-settings").addEventListener("click",()=>{chrome.runtime.openOptionsPage()});document.getElementById("btn-report").addEventListener("click",async()=>{S.style.display="flex",F.innerHTML='<div class="loading">리포트 불러오는 중...</div>',u({type:"getReport"});const[e,s]=await Promise.all([L("report:done"),se()]);e.type==="report:done"?F.innerHTML=fe(e.report,s):F.innerHTML='<p class="report-error">리포트를 불러오지 못했습니다.</p>'});document.getElementById("btn-close-report").addEventListener("click",()=>{S.style.display="none"});S.addEventListener("click",e=>{e.target===S&&(S.style.display="none")});function fe(e,s){let t="";if(s.length>0){const n=s.reduce((i,c)=>i+c.reads,0),r=s.reduce((i,c)=>i+c.rejected,0);t+='<section class="report-section">',t+="<h3>사이트별 활동</h3>",t+='<table class="report-activity-table">',t+="<thead><tr><th>사이트</th><th>읽음</th><th>싫어요</th></tr></thead>",t+="<tbody>";for(const i of s)t+=`<tr>
        <td class="site-name">${i.site}</td>
        <td class="num">${i.reads}</td>
        <td class="num">${i.rejected}</td>
      </tr>`;t+=`<tr class="total-row">
      <td class="site-name"><strong>합계</strong></td>
      <td class="num"><strong>${n}</strong></td>
      <td class="num"><strong>${r}</strong></td>
    </tr>`,t+="</tbody></table></section>"}if(!e.ready){const n=e.totalReads??0,r=e.minRequired??30,i=Math.min(100,Math.round(n/r*100));if(t+='<section class="report-section report-progress">',t+="<h3>AI 학습 진행</h3>",n>=r)t+="<p>게시글을 충분히 읽었습니다! <strong>새로고침</strong> 버튼을 눌러 AI 학습을 시작하세요.</p>",t+='<div class="progress-track"><div class="progress-fill" style="width:100%"></div></div>',t+=`<p class="progress-label">${n} / ${r} 읽음 ✓</p>`;else{const c=r-n;t+=`<p>게시글을 더 읽어주세요. 최소 <strong>${r}개</strong>의 게시글을 읽어야 AI가 선호도를 분석합니다.</p>`,t+=`<div class="progress-track"><div class="progress-fill" style="width:${i}%"></div></div>`,t+=`<p class="progress-label">${n} / ${r} 읽음 (${c}개 남음)</p>`}return t+="</section>",t}if(e.topics&&e.topics.length){const n=e.topics.filter(r=>Math.abs(r.weight)>.01).sort((r,i)=>i.weight-r.weight);if(n.length){t+='<section class="report-section">',t+="<h3>토픽 선호도</h3>",t+='<div class="topic-grid">';const r=Math.max(...n.map(i=>Math.abs(i.weight)),.01);for(const i of n){const c=Math.round(Math.abs(i.weight)/r*100),a=i.weight>=0?"topic-positive":"topic-negative",l=i.weight>0?"+":"";t+=`<div class="topic-row ${a}" title="${i.matchedWords}개 관련 단어 감지">
          <span class="topic-label">${i.label}</span>
          <div class="topic-bar-track">
            <div class="topic-bar-fill ${a}" style="width:${c}%"></div>
          </div>
          <span class="topic-val">${l}${i.weight}</span>
        </div>`}t+="</div></section>"}}if(e.liked_words&&e.liked_words.length&&(t+='<section class="report-section">',t+="<h3>좋아하는 단어</h3>",t+='<div class="tag-cloud tag-positive">',t+=e.liked_words.map(n=>`<span class="tag" title="weight: ${n.weight}">${n.word}</span>`).join(""),t+="</div></section>"),e.disliked_words&&e.disliked_words.length&&(t+='<section class="report-section">',t+="<h3>싫어하는 단어</h3>",t+='<div class="tag-cloud tag-negative">',t+=e.disliked_words.map(n=>`<span class="tag" title="weight: ${n.weight}">${n.word}</span>`).join(""),t+="</div></section>"),e.sources&&e.sources.length){t+='<section class="report-section">',t+="<h3>출처 사이트</h3>",t+='<div class="report-bars">';const n=Math.max(...e.sources.map(r=>Math.abs(r.weight)),.01);t+=e.sources.map(r=>{const i=Math.round(Math.abs(r.weight)/n*100),c=r.weight>=0?"bar-positive":"bar-negative";return`<div class="bar-row">
          <span class="bar-label">${r.source}</span>
          <div class="bar-track"><div class="bar-fill ${c}" style="width:${i}%"></div></div>
          <span class="bar-val">${r.weight>0?"+":""}${r.weight}</span>
        </div>`}).join(""),t+="</div></section>"}if(e.liked_authors&&e.liked_authors.length&&(t+='<section class="report-section">',t+="<h3>좋아하는 작성자</h3>",t+='<div class="tag-cloud tag-positive">',t+=e.liked_authors.map(n=>`<span class="tag" title="weight: ${n.weight}">${n.author}</span>`).join(""),t+="</div></section>"),e.disliked_authors&&e.disliked_authors.length&&(t+='<section class="report-section">',t+="<h3>싫어하는 작성자</h3>",t+='<div class="tag-cloud tag-negative">',t+=e.disliked_authors.map(n=>`<span class="tag" title="weight: ${n.weight}">${n.author}</span>`).join(""),t+="</div></section>"),e.metadata&&e.metadata.length){t+='<section class="report-section">',t+="<h3>기타 선호</h3>",t+="<ul class='report-meta-list'>";for(const n of e.metadata){const r=n.feature==="comment_count"?"댓글 수":"조회 수",i=n.weight>0?"인기글 선호":"비주류 선호";t+=`<li>${r}: ${i} (${n.weight>0?"+":""}${n.weight})</li>`}t+="</ul></section>"}return t||'<p class="report-empty">아직 표시할 선호 데이터가 없습니다.</p>'}b.addEventListener("click",async()=>{if(o.loading)return;o.loading=!0,b.classList.add("refreshing"),b.disabled=!0,N(),o.digestMode=!1;const e=document.getElementById("btn-digest");e&&e.classList.remove("active"),g.innerHTML=`
    <div class="empty-state">
      <div class="empty-icon">📡</div>
      <div class="empty-title">게시글을 수집하고 있습니다</div>
      <div class="empty-desc">커뮤니티 사이트에서 최신 글을 가져오는 중입니다.</div>
      <div class="scrape-progress" id="scrape-progress">
        <div class="scrape-progress-bar"><div class="scrape-progress-fill" id="scrape-progress-fill"></div></div>
        <div class="scrape-progress-text" id="scrape-progress-text">준비 중...</div>
      </div>
    </div>`;try{chrome.runtime.sendMessage({type:"trigger-scrape-now"}).catch(()=>{})}catch{Q()}});function Q(){d=[],o.loading=!1,b.classList.remove("refreshing"),b.disabled=!1,h(1,!0),D()}const _=document.getElementById("btn-digest");_&&_.addEventListener("click",()=>{o.digestMode=!o.digestMode,o.digestMode?(_.classList.add("active"),p()):(_.classList.remove("active"),p())});g.addEventListener("click",e=>{const s=e.target,t=s.closest(".btn-block-author");if(t){e.stopPropagation();const c=t.dataset.author;c&&he(c);return}const n=s.closest(".btn-reject");if(n){e.stopPropagation();const c=parseInt(n.dataset.rejectId||"0",10);!isNaN(c)&&c>0&&me(c);return}const r=s.closest(".article-item");if(!r)return;const i=parseInt(r.dataset.id||"0",10);!isNaN(i)&&i>0&&J(i)});async function me(e){const s=o.articles.find(t=>t.id===e);try{await ne(e,s?.recScore||null),d=d.filter(t=>t.id!==e),o.articles=f(o.currentPage),p()}catch{const t=g.querySelector(`[data-id="${e}"]`);t&&t.remove()}}async function he(e){try{await re(e),d=d.filter(s=>s.author!==e),o.articles=f(o.currentPage),p()}catch{}}document.addEventListener("keydown",e=>{const s=e.target.tagName;s==="INPUT"||s==="TEXTAREA"||(e.key==="j"||e.key==="ArrowDown"?(e.preventDefault(),K(1)):(e.key==="k"||e.key==="ArrowUp")&&(e.preventDefault(),K(-1)))});function K(e){const s=o.articles.filter(X);if(s.length===0)return;const t=s.findIndex(r=>r.id===o.activeArticleId);let n;if(t===-1?n=e>0?0:s.length-1:n=t+e,n>=0&&n<s.length){J(s[n].id);const r=g.querySelector(".article-item.active");r&&r.scrollIntoView({block:"nearest",behavior:"smooth"})}}function m(e){return e?e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;"):""}function ve(e){return e>=1e4?(e/1e4).toFixed(1)+"만":e>=1e3?(e/1e3).toFixed(1)+"k":String(e)}function ye(e){try{const s=new Date(e),n=new Date().getTime()-s.getTime(),r=Math.floor(n/6e4);if(r<1)return"방금";if(r<60)return`${r}m`;const i=Math.floor(r/60);return i<24?`${i}h`:`${Math.floor(i/24)}d`}catch{return""}}function we(e,s,t,n,r,i,c){const a=document.getElementById("scrape-progress-fill"),l=document.getElementById("scrape-progress-text");if(!a||!l)return;const ee=s>0?Math.round(e/s*100):0;a.style.width=`${ee}%`;const T=c?.length||0,A=T>0?` · ⚠ ${T}개 실패`:"";if(e>=s&&s>0)l.innerHTML=T>0?`완료! ${n}개 수집됨 · <span style="color:#e94560;">⚠ ${T}개 사이트 실패</span>`:`완료! ${n}개 수집됨`;else if(i)l.innerHTML=`<span style="color:#e94560;">✗ ${m(i)} 실패</span> (${e}/${s}) · ${n}개 수집됨${A}`;else if(t)l.textContent=`✓ ${t} 완료 (${e}/${s}) · ${n}개 수집됨${A}`;else if(r&&r.length>0){const te=r.join(", ");l.textContent=`수집 중: ${te} (${e}/${s})${A}`}else l.textContent=`수집 중... (${e}/${s})${A}`}function Y(e){const t=Number.isFinite(e)?e:13,n=Math.max(.8,t/13);document.documentElement.style.setProperty("--font-size-base",`${t}px`);const r=document.getElementById("app");r&&(r.style.zoom=String(n),r.style.height=100/n+"vh")}chrome.storage.sync.get({disabledSites:[],hiddenTopics:[],hiddenKeywords:[],fontSize:13,refreshInterval:B},e=>{I=e.disabledSites||[];const s=e.hiddenTopics||[];x=new Set(s),P=W(s),k=e.hiddenKeywords||[];const t=e.fontSize||13;E=e.refreshInterval||B,console.log("[init] sidepanel settings",{fontSize:t,refreshIntervalMinutes:E,disabledSites:I.length,hiddenTopics:s.length,hiddenKeywords:k.length}),Y(t),h(1),D()});chrome.runtime.onMessage.addListener((e,s,t)=>{if(e.type==="ping-sidepanel"){t({pong:!0}),window.close();return}e.type==="data-cleared"?(console.log("[sidepanel] Data cleared from settings, refreshing"),d=[],o.modelReady=!1,o._retrainPending=!0,u({type:"resetModel"}),h(1,!0)):e.type==="scrape-complete"?(console.log("[sidepanel] Background scrape complete"),o.loading?Q():le()):e.type==="scrape-progress"&&(console.log("[sidepanel] scrape-progress:",e.completed,"/",e.total,e.currentSite||e.scrapingSites?.join(",")),we(e.completed||0,e.total||1,e.currentSite||"",e.articlesCount||0,e.scrapingSites,e.failedSite||"",e.errors||[]))});function D(){N(),U=Date.now()+E*60*1e3,Z.style.display="",j.style.width="100%",R=setInterval(()=>{const e=U-Date.now(),s=E*60*1e3;if(e<=0){j.style.width="0%",N();return}const t=Math.max(0,e/s*100);j.style.width=`${t}%`},1e3)}function N(){R&&(clearInterval(R),R=null),Z.style.display="none"}chrome.storage.onChanged.addListener((e,s)=>{if(s==="sync"){if(e.fontSize&&Y(e.fontSize.newValue||13),e.refreshInterval&&(E=e.refreshInterval.newValue||B,D()),e.disabledSites&&(I=e.disabledSites.newValue||[],h(1,!0,!1)),e.hiddenTopics){const t=e.hiddenTopics.newValue||[];x=new Set(t),P=W(t),h(1,!0,!1)}e.hiddenKeywords&&(k=e.hiddenKeywords.newValue||[],h(1,!0,!1))}});
