{"version":3,"sources":["webpack:///./Flugger.Web/Scripts/Flugger/components/youtube.js","webpack:///./Flugger.Web/Scripts/Flugger/components/article-gallery.js","webpack:///./node_modules/youtube-google-analytics/lunametrics-youtube.gtm.js"],"names":["_jquery","_interopRequireDefault","require","_lunametricsYoutubeGtm","obj","__esModule","default","externalVideos","$","videoOnPage","loadExternalVideos","videos","getScript","count","each","$currentElement","this","ytId","attr","ytVideo","currCount","playYtVideo","playVideo","after","YT","Player","width","height","videoId","playerVars","autoplay","controls","rel","showinfo","modestbranding","wmode","events","onStateChange","event","data","stopYtVideo","onReady","target","f","ytTracker","init","console","log","initYtVideo","parent","addClass","window","trigger","pauseVideo","removeClass","on","e","id","exports","length","hasVideo","stopAllVideo","_youtube","_debounce","galleries","i","el","gallery","$nav","$navPrev","$navNext","$wrap","$navCaption","$navCaptionNext","$navList","$navListLi","pic_real_width","pic_real_height","$gallery","$gallerySlidesContainer","find","$slides","$slidesImageWraps","currentSlide","slidesCount","captions","isPortrait","hasClass","isCustomHeight","ratioLoaded","updateSlidesAspect","matchMedia","matches","isPortraitSplitSlides","Math","ceil","css","aspectPercent","prevSlide","prev","setSlide","nextSlide","next","index","$slide","newPos","youtube","content","stop","animate","html","updateNavCaption","updateNavNextCaption","updateNavigation","calcHeight","maxSlideHeigth","maxSlideWidth","h","children","w","child","outerHeight","push","img","topOffset","load","setupGallery","append","preventDefault","createNavigation","debounce","makeGallery","document","config","navigator","userAgent","match","firstScriptTag","tag","key","o","_config","forceSyntax","dataLayerName","eventsFired","hasOwnProperty","createElement","src","getElementsByTagName","parentNode","insertBefore","onYouTubeIframeAPIReady","apply","arguments","readyState","bind","addEvent","potentialVideos","checkIfYouTubeVideo","addYouTubeEvents","normalizeYouTubeIframe","digestPotentialVideos","getTagsAsArr_","concat","addEventListener","bindToNewVideos_","potentialYouTubeVideo","potentialYouTubeVideoSrc","dataSrc","getAttribute","indexOf","jsApiEnabled","url","originEnabled","youTubeVideo","loc","location","a","href","tmpPathname","pathname","charAt","search","hostname","port","origin","protocol","type","newIframe","replace","replaceChild","hash","youTubeIframe","player","get","pauseFlag","evt","stateIndex","targetVideoId","getVideoUrl","playerState","getPlayerState","marks","duration","min","floor","percentageTracking","points","every","parseInt","num","_point","_time","getMarks","getDuration","state","playTracker","timer","clearInterval","setInterval","currentTime","getCurrentTime","fireAnalyticsEvent","checkCompletion","onStateChangeHandler","videoUrl","_ga","GoogleAnalyticsObject","getAll","_gaq","name","fn","attachEvent","srcElement","call","tagName","slice","isYT"],"mappings":"+JAAA,IAAAA,EAAAC,EAAAC,EAAA,IACAC,EAAAF,EAAAC,EAAA,MAA4E,SAAAD,EAAAG,GAAA,OAAAA,KAAAC,WAAAD,EAAA,CAAAE,QAAAF,GAE5E,IAAMG,GAAiB,EAAAC,WAAE,YACrBC,GAAc,EAYlB,SAASC,EAAmBC,GACxBH,UAAEI,UAAU,sCAAsC,WAC9C,IAAIC,EAAQ,EACZF,EAAOG,MAAK,WACR,IAAMC,GAAkB,EAAAP,WAAEQ,MACpBC,EAAOF,EAAgBG,KAAK,UAC9BC,EAAU,KACRC,EAAYP,EAElB,SAASQ,IACW,OAAZF,EACAA,EAAQG,YAyBhB,WACIP,EAAgBQ,OAAM,EAAAf,WAAE,cAAgBY,EAAY,aAWpDD,EAAU,IAAIK,GAAGC,OAAO,KAAOL,EAAW,CACtCM,MAAO,KACPC,OAAQ,IACRC,QAASX,EACTY,WAbe,CACfC,SAAU,EACVC,SAAU,EACVC,IAAK,EACLC,SAAU,EACVC,eAAgB,EAChBC,MAAO,eAQPC,OAAQ,CACJC,cAAe,SAASC,GACD,IAAfA,EAAMC,MACNlB,IAEe,IAAfiB,EAAMC,MACNC,KAGRC,QAAS,SAASH,IACJ,EAAA9B,WAAE8B,EAAMI,OAAOC,QAxExB,IAAdC,UACuB,mBAAnBA,UAAUC,MACjBD,UAAUC,OAGdC,QAAQC,IAAI,0BAiBAC,GAEJjC,EAAgBkC,SAASC,SAAS,YAClC,EAAA1C,WAAE2C,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EAAI1J,OAAS0J,EAAI1J,QAAU0J,EAAIqC,WAE/BF,EAAGG,KAAKxK,EAAIkI,KASlB,SAASlC,EAAcyE,GAErB,MAAO,GAAGC,MAAMF,KAAKtG,EAASgB,qBAAqBuF,IAIrD,SAAStE,EAAiB+B,GAExB,IAAIlI,EAAKkI,EAAI1J,QAAU0J,EAAIqC,WACvBI,EAAO/E,EAAoB5F,GAIZ,WAAfA,EAAGyK,SAAwBE,GAAQlE,EAAazG,EAAGiF,MAAQ0B,EAAc3G,EAAGiF,MAE9EY,EAAiB7F,IA9bvB,CAocGkE,SAAUjF","file":"7.19d096928b293e468b2f.chunk.js","sourcesContent":["import $ from 'jquery';\r\nimport ytTracker from 'youtube-google-analytics/lunametrics-youtube.gtm.js';\r\n\r\nconst externalVideos = $('[src-yt]');\r\nlet videoOnPage = false;\r\n\r\nfunction callYtTracker() {\r\n if (typeof ytTracker !== 'undefined') {\r\n if (typeof ytTracker.init === 'function') {\r\n ytTracker.init();\r\n }\r\n } else {\r\n console.log('no ytTracker found'); // eslint-disable-line no-console\r\n }\r\n}\r\n\r\nfunction loadExternalVideos(videos) {\r\n $.getScript('https://www.youtube.com/iframe_api', function() {\r\n let count = 0;\r\n videos.each(function() {\r\n const $currentElement = $(this);\r\n const ytId = $currentElement.attr('src-yt');\r\n let ytVideo = null;\r\n const currCount = count;\r\n\r\n function playYtVideo() {\r\n if (ytVideo !== null) {\r\n ytVideo.playVideo();\r\n } else {\r\n initYtVideo();\r\n }\r\n $currentElement.parent().addClass('playing');\r\n $(window).trigger('videoPlaying', [currCount]);\r\n }\r\n\r\n function stopYtVideo() {\r\n if (ytVideo !== null) {\r\n ytVideo.pauseVideo();\r\n $currentElement.parent().removeClass('playing');\r\n $(window).trigger('videoStopped', [currCount]);\r\n }\r\n }\r\n\r\n function showMedia($element) {\r\n /*\r\n if (!$element.is('iframe')) {\r\n $currentElement.after($element);\r\n }\r\n */\r\n callYtTracker();\r\n }\r\n\r\n function initYtVideo() {\r\n $currentElement.after($('
'));\r\n\r\n const playerVars = {\r\n autoplay: 1,\r\n controls: 1,\r\n rel: 0,\r\n showinfo: 0,\r\n modestbranding: 1,\r\n wmode: 'transparent'\r\n };\r\n\r\n ytVideo = new YT.Player('yt' + currCount, {\r\n width: 1280,\r\n height: 720,\r\n videoId: ytId,\r\n playerVars: playerVars,\r\n events: {\r\n onStateChange: function(event) {\r\n if (event.data === 1) {\r\n playYtVideo();\r\n }\r\n if (event.data === 2) {\r\n stopYtVideo();\r\n }\r\n },\r\n onReady: function(event) {\r\n showMedia($(event.target.f));\r\n }\r\n }\r\n });\r\n }\r\n\r\n $currentElement.parent().on('click', playYtVideo);\r\n\r\n $(window).on('videoStop', function(e, id) {\r\n stopYtVideo();\r\n });\r\n\r\n $(window).on('videoPlaying', function(e, id) {\r\n if (id !== currCount) {\r\n stopYtVideo();\r\n }\r\n });\r\n\r\n count++;\r\n });\r\n });\r\n}\r\n\r\nfunction playExternalBackgroundVideos(videos) {\r\n videos.each(function(index, element) {\r\n element.playVideo();\r\n });\r\n}\r\n\r\nfunction stopAllVideo() {\r\n $(window).trigger('videoStop');\r\n}\r\n\r\nfunction hasVideo() {\r\n return videoOnPage;\r\n}\r\n\r\nfunction init() {\r\n if (externalVideos.length < 1) return false;\r\n videoOnPage = true;\r\n loadExternalVideos(externalVideos);\r\n}\r\n\r\nexport default {\r\n init: init,\r\n hasVideo: hasVideo,\r\n stopAllVideo: stopAllVideo\r\n};\r\n","import $ from 'jquery';\r\nimport youtube from './youtube';\r\nimport debounce from '../utility/debounce';\r\n\r\nconst galleries = $('.article-gallery');\r\n\r\nfunction init() {\r\n if (galleries.length < 1) return;\r\n\r\n galleries.each(function (i, el) {\r\n makeGallery(el);\r\n });\r\n}\r\n\r\nfunction makeGallery(gallery) {\r\n\r\n const $gallery = $(gallery);\r\n const $gallerySlidesContainer = $gallery.find('.article-gallery-slides');\r\n const $slides = $gallerySlidesContainer.find('.gallery-slide');\r\n const $slidesImageWraps = $($gallerySlidesContainer.find('.gallery-slide-image'));\r\n let currentSlide = 0;\r\n const slidesCount = $slides.length;\r\n\r\n // nav\r\n let $nav;\r\n let $navPrev;\r\n let $navNext;\r\n let $wrap;\r\n let $navCaption;\r\n let $navCaptionNext;\r\n let $navList;\r\n let $navListLi;\r\n const captions = [];\r\n\r\n //\r\n const isPortrait = $gallery.hasClass('article-gallery--portrait');\r\n const isCustomHeight = $gallery.hasClass('article-gallery--custom-height');\r\n let aspectRation = 0;\r\n let ratioLoaded = false;\r\n let pic_real_width;\r\n let pic_real_height;\r\n\r\n $gallery.addClass('preload');\r\n\r\n setupGallery();\r\n createNavigation();\r\n\r\n setSlide(currentSlide);\r\n $(window).on('resize', debounce(calcHeight, 50));\r\n // setTimeout(calcHeight, 300);\r\n\r\n\r\n function setupGallery() {\r\n\r\n\r\n $slides.each(function (i, el) {\r\n const $slide = $(el);\r\n $slide.css({\r\n 'position': 'absolute'\r\n });\r\n\r\n captions.push($slide.find('.gallery-slide-caption').html());\r\n /*\r\n $($slide.find(\".gallery-slide-title\")).css({\r\n \"margin-bottom\": topOffset + \"px\"\r\n })\r\n */\r\n });\r\n\r\n $gallerySlidesContainer.addClass('gallery-active');\r\n\r\n\r\n let topOffset = (slidesCount * 5);\r\n\r\n if (topOffset > 20) {\r\n topOffset = 20;\r\n }\r\n\r\n $gallerySlidesContainer.css({\r\n 'margin-top': topOffset + 'px'\r\n });\r\n\r\n checkPortraitFeatures();\r\n setAspectRation();\r\n }\r\n\r\n function setAspectRation() {\r\n\r\n // find first img in gallery\r\n const img = $($gallery.find('img')[0]);\r\n\r\n $('') // Make in memory copy of image to avoid css issues\r\n .attr('src', $(img).attr('src'))\r\n .load($(img).attr('src'), function () {\r\n pic_real_width = this.width; // Note: $(this).width() will not\r\n pic_real_height = this.height; // work for in memory images.\r\n\r\n aspectRation = (pic_real_height) / (pic_real_width) * 100;\r\n // console.log(pic_real_height+\" , \"+pic_real_width + \"= \"+aspectRation);\r\n // console.log('isCustomHeight: ' + isCustomHeight);\r\n ratioLoaded = true;\r\n if (isCustomHeight) {\r\n updateSlidesAspect();\r\n }\r\n calcHeight();\r\n });\r\n\r\n }\r\n\r\n function updateSlidesAspect() {\r\n\r\n if (isPortraitSplitSlides() && isPortrait) {\r\n let aspectPercent = Math.ceil((pic_real_height / 2) / (pic_real_width - 2) * 100);\r\n } else {\r\n let aspectPercent = Math.ceil((pic_real_height) / (pic_real_width - 2) * 100);\r\n }\r\n\r\n $slidesImageWraps.css({\r\n 'padding-bottom': aspectPercent + '%'\r\n });\r\n }\r\n\r\n function isPortraitSplitSlides() {\r\n\r\n if (window.matchMedia('(min-width: 570px)').matches) {\r\n return true;\r\n }\r\n return false;\r\n\r\n }\r\n\r\n function checkPortraitFeatures() {\r\n if (isPortrait && slidesCount == 2) {\r\n $gallery.addClass('gallery-active--two');\r\n }\r\n }\r\n\r\n\r\n function prevSlide() {\r\n let prev = currentSlide - 1;\r\n if (prev < 0) {\r\n prev = slidesCount - 1;\r\n }\r\n setSlide(prev);\r\n }\r\n\r\n function nextSlide() {\r\n let next = currentSlide + 1;\r\n if (next > slidesCount - 1) {\r\n next = 0;\r\n }\r\n setSlide(next);\r\n }\r\n\r\n function setSlide(index) {\r\n $slides.each(function (i, el) {\r\n const $slide = $(el);\r\n $slide.removeClass('previous-slide').removeClass('back-slide');\r\n let newPos = slidesCount - index + i;\r\n\r\n if (newPos > slidesCount - 1) {\r\n newPos = newPos - slidesCount;\r\n }\r\n $slide.attr('data-slideindex', newPos);\r\n\r\n\r\n if (newPos == slidesCount - 1 && $slides.length > 3) {\r\n $slide.addClass('previous-slide');\r\n }\r\n if (newPos == slidesCount - 2 && $slides.length > 3) {\r\n $slide.addClass('back-slide');\r\n }\r\n\r\n });\r\n if (youtube.hasVideo()) {\r\n youtube.stopAllVideo();\r\n }\r\n currentSlide = index;\r\n updateNavigation(currentSlide);\r\n }\r\n\r\n\r\n function createNavigation() {\r\n $nav = $('');\r\n $navPrev = $('prev');\r\n $navNext = $('next');\r\n $navCaption = $('

');\r\n $navCaptionNext = $('

');\r\n $navList = $('');\r\n\r\n $wrap = $(\"
\");\r\n $wrap.append($navPrev, $navList, $navNext);\r\n\r\n if ($navList.length < 1) return;\r\n\r\n for (let i = 0; i < slidesCount; i++) {\r\n $navList.append($('
  • ' + (i) + '
  • '));\r\n }\r\n $navListLi = $navList.find('li');\r\n\r\n $nav.append($wrap, $navCaption, $navCaptionNext);\r\n $gallery.append($nav);\r\n\r\n // bind clicks\r\n $navNext.on('click', function (e) {\r\n e.preventDefault();\r\n nextSlide();\r\n });\r\n $navPrev.on('click', function (e) {\r\n e.preventDefault();\r\n prevSlide();\r\n });\r\n $navListLi.each(function (i, el) {\r\n $(el).on('click', function (e) {\r\n e.preventDefault();\r\n setSlide(i);\r\n });\r\n });\r\n\r\n addSwipeNavigation();\r\n\r\n }\r\n\r\n function addSwipeNavigation() {\r\n $gallerySlidesContainer.on('swipeleft', function swipeLeft() {\r\n console.log('swipe left');\r\n nextSlide();\r\n });\r\n\r\n $gallerySlidesContainer.on('swiperight', function swipeRight() {\r\n console.log('swipe right');\r\n prevSlide();\r\n });\r\n }\r\n\r\n function updateNavigation(index) {\r\n $navListLi.each(function (i, el) {\r\n $(el).removeClass('gallery-navigation-active');\r\n // console.log( slidesCount +\" - \"+ index+\" \"+ ( slidesCount - index) +\" / \"+ i);\r\n if (index == i) {\r\n $(el).addClass('gallery-navigation-active');\r\n updateNavCaption(captions[i]);\r\n\r\n if (i + 1 < $navListLi.length) {\r\n updateNavNextCaption(captions[i + 1]);\r\n } else {\r\n updateNavNextCaption(captions[0]);\r\n }\r\n }\r\n });\r\n }\r\n\r\n function updateNavCaption(content) {\r\n if (!content) {\r\n content = '';\r\n }\r\n $navCaption.stop().animate({'opacity': 0}, function () {\r\n $navCaption.html(content);\r\n $navCaption.animate({'opacity': 1});\r\n });\r\n\r\n }\r\n\r\n function updateNavNextCaption(content) {\r\n if (!content) {\r\n content = '';\r\n }\r\n $navCaptionNext.stop().animate({'opacity': 0}, function () {\r\n $navCaptionNext.html(content);\r\n $navCaptionNext.animate({'opacity': 1});\r\n });\r\n\r\n }\r\n\r\n function calcHeight() {\r\n\r\n $gallery.addClass('preload');\r\n\r\n let maxSlideHeigth = 0;\r\n let maxSlideWidth = 0;\r\n if (isCustomHeight) {\r\n if (!ratioLoaded){\r\n return;\r\n }\r\n updateSlidesAspect();\r\n }\r\n\r\n $slides.each(function (i, el) {\r\n const $slide = $(el);\r\n let h = 0;\r\n\r\n const children = $slide.find('.gallery-slide-title, .gallery-slide-image'); // removed .gallery-slide-caption\r\n const w = $slide.find('.gallery-slide-image').width();\r\n\r\n children.each(function (i, el) {\r\n const child = $(el);\r\n\r\n if (child.outerHeight()) {\r\n h = h + child.outerHeight();\r\n }\r\n\r\n });\r\n\r\n if (h > maxSlideHeigth) {\r\n maxSlideHeigth = h;\r\n }\r\n if (w > maxSlideWidth) {\r\n maxSlideWidth = w;\r\n }\r\n });\r\n\r\n\r\n const aspectPercent = Math.ceil((maxSlideHeigth) / ($gallerySlidesContainer.width() - 2) * 100);\r\n $gallerySlidesContainer.css('padding-bottom', aspectPercent + '%');\r\n\r\n $gallery.removeClass('preload');\r\n $(window).trigger('lazyload');\r\n }\r\n}\r\n\r\nexport default {\r\n init: init\r\n};\r\n","(function(document, window, config) {\r\n\r\n 'use strict';\r\n\t// This script won't work on IE 6 or 7, so we bail at this point if we detect that UA\r\n\tif (navigator.userAgent.match(/MSIE [67]\\./gi)) return;\r\n\r\n var _config = config || {};\r\n var forceSyntax = _config.forceSyntax || 0;\r\n var dataLayerName = _config.dataLayerName || 'dataLayer';\r\n // Default configuration for events\r\n var eventsFired = {\r\n 'Play': true,\r\n 'Pause': true,\r\n 'Watch to End': true\r\n };\r\n\tvar firstScriptTag;\r\n\tvar tag;\r\n var key;\r\n\r\n for (key in _config.events) {\r\n\r\n if (_config.events.hasOwnProperty(key)) {\r\n\r\n eventsFired[key] = _config.events[key];\r\n\r\n }\r\n\r\n }\r\n\r\n\tif (window.YT) {\r\n\r\n\t\tinit();\t\r\n\r\n\t} else {\r\n\r\n\t\t// Fetches YouTube JS API\r\n\t\ttag = document.createElement('script');\r\n\t\ttag.src = '//www.youtube.com/iframe_api';\r\n\t\tfirstScriptTag = document.getElementsByTagName('script')[0];\r\n\t\tfirstScriptTag.parentNode.insertBefore(tag, firstScriptTag);\r\n\r\n\t\twindow.onYouTubeIframeAPIReady = (function(o) {\r\n\r\n\t\t\treturn function() {\r\n\r\n\t\t\t\tif (o) o.apply(this, arguments);\r\n\r\n\t\t\t\tinit();\r\n\r\n\t\t\t};\t\r\n\r\n\t\t})(window.onYouTubeIframeAPIReady);\r\n\r\n\t}\r\n\r\n // Invoked by the YouTube API when it's ready\r\n function init() {\r\n\r\n\t\tif (document.readyState !== 'loading') {\r\n\r\n\t\t\tbind();\r\n\r\n\t\t} else {\r\n\r\n\t\t\t// On IE8 this fires on window.load, all other browsers will fire when DOM ready\r\n\t\t\tif ('addEventListener' in document) {\r\n\r\n\t\t\t\taddEvent(document, 'DOMContentLoaded', bind);\r\n\r\n\t\t\t} else {\r\n\r\n\t\t\t\taddEvent(window, 'load', bind);\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n }\r\n\r\n\tfunction bind() {\r\n\r\n var potentialVideos = getTagsAsArr_('iframe').concat(getTagsAsArr_('embed'));\r\n digestPotentialVideos(potentialVideos);\r\n\r\n // Will bind to dynamically added videos\r\n if ('addEventListener' in document) { \r\n document.addEventListener('load', bindToNewVideos_, true);\r\n }\r\n\r\n\t}\r\n\r\n // Take our videos and turn them into trackable videos with events\r\n function digestPotentialVideos(potentialVideos) {\r\n\r\n var i;\r\n\r\n for (i = 0; i < potentialVideos.length; i++) {\r\n\r\n var isYouTubeVideo = checkIfYouTubeVideo(potentialVideos[i]);\r\n\r\n if (isYouTubeVideo) {\r\n\r\n var normalizedYouTubeIframe = normalizeYouTubeIframe(potentialVideos[i]);\r\n addYouTubeEvents(normalizedYouTubeIframe);\r\n\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n // Determine if the element is a YouTube video or not\r\n function checkIfYouTubeVideo(potentialYouTubeVideo) {\r\n\r\n var potentialYouTubeVideoSrc = potentialYouTubeVideo.src || '';\r\n var dataSrc = potentialYouTubeVideo.getAttribute('data-src') || '';\r\n\r\n if (potentialYouTubeVideoSrc.indexOf('youtube.com/embed/') > -1 ||\r\n potentialYouTubeVideoSrc.indexOf('youtube.com/v/') > -1 ||\r\n dataSrc.indexOf('youtube.com/embed/') > -1 ||\r\n dataSrc.indexOf('youtube.com/v/') > -1) {\r\n\r\n return true;\r\n\r\n }\r\n\r\n return false;\r\n\r\n }\r\n\r\n function jsApiEnabled(url) {\r\n\r\n return url.indexOf('enablejsapi') > -1;\r\n\r\n }\r\n\r\n function originEnabled(url) {\r\n\r\n return url.indexOf('origin') > -1;\r\n\r\n }\r\n\r\n // Turn embed objects into iframe objects and ensure they have the right parameters\r\n function normalizeYouTubeIframe(youTubeVideo) {\r\n\r\n var loc = window.location;\r\n var a = document.createElement('a');\r\n a.href = youTubeVideo.getAttribute('data-src') || youTubeVideo.src;\r\n var tmpPathname = a.pathname.charAt(0) === '/' ? a.pathname : '/' + a.pathname; // IE10 shim\r\n\r\n // For security reasons, YouTube wants an origin parameter set that matches our hostname\r\n\r\n if (!jsApiEnabled(a.search)) {\r\n\r\n a.search = (a.search.length > 0 ? a.search + '&' : '') + 'enablejsapi=1';\r\n\r\n }\r\n\r\n if (!originEnabled(a.search) && loc.hostname.indexOf('localhost') === -1) {\r\n \r\n var port = loc.port ? ':' + loc.port : '';\r\n var origin = loc.protocol + '%2F%2F' + loc.hostname + port;\r\n\r\n a.search = a.search + '&origin=' + origin;\r\n\r\n }\r\n\r\n if (youTubeVideo.type === 'application/x-shockwave-flash') {\r\n\r\n var newIframe = document.createElement('iframe');\r\n newIframe.height = youTubeVideo.height;\r\n newIframe.width = youTubeVideo.width;\r\n tmpPathname = tmpPathname.replace('/v/', '/embed/');\r\n\r\n youTubeVideo.parentNode.parentNode.replaceChild(newIframe, youTubeVideo.parentNode);\r\n\r\n youTubeVideo = newIframe;\r\n\r\n }\r\n\r\n a.pathname = tmpPathname;\r\n\r\n if (youTubeVideo.src !== a.href + a.hash) {\r\n\r\n youTubeVideo.src = a.href + a.hash;\r\n\r\n }\r\n\r\n return youTubeVideo;\r\n\r\n }\r\n\r\n // Add event handlers for events emitted by the YouTube API\r\n function addYouTubeEvents(youTubeIframe) {\r\n\r\n var player = YT.get(youTubeIframe.id);\r\n\r\n if (!player) {\r\n\r\n player = new YT.Player(youTubeIframe, {}); \r\n\r\n }\r\n\r\n if (typeof youTubeIframe.pauseFlag === 'undefined') { \r\n\r\n youTubeIframe.pauseFlag = false;\r\n player.addEventListener('onStateChange', function(evt) {\r\n\r\n onStateChangeHandler(evt, youTubeIframe);\r\n\r\n });\r\n\r\n }\r\n\r\n }\r\n\r\n // Returns key/value pairs of percentages: number of seconds to achieve\r\n function getMarks(duration) {\r\n\r\n var marks = {};\r\n\r\n // For full support, we're handling Watch to End with percentage viewed\r\n if (_config.events['Watch to End']) {\r\n\r\n marks['Watch to End'] = Math.min(duration - 3, Math.floor(duration * 0.99));\r\n\r\n }\r\n\r\n if (_config.percentageTracking) {\r\n\r\n var points = [];\r\n var i;\r\n\r\n if (_config.percentageTracking.each) {\r\n\r\n points = points.concat(_config.percentageTracking.each);\r\n\r\n }\r\n\r\n if (_config.percentageTracking.every) {\r\n\r\n var every = parseInt(_config.percentageTracking.every, 10);\r\n var num = 100 / every;\r\n\r\n for (i = 1; i < num; i++) {\r\n\r\n points.push(i * every);\r\n\r\n }\r\n\r\n }\r\n\r\n for (i = 0; i < points.length; i++) {\r\n\r\n var _point = points[i];\r\n var _mark = _point + '%';\r\n var _time = duration * _point / 100;\r\n\r\n marks[_mark] = Math.floor(_time);\r\n\r\n }\r\n\r\n }\r\n\r\n return marks;\r\n\r\n }\r\n\r\n function checkCompletion(player, marks, videoId) {\r\n\r\n var currentTime = player.getCurrentTime();\r\n var key;\r\n\r\n player[videoId] = player[videoId] || {};\r\n\r\n for (key in marks) {\r\n\r\n if (marks[key] <= currentTime && !player[videoId][key]) {\r\n\r\n player[videoId][key] = true;\r\n fireAnalyticsEvent(videoId, key);\r\n\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n // Event handler for events emitted from the YouTube API\r\n function onStateChangeHandler(evt, youTubeIframe) {\r\n\r\n var stateIndex = evt.data;\r\n var player = evt.target;\r\n var targetVideoUrl = player.getVideoUrl();\r\n var targetVideoId = targetVideoUrl.match(/[?&]v=([^&#]*)/)[1]; // Extract the ID \r\n var playerState = player.getPlayerState();\r\n var duration = Math.floor(player.getDuration());\r\n var marks = getMarks(duration);\r\n var playerStatesIndex = {\r\n '1': 'Play',\r\n '2': 'Pause'\r\n };\r\n var state = playerStatesIndex[stateIndex];\r\n\r\n youTubeIframe.playTracker = youTubeIframe.playTracker || {};\r\n\r\n if (playerState === 1 && !youTubeIframe.timer) {\r\n\r\n clearInterval(youTubeIframe.timer);\r\n\r\n youTubeIframe.timer = setInterval(function() {\r\n\r\n // Check every second to see if we've hit any of our percentage viewed marks\r\n checkCompletion(player, marks, youTubeIframe.videoId);\r\n\r\n }, 1000);\r\n\r\n } else {\r\n\r\n clearInterval(youTubeIframe.timer);\r\n youTubeIframe.timer = false;\r\n\r\n }\r\n\r\n // Playlist edge-case handler\r\n if (stateIndex === 1) {\r\n\r\n youTubeIframe.playTracker[targetVideoId] = true;\r\n youTubeIframe.videoId = targetVideoId;\r\n youTubeIframe.pauseFlag = false;\r\n\r\n }\r\n\r\n if (!youTubeIframe.playTracker[youTubeIframe.videoId]) {\r\n\r\n // This video hasn't started yet, so this is spam\r\n return false;\r\n\r\n }\r\n\r\n if (stateIndex === 2) {\r\n\r\n if (!youTubeIframe.pauseFlag) {\r\n\r\n youTubeIframe.pauseFlag = true;\r\n\r\n } else {\r\n\r\n // We don't want to fire consecutive pause events\r\n return false;\r\n\r\n }\r\n\r\n }\r\n\r\n // If we're meant to track this event, fire it\r\n if (eventsFired[state]) {\r\n\r\n fireAnalyticsEvent(youTubeIframe.videoId, state);\r\n\r\n }\r\n\r\n }\r\n\r\n // Fire an event to Google Analytics or Google Tag Manager\r\n function fireAnalyticsEvent(videoId, state) {\r\n\r\n var videoUrl = 'https://www.youtube.com/watch?v=' + videoId;\r\n var _ga = window.GoogleAnalyticsObject;\r\n\r\n if (typeof window[dataLayerName] !== 'undefined' && !_config.forceSyntax) {\r\n\r\n window[dataLayerName].push({\r\n\r\n 'event': 'youTubeTrack',\r\n 'attributes': {\r\n\r\n 'videoUrl': videoUrl,\r\n 'videoAction': state\r\n\r\n }\r\n\r\n });\r\n\r\n } else if (typeof window[_ga] === 'function' &&\r\n typeof window[_ga].getAll === 'function' &&\r\n _config.forceSyntax !== 2) {\r\n\r\n window[_ga]('send', 'event', 'Videos', state, videoUrl);\r\n\r\n } else if (typeof window._gaq !== 'undefined' && forceSyntax !== 1) {\r\n\r\n window._gaq.push(['_trackEvent', 'Videos', state, videoUrl]);\r\n\r\n }\r\n\r\n }\r\n\r\n // Simple cross-browser event listener\r\n function addEvent(el, name, fn) {\r\n\r\n if (el.addEventListener) {\r\n\r\n el.addEventListener(name, fn);\r\n\r\n } else if (el.attachEvent) {\r\n\r\n el.attachEvent('on' + name, function(evt) {\r\n\r\n evt.target = evt.target || evt.srcElement;\r\n // Call the event to ensure uniform 'this' handling, pass it event\r\n fn.call(el, evt);\r\n\r\n });\r\n\r\n } else if (typeof el['on' + name] === 'undefined' || el['on' + name] === null) {\r\n\r\n\r\n el['on' + name] = function(evt) {\r\n\r\n evt.target = evt.target || evt.srcElement;\r\n // Call the event to ensure uniform 'this' handling, pass it event\r\n fn.call(el, evt);\r\n\r\n };\r\n\r\n }\r\n\r\n }\r\n\r\n // Returns array of elements with given tag name\r\n function getTagsAsArr_(tagName) {\r\n\r\n return [].slice.call(document.getElementsByTagName(tagName));\r\n\r\n }\r\n\r\n function bindToNewVideos_(evt) {\r\n\r\n var el = evt.target || evt.srcElement;\r\n var isYT = checkIfYouTubeVideo(el);\r\n\r\n // We only bind to iframes with a YouTube URL with the enablejsapi=1 and \r\n // origin=<> parameters\r\n if (el.tagName === 'IFRAME' && isYT && jsApiEnabled(el.src) && originEnabled(el.src)) {\r\n\r\n addYouTubeEvents(el);\r\n\r\n }\r\n\r\n }\r\n\r\n})(document, window, {\r\n 'events': {\r\n 'Play': true,\r\n 'Pause': true,\r\n 'Watch to End': true\r\n },\r\n 'percentageTracking': {\r\n 'every': 25,\r\n 'each': [10, 90]\r\n }\r\n});\r\n/*\r\n * Configuration Details\r\n *\r\n * @property events object\r\n * Defines which events emitted by YouTube API\r\n * will be turned into Google Analytics or GTM events\r\n *\r\n * @property percentageTracking object\r\n * Object with configurations for percentage viewed events\r\n *\r\n * @property each array\r\n * Fires an event once each percentage ahs been reached\r\n *\r\n * @property every number\r\n * Fires an event for every n% viewed\r\n *\r\n * @property forceSyntax int 0, 1, or 2\r\n * Forces script to use Classic (2) or Universal(1)\r\n *\r\n * @property dataLayerName string\r\n * Tells script to use custom dataLayer name instead of default\r\n */\r\n/*\r\n * v8.1.4\r\n * Created by the Google Analytics consultants at http://www.lunametrics.com\r\n * Written by @SayfSharif and @notdanwilkerson\r\n * Documentation: https://github.com/lunametrics/youtube-google-analytics/\r\n * Licensed under the Creative Commons 4.0 Attribution Public License\r\n */"],"sourceRoot":""}