1"use strict";(self.webpackChunktrux_common=self.webpackChunktrux_common||[]).push([[742],{80742:function(e,t,a){a.r(t);var n=a(52891),s=a(89336),o=a(60197);t.default=class extends n.xI{static targets=["item"];static values={key:String,view:String,src:String,mute:Boolean,loop:Boolean,poster:Boolean,modal:Boolean,autoplay:Boolean};connect(){!this.modalValue&&this.autoplayValue&&this.initPlayer(this.element,!1)}playClick(){if(this.modalValue){const e="#modal"+this.keyValue+this.viewValue,t=new s.Modal(e,[]),a=document.querySelector(e+" .modal-body-iframe");this.initPlayer(a,!0),t.show();document.querySelector(e).addEventListener("hidden.bs.modal",()=>{let e=document.querySelector(".embed-responsive-item");if(e)try{e.remove()}catch(e){}})}else this.autoplayValue||this.initPlayer(this.element,!1)}initPlayer(e,t=!1){e.innerHTML=t?this.getVideoFrameInModal():this.getVideoFrame();const a=e.querySelector("iframe"),n=()=>{a.contentWindow.postMessage(JSON.stringify({type:"player:setCurrentTime",data:{time:0}}),"*"),a.contentWindow.postMessage(JSON.stringify({type:"player:play",data:{}}),"*")};window.addEventListener("message",e=>{if(a.contentWindow!==e.source)return;const t="string"==typeof e.data?JSON.parse(e.data):e.data;switch(!0){case"inited"===t.event:this.muteValue&&a.contentWindow.postMessage({method:"mute"},"*");break;case"player:ready"===t.type:const e=this.muteValue?"mute":"unMute";a.contentWindow.postMessage(`{"type":"player:${e}","data":{}}`,"*"),setTimeout(n,2e3);break;case"player:changeState"===t.type&&"stopped"===t.data?.state:this.loopValue&&n()}})}getVideoFrame(){return`\n <iframe frameborder="0"\n allow="autoplay; encrypted-media; clipboard-write; fullscreen"\n type="text/html"\n src="${this.srcValue}">\n </iframe>\n `}getVideoFrameInModal(){return`\n <iframe frameborder="0"\n type="text/html"\n class="embed-responsive-item"\n src="${this.srcValue}"\n allowscriptaccess="always"\n allow="autoplay; encrypted-media; clipboard-write; fullscreen">\n </iframe>\n `}show(e){return e.preventDefault(),o.lX.fromNodes(this.itemTargets),!1}}}}]);
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.