1import{Controller}from"@hotwired/stimulus";export default class extends Controller{static get targets(){return["input","counter","noun"]}initialize(){this.update=this.update.bind(this)}connect(){this.update(),this.inputTarget.addEventListener("input",this.update)}disconnect(){this.inputTarget.removeEventListener("input",this.update)}update(){1===this.count?this.nounTarget.textContent="character":this.nounTarget.textContent="characters",this.counterTarget.textContent=this.count.toString()}get count(){if(this.inputTarget.hasAttribute("maxlength")){return this.inputTarget.getAttribute("maxlength")-this.inputTarget.value.length}return this.inputTarget.value.length}}
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.