1import{f as z}from"./chunk-ELNQ7RDE.js";import{b as j,e as f}from"./chunk-JKHFDN75.js";import{b as S,c as w}from"./chunk-STVKRBRR.js";import{F as v,G as i,H as l,K as g,L as p,P as b,S as H,da as A,ea as O,i as T,ia as m,k as D,l as M,m as L,n as P,s as F,x as $,z as u}from"./chunk-JZ3E72XP.js";import{b as k}from"./chunk-GG5QQI54.js";function V(e){switch(e){case"shield":return'<svg class="category-icon" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"/></svg>';case"palette":return'<svg class="category-icon" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="13.5" cy="6.5" r="0.5" fill="currentColor"/><circle cx="17.5" cy="10.5" r="0.5" fill="currentColor"/><circle cx="8.5" cy="7.5" r="0.5" fill="currentColor"/><circle cx="6.5" cy="12.5" r="0.5" fill="currentColor"/><path d="M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 011.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z"/></svg>';case"waves":return'<svg class="category-icon" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M3 7c3-3 6 3 9 0s6 3 9 0"/><path d="M3 12c3-3 6 3 9 0s6 3 9 0"/><path d="M3 17c3-3 6 3 9 0s6 3 9 0"/></svg>';case"users":return'<svg class="category-icon" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M17 21v-2a4 4 0 00-4-4H5a4 4 0 00-4 4v2"/><circle cx="9" cy="7" r="4"/><path d="M23 21v-2a4 4 0 00-3-3.87"/><path d="M16 3.13a4 4 0 010 7.75"/></svg>';case"terminal":return'<svg class="category-icon" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="4 17 10 11 4 5"/><line x1="12" y1="19" x2="20" y2="19"/></svg>';default:return""}}function _(){let e=document.getElementById("filter-dropdown"),s=[{id:"all",label:"All themes"},{id:"dark-only",label:"Dark only"},{id:"light-only",label:"Light only"},{id:"both",label:"Both variants"}];e.innerHTML=` 2 <div class="dropdown-label">Variant</div> 3 ${s.map(r=>` 4 <button class="dropdown-item${g===r.id?" active":""}" data-action="set-filter" data-filter="${r.id}"> 5 <span class="check">${g===r.id?'<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5"><polyline points="20 6 9 17 4 12"/></svg>':""}</span> 6 ${r.label} 7 </button> 8 `).join("")} 9 `;let a=document.getElementById("filter-btn");a&&a.classList.toggle("has-filter",g!=="all")}function R(){let e=document.getElementById("sort-dropdown"),s=[{id:"default",label:"Default"},{id:"trending",label:"Trending"},{id:"recent",label:"Newest"},{id:"az",label:"A \u2192 Z"},{id:"za",label:"Z \u2192 A"}];e.innerHTML=` 10 <div class="dropdown-label">Sort</div> 11 ${s.map(r=>` 12 <button class="dropdown-item${p===r.id?" active":""}" data-action="set-sort" data-sort="${r.id}"> 13 <span class="check">${p===r.id?'<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5"><polyline points="20 6 9 17 4 12"/></svg>':""}</span> 14 ${r.label} 15 </button> 16 `).join("")} 17 `;let a=document.getElementById("sort-btn");a&&a.classList.toggle("has-sort",p!=="default")}function ee(e){e.stopPropagation();let s=document.getElementById("filter-dropdown");document.getElementById("sort-dropdown").classList.remove("open"),b==="filter"?(s.classList.remove("open"),m(null)):(_(),s.classList.add("open"),m("filter"))}function te(e){e.stopPropagation();let s=document.getElementById("filter-dropdown"),a=document.getElementById("sort-dropdown");s.classList.remove("open"),b==="sort"?(a.classList.remove("open"),m(null)):(R(),a.classList.add("open"),m("sort"))}function oe(e){k("filter_changed",null,{filter:e}),A(e),_(),h(),setTimeout(()=>C(),150)}function se(e){k("sort_changed",null,{sort:e}),O(e),R(),h(),setTimeout(()=>C(),150)}function C(){document.getElementById("filter-dropdown").classList.remove("open"),document.getElementById("sort-dropdown").classList.remove("open"),m(null)}var ne=(function(){let e;return function(){clearTimeout(e),e=setTimeout(h,200)}})();function h(){if(window.innerWidth<=1024){z().then(o=>o.renderMobileBrowse());return}
17let e=document.getElementById("category-list"),s=document.getElementById("sidebar-search"),a=s?s.value.toLowerCase().trim():"",r=D($);e.innerHTML=r.map(o=>{let n=P.filter(t=>t.category===o.id&&j(t,H));if(a&&(n=n.filter(t=>T(t,a))),g==="dark-only"?n=n.filter(t=>f(t,"dark")):g==="light-only"?n=n.filter(t=>f(t,"light")):g==="both"&&(n=n.filter(t=>f(t,"dark")&&f(t,"light"))),p==="trending"?n=[...n].sort((t,d)=>(d.copies||0)-(t.copies||0)):p==="recent"?n=[...n].sort((t,d)=>(d.dateAdded||"").localeCompare(t.dateAdded||"")):p==="az"?n=[...n].sort((t,d)=>t.name.localeCompare(d.name)):p==="za"&&(n=[...n].sort((t,d)=>d.name.localeCompare(t.name))),n.length===0&&!a){let t=v[o.id];return` 18 <div class="category"> 19 <div class="category-header" role="button" tabindex="0" aria-expanded="${t?"true":"false"}" data-action="toggle-category" data-action-keyboard="true" data-category-id="${o.id}"> 20 <svg class="category-chevron ${t?"expanded":""}" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="9 18 15 12 9 6"/></svg> 21 ${V(o.icon)} 22 <span class="category-name">${o.name}</span> 23 <span class="category-count">0</span> 24 </div> 25 <div class="category-threads ${t?"expanded":""}"> 26 <div class="thread-empty">${w(M(o.id,$))}</div> 27 </div> 28 </div> 29 `}if(n.length===0&&a)return"";let x=v[o.id]||!!a,U=()=>o.groups?o.groups.map(t=>{let d=n.filter(c=>(c.subgroup||"originals")===t);if(d.length===0)return"";let B=i[o.id]&&i[o.id][t]||!!a,y=!!(l[o.id]&&l[o.id][t]);return` 30 <div class="thread-group"> 31 <button 32 class="thread-group-toggle${y?" is-pinned":""}" 33 type="button" 34 data-action="toggle-subgroup" 35 data-double-action="pin-subgroup" 36 data-category-id="${o.id}" 37 data-group-id="${t}" 38 title="${y?"Pinned open":"Click to open. Double-click to pin open."}"> 39 <svg class="thread-group-chevron ${B?"expanded":""}" width="10" height="10" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"> 40 <polyline points="9 18 15 12 9 6"></polyline> 41 </svg> 42 <span class="thread-group-label">${L[t]||t}</span> 43 <span class="thread-group-count">${d.length}</span> 44 <span class="thread-group-pin${y?" visible":""}"></span> 45 </button> 46 <div class="thread-group-items ${B?"expanded":""}"> 47 ${d.map(c=>{let E=F.includes(c.id);return` 48 <div class="thread-item ${c.id===u.id?"active":""}${E?" thread-item--locked":""}" 49 role="button" 50 tabindex="0" 51 aria-pressed="${c.id===u.id?"true":"false"}" 52 data-theme-id="${c.id}" 53 data-action="select-theme" 54 data-action-keyboard="true"> 55 <div class="thread-swatch" style="background:${S((c.dark||c.light)?.accent,"#6B7280")}"></div> 56 <span class="thread-title">${w(c.name)}</span> 57 ${c.id===u.id?'<span class="selection-indicator">Selected</span>':""} 58 ${E?'<svg class="thread-lock-icon" width="10" height="10" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="3" y="11" width="18" height="11" rx="2"/><path d="M7 11V7a5 5 0 0110 0v4"/></svg>':""} 59 </div> 60 `}).join("")} 61 </div> 62 </div> 63 `}).join(""):n.map(t=>` 64 <div class="thread-item ${t.id===u.id?"active":""}" 65 role="button" 66 tabindex="0" 67 aria-pressed="${t.id===u.id?"true":"false"}" 68 data-theme-id="${t.id}" 69 data-action="select-theme" 70 data-action-keyboard="true"> 71 <div class="thread-swatch" style="background:${S((t.dark||t.light)?.accent,"#6B7280")}"></div> 72 <span class="thread-title">${w(t.name)}</span> 73 ${t.id===u.id?'<span class="selection-indicator">Selected</span>':""} 74 </div> 75 `).join("");return` 76 <div class="category"> 77 <div class="category-header" role="button" tabindex="0" aria-expanded="${x?"true":"false"}" data-action="toggle-category" data-action-keyboard="true" data-category-id="${o.id}"> 78 <svg class="category-chevron ${x?"expanded":""}" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="9 18 15 12 9 6"/></svg> 79 ${V(o.icon)}
80 <span class="category-name">${o.name}</span> 81 <span class="category-count">${n.length}</span> 82 </div> 83 <div class="category-threads ${x?"expanded":""}"> 84 ${U()} 85 </div> 86 </div> 87 `}).join("")}function ae(e){v[e]=!v[e],h()}function re(e,s){i[e]||(i[e]={}),l[e]||(l[e]={});let a=!!i[e][s],r=!!l[e][s];if(a&&!r){i[e][s]=!1,h();return}Object.keys(i[e]).forEach(o=>{o!==s&&!l[e][o]&&(i[e][o]=!1)}),i[e][s]=!0,h()}function ie(e,s){i[e]||(i[e]={}),l[e]||(l[e]={});let a=!l[e][s];l[e][s]=a,i[e][s]=!0,h()}function de(){document.addEventListener("click",e=>{b&&!e.target.closest(".search-bar-wrapper")&&C()})}export{_ as a,R as b,ee as c,te as d,oe as e,se as f,C as g,ne as h,h as i,ae as j,re as k,ie as l,de as m};
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.