PageSourceSearch

https://doghatstudio.com/easel.js?v=260928dh3

js doghatstudio.com collected 2026-10-06 18:37:35 UTC 22,229 bytes, 456 lines download raw bytes

1/* doghatstudio EASEL (w40): still ladder, lazy-zone watchdog, canvas fit, the canvas on the easel, whole-row walls,
2   still viewer, find tray, key chips, promo close rescue.
3   Mechanics taken from the wave (canary fotoman.name, digiwavefront.com) and rewritten for this markup. Rules:
4   the ladder starts from the ORIGINAL (Photon over img_link -> bare img_link -> origin taken out of a foreign
5   Photon address -> remove the BLOCK; the search-engine thumbnail is never used); a lazy still that has not
6   started is not stepped down (A3); a step that hangs with neither load nor error is abandoned after STEP_MS in
7   the viewer (w38 C1/C7) and after DEADLINE on the page, only inside the lazy zone; handlers are named and
8   re-armed on every step; only our own blocks are removed (never body/html/head, the viewer or the h1 block).
9   Numbers shown are counted once from the bytes served (w38 H2). */
10(function () {
11  "use strict";
12  var W_BIG = 1600, JUNK = 150, JUNK_LAST = 100, LAZY_PAD = 800, TICK = 1500, DEADLINE = 20000, STEP_MS = 6000;
13  var AR_MIN = 0.8, AR_MAX = 1.78;
14  var BLANK = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";
15  /* every branch of the selector written out in full */
16  var SEL = ".lean .cv__fr img.pic, .wallboard .cv__fr img.pic, .rack .cv__fr img.pic, .book .cv__fr img.pic, " +
17            ".hang .cv__fr img.pic, .stills .cv__fr img.pic, .easel__hold .cv__fr img.pic";
18  var BLOCK = ".cv, .bk, .still, .easel__cv";
19  var STUBS = [[177, 142], [161, 81], [600, 265]];
20  /* host + exact size: hosting stubs that arrive as valid images with a 200 (w38 L2, w40 A5) */
21  var HOST_STUBS = [[/imgbox\.com\//, 240, 240], [/iceppsn\.com\//, 320, 240]];
22
23  function isPh(u) { return /^https?:\/\/i\d\.wp\.com\//.test(u || ""); }
24  function isHttp(u) { return /^https?:\/\/[^\/\s]+\/./.test(u || ""); }
25
26  /* core address -> Photon with OUR width. Already-Photon: drop its foreign query and set ours;
27     plain address with its own query: glue with '&'. */
28  function photon(u, w) {
29    if (!u || u.length < 12) return "";
30    if (isPh(u)) return u.split(/[?&]/)[0] + "?w=" + w + "&ssl=1";
31    var bare = u.replace(/^https?:\/\//, "");
32    if (bare.indexOf("/") < 1) return "";
33    var q = bare.indexOf("?");
34    if (q !== -1) bare = bare.slice(0, q) + "&" + bare.slice(q + 1).split("?").join("&");
35    return "https://i0.wp.com/" + bare + (q !== -1 ? "&" : "?") + "w=" + w + "&ssl=1";
36  }
37  /* the origin hidden inside a foreign Photon address: i3.wp.com/host/path?ssl=1 -> https://host/path */
38  function origin(u) {
39    var m = /^https?:\/\/i\d\.wp\.com\/([^?]+)/.exec(u || "");
40    return m ? "https://" + m[1] : "";
41  }
42  /* byte src of step 0: repair only what Photon cannot read (a foreign resize/fit, a query glued twice) */
43  function fixsrc(img) {
44    var s = img.getAttribute("src") || "";
45    if (!isPh(s)) return;
46    var bad = /[?&](resize|fit)=/.test(s) || (s.indexOf("?") === -1 && s.indexOf("&w=") !== -1) || s.split("?").length > 2;
47    if (bad) { var f = photon(s.replace(/&w=\d+$/, ""), parseInt(img.getAttribute("data-w") || "400", 10)); if (f) img.src = f; }
48  }
49
50  function steps(img) {
51    var raw = (img.getAttribute("data-alt") || "").trim(), out = [], cur = img.getAttribute("src") || "";
52    if (isHttp(raw) && raw !== cur) out.push(raw);
53    var o = origin(raw);
54    if (isHttp(o) && out.indexOf(o) === -1 && o !== cur) out.push(o);
55    return out;
56  }
57  function rung(img) { return parseInt(img.getAttribute("data-step") || "0", 10); }
58
59  function block(img) {
60    var b = img.closest(BLOCK);
61    if (!b || b.closest("#look") || b.querySelector("h1")) return null;
62    if (b === document.body || b === document.documentElement || b === document.head) return null;
63    return b;
64  }
65  function drop(img) {
66    if (img.closest("#look")) { img.src = BLANK; return; }
67    var b = block(img), wasLead = !!(b && b.classList.contains("easel__cv"));
68    if (b && b.parentNode) b.parentNode.removeChild(b);
69    else if (img.parentNode) img.parentNode.removeChild(img);
70    if (wasLead) pickLead(false);
71    tidy();
72  }
73
74  function stepDown(img) {
75    var list = steps(img), k = rung(img);
76    if (k < list.length) {
77      img.setAttribute("data-step", String(k + 1));
78      img.removeAttribute("data-bad");
79      img.onerror = onErr;
80      img.onload = onLoad;
81      img.src = list[k];
82      img.setAttribute("data-t0", String(Date.now()));
83      img.setAttribute("data-seen", "1");
84      return;
85    }
86    drop(img);
87  }
88  function onErr() { stepDown(this); }
89  function junk(img, nw, nh) {
90    var w = parseInt(img.getAttribute("data-w") || "400", 10);
91    var last = rung(img) >= steps(img).length;
92    if (last ? Math.max(nw, nh) < JUNK_LAST : nw < Math.min(JUNK, w * 0.5)) return true;
93    if (nw > nh * 4 || nh > nw * 4) return true;
94    var s = img.currentSrc || img.src || "";
95    for (var i = 0; i < STUBS.length; i++) if (nw === STUBS[i][0] && nh === STUBS[i][1]) return true;
96    for (i = 0;
96 i < HOST_STUBS.length; i++) if (HOST_STUBS[i][0].test(s) && nw === HOST_STUBS[i][1] && nh === HOST_STUBS[i][2]) return true;
97    return false;
98  }
99  function onLoad() {
100    var img = this, nw = img.naturalWidth || 0, nh = img.naturalHeight || 0;
101    if (!nw || !nh) { stepDown(img); return; }
102    if (junk(img, nw, nh)) { stepDown(img); return; }
103    img.setAttribute("data-ok", "1");
104    fit(img);
105    if (img.closest(".easel__hold")) pickLead(false);
106  }
107  function clampAr(a) { return Math.max(AR_MIN, Math.min(AR_MAX, a)); }
108  /* a canvas: the still covers it (cropped) while that needs no upscale past 1.15; otherwise the whole still stands
109     on the primed gesso, never upscaled (scale-down). The canvas on the easel takes the still's own proportion,
110     held between 4:5 and 16:9. */
111  function fit(img) {
112    var nw = img.naturalWidth, nh = img.naturalHeight;
113    if (!nw || !nh) return;
114    var fr = img.closest(".cv__fr");
115    if (!fr) return;
116    if (fr.classList.contains("cv__fr--lead")) fr.style.aspectRatio = clampAr(nw / nh).toFixed(3);
117    var box = fr.getBoundingClientRect();
118    if (box.width < 4 || box.height < 4) return;
119    var kc = Math.max(box.width / nw, box.height / nh);
120    fr.classList.toggle("is-whole", kc > 1.15);
121  }
122  /* judged from the natural size against a lead canvas of width W: hidden candidates have no box */
123  function coverable(img, W) {
124    if (img.getAttribute("data-ok") !== "1" || !W) return false;
125    var nw = img.naturalWidth, nh = img.naturalHeight, ar = clampAr(nw / nh);
126    return Math.max(W / nw, W / ar / nh) <= 1.15;
127  }
128  /* the canvas on the easel: three candidates in the bytes; the first whose original covers the easel canvas and
129     keeps its own proportion wins, then any that covers; after the final check any living one (it stands whole on
130     the gesso); with none the easel is taken down and the label takes the row (w38 D2/E1/F1/H3, w40 A3) */
131  function pickLead(final) {
132    var holds = document.querySelectorAll(".easel__hold");
133    for (var h = 0; h < holds.length; h++) pickOne(holds[h], final);
134  }
135  function pickOne(hold, final) {
136    var ls = [].slice.call(hold.querySelectorAll(":scope > .easel__cv")), ez = hold.closest(".easel");
137    if (!ls.length) { if (final && ez) ez.classList.add("is-empty"); return; }
138    if (hold.getAttribute("data-picked") === "1") return;
139    var W = hold.getBoundingClientRect().width, best = null, i, im;
140    for (i = 0; i < ls.length && !best; i++) {
141      im = ls[i].querySelector("img");
142      if (im && coverable(im, W)) { var a = im.naturalWidth / im.naturalHeight; if (a >= AR_MIN && a <= AR_MAX) best = ls[i]; }
143    }
144    for (i = 0; i < ls.length && !best; i++) { im = ls[i].querySelector("img"); if (im && coverable(im, W)) best = ls[i]; }
145    if (!best && final) for (i = 0; i < ls.length && !best; i++) { im = ls[i].querySelector("img"); if (im && im.getAttribute("data-ok") === "1") best = ls[i]; }
146    if (!best) {
147      if (final) { for (i = 0; i < ls.length; i++) if (ls[i].parentNode) ls[i].parentNode.removeChild(ls[i]); if (ez) ez.classList.add("is-empty"); }
148      return;
149    }
150    for (i = 0; i < ls.length; i++) if (ls[i] !== best && ls[i].parentNode) ls[i].parentNode.removeChild(ls[i]);
151    best.classList.add("is-picked");
152    hold.setAttribute("data-picked", "1");
153    var bi = best.querySelector("img"); if (bi) fit(bi);
154  }
155  /* Bowlby One SC is wide and heavy: the longest word is measured and the size brought down until it fits the
156     column, so no name is broken in the middle of a word (w40 A2) */
157  function fitHeads() {
158    var hs = document.querySelectorAll(".display"), cv = fitHeads.cd || (fitHeads.cd = document.createElement("canvas").getContext("2d"));
159    for (var i = 0; i < hs.length; i++) {
160      var h = hs[i];
161      h.style.fontSize = "";
162      var cs = getComputedStyle(h), size = parseFloat(cs.fontSize), avail = h.clientWidth - 6;
163      var words = (h.textContent || "").trim().split(/\s+/), lwW = 0;
164      cv.font = "400 " + size + "px \"Bowlby One SC\", \"Dh Cyr\", \"PT Sans Caption\"";
165      for (var j = 0; j < words.length; j++) { var ww = cv.measureText(words[j]).width; if (ww > lwW) lwW = ww; }
166      if (!lwW || avail < 20) continue;
167      if (lwW > avail) h.style.fontSize = Math.max(20, Math.floor(size * avail / lwW * 0.96)) + "px";
168    }
169  }
170
171  function arm(img, initial) {
172    if (img.getAttribute("data-armed") === "1") return;
173    img.setAttribute("data-armed", "1");
174    img.onerror = onErr;
175    img.onload = onLoad;
176    img.setAttribute("data-t0", String(Date.now()));
177    fixsrc(img);
178    /* a still that died before this script existed gets one immediate step, at load only */
179    if (initial && img.complete) {
180      if (img.naturalWidth === 0 && img.getAttribute("src")) stepDown(img);
181      else if (img.naturalWidth > 0) onLoad.call(img);
182    }
183  }
184  function inZone(img) {
185    var r = img.getBoundingClientRect();
186    return r.top < window.innerHeight + LAZY_PAD && r.bottom > -LAZY_PAD;
187  }
188  function sweep() {
189    var list = document.querySelectorAll(SEL), now = Date.now();
190    for (var i = 0; i < list.length; i++) {
191      var img = list[i];
192      if (img.closest("#look")) continue;
193      if (!img.offsetParent && !img.closest(".easel__hold")) continue;   /* capped spares stay untouched */
194      arm(img, false);
195      if (img.getAttribute("data-ok") === "1") { fit(img); continue; }
196      if (img.complete) {
197        if (img.naturalWidth > 0) { onLoad.call(img); continue; }
198        /* broken bytes with a 200 give no error event: two marks in a row = dead */
199        if (img.getAttribute("data-bad") === "1") { stepDown(img); continue; }
200        img.setAttribute("data-bad", "1");
201        continue;
202      }
203      if (rung(img) > 0) img.setAttribute("data-seen", "1");
204      if (!img.getAttribute("data-seen")) {
205        if (!inZone(img)) { img.setAttribute("data-t0", String(now)); continue; }
206        img.setAttribute("data-seen", "1");
207      }
208      if (img.getAttribute("data-eager") !== "1") {          /* A3: once eager, fresh countdown */
209        img.setAttribute("data-eager", "1");
210        img.loading = "eager";
211        img.setAttribute("data-t0", String(now));
212        continue;
213      }
214      if (!inZone(img) && !img.closest(".easel__hold")) { img.setAttribute("data-t0", String(now)); continue; }
215      var t0 = parseInt(img.getAttribute("data-t0") || String(now), 10);
216      if (now - t0 > DEADLINE) stepDown(img);
217    }
218    tidy();
219  }
220
221  function cols(el) {
222    var t = getComputedStyle(el).gridTemplateColumns || "";
223    var n = t.split(" ").filter(function (x) { return x && x !== "none"; }).length;
224    return n || 1;
225  }
226  function span(el) {            /* cells taken by an item; Chrome gives "span 2" in Start, End may be auto (w38 M1) */
227    var cs = getComputedStyle(el), c = /span (\d+)/.exec(cs.gridColumnStart + " " + cs.gridColumnEnd), r = /span (\d+)/.exec(cs.gridRowStart + " " + cs.gridRowEnd);
228    return (c ? parseInt(c[1], 10) : 1) * (r ? parseInt(r[1], 10) : 1);
229  }
230  /* last row never ragged: capped walls are clamped to whole rows (links stay in the bytes); a big canvas counts as
231     the cells it takes; the stills keep every still and close their last row with the next-name cell */
232  function tidy() {
233    var grids = document.querySelectorAll("[data-tidy]");
234    for (var i = 0; i < grids.length; i++) {
235      var g = grids[i], kids = [].slice.call(g.children), c = cols(g), j;
236      var cap = parseInt(g.getAttribute("data-max") || String(kids.length), 10);
237      for (j = 0; j < kids.length; j++) kids[j].removeAttribute("data-hide");
238      var vis = kids.slice(0, Math.min(kids.length, cap)), cells = 0;
239      for (j = 0; j < vis.length; j++) cells += span(vis[j]);
240      var k = vis.length - 1;
241      while (c > 1 && cells % c !== 0 && k >= 0) {
242        var s = span(vis[k]);
243        if (s === 1 || cells - s >= 0) { vis[k].setAttribute("data-hide", "1"); cells -= s; }
244        k--;
245      }
246    }
247    var st = document.querySelector(".stills");
248    if (st) {
249      var ts = st.querySelectorAll(":scope > .still"), nx = st.querySelector(":scope > .nextup"), cc = cols(st);
250      if (nx) { var rem = ts.length % cc; nx.style.gridColumn = rem ? ("span " + (cc - rem)) : "1 / -1"; }
251    }
252  }
253
254  /* ---- chips from the page key: CJK from one sign, everything else from FOUR ---- */
255  function chips() {
256    var box = document.querySelector(".chips-key[data-key]");
257    if (!box) return;
258    var key = (box.getAttribute("data-key") || "").trim(), seen = {}, made = 0;
259    var parts = key.split(/[\s,.;:!?()\[\]{}"'«»\/|+_\-]+/);
260    for (var i = 0; i < parts.length && made < 8; i++) {
261      var w = parts[i].trim();
262      if (!w) continue;
263      var cjk = /[぀-ヿ㐀-䶿一-鿿가-힯]/.test(w);
264      if (!cjk && w.length < 4) continue;
265      var k = w.toLowerCase();
266      if (seen[k]) continue;
267      seen[k] = 1;
268      var a = document.createElement("a");
269      a.href = "/search?query=" + encodeURIComponent(w);
270      a.setAttribute("dir", "auto");
271      a.textContent = w;
272      box.appendChild(a);
273      made++;
274    }
275    if (!made && box.parentNode) box.parentNode.removeChild(box);
276  }
277  function fillQuery() {
278    try {
279      var q = new URLSearchParams(location.search).get("query");
280      if (!q) return;
281      ["aq", "tq"].forEach(function (id) { var el = document.getElementById(id); if (el) el.value = q; });
282    } catch (e) {}
283  }
284  function countStills() {      /* counted once, from the bytes served (w38 H2) */
285    var dd = document.querySelector("[data-count=stills]");
286    if (dd) dd.textContent = String(document.querySelectorAll(".stills > .still").length);
287  }
288  function clipWatch() {
289    var c = document.querySelector(".sect--clip"), st = c && c.querySelector(".clipwrap__st");
290    if (!c || !st) return;
291    var t0 = Date.now();
292    c.setAttribute("data-state", "wait");
293    st.textContent = "Loading the clip…";
294    (function poll() {            /* once a second, not one timer: the caption never sits next to a playing clip (w40 C4) */
295      if (c.querySelector("video")) { c.setAttribute("data-state", "on"); st.textContent = ""; return; }
296      if (Date.now() - t0 > 20000) { c.setAttribute("data-state", "off"); st.textContent = "The clip is not playing right now. Every still of this page is below."; }
297      if (Date.now() - t0 < 120000) setTimeout(poll, 1000);
298    })();
299  }
300
301  /* ---- viewer: its own ladder from the ORIGINAL; a hanging step is left after STEP_MS ---- */
302  var lk, lkIm, lkC, list = [], at = 0, dir = 1;
303  function two(n) { return (n < 10 ? "0" : "") + n; }
304  function stills() { return [].slice.call(document.querySelectorAll(".stills .still[data-o]")); }
305  function bigChain(btn) {
306    var o = btn.getAttribute("data-o") || "", c = [], im = btn.querySelector("img");
307    var failedPh = im && rung(im) > 0;           /* the still already lost Photon: do not wait on it again */
308    var big = photon(o, W_BIG);
309    if (big && !failedPh) c.push(big);
310    if (isHttp(o) && c.indexOf(o) === -1) c.push(o);
311    var og = origin(o);
312    if (isHttp(og) && c.indexOf(og) === -1) c.push(og);
313    return c;
314  }
315  function show(n, tries) {
316    if (!list.length) { close(); return; }
317    tries = tries || 0;
318    if (tries > list.length) { close(); return; }
319    at = (n + list.length) % list.length;
320    var btn = list[at], c = bigChain(btn), k = 0, tok = show.tok = {};
321    lkC.textContent = two(at + 1) + " / " + two(list.length);
322    lkIm.style.visibility = "hidden";
323    function next() {
324      if (show.tok !== tok) return;
325      clearTimeout(show.tm);
326      if (k >= c.length) {                        /* every path to this still is dead: skip it */
327        lkIm.onerror = null; lkIm.onload = null;
328        list.splice(at, 1);
329        if (btn.parentNode) { btn.parentNode.removeChild(btn); tidy(); countStillsLive(); }
330        if (!list.length) { close(); return; }
331        show(dir > 0 ? at : at - 1, tries + 1);
332        return;
333      }
334      var u = c[k]; k++;
335      lkIm.onerror = next;
336      lkIm.onload = function () {
337        if (show.tok !== tok) return;
338        clearTimeout(show.tm);
339        if ((lkIm.naturalWidth || 0) <= 2) { next(); return; }
340        lkIm.style.visibility = "visible";
341      };
342      show.tm = setTimeout(next, STEP_MS);
343      lkIm.src = u;
344    }
345    next();
346  }
347  function countStillsLive() { /* the label keeps the number counted from the bytes; nothing to recount */ }
348  function open(i) {
349    list = stills();
350    if (!list.length || !lk) return;
351    if (lk.parentNode !== document.body || lk.nextElementSibling) document.body.appendChild(lk);
352    lk.style.zIndex = "2147483647";
353    if (!lk.open) { try { lk.showModal(); } catch (e) { lk.setAttribute("open", ""); } }
354    lk.setAttribute("data-open", "1");
355    document.documentElement.classList.add("look-lock");
356    dir = 1;
357    show(i);
358  }
359  function close() {
360    if (!lk || lk.getAttribute("data-open") !== "1") return;
361    lk.setAttribute("data-open", "0");
362    clearTimeout(show.tm); show.tok = null;
363    lkIm.onerror = null; lkIm.onload = null;
364    lkIm.src = BLANK;
365    document.documentElement.classList.remove("look-lock");
366    try { lk.close(); } catch (e) { lk.removeAttribute("open"); }
367  }
368  function tray(openIt) {
369    var d = document.getElementById("tray");
370    if (!d) return;
371    if (openIt) {
372      try { d.showModal(); } catch (e) { d.setAttribute("open", ""); }
373      var f = document.getElementById("tq"); if (f && window.innerWidth >= 720) try { f.focus(); } catch (e2) {}
374    } else { try { d.close(); } catch (e) { d.removeAttribute("open"); } }
375  }
376
377  /* brief 7c: the network promo arrives twice and its close handler lands on the first copy */
378  document.addEventListener("click", function (ev) {
379    var b = ev.target.closest(".r34-banner-close, .r34-popup-close");
380    if (!b) return;
381    var host = b.closest(".r34-banner, .r34-overlay");
382    if (host) host.remove();
383  }, true);
384
385  /* our own clicks: on window, capture phase, no stopPropagation (w38 F2, w40 B3) */
386  window.addEventListener("click", function (ev) {
387    var t = ev.target;
388    if (!t || !t.closest) return;
389    var d = t.closest("[data-tray]");
390    if (d) { tray(d.getAttribute("data-tray") === "open"); return; }
391    var dw = document.getElementById("tray");
392    if (dw && t === dw) { tray(false); return; }
393    var v = t.closest("[data-look]");
394    if (v) {
395      var a = v.getAttribute("data-look");
396      if (a === "x") close(); else if (a === "p") { dir = -1; show(at - 1); } else if (a === "n") { dir = 1; show(at + 1); }
397      return;
398    }
399    if (lk && lk.getAttribute("data-open") === "1") {
400      if (t === lk || t.classList.contains("look__im") || t.classList.contains("look__top") || t.classList.contains("look__bot")) { close(); return; }
401      /* the still stands whole (scale-down) inside a full-size box: a press on the empty part of that box is a
402         press on the backdrop; a press on the picture itself never closes */
403      if (t === lkIm && lkIm.naturalWidth > 2) {
404        var r = lkIm.getBoundingClientRect(), nw = lkIm.naturalWidth, nh = lkIm.naturalHeight;
405        var s = Math.min(1, r.width / nw, r.height / nh), cw = nw * s, ch = nh * s;
406        var x0 = r.left + (r.width - cw) / 2, y0 = r.top + (r.height - ch) / 2;
407        if (ev.clientX < x0 || ev.clientX > x0 + cw || ev.clientY < y0 || ev.clientY > y0 + ch) close();
408      }
409      return;
410    }
411    var ld = t.closest("button.easel__cv");
412    if (ld) {
413      var o = ld.getAttribute("data-o"), all = stills(), hit = 0;
414      for (var i = 0; i < all.length; i++) if (all[i].getAttribute("data-o") === o) { hit = i; break; }
415      open(hit);
416      return;
417    }
418    var tb = t.closest(".stills .still");
419    if (tb) { var ts = stills(), kk = ts.indexOf(tb); if (kk !== -1) open(kk); }
420  }, true);
421
422  document.addEventListener("keydown", function (ev) {
423    if (lk && lk.getAttribute("data-open") === "1") {
424      if (ev.key === "Escape") { ev.preventDefault(); close(); }
425      else if (ev.key === "ArrowLeft") { dir = -1; show(at - 1); }
426      else if (ev.key === "ArrowRight") { dir = 1; show(at + 1); }
427    }
428  });
429
430  function boot() {
431    lk = document.getElementById("look");
432    if (lk) {
433      lkIm = lk.querySelector(".look__im img");
434      lkC = lk.querySelector(".look__c");
435      lk.addEventListener("cancel", function (ev) { ev.preventDefault(); close(); });
436    }
437    countStills();
438    var imgs = document.querySelectorAll(SEL);
439    for (var i = 0; i < imgs.length;
439 i++) arm(imgs[i], true);
440    chips();
441    fillQuery();
442    clipWatch();
443    tidy();
444    sweep();
445    setInterval(sweep, TICK);
446    setTimeout(function () { pickLead(false); }, 2500);
447    setTimeout(function () { pickLead(true); }, 9000);
448    fitHeads();
449    if (document.fonts && document.fonts.ready) document.fonts.ready.then(fitHeads);
450    var rt = 0;
451    window.addEventListener("resize", function () { tidy(); clearTimeout(rt); rt = setTimeout(function () { fitHeads(); var a = document.querySelectorAll(SEL); for (var j = 0; j < a.length; j++) if (a[j].getAttribute("data-ok") === "1") fit(a[j]); }, 150); });
452    window.addEventListener("pageshow", sweep);
453  }
454  if (document.readyState === "loading") document.addEventListener("DOMContentLoaded", boot);
455  else boot();
456})();

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.