1/** 2 * uri-component-library 3 * 4 * --scripts-- 5 * 6 * @version v5.3.3 7 * @author Brandon Fuller <[email protected]> 8 * @author John Pennypacker <[email protected]> 9 * @license GPL-3.0 10 * @see https://www.uri.edu/wordpress 11 */ 12 13!function(){"use strict";function e(e,t){let o,s,n;const i=window.innerHeight,a=window.innerWidth,r=window.pageYOffset;for(o=0;o<t;o++)s=e[o],n=(s.offset+r)/i,s.proper.style.height=i<.75*a&&i<675||n>.3?Math.max(.9*i,500)+"px":98-100*n+"vh"}window.addEventListener("load",(function(){let t,o;const s=[],n=document.querySelectorAll(".cl-abstract"),i=n.length;for(t=0;t<i;t++)o=n[t].querySelector(".cl-abstract-proper"),s.push({proper:o,offset:o.getBoundingClientRect().top});window.dispatchEvent(new Event("scroll")),e(s,i),window.addEventListener("resize",e.bind(null,s,i),!1)}),!1)}();class CLA11y{static hasNoMotion(){let e=!1;return CLA11y.arePrefsSaved()&&CLA11y.isSystemMotionPaused()&&(e=!0),e}static hasNoContrast(){let e=!1;return CLA11y.arePrefsSaved()&&CLA11y.isSystemContrastImproved()&&(e=!0),e}static arePrefsSaved(){let e=!1;return"1"===URICL.getCookie("uri-cl-accessibility-saved")&&(e=!0),e}static isSystemMotionPaused(){let e=!1;return"1"===URICL.getCookie("uri-cl-accessibility-motion")&&(e=!0),e}static isSystemContrastImproved(){let e=!1;return"1"===URICL.getCookie("uri-cl-accessibility-contrast")&&(e=!0),e}}!function(){"use strict";let e;function t(t){t.querySelector(".cl-accessibility-system-setting").addEventListener("click",(function(o){o.preventDefault(),function(t){let o;const s=["motion","contrast"];if(CLA11y.arePrefsSaved()){URICL.setCookie(e.settings.saved.key,"0",365);for(const t of s)URICL.setCookie(e.settings[t].key,"0",365);t.classList.toggle(e.classes.motion,e.body.classList.contains(e.classes.motion)),t.classList.toggle(e.classes.contrast,e.body.classList.contains(e.classes.contrast))}else{URICL.setCookie(e.settings.saved.key,"1",365);for(const n of s)o=t.classList.contains(e.classes[n])?"1":"0",URICL.setCookie(e.settings[n].key,o,365),"1"===o?e.body.classList.add(e.classes[n]):e.body.classList.remove(e.classes[n])}e.body.classList.toggle(e.classes.system)}(t)}),!1);const o=t.querySelector(".cl-accessibility-motion-control");CLA11y.hasNoMotion()&&t.classList.toggle(e.classes.motion),o.addEventListener("click",(function(o){o.preventDefault(),function(t){let o="0",s=!1;t.classList.toggle(e.classes.motion),t.classList.contains(e.classes.motion)&&(s=!0);if(CLA11y.arePrefsSaved()){e.body.classList.toggle(e.classes.motion)&&(o="1");for(const t of e.els)t.classList.toggle(e.classes.motion,s);URICL.setCookie(e.settings.motion.key,o,365)}}(t)}),!1);const s=t.querySelector(".cl-accessibility-contrast-control");CLA11y.hasNoContrast()&&t.classList.toggle(e.classes.contrast),s.addEventListener("click",(function(o){o.preventDefault(),function(t){let o="0",s=!1;t.classList.toggle(e.classes.contrast),t.classList.contains(e.classes.contrast)&&(s=!0);if(CLA11y.arePrefsSaved()){e.body.classList.toggle(e.classes.contrast)&&(o="1");for(const t of e.els)t.classList.toggle(e.classes.contrast,s);URICL.setCookie(e.settings.contrast.key,o,365)}}(t)}),!1)}window.addEventListener("load",(function(){e={body:document.getElementsByTagName("BODY")[0],els:document.querySelectorAll(".cl-has-accessibility-controls"),settings:{saved:{key:"uri-cl-accessibility-saved"},motion:{key:"uri-cl-accessibility-motion"},contrast:{key:"uri-cl-accessibility-contrast"}},classes:{system:"cl-accessibility-applied-site-wide",motion:"cl-accessibility-motion-paused",contrast:"cl-accessibility-contrast-improved"}},CLA11y.arePrefsSaved()&&e.body.classList.add(e.classes.system);CLA11y.isSystemMotionPaused()&&e.body.classList.add(e.classes.motion);CLA11y.isSystemContrastImproved()&&e.body.classList.add(e.classes.contrast);let o;const s=e.els.length;for(o=0;o<s;o++)t(e.els[o])}),!1)}();class CLCardVimeo{static onReady(e){window.addEventListener("resize",(function(){CLVimeo.resizeRelative(e)})),CLVimeo.resizeRelative(e),window.addEventListener("scroll",(function(){e.parent.classList.contains("paused")||CLVimeo.determinePlayState(e)})),CLVimeo.determinePlayState(e);e.parent.querySelector(".cl-accessibility-motion-control .cl-accessibility-control-button").addEventListener("click",(function(){CLCardVimeo.control(e)}))}static control(e){switch(e.state){default:case"playing":e.player.pause(),e.parent.classList.add("paused");break;case"paused":e.player.play(),e.parent.classList.remove("paused")}}static onStateChange(e){if("playing"===e.state)e.poster.classList.add("unveil")}static onError(e){e.poster.classList.remove("unveil")}static theatreControl(e){const t=e.parent.parentNode.parentNode,o={el:t.querySelector(".theatre-control
13s")};o.close=o.el.querySelector(".close"),o.close.addEventListener("click",CLCardVimeo.closeTheatre.bind(null,e),!1),t.parentNode.addEventListener("click",(function(t){CLCardVimeo.isClickAccessibilityRelated(t)||"close"!==t.target.className&&e.player.play()}),!1)}static closeTheatre(e){e.player.pause()}static isClickAccessibilityRelated(e){let t=!1;return(e.target.classList.contains("cl-accessibility-control")||e.target.classList.contains("cl-accessibility-control-button"))&&(t=!0),t}}!function(){"use strict";function e(e){e.addEventListener("click",(function(t){t.preventDefault(),CLCardVimeo.isClickAccessibilityRelated(t)||function(e){e.classList.toggle("theatre-open")}(e)}))}window.addEventListener("load",(function(){const t=document.querySelectorAll(".cl-card-theatre");for(let o=0;o<t.length;o++)e(t[o])}),!1)}(),function(){"use strict";function e(e){e.classList.add("has-js");const s=e.querySelector(".cl-date-content-wrapper");s.addEventListener("click",t.bind(null,e),!1);e.querySelector(".cl-date-download-confirm").addEventListener("click",o.bind(null,e,s),!1);e.querySelector(".cl-date-download-cancel").addEventListener("click",t.bind(null,e),!1);const n=e.getAttribute("data-hash");"downloaded"===URICL.getCookie("uri-cl-"+n)&&(e.classList.add("downloaded"),s.setAttribute("title","You've downloaded this date before. Check your downloads folder for an ICS file."))}function t(e){const t="dialogue";e.classList.contains("downloaded")||(e.classList.contains(t)?e.classList.remove(t):e.classList.add(t))}function o(e,o){const s=e.getAttribute("data-hash");e.classList.contains("downloaded")||(e.querySelector("form").submit(),t(e),e.classList.add("downloaded"),o.setAttribute("title","Check your downloads folder for an ICS file."),URICL.setCookie("uri-cl-"+s,"downloaded",.5))}window.addEventListener("DOMContentLoaded",(function(){let t;const o=document.querySelectorAll(".cl-date");for(t=0;t<o.length;t++)e(o[t])}),!1)}(),function(){"use strict";function e(e){const o=e.querySelector(".dismiss");if(null===o)return;o.addEventListener("click",t.bind(null,e),!1);const s=e.getAttribute("data-hash");"dismissed"===URICL.getCookie("uri-cl-"+s)&&t(e)}function t(e){const t=e.getAttribute("data-hash");e.classList.add("dismissed"),URICL.setCookie("uri-cl-"+t,"dismissed",30)}window.addEventListener("DOMContentLoaded",(function(){let t;const o=document.querySelectorAll(".cl-countdown, .cl-notice");for(t=0;t<o.length;t++)e(o[t])}),!1)}();class URICL{static setCookie(e,t,o){const s=new Date;s.setTime(s.getTime()+24*o*60*60*1e3);const n="expires="+s.toUTCString();document.cookie=e+"="+t+";"+n+";path=/"}static getCookie(e){let t,o;const s=e+"=",n=document.cookie.split(";");for(t=0;t<n.length;t++){for(o=n[t];" "===o.charAt(0);)o=o.substring(1);if(0===o.indexOf(s))return o.substring(s.length,o.length)}return""}}let CLResizeSuperheroes,CLCreateYouTubePlayers,CLCreateVimeoPlayers;function onYouTubePlayerAPIReady(){CLCreateYouTubePlayers()}!function(){"use strict";window.addEventListener("load",(function(){(function(){let e,t,o,s;const n=document.getElementById("hero");n&&(e=n.querySelector(".overlay"),t=window.scrollY||window.pageYOffset,o=e.getBoundingClientRect().top+t,s=50,i(),window.addEventListener("scroll",(function(){i()})));function i(){const t=window.scrollY||window.pageYOffset,n=e.offsetHeight+o,i=Math.min(t/n*s,s);e.style.webkitBackdropFilter="blur("+i+"px)"}})(),function(){const e=window.innerWidth,t=document.querySelectorAll(".cl-hero .poster[data-platform=youtube]");let o;if(e<750)for(o=0;o<t.length;o++)t[o].classList.remove("unveil")}(),function(){let e;const t=[],o=document.querySelectorAll(".cl-hero.super .cl-hero-proper"),s=o.length;for(e=0;e<s;e++)t.push({el:o[e],offset:o[e].getBoundingClientRect().top});CLResizeSuperheroes=function(o){let n,i;const a=window.innerHeight,r=window.innerWidth,l=window.scrollY||window.pageYOffset;for(e=0;e<s;e++)n=t[e],!1!==o&&(n.offset=n.el.getBoundingClientRect().top),i=(n.offset+l)/a,n.el.style.height=a<.75*r&&a<675||i>.3?Math.max(.9*a,500)+"px":98-100*i+"vh"},window.dispatchEvent(new Event("scroll")),CLResizeSuperheroes(!1),window.addEventListener("resize",CLResizeSuperheroes.bind(null,!1),!1)}()}),!1)}(),function(){"use strict";const e="reveal";function t(t,o,s){t.addEventListener("click",(function(t){t.preventDefault(),function(t,o){let s;const n=o.classList.contains(e);for(s=0;s<t.length;s++)t[s].classList.remove(e);n||o.classList.add(e)}(o,s)}))}window.addEventListener("load",(function(){let e,o,s,n,i,a;const r=document.querySelectorAll(".cl-menu");for(s=0;s<r.length;
13s++)e=document.createElement("span"),e.className="cl-menu-toggle","0"===r[s].getAttribute("data-show-title")&&e.classList.add("hidden"),e.innerHTML=r[s].getAttribute("data-name"),e.addEventListener("click",(function(){this.classList.contains("active")?this.classList.remove("active"):this.classList.add("active")})),o=r[s].querySelector(".cl-menu-list"),o.classList.remove("cl-menu-list-no-js"),r[s].insertBefore(e,o),r[s].classList.add("cl-menu-js");const l=document.querySelectorAll(".cl-menu-list ul");for(s=0;s<l.length;s++)i=document.createElement("span"),i.className="cl-menu-arrow",l[s].parentNode.append(i),n=l[s].parentNode.querySelector("a"),a=document.createElement("li"),a.appendChild(n.cloneNode(!0)),l[s].insertBefore(a,l[s].firstChild),n.classList.add("cl-menu-trigger"),t(n,l,l[s])}),!1)}(),function(){"use strict";function e(e){let t,o;for(t=0;t<e.length;t++)if(o={},o.el=e[t],o.num=o.el.querySelector("span"),o.w=o.num.clientWidth,o.fs=window.getComputedStyle(o.num).getPropertyValue("font-size"),o.sw=o.num.scrollWidth,o.mfs=o.el.getAttribute("data-font-max"),o.nfs=o.fs.match(/\d+/)[0],o.sw>o.w)for(o.num.classList.add("autosized");o.sw>o.w;)o.nfs--,o.num.style.fontSize=o.nfs+"px",o.sw=o.num.scrollWidth;else if(o.num.classList.contains("autosized"))for(;o.sw===o.w&&o.nfs<o.mfs;)o.nfs++,o.num.style.fontSize=o.nfs+"px",o.sw=o.num.scrollWidth}window.addEventListener("load",(function(){let t;const o=document.querySelectorAll(".cl-metric");if(o.length>0){for(t=0;t<o.length;t++)o[t].setAttribute("data-font-max",window.getComputedStyle(o[t].querySelector("span")).getPropertyValue("font-size").match(/\d+/)[0]);e(o),window.addEventListener("resize",e.bind(null,o))}}),!1)}(),function(){"use strict";function e(e,t){const o=t.querySelector(".cl-overlay-block");o.classList.contains("hidden")?(o.classList.remove("hidden"),t.style.height="auto",e.title="Hide story"):(t.style.height=t.offsetHeight+"px",o.classList.add("hidden"),e.title="Show story")}window.addEventListener("load",(function(){let t,o;const s=document.querySelectorAll(".cl-overlay");for(t=0;t<s.length;t++)o=document.createElement("div"),o.className="cl-overlay-slider",o.innerHTML='<div class="cl-overlay-prompter"></div>',o.title="Hide story",o.addEventListener("click",e.bind(null,o,s[t]),!1),s[t].querySelector(".cl-overlay-block").appendChild(o)}),!1)}(),function(){"use strict";const e={heroes:{vimeo:{},yt:{}},videos:{vimeo:{},yt:{}},cards:{vimeo:{}},cardFeatures:{vimeo:{}}};function t(e,t,o,s){t.player=new Vimeo.Player(e,o),t.player.on("loaded",(function(){t.state="loaded",s.onReady(t)})),t.player.on("bufferstart",(function(){t.state="buffering",s.onStateChange(t)})),t.player.on("play",(function(){t.state="playing",s.onStateChange(t)})),t.player.on("pause",(function(){t.state="paused",s.onStateChange(t)})),t.player.on("ended",(function(){t.state="ended",s.onStateChange(t)})),t.player.on("error",s.onError.bind(null,t))}window.addEventListener("load",(function(){let t,o,s,n,i,a,r,l,c=!1,d=!1;const u=document.querySelectorAll(".cl-hero .poster"),y=document.querySelectorAll(".cl-video .poster"),f=document.querySelectorAll(".cl-card .cl-card-container.video .poster");for(t=0;t<u.length;t++)o=u[t],n=o.parentNode,i={parent:n,poster:o,state:"init",w:n.offsetWidth,h:n.offsetHeight},a=o.getAttribute("data-video"),r=o.getAttribute("data-platform"),s=o.getAttribute("id"),"youtube"===r&&(c=!0,e.heroes.yt[s]=i,e.heroes.yt[s].src=a),"vimeo"===r&&(d=!0,e.heroes.vimeo[s]=i,e.heroes.vimeo[s].src=a),o.removeAttribute("id"),l=document.createElement("div"),l.id=s,n.appendChild(l);for(t=0;t<y.length;t++)o=y[t],i={parent:o.parentNode,poster:o,state:"init"},a=o.getAttribute("data-video"),r=o.getAttribute("data-platform"),s=o.getAttribute("id"),"youtube"===r&&(e.videos.yt[s]=i,e.videos.yt[s].src=a,c=!0),"vimeo"===r&&(e.videos.vimeo[s]=i,e.videos.vimeo[s].src=a,e.videos.vimeo[s].showinfo=o.getAttribute("data-showinfo"),d=!0);for(t=0;t<f.length;t++)o=f[t],n=o.parentNode,i={parent:n,poster:o,state:"init"},a=o.getAttribute("data-video"),r=o.getAttribute("data-platform"),s=o.getAttribute("id"),d=!0,e.cards.vimeo[s]=i,e.cards.vimeo[s].src=a,o.removeAttribute("id"),l=document.createElement("div"),l.id=s,n.appendChild(l);c&&CLYT.loadYouTubeAPI();d&&CLVimeo.loadVimeoAPI()}),!1),CLCreateVimeoPlayers=function(){let o,s,n,i,a;for(o in e.heroes.vimeo)s=e.heroes.vimeo[o],n={url:s.src,background:!0,autoplay:!0,width:s.w,height:s.h},a={onReady:CLHeroVimeo.onReady,onStateChange:CLHeroVimeo.onStateChange,onError:CLHeroVimeo.onError},t(o,s,n,a);for(o in e.videos.vimeo)s=e.videos.vimeo[o],i="1"===s.showinfo,n={url:s.src,byline:i,title:i,portrait:i},a={onReady:CLVideoVimeo.onReady,onStateChange:CLVideoVimeo.onStateChange,onError:CLVideoVimeo.onError},t(o,s,n,a);for(o in e.cards.vimeo)s=e.cards.vimeo[o],n={url:s.src,background:!0,autoplay:!0},a={onReady:CLCardVimeo.onReady,onStateChange:CLCardVimeo.onStateChange,onError:CLCardVimeo.onError},t(o,s,n,a)},CLCreateYouTubePlayers=function(){let t,o;for(t in e.heroes.yt)o=e.heroes.yt[t],o.player=new YT.Player(t,{width:o.w,height:o.h,videoId:o.src,playerVars:{autoplay:1,controls:0,showinfo:0,modestbranding:1,iv_load_policy:3,rel:0},events:{onReady:CLYT.onHeroReady,onStateChange:CLYT.onHeroStateChange,onError:CLYT.onHeroError}});for(t in e.videos.yt)o=e.videos.yt[t],o.player=new YT.Player(t,{videoId:o.src,playerVars:{autoplay:0,controls:1,showinfo:0,color:"white",modestbranding:1,iv_load_policy:3,rel:0},events:{onReady:CLYT.onVideoReady,onStateChange:CLYT.onVideoStateChange,onError:CLYT.onVideoError}})}}(),function(){"use strict";function e(e,n){let i,a,r,l,c,d;e.classList.add("cl-tabs-js");const u=e.querySelectorAll(".cl-tab"),y=document.createElement("ul");for(y.setAttribute("role","tablist"),d=0,c=0;c<u.length;c++)d++,i=u[c].querySelector("h1"),i?i=i.innerHTML:(i=u[c].querySelector("h2"),i=i?i.innerHTML:"Section "+d),a=u[c].id,""===a&&(a="cl-tabs-"+n+"-tab-section-"+d,u[c].id=a),r
13=document.createElement("li"),r.setAttribute("role","presentation"),l=document.createElement("a"),l.href="#"+a,l.id="cl-tabs-"+n+"-tab-"+d,l.setAttribute("role","tab"),l.setAttribute("tabindex","-1"),l.innerHTML=i,r.appendChild(l),y.appendChild(r);e.insertBefore(y,u[0]);const f=y.querySelectorAll("a");for(c=0;c<f.length;c++)f[c].addEventListener("click",(function(e){t(e,f,y,u)})),f[c].addEventListener("keydown",(function(e){o(e,f,u)}));for(c=0;c<u.length;c++)u[c].setAttribute("role","tabpanel"),u[c].setAttribute("tabindex","-1"),u[c].setAttribute("aria-labelledby",f[c].id),u[c].hidden=!0;f[0].removeAttribute("tabindex"),f[0].setAttribute("aria-selected","true"),u[0].hidden=!1;const m=function(e){let t,o;const s=document.URL.split("#");o=null,s.length>1&&(t=e.querySelector("#"+s[1]),null!==t&&(o=document.getElementById(t.getAttribute("aria-labelledby"))));return o}(e);null!==m&&s(f,u,y.querySelector("[aria-selected]"),m)}function t(e,t,o,n){e.preventDefault();const i=o.querySelector("[aria-selected]");e.currentTarget!==i&&s(t,n,i,e.currentTarget)}function o(e,t,o){let n;const i=Array.prototype.indexOf.call(t,e.currentTarget);n=37===e.which?i-1:39===e.which?i+1:40===e.which?"down":null,null!==n&&(e.preventDefault(),"down"===n?o[i].focus():t[n]&&s(t,o,e.currentTarget,t[n]))}function s(e,t,o,s){s.focus(),s.removeAttribute("tabindex"),s.setAttribute("aria-selected","true"),o.removeAttribute("aria-selected"),o.setAttribute("tabindex","-1");const n=Array.prototype.indexOf.call(e,s);t[Array.prototype.indexOf.call(e,o)].hidden=!0,t[n].hidden=!1}window.addEventListener("load",(function(){let t;const o=document.querySelectorAll(".cl-tabs");for(t=0;t<o.length;t++)e(o[t],t+1)}),!1)}();class CLVimeo{static loadVimeoAPI(){const e=document.createElement("script");e.src="https://player.vimeo.com/api/player.js";const t=document.getElementsByTagName("script")[0];t.parentNode.insertBefore(e,t),e.addEventListener("load",CLCreateVimeoPlayers,!1)}static determinePlayState(e){if(CLA11y.hasNoMotion())return e.player.pause(),!1;if(e.parent.parentNode.classList.contains("cl-accessibility-motion-paused"))return!1;const t=window.innerHeight,o=window.scrollY||window.pageYOffset,s=e.parent.offsetHeight,n=e.parent.getBoundingClientRect().top+o;t+o<n||o>n+s?e.player.pause():e.player.play()}static resizeRelative(e){let t=e.parent.offsetWidth;const o=e.parent.querySelector("iframe"),s=e.parent.offsetHeight;t/s>16/9?(o.style.height=9*t/16+"px",o.style.width="100%",o.style.left=0,o.style.top=(s-9*t/16)/2+"px",o.style.marginLeft=0):(t=16*s/9,o.style.height="100%",o.style.width=t+"px",o.style.left=0-t/2+"px",o.style.top=0,o.style.marginLeft="50%")}static resizeProportionate(e){e.player.element.setAttribute("height",e.parent.offsetWidth/e.ratio)}}class CLHeroVimeo{static onReady(e){window.addEventListener("resize",(function(){CLVimeo.resizeRelative(e)})),CLVimeo.resizeRelative(e),window.addEventListener("scroll",CLVimeo.determinePlayState.bind(null,e),!1),CLVimeo.determinePlayState(e);e.parent.querySelector(".cl-accessibility-motion-control").addEventListener("click",(function(){CLHeroVimeo.control(e)}))}static control(e){switch(e.state){default:case"playing":e.player.pause();break;case"loaded":case"paused":e.player.play()}}static onStateChange(e){if("playing"===e.state)e.poster.classList.add("unveil")}static onError(e){e.poster.classList.remove("unveil")}}class CLVideoVimeo{static onReady(e){e.poster.querySelector("img").style.display="none",e.ratio=e.player.element.width/e.player.element.height,window.addEventListener("resize",(function(){CLVimeo.resizeProportionate(e)})),CLVimeo.resizeProportionate(e),e.parent.classList.contains("cl-card-feature-video")&&CLCardVimeo.theatreControl(e)}static onError(e){let t;const o=document.createElement("a");o.href=e.src,o.title="Try watching this video on Vimeo";const s=document.createElement("img");s.src=e.poster.getAttribute("src"),t=e.poster.getAttribute("alt"),t||(t="Poster for video"),s.alt=t,o.appendChild(s),e.parent.replaceChild(o,e.player.element)}static onStateChange(e){const t=e.parent.querySelector(".overlay");switch(e.state){case"playing":case"buffering":t.classList.add("hidden");break;default:t.classList.remove("hidden")}}}!function(){"use strict";window.addEventListener("load",(function(){const e=document.querySelectorAll(".cl-wave"),t=window.scrollY||window.pageYOffset;window.addEventListener("scroll",(function(){!function(e,t){let o,s;const n=(window.scrollY||window.pageYOffset)-t;for(o=0;o<e.length;o++)s=e[o],s.firstElementChild.style.backgroundPositionX=n+"px",s.lastElementChild.style.backgroundPositionX=n+"px"}(e,t)}))}),!1)}();class CLYT{static loadYouTubeAPI(){const e=document.createElement("script");e.src="https://www.youtube.com/player_api";const t=document.getElementsByTagName("script")[0];t.parentNode.insertBefore(e,t)}static resizeHero(e,t){let o=t.offsetWidth;const s=t.offsetHeight;o/s>16/9?(e.style.height=9*o/16+"px",e.style.width="100%",e.style.left=0,e.style.top=(s-9*o/16)/2+"px",e.style.marginLeft=0):(o=16*s/9,e.style.height="100%",e.style.width=o+"px",e.style.left=0-o/2+"px",e.style.top=0,e.style.marginLeft="50%")}static resizeVideo(e,t){e.style.height=t.offsetWidth/(e.width/e.height)+"px"}static determinePlayState(e,t){if(CLA11y.hasNoMotion())return e.target.pauseVideo(),!1;if(t.parentNode.classList.contains("cl-accessibility-motion-paused"))return!1;const o=window.innerHeight,s=window.scrollY||window.pageYOffSet,n=t.offsetHeight,i=t.getBoundingClientRect().top+s;o+s<i||s>i+n?e.target.pauseVideo():e.target.playVideo()}static onHeroReady(e){e.target.mute();const t=e.target.getIframe(),o=t.parentNode;window.addEventListener("resize",(function(){CLYT.resizeHero(t,o)})),CLYT.resizeHero(t,o),window.addEventListener("scroll",CLYT.determinePlayState.bind(null,e,o),!1),CLYT.determinePlayState(e,o);o.querySelector(".cl-accessibility-motion-control").addEventListener("click",(function(){CLYT.heroControl(e,o)}))}static onVideoReady(e){const t=e.target.getIframe(),o=t.parentNode;window.addEventListener("resize",(function(){CLYT.resizeVideo(t,o)})),CLYT.resizeVideo(t,o)}static heroControl(e,t){switch(e.target.getPlayerState()){default:case 1:e.target.pauseVideo(),t.classList.add("paused");break;case 2:e.target.playVideo(),t.classList.remove("paused")}}static onHeroStateChange(e){const t=e.target.getPlayerState(),o=e.target.getIframe();switch(t){case 0:e.target.playVideo();break;case-1:case 1:window.innerWidth>750&&o.previousSibling.previousSibling.classList.add("unveil")}}static onHeroError(e){e.target.getIframe().previousSibling.classList.remove("unveil")}static onVideoError(e){let t;const o=e.target.getIframe(),s=o.previousSibling,n=document.createElement("a");n.href="http://www.youtube.com/watch?v="+o.id,n.title="Try watching this video on YouTube";const i=document.createElement("img");i.src=s.getAttribute("src"),t=s.getAttribute("alt"),t||(t="Poster for video"),i.alt=t,n.appendChild(i);const a=document.getElementById(o.id);a&&o.parentNode.replaceChild(n,a)}static onVideoStateChange(e){const t=e.target.getPlayerState(),o=e.target.getIframe().parentNode.querySelector(".overlay");switch(t){case 1:case 3:null!==o&&o.classList.add("hidden");break;default:null!==o&&o.classList.remove("hidden")}}}
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.