1import{Controller}from"@hotwired/stimulus";export default class extends Controller{static targets=["input","total","error","submit"];connect(){this.update()}update(){if(!this.hasTotalTarget)return;const t=this.sum();this.totalTarget.value=t,this.setError(t<=0),this.setSubmitDisabled(t<=0)}sum(){return this.inputTargets.reduce((t,s)=>t+(parseInt(s.value,10)||0),0)}validateOnSubmit(t){!this.hasTotalTarget||this.sum()>0||t.preventDefault()}setError(t){this.hasErrorTarget&&this.errorTarget.classList.toggle("has-error",t)}setSubmitDisabled(t){this.hasSubmitTarget&&(this.submitTarget.disabled=t)}}
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.