1import{Controller}from"@hotwired/stimulus";export default class extends Controller{static values={title:String,text:String,url:String,successMessage:String};static targets=["result"];async share(e){e.preventDefault();const t={title:this.titleValue||document.title,text:this.textValue||"",url:this.urlValue||window.location.href};if(typeof navigator.share=="function")try{await navigator.share(t);return}catch(e){if(e.name==="AbortError")return}await navigator.clipboard.writeText(t.url),this.updateResult(this.successMessageValue||"The link has been copied to the clipboard.")}updateResult(e){this.hasResultTarget&&(this.resultTarget.textContent=e,this.resultTarget.classList.add("is-visible"),setTimeout(()=>{this.resultTarget.classList.remove("is-visible"),setTimeout(()=>{this.resultTarget.textContent=""},200)},3e3))}}
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.