1'use strict';class CommonActionsUtilsClass{scrollToElement(a){if(a){var b=STICKYMANAGER.top()||0,c=a.getBoundingClientRect().top+window.scrollY-b;window.scrollTo({top:c,behavior:"smooth"});this._adjustScroll(c,b,a)}}_adjustScroll(a,b,c){let d=0;const e=()=>{var f=STICKYMANAGER.top()||0;const h=window.scrollY;.5<Math.abs(f-b)&&(0!==c.getBoundingClientRect().top&&(a=c.getBoundingClientRect().top+window.scrollY-f),window.scrollTo({top:a,behavior:"smooth"}),b=f);f=Math.abs(h-a);d++;1<f&&100>d&&requestAnimationFrame(e)}; 2requestAnimationFrame(e)}}function CommonAemUtilsClass(){} 3CommonAemUtilsClass.prototype={CSS_CLASS:{author:"isAuthor",authorEdit:"isAuthorEdit",activeDS:"active-ds",dsCmp:"ds-cmp"},isAuthor:function(){return document.body.classList.contains(this.CSS_CLASS.author)},isAuthorEdit:function(){return document.body.classList.contains(this.CSS_CLASS.authorEdit)},isActiveDS:function(){return document.body.classList.contains(this.CSS_CLASS.activeDS)},getGraniteToken:async function(){let a;if(this.isAuthor())try{a=(await (await fetch("/libs/granite/csrf/token.json")).json()).token}catch(b){console.warn("Something went wrong.", 4b)}else a=Promise.resolve();return a}};function CommonAnimationUtilsClass(){this.DELAYS={LOADING_TRANSITION:800}}CommonAnimationUtilsClass.prototype={getLoadingTransitionDelay:function(){return this.DELAYS.LOADING_TRANSITION}};let isDOMContentLoaded=!1;document.addEventListener("DOMContentLoaded",()=>{isDOMContentLoaded=!0});function CommonDomUtilsClass(){} 5CommonDomUtilsClass.prototype={CSS_CLASS:{show:"mod__show",hidden:"mod__hidden",fixed:"mod__fixed",sticky:"mod__sticky",active:"mod__active",disabled:"mod__disabled",noOpacity:"mod__no-opacity",animated:"mod__animated",loading:"mod__loading",loaded:"mod__loaded",skeleton:"mod__skeleton",error:"mod__error",scrollLocked:"mod__scroll-locked",title:{container:"cmp-title",text:"cmp-title__text",link:"cmp-title__link"},text:{container:"cmp-text"},button:{container:"cmp-button",text:"cmp-button__text",js:"button-JS"}, 6image:{container:"cmp-image",img:"cmp-image__image",ai:"cmp-image--ia"},link:{container:"cmp-link"},modal:{visible:"modal-visible"}},domReady:function(a){try{isDOMContentLoaded?a(document):document.addEventListener("DOMContentLoaded",()=>{a(document)}),document.addEventListener("ds-dialog:open",b=>{(b=b.target.closest("ds-dialog"))&&a(b)})}catch(b){console.error(b)}},initComponent:function(a,b){CommonUtils.dom.domReady(c=>{c.querySelectorAll(a).forEach(d=>{b(d)})})},subscribeReady:function(a){this.domReady(a); 7document.addEventListener("render-load-components",b=>{b&&b.detail&&a(b.detail)})},removeNodesByClassName:function(a){a=document.querySelectorAll(`.${a}`);Array.prototype.forEach.call(a,b=>{b.remove()})},createElementInDOM:function(a,b=[],c="div"){c=document.createElement(c);"string"===typeof b&&""!==b.trim()?c.classList.add(...b.split(" ")):Array.isArray(b)&&0<b.length&&c.classList.add(...b);a.appendChild(c);return c}};function CommonDSUtilsClass(){} 8CommonDSUtilsClass.prototype={PROPERTIES:{transitions:"--ui-kit-picker-item-transition"},disableTransitions:function(){document.body.style.setProperty(this.PROPERTIES.transitions,"none")},enableTransitions:function(){setTimeout(()=>{document.body.style.removeProperty(this.PROPERTIES.transitions)},100)}}; 9class CommonEventUtilsClass{static get EVENTS_CONSTANTS(){return{FOOTER_VISIBILITY_CHANGE:"footer:visibility-change"}}constructor(){this.instance||(this.userInteractionCallbacks=[],this.userHasInteracted=!1,this.onUserInteraction=this.onUserInteraction.bind(this),this.instance=this,this.idleCallbacks=[],this.idleScheduled=!1);return this.instance}onUserInteraction(){this.userHasInteracted=!0;this.userInteractionCallbacks.forEach(a=>a());this.userInteractionCallbacks.length=0}
9runOnUserInteraction(a){if("function"=== 10typeof a)if(this.userHasInteracted)a();else if(this.userInteractionCallbacks.push(a),1===this.userInteractionCallbacks.length){const b={once:!0};setTimeout(()=>{document.addEventListener("mousemove",this.onUserInteraction,b);document.addEventListener("keydown",this.onUserInteraction,b);document.addEventListener("click",this.onUserInteraction,b);document.addEventListener("scroll",this.onUserInteraction,b);document.addEventListener("touchstart",this.onUserInteraction,b)},1E3)}}runOnScrollPercent(a, 11b){if("function"===typeof a&&"number"===typeof b){var c=document.documentElement.scrollHeight-window.innerHeight,d=b/100;if((0<c?window.scrollY/c:1)>=d)a();else{var e=()=>{(0<c?window.scrollY/c:1)>=d&&(window.removeEventListener("scroll",e),a())};window.addEventListener("scroll",e,{passive:!0})}}}onIdle(){!this.idleScheduled&&this.idleCallbacks.length&&(this.idleScheduled=!0,"requestIdleCallback"in window?requestIdleCallback(a=>this._processIdle(a),{timeout:2E3}):setTimeout(()=>this._processIdle(), 1250))}_processIdle(a){for(;this.idleCallbacks.length&&!(a&&1>=a.timeRemaining());){const {callback:b,...c}=this.idleCallbacks.shift();try{b(c)}catch(d){CommonUtils.logger.error("[IdleQueue]",d)}}this.idleScheduled=!1;if(this.idleCallbacks.length)this.onIdle()}runOnIdle(a,...b){if("function"!==typeof a)throw new TypeError("IdleQueue only accepts functions");this.idleCallbacks.push({callback:a,args:b});this.onIdle()}}function CommonOthersUtilsClass(){} 13CommonOthersUtilsClass.prototype={sendSeatAnalytics:function(a,b){try{const c={};for(const d in b)c[`${b[d][0]}`]=`${b[d][1]}`;"undefined"!==typeof window.SEAT_ANALYTICS&&window.SEAT_ANALYTICS.trackDynamicDataLayer&&window.SEAT_ANALYTICS.trackDynamicDataLayer(a,c)}catch(c){console.error("Error sending analytics information, undefined track objects"),console.error(c)}},getStyle:(a,b)=>{let c;a.currentStyle?c=a.currentStyle[b]:window.getComputedStyle&&(c=document.defaultView.getComputedStyle(a,null).getPropertyValue(b)); 14return c},setElementMinHeight:({elementsArray:a,parent:b,variable:c})=>{a=a.map(e=>e.offsetHeight);const d=Math.max.apply(this,a);(a=Math.min.apply(this,a)!==d&&d)&&b.style.setProperty(c,`${a}px`)},_getMeta:(a,b)=>(a=document.querySelector(`meta[${a}='${b}']`))?a.getAttribute("content")||"":"",getMetaContent:function(a){return this._getMeta("name",a)},getMetaPropertyContent:function(a){return this._getMeta("property",a)},registerService:function(a,b){window.CommonServices=window.CommonServices||{}; 15window.CommonServices[a]=b},debounce:function(a,b=100){let c;return function(...d){const e=this;clearTimeout(c);c=setTimeout(()=>a.apply(e,d),b)}}};function CommonStringUtilsClass(){} 16CommonStringUtilsClass.prototype={capitalize:function(a){if(!a)return a;a=a.match(/[A-Z\xC0-\xD6\xD8-\xDE]?[a-z\xDF-\xF6\xF8-\xFF]+|[A-Z\xC0-\xD6\xD8-\xDE]+(?![a-z\xDF-\xF6\xF8-\xFF])|\d+/g);if(!a)return"";let b="";for(let c=0,d=a.length;c<d;c++){let e=a[c].toLowerCase();0!==c&&(e=e.substr(0,1).toUpperCase()+e.substr(1));b+=e}return b},removeLastComma:function(a){if(!a)return a;","===a.charAt(a.length-1)&&(a=a.slice(0,-1));return a},sanitize:function(a){return"string"!==typeof a?a:a.replace(/[\x00-\x1F\x7F]/g, 17"").trim()},stripHtml:function(a){return"string"!==typeof a?a:a.replace(/<[^>]*>/g,"").trim()}};function CommonUrlUtilsClass(){} 18CommonUrlUtilsClass.prototype={getUrlParameter:function(a){const b=window.location.search.substring(1).split("\x26");let c,d;for(d=0;d<b.length;d++)if(c=b[d].split("\x3d"),c[0]===a)return void 0===c[1]?"true":decodeURIComponent(c[1]);return""},getUrlWithoutParams:function(a){if(!a)return a;a=a.split("?")[0];const b=a.indexOf("#");-1!==b&&(a=a.substring(0,b));a.endsWith(".html")&&(a=a.slice(0,-5));return a},removeURLParameters:function(a){if(a)for(let b=0;b<a.length;b++)this.removeURLParameter(a[b])}, 19removeURLParameter:function(a){try{if(a&&a.length){const b=location.pathname,c=location.search.split("?");if(2<=c.length){let d="";const e=encodeURIComponent(a)+"\x3d",f=c[1].split(/[&;]/g);let h=f.length-1;for(;0<=h;)-1!==f[h].lastIndexOf(e,0)?f.splice(h,1):(0<d.length&&(d+="\x26"),d+=f[h]),h--;0!==d.length&&(d="?"+d);window.history.replaceState({}
19,document.title,b+d)}}}catch(b){console.error(b)}},addingSelector:function(a,b){return a&&b?a=-1<a.indexOf(".html")?a.replace(".html","."+b+".html"):-1< 20a.indexOf(".json")?a.replace(".json","."+b+".json"):-1<a.indexOf("?")?a.replace("?","."+b+"?"):a+("."+b):a},getSelectors:function(a,b,c){a||(a=window.location.href);a=this.getUrlWithoutParams(a).split("/").slice(-1)[0].split(".");return void 0!==b&&void 0!==c?a.slice(b-1,c).filter(Boolean):void 0!==b?a.slice(b-1).filter(Boolean):a.filter(Boolean)},separatorParams:function(a){return a?-1<a.indexOf("?")?"\x26":"?":a},addParams:function(a,b){if(!a||!b)return a;for(const c in b)a+=this.separatorParams(a)+ 21c+"\x3d"+b[c];return a},clean:function(a){if(!a)return"/";a=a.split("?")[0].replace(/\.html$/,"");try{return(new URL(a,window.location.origin)).pathname}catch{return a}}};function CommonViewportsUtilsClass(){} 22CommonViewportsUtilsClass.prototype={MOBILE:{android:{label:"android"},ios:{label:"ios"}},VIEWPORT_CHANGE_EVENT:"viewportchange",matchDevice:function(a){return!!navigator.userAgent.match(a)},isAndroid:function(){let a;this.matchDevice(/Android/i)&&(a=this.MOBILE.android);return a},isiOS:function(){let a;this.matchDevice(/iPhone|iPad|iPod/i)&&(a=this.MOBILE.ios);return a},isSafari:function(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)},isMobile:function(){return this.isAndroid()|| 23this.isiOS()||(this.isTouchScreen()&&1016>window.screen.width?{label:"touchscreen"}:null)},isTouchScreen:function(){return"ontouchstart"in window||0<navigator.maxTouchPoints||0<navigator.msMaxTouchPoints},isS:function(){return window.matchMedia(`(min-width: ${this.VIEWPORTS.S.min}px) and (max-width: ${this.VIEWPORTS.S.max}px)`).matches&&this.VIEWPORTS.S},isM:function(){return window.matchMedia(`(min-width: ${this.VIEWPORTS.M.min}px) and (max-width: ${this.VIEWPORTS.M.max}px)`).matches&&this.VIEWPORTS.M}, 24isL:function(){return window.matchMedia(`(min-width: ${this.VIEWPORTS.L.min}px) and (max-width: ${this.VIEWPORTS.L.max}px)`).matches&&this.VIEWPORTS.L},isXL:function(){return window.matchMedia(`(min-width: ${this.VIEWPORTS.XL.min}px) and (max-width: ${this.VIEWPORTS.XL.max}px)`).matches&&this.VIEWPORTS.XL},_setupViewportChangeEmitter:function(){if(!this._viewportEmitterSetup){this._viewportEmitterSetup=!0;try{this._lastViewportLabel=CommonUtils.viewports.getViewport().label}catch(b){this._lastViewportLabel= 25void 0}var a=()=>{try{var b=CommonUtils.viewports.getViewport().label}catch(c){b=void 0}b!==this._lastViewportLabel&&(this._lastViewportLabel=b,b=new CustomEvent(this.VIEWPORT_CHANGE_EVENT),document.dispatchEvent(b))};window.addEventListener("resize",()=>{clearTimeout(this._vpResizeTimer);this._vpResizeTimer=setTimeout(a,150)})}},onViewportChange:function(a){if("function"!==typeof a)return function(){};this._setupViewportChangeEmitter();const b=()=>{try{a()}catch(c){}};document.addEventListener(this.VIEWPORT_CHANGE_EVENT, 26b);return()=>{document.removeEventListener(this.VIEWPORT_CHANGE_EVENT,b)}}}; 27document.body.classList.contains("ds-bg")?(CommonViewportsUtilsClass.prototype.VIEWPORTS={XS:{label:"XS",min:0,max:479},S:{label:"S",min:480,max:767},M:{label:"M",min:768,max:1023},L:{label:"L",min:1024,max:1439},XL:{label:"XL",min:1440,max:1919},XXL:{label:"XXL",min:1920,max:99999999}},CommonViewportsUtilsClass.prototype.isXS=function(){return window.matchMedia(`(min-width: ${this.VIEWPORTS.XS.min}px) and (max-width: ${this.VIEWPORTS.XS.max}px)`).matches&&this.VIEWPORTS.XS},CommonViewportsUtilsClass.prototype.isXXL= 28function(){return window.matchMedia(`(min-width: ${this.VIEWPORTS.XXL.min}px) and (max-width: ${this.VIEWPORTS.XXL.max}px)`).matches&&this.VIEWPORTS.XXL},CommonViewportsUtilsClass.prototype.getViewport=function(){return this.isXS()||this.isS()||this.isM()||this.isL()||this.isXL()||this.isXXL()}):(CommonViewportsUtilsClass.prototype.VIEWPORTS={S:{label:"S",min:0,max:763},M:{label:"M",min:764,max:1015},L:{label:"L",min:1016,max:1435},XL:{label:"XL",min:1436,max:99999999}},CommonViewportsUtilsClass.prototype.isXS= 29function(){return CommonUtils.viewports.isS()},CommonViewportsUtilsClass.prototype.isXXL=function(){return CommonUtils.viewports.isXL()},CommonViewportsUtilsClass.prototype.getViewport=function(){return this.isS()||this.isM()||this.isL()||this.isXL()});function CommonAnalyticsUtilsClass(){} 30CommonAnalyticsUtilsClass.prototype={ANALYTICS:{channel:"channel",channelAnalytics:"channelAnalytics",privateArea:"Private Area",pageView:"pageView",pageName:"pageName",virtualPageName:"virtualPageName",eventName:"eventName",callName:"callName",seatID:"seatID",currency:"currency",generic:"generic",moduleComponent:"moduleComponent",moduleSubcomponent:"moduleSubcomponent",ctaLabel:"CTALabel",ctaType:"CTAType",linkUrl:"linkURL",interaction:"interaction",interactionElements:"interactionElements",errorType:"errorType", 31errorDescription:"errorDescription",registered:"registered",logged:"logged",notLogged:"Not Logged",login:"login",loginStatus:"loginStatus",form:"form",elementName:"elementName",dealerId:"dealerId",dealerCode:"dealerCode",dealerName:"dealerName",dealerCity:"dealerCity",dealerAddress:"dealerAddress",car:"car",carName:"carName",carCode:"carCode",carType:"carType",name:"name",code:"code",carWheels:"carWheels",exterior
31Colour:"exteriorColour",engine:"engine",fullPayment:"fullPayment",paymentFrequencyAmount:"paymentFrequencyAmount", 32PopUp:{view:"popUpView",type:"popUpType",description:"popUpDescription",action:"popUpAction",title:"popUpTitle",close:"popUpClose"},manuals:"Manuals",Application:{type:"applicationType",name:"applicationName",step:"applicationStep",origin:"applicationOrigin"},EventNames:{addTabClicked:"addTabClicked",clickCTA:"clickCTA",clickCard:"clickCard",clickModal:"clickModal",clickAnchor:"clickAnchor",clickArrow:"clickArrow",interaction:"interaction",clickLink:"clickLink"},Modal:{cancel:"Cancel",accept:"Accept", 33close:"Close",confirm:"Confirm"},CtaTypes:{primary:"primary",secondary:"secondary",arrow:"arrow",link:"link",image:"image",card:"card",navLink:"nav-link",quaternary:"quaternary",tertiary:"tertiary",anchor:"anchor",naked:"naked"}},BASE_PAGE_CONSTANTS:{},getCarData:()=>{var a=document.querySelector(".container-body");if(!a)return{};const b=(a?.dataset.carName||"").trim();a=(a?.dataset.carCode||"").trim();return{...(b?{carName:b}:{}),...(a?{carCode:a}:{})}},addAnalytics:a=>{if(a){var b={};"undefined"!== 34typeof SeatId&&(b[CommonUtils.analytics.ANALYTICS.seatID]=SeatId.getParam(SeatId.PARAMS().USER_ID));a.eventName&&(b[CommonUtils.analytics.ANALYTICS.eventName]=a.eventName);a.data&&(b=Object.assign(b,a.data));var c=[];for(const d in b)b[d]&&c.push([d,b[d]]);CommonUtils.others.sendSeatAnalytics(a.name||currentWebsite,c)}},callAnalytics:a=>{if(a?.callName){var b=a.callName;delete a.callName;a={...CommonUtils.analytics.BASE_PAGE_CONSTANTS,...a};CommonUtils.analytics.setVirtualPageName(a);if("undefined"!== 35typeof dynamic_dataLayer)try{dynamic_dataLayer.call(b,a)}catch(c){console.warn("Something went wrong.",c)}}},setVirtualPageName:a=>{if(!a.virtualPageName){const b=CommonUtils.analytics.getVirtualPageName();b&&(a[CommonUtils.analytics.ANALYTICS.virtualPageName]=b.trim().replace(/^\/+|\/+$/g,""))}},getChannelAnalytics:()=>CommonUtils.others.getMetaContent(CommonUtils.analytics.ANALYTICS.channelAnalytics)||"",getVirtualPageName:a=>CommonUtils.others.getMetaContent(CommonUtils.analytics.ANALYTICS.virtualPageName)|| 36(a?"":CommonUtils.others.getMetaContent("originPath")),sendDynamicDataLayer:(a,b)=>{if("undefined"!=typeof dynamic_dataLayer&&a&&b){CommonUtils.analytics.setVirtualPageName(b,b);try{dynamic_dataLayer.call(a,b)}catch(c){console.warn("Something went wrong.",c)}}},setDefaultValues:a=>{a.channel&&(CommonUtils.analytics.BASE_PAGE_CONSTANTS.channel=a.channel);a.virtualPageName&&(CommonUtils.analytics.BASE_PAGE_CONSTANTS.virtualPageName=a.virtualPageName)},sendDefaultValuesDataLayer:a=>{if(!window._isSendedDefaultValues){var b= 37()=>{if("undefined"===typeof dynamic_dataLayer||window._isSendedDefaultValues)setTimeout(b,10);else{try{dynamic_dataLayer.call("setDefaultValues",a)}catch(c){console.warn("Something went wrong.",c)}window._isSendedDefaultValues=!0}};b();CommonUtils.analytics.setDefaultValues(a)}}};function CommonLoggerUtilsClass(){this.level={debug:"debug",log:"log",info:"info",warn:"warn",error:"error"};this.LEVELS={debug:0,log:1,info:2,warn:3,error:4};this.DEFAULT_MIN_LEVEL=4;this.URL_PARAM_NAME="js-logger"} 38CommonLoggerUtilsClass.prototype={_getMinLevel:function(){return CommonUtils.aem.isAuthor()||"localhost"===window.location.hostname||"true"===CommonUtils.url.getUrlParameter(this.URL_PARAM_NAME)?0:this.DEFAULT_MIN_LEVEL},_shouldLog:function(a){return this.LEVELS[a]>=this._getMinLevel()},_normalizeData:function(a,b){b={locale:CommonUtils.others.getMetaContent("lenguajeIso"),country:CommonUtils.others.getMetaContent("workflow"),page:CommonUtils.others.getMetaPropertyContent("og:url"),isError:this.level.error=== 39b,errorType:"",source:"",className:"",code:"",field:"",group:"",description:""};"string"===typeof a?b.description=a:"object"===typeof a&&null!==a&&(b=Object.assign(b,a));return b},_log:function(a,b){this._shouldLog(a)&&(b=this._normalizeData(b,a),console[a](b))},log:function(a){this._log(this.level.log,a)},info:function(a){this._log(this.level.info,a)},warn:function(a){this._log(this.level.warn,a)},error:function(a,b){if(b instanceof Error){const c="object"===typeof a&&null!==a?Object.assign({},a): 40{description:a};c.className=b.name;c.stack=b.stack;c.message=b.message;"string"===typeof a&&a?c.description=a:c.description||(c.description=b.message);this._log(this.level.error,c)}else this._log(this.level.error,a)}};
41class VideoFactoryV2{constructor(){this.CSS_CLASS={component:"cmp-video-v2"};this.videoCreators={vimeo:(...a)=>new VideoVimeoV2(...a),youtube:(...a)=>new VideoYoutubeV2(...a),dam:(...a)=>new VideoDamV2(...a)}}createVideo(a,b,c){var d=this.getInstance(b);if(d)return d;d=this.videoCreators[a];if(!d)throw Error(`Video type ${a} is not supported`);a=d(b,c);this.setInstance(b,a);return a}createVideoWithContainer(a,b,c,d){let e=CommonUtils.video.classes.component;d&&(e+=" "+d.join(" "));b=CommonUtils.dom.createElementInDOM(b, 42e);return this.createVideo(a,b,c)}get classes(){return this.CSS_CLASS}getInstance(a){return a?._videoInstance}setInstance(a,b){a._videoInstance=b}} 43class VideoV2{constructor(a,b){this.CSS_CLASSES=Object.freeze({IMAGE:"cmp-image",PLAY_BUTTON:CommonUtils.video.classes.component+"__play",IFRAME:CommonUtils.video.classes.component+"__iframe",VIDEO:CommonUtils.video.classes.component+"__video",WRAPPER:CommonUtils.video.classes.component+"__wrapper",MODAL_CONTAINER_BODY:"modal-container-body",MODAL_VIEW_CONTENT:"modal-view.modal-load-content",POSTER:CommonUtils.video.classes.component+"__poster-image",MODIFIER_POSTER:"mod__video-poster",HAS_POSTER:CommonUtils.video.classes.component+ 44"--has-poster",VIDEO_VISIBLE:CommonUtils.video.classes.component+"--video-visible"});this.ANALYTICS={title:"videoTitle",url:"videoURL",action:"videoAction",average:"videoAverage",play:"Play",pause:"Pause",videoInteraction:"videoInteraction",type:"videoType"};this.element=a;this.video=null;this._params={className:null,id:null,url:null,poster:null,autoplay:!1,controls:!1,loop:!1,title:null,muted:!1,damVideoType:null,urlXL:null,urlL:null,urlM:null,urlS:null};this.analyticsInitialized=!1;this.setParams(b); 45this.init()}init(){this.hasImage()?this.addPlayButtonEventListener():this.element.querySelector("iframe,video")?this.initVideo():this.addIntersectionObserver()}setParams(a){const b={};for(const d of Object.keys(this.element.dataset))b[d]=""===this.element.dataset[d]?!0:this.element.dataset[d];const c={...this._params};Object.keys(b).forEach(d=>{d in c&&(c[d]=b[d])});a&&Object.keys(a).forEach(d=>{d in c&&(c[d]=a[d])});CommonUtils.events.runOnIdle(()=>{Object.keys(this.element.dataset).forEach(d=>{"modal"!== 46d&&this.element.removeAttribute(`data-${d}`)})});this._params=c}initVideo(){}createWrapper(){const a=document.createElement("div");a.classList.add(this.CSS_CLASSES.WRAPPER);return a}createMediaElement(){}injectVideoAndInit(a){const b=this.createWrapper(),c=this.createMediaElement();this.title&&(c.title=this.title);b.appendChild(c);const d=a||this.element;d.innerHTML="";d.appendChild(b);this.initializeAnalytics(c,a)}injectVideoInModal(){this.injectVideoAndInit(this.element.querySelector(`.${this.CSS_CLASSES.MODAL_CONTAINER_BODY}`))}playVideo(){}pauseVideo(){}stopVideo(){}muteVideo(){}unmuteVideo(){}initializeAnalytics(a, 47b){b?.closest(".modal-base-content")?this.initializeModalAnalytics():this.initializeStandardAnalytics(a)}initializeModalAnalytics(){const a=this.getModalElement();a&&!this.analyticsInitialized&&(this.initTypeSpecificAnalytics(a),this.analyticsInitialized=!0)}initializeStandardAnalytics(a){this.analyticsInitialized||(this.initTypeSpecificAnalytics(a),this.analyticsInitialized=!0)}getModalElement(){}initTypeSpecificAnalytics(a){}sendAnalytic(a,b,c,d,e){a={[CommonUtils.analytics.ANALYTICS.eventName]:this.ANALYTICS.videoInteraction, 48[this.ANALYTICS.type]:a,[this.ANALYTICS.url]:c,...CommonUtils.analytics.BASE_PAGE_CONSTANTS};void 0!==b&&null!==b&&(a[this.ANALYTICS.title]=b);d&&(a[this.ANALYTICS.action]=d);void 0!==e&&null!==e&&0!==e&&(a[this.ANALYTICS.average]=e);CommonUtils.analytics.sendDynamicDataLayer("videoInteraction",a)}hasImage(){return 0<this.element.getElementsByClassName(this.CSS_CLASSES.IMAGE).length}getVideoUrl(a){return a&&this.id?a+this.id:this.url||null}addIntersectionObserver(){const a={},b=this.element.dataset.rootMargin; 49b?(a.rootMargin=b.replace("-","px ")+"px",a.threshold=0):a.threshold=.1;(new IntersectionObserver((c,d)=>{c.forEach(e=>{e.isIntersecting&&(this.injectVideoAndInit(),d.disconnect())})},a)).observe(this.element)}addPlayButtonEventListener(){this.element.addEventListener("click",()=>{this.handlePlayButtonClick()})}handlePlayButtonClick(){this.autoplay=!0;"true"===this.element.dataset.modal?(this.injectVideoInModal(),this.element.querySelector(`.${this.CSS_CLASSES.MODAL_VIEW_CONTENT}`).click()):this.injectVideoAndInit()}get id(){return this._params.id}set id(a){this._params.id= 50a}get url(){return this._params.url}set url(a){this._params.url=a}get poster(){return this._params.poster}set poster(a){this._params.poster=a}get autoplay(){return this._params.autoplay}set autoplay(a){this._params.autoplay=!!a}get controls(){return this._params.controls}set controls(a){this._params.controls=!!a}get loop(){return this._params.loop}set loop(a){this._params.loop=!!a}get muted(){return this._params.muted}set muted(a){this._params.muted=!!a}get className(){return this._params.className}set className(a){this._params.className= 51!!a}get title(){return this._params.title}set title(a){this._params.title=a}get damVideoType(){return this._params.damVideoType}set damVideoType(a){this._params.damVideoType=a}get urlXL(){return this._params.urlXL}set urlXL(a){this._params.urlXL=a}get urlL(){return this._params.urlL}set urlL(a){this._params.urlL=a}get urlM(){return this._params.urlM}set urlM(a){this._params.urlM=a}get urlS(){return this._params.urlS}set urlS(a){this._params.urlS=a}} 52class VideoDamV2 extends VideoV2{constructor(...a){super(...a);this.analyticsInitialized=!1;this.initializedModalVideo=null}_createSources(a){a.innerHTML="";const {VIEWPORTS:b}=CommonUtils.viewports;[{minWidth:b.XL.min,url:this.urlXL}
52,{minWidth:b.L.min,url:this.urlL},{minWidth:b.M.min,url:this.urlM},{url:this.urlS||this.urlM||this.urlL||this.urlXL}].forEach(({minWidth:c,url:d})=>{if(d){var e=document.createElement("source");e.src=d;e.type="video/mp4";c&&(e.media=`(min-width: ${c}px)`);a.appendChild(e)}})}_applyViewportSources(a){"viewport"=== 53this.damVideoType&&a&&(this._createSources(a),this.viewportChangeUnsubscribe||(this.viewportChangeUnsubscribe=CommonUtils.viewports.onViewportChange(()=>{this._createSources(a);a.load()})))}initVideo(){this.video||(this.video=this.element.querySelector("video"));CommonUtils.viewports.isSafari()&&this.video.load();this.initSpinnerIfNoControls();this.addEventListeners();(this.autoplay||this.forcePlay)&&this.playVideo()}addEventListeners(){this.autoplay&&!this.loop&&this.video.addEventListener("ended", 54()=>{this.video.removeAttribute("autoplay");this.video.pause()})}createMediaElement(){const a=document.createElement("video");a.classList.add(this.CSS_CLASSES.VIDEO);a.controls=this.controls;a.loop=this.loop;a.playsInline=!0;if("viewport"===this.damVideoType)this._applyViewportSources(a);else{const b=document.createElement("source");b.src=this.url;b.type="video/mp4";a.appendChild(b)}this.poster&&(a.poster=this.poster);this.className&&a.classList.add(this.className);this.title&&a.setAttribute("aria-label", 55this.title);this.autoplay&&!this.controls&&a.setAttribute("aria-hidden","true");this.muted&&(a.setAttribute("muted",""),a.muted=!0);return a}injectVideoAndInit(a){const b=a||this.element;b.innerHTML="";const c=this.createMediaElement();this.video=c;this.initImagePoster();b.appendChild(c);this.video.load();this.initVideo();this.initializeAnalytics(c,a)}initializeAnalytics(a,b){const c=(b=!!b?.closest(".modal-base-content"))?document.querySelector(".modal-container-body .cmp-video-v2__video"):null; 56b?c&&c!==this.initializedModalVideo&&(this.initDamVideoAnalytics(c),this.initializedModalVideo=c,this.analyticsInitialized=!0):this.analyticsInitialized||(this.initDamVideoAnalytics(a),this.analyticsInitialized=!0)}initDamVideoAnalytics(a){const b=a||this.video;Object.entries({play:()=>this.sendAnalytic("Video DAM",this.title,this.url,this.ANALYTICS.play,this.calculateProgress()),pause:()=>this.sendAnalytic("Video DAM",this.title,this.url||window.location.href,this.ANALYTICS.pause,this.calculateProgress())}).forEach(([c, 57d])=>{b.addEventListener(c,d)})}initSpinnerIfNoControls(){this.video.controls||CommonUtils.aem.isActiveDS()&&!this.video.hasAttribute("data-force-controls")&&!this.video.parentElement?.parentElement?.parentElement?.hasAttribute("data-force-controls")||(this.spinner=new VideoDamSpinner(this),this.autoplay&&this.spinner.playVideo())}playVideo(){this.video?(this.setVideoVisibility(!0),this.video.play(),delete this.forcePlay,this.spinner&&this.spinner.renderPlayVideo()):this.forcePlay=!0}pauseVideo(){this.posterImage? 58(this.setVideoVisibility(!1),this.stopVideo()):(this.video?.pause(),this.spinner&&this.spinner.renderPauseVideo())}stopVideo(){this.posterImage&&this.setVideoVisibility(!1);this.video&&(this.video.pause(),this.video.currentTime=0)}muteVideo(){this.video.muted=!0}unmuteVideo(){this.video.muted=!1}get duration(){return this.video.duration}calculateProgress(){if(this.video&&this.video.duration){const a=Math.floor(this.video.currentTime/this.video.duration*100);return 0<a?`${a}%`:null}return null}initImagePoster(){this.element.closest(`.${this.CSS_CLASSES.MODIFIER_POSTER}`)&& 59this.poster&&(this.addImagePoster(),this.setVideoVisibility(!1))}addImagePoster(){let a=this.element.querySelector(`.${this.CSS_CLASSES.POSTER}`);a||(this.autoplay=!1,a=document.createElement("img"),a.src=this.poster,a.alt=this.title||"Video Poster",a.classList.add(this.CSS_CLASSES.POSTER),this.element.prepend(a));this.posterImage=a;this.element.classList.add(this.CSS_CLASSES.HAS_POSTER)}setVideoVisibility(a){this.posterImage&&this.element.classList.toggle(this.CSS_CLASSES.VIDEO_VISIBLE,a)}} 60class VideoDamSpinner{constructor(a){this.parent=a;this.disableSendAnalaytics=!!a.autoplay;this.ctx=this.canvas=this.spinner=null;this.scale=window.devicePixelRatio||1;this.CSS_CLASSES={BLOCK:"cmp-video-spinner",PAUSED:"cmp-video-spinner--paused",PLAYING:"cmp-video-spinner--playing",PROGRESS:"cmp-video-spinner__progress",CIRCLE:"cmp-video-spinner__circle",CIRCLE_ACTIVE:"cmp-video-spinner__circle--active",ICON:"cmp-video-spinner__icon"};this.init();window.addEventListener("resize",()=>{this.canvas&& 61(this.setCanvasSize(this.canvas),this.updateProgress())})}init(){this.setSpinnerColor();this.spinner=this.createSpinnerHTML();this.parent.element.appendChild(this.spinner);this.renderLoop();this.spinner.addEventListener("click",()=>this.togglePlayPause())}setSpinnerColor(){this.spinnerColor=getComputedStyle(document.documentElement).getPropertyValue("--color-ui-05").trim()}
61renderLoop(){const a=this.spinner.parentNode.firstElementChild.getAttribute("noSpinnerProgress"),b=this.spinner.parentNode.firstElementChild.getAttribute("toggleIconTheme"); 62if(null===a){const c=()=>{this.parent.video.paused||this.parent.video.ended||(this.updateProgress(),requestAnimationFrame(c))};requestAnimationFrame(c)}else null!==b&&this.spinner.classList.add(`${this.CSS_CLASSES.BLOCK}--dark`)}createSpinnerHTML(){const {BLOCK:a,PAUSED:b,PLAYING:c,PROGRESS:d,CIRCLE:e,CIRCLE_ACTIVE:f,ICON:h}=this.CSS_CLASSES,g=document.createElement("div");g.classList.add(a,b);this.parent.autoplay&&(g.classList.remove(b),g.classList.add(c));const l=document.createElement("div");l.classList.add(d); 63const k=document.createElement("canvas");k.classList.add(e,f);const m=document.createElement("div");m.classList.add(h);l.appendChild(k);l.appendChild(m);g.appendChild(l);requestAnimationFrame(()=>{this.canvas=k;this.ctx=k.getContext("2d");this.setCanvasSize(k)});return g}setCanvasSize(a){let b;b=CommonUtils.aem.isActiveDS()?{XS:32,S:32,M:40,L:40,XL:40,XXL:48}[CommonUtils.viewports.getViewport().label]:a.getBoundingClientRect().width||40;a.style.width=`${b}px`;a.style.height=`${b}px`;a.width=b*this.scale; 64a.height=b*this.scale;if(a=a.getContext("2d"))a.resetTransform(),a.scale(this.scale,this.scale)}updateProgress(){if(this.canvas&&this.ctx&&this.parent.duration){var a=this.canvas.width/this.scale,b=this.canvas.height/this.scale,c=a/2,d=b/2,e=c-2,f=-.5*Math.PI,h=this.parent.video.currentTime/this.parent.duration*Math.PI*2+f,g=this.ctx;g.clearRect(0,0,a,b);g.beginPath();0<=e&&g.arc(c,d,e,f,h,!1);g.strokeStyle=this.spinnerColor||"#ffffff";g.lineWidth=CommonUtils.aem.isActiveDS()?1:3;g.lineCap="round"; 65g.stroke()}}sendVideoAnalytic(a){this.disableSendAnalaytics||this.parent.sendAnalytic("Video DAM",this.parent.title,"pause"===a?this.parent.url||window.location.href:this.parent.url,this.parent.ANALYTICS[a],this.parent.calculateProgress())}togglePlayPause(){this.disableSendAnalaytics&&(this.disableSendAnalaytics=!1);this.isPlaying()?this.pauseVideo():this.playVideo()}isPlaying(){return this.spinner.classList.contains(this.CSS_CLASSES.PLAYING)}playVideo(){this.renderLoop();this.parent.playVideo(); 66this.sendVideoAnalytic("play")}renderPlayVideo(){this.spinner.classList.remove(this.CSS_CLASSES.PAUSED);this.spinner.classList.add(this.CSS_CLASSES.PLAYING)}pauseVideo(){this.renderLoop();this.parent.pauseVideo();this.sendVideoAnalytic("pause")}renderPauseVideo(){this.spinner.classList.remove(this.CSS_CLASSES.PLAYING);this.spinner.classList.add(this.CSS_CLASSES.PAUSED)}} 67class VideoVimeoV2 extends VideoV2{constructor(...a){super(...a)}createMediaElement(){return Object.assign(document.createElement("iframe"),{src:this.getVideoUrl("https://player.vimeo.com/video/"),frameBorder:"0",allow:"autoplay; fullscreen; picture-in-picture",allowFullscreen:!0,classList:this.CSS_CLASSES.IFRAME})}getVideoUrl(a){a=new URL(super.getVideoUrl(a));a.searchParams.set("title","0");a.searchParams.set("dnt","1");this.autoplay&&a.searchParams.set("autoplay","1");this.controls||(a.searchParams.set("background", 68"1"),a.searchParams.set("byline","0"));this.muted&&a.searchParams.set("muted","1");this.loop&&a.searchParams.set("loop","1");return a.toString()}getModalElement(){return document.querySelector(".modal-container-body .cmp-video-v2__wrapper iframe")}initTypeSpecificAnalytics(a){this.sendAnalytic("Vimeo",this.title,this.getVideoUrl("https://player.vimeo.com/video/"),this.ANALYTICS.init)}} 69class VideoYoutubeV2 extends VideoV2{constructor(...a){super(...a);this.autoplay=!1}createMediaElement(){return Object.assign(document.createElement("iframe"),{src:this.getVideoUrl("https://www.youtube-nocookie.com/embed/"),frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullscreen:!0,classList:this.CSS_CLASSES.IFRAME})}getVideoUrl(a){a=new URL(super.getVideoUrl(a));this.autoplay&&(a.searchParams.set("autoplay","1"),a.searchParams.set("mute", 70"1"));return a.toString()}getModalElement(){return document.querySelector(".modal-container-body .cmp-video-v2__wrapper iframe")}
70initTypeSpecificAnalytics(a){this.sendAnalytic("Youtube",this.title,this.getVideoUrl("https://www.youtube-nocookie.com/embed/"),this.ANALYTICS.init)}}function CommonUtilsClass(){} 71CommonUtilsClass.prototype={actions:new CommonActionsUtilsClass,aem:new CommonAemUtilsClass,animation:new CommonAnimationUtilsClass,dom:new CommonDomUtilsClass,ds:new CommonDSUtilsClass,events:new CommonEventUtilsClass,others:new CommonOthersUtilsClass,string:new CommonStringUtilsClass,url:new CommonUrlUtilsClass,viewports:new CommonViewportsUtilsClass,analytics:new CommonAnalyticsUtilsClass,logger:new CommonLoggerUtilsClass,video:new VideoFactoryV2};window.CommonUtils=new CommonUtilsClass;window.dispatchEvent(new CustomEvent("commonUtils.loaded"));
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.