1/* stimulusFetch: 'lazy' */ 2import{Controller as n}from"@hotwired/stimulus";import{isConsentCategoryGranted as t}from"../consent_mode.js";export default class extends n{static targets=["frame","thumbnail","placeholder"];static values={id:String};connect(){this.handleConsentChange=()=>this.activateIfAllowed(),window.addEventListener("cookie-consent:changed",this.handleConsentChange),this.activateIfAllowed()}disconnect(){window.removeEventListener("cookie-consent:changed",this.handleConsentChange)}requestConsent(e){t("marketing")||(e.preventDefault(),e.stopImmediatePropagation(),window.dispatchEvent(new CustomEvent("cookie-consent:open")))}activateIfAllowed(){!this.idValue||!t("marketing")||(this.hasFrameTarget&&!this.frameTarget.hasAttribute("src")&&(this.frameTarget.src=`https://www.youtube-nocookie.com/embed/${encodeURIComponent(this.idValue)}`,this.frameTarget.hidden=!1),this.hasThumbnailTarget&&!this.thumbnailTarget.hasAttribute("src")&&(this.thumbnailTarget.src=`https://img.youtube.com/vi/${encodeURIComponent(this.idValue)}/default.jpg`,this.thumbnailTarget.hidden=!1),this.placeholderTargets.forEach(e=>{e.hidden=!0}),this.element.matches("button")&&(this.element.dataset.pswpType="youtube",this.element.dataset.youtubeUrl=`https://www.youtube-nocookie.com/embed/${encodeURIComponent(this.idValue)}`))}}
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.