1import{Controller}from"@hotwired/stimulus";export default class extends Controller{static targets=["liveBlock","yesterdayBlock","preYesterdayBlock"];static values={statusUrl:String,initial:Boolean,intervalMs:{type:Number,default:3e4},oneLine:Boolean};connect(){this.prev=this.initialValue,this.timer=setInterval(()=>this.check(),this.intervalMsValue),setTimeout(()=>this.check(),1500)}disconnect(){clearInterval(this.timer)}async check(){try{const t=await fetch(this.statusUrlValue,{cache:"no-store"});if(!t.ok)return;const{live:e}=await t.json();e!==this.prev&&(this.render(e),this.prev=e)}catch{}}render(e){e?this.oneLineValue===!0?(this.show(this.liveBlockTarget),this.hide(this.yesterdayBlockTarget)):(this.show(this.liveBlockTarget),this.show(this.yesterdayBlockTarget),this.preYesterdayBlockTarget&&this.hide(this.preYesterdayBlockTarget,{pauseAudio:!0})):this.oneLineValue===!0?(this.hide(this.liveBlockTarget,{pauseAudio:!0}),this.show(this.yesterdayBlockTarget)):(this.hide(this.liveBlockTarget,{pauseAudio:!0}),this.show(this.yesterdayBlockTarget),this.preYesterdayBlockTarget&&this.show(this.preYesterdayBlockTarget))}show(e){const t=["opacity-0","pointer-events-none","h-0","overflow-hidden"];t.forEach(t=>e.classList.remove(t)),e.setAttribute("aria-hidden","false")}hide(e,{pauseAudio:t=!1}={}){const n=["opacity-0","pointer-events-none","h-0","overflow-hidden"];if(n.forEach(t=>e.classList.add(t)),e.setAttribute("aria-hidden","true"),t){const t=e.querySelector("audio");try{t?.pause()}catch{}}}}
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.