1(() => { 2 "use strict"; 3 const t = [function () { 4 const t = document.querySelector(".site-header"); 5 if (!t) 6 return; 7 const e = window.getComputedStyle(document.documentElement).getPropertyValue("--asona--offset--sticky-header"); 8 new window.IntersectionObserver((e => { 9 const n = !e[0].isIntersecting; 10 t.setAttribute("data-is-sticky", n) 11 }), { 12 root: document, 13 threshold: [1], 14 rootMargin: `-${e} 0px 0px 0px` 15 }).observe(t); 16 const n = document.querySelector('.featured-figure-backdrop[data-theme="dark-reset"]') || document.querySelector('.article-header[data-theme="dark-reset"]') || document.querySelector('.posts-highlight[data-theme="dark-reset"]'); 17 if (n) { 18 const a = e => { 19 const n = !e[0].isIntersecting; 20 t.setAttribute("data-theme", n ? "reset" : "dark-reset"), 21 document.documentElement.setAttribute("data-theme", n ? "reset" : "dark-reset") 22 }; 23 new window.IntersectionObserver(a, { 24 root: document, 25 threshold: [0], 26 rootMargin: `-${parseInt(e,10)+t.clientHeight}px 0px 0px 0px` 27 }).observe(n) 28 } 29 }, function () { 30 const t = document.querySelector(".site-navigation"); 31 if (!t) 32 return; 33 const e = t.querySelectorAll("[data-open-submenu]"), 34 n = new Map; 35 function a(t) { 36 const e = t.currentTarget, 37 a = e.getAttribute("aria-controls"), 38 o = document.getElementById(a),
39 r = e.closest(".nav-submenu"), 40 i = "true" === e.getAttribute("aria-expanded"), 41 s = o.scrollHeight; 42 e.setAttribute("aria-expanded", !i), 43 o.setAttribute("aria-hidden", i), 44 i ? (o.style.setProperty("--nav-submenu-max-height", 0), n.set(a, 0)) : (r && r.style.setProperty("--nav-submenu-max-height", r.scrollHeight + s + "px"), o.style.setProperty("--nav-submenu-max-height", s + "px"), n.set(a, s)) 45 } 46 e.forEach((t => { 47 t.addEventListener("click", a) 48 })), 49 t.querySelectorAll("[data-has-submenu]").forEach((t => { 50 t.addEventListener("focusout", (e => { 51 !t.contains(e.relatedTarget) && window.matchMedia("(min-width: 68.75em)").matches && (t.querySelector("[aria-expanded]").setAttribute("aria-expanded", !1), t.querySelector("[aria-hidden]").setAttribute("aria-hidden", !0)) 52 })) 53 })), 54 window.addEventListener("asona:site-actions", (t => { 55 t.detail.isExpanded || n.clear() 56 })), 57 document.addEventListener("click", (a => { 58 t && t !== a.target && !t.contains(a.target) && (e.forEach((t => { 59 t.setAttribute("aria-expanded", !1), 60 t.nextElementSibling.setAttribute("aria-hidden", !0) 61 })), n.clear()) 62 })) 63 }, function () { 64 const t = document.querySelector(".site-header"); 65 if (!t) 66 return; 67 const e = t.querySelector(".site-actions"), 68 n = t.querySelectorAll("[data-site-action-trigger]"), 69 a = t.querySelectorAll("[data-close-site-actions]"); 70 function o(n) { 71 const a = n.currentTarget, 72 o = a.getAttribute("data-site-action-trigger"), 73 s = "true" === a.getAttribute("aria-expanded"), 74 d = document.getElementById(a.getAttribute("aria-controls")); 75 r(), 76 s || (document.body.style.overflow = "hidden", a.setAttribute("aria-expanded", !0), t.setAttribute("data-state", `${o}-open`), t.style.setProperty("--asona--site-header--offset", `${window.Math.max(0,t.getBoundingClientRect().top)}px`), e.style.setProperty("--asona--site-actions--height", `${d.scrollHeight}px`), setTimeout((() => { 77 d.querySelector("input")?.focus({ 78 preventScroll: !0 79 }) 80 }), 300), window.addEventListener("keydown", i)); 81 const c = new window.CustomEvent("asona:site-actions", { 82 detail: { 83 isExpanded: !s, 84 action: o, 85 el: a, 86 controls: d 87 } 88 }); 89 window.dispatchEvent(c) 90 } 91 function r() { 92 n.forEach((t => { 93 t.setAttribute("aria-expanded", !1) 94 })), 95 t.removeAttribute("data-state"), 96 document.body.style.overflow = "", 97 window.removeEventListener("keydown", i) 98 } 99 function i(t) { 100 "Escape" === t.key && r() 101 } 102 n.forEach((t => { 103 t.addEventListener("click", o) 104 })), 105 a.forEach((t => { 106 t.addEventListener("click", r) 107 })) 108 }, function () { 109 const t = document.querySelectorAll("[data-toggle-color-scheme]"), 110 e = document.querySelector('[aria-controls="site-color-scheme-options"]'), 111 n = document.getElementById("site-color-scheme-options"); 112 function a(t) { 113 const e = t.currentTarget.getAttribute("data-toggle-color-scheme"); 114 "system" === e ? (window.localStorage.removeItem(`asona-pcs-${window.location.hostname}`), document.documentElement.removeAttribute("data-prefers-color-scheme")) : (window.localStorage.setItem(`asona-pcs-${window.location.hostname}`, e), document.documentElement.setAttribute("data-prefers-color-scheme", e)), 115 document.documentElement.setAttribute("data-transitions-disabled", !0), 116 setTimeout((() => { 117 document.documentElement.removeAttribute("data-transitions-disabled") 118 }), 10); 119 const n = new window.CustomEvent("asona:color-scheme-changed", { 120 detail: { 121 colorScheme: e 122 } 123 }); 124 window.dispatchEvent(n) 125 } 126 e?.addEventListener("click", (t => { 127 const e = "true" === t.currentTarget.getAttribute("aria-expanded"); 128 t.currentTarget.setAttribute("aria-expanded", !e), 129 n.setAttribute("aria-hidden", e) 130 })), 131 t.forEach((t => { 132 t.addEventListener("click", a), 133 t.addEventListener("focusout", (() => { 134 n.matches(":focus-within") || (e.setAttribute("aria-expanded", !1), n.setAttribute("aria-hidden", !0)) 135 })) 136 })) 137 }, function () { 138 function t(t) { 139 const e = t.currentTarget; 140 if ("copy-link" === e.getAttribute("data-social")) { 141 const t = e.getAttribute("data-copy-link"); 142 return window.navigator.clipboard.writeText(t).then((() => { 143 const t = e.querySelector("[role=tooltip]"); 144 t.setAttribute("aria-hidden", "false"), 145 setTimeout((() => { 146 t.setAttribute("aria-hidden", "true") 147 }), 2500) 148 })), 149 !1 150 } 151 } 152 document.querySelectorAll(".sharing-buttons [data-social]").forEach((e => e.addEventListener("click", t))) 153 }, function () { 154 const t = document.querySelectorAll(".featured-sections__tab"); 155 function e(e) { 156 const n = e.currentTarget, 157 a = "true" === n.getAttribute("aria-selected"); 158 if (a) 159 return; 160 const o = n.getAttribute("aria-controls"); 161 t.forEach((t => { 162 t.setAttribute("aria-selected", !1), 163 document.getElementById(t.getAttribute("aria-controls")).setAttribute("data-state", "animating") 164 })), 165 n.setAttribute("aria-selected", !a), 166 document.getElementById(o).setAttribute("data-state", "hidden"), 167 setTimeout((() => { 168 t.forEach((t => { 169 document.getElementById(t.getAttribute("aria-controls")).setAttribute("data-state", "hidden") 170 })), 171 document.getElementById(o).setAttribute("data-state", "active"), 172 setTimeout((() => { 173 document.getElementById(o).setAttribute("data-state", "visible") 174 }), 50) 175 }), 200) 176 } 177 t.forEach((t => t.addEventListener("click", e))) 178 }, function () { 179 const t = document.querySelector(".pagination-load-more"); 180 if (!t) 181 return; 182 const e = t.closest(".pagination"), 183 n = document.querySelector(".posts-feed"), 184 a = "infinite-scroll" === t.getAttribute("data-pagination-type"); 185 let o = null; 186 a && (o = new window.IntersectionObserver((e => { 187 e[0].isIntersecting && t.click() 188 }), { 189 threshold: 0, 190 rootMargin: "100%" 191 }), o.observe(e)), 192 t.addEventListener("click", (function (r) { 193 r.preventDefault(); 194 const i = r.currentTarget, 195 s = "loading" === i.getAttribute("data-state"), 196 d = { 197 page: parseInt(e.querySelector("[data-pagination-page]").getAttribute("data-pagination-page"), 10), 198 pages: parseInt(e.querySelector("[data-pagination-pages]").getAttribute("data-pagination-pages"), 10) 199 }; 200 s || (d.page++, t.setAttribute("data-state", "loading"), window.fetch(i.getAttribute("href")).then((t => t.text())).then((r => { 201 const i = (new window.DOMParser).parseFromString(r, "text/html"), 202 s = i.querySelectorAll(".posts-feed .post"), 203 c = i.querySelector(".pagination-load-more"), 204 u = i.querySelector(".pagination__info"), 205 l = e.querySelector(".pagination__info"); 206 if (s) {
207 s.forEach((t => { 208 n.append(t) 209 })); 210 const t = s[0].querySelector(".post-card__media"); 211 t?.focus({ 212 preventScroll: !0 213 }), 214 window.dispatchEvent(new window.CustomEvent("asona:pagination-load-more", { 215 detail: { 216 posts: s 217 } 218 })) 219 } 220 if (c && d.page !== d.pages) { 221 const e = c.getAttribute("href"); 222 t.setAttribute("href", e) 223 } else 224 t.remove(), a && o.unobserve(e); 225 e.querySelector(".pagination__container").replaceChild(u, l), 226 t.setAttribute("data-state", "initial") 227 })).catch((() => { 228 t.setAttribute("data-state", "error") 229 }))) 230 }), !1) 231 }, function () { 232 let t = document.querySelectorAll('[data-highlight="modern"] .post-card'); 233 if (!t.length) 234 return; 235 const prefersReducedMotion = window.matchMedia("(prefers-reduced-motion: reduce)"); 236 if (prefersReducedMotion.matches) { 237 return; 238 } 239 let n = []; 240 function a(preserve = false) { 241 if (!preserve) 242 n = []; 243 const scrollTop = document.documentElement.scrollTop; 244 t.forEach((card) => { 245 const cardRect = card.getBoundingClientRect(); 246 const contentRect = card.querySelector(".post-card__content").getBoundingClientRect(); 247 const ranges = { 248 startTranslate: cardRect.top + scrollTop + cardRect.height / 8, 249 stopTranslate: cardRect.top + scrollTop + 3 * cardRect.height 250 }; 251 n.push({ 252 element: card, 253 anime: ranges, 254 height: cardRect.height, 255 isMobile: window.matchMedia("(max-width: 767px)").matches 256 }); 257 }); 258 } 259 function o() { 260 const scrollTop = document.documentElement.scrollTop; 261 for (let i = 0; i < n.length; i++) { 262 const item = n[i]; 263 if (item.anime.startTranslate <= scrollTop && item.anime.stopTranslate >= scrollTop && !item.isMobile) { 264 const progress = (scrollTop - item.anime.startTranslate) / (item.anime.stopTranslate - item.anime.startTranslate); 265 const offset = Math.round(progress * item.height * 1.3); 266 item.element.style.transform = `translate3d(0, ${offset}px, 0)` 267 } else { 268 item.element.style.transform = "translate3d(0, 0, 0)"; 269 } 270 item.element.style.opacity = 1; 271 } 272 } 273 window.addEventListener("resize", (function (handler, delay = 100) { 274 let timeout; 275 return (...args) => { 276 clearTimeout(timeout); 277 timeout = setTimeout(() => handler.apply(this, args), delay); 278 }; 279 })(() => { 280 a(); 281 o(); 282 })); 283 window.addEventListener("asona:pagination-load-more", (e) => { 284 t = e.detail.posts; 285 a(true); 286 o(); 287 }); 288 // Initial calculation + paint 289 a(); 290 o(); 291 292 // Run o() only when user scrolls, not 60fps forever 293 let ticking = false; 294 295 function onScroll() { 296 if (ticking) return; 297 ticking = true; 298 299 requestAnimationFrame(() => { 300 o(); 301 ticking = false; 302 }); 303 } 304 305 window.addEventListener("scroll", onScroll); 306}, function () { 307 const t = document.querySelector(".comments-open-respond"); 308 t && t.addEventListener("click", (function (t) { 309 const e = t.currentTarget, 310 n = document.getElementById("respond"), 311 a = document.getElementById("cancel-comment-reply-link"); 312 a && a.click(), 313 e.style.display = "none", 314 n.style.display = "block", 315 n.querySelector("textarea").focus() 316 })) 317 } 318 ]; 319 for (const e in t) 320 t[e](); 321 document.addEventListener("DOMContentLoaded", (() => { 322 setTimeout((() => { 323 const t = window.innerWidth - document.body.offsetWidth; 324 document.documentElement.setAttribute("data-dom-content-loaded", !0), 325 document.documentElement.style.setProperty("--asona--scrollbar-width", `${t}px`) 326 }), 10) 327 })), 328 new window.MutationObserver((() => { 329 const t = window.getComputedStyle(document.body); 330 document.documentElement.toggleAttribute("data-scroll-disabled", "hidden" === t.overflow) 331 })).observe(document.body, { 332 attributes: !0 333 }) 334})();
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.