{"version":3,"sources":["20220922OmniChannel_functions.js"],"names":["playVideoBtns","document","querySelectorAll","msdwPopupVideoWrapper","querySelector","msdwPopupVideoBackDrop","msdwPopupVideo","getElementById","contains","forEach","playVideoBtn","addEventListener","e","preventDefault","videoUrl","href","setAttribute","classList","add","body","muted","play","closePopUpVideo","remove","pause","currentTime","window","onkeydown","keyCode"],"mappings":"AA4BA,IAAMA,cAAgBC,SAASC,iBAAiB,oBAC1CC,sBAAwBF,SAASG,cACrC,6BAEIC,uBAAyBJ,SAASG,cACtC,8BAEIE,eAAiBL,SAASM,eAAe,kBAE/C,GAAIN,SAASO,SAASL,uBAAwB,CAE5CH,cAAcS,QAAQ,SAACC,GACrBA,EAAaC,iBAAiB,QAAS,SAACC,GACtCA,EAAEC,iBACF,IAAMC,EAAWJ,EAAaK,KAC9BT,eAAeU,aAAa,MAAOF,GACnCX,sBAAsBc,UAAUC,IAAI,eACpCjB,SAASkB,KAAKF,UAAUC,IAAI,sBAC5BZ,eAAec,OAAQ,EACvBd,eAAee,WAKnB,IAAMC,gBAAkB,WACtBrB,SAASkB,KAAKF,UAAUM,OAAO,sBAC/BjB,eAAec,OAAQ,EACvBd,eAAekB,QACflB,eAAemB,YAAc,EAE7BtB,sBAAsBc,UAAUM,OAAO,gBAGzClB,uBAAuBM,iBAAiB,QAAS,WAC/CW,oBAGFI,OAAOC,UAAY,SAACf,GACD,IAAbA,EAAEgB,SAAeN","file":"20220922OmniChannel_functions.min.js","sourcesContent":["// videoLightning({\r\n//   settings: {\r\n//       autoplay: true,\r\n//       color: \"white\",\r\n//       bdColor: \"#000\",\r\n//       bdOpacity: \"0.5\",\r\n//       rickRoll: false,\r\n//       byline:0,\r\n//       portrait: 0,\r\n//       showinfo: 0,\r\n//       zIndex: 99999\r\n//   },\r\n//   elements: [{\r\n//       \".msdw-play-video\": {\r\n//           autoplay: true,\r\n//           autoclose: true,\r\n//           ease_out: 1000,\r\n//           width: 1280,\r\n//           height: 720\r\n//       }\r\n//   }]\r\n// });\r\n\r\n\r\n//\r\n// =VIDEO MODAL\r\n// --------------------------------------------------\r\n\r\nconst playVideoBtns = document.querySelectorAll(\".msdw-play-video\");\r\nconst msdwPopupVideoWrapper = document.querySelector(\r\n  \".msdw-popup-video-wrapper\"\r\n);\r\nconst msdwPopupVideoBackDrop = document.querySelector(\r\n  \".msdw-popup-video-backdrop\"\r\n);\r\nconst msdwPopupVideo = document.getElementById(\"msdwPopupVideo\");\r\n\r\nif (document.contains(msdwPopupVideoWrapper)) {\r\n  // open\r\n  playVideoBtns.forEach((playVideoBtn) => {\r\n    playVideoBtn.addEventListener(\"click\", (e) => {\r\n      e.preventDefault();\r\n      const videoUrl = playVideoBtn.href;\r\n      msdwPopupVideo.setAttribute(\"src\", videoUrl);\r\n      msdwPopupVideoWrapper.classList.add(\"msdw-active\");\r\n      document.body.classList.add(\"jws-overflowHidden\");\r\n      msdwPopupVideo.muted = false;\r\n      msdwPopupVideo.play();\r\n    });\r\n  });\r\n\r\n  // close\r\n  const closePopUpVideo = () => {\r\n    document.body.classList.remove(\"jws-overflowHidden\");\r\n    msdwPopupVideo.muted = true;\r\n    msdwPopupVideo.pause();\r\n    msdwPopupVideo.currentTime = 0;\r\n\r\n    msdwPopupVideoWrapper.classList.remove(\"msdw-active\");\r\n  };\r\n\r\n  msdwPopupVideoBackDrop.addEventListener(\"click\", () => {\r\n    closePopUpVideo();\r\n  });\r\n\r\n  window.onkeydown = (e) => {\r\n    if (e.keyCode == 27) closePopUpVideo();\r\n  };\r\n}\r\n\r\n\r\n\r\n"]}