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AUC,IAChBN,EAAKE,cAAc,UACzBK,IAAM,GACbP,EAAKT,aAAa,gBAAiB,GAAG,IAI1CP,SAASqB,iBAAiB,WAAYC,IAElC,GAAc,WAAVA,EAAErC,KAAkC,KAAdqC,EAAEE,QAAgB,CACxC,IAAIP,EAASD,EAAKE,cAAc,UAE5BD,IACAA,EAAOM,IAAM,GACbP,EAAKT,aAAa,gBAAiB,IAE3C,KAGJI,EAAOc,YAAYb,GACnBF,EAAQe,YAAYd,GACpBD,EAAQgB,OAAOV,GACfP,EAAOgB,YAAYf,GACnBR,EAAMuB,YAAYhB,GAElBT,SAASgB,KAAKU,OAAOxB,EACzB,CAEyBF,SAAS2B,iBAAiB,eAChCC,SAAQC,IACvBA,EAAOR,iBAAiB,SAAUC,IAC9B,IAAIQ,EAAUD,EAAOE,aAAa,iBAC9BC,EAAWH,EAAOE,aAAa,kBAC/Bf,EAAOhB,SAASkB,cAAc,4BAG9BY,GAFSd,EAAKe,aAAa,mBAG3Bf,EAAKD,UAAa,gBAAeiB,kKACjChB,EAAKT,aAAa,gBAAiBuB,GACvC,GACF,GA/EI,CAiFd,CACA,E","sources":["webpack://static/webpack/bootstrap","webpack://static/webpack/runtime/define property getters","webpack://static/webpack/runtime/hasOwnProperty shorthand","webpack://static/./Static/js/Content/YouTubeModal.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","async function hiYouTubeModal() {\r\n    if (!window.HasLoaded)\r\n        window.HasLoaded = [];\r\n\r\n    if (window.HasLoaded.YouTubeModal)\r\n        return;\r\n\r\n    window.HasLoaded.YouTubeModal = true;\r\n\r\n    let modal = document.getElementById('video-modal');\r\n    if (!modal) {\r\n        let modal = document.createElement('div');\r\n        modal.id = 'video-modal';\r\n        modal.classList.add('modal', 'modal-fullscreen', 'fade');\r\n        modal.setAttribute('data-backdrop', 'static');\r\n        modal.setAttribute('data-keyboard', 'true');\r\n        modal.tabIndex = -1;\r\n\r\n        let dialog = document.createElement('div');\r\n        dialog.classList.add('modal-dialog', 'modal-dialog-centered', 'modal-xl');\r\n\r\n        let content = document.createElement('div');\r\n        content.classList.add('modal-content');\r\n\r\n        let header = document.createElement('div');\r\n        header.classList.add('modal-header', 'py-1');\r\n\r\n        let close = document.createElement('button');\r\n        close.type = 'button';\r\n        close.classList.add('closer', 'btn', 'btn-outline-light', 'rounded-0', 'mx-auto');\r\n        close.setAttribute('data-dismiss', 'modal');\r\n        close.ariaLabel = 'Close';\r\n        close.innerHTML = `<span aria-hidden=\"true\">&times; Close</span>`;\r\n\r\n        let body = document.createElement('div');\r\n        body.classList.add('modal-body', 'p-1');\r\n        body.setAttribute('data-video-id', '');\r\n\r\n        let iframe = body.querySelector('iframe');\r\n        if (iframe && iframe.contentWindow) {\r\n            iframe.contentWindow.postMessage('{\"event\":\"command\",\"func\":\"playVideo\",\"args\":\"\"}', '*');\r\n        }\r\n\r\n        // Setup the Close Button\r\n        close.addEventListener('click', (e) => {\r\n            let iframe = body.querySelector('iframe');\r\n            iframe.src = '';\r\n            body.setAttribute('data-video-id', '');\r\n        });\r\n\r\n        // Setup the Escape Key\r\n        document.addEventListener('keydown', (e) => {\r\n            // Check if the pressed key was the 'Escape' key\r\n            if (e.key === 'Escape' || e.keyCode === 27) { // 'e.keyCode === 27' is for older browsers\r\n                let iframe = body.querySelector('iframe');\r\n\r\n                if (iframe) { // Check if iframe exists just to be safe\r\n                    iframe.src = '';\r\n                    body.setAttribute('data-video-id', '');\r\n                }\r\n            }\r\n        });\r\n\r\n        header.appendChild(close);\r\n        content.appendChild(header);\r\n        content.append(body);\r\n        dialog.appendChild(content);\r\n        modal.appendChild(dialog);\r\n\r\n        document.body.append(modal);\r\n    }\r\n\r\n    let youTubePlayButtons = document.querySelectorAll(\".ytp-button\");\r\n    youTubePlayButtons.forEach(button => {\r\n        button.addEventListener('click', (e) => {\r\n            let videoID = button.getAttribute('data-video-id');\r\n            let videoUrl = button.getAttribute('data-video-url');\r\n            let body = document.querySelector('#video-modal .modal-body');\r\n            let bodyID = body.getAttribute('data-video-id');\r\n\r\n            if (videoID != bodyID) {\r\n                body.innerHTML = `<iframe src=\"${videoUrl}\" frameborder=\"0\" allow=\"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\" style=\"width: 100%; height: 100%; display: block;\"></iframe>`;\r\n                body.setAttribute('data-video-id', videoID);\r\n            }\r\n        });\r\n    });\r\n}\r\nexport default hiYouTubeModal();"],"names":["__webpack_require__","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","async","window","HasLoaded","YouTubeModal","document","getElementById","modal","createElement","id","classList","add","setAttribute","tabIndex","dialog","content","header","close","type","ariaLabel","innerHTML","body","iframe","querySelector","contentWindow","postMessage","addEventListener","e","src","keyCode","appendChild","append","querySelectorAll","forEach","button","videoID","getAttribute","videoUrl"],"sourceRoot":""}