{"version":3,"sources":["webpack://@verndale/toolkit/./src/js/limelight.js","webpack://@verndale/toolkit/./src/js/components/video-item.js","webpack://@verndale/toolkit/./src/js/modules/video-gallery-carousel.js"],"names":[],"mappings":"iPAEA,KAAM,GACJ,kGAEa,MAAM,CAAgB,CACnC,YAAY,CAAE,WAAW,CAAC,EAAG,UAAU,CACrC,KAAK,cAAgB,CACnB,OAAQ,OACR,MAAO,OACP,WAAY,uBACT,CACL,EACA,KAAK,OAAS,EACd,KAAK,gBAAgB,CACvB,CAEA,iBAAkB,CAChB,KAAM,GAAY,SAAS,cAAc,KAAK,EACxC,EAAW,KAAK,KAAK,OAAO,EAAE,SAAS,EAAE,EAAE,MAAM,CAAC,IACxD,EAAU,GAAK,EACf,KAAK,cAAgB,IAAK,KAAK,cAAe,UAAS,EACvD,KAAK,OAAO,YAAY,CAAS,EACjC,KAAK,SAAW,EAEhB,KAAK,cAAc,CACrB,CAEA,WAAY,CACV,KAAK,OAAS,KAAK,OAAO,cAAc,IAAI,KAAK,UAAU,EAC3D,KAAK,OAAS,EAChB,CAEA,MAAO,CACL,KAAK,OAAO,OAAO,CACrB,CAEA,OAAQ,CACN,KAAK,QAAQ,QAAQ,CACvB,CAEA,KAAK,EAAY,EAAW,GAAO,EAAyB,EAAG,CAC7D,KAAK,UAAU,EACf,KAAK,OAAO,YAAY,EAAY,EAAU,CAAsB,CACtE,MAEM,gBAAgB,CACpB,KAAM,KAAW,CAAwB,EACzC,OAAO,oBAAoB,MAAM,KAAK,aAAa,EACnD,KAAK,UAAU,CACjB,CACF,C,cCzCA,KAAM,GAAc,qBAEpB,MAAM,SAAkB,KAAU,CAChC,eAAgB,CACd,KAAK,IAAM,CACT,gBAAiB,KAAK,GAAG,cAAc,wBAAwB,EAC/D,YAAa,KAAK,GAAG,cAAc,6BAA6B,EAChE,eAAgB,KAAK,GAAG,cAAc,4BAA4B,EAClE,aAAc,KAAK,GAAG,cAAc,0BAA0B,EAC9D,iBAAkB,KAAK,GAAG,cAA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eAAgB,EAChB,cAAe,EACf,aAAc,GACd,WAAY,CACV,KAAM,CACR,CACF,CACF,EACA,WAAY,CACV,GAAI,KAAK,IAAI,kBACb,KAAM,UACR,EACA,WAAY,CACV,OAAQ,KAAK,IAAI,kBACjB,OAAQ,KAAK,IAAI,iBACnB,EACA,oBAAqB,EACvB,CAAC,CACH,CACF,CAEA,UAAe,C","file":"scripts/2466.7cbed4cf67c55a712abd.js","sourcesContent":["import loadScript from 'load-script2';\n\nconst LIMELIGHT_IFRAME_API_SRC =\n 'https://video.limelight.com/player/limelightjs-player.js?orgId=3ee7b65cff5f4484b6ad3f9565c13737';\n\nexport default class LimeLightPlayer {\n constructor({ settings = {}, parent }) {\n this.videoSettings = {\n height: '100%',\n width: '100%',\n playerForm: 'LVPPlayerStandard',\n ...settings\n };\n this.parent = parent;\n this.createContainer();\n }\n\n createContainer() {\n const container = document.createElement('div');\n const playerId = `id${Math.random().toString(16).slice(2)}`;\n container.id = playerId;\n this.videoSettings = { ...this.videoSettings, playerId };\n this.parent.appendChild(container);\n this.playerId = playerId;\n\n this.loadIframeAPI();\n }\n\n getPlayer() {\n this.player = this.parent.querySelector(`#${this.playerId}`);\n this.loaded = true;\n }\n\n play() {\n this.player.doPlay();\n }\n\n pause() {\n this.player?.doPause();\n }\n\n load(newMediaId, autoPlay = false, positionInMilliseconds = 0) {\n this.getPlayer();\n this.player.doLoadMedia(newMediaId, autoPlay, positionInMilliseconds);\n }\n\n async loadIframeAPI() {\n await loadScript(LIMELIGHT_IFRAME_API_SRC);\n window.LimelightPlayerUtil.embed(this.videoSettings);\n this.getPlayer();\n }\n}\n","// @ts-check\n// @ts-ignore\n// @ts-ignore\nimport { Component } from '@verndale/core';\nimport YouTubePlayer from 'yt-player';\nimport VimeoPlayer from '@vimeo/player';\nimport LimeLightPlayer from '../limelight';\nimport { setTrackDataLayer, secondsToHHMMSS } from '../utils';\n\n// @ts-ignore\nconst VIDEO_EVENT = 'video_interactions';\n\nclass VideoItem extends Component {\n setupDefaults() {\n this.dom = {\n $imageContainer: this.el.querySelector('.card__image-container'),\n $playButton: this.el.querySelector('.video-item__icon-container'),\n $youTubePlayer: this.el.querySelector('.video-item__youtube-video'),\n $vimeoPlayer: this.el.querySelector('.video-item__vimeo-video'),\n $limelightPlayer: this.el.querySelector('.video-item__limelight-video'),\n $mediaModal: document.getElementById('modal-1')\n };\n\n this.nativePlayer = this.el.dataset.native;\n\n this.loaded = false;\n this.init();\n this.initObserver();\n }\n\n addListeners() {\n this.dom?.$playButton?.addEventListener('click', () => this.playVideo());\n this.dom?.$playButton?.addEventListener('mouseover', () =>\n this.loadVideo()\n );\n }\n\n observeClass(mutationsList) {\n mutationsList.forEach((mutation) => {\n if (mutation.attributeName === 'class') {\n if (!mutation.target.classList.contains('is-open')) {\n // @ts-ignore\n this.player?.stop();\n this.playerVimeo?.unload();\n }\n }\n });\n }\n\n switchToVideo() {\n if (this.dom) {\n this.dom.$imageContainer.style.display = 'none';\n this.dom.$playButton.style.display = 'none';\n }\n this.el.classList.add('video-item--playing');\n }\n\n playVideo() {\n this.switchToVideo();\n this.player?.play();\n this.playerVimeo?.play();\n }\n\n pauseVideo() {\n this.player?.pause();\n this.playerVimeo?.pause();\n }\n\n loadVideo() {\n if (!this.loaded) {\n this.player?.load(this.videoId);\n this.loaded = true;\n }\n }\n\n async getVideoMetadata() {\n if (this.videoProps) {\n if (this.el.dataset.youtubeId) {\n this.player = new YouTubePlayer(this.dom?.$youTubePlayer);\n this.videoId = this.el.dataset.youtubeId;\n // @ts-ignore\n this.videoProps.video_id = this.videoId;\n\n // These are all the events that the YouTube player can trigger (https://developers.google.com/youtube/iframe_api_reference#Events)\n const ytPlayerEvents = ['unstarted', 'ended', 'playing', 'paused'];\n\n ytPlayerEvents.forEach((event) => {\n // @ts-ignore\n this.player?.on(event, async () => {\n // @ts-ignore\n this.videoProps.video_duration = secondsToHHMMSS(\n // @ts-ignore\n this.player?.getDuration().toString()\n );\n // @ts-ignore\n this.videoProps.video_current_time = secondsToHHMMSS(\n // @ts-ignore\n this.player?.getCurrentTime().toString()\n );\n // @ts-ignore\n this.videoProps.video_progress_percentage =\n // @ts-ignore\n `${this.player?.getProgress() / 100}%`;\n setTrackDataLayer({\n eventName: VIDEO_EVENT,\n custom: {\n interaction: event,\n ...this.videoProps\n }\n });\n });\n });\n }\n\n if (this.dom?.$vimeoPlayer) {\n this.playerVimeo = new VimeoPlayer(this.dom?.$vimeoPlayer);\n this.videoId = this.el.dataset.videoId;\n // @ts-ignore\n this.videoProps.video_id = this.videoId;\n\n // These are all the events that the Vimeo player can trigger (https://developer.vimeo.com/player/sdk/reference#events-for-playback-controls)\n const vimeoPlayerEvents = ['ended', 'error', 'pause', 'play'];\n\n vimeoPlayerEvents.forEach((event) => {\n // @ts-ignore\n this.playerVimeo.on(event, async () => {\n // @ts-ignore\n this.videoProps.video_title =\n // @ts-ignore\n await this.playerVimeo.getVideoTitle();\n // @ts-ignore\n this.videoProps.video_duration = secondsToHHMMSS(\n // @ts-ignore\n (await this.playerVimeo.getDuration()).toString()\n );\n // @ts-ignore\n this.videoProps.video_current_time = secondsToHHMMSS(\n // @ts-ignore\n (await this.playerVimeo.getCurrentTime()).toString()\n );\n // @ts-ignore\n this.videoProps.video_progress_percentage = `${Math.round(\n // @ts-ignore\n ((await this.playerVimeo.getCurrentTime()) * 100) /\n // @ts-ignore\n (await this.playerVimeo.getDuration())\n )}%`;\n setTrackDataLayer({\n eventName: VIDEO_EVENT,\n custom: {\n interaction: event,\n ...this.videoProps\n }\n });\n });\n });\n }\n }\n }\n\n async init() {\n this.videoProps = {\n video_title: '', // Video title\n video_duration: '', // Duration in seconds\n video_current_time: '', // Current time in seconds\n video_id: '', // Unique video ID\n video_progress_percentage: '' // Percentage of video watched, (Just for those 4 percentages)\n };\n\n if (this.el.dataset.limelightId && !this.nativePlayer) {\n this.player = new LimeLightPlayer({ parent: this.dom?.$limelightPlayer });\n this.videoId = this.el.dataset.limelightId;\n }\n\n await this.getVideoMetadata();\n\n if (this.nativePlayer) {\n if (this.el.dataset.limelightId) {\n this.player = new LimeLightPlayer({\n settings: { mediaId: this.el.dataset.limelightId },\n parent: this.dom?.$limelightPlayer\n });\n } else {\n this.loadVideo();\n }\n }\n }\n\n initObserver() {\n if (this.dom?.$mediaModal) {\n const mutationObserver = new MutationObserver(\n this.observeClass.bind(this)\n );\n mutationObserver.observe(this.dom.$mediaModal, { attributes: true });\n }\n }\n}\n\nexport default VideoItem;\n","import { Component } from '@verndale/core';\nimport Swiper, { Navigation, Pagination } from 'swiper';\nimport { BREAKPOINTS } from '../utils';\n\nimport VideoItem from '../components/video-item';\n\nSwiper.use([Navigation, Pagination]);\nclass VideoGalleryCarousel extends Component {\n setupDefaults() {\n this.dom = {\n $heading: this.el.querySelector('.video-gallery-carousel__heading'),\n $link: this.el.querySelector('.video-gallery-carousel__link'),\n $swiperContainer: this.el.querySelector('.swiper'),\n $swiperSlides: this.el.querySelectorAll('.swiper-slide'),\n $videos: this.el.querySelectorAll('.video-item'),\n $swiperPagination: this.el.querySelector('.swiper-pagination'),\n $swiperNextButton: this.el.querySelector('.swiper-button-next'),\n $swiperPrevButton: this.el.querySelector('.swiper-button-prev')\n };\n\n this.isSmallContainer = this.el.closest('.dual-column-container__main');\n this.videos = [...this.dom.$videos].map((video) => new VideoItem(video));\n this.initSwiper();\n }\n\n initSwiper() {\n let enableSwiper = false;\n const swiperSlides = this.isSmallContainer ? 1 : 2;\n const swiperPaginationType = this.isSmallContainer ? 'fraction' : 'bullets';\n\n if (this.isSmallContainer) {\n enableSwiper = this.dom.$swiperSlides.length >= 2;\n } else {\n enableSwiper = this.dom.$swiperSlides.length !== 2;\n }\n\n if (!enableSwiper && this.dom.$link)\n this.dom.$link.classList.add(\n 'video-gallery-carousel__link--no-margin-block'\n );\n\n this.swiper = new Swiper(this.dom.$swiperContainer, {\n a11y: true,\n centeredSlides: true,\n direction: 'horizontal',\n rewind: true,\n slidesPerGroup: 1,\n slidesPerView: 1,\n breakpoints: {\n [BREAKPOINTS.TABLET_LANDSCAPE]: {\n allowTouchMove: false,\n enabled: enableSwiper,\n centeredSlides: false,\n slidesPerGroup: swiperSlides,\n slidesPerView: swiperSlides,\n spaceBetween: 32,\n pagination: {\n type: swiperPaginationType\n }\n }\n },\n pagination: {\n el: this.dom.$swiperPagination,\n type: 'fraction'\n },\n navigation: {\n nextEl: this.dom.$swiperNextButton,\n prevEl: this.dom.$swiperPrevButton\n },\n watchSlidesProgress: true\n });\n }\n}\n\nexport default VideoGalleryCarousel;\n"],"sourceRoot":""}