Samsung Galaxy设备之间的S 互传功能可用于以下操作系统:运行Android OS 10.0 (Q OS)和Samsung One UI 2.1或以上版本的智能手机和平板电脑,运行Windows 10或以上版本的电脑。需要三星账号以及Wi-Fi和蓝牙连接。快速分享至iOS和Android设备,可通过发送分享链接:分享的单个文件不能超过5GB(每天最多可传输5GB数据),链接有效期为两天。发送者的设备需要三星账号,发送者和接收者的设备均需要连接网络。
'));
}
}
};
const isZoom = function () {
let zoomLevel = 100 / ((window.innerWidth / window.outerWidth) * 100);
if (zoomLevel > 1.7) {
document.documentElement.classList.add('browser-zoomed-175');
} else {
document.documentElement.classList.remove('browser-zoomed-175');
}
if (zoomLevel > 3) {
document.documentElement.classList.add('browser-zoomed-300');
} else {
document.documentElement.classList.remove('browser-zoomed-300');
}
if (zoomLevel > 4) {
document.documentElement.classList.add('browser-zoomed-400');
} else {
document.documentElement.classList.remove('browser-zoomed-400');
}
};
const getViewerUrl = function () {
let defaultParams = '',
// viewerSection = document.querySelector('.js-colors-viewer'),
viewerButton = document.querySelector('.viewer-btn'),
viewerModel = utils.isLowNetwork() ? viewerButton.getAttribute('data-model-name') : viewerSection.getAttribute('data-model-name'),
viewerColor = utils.isLowNetwork() ? viewerButton.getAttribute('data-model-color') : viewerSection.getAttribute('data-model-color'),
viewerUrl = '//www.samsung.com/global/galaxy/3d-360/viewer/?';
defaultParams = '&gesture_guide=0';
defaultParams += '&bgcolor=transparent';
defaultParams += '&skin=colorlayer';
defaultParams += '&theme=roundlayer';
defaultParams += '&auto_rotation=0';
defaultParams += '&intro=1';
defaultParams += '&ruler=1';
defaultParams += '&breakpoint_criteria=outer';
defaultParams += '&breakpoint_desktop_width=1024';
defaultParams += '&x=180';
defaultParams += '&status_toggle=1';
defaultParams += '&intro_pose=3';
defaultParams += '&intro_pose_hold=1';
defaultParams += '&intro_pose_hold_limit=9999999';
defaultParams += '&controls=0';
defaultParams += '&use_zoom=0';
defaultParams += '&use_pan=0';
defaultParams += '&screen_mode=on';
// model_name
viewerUrl += 'model_name=' + viewerModel;
if (document.documentElement.classList.contains('color_yb') || (utils.getCookie('highContrastMode') != null && utils.getCookie('highContrastMode') == 1)) {
viewerUrl += '&highcontrast=1';
} else {
viewerUrl += '&highcontrast=0';
}
// RTL
utils.isRTL() && (viewerUrl += '&rtl=1');
viewerUrl += defaultParams;
viewerUrl += '#color=' + (viewerColor ? viewerColor : 'null');
return viewerUrl;
};
return {
addLoadStatusClass: addLoadStatusClass,
setResolution: setResolution,
clickSup: clickSup,
centeredFocus: centeredFocus,
setArBanner: setArBanner,
isZoom: isZoom,
getViewerUrl: getViewerUrl,
}
})();
flagship.features.setting = (function () {
const resize = window.flagship.common.resize,
common = window.flagship.features.common,
utils = window.flagship.common.utils,
agent = navigator.userAgent.toLowerCase(),
maxOs = agent.indexOf('mac os') > -1,
touchDevice = ('ontouchstart' in window || (window.DocumentTouch && document instanceof window.DocumentTouch)),
isGlobal = document.documentElement.classList.contains('global');
let els = {};
const init = function () {
common.addLoadStatusClass();
common.setArBanner();
setElements();
bindEvents();
setResize();
if (!maxOs && !touchDevice) {
setScrollControl();
}
setImageLoader();
setVideoLoader();
setMp4VideoLoader();
setCenteredfocus();
setDisclaimerNumber();
setDisclaimer();
setVideoTheme();
setVideoBlind();
common.isZoom();
resize.add(common.isZoom);
};
const setElements = function () {
// video
els.videoWrap = document.querySelectorAll('.js-video-wrap');
};
const bindEvents = function () {
window.addEventListener('load', anchorPosition);
window.addEventListener('hashchange', anchorPosition);
};
const anchorPosition = function () {
if (window.location.hash != '') {
let hash = location.hash.split('#')[1],
hashSection = document.querySelector('#contents #' + hash),
hashTimeout = null;
clearTimeout(hashTimeout);
hashTimeout = setTimeout(function () {
let sectionTop = hashSection.getBoundingClientRect().top,
navHeight = utils.getNavHeight(),
hashScroll = window.pageYOffset + sectionTop - navHeight;
window.scrollTo(0, hashScroll);
}, 300);
}
};
const setResize = function () {
resize.init([{
resolution: 1920,
resolutionName: 'desktop',
eventFunction: ''
}, {
resolution: 1023,
resolutionName: 'tablet',
eventFunction: ''
}, {
resolution: 767,
resolutionName: 'mobile',
eventFunction: ''
}, {
resolution: 320,
resolutionName: 'mobileS',
eventFunction: ''
}], 200);
resize.add(common.setResolution);
};
const setScrollControl = function () {
window.scrollController = utils.scrollController();
scrollController.init({
speed: 120,
duration: 0.6
});
};
const setImageLoader = function () {
window.imageLoader = utils.mediaLoader({
lazyClass: '.js-img-src',
responsiveClass: '.js-res-img',
preset: isGlobal ? '' : '?imbypass=true',
loadOption: [{
resolution: 1920,
attribute: 'data-src-pc'
}, {
resolution: 1023,
attribute: 'data-src-tb'
}, {
resolution: 767,
attribute: 'data-src-mo'
}, {
resolution: 360,
attribute: 'data-src-mo-s'
}],
visiblePoint: 2
});
window.bgLoader = utils.mediaLoader({
type: 'bgImage',
lazyClass: '.js-bg-img',
loadOption: [{
resolution: 1920,
attribute: '',
bgOpts: ''
}],
visiblePoint: 2
});
};
const setVideoLoader = function () {
window.videoLoader = utils.mediaLoader({
type: 'video',
lazyClass: '.js-video-src',
responsiveClass: '.js-res-video',
preset: isGlobal ? '' : '?imbypass=true',
loadOption: [{
resolution: 1920,
attribute: 'data-video-src-pc'
}, {
resolution: 1023,
attribute: 'data-video-src-tb'
}, {
resolution: 767,
attribute: 'data-video-src-mo'
}, {
resolution: 360,
attribute: 'data-video-src-mo-s'
}],
visiblePoint: 1,
endCallback: function (video) {
if (!!video.videoHandler && !video.videoHandler.wrap.classList.contains('is-loaded')) {
video.videoHandler.wrap.classList.add('is-loaded');
}
}
});
};
const setMp4VideoLoader = function () {
window.mp4VideoLoader = utils.mediaLoader({
type: 'mp4Video',
lazyClass: '.js-mp4-video-src',
responsiveClass: '.js-res-video',
preset: isGlobal ? '' : '?imbypass=true',
loadOption: [{
resolution: 1920,
attribute: 'data-video-src-pc'
}, {
resolution: 1023,
attribute: 'data-video-src-tb'
}, {
resolution: 767,
attribute: 'data-video-src-mo'
}, {
resolution: 360,
attribute: 'data-video-src-mo-s'
}],
visiblePoint: 1,
endCallback: function (video) {
if (!!video.videoHandler && !video.videoHandler.wrap.classList.contains('is-loaded')) {
video.videoHandler.wrap.classList.add('is-loaded');
}
}
});
};
const setCenteredfocus = function () {
els.contents = document.querySelector('#contents');
els.allClickables = els.contents.querySelectorAll('a, button, input, select');
for (let i = 0; i < els.allClickables.length; i++) {
els.allClickables[i].addEventListener('focusin', common.centeredFocus);
}
};
const setDisclaimerNumber = function () {
const supTag = document.querySelectorAll('.click_sup'),
btmDicl = document.querySelectorAll('li.common-bottom-disclaimer__list-item');
let btmDiclArr = [];
for (let i = 0; i < btmDicl.length; i++) {
let dataSup = btmDicl[i].getAttribute('data-sup');
btmDiclArr.push(dataSup);
}
for (let j = 0; j < supTag.length; j++) {
let dataSupTag = supTag[j].getAttribute('data-sup-tag');
let supChildCount = supTag[j].parentElement.childElementCount;
if (btmDiclArr.indexOf(dataSupTag) > -1) {
supTag[j].innerText = btmDiclArr.indexOf(dataSupTag) + 1;
} else {
if (supChildCount == 1) {
supTag[j].parentElement.remove();
} else {
let supParent = supTag[j].parentElement.childNodes;
let supArr = [];
for (let supIndex = 0; supIndex < supParent.length; supIndex++) {
supArr.push(supParent[supIndex]);
}
let index = supArr.indexOf(supTag[j]);
if (index != 0 && index % 2 == 0) {
supParent[index].remove();
supParent[index - 1].remove();
} else {
if (index != supArr.length) supParent[index + 1].remove();
supParent[index].remove();
}
}
}
}
};
const setDisclaimer = function () {
els.supClicker = document.querySelectorAll('a.click_sup');
for (let i = 0; i < els.supClicker.length; i++) {
els.supClicker[i].addEventListener('click', common.clickSup);
}
};
const setVideoTheme = function () {
for (let i = 0; i < els.videoWrap.length; i++) {
let colorType = els.videoWrap[i].getAttribute('data-theme-type');
if (colorType === 'white') {
els.videoWrap[i].classList.add('common-video--white');
} else if (colorType === 'black') {
els.videoWrap[i].classList.add('common-video--black');
}
}
};
const setVideoBlind = function () {
for (let i = 0; i < els.videoWrap.length; i++) {
let controlBlind = els.videoWrap[i].querySelector('.js-video-control .blind');
controlBlind.innerHTML = (typeof LOCAL_VARI != 'undefined' && !!LOCAL_VARI) ? LOCAL_VARI.play : 'play';
}
};
return {
init: init
}
})();
flagship.features.setting.init();
(function () {
window.flagship.features.clickToVideo = (function () {
const utils = window.flagship.common.utils;
let els = {
clickToVideosWrap: [],
clickToVideo: [],
};
const init = function () {
els.clickToVideosWrap = document.querySelectorAll('.js-click-video');
if (els.clickToVideosWrap.length > 0) {
setProperty();
bindEvents();
}
};
const setProperty = function () {
for (let i = 0; i < els.clickToVideosWrap.length; i++) {
els.clickToVideosWrap[i].video = els.clickToVideosWrap[i].querySelector('video');
els.clickToVideosWrap[i].controller = els.clickToVideosWrap[i].querySelector('.js-video-control');
els.clickToVideosWrap[i].controller.video = els.clickToVideosWrap[i].video;
}
};
const bindEvents = function () {
eventList.setVideo();
eventHandler.click();
};
const eventHandler = {
click: function () {
for (let i = 0; i < els.clickToVideosWrap.length; i++) {
els.clickToVideosWrap[i].controller.addEventListener('click', eventList.clickVideoCta);
}
}
};
const eventList = {
setVideo: function () {
for (let i = 0; i < els.clickToVideosWrap.length; i++) {
els.clickToVideo[i] = utils.videoHandler({
wrap: els.clickToVideosWrap[i],
video: els.clickToVideosWrap[i].video,
controller: els.clickToVideosWrap[i].controller,
resetCallback: function () {
if (this.wrap.classList.contains('is-completed')) {
this.wrap.classList.remove('is-completed');
}
if (this.wrap.classList.contains('is-started')) {
this.wrap.classList.remove('is-started');
}
},
playCallback: function () {
if (!this.wrap.classList.contains('is-started')) {
this.wrap.classList.add('is-started');
}
setTagging.pause(this.controller);
},
pauseCallback: function () {
setTagging.play(this.controller);
},
endCallback: function () {
if (!this.wrap.classList.contains('is-completed')) {
this.wrap.classList.add('is-completed');
}
}
});
}
},
clickVideoCta: function (e) {
if (e.target == e.currentTarget) {
if (e.currentTarget.video.paused) {
e.currentTarget.video.play();
} else {
e.currentTarget.video.pause();
}
}
}
};
const setTagging = {
play: function (targetController) {
if (targetController.hasAttribute('data-omni')) {
let dataOmni = targetController.getAttribute('data-omni').toLowerCase();
targetController.setAttribute('data-omni', dataOmni.replace('pause', 'play'));
}
if (targetController.hasAttribute('ga-la')) {
let gaLa = targetController.getAttribute('ga-la').toLowerCase();
targetController.setAttribute('ga-la', gaLa.replace('pause', 'play'));
}
},
pause: function (targetController) {
if (targetController.hasAttribute('data-omni')) {
let dataOmni = targetController.getAttribute('data-omni').toLowerCase();
targetController.setAttribute('data-omni', dataOmni.replace('play', 'pause'));
}
if (targetController.hasAttribute('ga-la')) {
let gaLa = targetController.getAttribute('ga-la').toLowerCase();
targetController.setAttribute('ga-la', gaLa.replace('play', 'pause'));
}
}
};
return {
init: init
}
})();
})();
(function () {
window.flagship.features.headline = (function () {
const utils = window.flagship.common.utils;
let els = {};
const init = function () {
setElements();
bindEvents();
};
const setElements = function() {
els.moveText = document.querySelectorAll('.js-move-text');
els.moveText1 = document.querySelectorAll('.animate-l');
els.moveText2 = document.querySelectorAll('.animate-r');
els.moveText3 = document.querySelectorAll('.iphone-gradually-appearing1');
// els.moveText4 = document.querySelectorAll('.guang');
els.moveText5 = document.querySelectorAll('.iphone-gradually-appearing1_mo');
};
const bindEvents = function () {
eventList.setScene();
eventHandler.scroll();
eventList.scroll();
};
const eventHandler = {
scroll: function () {
window.addEventListener('scroll', eventList.scroll);
}
};
const eventList = {
scroll: function () {
for (let i = 0; i < els.moveText.length; i++) {
els.moveText[i].sceneObj.trackAnimation(function () {
if(this.progress >= 10) {
els.moveText[i].classList.add('is-moved');
if (this.trackElement.classList.contains('common-description')) this.trackElement.style.transitionDelay = "0.2s";
}
if(this.progress <= 0) {
els.moveText[i].classList.remove('is-moved');
}
});
}
for (let i = 0; i < els.moveText1.length; i++) {
els.moveText1[i].sceneObj.trackAnimation(function () {
if(this.progress >= 10) {
els.moveText1[i].classList.add('animate__slideInLeft');
if (this.trackElement.classList.contains('common-description')) this.trackElement.style.transitionDelay = "0.2s";
}
if(this.progress <= 0) {
els.moveText1[i].classList.remove('animate__slideInLeft');
}
});
}
for (let i = 0; i < els.moveText2.length; i++) {
els.moveText2[i].sceneObj.trackAnimation(function () {
if(this.progress >= 10) {
els.moveText2[i].classList.add('animate__slideInRight');
if (this.trackElement.classList.contains('common-description')) this.trackElement.style.transitionDelay = "0.2s";
}
if(this.progress <= 0) {
els.moveText2[i].classList.remove('animate__slideInRight');
}
});
}
for (let i = 0; i < els.moveText3.length; i++) {
els.moveText3[i].sceneObj.trackAnimation(function () {
if(this.progress >= 10) {
els.moveText3[0].classList.add('animate__slideInOpen');
// els.moveText3[1].classList.add('animate__slideInLeft');
}
if(this.progress <= 0) {
els.moveText3[0].classList.remove('animate__slideInOpen');
// els.moveText3[1].classList.remove('animate__slideInLeft');
}
});
}
for (let i = 0; i < els.moveText5.length; i++) {
els.moveText5[i].sceneObj.trackAnimation(function () {
if(this.progress >= 10) {
els.moveText5[0].classList.add('animate__slideInOpen');
// els.moveText3[1].classList.add('animate__slideInLeft');
}
if(this.progress <= 0) {
els.moveText5[0].classList.remove('animate__slideInOpen');
// els.moveText3[1].classList.remove('animate__slideInLeft');
}
});
}
},
setScene: function () {
for(let i = 0; i < els.moveText.length; i++) {
els.moveText[i].sceneObj = SCROLLER({
trackElement: els.moveText[i],
useFixed: false,
});
}
for(let i = 0; i < els.moveText1.length; i++) {
els.moveText1[i].sceneObj = SCROLLER({
trackElement: els.moveText1[i],
useFixed: false,
});
}
for(let i = 0; i < els.moveText2.length; i++) {
els.moveText2[i].sceneObj = SCROLLER({
trackElement: els.moveText2[i],
useFixed: false,
});
}
for(let i = 0; i < els.moveText3.length; i++) {
els.moveText3[i].sceneObj = SCROLLER({
trackElement: els.moveText3[i],
useFixed: false,
});
}
// for(let i = 0; i < els.moveText4.length; i++) {
// els.moveText4[i].sceneObj = SCROLLER({
// trackElement: els.moveText4[i],
// useFixed: false,
// });
// }
for(let i = 0; i < els.moveText5.length; i++) {
els.moveText5[i].sceneObj = SCROLLER({
trackElement: els.moveText5[i],
useFixed: false,
});
}
}
};
return {
init: init
}
})();
})();
(function() {
window.flagship = window.flagship || {};
window.flagship.features = window.flagship.features || {};
window.flagship.features.ai = (function() {
const utils = window.flagship.common.utils;
const resize = window.flagship.common.resize;
let els = {},
objs = {},
status = {
prevIndex: 0,
isAuto: true,
};
const init = function() {
els.section = document.querySelector('.highlights-ai');
if (!!els.section) {
setElements();
// eventList.setScene();
bindEvents();
}
};
const setElements = function() {
els.carouselWrap = els.section.querySelector('.js-carousel-wrap');
els.yotubeCta = els.section.querySelectorAll('.js-youtube-popup');
// swiper
els.swiperContainer = els.section.querySelector('.swiper-container');
els.nextArrow = els.section.querySelector('.swiper-button-next');
els.prevArrow = els.section.querySelector('.swiper-button-prev');
els.pagination = els.section.querySelector('.swiper-pagination');
// video
// els.videoWrap = els.section.querySelectorAll('.common-video');
// els.videoControlCta = Array.prototype.slice.call(els.section.querySelectorAll('.common-video__control'));
};
const bindEvents = function() {
eventHandler.load();
// eventHandler.scroll();
eventHandler.click();
resize.add(eventList.onResize);
};
const eventHandler = {
load: function() {
window.addEventListener('DOMContentLoaded', eventList.onLoad, {
once: true
});
},
scroll: function() {
window.addEventListener('scroll', eventList.scroll);
},
click: function() {
// for (let i = 0; i < els.videoControlCta.length; i++) {
// els.videoControlCta[i].addEventListener('click', eventList.setVideoStatus);
// }
els.nextArrow.addEventListener('click', eventList.setArrowFocus);
els.nextArrow.addEventListener('keydown', eventList.setArrowFocus);
els.prevArrow.addEventListener('click', eventList.setArrowFocus);
els.prevArrow.addEventListener('keydown', eventList.setArrowFocus);
// for (let i = 0; i < els.yotubeCta.length; i++) {
// els.yotubeCta[i].addEventListener('click', eventList.pauseVideo);
// }
},
};
const eventList = {
swiper: {
set: function() {
if (objs.swiper == null) {
objs.swiper = new Swiper(els.swiperContainer, {
init: false,
speed: 500,
navigation: {
nextEl: els.nextArrow,
prevEl: els.prevArrow,
},
pagination: {
el: els.pagination,
type: 'bullets',
renderBullet: function() {
return '';
}
},
});
}
},
init: function() {
let notification = this.el.querySelector('.swiper-notification');
this.el.removeChild(notification);
els.nextArrow.removeAttribute('aria-label');
els.nextArrow.removeAttribute('role');
els.prevArrow.removeAttribute('aria-label');
els.prevArrow.removeAttribute('role');
objs.swiper.on('slideChange', eventList.swiper.slideChange);
objs.swiper.on('transitionEnd', eventList.swiper.transitionEnd);
objs.swiper.on('touchMove', eventList.swiper.touchMove);
objs.swiper.on('touchEnd', eventList.swiper.touchEnd);
els.bullets = objs.swiper.pagination.bullets;
for (let i = 0; i < els.bullets.length; i++) {
els.bullets[i].addEventListener('click', function() {
objs.swiper.slideTo(i);
});
}
// eventList.setVideo();
// eventList.scroll();
accessibility.slide();
accessibility.pagination.label();
accessibility.pagination.tagging();
},
slideChange: function() {
let activeIndex = objs.swiper.activeIndex;
let nextIndex = (activeIndex == (objs.swiper.slides.length - 1)) ? null : activeIndex + 1;
// if (nextIndex != null) {
// if (nextIndex == 2) {
// eventList.lazyLoad(els.videoWrap[nextIndex]);
// } else if (nextIndex == 3) {
// eventList.lazyLoad(els.videoWrap[nextIndex]);
// }
// }
// set autoplay
if (objs.swiper.activeIndex == (objs.swiper.slides.length - 1)) status.isLast = true;
accessibility.slide();
accessibility.pagination.label();
status.prevIndex = activeIndex;
},
transitionEnd: function() {
// let activeController = objs[`video_${objs.swiper.activeIndex}`].controller;
let isArrow = document.activeElement.classList.contains('swiper-button-next') || document.activeElement.classList.contains('swiper-button-prev');
let isBullet = document.activeElement.classList.contains('swiper-pagination-bullet');
if (!!isArrow || !!isBullet) return;
// activeController.focus();
},
touchMove: function() {
objs.swiper.off('transitionEnd', eventList.swiper.transitionEnd);
},
touchEnd: function() {
objs.swiper.on('transitionEnd', eventList.swiper.transitionEnd);
},
},
setVideo: function() {
for (let i = 0; i < els.videoWrap.length; i++) {
objs[`video_${i}`] = newVideoHandler({
playType: 'scrollPlay',
wrap: els.videoWrap[i],
video: els.videoWrap[i].querySelector('video'),
controller: els.videoControlCta[i],
startPoint: status.currentDevice.indexOf('mobile') > -1 ? 25 : 35,
reversePoint: status.currentDevice.indexOf('mobile') > -1 ? 65 : 75,
resetCallback: function() {
if (this.wrap.classList.contains('is-completed')) {
this.wrap.classList.remove('is-completed');
}
},
playCallback: function() {
accessibility.controlTagging.play(objs[`video_${i}`].wrap.control);
},
pauseCallback: function() {
accessibility.controlTagging.pause(objs[`video_${i}`].wrap.control);
},
endCallback: function() {
if (!this.wrap.classList.contains('is-completed')) {
this.wrap.classList.add('is-completed');
}
if (!status.isAuto || !!status.isLast) return;
setTimeout(() => {
objs.swiper.slideNext(500);
}, 300);
}
});
}
},
setScene: function() {
objs.scene = SCROLLER({
trackElement: els.carouselWrap,
useFixed: false
});
},
onLoad: function() {
status.currentDevice = resize.checkResolution();
if (!!utils.isLowNetwork()) status.isAuto = false;
eventList.swiper.set();
objs.swiper.on('init', eventList.swiper.init);
objs.swiper.init();
},
onResize: function(currRes) {
status.currentDevice = currRes;
},
scroll: function() {
objs.scene.trackAnimation(function() {
if (!status.isAuto) return;
objs[`video_${objs.swiper.activeIndex}`].scrollActive(this.progress);
});
},
lazyLoad: function(videoWrap) {
videoLoader.setResponsiveMedia([videoWrap.querySelector('video')], function(target) {
if (!target.videoHandler.wrap.classList.add('is-loaded')) target.videoHandler.wrap.classList.add('is-loaded');
});
let image = videoWrap.querySelectorAll('img');
imageLoader.setResponsiveMedia(image);
},
setVideoStatus: function() {
let activeIndex = els.videoControlCta.indexOf(this);
if (!objs[`video_${activeIndex}`].video.paused) {
objs[`video_${activeIndex}`].video.pause();
if (!utils.isLowNetwork()) status.isAuto = false;
} else {
objs[`video_${activeIndex}`].video.play();
if (!utils.isLowNetwork()) status.isAuto = true;
}
},
setArrowFocus: function(e) {
status.arrowFocusTimeout = null;
if ((e.type == 'keydown' && e.keyCode == 13) || e.type == 'click') {
e.preventDefault();
clearTimeout(status.arrowFocusTimeout);
status.arrowFocusTimeout = setTimeout(() => {
if (objs.swiper.isBeginning && !objs.swiper.isEnd) {
els.nextArrow.focus();
} else if (!objs.swiper.isBeginning && objs.swiper.isEnd) {
els.prevArrow.focus();
}
}, 300);
}
},
pauseVideo: function() {
if (!objs[`video_${objs.swiper.activeIndex}`].video.paused) {
objs[`video_${objs.swiper.activeIndex}`].video.pause();
if (!utils.isLowNetwork()) status.isAuto = false;
}
}
};
const accessibility = {
slide: function() {
for (let i = 0; i < objs.swiper.slides.length; i++) {
if (i != objs.swiper.activeIndex) {
utils.onAccessibility(objs.swiper.slides[i]);
} else {
utils.offAccessibility(objs.swiper.slides[i]);
}
}
},
pagination: {
label: function() {
for (let i = 0; i < els.bullets.length; i++) {
let slideTitle = objs.swiper.slides[i].getAttribute('data-slide-name');
if (i === objs.swiper.realIndex) {
if (typeof LOCAL_VARI != 'undefined' && !!LOCAL_VARI) {
els.bullets[i].setAttribute('aria-label', `Slide${i+1}: ${slideTitle} ${LOCAL_VARI.selected.toLowerCase()}`);
} else {
els.bullets[i].setAttribute('aria-label', `Slide${i+1}: ${slideTitle} selected`);
}
} else {
els.bullets[i].setAttribute('aria-label', `Slide${i+1}: ${slideTitle}`);
}
}
},
tagging: function() {
for (let i = 0; i < els.bullets.length; i++) {
let tagging = {
'data-omni-type': 'microsite_pcontentinter',
'data-omni': 'galaxy-z-fold5:highlights:overview:index:',
'ga-ca': 'indication',
'ga-ac': 'carousel',
'ga-la': 'galaxy-z-fold5:highlights:overview:index:',
};
Object.keys(tagging).forEach(function(key) {
if (key == 'data-omni' || key == 'ga-la') {
els.bullets[i].setAttribute(key, tagging[key] + (i + 1));
} else {
els.bullets[i].setAttribute(key, tagging[key]);
}
});
}
},
},
controlTagging: {
pause: function(control) {
if (!!control) {
let dataOmni = control.getAttribute('data-omni'),
gaLa = control.getAttribute('ga-la');
control.setAttribute('data-omni', dataOmni.replace('pause', 'play'));
control.setAttribute('ga-la', gaLa.replace('pause', 'play'));
}
},
play: function(control) {
if (!!control) {
let dataOmni = control.getAttribute('data-omni'),
gaLa = control.getAttribute('ga-la');
control.setAttribute('data-omni', dataOmni.replace('play', 'pause'));
control.setAttribute('ga-la', gaLa.replace('play', 'pause'));
}
},
}
};
return {
init: init
}
})();
})();
(function () {
window.flagship = window.flagship || {};
window.flagship.features = window.flagship.features || {};
window.flagship.features.oneColumnCarousel = (function () {
const utils = window.flagship.common.utils;
const resize = window.flagship.common.resize;
let els = {};
let prevDevice;
let currDevice = resize.checkResolution();
let dimmedClass = 'is-dimmed';
const isRtl = document.documentElement.classList.contains('rtl');
const init = function () {
els.section = document.querySelectorAll('.js-one-column-carousel');
if (!!els.section) {
setElements();
setProperty();
bindEvents();
}
};
const setElements = function () {
for (let i = 0; i < els.section.length; i++) {
els.section[i].swiperContainer = els.section[i];
els.section[i].swiperSlides = els.section[i].swiperContainer.querySelectorAll('.swiper-slide');
els.section[i].prevArrow = els.section[i].parentElement.querySelector('.swiper-button-prev');
els.section[i].nextArrow = els.section[i].parentElement.querySelector('.swiper-button-next');
els.section[i].scrollbar = els.section[i].parentElement.querySelector('.swiper-scrollbar');
}
};
const setProperty = function() {
for (let i = 0; i < els.section.length; i++) {
let isSlideLength = els.section[i].swiperSlides.length;
for (let j = 0; j < isSlideLength; j++) {
els.section[i].swiperSlides[j].video = els.section[i].swiperSlides[j].querySelector('.common-video__video');
}
}
}
const bindEvents = function () {
eventList.load();
resize.add(eventList.resize);
};
const eventList = {
load: function() {
swiperEvents.set();
for (let i = 0; i < els.section.length; i++) {
els.section[i].swiper.init();
if (els.section[i].swiperSlides.length >= 2) {
els.section[i].swiper.init();
}
}
},
resize: function() {
currDevice = resize.checkResolution();
if (prevDevice != currDevice) {
eventList.responsive();
prevDevice = currDevice;
};
},
responsive: function() {
for (let i = 0; i < els.section.length; i++) {
eventList.resetDimmedSlide(els.section[i].swiper);
els.section[i].swiper.slideTo(0, false);
if (eventList.getCarouselSizeInfo(els.section[i].swiper).viewLength > 0 && currDevice != 'mobile') eventList.initDimmedSlides(els.section[i].swiper);
}
},
setMedia: function(swiper, index) {
let isIndex = index + 1 > swiper.slides.length -1 ? swiper.slides.length -1 : index + 1;
let videoLength = swiper.el.querySelectorAll('video').length - 1;
let imageLength = swiper.el.querySelectorAll('img').length - 1;
let videoloadComplateLength = swiper.el.querySelectorAll('.is-video-load-complete').length - 1;
let imageloadComplateLength = swiper.el.querySelectorAll('.is-img-load-complete').length - 1;
let nextVideo = swiper.slides[isIndex].querySelector('video');
let nextImage = swiper.slides[isIndex].querySelector('img');
if (videoloadComplateLength != videoLength) {
if (!!nextVideo) {
videoLoader.setResponsiveMedia([nextVideo]);
}
}
if (imageloadComplateLength != imageLength) {
if (!!nextImage) {
imageLoader.setResponsiveMedia([nextImage]);
}
}
},
resetVideo: function(swiper) {
for (let i = 0; i < swiper.slides.length; i++) {
let isVideo = swiper.slides[i].video;
if (!!isVideo && !isVideo.paused) {
isVideo.pause();
isVideo.currentTime = 0;
};
};
},
getCarouselSizeInfo: function(swiper) {
let slideLength = swiper.slides.length;
let slideWidth = swiper.slides[0].clientWidth;
let slideMargin = parseInt(window.getComputedStyle(swiper.slides[0]).margin.split(' ')[isRtl ? 3 : 1]);
let slideSize = slideWidth + slideMargin;
let maxMoveSize = ((slideSize * slideLength) - slideMargin) - swiper.wrapperEl.clientWidth;
let viewWidth = swiper.wrapperEl.clientWidth;
let viewLength = parseInt((viewWidth + slideMargin)/slideSize);
let lastBeforeSize = slideLength == 2 ? 0 : Math.abs((maxMoveSize - slideSize)) + Math.abs((viewWidth - slideWidth));
let isMoveSize = Math.abs(parseInt(window.getComputedStyle(swiper.wrapperEl).transform.split(',')[4]));
return {
slideWidth: slideWidth,
slideMargin: slideMargin,
slideSize: slideSize,
maxMoveSize: maxMoveSize,
viewWidth: viewWidth,
viewLength: viewLength,
lastBeforeSize: lastBeforeSize,
isMoveSize: isMoveSize
}
},
initDimmedSlides: function(swiper) {
for (let i = 0; i < swiper.slides.length; i++) {
if ((swiper.activeIndex + eventList.getCarouselSizeInfo(swiper).viewLength) <= i) {
swiper.slides[i].classList.add(dimmedClass);
}
}
},
setDimmedSlide: function(swiper) {
if (currDevice != 'mobile') {
for (let i = 0; i < swiper.slides.length; i++) {
let dimmedSlide = (swiper.activeIndex) > i || (swiper.activeIndex + (eventList.getCarouselSizeInfo(swiper).viewLength - 1)) < i;
if (dimmedSlide) {
swiper.slides[i].classList.add(dimmedClass);
} else {
swiper.slides[i].classList.remove(dimmedClass);
}
}
}
},
resetDimmedSlide: function(swiper) {
for (let i = 0; i < swiper.slides.length; i++) {
swiper.slides[i].classList.remove(dimmedClass);
}
},
}
const swiperEvents = {
set: function () {
for (let i = 0; i < els.section.length; i++) {
if (els.section[i].swiper == null) {
new Swiper(els.section[i].swiperContainer, {
init: false,
slidesPerView: 'auto',
navigation: {
nextEl: els.section[i].nextArrow,
prevEl: els.section[i].prevArrow,
},
scrollbar: {
el: els.section[i].scrollbar,
draggable: true
},
});
els.section[i].swiper.on('init', swiperEvents.init);
els.section[i].swiper.on('slideChange', swiperEvents.slideChange);
els.section[i].swiper.on('transitionEnd', swiperEvents.transitionEnd);
}
}
},
init: function () {
let isNextArrow = this.el.parentElement.querySelector('.swiper-button-next');
let isPrevArrow = this.el.parentElement.querySelector('.swiper-button-prev');
isNextArrow.removeAttribute('aria-label');
isNextArrow.removeAttribute('role');
isPrevArrow.removeAttribute('aria-label');
isPrevArrow.removeAttribute('role');
accessibility.slide(this);
if (eventList.getCarouselSizeInfo(this).viewLength > 0 && currDevice != 'mobile') eventList.initDimmedSlides(this);
},
slideChange: function () {
accessibility.slide(this);
eventList.resetVideo(this);
if (eventList.getCarouselSizeInfo(this).viewLength > 0 && currDevice != 'mobile') eventList.setDimmedSlide(this);
if (this.realIndex > 0) eventList.setMedia(this, this.realIndex);
},
transitionEnd: function() {
if (this.slides.length < 3 && currDevice == 'mobile') return;
setTimeout(() => {
let carouselInfo = eventList.getCarouselSizeInfo(this);
let lastIndex = this.slides.length -1;
let lastSlide = this.slides[lastIndex];
let lastBeforeSlide = this.slides[lastIndex - 1];
if (carouselInfo.isMoveSize > carouselInfo.lastBeforeSize || carouselInfo.maxMoveSize == carouselInfo.isMoveSize) {
eventList.resetVideo(this);
lastSlide.classList.add('is-last-slide');
lastBeforeSlide.classList.add('is-dimmed');
lastSlide.classList.remove('is-dimmed');
utils.offAccessibility(this.slides[lastIndex]);
utils.onAccessibility(this.slides[lastIndex - 1]);
} else if (lastSlide.classList.contains('is-last-slide') && carouselInfo.lastBeforeSize == carouselInfo.isMoveSize) {
eventList.resetVideo(this);
lastSlide.classList.add('is-dimmed');
lastSlide.classList.remove('is-last-slide');
lastBeforeSlide.classList.remove('is-dimmed');
utils.onAccessibility(this.slides[lastIndex]);
utils.offAccessibility(this.slides[lastIndex - 1]);
}
}, 0);
},
destroy: function (swiper) {
if (swiper != null) {
swiper.navigation.destroy(true);
swiper.destroy(true);
swiper = null;
}
},
};
const accessibility = {
slide: function (swiper) {
for (let i = 0; i < swiper.slides.length; i++) {
if (i != swiper.activeIndex) {
utils.onAccessibility(swiper.slides[i]);
} else {
utils.offAccessibility(swiper.slides[i]);
}
}
}
};
return {
init: init,
}
})();
})();
(function () {
window.flagship.features.scrollVideo = (function () {
const utils = window.flagship.common.utils,
resize = window.flagship.common.resize;
let els = {
scrollVideoWraps: [],
scrollVideo: [],
scene: [],
},
currDevice = resize.checkResolution();
const init = function () {
els.scrollVideoWraps = document.querySelectorAll('.js-scroll-video');
if (els.scrollVideoWraps.length > 0) {
setProperty();
eventList.setVideo();
eventList.setScene();
bindEvents();
}
};
const setProperty = function () {
for (let i = 0; i < els.scrollVideoWraps.length; i++) {
els.scrollVideoWraps[i].video = els.scrollVideoWraps[i].querySelector('video');
els.scrollVideoWraps[i].controller = els.scrollVideoWraps[i].querySelector('.js-video-control');
els.scrollVideoWraps[i].controller.video = els.scrollVideoWraps[i].video;
els.scrollVideoWraps[i].startPoint = !!els.scrollVideoWraps[i].getAttribute('data-start-point') ? parseInt(els.scrollVideoWraps[i].getAttribute('data-start-point')) : undefined;
els.scrollVideoWraps[i].reversePoint = !!els.scrollVideoWraps[i].getAttribute('data-reverse-point') ? parseInt(els.scrollVideoWraps[i].getAttribute('data-reverse-point')) : undefined;
els.scrollVideoWraps[i].moStartPoint = !!els.scrollVideoWraps[i].getAttribute('data-mo-start-point') ? parseInt(els.scrollVideoWraps[i].getAttribute('data-mo-start-point')) : undefined;
els.scrollVideoWraps[i].moReversePoint = !!els.scrollVideoWraps[i].getAttribute('data-mo-reverse-point') ? parseInt(els.scrollVideoWraps[i].getAttribute('data-mo-reverse-point')) : undefined;
}
};
const bindEvents = function () {
eventHandler.scroll();
eventList.scroll();
eventHandler.click();
resize.add(eventList.resize);
};
const eventHandler = {
scroll: function () {
window.addEventListener('scroll', eventList.scroll);
},
click: function () {
for (let i = 0; i < els.scrollVideoWraps.length; i++) {
els.scrollVideoWraps[i].controller.addEventListener('click', eventList.clickVideoCta);
}
}
};
const eventList = {
setVideo: function () {
for (let i = 0; i < els.scrollVideoWraps.length; i++) {
els.scrollVideo[i] = utils.videoHandler({
playType: 'scrollPlay',
startPoint: (currDevice.indexOf('mobile') > -1) ? els.scrollVideoWraps[i].moStartPoint : els.scrollVideoWraps[i].startPoint,
reversePoint: (currDevice.indexOf('mobile') > -1) ? els.scrollVideoWraps[i].moReversePoint : els.scrollVideoWraps[i].reversePoint,
wrap: els.scrollVideoWraps[i],
video: els.scrollVideoWraps[i].video,
controller: els.scrollVideoWraps[i].controller,
resetCallback: function () {
if (this.wrap.classList.contains('is-completed')) {
this.wrap.classList.remove('is-completed');
}
if (this.wrap.classList.contains('is-started')) {
this.wrap.classList.remove('is-started');
}
if (!!this.video.videoWrap && this.video.videoWrap.classList.contains('js-interactive-intro-video')) {
this.video.tooltip.classList.remove('is-visible');
}
},
playCallback: function () {
if (!this.wrap.classList.contains('is-started')) {
this.wrap.classList.add('is-started');
}
setTagging.pause(this.controller);
},
pauseCallback: function () {
setTagging.play(this.controller);
},
endCallback: function () {
if (!this.wrap.classList.contains('is-completed')) {
this.wrap.classList.add('is-completed');
}
}
});
}
},
setScene: function () {
for (let i = 0; i < els.scrollVideoWraps.length; i++) {
els.scene[i] = SCROLLER({
trackElement: els.scrollVideoWraps[i].video,
useFixed: false,
resize: utils.detector.isTouchDevice ? false : true
});
}
},
scroll: function () {
for (let i = 0; i < els.scrollVideoWraps.length; i++) {
els.scene[i].trackAnimation(function () {
els.scrollVideo[i].scrollActive(this.progress);
});
}
},
resize: function (currRes) {
currDevice = currRes;
},
clickVideoCta: function (e) {
if (e.target == e.currentTarget) {
if (e.currentTarget.video.paused) {
e.currentTarget.video.play();
} else {
e.currentTarget.video.pause();
}
}
}
};
const setTagging = {
play: function (targetController) {
if (targetController.hasAttribute('data-omni')) {
let dataOmni = targetController.getAttribute('data-omni').toLowerCase();
targetController.setAttribute('data-omni', dataOmni.replace('pause', 'play'));
}
if (targetController.hasAttribute('ga-la')) {
let gaLa = targetController.getAttribute('ga-la').toLowerCase();
targetController.setAttribute('ga-la', gaLa.replace('pause', 'play'));
}
},
pause: function (targetController) {
if (targetController.hasAttribute('data-omni')) {
let dataOmni = targetController.getAttribute('data-omni').toLowerCase();
targetController.setAttribute('data-omni', dataOmni.replace('play', 'pause'));
}
if (targetController.hasAttribute('ga-la')) {
let gaLa = targetController.getAttribute('ga-la').toLowerCase();
targetController.setAttribute('ga-la', gaLa.replace('play', 'pause'));
}
}
};
return {
init: init
}
})();
})();
;
(function () {
window.flagship.features.threeColumnCarousel = (function () {
const utils = window.flagship.common.utils,
resize = window.flagship.common.resize;
let els = {},
swiperObj,
prevDevice = null,
currDevice = resize.checkResolution();
dimmedClass = 'is-dimmed';
const isRtl = document.documentElement.classList.contains('rtl');
const init = function () {
els.section = document.querySelectorAll('.js-three-column-carousel');
if (!!els.section) {
setElements();
bindEvents();
}
};
const setElements = function () {
for (let i = 0; i < els.section.length; i++) {
els.section[i].swiperContainer = els.section[i];
els.section[i].swiperSlide = els.section[i].querySelectorAll('.swiper-slide');
els.section[i].nextArrow = els.section[i].parentElement.querySelector('.swiper-button-next');
els.section[i].prevArrow = els.section[i].parentElement.querySelector('.swiper-button-prev');
els.section[i].scrollbar = els.section[i].parentElement.querySelector('.swiper-scrollbar');
};
};
const bindEvents = function () {
eventList.load();
resize.add(eventList.resize);
};
const eventHandler = {
swiper: function() {
for (let i = 0; i < els.section.length; i++) {
els.section[i].swiper.on('init', swiperEvents.init);
els.section[i].swiper.on('slideChange', swiperEvents.slideChange);
els.section[i].swiper.on('transitionEnd', swiperEvents.transitionEnd);
};
}
};
const eventList = {
load: function() {
for (let i = 0; i < els.section.length; i++) {
let desktopStatus = (currDevice == 'desktop' || currDevice == 'tablet') && els.section[i].swiperSlide.length > 3;
let mobileStatus = (currDevice == 'mobile' || currDevice == 'mobileS') && els.section[i].swiperSlide.length > 1;
if (desktopStatus || mobileStatus) {
swiperEvents.set();
eventHandler.swiper();
els.section[i].swiper.init();
}
}
},
resize: function() {
currDevice = resize.checkResolution();
if (prevDevice != currDevice) {
eventList.responsive();
prevDevice = currDevice;
};
},
responsive: function() {
for (let i = 0; i < els.section.length; i++) {
let isSection = els.section[i];
let desktopStatus = (currDevice == 'desktop' || currDevice == 'tablet') && isSection.swiperSlide.length > 3;
let mobileStatus = currDevice == 'mobile' && isSection.swiperSlide.length > 1;
eventList.resetDimmedSlide(isSection.swiper);
// accessibility.reset(isSection.swiper);
if (desktopStatus || mobileStatus) {
if (isSection.swiper?.initialized) swiperEvents.destroy(isSection.swiper);
swiperEvents.set();
eventHandler.swiper();
isSection.swiper.init();
// if (desktopStatus) eventList.initDimmedSlides(isSection.swiper);
// if (mobileStatus) accessibility.slide(isSection.swiper);
} else if ((!desktopStatus || !mobileStatus) && isSection.swiper != undefined) {
if (isSection.swiper?.initialized) swiperEvents.destroy(isSection.swiper);
}
};
},
getCarouselSizeInfo: function(swiperObj) {
let slideLength = swiperObj.slides.length;
let slideWidth = swiperObj.slides[0].clientWidth;
let slideMargin = parseInt(window.getComputedStyle(swiperObj.slides[0]).margin.split(' ')[isRtl ? 3 : 1]);
let slideSize = slideWidth + slideMargin;
let maxMoveSize = ((slideSize * slideLength) - slideMargin) - swiperObj.wrapperEl.clientWidth;
let viewWidth = swiperObj.wrapperEl.clientWidth;
let viewLength = Math.round((viewWidth + slideMargin)/slideSize);
let lastBeforeSize = slideLength == 3 ? 0 : (slideWidth + slideMargin) * ((slideLength - viewLength) - 1);
let isMoveSize = Math.abs(parseInt(window.getComputedStyle(swiperObj.wrapperEl).transform.split(',')[4]));
return {
slideLength: slideLength,
slideWidth: slideWidth,
slideMargin: slideMargin,
slideSize: slideSize,
maxMoveSize: maxMoveSize,
viewWidth: viewWidth,
viewLength: viewLength,
lastBeforeSize: lastBeforeSize,
isMoveSize: isMoveSize
}
},
initDimmedSlides: function(swiperObj) {
for (let i = 0; i < swiperObj.slides.length; i++) {
let isSlide = swiperObj.slides[i];
if ((swiperObj.activeIndex + eventList.getCarouselSizeInfo(swiperObj).viewLength) <= i) {
isSlide.classList.add(dimmedClass);
utils.onAccessibility(isSlide)
}
}
},
setDimmedSlide: function(swiperObj) {
if (currDevice != 'mobile') {
for (let i = 0; i < swiperObj.slides.length; i++) {
let isSlide = swiperObj.slides[i];
let dimmedSlide = (swiperObj.activeIndex) > i || (swiperObj.activeIndex + (eventList.getCarouselSizeInfo(swiperObj).viewLength - 1)) < i;
if (dimmedSlide) {
isSlide.classList.add(dimmedClass);
utils.onAccessibility(isSlide)
} else {
isSlide.classList.remove(dimmedClass);
utils.offAccessibility(isSlide)
}
}
}
},
resetDimmedSlide: function(swiperObj) {
if (!!!swiperObj) return;
for (let i = 0; i < swiperObj.slides.length; i++) {
swiperObj.slides[i].classList.remove(dimmedClass);
}
},
tagging: function () {
const values = {
'data-omni-type': 'microsite_pcontentinter',
'data-omni': 'galaxy-z-fold6:highlights:indicator:sldr-dots:',
'ga-ca': 'indication',
'ga-ac': 'carousel',
'ga-la': 'galaxy-z-fold6:highlights:indicator:sldr-dots:',
};
}
};
const swiperEvents = {
set: function () {
for (let i = 0; i < els.section.length; i++) {
if (els.section[i].swiper == null) {
new Swiper(els.section[i].swiperContainer, {
init: false,
slidesPerView: 'auto',
speed: 200,
navigation: {
nextEl: els.section[i].nextArrow,
prevEl: els.section[i].prevArrow,
},
scrollbar: {
el: els.section[i].scrollbar,
draggable: true
}
});
}
}
},
init: function () {
let isNextArrow = this.el.parentElement.querySelector('.swiper-button-next');
let isPrevArrow = this.el.parentElement.querySelector('.swiper-button-prev');
isNextArrow.removeAttribute('aria-label');
isNextArrow.removeAttribute('role');
isPrevArrow.removeAttribute('aria-label');
isPrevArrow.removeAttribute('role');
eventList.tagging();
if (currDevice != 'mobile') {
eventList.initDimmedSlides(this);
} else {
// accessibility.slide(this);
};
},
transitionEnd: function() {
let carouselInfo = eventList.getCarouselSizeInfo(this);
if (currDevice == 'mobile' || currDevice == 'tablet') return;
if (carouselInfo.viewLength < 3) return;
setTimeout(() => {
let lastIndex = this.slides.length -1 ;
let lastSlide = this.slides[lastIndex];
let lsatDimmedLength = (carouselInfo.slideLength - 1) - carouselInfo.viewLength;
let lastBeforeSlide = this.slides[lsatDimmedLength];
if (carouselInfo.isMoveSize > carouselInfo.lastBeforeSize && carouselInfo.maxMoveSize >= carouselInfo.isMoveSize) {
lastSlide.classList.add('is-last-slide');
lastBeforeSlide.classList.add('is-dimmed');
lastSlide.classList.remove('is-dimmed');
} else if (lastSlide.classList.contains('is-last-slide') && carouselInfo.lastBeforeSize == carouselInfo.isMoveSize) {
lastSlide.classList.add('is-dimmed');
lastSlide.classList.remove('is-last-slide');
lastBeforeSlide.classList.remove('is-dimmed');
}
}, 0);
},
slideChange: function () {
eventList.setDimmedSlide(this);
// if (currDevice == 'mobile') accessibility.slide(this);
},
destroy: function (swiperObj) {
swiperObj.navigation.destroy(true);
swiperObj.destroy(true);
swiperObj = null;
},
};
// const accessibility = {
// slide: function (swiper) {
// for (let i = 0; i < swiper.slides.length; i++) {
// if (i != swiper.activeIndex) {
// utils.onAccessibility(swiper.slides[i]);
// } else {
// utils.offAccessibility(swiper.slides[i]);
// }
// }
// },
// reset: function(swiper) {
// for (let i = 0; i < swiper.slides.length; i++) {
// utils.offAccessibility(swiper.slides[i]);
// }
// }
// };
return {
init: init
}
})();
})();
(function () {
window.flagship.features.flexWindow = (function () {
const utils = window.flagship.common.utils;
const resize = window.flagship.common.resize;
let els = {};
let oldIndex = 0;
let swiperObj = {};
let pointerOffset = {};
let currDevice = resize.checkResolution();
let videoPlayStatus = false;
let lowNetwork = document.documentElement.classList.contains('low_network');
const init = function () {
els.section = document.querySelector('.features-flex-window');
if (!!els.section) {
setElements();
bindEvents();
}
};
const setElements = function () {
els.carouselWrap = els.section.querySelector('.features-flex-window__carousel');
els.carouselInner = els.section.querySelector('.features-flex-window__carousel-inner');
els.swiperContainer = els.section.querySelector('.swiper-container');
els.nextArrow = els.section.querySelector('.swiper-button-next');
els.prevArrow = els.section.querySelector('.swiper-button-prev');
els.autoSlideController = els.section.querySelector('.features-flex-window__carousel-button');
els.blind = els.autoSlideController.querySelector('.blind');
els.videos;
els.realCarouselSlides;
};
const setProperty = function () {
for (let i = 0; i < els.realCarouselSlides.length; i++) {
let isSlide = els.realCarouselSlides[i];
let isVideoWrap = els.realCarouselSlides[i].querySelector('.common-video');
if (!!isVideoWrap) {
isSlide.videoWrap = isVideoWrap;
isSlide.videoWrap.video = isVideoWrap.querySelector('.common-video__video');
isSlide.video = isVideoWrap.querySelector('.common-video__video');
isSlide.videoWrap.controller = isVideoWrap.querySelector('.js-video-control');
isSlide.videoWrap.controller.video = isVideoWrap.querySelector('.common-video__video');
}
}
};
const bindEvents = function () {
eventList.load();
eventHandler.scroll();
// eventHandler.autoSlideController();
};
const eventHandler = {
scroll: function() {
window.addEventListener('scroll', eventList.scroll)
},
transitionend: function() {
els.carouselInner.addEventListener('animationend', eventList.transitionend, {once: true})
},
flickSwiper: function() {
els.carouselWrap.addEventListener('touchstart', function(e) {
pointerOffset.start = null;
pointerOffset.current = null;
pointerOffset.start = e.touches[0].clientX;
els.carouselWrap.addEventListener('touchmove', eventList.getPointerMoveSize);
});
els.carouselWrap.addEventListener('touchend', function() {
if (pointerOffset.start == null) return;
eventList.flickSwiper();
els.carouselWrap.removeEventListener('touchmove', eventList.getPointerMoveSize);
});
els.carouselWrap.addEventListener('mousedown', function(e) {
pointerOffset.start = null;
pointerOffset.current = null;
pointerOffset.start = e.offsetX;
els.carouselWrap.addEventListener('mousemove', eventList.getPointerMoveSize);
});
els.carouselWrap.addEventListener('mouseup', function() {
eventList.flickSwiper();
els.carouselWrap.removeEventListener('mousemove', eventList.getPointerMoveSize);
});
els.carouselWrap.addEventListener('mouseleave', function() {
if (pointerOffset.start == null) return;
pointerOffset.start = null;
pointerOffset.current = null;
els.carouselWrap.removeEventListener('mousemove', eventList.getPointerMoveSize);
});
},
click: function () {
for (let i = 0; i < els.realCarouselSlides.length; i++) {
let isVideoWrap = els.realCarouselSlides[i].videoWrap;
if (!!isVideoWrap) {
els.realCarouselSlides[i].videoWrap.controller.addEventListener('click', eventList.clickVideoCta);
}
}
},
// autoSlideController: function() {
// els.autoSlideController.addEventListener('click', eventList.autoSlideController);
// }
};
const eventList = {
load: function() {
swiperEvent.set();
swiperObj.thumb.init();
eventList.setScene();
eventList.scroll();
els.blind.innerText = LOCAL_VARI.play;
},
setVideo: function() {
els.realCarouselSlides = els.swiperContainer.querySelectorAll('.swiper-slide');
els.videos = els.swiperContainer.querySelectorAll('.common-video__video');
setProperty();
eventHandler.click();
for (let i = 0; i < els.realCarouselSlides.length; i++) {
let isVideoWrap = els.realCarouselSlides[i].videoWrap;
if (!!isVideoWrap) {
if (!isVideoWrap.classList.contains('is-loaded')) isVideoWrap.classList.add('is-loaded');
utils.videoHandler({
playType: 'scrollPlay',
wrap: isVideoWrap,
video: isVideoWrap.video,
controller: isVideoWrap.controller,
resetCallback: function () {
if (this.wrap.classList.contains('is-completed')) {
this.wrap.classList.remove('is-completed');
}
if (this.wrap.classList.contains('is-started')) {
this.wrap.classList.remove('is-started');
}
},
playCallback: function () {
if (!this.wrap.classList.contains('is-started')) {
this.wrap.classList.add('is-started');
}
setTagging.pause(this.controller);
},
pauseCallback: function () {
setTagging.play(this.controller);
},
endCallback: function () {
if (!this.wrap.classList.contains('is-completed')) {
this.wrap.classList.add('is-completed');
}
}
});
}
}
},
playVideo: function(videoWrap) {
let isVideo = videoWrap.video;
if (isVideo.readyState >= 4) {
isVideo.play();
} else {
isVideo.load();
isVideo.addEventListener('canplay', function() {
isVideo.play();
}, {once: true});
}
},
resetVideo: function() {
if (!!!els.realCarouselSlides) return;
for (let i = 0; i < els.realCarouselSlides.length; i++) {
let isVideo = els.realCarouselSlides[i].video;
if (!!isVideo && !isVideo.paused) {
isVideo.pause();
isVideo.currentTime = 0;
};
};
},
clickVideoCta: function (e) {
if (e.target == e.currentTarget) {
if (e.currentTarget.video.paused) {
e.currentTarget.video.play();
} else {
e.currentTarget.video.pause();
}
}
},
setScene: function() {
SCROLLER({
trackElement: els.swiperContainer,
resize: true
})
},
// autoSlideController: function() {
// let taggingValue = this.getAttribute('data-omni');
// if (this.classList.contains('is-playing')) {
// this.classList.remove('is-playing');
// this.classList.add('is-paused');
// this.setAttribute('data-omni', taggingValue.replace('play', 'pause'));
// this.setAttribute('ga-la', taggingValue.replace('play', 'pause'));
// els.blind.innerText = LOCAL_VARI.pause;
// } else {
// this.classList.remove('is-paused');
// this.classList.add('is-playing');
// this.setAttribute('data-omni', taggingValue.replace('pause', 'play'));
// this.setAttribute('ga-la', taggingValue.replace('pause', 'play'));
// els.blind.innerText = LOCAL_VARI.play;
// }
// },
resetScroll: function() {
swiperEvent.destroy(swiperObj.thumb);
swiperEvent.set();
swiperObj.thumb.init();
for (let i = 0; i < swiperObj.thumb.slides.length; i++) {
let isVideo = swiperObj.thumb.slides[i].querySelector('.common-video');
if (!!isVideo) {
isVideo.classList.remove('is-playing');
isVideo.classList.remove('is-paused');
isVideo.classList.remove('is-ended');
isVideo.classList.remove('is-loaded');
isVideo.classList.remove('is-completed');
}
}
els.carouselInner.classList.remove('is-animate-start');
els.autoSlideController.classList.add('is-ended');
els.autoSlideController.classList.remove('is-playing');
els.autoSlideController.classList.remove('is-paused');
},
scroll: function() {
els.swiperContainer.scroller.trackAnimation(function() {
let clsaaStatus = els.carouselInner.classList.contains('is-animate-start');
let activeStatus = this.progress > 20 && !clsaaStatus;
let resetStatus = this.wheelDirection == 'up' && this.progress <= 0 && clsaaStatus;
let isActiveVideo = swiperObj.thumb.slides[swiperObj.thumb.activeIndex].querySelector('video');
if (resetStatus) {
eventList.resetScroll();
};
if (activeStatus) {
videoPlayStatus = false;
els.carouselInner.classList.add('is-animate-start');
els.autoSlideController.classList.add('is-ended');
els.autoSlideController.classList.remove('is-playing');
eventHandler.transitionend();
};
for (let i = 0; i < els.videos.length; i++) {
if (!lowNetwork && videoPlayStatus && !!isActiveVideo) isActiveVideo.videoHandler.scrollActive(this.progress);
}
});
},
// transitionend: function() {
// videoPlayStatus = true;
// els.autoSlideController.classList.remove('is-playing');
// els.autoSlideController.classList.add('is-ended');
// setTimeout(function() {
// let isActiveVideo = swiperObj.thumb.slides[swiperObj.thumb.activeIndex].querySelector('video');
// if (!!isActiveVideo) {
// isActiveVideo.currentTime = 0;
// // isActiveVideo.play();
// }
// }, 600);
// },
getPointerMoveSize: function(e) {
if (!!e.touches) {
pointerOffset.current = e.touches[0].clientX;
} else {
pointerOffset.current = e.offsetX;
}
},
};
const swiperEvent = {
set: function() {
swiperObj.thumb = new Swiper(els.swiperContainer, {
init: false,
loop: true,
centeredSlides: true,
slidesPerView: 'auto',
navigation: {
nextEl: els.nextArrow,
prevEl: els.prevArrow
},
});
swiperObj.thumb.on('transitionEnd', swiperEvent.transitionEnd);
swiperObj.thumb.on('init', swiperEvent.init);
},
init: function() {
els.nextArrow.removeAttribute('aria-label');
els.nextArrow.removeAttribute('role');
els.prevArrow.removeAttribute('aria-label');
els.prevArrow.removeAttribute('role');
accessibility.slide(this);
eventList.setVideo();
},
transitionEnd: function() {
let isActiveSlide = els.swiperContainer.querySelector('.swiper-slide-active');
let isVideoWrap = isActiveSlide.videoWrap;
accessibility.slide(this);
eventList.resetVideo();
if (!lowNetwork && !!isVideoWrap) eventList.playVideo(isVideoWrap);
},
destroy: function (swiper) {
swiper.navigation.destroy(true);
swiper.destroy(true);
},
}
const accessibility = {
slide: function (swiper) {
for (let i = 0; i < swiper.slides.length; i++) {
if (i != swiper.activeIndex) {
utils.onAccessibility(swiper.slides[i]);
} else {
utils.offAccessibility(swiper.slides[i]);
}
}
}
};
// const setTagging = {
// play: function (targetController) {
// if (targetController.hasAttribute('data-omni')) {
// let dataOmni = targetController.getAttribute('data-omni').toLowerCase();
// targetController.setAttribute('data-omni', dataOmni.replace('pause', 'play'));
// }
// if (targetController.hasAttribute('ga-la')) {
// let gaLa = targetController.getAttribute('ga-la').toLowerCase();
// targetController.setAttribute('ga-la', gaLa.replace('pause', 'play'));
// }
// },
// pause: function (targetController) {
// if (targetController.hasAttribute('data-omni')) {
// let dataOmni = targetController.getAttribute('data-omni').toLowerCase();
// targetController.setAttribute('data-omni', dataOmni.replace('play', 'pause'));
// }
// if (targetController.hasAttribute('ga-la')) {
// let gaLa = targetController.getAttribute('ga-la').toLowerCase();
// targetController.setAttribute('ga-la', gaLa.replace('play', 'pause'));
// }
// }
// };
return {
init: init
}
})();
})();
(function () {
window.flagship.features.aiOverview = (function () {
const utils = window.flagship.common.utils,
resize = flagship.common.resize;
let els = {};
let currDevice = resize.checkResolution();
let isLoaded = false;
const init = function () {
els.section = document.querySelector('.features-ai-overview');
if (!!els.section) {
setElements();
bindEvents();
}
};
const setElements = function () {
// fixed
// els.fixedTrack = els.section.querySelector('.js-fixed-track');
// els.fixedInner = els.section.querySelector('.js-fixed-inner');
// title
els.overviewTextWrap = els.section.querySelector('.js-overview-text-wrap');
els.overviewTopText = els.section.querySelector('.js-overview-top-text');
els.overviewMiddleTextPc = els.section.querySelector('.js-overview-middle-text-pc');
els.overviewMiddleTextMo = els.section.querySelector('.js-overview-middle-text-mo');
els.overviewBottomTextPc = els.section.querySelector('.js-overview-bottom-text-pc');
els.overviewBottomTextMo = els.section.querySelector('.js-overview-bottom-text-mo');
// introLogoVideo
els.introLogoWrap = els.section.querySelector('.js-intro-logo-wrap');
els.introLogoVideoWrap = els.section.querySelector('.js-intro-logo-video-wrap');
els.introLogoVideoWrap.video = els.introLogoVideoWrap.querySelector('video');
els.introLogoVideoWrap.coverImg = els.introLogoVideoWrap.querySelector('.js-intro-logo-cover-image');
// logoVideo
els.logoWrap = els.section.querySelector('.js-logo-wrap');
els.logoVideoWrap = els.section.querySelector('.js-logo-video-wrap');
els.logoVideoWrap.video = els.logoVideoWrap.querySelector('video');
els.logoVideoWrap.coverImg = els.logoVideoWrap.querySelector('.js-logo-cover-image');
// dimmed
els.dimmed = els.section.querySelector('.js-dimmed');
};
const bindEvents = function () {
eventHandler.load();
resize.add(eventHandler.resize);
};
const eventHandler = {
load: function () {
eventList.checkBrokenFixed();
if (document.documentElement.classList.contains('is-ai-broken-fixed') || document.documentElement.classList.contains('low_network')) {
window.addEventListener('DOMContentLoaded', eventList.setStaticContents, {once:true});
} else {
window.addEventListener('DOMContentLoaded', function () {
eventList.setVideoHandler();
eventList.fixedScroller.set();
}, {once : true});
window.addEventListener('scroll', eventList.setScroll);
eventList.setScroll();
}
window.addEventListener('orientationchange', eventHandler.orientationchange);
},
resize: function (currRes) {
currDevice = currRes;
eventList.setContents();
},
orientationchange: function () {
setTimeout(function () {
eventList.setContents();
}, 150);
}
};
const eventList = {
mediaLoader: function () {
let scrollTop = window.pageYOffset,
kv = document.querySelector('.features-kv'),
kvTop = scrollTop + kv.getBoundingClientRect().top;
if ((scrollTop > kvTop) && !isLoaded) {
if (!els.introLogoVideoWrap.coverImg.classList.contains('is-img-load-complete')) {
imageLoader.setResponsiveMedia([els.introLogoVideoWrap.coverImg]);
}
if (!els.introLogoVideoWrap.video.classList.contains('is-mp4video-load-complete')) {
mp4VideoLoader.setResponsiveMedia([els.introLogoVideoWrap.video]);
}
if (!els.logoVideoWrap.coverImg.classList.contains('is-img-load-complete')) {
imageLoader.setResponsiveMedia([els.logoVideoWrap.coverImg]);
}
if (!els.logoVideoWrap.video.classList.contains('is-mp4video-load-complete')) {
mp4VideoLoader.setResponsiveMedia([els.logoVideoWrap.video]);
}
isLoaded = true;
}
},
setVideoHandler: function () {
utils.videoHandler({
wrap: els.introLogoVideoWrap,
video: els.introLogoVideoWrap.video
});
utils.videoHandler({
wrap: els.logoVideoWrap,
video: els.logoVideoWrap.video
});
},
// fixedScroller: {
// set: function () {
// if (els.fixedTrack.scene == null) {
// els.fixedTrack.scene = SCROLLER({
// trackElement: els.fixedTrack,
// fixedElement: els.fixedInner,
// useFixed: true,
// useFixedStlye: false,
// useStrictMode: false,
// trackHeight: 2,
// resize: (utils.detector.isTouchDevice) ? false : true
// });
// }
// },
// destroy: function () {
// if (els.fixedTrack.scene != null) {
// els.fixedTrack.scene.destroy(true, true);
// els.fixedTrack.scene = null;
// els.fixedTrack.style = '';
// }
// },
// play: function () {
// if (els.fixedTrack.scene != null) {
// els.fixedTrack.scene.trackAnimation(function () {
// let progress = this.progress;
// let isMobile = currDevice.indexOf('mobile') > -1;
// introLogoHideValue = utils.calRange({
// targetValue: 1,
// progress: progress,
// startPoint: 35,
// endPoint: 45
// }),
// introLogoScaleValue = utils.calRange({
// targetValue: 0.5,
// progress: progress,
// startPoint: 35,
// endPoint: 45
// }),
// textWrapShowValue = utils.calRange({
// targetValue: 1,
// progress: progress,
// startPoint: 43,
// endPoint: 48
// }),
// topMiddleTextShowValue = utils.calRange({
// targetValue: 1,
// progress: progress,
// startPoint: 38,
// endPoint: 45
// }),
// logoShowValue = utils.calRange({
// targetValue: 1,
// progress: progress,
// startPoint: 40,
// endPoint: 46
// }),
// bottomTextShowValue = utils.calRange({
// targetValue: 1,
// progress: progress,
// startPoint: 50,
// endPoint: 55
// }),
// bottomTextTopValue = utils.calRange({
// targetValue: 50,
// progress: progress,
// startPoint: 52,
// endPoint: 60
// });
// // introLogoVideo
// if (progress < -36) {
// if (!els.introLogoVideoWrap.video.paused) {
// if (els.introLogoWrap.classList.contains('is-visible')) {
// els.introLogoWrap.classList.remove('is-visible');
// }
// els.introLogoVideoWrap.video.pause();
// els.introLogoVideoWrap.video.currentTime = 0;
// }
// }
// if (progress > -20) {
// if (els.introLogoVideoWrap.video.paused) {
// if (!els.introLogoWrap.classList.contains('is-visible')) {
// els.introLogoWrap.classList.add('is-visible');
// }
// els.introLogoVideoWrap.video.play();
// }
// }
// if (progress >= 0 && progress <= 100) {
// if (progress > 30) {
// TweenMax.to(els.introLogoWrap, 0.5, {
// opacity: 1 - introLogoHideValue,
// scale: 1 - introLogoScaleValue,
// ease: 'cubic-bezier(0, 0.25, 0, 1.06)'
// });
// } else {
// els.introLogoWrap.style.opacity = 1;
// }
// // text
// TweenMax.to(els.overviewTextWrap, 0.1, {
// opacity: textWrapShowValue
// });
// TweenMax.to(els.overviewTopText, 0.1, {
// opacity: topMiddleTextShowValue
// });
// if (isMobile) {
// TweenMax.to(els.overviewMiddleTextMo, 0.1, {
// opacity: topMiddleTextShowValue
// });
// } else {
// TweenMax.to(els.overviewMiddleTextPc, 0.1, {
// opacity: topMiddleTextShowValue
// });
// }
// TweenMax.to(els.logoWrap, 0.1, {
// opacity: logoShowValue
// });
// if (progress > 45) {
// if (els.logoVideoWrap.video.paused) {
// if (!els.logoWrap.classList.contains('is-visible')) {
// els.logoWrap.classList.add('is-visible');
// }
// els.logoVideoWrap.video.play();
// }
// } else {
// if (!els.logoVideoWrap.video.paused) {
// if (els.logoWrap.classList.contains('is-visible')) {
// els.logoWrap.classList.remove('is-visible');
// }
// els.logoVideoWrap.video.pause();
// els.logoVideoWrap.video.currentTime = 0;
// }
// }
// // dimmed
// if (progress > 45) {
// if (!els.dimmed.classList.contains('is-active')) {
// els.dimmed.classList.add('is-active')
// }
// } else {
// if (els.dimmed.classList.contains('is-active')) {
// els.dimmed.classList.remove('is-active')
// }
// }
// if (isMobile) {
// TweenMax.to(els.overviewBottomTextMo, 0.3, {
// opacity: bottomTextShowValue,
// y: 50 - bottomTextTopValue + '%',
// ease: 'cubic-bezier(0, 0.25, 0, 1.06)'
// });
// } else {
// TweenMax.to(els.overviewBottomTextPc, 0.3, {
// opacity: bottomTextShowValue,
// y: 50 - bottomTextTopValue + '%',
// ease: 'cubic-bezier(0, 0.25, 0, 1.06)'
// });
// }
// }
// });
// }
// },
// },
checkBrokenFixed: function () {
let winWidth = window.innerWidth,
winHeight = window.innerHeight;
document.documentElement.classList.remove('is-ai-broken-fixed');
if (winWidth > 1440 && winHeight <= 720) {
document.documentElement.classList.add('is-ai-broken-fixed');
} else if (winWidth <= 1440 && (winHeight / winWidth) < 0.5277) {
document.documentElement.classList.add('is-ai-broken-fixed');
} else {
document.documentElement.classList.remove('is-ai-broken-fixed');
}
},
setStaticContents: function () {
els.section.classList.add('none-fixed');
},
setFixedContents: function () {
if (els.section.classList.contains('none-fixed')) {
els.section.classList.remove('none-fixed');
}
window.addEventListener('scroll', eventList.setScroll);
eventList.setVideoHandler();
eventList.fixedScroller.set();
},
setContents: function () {
eventList.checkBrokenFixed();
if (document.documentElement.classList.contains('is-ai-broken-fixed') || document.documentElement.classList.contains('low_network')) {
eventList.fixedScroller.destroy();
eventList.setStaticContents();
window.removeEventListener('scroll', eventList.setScroll);
} else {
eventList.setFixedContents();
}
},
setScroll: function () {
eventList.mediaLoader();
eventList.fixedScroller.play();
},
};
return {
init: init
}
})();
})();
;
(function () {
window.flagship.features.cameraSpec = (function () {
const utils = window.flagship.common.utils,
resize = window.flagship.common.resize;
let els = {},
prevDevice = null,
currDevice = resize.checkResolution();
const init = function () {
els.section = document.querySelector('.features-camera-spec');
if (!!els.section) {
setElements();
bindEvents();
}
};
const setElements = function () {
els.listInner = els.section.querySelectorAll('.js-camera-spec-inner');
};
const bindEvents = function () {
resize.add(eventList.resize);
eventList.load();
eventList.showCollout();
eventHandler.scroll();
};
const eventHandler = {
scroll: function() {
window.addEventListener('scroll', eventList.showCollout);
}
}
const eventList = {
load: function() {
eventList.setSecene();
},
resize: function (currRes) {
currDevice = currRes;
if (currDevice != prevDevice) {
prevDevice = currDevice;
}
},
setSecene: function () {
for (let i = 0; i < els.listInner.length; i++) {
SCROLLER({
trackElement: els.listInner[i],
useFixed: false
});
}
},
showCollout: function() {
for (let i = 0; i < els.listInner.length; i++) {
els.listInner[i].scroller.trackAnimation(function() {
if (this.progress > 0) {
this.trackElement.classList.add('is-active');
}
if (i == 0) {
if (this.progress <= 0) {
for (let j = 0; j < els.listInner.length; j++) {
els.listInner[j].classList.remove('is-active');
}
}
}
});
}
}
};
return {
init: init
}
})();
})();
(function () {
window.flagship.features.colorchip = function (colorchipWrap) {
const utils = window.flagship.common.utils,
common = window.flagship.features.common,
resize = window.flagship.common.resize;
let els = {},
activeClass = 'is-active',
currentDevice = resize.checkResolution(),
prevDevice = null,
currentSlidesPerView = currentDevice.indexOf('mobile') > -1 ? 5 : 7;
const init = function () {
els.section = document.querySelector('.js-colors');
els.popup = document.querySelector('.js-viewer');
if (colorchipWrap.type == 'popup') {
colorchipWrap.contentWrap = els.popup;
} else {
colorchipWrap.contentWrap = els.section;
}
setElements();
setProperty();
bindEvents();
};
const setElements = function () {
// panel
// els.panelWrap = els.section.querySelector('.js-panel-wrap');
// els.panelItems = els.panelWrap.querySelectorAll('.js-panel-item');
// colorchip
els.swiperContainer = colorchipWrap.querySelector('.js-colorchip-container');
els.colorchipButtons = colorchipWrap.querySelectorAll('.js-colorchip-button');
els.swiperArrowWrap = colorchipWrap.querySelector('.js-arrow-wrap');
els.swiperNextArrow = colorchipWrap.querySelector('.js-colorchip-next');
els.swiperPrevArrow = colorchipWrap.querySelector('.js-colorchip-prev');
els.colorchipNames = colorchipWrap.querySelectorAll('.js-colorchip-name');
// 360 Popup Btn
// els.viewerBtn = els.section.querySelector('.viewer-btn');
// viewer
// els.viewerSection = els.section.querySelector('.js-colors-viewer');
els.viewerIframe = colorchipWrap.contentWrap.querySelector('iframe');
// exclusive badge
els.exclusive = colorchipWrap.contentWrap.querySelector('.js-exclusive-badge');
};
const setProperty = function () {
for (let i = 0; i < els.colorchipButtons.length; i++) {
els.colorchipButtons[i].index = i;
}
};
const bindEvents = function () {
eventList.checkColorchipSwiper();
if (colorchipWrap.type != 'popup') eventList.setColors(0);
eventHandler.click();
eventHandler.keydown();
resize.add(eventList.resize);
eventHandler.scroll();
};
const eventHandler = {
click: function () {
for (let i = 0; i < els.colorchipButtons.length; i++) {
els.colorchipButtons[i].addEventListener('click', eventList.clickColorchip);
}
// els.viewerBtn.addEventListener('click', function () {
// let activeIndex = this.getAttribute('data-target-index');
// eventList.setColorchip(activeIndex);
// eventList.setColorName(activeIndex);
// eventList.setExclusive(activeIndex);
// });
els.swiperNextArrow.addEventListener('click', accessibility.clickArrow);
els.swiperPrevArrow.addEventListener('click', accessibility.clickArrow);
},
keydown: function () {
els.swiperNextArrow.addEventListener('keydown', accessibility.clickArrow);
els.swiperPrevArrow.addEventListener('keydown', accessibility.clickArrow);
},
scroll: function () {
window.addEventListener('scroll', eventList.scroll);
}
};
const eventList = {
scroll: function () {
let winOffsetBottom = window.pageYOffset + window.innerHeight,
kv = document.querySelector('.features-kv'),
kvHeight = kv.getBoundingClientRect().height + utils.getNavHeight();
if (winOffsetBottom >= kvHeight) {
// bg load
colorchipWrap.bgImgs = colorchipWrap.querySelectorAll('.js-bg-img');
if(!!colorchipWrap.bgImgs) bgLoader.setResponsiveMedia(colorchipWrap.bgImgs);
eventList.setViewer();
window.removeEventListener('scroll', eventList.scroll);
}
},
setViewer: function () {
if (!utils.isLowNetwork()) {
setTimeout(function () {
els.viewerIframe.style.position = 'fixed';
els.viewerIframe.style.top = 0;
els.viewerIframe.style.opacity = 0;
setTimeout(function () {
els.viewerIframe.style.position = '';
els.viewerIframe.style.top = '';
els.viewerIframe.style.opacity = '';
}, 300);
}, 1000);
// set
eventList.setViewerUrl(els.colorchipButtons[0].getAttribute('data-colors'));
}
},
checkColorchipSwiper: function () {
let colorchipSwiperLength = currentDevice.indexOf('mobile') > -1 ? 6 : 8;
if (els.colorchipButtons.length >= colorchipSwiperLength) {
if (els.swiperArrowWrap.style.display == 'none') {
els.swiperArrowWrap.style.display = '';
}
swiperEvents.set();
} else {
if (els.swiperArrowWrap.style.display != 'none') {
els.swiperArrowWrap.style.display = 'none';
}
if (els.colorchipSwiper != null) {
swiperEvents.destroy();
}
}
},
setColors: function (activeIndex) {
eventList.setPopupBtn(els.colorchipButtons[activeIndex]);
eventList.setColorchip(activeIndex);
eventList.setPanel(activeIndex);
eventList.setColorName(activeIndex);
eventList.setExclusive(activeIndex);
},
resize: function (currRes) {
currentDevice = currRes;
if (currentDevice !== prevDevice) {
eventList.checkColorchipSwiper();
currentSlidesPerView = currentDevice.indexOf('mobile') > -1 ? 5 : 7;
prevDevice = currentDevice;
}
},
clickColorchip: function () {
let targetColor = this;
eventList.setColors(targetColor.index);
eventList.setViewerUrl(targetColor.getAttribute('data-colors'));
},
setColorchip: function (activeIndex) {
let targetcolorchipButton = els.colorchipButtons[activeIndex];
for (let i = 0; i < els.colorchipButtons.length; i++) {
els.colorchipButtons[i].classList.remove(activeClass);
if (!!colorchipWrap.isStatic) {
els.colorchipButtons[i].setAttribute('aria-selected', false);
} else {
els.colorchipButtons[i].removeAttribute('title');
}
}
if (!targetcolorchipButton.classList.contains(activeClass)) {
targetcolorchipButton.classList.add(activeClass);
if (!!colorchipWrap.isStatic) {
targetcolorchipButton.setAttribute('aria-selected', true);
} else {
accessibility.selected(targetcolorchipButton);
}
}
},
setPanel: function (activeIndex) {
if (!colorchipWrap.isStatic) return;
// for (let i = 0; i < els.panelItems.length; i++) {
// if (els.panelItems[i].classList.contains(activeClass)) {
// els.panelItems[i].classList.remove(activeClass);
// els.panelItems[i].setAttribute('aria-hidden', true);
// }
// }
// if (!els.panelItems[activeIndex].classList.contains(activeClass)) {
// els.panelItems[activeIndex].classList.add(activeClass);
// els.panelItems[activeIndex].setAttribute('aria-hidden', false);
// }
},
setColorName: function (activeIndex) {
for (let i = 0; i < els.colorchipNames.length; i++) {
if (els.colorchipNames[i].classList.contains(activeClass)) {
els.colorchipNames[i].classList.remove(activeClass);
els.colorchipNames[i].setAttribute('aria-hidden', true);
}
}
if (!els.colorchipNames[activeIndex].classList.contains(activeClass)) {
els.colorchipNames[activeIndex].classList.add(activeClass);
els.colorchipNames[activeIndex].setAttribute('aria-hidden', false);
}
},
setViewerUrl: function (colorName) {
if (!!colorchipWrap.isStatic) return;
if (colorchipWrap.type == 'popup') {
let viewerSrc = els.viewerIframe.getAttribute('src').split('#color=')[0];
els.viewerIframe.setAttribute('src', `${viewerSrc}#color=${colorName}`);
} else {
// els.viewerSection.setAttribute('data-model-color', colorName);
els.viewerIframe.setAttribute('src', common.getViewerUrl());
}
},
setPopupBtn: function (target) {
if (colorchipWrap.type == 'popup') return;
// els.viewerBtn.setAttribute('data-target-index', target.index);
// els.viewerBtn.setAttribute('data-model-color', target.getAttribute('aria-controls'));
},
setExclusive: function (activeIndex) {
if (!!els.colorchipButtons[activeIndex].getAttribute('data-exclusive')) {
els.exclusive.classList.add('is-active');
} else {
els.exclusive.classList.remove('is-active');
}
}
};
const swiperEvents = {
set: function () {
if (els.colorchipSwiper == null) {
els.colorchipSwiper = new Swiper(els.swiperContainer, {
init: false,
navigation: {
nextEl: els.swiperNextArrow,
prevEl: els.swiperPrevArrow,
},
slidesPerView: currentSlidesPerView,
speed: 300,
});
els.colorchipSwiper.on('init', swiperEvents.init);
els.colorchipSwiper.on('slideChange', swiperEvents.slideChange);
els.colorchipSwiper.init();
}
},
init: function () {
let notification = this.el.querySelector('.swiper-notification');
if (!!notification) this.el.removeChild(notification);
els.swiperPrevArrow.removeAttribute('aria-label');
els.swiperPrevArrow.removeAttribute('role');
els.swiperNextArrow.removeAttribute('aria-label');
els.swiperNextArrow.removeAttribute('role');
accessibility.colorchip(els.colorchipSwiper);
},
slideChange: function () {
accessibility.colorchip(els.colorchipSwiper);
},
destroy: function () {
els.colorchipSwiper.destroy(true);
els.colorchipSwiper = null;
},
};
const accessibility = {
clickArrow: function (e) {
let arrowTimeout = null,
arrowStyleTimeout = null;
if ((e.type == 'keydown' && e.keyCode == 13) || e.type == 'click') {
e.preventDefault();
if (els.colorchipSwiper.isBeginning && !els.colorchipSwiper.isEnd) {
els.swiperPrevArrow.style.setProperty('display', 'block');
clearTimeout(arrowTimeout);
arrowTimeout = setTimeout(function () {
els.swiperNextArrow.focus();
}, 300);
clearTimeout(arrowStyleTimeout);
arrowStyleTimeout = setTimeout(function () {
els.swiperPrevArrow.style.display = '';
}, 400);
} else if (!els.colorchipSwiper.isBeginning && els.colorchipSwiper.isEnd) {
els.swiperNextArrow.style.setProperty('display', 'block');
clearTimeout(arrowTimeout);
arrowTimeout = setTimeout(function () {
els.swiperPrevArrow.focus();
}, 300);
clearTimeout(arrowStyleTimeout);
arrowStyleTimeout = setTimeout(function () {
els.swiperNextArrow.style.display = '';
}, 400);
}
}
},
colorchip: function (swiperObj) {
let isNotActivedColorchips = null;
for (let i = 0; i < swiperObj.slides.length; i++) {
if (currentDevice.indexOf('mobile') > -1) {
isNotActivedColorchips = (i != swiperObj.activeIndex) && (i > swiperObj.activeIndex + 4) || (swiperObj.activeIndex > i);
} else {
isNotActivedColorchips = (i != swiperObj.activeIndex) && (i > swiperObj.activeIndex + 6) || (swiperObj.activeIndex > i);
}
if (isNotActivedColorchips) {
utils.onAccessibility(swiperObj.slides[i]);
setTimeout(function () {
utils.onAccessibility(swiperObj.slides[i]);
}, 300);
} else {
utils.offAccessibility(swiperObj.slides[i]);
setTimeout(function () {
utils.offAccessibility(swiperObj.slides[i]);
}, 300);
}
}
},
selected: function (target) {
if (typeof LOCAL_VARI != 'undefined' && !!LOCAL_VARI) {
target.setAttribute('title', LOCAL_VARI.selected);
} else {
target.setAttribute('title', 'Selected');
}
}
};
return init(colorchipWrap);
};
let colorchips = document.querySelectorAll('.js-colorchip');
for (let i = 0; i < colorchips.length; i++) {
colorchips[i].type = colorchips[i].parentElement.classList.contains('js-popup-colorchip') ? 'popup' : 'colors';
colorchips[i].isStatic = colorchips[i].parentElement.getAttribute('data-static');
// flagship.features.colorchip(colorchips[i]);
}
})();
;
(function () {
window.flagship.features.faq = (function () {
const resize = window.flagship.common.resize,
utils = window.flagship.common.utils;
let els = {},
prevDevice = null,
currDevice = resize.checkResolution();
const init = function () {
els.section = document.querySelector('.js-faq');
if (!!els.section) {
setElements();
bindEvents();
}
};
const setElements = function () {
els.faqList = els.section.querySelector('.js-faq-list');
};
const bindEvents = function () {
resize.add(eventList.resize);
eventList.setAccordion();
};
const eventList = {
resize: function (currRes) {
currDevice = currRes;
if (currDevice != prevDevice) {
eventList.responsive();
prevDevice = currDevice;
}
},
responsive: function () {
let isOpenedItems = els.faqList.querySelectorAll('.js-faq-item.is-open');
if (isOpenedItems.length > 0) {
for (let i = 0; i < isOpenedItems.length; i++) {
let isOpenedItemContent = isOpenedItems[i].querySelector('.js-faq-answer');
let clientHeight = isOpenedItemContent.children[0].clientHeight;
isOpenedItemContent.style.height = `${clientHeight}px`;
}
}
},
setAccordion: function () {
els.accordion = new window.flagship.common.accordion({
wrap: els.faqList,
classList: {
item: 'js-faq-item',
button: 'js-faq-open',
contents: 'js-faq-answer',
activeClass: 'is-open'
},
open: {
start: function (target) {
let targetInnerCta = target.querySelector('.js-featue-cta');
if (targetInnerCta) targetInnerCta.addEventListener('click', accessibility.moveFocus);
}
}
});
els.accordion.init();
},
};
const accessibility = {
moveFocus: function (e) {
if (this.getAttribute('href').indexOf('#') > -1) {
e.preventDefault();
let sectionId = this.getAttribute('href'),
section = document.querySelector(`${sectionId}`),
sectionTop = section.getBoundingClientRect().top,
movePosition = (sectionTop + window.pageYOffset) - utils.getNavHeight(),
clickable = section.querySelectorAll('a, button'),
title = section.querySelector('h2') || section.querySelector('h3');
if (!!title) {
let _focusOut = function () {
title.removeAttribute('tabindex');
title.removeEventListener('focusout', _focusOut);
};
title.addEventListener('focusout', _focusOut);
title.setAttribute('tabindex', 0);
title.focus();
} else {
clickable[0].focus();
}
window.scrollTo(0, movePosition);
}
}
};
return {
init: init
}
})();
})();
(function () {
window.flagship.features.formfactor = (function () {
const utils = window.flagship.common.utils,
resize = flagship.common.resize;
let els = {};
let currDevice = resize.checkResolution();
let isAos = utils.detector.isTouchDevice && document.documentElement.classList.contains('android');
let sizeCount = {
num: 6.1
};
let weightCount = {
num: 253
};
const init = function () {
els.section = document.querySelector('.js-form-factor');
if (!!els.section) {
setElements();
bindEvents();
}
};
const setElements = function () {
// fixed
els.fixedVideoTrack = els.section.querySelector('.js-fixed-track');
els.fixedVideoInner = els.section.querySelector('.js-fixed-inner');
els.fixedVideoWrap = els.section.querySelector('.js-fixed-scroll-video .js-video-wrap');
els.fixedVideo = els.section.querySelector('.js-fixed-scroll-video video');
// title
els.titleWrap1 = els.section.querySelector('.js-title-1');
els.titleWrap2 = els.section.querySelector('.js-title-2');
els.titleWrap3 = els.section.querySelector('.js-title-3');
els.titleWrap1.text = els.titleWrap1.querySelector('.js-title-text-1');
els.titleWrap2.text = els.titleWrap2.querySelector('.js-title-text-2');
els.titleWrap3.text = els.titleWrap3.querySelector('.features-form-factor__title');
els.titleWrap1.infoWrap = els.titleWrap1.querySelector('.js-info-wrap-1');
els.titleWrap2.infoWrap = els.titleWrap2.querySelector('.js-info-wrap-2');
els.titleWrap1.infoWrap.value = els.titleWrap1.infoWrap.querySelector('.js-value-1');
els.titleWrap2.infoWrap.value = els.titleWrap2.infoWrap.querySelector('.js-value-2');
};
const bindEvents = function () {
eventHandler.load();
resize.add(eventHandler.resize);
};
const eventHandler = {
load: function () {
eventList.checkBrokenFixed();
if (document.documentElement.classList.contains('is-formfactor-broken-fixed') || document.documentElement.classList.contains('low_network')) {
window.addEventListener('DOMContentLoaded', eventList.setStaticContents, {once: true});
} else {
if (isAos) {
window.addEventListener('DOMContentLoaded', function () {
eventList.fixedScroller.set();
eventList.sequencePlayer.set();
}, {once: true});
window.addEventListener('scroll', eventList.sequencePlayer.play);
} else {
window.addEventListener('DOMContentLoaded', eventList.setVideoHandler, {once: true});
els.fixedVideo.addEventListener('canplaythrough', function () {
window.addEventListener('scroll', eventList.fixedScroller.play);
eventList.fixedScroller.set();
}, {once: true});
}
}
window.addEventListener('orientationchange', eventHandler.orientationchange);
},
resize: function () {
eventList.setContents();
},
orientationchange: function () {
setTimeout(function () {
eventList.setContents();
}, 150);
}
};
const eventList = {
setVideoHandler: function () {
utils.videoHandler({
wrap: els.fixedVideoWrap,
video: els.fixedVideo
});
},
fixedScroller: {
set: function () {
eventList.fixedScroller.destroy();
if (els.fixedVideoTrack.scene == null) {
els.fixedVideoTrack.scene = SCROLLER({
trackElement: els.fixedVideoTrack,
fixedElement: els.fixedVideoInner,
useFixed: true,
useFixedStyle: false,
trackHeight: isAos ? 4.5 : 6,
resize: (utils.detector.isTouchDevice) ? false : true
});
}
},
destroy: function () {
if (els.fixedVideoTrack.scene != null) {
els.fixedVideoTrack.scene.destroy(true, true);
els.fixedVideoTrack.scene = null;
els.fixedVideoTrack.style = '';
}
},
play: function () {
if (els.fixedVideoTrack.scene != null) {
els.fixedVideoTrack.scene.trackAnimation(eventList.fixedScrollMotion);
}
}
},
sequencePlayer: {
set: function () {
let imageName = null;
if (currDevice.indexOf('desktop') > -1) {
imageName = 'galaxy-z-fold6-features-form-factor-';
} else if (currDevice.indexOf('mobile') > -1) {
imageName = 'galaxy-z-fold6-features-form-factor-mo-';
} else {
imageName = 'galaxy-z-fold6-features-form-factor-tb-';
}
els.fixedVideoTrack.seqSence = SEQUENCEPLAYER({
targetElement: els.fixedVideoWrap,
startNum: 0,
endNum: (currDevice.indexOf('mobile') > -1) ? 123 : 92,
path: typeof SEQUENCE_IMG_PATH == 'undefined' ? './images/seq/' : SEQUENCE_IMG_PATH,
name: imageName,
extension: 'jpg',
addType: 'append'
});
},
destroy: function () {
if (els.fixedVideoTrack.seqSence != null) {
els.fixedVideoWrap.removeChild(els.fixedVideoWrap.querySelector('canvas'));
els.fixedVideoTrack.seqSence = null;
}
},
play: function () {
if (els.fixedVideoTrack.scene != null) {
els.fixedVideoTrack.scene.trackAnimation(eventList.fixedScrollMotion);
}
}
},
fixedScrollMotion: function () {
let progress = this.progress;
let isMobile = currDevice.indexOf('mobile') > -1;
if (els.fixedVideoTrack.seqSence != null) {
let motionValue = utils.calRange({
targetValue: (currDevice.indexOf('mobile') > -1) ? 123 : 92,
progress: progress,
});
els.fixedVideoTrack.seqSence.play({
index: parseInt(motionValue)
});
} else {
if (els.fixedVideo.readyState >= 4) {
let scrollTimeValue = utils.calRange({
targetValue: els.fixedVideo.duration,
progress: progress,
});
els.fixedVideo.currentTime = scrollTimeValue - 0.1;
}
}
if (isMobile) {
// title1
let titleOpacityValue1 = utils.calRange({
targetValue: 1,
progress: progress,
startPoint: 30,
endPoint: 35
}),
numOpacityValue1 = utils.calRange({
targetValue: 1,
progress: progress,
startPoint: 28,
endPoint: 33
}),
titleWrapShowTopValue1 = utils.calRange({
targetValue: 70,
progress: progress,
startPoint: 33,
endPoint: 44
}),
titleHideValue1 = utils.calRange({
targetValue: 1,
progress: progress,
startPoint: 55,
endPoint: 60
}),
numHideValue1 = utils.calRange({
targetValue: 1,
progress: progress,
startPoint: 55,
endPoint: 60
}),
titleWrapHideTopValue1 = utils.calRange({
targetValue: 50,
progress: progress,
startPoint: 57,
endPoint: 60
});
TweenMax.to(els.titleWrap1.infoWrap, 0.1, {
opacity: numOpacityValue1 - 0.01
});
TweenMax.to(els.titleWrap1.text, 0.1, {
opacity: titleOpacityValue1 - 0.01
});
TweenMax.to(els.titleWrap1, 0.1, {
y: 50 - titleWrapShowTopValue1 + '%'
});
if (titleOpacityValue1 == 1) {
els.titleWrap1.text.classList.add('is-text-visible');
els.titleWrap1.infoWrap.classList.add('is-text-visible');
}
if (this.wheelDirection == 'down') {
if (progress >= 28) {
TweenMax.to(weightCount, 0.6, {
num: 239,
onUpdate: function () {
els.titleWrap1.infoWrap.value.innerText = Math.floor(weightCount.num);
}
});
}
} else {
if (progress == 0) {
TweenMax.to(els.titleWrap1.infoWrap.value, 0.5, {
onUpdate: function () {
els.titleWrap1.infoWrap.value.innerText = '253';
els.titleWrap2.infoWrap.value.innerText = 6.1;
weightCount.num = 253;
}
});
}
}
if (progress > 55) {
TweenMax.to(els.titleWrap1.infoWrap, 0.1, {
opacity: 1 - numHideValue1
});
TweenMax.to(els.titleWrap1.text, 0.1, {
opacity: 1 - titleHideValue1
});
if (titleHideValue1 == 1) {
els.titleWrap1.text.classList.remove('is-text-visible');
els.titleWrap1.infoWrap.classList.remove('is-text-visible');
}
}
if (progress >= 57) {
TweenMax.to(els.titleWrap1, 0.1, {
y: -(titleWrapShowTopValue1 + titleWrapHideTopValue1) + '%'
});
}
// title2
let titleOpacityValue2 = utils.calRange({
targetValue: 1,
progress: progress,
startPoint: 58,
endPoint: 67
}),
numOpacityValue2 = utils.calRange({
targetValue: 1,
progress: progress,
startPoint: 56,
endPoint: 65
}),
titleWrapShowTopValue2 = utils.calRange({
targetValue: 50,
progress: progress,
startPoint: 56,
endPoint: 67
}),
titleHideValue2 = utils.calRange({
targetValue: 1,
progress: progress,
startPoint: 87,
endPoint: 90
}),
numHideValue2 = utils.calRange({
targetValue: 1,
progress: progress,
startPoint: 87,
endPoint: 90
}),
titleHideScaleValue2 = utils.calRange({
targetValue: 0.1,
progress: progress,
startPoint: 87,
endPoint: 90
});
TweenMax.to(els.titleWrap2.infoWrap, 0.1, {
opacity: numOpacityValue2 - 0.01
});
TweenMax.to(els.titleWrap2.text, 0.1, {
opacity: titleOpacityValue2 - 0.01
});
TweenMax.to(els.titleWrap2, 0.1, {
y: 50 - titleWrapShowTopValue2 + '%',
});
if (titleOpacityValue2 == 1) {
els.titleWrap2.text.classList.add('is-text-visible');
els.titleWrap2.infoWrap.classList.add('is-text-visible');
}
if (this.wheelDirection == 'down') {
if (progress >= 56) {
TweenMax.to(sizeCount, 0.6, {
num: 5.6,
onUpdate: function () {
els.titleWrap2.infoWrap.value.innerText = sizeCount.num.toFixed(1);
}
});
}
} else {
if (progress < 65) {
TweenMax.to(els.titleWrap2.infoWrap.value, 0.5, {
onUpdate: function () {
sizeCount.num = 6.1;
}
});
}
}
if (progress > 86) {
TweenMax.to(els.titleWrap2.infoWrap, 0.1, {
opacity: 1 - numHideValue2
});
TweenMax.to(els.titleWrap2.text, 0.1, {
opacity: 1 - titleHideValue2
});
if (titleHideValue2 == 1) {
els.titleWrap2.text.classList.remove('is-text-visible');
els.titleWrap2.infoWrap.classList.remove('is-text-visible');
}
}
TweenMax.to(els.titleWrap2, 0.1, {
scale: 1 - titleHideScaleValue2,
});
// title3
let titleOpacityValue3 = utils.calRange({
targetValue: 1,
progress: progress,
startPoint: 90,
endPoint: 93
}),
titleScaleValue3 = utils.calRange({
targetValue: 0.9,
progress: progress,
startPoint: 90,
endPoint: 100
});
TweenMax.to(els.titleWrap3, 0.1, {
opacity: titleOpacityValue3,
});
TweenMax.to(els.titleWrap3, 0.1, {
scale: 1.9 - titleScaleValue3
});
if (titleOpacityValue3 == 1) {
els.titleWrap3.text.classList.add('is-text-visible');
} else {
els.titleWrap3.text.classList.remove('is-text-visible');
}
} else {
// title1
let titleOpacityValue1 = utils.calRange({
targetValue: 1,
progress: progress,
startPoint: 16,
endPoint: 20
}),
numOpacityValue1 = utils.calRange({
targetValue: 1,
progress: progress,
startPoint: 14,
endPoint: 20
}),
titleHideValue1 = utils.calRange({
targetValue: 1,
progress: progress,
startPoint: 34,
endPoint: 38
}),
numHideValue1 = utils.calRange({
targetValue: 1,
progress: progress,
startPoint: 34,
endPoint: 38
}),
infoLeftValue = utils.calRange({
targetValue: 35,
progress: progress,
startPoint: 0,
endPoint: 20
});
hideTopValue1 = utils.calRange({
targetValue: 85,
progress: progress,
startPoint: 34,
endPoint: 38
});
TweenMax.to(els.titleWrap1.text, 0, {
x: -35 + infoLeftValue + '%'
});
TweenMax.to(els.titleWrap1.infoWrap, 0, {
x: 35 - infoLeftValue + '%'
});
TweenMax.to(els.titleWrap1.infoWrap, 0.1, {
opacity: numOpacityValue1
});
TweenMax.to(els.titleWrap1.text, 0.1, {
opacity: titleOpacityValue1
});
if (titleOpacityValue1 >= 0.1) {
if (!els.titleWrap1.text.classList.contains('is-text-visible')) {
els.titleWrap1.text.classList.add('is-text-visible');
}
}
if (numOpacityValue1 >= 0.1) {
if (!els.titleWrap1.infoWrap.classList.contains('is-text-visible')) {
els.titleWrap1.infoWrap.classList.add('is-text-visible');
}
}
if (this.wheelDirection == 'down') {
if (progress >= 18) {
TweenMax.to(weightCount, 0.5, {
num: 239,
onUpdate: function () {
els.titleWrap1.infoWrap.value.innerText = Math.floor(weightCount.num);
}
});
}
} else {
if (progress == 0) {
TweenMax.to(els.titleWrap1.infoWrap.value, 0.5, {
onUpdate: function () {
els.titleWrap1.infoWrap.value.innerText = '253';
els.titleWrap2.infoWrap.value.innerText = 6.1;
weightCount.num = 253;
}
});
}
}
TweenMax.to(els.titleWrap1.text, 0, {
y: -hideTopValue1 + '%'
});
TweenMax.to(els.titleWrap1.infoWrap, 0, {
y: hideTopValue1 + '%'
});
if (progress > 38) {
TweenMax.to(els.titleWrap1.infoWrap, 0.1, {
opacity: 1 - numHideValue1
});
TweenMax.to(els.titleWrap1.text, 0.1, {
opacity: 1 - titleHideValue1
});
if (titleHideValue1 == 1) {
els.titleWrap1.text.classList.remove('is-text-visible');
els.titleWrap1.infoWrap.classList.remove('is-text-visible');
}
}
// title2
let titleOpacityValue2 = utils.calRange({
targetValue: 1,
progress: progress,
startPoint: 49,
endPoint: 61
}),
numOpacityValue2 = utils.calRange({
targetValue: 1,
progress: progress,
startPoint: 47,
endPoint: 59
}),
titleHideValue2 = utils.calRange({
targetValue: 1,
progress: progress,
startPoint: 76,
endPoint: 80
}),
numHideValue2 = utils.calRange({
targetValue: 1,
progress: progress,
startPoint: 76,
endPoint: 80
}),
titleTopValue2 = utils.calRange({
targetValue: 50,
progress: progress,
startPoint: 52,
endPoint: 59
}),
titleScaleValue2 = utils.calRange({
targetValue: 0.3,
progress: progress,
startPoint: 78,
endPoint: 80
});
TweenMax.to(els.titleWrap2.infoWrap, 0.1, {
opacity: numOpacityValue2
});
TweenMax.to(els.titleWrap2.text, 0.1, {
opacity: titleOpacityValue2
});
if (titleOpacityValue2 >= 0.1) {
if (!els.titleWrap2.text.classList.contains('is-text-visible')) {
els.titleWrap2.text.classList.add('is-text-visible');
}
if (!els.titleWrap2.infoWrap.classList.contains('is-text-visible')) {
els.titleWrap2.infoWrap.classList.add('is-text-visible');
}
}
TweenMax.to(els.titleWrap2, 0, {
y: -titleTopValue2 + '%'
});
if (this.wheelDirection == 'down') {
if (progress >= 49) {
TweenMax.to(sizeCount, 0.5, {
num: 5.6,
onUpdate: function () {
els.titleWrap2.infoWrap.value.innerText = sizeCount.num.toFixed(1);
}
});
}
} else {
if (progress < 38) {
TweenMax.to(els.titleWrap2.infoWrap.value, 0.1, {
onUpdate: function () {
sizeCount.num = 6.1;
}
});
}
}
if (progress > 78) {
TweenMax.to(els.titleWrap2.infoWrap, 0.1, {
opacity: 1 - numHideValue2
});
TweenMax.to(els.titleWrap2.text, 0.1, {
opacity: 1 - titleHideValue2
});
TweenMax.to(els.titleWrap2, 0.1, {
scale: 1 - titleScaleValue2
});
if (titleHideValue2 == 1) {
els.titleWrap2.text.classList.remove('is-text-visible');
els.titleWrap2.infoWrap.classList.remove('is-text-visible');
}
}
// title3
let titleOpacityValue3 = utils.calRange({
targetValue: 1,
progress: progress,
startPoint: 81,
endPoint: 88
}),
titleScaleValue3 = utils.calRange({
targetValue: 0.8,
progress: progress,
startPoint: 81,
endPoint: 88
});
TweenMax.to(els.titleWrap3, 0.1, {
opacity: titleOpacityValue3
});
TweenMax.to(els.titleWrap3, 0.1, {
scale: 1.8 - titleScaleValue3
});
if (titleOpacityValue3 == 1) {
els.titleWrap3.text.classList.add('is-text-visible');
} else {
els.titleWrap3.text.classList.remove('is-text-visible');
}
}
},
checkBrokenFixed: function () {
let winWidth = window.innerWidth,
winHeight = window.innerHeight;
document.documentElement.classList.remove('is-formfactor-broken-fixed');
if (winWidth > 1440 && winHeight <= 720) {
document.documentElement.classList.add('is-formfactor-broken-fixed');
} else if (winWidth <= 1440 && (winHeight / winWidth) < 0.5277) {
document.documentElement.classList.add('is-formfactor-broken-fixed');
} else {
document.documentElement.classList.remove('is-formfactor-broken-fixed');
}
},
setStaticContents: function () {
if (!els.section.classList.contains('none-fixed')) {
els.section.classList.add('none-fixed');
}
},
setFixedContents: function () {
if (els.section.classList.contains('none-fixed')) {
els.section.classList.remove('none-fixed');
}
if (isAos) {
window.addEventListener('DOMContentLoaded', function () {
eventList.fixedScroller.set();
eventList.sequencePlayer.set();
}, {once: true});
window.addEventListener('scroll', eventList.sequencePlayer.play);
} else {
eventList.setVideoHandler();
eventList.fixedScroller.set();
eventList.fixedScroller.play();
window.addEventListener('scroll', eventList.fixedScroller.play);
}
},
setContents: function () {
eventList.checkBrokenFixed();
if (document.documentElement.classList.contains('is-formfactor-broken-fixed') || document.documentElement.classList.contains('low_network')) {
eventList.fixedScroller.destroy();
if (isAos) {
eventList.sequencePlayer.destroy();
window.removeEventListener('scroll', eventList.sequencePlayer.play);
} else {
window.removeEventListener('scroll', eventList.fixedScroller.play);
}
eventList.setStaticContents();
} else {
eventList.setFixedContents();
}
},
};
return {
init: init
}
})();
})();
(function () {
window.flagship = window.flagship || {};
window.flagship.features = window.flagship.features || {};
window.flagship.features.highlightsZone = (function () {
const utils = window.flagship.common.utils;
const resize = window.flagship.common.resize;
let els = {};
let prevDevice;
let swiperObj = {};
let pointerOffset = {};
let currDevice = resize.checkResolution();
let dimmedClass = 'is-dimmed';
let ctaPlayStatus = true;
let scrollProgress = null;
let lowNetwork = document.documentElement.classList.contains('low_network');
let isBgLoaded = false;
const init = function () {
els.section = document.querySelector('.features-highlights');
if (!!els.section) {
setElements();
setProperty();
bindEvents();
}
};
const setElements = function () {
els.mainContainer = els.section.querySelector('.js-highlights-main-container');
els.mainSwiperSlides = els.mainContainer.querySelectorAll('.swiper-slide');
els.videoWrap = els.mainContainer.querySelectorAll('.js-video-wrap');
els.prevArrow = els.mainContainer.parentElement.querySelector('.swiper-button-prev');
els.nextArrow = els.mainContainer.parentElement.querySelector('.swiper-button-next');
els.scrollbar = els.section.querySelector('.js-highlights-scrollbar');
els.bgContainer = els.section.querySelector('.js-highlights-bg-container');
els.bgSwiperSlides = els.bgContainer.querySelectorAll('.swiper-slide');
};
const setProperty = function () {
els.mainContainer.autoPlay = true;
els.videoWrap = els.mainContainer.querySelectorAll('.js-video-wrap');
for (let i = 0; i < els.videoWrap.length; i++) {
els.videoWrap[i].video = els.videoWrap[i].querySelector('.common-video__video');
els.videoWrap[i].coverImageHighband = els.videoWrap[i].querySelector('.common-video__cover-image--highband');
els.videoWrap[i].coverImageLowband = els.videoWrap[i].querySelector('.common-video__cover-image--lowband');
els.videoWrap[i].controller = els.videoWrap[i].querySelector('.js-video-control');
els.videoWrap[i].controller.video = els.videoWrap[i].video;
els.videoWrap[i].progressBar = els.videoWrap[i].querySelector('.common-video__control-progress-bar');
els.bgSwiperSlides[i].image = els.bgSwiperSlides[i].querySelector('img');
}
};
const bindEvents = function () {
eventList.load();
eventHandler.click();
eventHandler.scroll();
eventHandler.flickSwiper();
resize.add(eventList.resize);
};
const eventHandler = {
flickSwiper: function () {
els.mainContainer.addEventListener('touchstart', function (e) {
pointerOffset.start = null;
pointerOffset.current = null;
pointerOffset.start = e.touches[0].clientX;
els.mainContainer.addEventListener('touchmove', eventList.getPointerMoveSize);
});
els.mainContainer.addEventListener('touchend', function () {
if (pointerOffset.start == null) return;
els.mainContainer.autoPlay = false;
els.mainContainer.removeEventListener('touchmove', eventList.getPointerMoveSize);
});
els.mainContainer.addEventListener('mousedown', function (e) {
pointerOffset.start = null;
pointerOffset.current = null;
pointerOffset.start = e.offsetX;
els.mainContainer.addEventListener('mousemove', eventList.getPointerMoveSize);
});
els.mainContainer.addEventListener('mouseup', function () {
els.mainContainer.autoPlay = false;
els.mainContainer.removeEventListener('mousemove', eventList.getPointerMoveSize);
});
els.mainContainer.addEventListener('mouseleave', function () {
if (pointerOffset.start == null) return;
pointerOffset.start = null;
pointerOffset.current = null;
els.mainContainer.removeEventListener('mousemove', eventList.getPointerMoveSize);
});
},
click: function () {
for (let i = 0; i < els.videoWrap.length; i++) {
els.videoWrap[i].controller.addEventListener('click', eventList.clickVideoCta);
}
for (let i = 0; i < els.videoWrap.length; i++) {
els.videoWrap[i].controller.addEventListener('click', eventList.stopAutoPlay);
}
els.nextArrow.addEventListener('click', function (e) {
eventList.stopAutoPlay(e)
eventList.swiperArrow(e);
});
els.prevArrow.addEventListener('click', function (e) {
eventList.stopAutoPlay(e)
eventList.swiperArrow(e);
});
els.scrollbar.addEventListener('click', eventList.stopAutoPlay);
},
scroll: function () {
window.addEventListener('scroll', eventList.scroll)
}
}
const eventList = {
load: function () {
swiperEvents.set();
swiperObj.main.init();
swiperObj.bg.init();
eventList.setVideo();
eventList.setScene();
eventList.scroll();
},
resize: function () {
currDevice = resize.checkResolution();
if (prevDevice != currDevice) {
eventList.responsive();
prevDevice = currDevice;
};
},
responsive: function () {
let desktopStatus = eventList.getCarouselSizeInfo(swiperObj.main).viewLength > 0 && currDevice == 'desktop';
eventList.resetDimmedSlide(swiperObj.main);
swiperObj.main.slideTo(0, false);
if (desktopStatus) eventList.initDimmedSlides(swiperObj.main);
},
setVideo: function () {
for (let i = 0; i < els.videoWrap.length; i++) {
utils.videoHandler({
playType: 'scrollPlay',
startPoint: currDevice != 'mobile' ? 40 : 24,
reversePoint: currDevice != 'mobile' ? 88 : 80,
wrap: els.videoWrap[i],
video: els.videoWrap[i].video,
controller: els.videoWrap[i].controller,
resetCallback: function () {
if (this.wrap.classList.contains('is-completed')) {
this.wrap.classList.remove('is-completed');
}
if (this.wrap.classList.contains('is-started')) {
this.wrap.classList.remove('is-started');
}
},
playCallback: function () {
setTagging.pause(this.controller);
this.video.timeupdateEvent = function(){
if (this.currentTime > 0) {
if (!this.videoHandler.wrap.classList.contains('is-started')) {
this.videoHandler.wrap.classList.add('is-started');
}
eventList.setProgerssDuration(i);
this.removeEventListener('timeupdate', this.timeupdateEvent);
}
}
this.video.addEventListener('timeupdate', this.video.timeupdateEvent);
},
pauseCallback: function () {
setTagging.play(this.controller);
},
endCallback: function () {
if (!this.wrap.classList.contains('is-completed')) {
this.wrap.classList.add('is-completed');
}
if (els.mainContainer.autoPlay) {
if (scrollProgress > 40 && scrollProgress < 55) {
clearTimeout(swiperObj.main.videoTiming);
swiperObj.main.videoTiming = setTimeout(() => {
swiperObj.main.slideNext();
}, 1000);
}
}
}
});
}
},
playVideo: function (video) {
if (video.readyState >= 1) {
video.play();
} else {
video.addEventListener('canplay', function () {
this.play();
}, {
once: true
})
}
},
clickVideoCta: function (e) {
if (e.target == e.currentTarget) {
if (e.currentTarget.video.paused) {
eventList.playVideo(e.currentTarget.video);
ctaPlayStatus = true;
} else {
e.currentTarget.video.pause();
ctaPlayStatus = false;
}
}
},
stopAutoPlay: function (e) {
if (e.target.classList.contains('js-video-control') ||
e.target.classList.contains('swiper-button-next') ||
e.target.classList.contains('swiper-button-prev') ||
e.target.classList.contains('js-highlights-scrollbar')
) {
els.mainContainer.autoPlay = false;
};
},
swiperArrowVisiblirity: function () {
let mainSlidesLength = els.mainSwiperSlides.length - 1;
let mainSwiper = swiperObj.main;
let prevArrow = mainSwiper.previousIndex > mainSwiper.realIndex;
let nextArrow = mainSwiper.previousIndex < mainSwiper.realIndex;
if (prevArrow) {
if (mainSwiper.realIndex == (mainSlidesLength - 1)) {
if (els.nextArrow.style.display == 'none') els.nextArrow.style.display = '';
} else if (mainSwiper.realIndex == 0) {
els.prevArrow.style.display = 'none';
}
};
if (nextArrow) {
if (mainSwiper.realIndex == 1) {
if (els.prevArrow.style.display == 'none') els.prevArrow.style.display = '';
} else if (mainSwiper.realIndex == mainSlidesLength) {
els.nextArrow.style.display = 'none';
}
};
},
swiperArrow: function (e) {
let mainSwiper = swiperObj.main;
let mainSlidesLength = els.mainSwiperSlides.length - 1;
let prevArrow = e.target.classList.contains('swiper-button-prev');
let nextArrow = e.target.classList.contains('swiper-button-next');
if (prevArrow) {
clearTimeout(swiperObj.main.videoTiming);
mainSwiper.slidePrev();
if (mainSwiper.realIndex == 0) {
setTimeout(() => {
els.nextArrow.blur();
els.nextArrow.focus();
}, 300);
}
};
if (nextArrow) {
clearTimeout(swiperObj.main.videoTiming);
mainSwiper.slideNext();
if (mainSwiper.realIndex == mainSlidesLength) {
setTimeout(() => {
els.prevArrow.blur();
els.prevArrow.focus();
}, 300);
}
};
},
scroll: function () {
els.section.scene.trackAnimation(function () {
let isIndex = swiperObj.main.realIndex;
let isMainVideoHandler = els.videoWrap[isIndex].video.videoHandler;
scrollProgress = this.progress;
if (!lowNetwork && ctaPlayStatus) isMainVideoHandler.scrollActive(this.progress);
if (scrollProgress > 0 && !isBgLoaded) {
for (let i = 0; i < els.bgSwiperSlides.length; i++) {
if (!els.bgSwiperSlides[i].image.classList.contains('is-img-load-complete')) {
imageLoader.setResponsiveMedia([els.bgSwiperSlides[i].image]);
}
}
isBgLoaded = true;
}
});
},
slideVideoPlay: function () {
let isIndex = swiperObj.main.realIndex;
let isVideoWrap = els.videoWrap[isIndex];
isVideoWrap.classList.add('is-ended');
setTimeout(function () {
isVideoWrap.classList.remove('is-started', 'is-paused');
if (!ctaPlayStatus) isVideoWrap.video.paused();
isVideoWrap.video.currentTime = 0;
if (ctaPlayStatus) {
eventList.playVideo(isVideoWrap.video);
setTimeout(function () {
if (els.mainContainer.autoPlay) isVideoWrap.video.videoHandler.controller.blur();
if (els.mainContainer.autoPlay) isVideoWrap.video.videoHandler.controller.focus();
if (isIndex == (swiperObj.main.slides.length - 1)) {
els.mainContainer.autoPlay = false;
}
}, 300);
}
}, 50);
},
setProgerssDuration: function (index) {
let isDuration = els.videoWrap[index].video.duration;
if (!!!els.videoWrap[index].durationSet) {
els.videoWrap[index].progressBar.style.animationDuration = `${isDuration}s`;
els.videoWrap[index].durationSet = true;
}
},
setMedia: function (index) {
let videoLength = els.mainSwiperSlides.length - 1;
let isIndex = index + 1
let loadIndex = isIndex < videoLength ? isIndex : videoLength;
let mainVideoloadComplateLength = els.mainContainer.querySelectorAll('.is-video-load-complete').length - 1;
for (let i = 0; i <= loadIndex; i++) {
if (mainVideoloadComplateLength != videoLength && !els.videoWrap[i].video.classList.contains('.is-video-load-complete')) {
if (!!els.videoWrap[i].video) videoLoader.setResponsiveMedia([els.videoWrap[i].video]);
if (!lowNetwork) {
if (!!els.videoWrap[i].coverImageHighband) imageLoader.setResponsiveMedia([els.videoWrap[i].coverImageHighband]);
} else {
if (!!els.videoWrap[i].coverImageLowband) imageLoader.setResponsiveMedia([els.videoWrap[i].coverImageLowband]);
}
if (!!els.bgSwiperSlides[i].image) imageLoader.setResponsiveMedia([els.bgSwiperSlides[i].image]);
}
}
},
pauseVideo: function (swiper) {
for (let i = 0; i < swiper.slides.length; i++) {
let isVideo = swiper.slides[i].querySelector('video');
if (!!isVideo && !isVideo.paused) {
isVideo.pause();
};
};
},
getCarouselSizeInfo: function (swiper) {
let slideLength = swiper.slides.length;
let slideWidth = swiper.slides[0].clientWidth;
let slideMargin = parseInt(window.getComputedStyle(swiper.slides[0]).margin.split(' ')[1]);
let slideSize = slideWidth + slideMargin;
let maxMoveSize = ((slideSize * slideLength) - slideMargin) - swiper.wrapperEl.clientWidth;
let viewWidth = swiper.wrapperEl.clientWidth;
let viewLength = parseInt((viewWidth + slideMargin) / slideSize);
let lastBeforeSize = slideLength == 2 ? 0 : Math.abs((maxMoveSize - slideSize)) + Math.abs((viewWidth - slideWidth));
let isMoveSize = Math.abs(parseInt(window.getComputedStyle(swiper.wrapperEl).transform.split(',')[4]));
return {
slideWidth: slideWidth,
slideMargin: slideMargin,
slideSize: slideSize,
maxMoveSize: maxMoveSize,
viewWidth: viewWidth,
viewLength: viewLength,
lastBeforeSize: lastBeforeSize,
isMoveSize: isMoveSize
}
},
setScene: function () {
els.section.scene = SCROLLER({
trackElement: els.section,
useFixed: false
});
},
initDimmedSlides: function (swiper) {
for (let i = 0; i < swiper.slides.length; i++) {
if ((swiper.activeIndex + eventList.getCarouselSizeInfo(swiper).viewLength) <= i) {
swiper.slides[i].classList.add(dimmedClass);
}
}
},
setDimmedSlide: function (swiper) {
if (currDevice != 'mobile') {
for (let i = 0; i < swiper.slides.length; i++) {
let dimmedSlide = (swiper.activeIndex) > i || (swiper.activeIndex + (eventList.getCarouselSizeInfo(swiper).viewLength - 1)) < i;
if (dimmedSlide) {
swiper.slides[i].classList.add(dimmedClass);
} else {
swiper.slides[i].classList.remove(dimmedClass);
}
}
}
},
resetDimmedSlide: function (swiper) {
for (let i = 0; i < swiper.slides.length; i++) {
swiper.slides[i].classList.remove(dimmedClass);
}
},
getPointerMoveSize: function (e) {
if (!!e.touches) {
pointerOffset.current = e.touches[0].clientX;
} else {
pointerOffset.current = e.offsetX;
}
}
}
const swiperEvents = {
set: function () {
if (swiperObj.main == null) {
swiperObj.main = new Swiper(els.mainContainer, {
init: false,
slidesPerView: 'auto',
scrollbar: {
el: els.scrollbar,
draggable: true
},
});
swiperObj.main.on('init', swiperEvents.init);
swiperObj.main.on('slideChange', swiperEvents.slideChange);
swiperObj.main.on('transitionEnd', swiperEvents.transitionEnd);
}
if (swiperObj.bg == null) {
swiperObj.bg = new Swiper(els.bgContainer, {
init: false,
slidesPerView: 'auto',
allowTouchMove: false
});
}
els.prevArrow.style.display = 'none';
},
init: function () {
let isNextArrow = this.el.parentElement.querySelector('.swiper-button-next');
let isPrevArrow = this.el.parentElement.querySelector('.swiper-button-prev');
isNextArrow.removeAttribute('aria-label');
isNextArrow.removeAttribute('role');
isPrevArrow.removeAttribute('aria-label');
isPrevArrow.removeAttribute('role');
accessibility.slide(this);
if (eventList.getCarouselSizeInfo(this).viewLength > 0 && currDevice == 'desktop') eventList.initDimmedSlides(this);
},
slideChange: function () {
swiperObj.bg.slideTo(this.realIndex);
accessibility.slide(this);
eventList.pauseVideo(this);
if (eventList.getCarouselSizeInfo(this).viewLength > 0 && currDevice == 'desktop') eventList.setDimmedSlide(this);
if (this.realIndex > 0) eventList.setMedia(this.realIndex);
if (!lowNetwork) eventList.slideVideoPlay();
eventList.swiperArrowVisiblirity();
},
transitionEnd: function () {
setTimeout(() => {
let carouselInfo = eventList.getCarouselSizeInfo(this);
let lastIndex = this.slides.length - 1;
let lastSlide = this.slides[lastIndex];
let lastBeforeSlide = this.slides[lastIndex - 1];
let isIndex = swiperObj.main.previousIndex;
let isMoveSize = currDevice != 'mobile' ? carouselInfo.isMoveSize : carouselInfo.isMoveSize + Math.abs(carouselInfo.slideMargin);
els.videoWrap[isIndex].video.pause();
if (carouselInfo.maxMoveSize == isMoveSize) {
lastSlide.classList.add('is-last-slide');
lastBeforeSlide.classList.add('is-dimmed');
lastSlide.classList.remove('is-dimmed');
if (currDevice == 'mobile') {
eventList.pauseVideo(this);
if (!lowNetwork && ctaPlayStatus) {
lastSlide.querySelector('video').play();
};
lastSlide.classList.add('swiper-slide-active');
lastBeforeSlide.classList.remove('swiper-slide-active');
}
} else if (lastSlide.classList.contains('is-last-slide') && carouselInfo.lastBeforeSize == carouselInfo.isMoveSize) {
lastSlide.classList.add('is-dimmed');
lastSlide.classList.remove('is-last-slide');
lastBeforeSlide.classList.remove('is-dimmed');
if (currDevice == 'mobile') {
eventList.pauseVideo(this);
if (!lowNetwork && ctaPlayStatus) {
lastBeforeSlide.querySelector('video').play();
};
lastSlide.classList.remove('swiper-slide-active');
lastBeforeSlide.classList.add('swiper-slide-active');
}
}
}, 0);
},
destroy: function (swiper) {
if (swiper != null) {
swiper.navigation.destroy(true);
swiper.destroy(true);
swiper = null;
}
},
};
const setTagging = {
play: function (targetController) {
if (targetController.hasAttribute('data-omni')) {
let dataOmni = targetController.getAttribute('data-omni').toLowerCase();
targetController.setAttribute('data-omni', dataOmni.replace('pause', 'play'));
}
if (targetController.hasAttribute('ga-la')) {
let gaLa = targetController.getAttribute('ga-la').toLowerCase();
targetController.setAttribute('ga-la', gaLa.replace('pause', 'play'));
}
},
pause: function (targetController) {
if (targetController.hasAttribute('data-omni')) {
let dataOmni = targetController.getAttribute('data-omni').toLowerCase();
targetController.setAttribute('data-omni', dataOmni.replace('play', 'pause'));
}
if (targetController.hasAttribute('ga-la')) {
let gaLa = targetController.getAttribute('ga-la').toLowerCase();
targetController.setAttribute('ga-la', gaLa.replace('play', 'pause'));
}
}
};
const accessibility = {
slide: function (swiper) {
for (let i = 0; i < swiper.slides.length; i++) {
if (i != swiper.activeIndex) {
utils.onAccessibility(swiper.slides[i]);
} else {
utils.offAccessibility(swiper.slides[i]);
}
}
}
};
return {
init: init,
}
})();
})();
;
(function () {
window.flagship.features.interactiveCircleToSearch = (function () {
const utils = window.flagship.common.utils,
resize = window.flagship.common.resize;
let els = {};
let objs = {};
let stepInfo = [];
let scrollProgress = null;
let isPlaySection = null;
const init = function () {
els.section = document.querySelector('.js-circle-to-search');
if (!!els.section) {
setElements();
bindEvents();
}
};
const setElements = function () {
els.interactiveContent = els.section.querySelector('.js-interactive');
els.tutorialVideoContainer = els.section.querySelector('.common-interactive__tutorial');
els.videoList = els.tutorialVideoContainer.querySelectorAll('.common-interactive__tutorial-video');
els.videoWrap = els.tutorialVideoContainer.querySelectorAll('.common-interactive__tutorial-video .common-video');
els.videos = els.tutorialVideoContainer.querySelectorAll('.common-interactive__tutorial-video .common-video__video');
els.tooltipCta = els.tutorialVideoContainer.querySelectorAll('.js-tutorial-tooltip-cta');
els.tutorialReplay = els.tutorialVideoContainer.querySelector('.js-replay-cta');
};
const setProperty = function (el, index) {
el.video = el.querySelector('video');
el.video.videoWrap = el;
el.controller = el.querySelector('.js-video-control');
el.controller.video = el.querySelector('video');
el.alert = el.parentElement.querySelector('.common-tutorial__alert');
el.tooltip = el.parentElement.querySelector('.js-tutorial-tooltip');
el.tooltipCta = el.parentElement.querySelector('.js-tutorial-tooltip-cta');
el.video.playIndex = index;
el.video.coverImage = el.querySelector('.common-video__cover-image');
};
const bindEvents = function () {
for (let i = 0; i < els.videoWrap.length; i++) {
setProperty(els.videoWrap[i], i);
setStepStatus(els.videoList[i])
}
setVideos();
eventList.videoController();
eventList.click();
eventList.setScroller();
eventHandler.scroll();
};
const setStepStatus = function (el) {
stepInfo.push({
alert: el.getAttribute('data-alert'),
tooltip: el.getAttribute('data-tooltip')
});
};
const eventList = {
setScroller: function () {
if (els.interactiveContent.scene == null) {
els.interactiveContent.scene = SCROLLER({
trackElement: els.interactiveContent,
useFixed: false
});
}
},
scrollEvent: function () {
if (els.interactiveContent.scene != null) {
if (els.interactiveContent.classList.contains('is-tutorial-opened')) {
els.interactiveContent.scene.trackAnimation(function () {
scrollProgress = this.progress;
let activeVideo = els.tutorialVideoContainer.querySelector('.is-visible video');
let firstVideoHandler = els.videoWrap[0].video.videoHandler;
let replayStatus = !document.documentElement.classList.contains('low_network') &&
activeVideo.paused &&
!els.videoWrap[0].classList.contains(firstVideoHandler.endedClass) &&
!els.videoWrap[0].classList.contains(firstVideoHandler.pauseClass) &&
scrollProgress > 0 && scrollProgress < 100;
let resetStatus = scrollProgress === 0 || scrollProgress === 100;
if (replayStatus) {
if (els.videoWrap[0].video.readyState == 4 && els.videoWrap[0].video.paused) {
els.videoWrap[0].video.play();
} else {
els.videoWrap[0].video.addEventListener('canplay', function() {
els.videoWrap[0].video.play();
}, {once:true});
}
}
if (resetStatus) {
activeVideo.pause();
activeVideo.currentTime = 0;
eventList.tutorialReset();
}
});
}
}
},
videoController: function () {
for (let i = 0; i < objs.videos.length; i++) {
objs.videos[i].controller.addEventListener('click', function () {
if (this.video.paused) {
this.video.play();
} else {
this.video.pause();
}
});
}
},
nextVideoPlay: function (index) {
if (!!els.videoList[index].tooltip) {
utils.onAccessibility(els.videoList[index].tooltip);
}
els.videoList[index + 1].classList.add('is-visible');
utils.onAccessibility(els.videoList[index]);
if (els.videos[index + 1].readyState > 3) {
els.videos[index + 1].play();
} else {
els.videos[index + 1].addEventListener('loadeddata', function () {
if (this.paused) this.play();
});
}
els.videoList[index].classList.remove('is-visible');
},
click: function () {
let self = this;
for (let i = 0; i < els.tooltipCta.length; i++) {
els.tooltipCta[i].addEventListener('click', function () {
self.nextVideoPlay(i);
});
}
},
tutorialReset: function () {
let firstVideoHandler = els.videoWrap[0].video.videoHandler;
els.videoWrap[0].classList.remove(firstVideoHandler.playClass);
els.videoWrap[0].classList.remove(firstVideoHandler.pauseClass);
els.videoWrap[0].classList.remove(firstVideoHandler.endedClass);
// video wrap
if (!els.videoList[0].classList.contains('is-visible')) {
els.videoList[0].classList.add('is-visible');
}
// tooltip
if (!!els.videoWrap[0].tooltip && els.videoWrap[0].tooltip.classList.contains('is-visible')) {
els.videoWrap[0].tooltip.classList.remove('is-visible');
}
// tootip accessibility
utils.offAccessibility(els.videoWrap[0]);
if (!!els.videoWrap[0].tooltip) utils.onAccessibility(els.videoWrap[0].tooltip);
for (let i = 0; i < els.videoWrap.length; i++) {
if (i != 0) {
if (els.videoList[i].classList.contains('is-visible')) {
els.videoList[i].classList.remove('is-visible');
}
if (!els.videoWrap[i].video.paused) {
els.videoWrap[i].video.pause();
els.videoWrap[i].video.currentTime = 0;
}
// tooltip
if (!!els.videoWrap[i].tooltip && els.videoWrap[i].tooltip.classList.contains('is-visible')) {
els.videoWrap[i].tooltip.classList.remove('is-visible');
}
utils.onAccessibility(els.videoWrap[i]);
if (!!els.videoWrap[i].tooltip) utils.onAccessibility(els.videoWrap[i].tooltip);
}
}
// replay cta
els.tutorialReplay.style.display = 'none';
els.tutorialReplay.setAttribute('aria-hidden', true);
els.tutorialReplay.setAttribute('tabindex', -1);
}
};
const eventHandler = {
scroll: function () {
window.addEventListener('scroll', eventList.scrollEvent);
eventList.scrollEvent();
}
}
const setVideos = function () {
objs.videos = [];
for (let i = 0; i < els.videoWrap.length; i++) {
let isVideoWrap = els.videoWrap[i];
objs.videos.push(utils.videoHandler({
wrap: isVideoWrap,
video: isVideoWrap.video,
controller: isVideoWrap.controller,
resetCallback: function () {
if (this.wrap.classList.contains('is-completed')) {
this.wrap.classList.remove('is-completed');
if (this.controller.style.display = 'none') {
this.controller.style.display = '';
}
}
},
playCallback: function () {
els.videoList[this.video.playIndex].removeAttribute('tabindex');
els.videoList[this.video.playIndex].removeAttribute('aria-hidden');
this.controller.style.display = 'block';
utils.offAccessibility(this.controller);
setTagging.pause(this.controller);
let nextPlayindex = this.video.playIndex + 1;
if ((els.videos.length - 1) > this.video.playIndex && els.videos[nextPlayindex].readyState < 4) {
if (!els.videos[nextPlayindex].classList.contains('is-video-load-complete')) {
videoLoader.setResponsiveMedia([els.videos[nextPlayindex]]);
}
if (!els.videos[nextPlayindex].coverImage.classList.contains('is-img-load-complete')) {
imageLoader.setResponsiveMedia([els.videos[nextPlayindex].coverImage]);
}
}
},
pauseCallback: function () {
setTagging.play(this.controller);
},
endCallback: function () {
if (!!this.wrap.tooltip && stepInfo[this.video.playIndex].tooltip == 'true') {
let self = this;
if (!!this.wrap.tooltipCta) this.wrap.tooltipCta.removeAttribute('disabled');
if (!!this.wrap.tooltip) this.wrap.tooltip.classList.add('is-visible');
utils.offAccessibility(this.wrap.tooltip);
}
if (!this.wrap.classList.contains('is-completed')) {
this.wrap.classList.add('is-completed');
}
this.controller.style.display = 'none';
if ((els.videos.length - 1) == this.video.playIndex) {
els.tutorialReplay.style.display = 'block';
els.tutorialReplay.removeAttribute('tabindex');
els.tutorialReplay.removeAttribute('aria-hidden');
}
}
}));
}
};
const setTagging = {
play: function (targetController) {
if (targetController.hasAttribute('data-omni')) {
let dataOmni = targetController.getAttribute('data-omni').toLowerCase();
targetController.setAttribute('data-omni', dataOmni.replace('pause', 'play'));
}
if (targetController.hasAttribute('ga-la')) {
let gaLa = targetController.getAttribute('ga-la').toLowerCase();
targetController.setAttribute('ga-la', gaLa.replace('pause', 'play'));
}
},
pause: function (targetController) {
if (targetController.hasAttribute('data-omni')) {
let dataOmni = targetController.getAttribute('data-omni').toLowerCase();
targetController.setAttribute('data-omni', dataOmni.replace('play', 'pause'));
}
if (targetController.hasAttribute('ga-la')) {
let gaLa = targetController.getAttribute('ga-la').toLowerCase();
targetController.setAttribute('ga-la', gaLa.replace('play', 'pause'));
}
}
};
return {
init: init
}
})();
})();
;
(function () {
window.flagship.features.interactiveInterpreter = (function () {
const utils = window.flagship.common.utils,
resize = window.flagship.common.resize;
let els = {};
let objs = {};
let stepInfo = [];
let scrollProgress = null;
let isMute = null;
let isPlaySection = null;
const init = function () {
els.section = document.querySelector('.js-interpreter');
if (!!els.section) {
setElements();
bindEvents();
}
};
const setElements = function () {
els.interactiveContent = els.section.querySelector('.js-interactive');
els.tutorialVideoContainer = els.section.querySelector('.common-interactive__tutorial');
els.videoList = els.tutorialVideoContainer.querySelectorAll('.common-interactive__tutorial-video');
els.videoWrap = els.tutorialVideoContainer.querySelectorAll('.common-interactive__tutorial-video .common-video');
els.videos = els.tutorialVideoContainer.querySelectorAll('.common-interactive__tutorial-video .common-video__video');
els.tooltipCta = els.tutorialVideoContainer.querySelectorAll('.js-tutorial-tooltip-cta');
els.tutorialReplay = els.tutorialVideoContainer.querySelector('.js-replay-cta');
els.allVideoWrap = els.section.querySelectorAll('.js-video-wrap');
els.muteCta = els.section.querySelectorAll('.js-mute-cta');
// status
isMute = !!els.muteCta && els.muteCta.length > 0;
};
const setProperty = function (el, index) {
el.video = el.querySelector('video');
el.video.videoWrap = el;
el.controller = el.querySelector('.js-video-control');
el.controller.video = el.querySelector('video');
el.alert = el.parentElement.querySelector('.common-tutorial__alert');
el.tooltip = el.parentElement.querySelector('.js-tutorial-tooltip');
el.tooltipCta = el.parentElement.querySelector('.js-tutorial-tooltip-cta');
el.video.playIndex = index;
el.video.coverImage = el.querySelector('.common-video__cover-image');
if (isMute) {
el.muteCta = els.muteCta[index + 1];
}
};
const bindEvents = function () {
for (let i = 0; i < els.videoWrap.length; i++) {
setProperty(els.videoWrap[i], i);
setStepStatus(els.videoList[i])
}
setVideos();
eventList.videoController();
eventList.click.tooltipCta();
eventList.setScroller();
eventHandler.scroll();
if (isMute) {
muteEventHandler();
}
};
const setStepStatus = function (el) {
stepInfo.push({
alert: el.getAttribute('data-alert'),
tooltip: el.getAttribute('data-tooltip')
});
};
const muteEventHandler = function () {
for (let i = 0; i < els.muteCta.length; i++) {
muteEventList.setProperty(els.muteCta[i], i);
muteEventList.setMuteBlindText(els.muteCta[i], i);
muteEventList.click(els.muteCta[i], i);
els.allVideoWrap[i].querySelector('video').style.pointerEvents = 'none';
}
};
const muteEventList = {
setProperty: function (muteCta, index) {
muteCta.videoWrap = els.allVideoWrap[index];
muteCta.videoWrap.muteCta = muteCta;
muteCta.video = els.allVideoWrap[index].querySelector('video');
muteCta.blind = muteCta.querySelector('.blind');
},
setMuteBlindText: function (muteCta) {
muteCta.blind.innerText = muteCta.getAttribute('data-unmute');
},
click: function (muteCta) {
muteCta.addEventListener('click', function () {
let isMute = this.video.muted;
if (!!isMute) {
this.classList.remove('is-muted');
this.classList.add('is-unmuted');
this.blind.innerText = this.getAttribute('data-mute');
this.video.muted = false;
setTagging.mute(this);
} else {
this.classList.remove('is-unmuted');
this.classList.add('is-muted');
this.blind.innerText = this.getAttribute('data-unmute');
this.video.muted = true;
setTagging.unmute(this);
}
});
},
};
const eventList = {
setScroller: function () {
if (els.interactiveContent.scene == null) {
els.interactiveContent.scene = SCROLLER({
trackElement: els.interactiveContent,
useFixed: false
});
}
},
scrollEvent: function () {
if (els.interactiveContent.scene != null) {
if (els.interactiveContent.classList.contains('is-tutorial-opened')) {
els.interactiveContent.scene.trackAnimation(function () {
scrollProgress = this.progress;
let activeVideo = els.tutorialVideoContainer.querySelector('.is-visible video');
let firstVideoHandler = els.videoWrap[0].video.videoHandler;
let replayStatus = !document.documentElement.classList.contains('low_network') &&
activeVideo.paused &&
!els.videoWrap[0].classList.contains(firstVideoHandler.endedClass) &&
!els.videoWrap[0].classList.contains(firstVideoHandler.pauseClass) &&
scrollProgress > 0 && scrollProgress < 100;
let resetStatus = scrollProgress === 0 || scrollProgress === 100;
if (replayStatus) {
if (els.videoWrap[0].video.readyState == 4 && els.videoWrap[0].video.paused) {
els.videoWrap[0].video.play();
} else {
els.videoWrap[0].video.addEventListener('canplay', function() {
els.videoWrap[0].video.play();
}, {once:true});
}
}
if (resetStatus) {
activeVideo.pause();
activeVideo.currentTime = 0;
eventList.tutorialReset();
}
});
}
}
},
videoController: function () {
for (let i = 0; i < objs.videos.length; i++) {
objs.videos[i].controller.addEventListener('click', function () {
if (this.video.paused) {
this.video.play();
} else {
this.video.pause();
}
});
}
},
nextVideoPlay: function (index) {
if (!!els.videoList[index].tooltip) {
utils.onAccessibility(els.videoList[index].tooltip);
}
els.videoList[index + 1].classList.add('is-visible');
utils.onAccessibility(els.videoList[index]);
if (els.videos[index + 1].readyState > 3) {
els.videos[index + 1].play();
} else {
els.videos[index + 1].addEventListener('loadeddata', function () {
if (this.paused) this.play();
});
}
els.videoList[index].classList.remove('is-visible');
},
click: {
tooltipCta: function () {
for (let i = 0; i < els.tooltipCta.length; i++) {
els.tooltipCta[i].addEventListener('click', function () {
eventList.nextVideoPlay(i);
});
}
}
},
tutorialReset: function () {
let firstVideoHandler = els.videoWrap[0].video.videoHandler;
els.videoWrap[0].classList.remove(firstVideoHandler.playClass);
els.videoWrap[0].classList.remove(firstVideoHandler.pauseClass);
els.videoWrap[0].classList.remove(firstVideoHandler.endedClass);
// video wrap
if (!els.videoList[0].classList.contains('is-visible')) {
els.videoList[0].classList.add('is-visible');
}
// tooltip
if (!!els.videoWrap[0].tooltip && els.videoWrap[0].tooltip.classList.contains('is-visible')) {
els.videoWrap[0].tooltip.classList.remove('is-visible');
}
// tootip accessibility
utils.offAccessibility(els.videoWrap[0]);
if (!!els.videoWrap[0].tooltip) utils.onAccessibility(els.videoWrap[0].tooltip);
for (let i = 0; i < els.videoWrap.length; i++) {
if (i != 0) {
if (els.videoList[i].classList.contains('is-visible')) {
els.videoList[i].classList.remove('is-visible');
}
if (!els.videoWrap[i].video.paused) {
els.videoWrap[i].video.pause();
els.videoWrap[i].video.currentTime = 0;
}
// tooltip
if (!!els.videoWrap[i].tooltip && els.videoWrap[i].tooltip.classList.contains('is-visible')) {
els.videoWrap[i].tooltip.classList.remove('is-visible');
}
utils.onAccessibility(els.videoWrap[i]);
if (!!els.videoWrap[i].tooltip) utils.onAccessibility(els.videoWrap[i].tooltip);
}
}
// replay cta
els.tutorialReplay.style.display = 'none';
els.tutorialReplay.setAttribute('aria-hidden', true);
els.tutorialReplay.setAttribute('tabindex', -1);
}
};
const eventHandler = {
scroll: function () {
window.addEventListener('scroll', eventList.scrollEvent);
eventList.scrollEvent();
}
}
const setVideos = function () {
objs.videos = [];
for (let i = 0; i < els.videoWrap.length; i++) {
let isVideoWrap = els.videoWrap[i];
objs.videos.push(utils.videoHandler({
wrap: isVideoWrap,
video: isVideoWrap.video,
controller: isVideoWrap.controller,
resetCallback: function () {
if (this.wrap.classList.contains('is-completed')) {
this.wrap.classList.remove('is-completed');
if (this.controller.style.display = 'none') {
this.controller.style.display = '';
}
}
},
playCallback: function () {
els.videoList[this.video.playIndex].removeAttribute('tabindex');
els.videoList[this.video.playIndex].removeAttribute('aria-hidden');
utils.offAccessibility(this.wrap.muteCta);
if (!this.video.muted) {
this.wrap.muteCta.classList.remove('is-unmuted');
this.wrap.muteCta.video.muted = true;
this.wrap.muteCta.blind.innerText = this.wrap.muteCta.getAttribute('data-unmute');
setTagging.unmute(this.wrap.muteCta);
}
this.controller.style.display = 'block';
utils.offAccessibility(this.controller);
setTagging.pause(this.controller);
let nextPlayindex = this.video.playIndex + 1;
if ((els.videos.length - 1) > this.video.playIndex && els.videos[nextPlayindex].readyState < 4) {
if (!els.videos[nextPlayindex].classList.contains('is-video-load-complete')) {
videoLoader.setResponsiveMedia([els.videos[nextPlayindex]]);
}
if (!els.videos[nextPlayindex].coverImage.classList.contains('is-img-load-complete')) {
imageLoader.setResponsiveMedia([els.videos[nextPlayindex].coverImage]);
}
}
},
pauseCallback: function () {
setTagging.play(this.controller);
},
endCallback: function () {
if (!!this.wrap.tooltip && stepInfo[this.video.playIndex].tooltip == 'true') {
let self = this;
if (!!this.wrap.tooltipCta) this.wrap.tooltipCta.removeAttribute('disabled');
if (!!this.wrap.tooltip) this.wrap.tooltip.classList.add('is-visible');
utils.offAccessibility(this.wrap.tooltip);
}
if (!this.wrap.classList.contains('is-completed')) {
this.wrap.classList.add('is-completed');
}
this.controller.style.display = 'none';
if ((els.videos.length - 1) == this.video.playIndex) {
els.tutorialReplay.style.display = 'block';
els.tutorialReplay.removeAttribute('tabindex');
els.tutorialReplay.removeAttribute('aria-hidden');
}
}
}));
}
};
const setTagging = {
play: function (targetController) {
if (targetController.hasAttribute('data-omni')) {
let dataOmni = targetController.getAttribute('data-omni').toLowerCase();
targetController.setAttribute('data-omni', dataOmni.replace('pause', 'play'));
}
if (targetController.hasAttribute('ga-la')) {
let gaLa = targetController.getAttribute('ga-la').toLowerCase();
targetController.setAttribute('ga-la', gaLa.replace('pause', 'play'));
}
},
pause: function (targetController) {
if (targetController.hasAttribute('data-omni')) {
let dataOmni = targetController.getAttribute('data-omni').toLowerCase();
targetController.setAttribute('data-omni', dataOmni.replace('play', 'pause'));
}
if (targetController.hasAttribute('ga-la')) {
let gaLa = targetController.getAttribute('ga-la').toLowerCase();
targetController.setAttribute('ga-la', gaLa.replace('play', 'pause'));
}
},
mute: function (targetCta) {
if (targetCta.hasAttribute('data-omni')) {
let dataOmni = targetCta.getAttribute('data-omni').toLowerCase();
targetCta.setAttribute('data-omni', dataOmni.replace('unmute', 'mute'));
}
if (targetCta.hasAttribute('ga-la')) {
let gaLa = targetCta.getAttribute('ga-la').toLowerCase();
targetCta.setAttribute('ga-la', gaLa.replace('unmute', 'mute'));
}
},
unmute: function (targetCta) {
if (targetCta.hasAttribute('data-omni')) {
let dataOmni = targetCta.getAttribute('data-omni').toLowerCase();
targetCta.setAttribute('data-omni', dataOmni.replace('mute', 'unmute'));
}
if (targetCta.hasAttribute('ga-la')) {
let gaLa = targetCta.getAttribute('ga-la').toLowerCase();
targetCta.setAttribute('ga-la', gaLa.replace('mute', 'unmute'));
}
},
};
return {
init: init
}
})();
})();
;
(function () {
window.flagship.features.interactiveSuggested = (function () {
const utils = window.flagship.common.utils,
resize = window.flagship.common.resize;
let els = {};
let objs = {};
let stepInfo = [];
let scrollProgress = null;
let isPlaySection = null;
const init = function () {
els.section = document.querySelector('.js-suggested-replies');
if (!!els.section) {
setElements();
bindEvents();
}
};
const setElements = function () {
els.interactiveContent = els.section.querySelector('.js-interactive');
els.tutorialVideoContainer = els.section.querySelector('.common-interactive__tutorial');
els.videoList = els.tutorialVideoContainer.querySelectorAll('.common-interactive__tutorial-video');
els.videoWrap = els.tutorialVideoContainer.querySelectorAll('.common-interactive__tutorial-video .common-video');
els.videos = els.tutorialVideoContainer.querySelectorAll('.common-interactive__tutorial-video .common-video__video');
els.tooltipCta = els.tutorialVideoContainer.querySelectorAll('.js-tutorial-tooltip-cta');
els.tutorialReplay = els.tutorialVideoContainer.querySelector('.js-replay-cta');
};
const setProperty = function (el, index) {
el.video = el.querySelector('video');
el.video.videoWrap = el;
el.controller = el.querySelector('.js-video-control');
el.controller.video = el.querySelector('video');
el.alert = el.parentElement.querySelector('.common-tutorial__alert');
el.tooltip = el.parentElement.querySelector('.js-tutorial-tooltip');
el.tooltipCta = el.parentElement.querySelector('.js-tutorial-tooltip-cta');
el.video.playIndex = index;
el.video.coverImage = el.querySelector('.common-video__cover-image');
};
const bindEvents = function () {
for (let i = 0; i < els.videoWrap.length; i++) {
setProperty(els.videoWrap[i], i);
setStepStatus(els.videoList[i])
}
setVideos();
eventList.videoController();
eventList.click();
eventList.setScroller();
eventHandler.scroll();
};
const setStepStatus = function (el) {
stepInfo.push({
alert: el.getAttribute('data-alert'),
tooltip: el.getAttribute('data-tooltip')
});
};
const eventList = {
setScroller: function () {
if (els.interactiveContent.scene == null) {
els.interactiveContent.scene = SCROLLER({
trackElement: els.interactiveContent,
useFixed: false
});
}
},
scrollEvent: function () {
if (els.interactiveContent.scene != null) {
if (els.interactiveContent.classList.contains('is-tutorial-opened')) {
els.interactiveContent.scene.trackAnimation(function () {
scrollProgress = this.progress;
let activeVideo = els.tutorialVideoContainer.querySelector('.is-visible video');
let firstVideoHandler = els.videoWrap[0].video.videoHandler;
let replayStatus = !document.documentElement.classList.contains('low_network') &&
activeVideo.paused &&
!els.videoWrap[0].classList.contains(firstVideoHandler.endedClass) &&
!els.videoWrap[0].classList.contains(firstVideoHandler.pauseClass) &&
scrollProgress > 0 && scrollProgress < 100;
let resetStatus = scrollProgress === 0 || scrollProgress === 100;
if (replayStatus) {
if (els.videoWrap[0].video.readyState == 4 && els.videoWrap[0].video.paused) {
els.videoWrap[0].video.play();
} else {
els.videoWrap[0].video.addEventListener('canplay', function() {
els.videoWrap[0].video.play();
}, {once:true});
}
}
if (resetStatus) {
activeVideo.pause();
activeVideo.currentTime = 0;
eventList.tutorialReset();
}
});
}
}
},
videoController: function () {
for (let i = 0; i < objs.videos.length; i++) {
objs.videos[i].controller.addEventListener('click', function () {
if (this.video.paused) {
this.video.play();
} else {
this.video.pause();
}
});
}
},
nextVideoPlay: function (index) {
if (!!els.videoList[index].tooltip) {
utils.onAccessibility(els.videoList[index].tooltip);
}
els.videoList[index + 1].classList.add('is-visible');
utils.onAccessibility(els.videoList[index]);
if (els.videos[index + 1].readyState > 3) {
els.videos[index + 1].play();
} else {
els.videos[index + 1].addEventListener('loadeddata', function () {
if (this.paused) this.play();
});
}
els.videoList[index].classList.remove('is-visible');
},
click: function () {
let self = this;
for (let i = 0; i < els.tooltipCta.length; i++) {
els.tooltipCta[i].addEventListener('click', function () {
self.nextVideoPlay(i);
});
}
},
tutorialReset: function () {
let firstVideoHandler = els.videoWrap[0].video.videoHandler;
els.videoWrap[0].classList.remove(firstVideoHandler.playClass);
els.videoWrap[0].classList.remove(firstVideoHandler.pauseClass);
els.videoWrap[0].classList.remove(firstVideoHandler.endedClass);
// video wrap
if (!els.videoList[0].classList.contains('is-visible')) {
els.videoList[0].classList.add('is-visible');
}
// tooltip
if (!!els.videoWrap[0].tooltip && els.videoWrap[0].tooltip.classList.contains('is-visible')) {
els.videoWrap[0].tooltip.classList.remove('is-visible');
}
// tootip accessibility
utils.offAccessibility(els.videoWrap[0]);
if (!!els.videoWrap[0].tooltip) utils.onAccessibility(els.videoWrap[0].tooltip);
for (let i = 0; i < els.videoWrap.length; i++) {
if (i != 0) {
if (els.videoList[i].classList.contains('is-visible')) {
els.videoList[i].classList.remove('is-visible');
}
if (!els.videoWrap[i].video.paused) {
els.videoWrap[i].video.pause();
els.videoWrap[i].video.currentTime = 0;
}
// tooltip
if (!!els.videoWrap[i].tooltip && els.videoWrap[i].tooltip.classList.contains('is-visible')) {
els.videoWrap[i].tooltip.classList.remove('is-visible');
}
utils.onAccessibility(els.videoWrap[i]);
if (!!els.videoWrap[i].tooltip) utils.onAccessibility(els.videoWrap[i].tooltip);
}
}
// replay cta
els.tutorialReplay.style.display = 'none';
els.tutorialReplay.setAttribute('aria-hidden', true);
els.tutorialReplay.setAttribute('tabindex', -1);
}
};
const eventHandler = {
scroll: function () {
window.addEventListener('scroll', eventList.scrollEvent);
eventList.scrollEvent();
}
}
const setVideos = function () {
objs.videos = [];
for (let i = 0; i < els.videoWrap.length; i++) {
let isVideoWrap = els.videoWrap[i];
objs.videos.push(utils.videoHandler({
wrap: isVideoWrap,
video: isVideoWrap.video,
controller: isVideoWrap.controller,
resetCallback: function () {
if (this.wrap.classList.contains('is-completed')) {
this.wrap.classList.remove('is-completed');
if (this.controller.style.display = 'none') {
this.controller.style.display = '';
}
}
},
playCallback: function () {
els.videoList[this.video.playIndex].removeAttribute('tabindex');
els.videoList[this.video.playIndex].removeAttribute('aria-hidden');
this.controller.style.display = 'block';
utils.offAccessibility(this.controller);
setTagging.pause(this.controller);
let nextPlayindex = this.video.playIndex + 1;
if ((els.videos.length - 1) > this.video.playIndex && els.videos[nextPlayindex].readyState < 4) {
if (!els.videos[nextPlayindex].classList.contains('is-video-load-complete')) {
videoLoader.setResponsiveMedia([els.videos[nextPlayindex]]);
}
if (!els.videos[nextPlayindex].coverImage.classList.contains('is-img-load-complete')) {
imageLoader.setResponsiveMedia([els.videos[nextPlayindex].coverImage]);
}
}
},
pauseCallback: function () {
setTagging.play(this.controller);
},
endCallback: function () {
if (!!this.wrap.tooltip && stepInfo[this.video.playIndex].tooltip == 'true') {
let self = this;
if (!!this.wrap.tooltipCta) this.wrap.tooltipCta.removeAttribute('disabled');
if (!!this.wrap.tooltip) this.wrap.tooltip.classList.add('is-visible');
utils.offAccessibility(this.wrap.tooltip);
}
if (!this.wrap.classList.contains('is-completed')) {
this.wrap.classList.add('is-completed');
}
this.controller.style.display = 'none';
if ((els.videos.length - 1) == this.video.playIndex) {
els.tutorialReplay.style.display = 'block';
els.tutorialReplay.removeAttribute('tabindex');
els.tutorialReplay.removeAttribute('aria-hidden');
}
}
}));
}
};
const setTagging = {
play: function (targetController) {
if (targetController.hasAttribute('data-omni')) {
let dataOmni = targetController.getAttribute('data-omni').toLowerCase();
targetController.setAttribute('data-omni', dataOmni.replace('pause', 'play'));
}
if (targetController.hasAttribute('ga-la')) {
let gaLa = targetController.getAttribute('ga-la').toLowerCase();
targetController.setAttribute('ga-la', gaLa.replace('pause', 'play'));
}
},
pause: function (targetController) {
if (targetController.hasAttribute('data-omni')) {
let dataOmni = targetController.getAttribute('data-omni').toLowerCase();
targetController.setAttribute('data-omni', dataOmni.replace('play', 'pause'));
}
if (targetController.hasAttribute('ga-la')) {
let gaLa = targetController.getAttribute('ga-la').toLowerCase();
targetController.setAttribute('ga-la', gaLa.replace('play', 'pause'));
}
}
};
return {
init: init
}
})();
})();
;
(function () {
window.flagship.features.interactiveNoteAssist = (function () {
const utils = window.flagship.common.utils,
resize = window.flagship.common.resize;
let els = {};
let objs = {};
let stepInfo = [];
let scrollProgress = null;
let isPlaySection = null;
const init = function () {
els.section = document.querySelector('.js-note-assist');
if (!!els.section) {
setElements();
bindEvents();
}
};
const setElements = function () {
els.interactiveContent = els.section.querySelector('.js-interactive');
els.tutorialVideoContainer = els.section.querySelector('.common-interactive__tutorial');
els.videoList = els.tutorialVideoContainer.querySelectorAll('.common-interactive__tutorial-video');
els.videoWrap = els.tutorialVideoContainer.querySelectorAll('.common-interactive__tutorial-video .common-video');
els.videos = els.tutorialVideoContainer.querySelectorAll('.common-interactive__tutorial-video .common-video__video');
els.tooltipCta = els.tutorialVideoContainer.querySelectorAll('.js-tutorial-tooltip-cta');
els.tutorialReplay = els.tutorialVideoContainer.querySelector('.js-replay-cta');
};
const setProperty = function (el, index) {
el.video = el.querySelector('video');
el.video.videoWrap = el;
el.controller = el.querySelector('.js-video-control');
el.controller.video = el.querySelector('video');
el.alert = el.parentElement.querySelector('.common-tutorial__alert');
el.tooltip = el.parentElement.querySelector('.js-tutorial-tooltip');
el.tooltipCta = el.parentElement.querySelector('.js-tutorial-tooltip-cta');
el.video.playIndex = index;
el.video.coverImage = el.querySelector('.common-video__cover-image');
};
const bindEvents = function () {
for (let i = 0; i < els.videoWrap.length; i++) {
setProperty(els.videoWrap[i], i);
setStepStatus(els.videoList[i])
}
setVideos();
eventList.videoController();
eventList.click();
eventList.setScroller();
eventHandler.scroll();
};
const setStepStatus = function (el) {
stepInfo.push({
alert: el.getAttribute('data-alert'),
tooltip: el.getAttribute('data-tooltip')
});
};
const eventList = {
setScroller: function () {
if (els.interactiveContent.scene == null) {
els.interactiveContent.scene = SCROLLER({
trackElement: els.interactiveContent,
useFixed: false
});
}
},
scrollEvent: function () {
if (els.interactiveContent.scene != null) {
if (els.interactiveContent.classList.contains('is-tutorial-opened')) {
els.interactiveContent.scene.trackAnimation(function () {
scrollProgress = this.progress;
let activeVideo = els.tutorialVideoContainer.querySelector('.is-visible video');
let firstVideoHandler = els.videoWrap[0].video.videoHandler;
let replayStatus = !document.documentElement.classList.contains('low_network') &&
activeVideo.paused &&
!els.videoWrap[0].classList.contains(firstVideoHandler.endedClass) &&
!els.videoWrap[0].classList.contains(firstVideoHandler.pauseClass) &&
scrollProgress > 0 && scrollProgress < 100;
let resetStatus = scrollProgress === 0 || scrollProgress === 100;
if (replayStatus) {
if (els.videoWrap[0].video.readyState == 4 && els.videoWrap[0].video.paused) {
els.videoWrap[0].video.play();
} else {
els.videoWrap[0].video.addEventListener('canplay', function() {
els.videoWrap[0].video.play();
}, {once:true});
}
}
if (resetStatus) {
activeVideo.pause();
activeVideo.currentTime = 0;
eventList.tutorialReset();
}
});
}
}
},
videoController: function () {
for (let i = 0; i < objs.videos.length; i++) {
objs.videos[i].controller.addEventListener('click', function () {
if (this.video.paused) {
this.video.play();
} else {
this.video.pause();
}
});
}
},
nextVideoPlay: function (index) {
if (!!els.videoList[index].tooltip) {
utils.onAccessibility(els.videoList[index].tooltip);
}
els.videoList[index + 1].classList.add('is-visible');
utils.onAccessibility(els.videoList[index]);
if (els.videos[index + 1].readyState > 3) {
els.videos[index + 1].play();
} else {
els.videos[index + 1].addEventListener('loadeddata', function () {
if (this.paused) this.play();
});
}
els.videoList[index].classList.remove('is-visible');
},
click: function () {
let self = this;
for (let i = 0; i < els.tooltipCta.length; i++) {
els.tooltipCta[i].addEventListener('click', function () {
self.nextVideoPlay(i);
});
}
},
tutorialReset: function () {
let firstVideoHandler = els.videoWrap[0].video.videoHandler;
els.videoWrap[0].classList.remove(firstVideoHandler.playClass);
els.videoWrap[0].classList.remove(firstVideoHandler.pauseClass);
els.videoWrap[0].classList.remove(firstVideoHandler.endedClass);
// video wrap
if (!els.videoList[0].classList.contains('is-visible')) {
els.videoList[0].classList.add('is-visible');
}
// tooltip
if (!!els.videoWrap[0].tooltip && els.videoWrap[0].tooltip.classList.contains('is-visible')) {
els.videoWrap[0].tooltip.classList.remove('is-visible');
}
// tootip accessibility
utils.offAccessibility(els.videoWrap[0]);
if (!!els.videoWrap[0].tooltip) utils.onAccessibility(els.videoWrap[0].tooltip);
for (let i = 0; i < els.videoWrap.length; i++) {
if (i != 0) {
if (els.videoList[i].classList.contains('is-visible')) {
els.videoList[i].classList.remove('is-visible');
}
if (!els.videoWrap[i].video.paused) {
els.videoWrap[i].video.pause();
els.videoWrap[i].video.currentTime = 0;
}
// tooltip
if (!!els.videoWrap[i].tooltip && els.videoWrap[i].tooltip.classList.contains('is-visible')) {
els.videoWrap[i].tooltip.classList.remove('is-visible');
}
utils.onAccessibility(els.videoWrap[i]);
if (!!els.videoWrap[i].tooltip) utils.onAccessibility(els.videoWrap[i].tooltip);
}
}
// replay cta
els.tutorialReplay.style.display = 'none';
els.tutorialReplay.setAttribute('aria-hidden', true);
els.tutorialReplay.setAttribute('tabindex', -1);
}
};
const eventHandler = {
scroll: function () {
window.addEventListener('scroll', eventList.scrollEvent);
eventList.scrollEvent();
}
}
const setVideos = function () {
objs.videos = [];
for (let i = 0; i < els.videoWrap.length; i++) {
let isVideoWrap = els.videoWrap[i];
objs.videos.push(utils.videoHandler({
wrap: isVideoWrap,
video: isVideoWrap.video,
controller: isVideoWrap.controller,
resetCallback: function () {
if (this.wrap.classList.contains('is-completed')) {
this.wrap.classList.remove('is-completed');
if (this.controller.style.display = 'none') {
this.controller.style.display = '';
}
}
},
playCallback: function () {
els.videoList[this.video.playIndex].removeAttribute('tabindex');
els.videoList[this.video.playIndex].removeAttribute('aria-hidden');
this.controller.style.display = 'block';
utils.offAccessibility(this.controller);
setTagging.pause(this.controller);
let nextPlayindex = this.video.playIndex + 1;
if ((els.videos.length - 1) > this.video.playIndex && els.videos[nextPlayindex].readyState < 4) {
if (!els.videos[nextPlayindex].classList.contains('is-video-load-complete')) {
videoLoader.setResponsiveMedia([els.videos[nextPlayindex]]);
}
if (!els.videos[nextPlayindex].coverImage.classList.contains('is-img-load-complete')) {
imageLoader.setResponsiveMedia([els.videos[nextPlayindex].coverImage]);
}
}
},
pauseCallback: function () {
setTagging.play(this.controller);
},
endCallback: function () {
if (!!this.wrap.tooltip && stepInfo[this.video.playIndex].tooltip == 'true') {
if (!!this.wrap.tooltipCta) this.wrap.tooltipCta.removeAttribute('disabled');
if (!!this.wrap.tooltip) this.wrap.tooltip.classList.add('is-visible');
utils.offAccessibility(this.wrap.tooltip);
}
if (!this.wrap.classList.contains('is-completed')) {
this.wrap.classList.add('is-completed');
}
this.controller.style.display = 'none';
if ((els.videos.length - 1) == this.video.playIndex) {
els.tutorialReplay.style.display = 'block';
els.tutorialReplay.removeAttribute('tabindex');
els.tutorialReplay.removeAttribute('aria-hidden');
}
}
}));
}
};
const setTagging = {
play: function (targetController) {
if (targetController.hasAttribute('data-omni')) {
let dataOmni = targetController.getAttribute('data-omni').toLowerCase();
targetController.setAttribute('data-omni', dataOmni.replace('pause', 'play'));
}
if (targetController.hasAttribute('ga-la')) {
let gaLa = targetController.getAttribute('ga-la').toLowerCase();
targetController.setAttribute('ga-la', gaLa.replace('pause', 'play'));
}
},
pause: function (targetController) {
if (targetController.hasAttribute('data-omni')) {
let dataOmni = targetController.getAttribute('data-omni').toLowerCase();
targetController.setAttribute('data-omni', dataOmni.replace('play', 'pause'));
}
if (targetController.hasAttribute('ga-la')) {
let gaLa = targetController.getAttribute('ga-la').toLowerCase();
targetController.setAttribute('ga-la', gaLa.replace('play', 'pause'));
}
}
};
return {
init: init
}
})();
})();
;
(function () {
window.flagship.features.interactive = (function () {
const utils = window.flagship.common.utils,
resize = window.flagship.common.resize;
let els = {},
prevDevice = null,
currDevice = resize.checkResolution(),
scrollProgress = null;
const init = function () {
els.interactiveContents = document.querySelectorAll('.js-interactive');
if (!!els.interactiveContents && els.interactiveContents.length > 0) {
for (let i = 0; i < els.interactiveContents.length; i++) {
setProperty(els.interactiveContents[i], i);
eventList.setIntroVideo(els.interactiveContents[i]);
eventList.setIntroScene(els.interactiveContents[i]);
bindEvents(els.interactiveContents[i], i);
}
}
};
const setProperty = function (content, index) {
// introVideo
content.index = index;
content.introVideo = content.querySelector('.js-interactive-intro-video video');
content.introVideo.videoWrap = content.querySelector('.js-interactive-intro-video');
content.introVideo.wrap = content.querySelector('.js-interactive-intro-video .js-video-wrap');
content.introVideo.parentWrap = content.parentElement;
content.introVideo.controllerCta = content.introVideo.videoWrap.querySelector('.js-video-control');
content.introVideo.controllerCta.video = content.introVideo;
content.introVideo.tooltip = content.querySelector('.js-tutorial-tooltip');
content.introVideo.tooltipCta = content.querySelector('.js-tutorial-tooltip-cta');
content.introVideo.tooltipCta.parentWrap = content;
content.tutorialContentWrap = content.querySelectorAll('.js-tutorial-video');
content.tutorialContentWrap.tooltip = content.querySelectorAll('.js-tutorial-video .js-tutorial-tooltip');
// start, reverse point
content.introVideo.wrap.startPoint = !!content.introVideo.wrap.getAttribute('data-start-point') ? parseInt(content.introVideo.wrap.getAttribute('data-start-point')) : undefined;
content.introVideo.wrap.reversePoint = !!content.introVideo.wrap.getAttribute('data-reverse-point') ? parseInt(content.introVideo.wrap.getAttribute('data-reverse-point')) : undefined;
content.introVideo.wrap.moStartPoint = !!content.introVideo.wrap.getAttribute('data-mo-start-point') ? parseInt(content.introVideo.wrap.getAttribute('data-mo-start-point')) : undefined;
content.introVideo.wrap.moReversePoint = !!content.introVideo.wrap.getAttribute('data-mo-reverse-point') ? parseInt(content.introVideo.wrap.getAttribute('data-mo-reverse-point')) : undefined;
// replayCta
content.replayCta = content.querySelector('.js-replay-cta');
content.replayCta.parentWrap = content;
};
const bindEvents = function (content, i) {
eventHandler.click.introTooltipCta(content.introVideo.tooltipCta);
eventHandler.click.replayCta(content.replayCta);
eventHandler.click.videoController(content.introVideo.controllerCta);
eventHandler.scroll(content);
eventList.scroll(content);
resize.add(function (currRes) {
eventList.resize(currRes, content);
});
};
const eventList = {
setIntroVideo: function (content) {
utils.videoHandler({
playType: 'scrollPlay',
startPoint: content.introVideo.wrap.startPoint,
reversePoint: content.introVideo.wrap.reversePoint,
wrap: content.introVideo.wrap,
video: content.introVideo,
controller: content.introVideo.controllerCta,
resetCallback: function () {
if (this.wrap.classList.contains('is-completed')) {
this.wrap.classList.remove('is-completed');
}
if (this.wrap.classList.contains('is-started')) {
this.wrap.classList.remove('is-started');
}
utils.offAccessibility(content.introVideo.videoWrap);
if (content.introVideo.controllerCta.style.display == 'none') {
content.introVideo.controllerCta.style.display = 'block';
}
if (this.video.tooltip.classList.contains('is-visible')) {
this.video.tooltip.classList.remove('is-visible');
}
this.video.tooltip.classList.remove('is-visible');
utils.onAccessibility(this.video.tooltip);
},
playCallback: function () {
if (!this.wrap.classList.contains('is-started')) {
this.wrap.classList.add('is-started');
}
setTagging.pause(this.controller);
let videoWrap = content.tutorialContentWrap[0].querySelector('.js-video-wrap');
videoWrap.coverImg = videoWrap.querySelector('.common-video__cover-image');
videoWrap.video = videoWrap.querySelector('video');
if (!!videoWrap.coverImg && !videoWrap.coverImg.classList.contains('is-img-load-complete')) {
imageLoader.setResponsiveMedia([videoWrap.coverImg]);
}
if (!!videoWrap.video && !videoWrap.video.classList.contains('is-video-load-complete')) {
videoLoader.setResponsiveMedia([videoWrap.video]);
}
},
pauseCallback: function () {
setTagging.play(this.controller);
},
endCallback: function () {
let self = this;
if (!this.wrap.classList.contains('is-completed')) {
this.wrap.classList.add('is-completed');
}
this.video.tooltip.classList.add('is-visible');
utils.offAccessibility(this.video.tooltip);
let isPlaySection = null;
isPlaySection = scrollProgress > 30 && scrollProgress < 60;
if (isPlaySection) {
this.video.tooltipCta.focus();
setTimeout(function () {
self.video.tooltipCta.focus();
self.controller.style.display = 'none';
}, 300);
}
}
});
},
setIntroScene: function (content) {
content.introVideo.scene = SCROLLER({
trackElement: content.introVideo,
useFixed: false,
resize: utils.detector.isTouchDevice ? false : true
});
},
scroll: function (content) {
if (!content.classList.contains('is-tutorial-opened')) {
content.introVideo.scene.trackAnimation(function () {
content.introVideo.videoHandler.scrollActive(this.progress);
scrollProgress = this.progress;
let pauseStatus = (this.wheelDirection == 'up' && scrollProgress <= 30) || (this.wheelDirection == 'down' && scrollProgress >= 60);
if (pauseStatus && !content.introVideo.paused) {
content.introVideo.pause();
}
});
}
},
click: {
introVideoTooltipCta: function () {
let content = this.parentWrap;
content.classList.add('is-tutorial-opened');
utils.onAccessibility(content.introVideo.videoWrap);
content.tutorialContentWrap[0].classList.add('is-visible');
utils.offAccessibility(content.tutorialContentWrap[0]);
content.tutorialContentWrap[0].querySelector('.common-video__control').focus();
setTimeout(function () {
content.tutorialContentWrap[0].querySelector('.common-video__control').focus();
}, 300);
content.introVideo.tooltip.classList.remove('is-visible');
let videoWrap = content.tutorialContentWrap[0].querySelector('.js-video-wrap');
videoWrap.video.play();
},
replayCta: function () {
let content = this.parentWrap;
content.introVideo.tooltip.classList.remove('is-visible');
utils.onAccessibility(content.introVideo.tooltip);
utils.offAccessibility(content.introVideo.videoWrap);
content.introVideo.controllerCta.style.display = 'block';
content.introVideo.controllerCta.focus();
setTimeout(function () {
content.introVideo.controllerCta.focus();
}, 300);
content.replayCta.style.display = 'none';
content.replayCta.setAttribute('aria-hidden', true);
content.replayCta.setAttribute('tabindex', -1);
for (let i = 0; i < content.tutorialContentWrap.length; i++) {
content.tutorialContentWrap[i].classList.remove('is-visible');
if (!!content.tutorialContentWrap.tooltip[i]) {
content.tutorialContentWrap.tooltip[i].classList.remove('is-visible');
}
utils.onAccessibility(content.tutorialContentWrap[i]);
setTimeout(function () {
content.tutorialContentWrap[i].querySelector('video').currentTime = 0;
}, 300);
}
content.classList.remove('is-tutorial-opened');
content.introVideo.play();
},
videoController: function (e) {
if (e.target == e.currentTarget) {
if (e.currentTarget.video.paused) {
e.currentTarget.video.play();
} else {
e.currentTarget.video.pause();
}
}
},
},
reset: function (content) {
if (content.classList.contains('is-tutorial-opened')) {
content.classList.remove('is-tutorial-opened');
}
// replay cta
if (content.replayCta.style.display == 'block') {
content.replayCta.style.display = 'none';
content.replayCta.setAttribute('aria-hidden', true);
content.replayCta.setAttribute('tabindex', -1);
}
// tutorial video
let tutorialWrap = content.tutorialContentWrap;
for (let i = 0; i < tutorialWrap.length; i++) {
tutorialWrap[i].classList.remove('is-visible');
utils.onAccessibility(tutorialWrap[i]);
// video
tutorialWrap[i].video = tutorialWrap[i].querySelector('video');
if (!tutorialWrap[i].video.paused) {
tutorialWrap[i].video.pause();
tutorialWrap[i].video.currentTime = 0;
}
// tooltip
if (!!tutorialWrap.tooltip[i]) {
if (tutorialWrap.tooltip[i].classList.contains('is-visible')) {
tutorialWrap.tooltip[i].classList.remove('is-visible');
}
utils.onAccessibility(tutorialWrap.tooltip[i]);
}
}
// intro video
utils.offAccessibility(content.introVideo.videoWrap);
if (content.introVideo.controllerCta.style.display == 'none') {
content.introVideo.controllerCta.style.display = 'block';
}
// intro tooltip
if (content.introVideo.tooltip.classList.contains('is-visible')) {
content.introVideo.tooltip.classList.remove('is-visible')
}
utils.onAccessibility(content.introVideo.tooltip);
if (scrollProgress >= 30 && scrollProgress <= 60) {
if (content.introVideo.paused) {
content.introVideo.currentTime = 0;
content.introVideo.play();
}
}
},
resize: function (currRes, content) {
currDevice = currRes;
if (prevDevice != currDevice) {
eventList.reset(content);
}
prevDevice = currDevice;
},
};
const eventHandler = {
click: {
replayCta: function (replayCta) {
replayCta.addEventListener('click', eventList.click.replayCta);
},
introTooltipCta: function (introTooltipCta) {
introTooltipCta.addEventListener('click', eventList.click.introVideoTooltipCta);
},
videoController: function (introVideoController) {
introVideoController.addEventListener('click', eventList.click.videoController);
}
},
scroll: function (content) {
window.addEventListener('scroll', function () {
eventList.scroll(content);
});
}
};
const setTagging = {
play: function (targetController) {
if (targetController.hasAttribute('data-omni')) {
let dataOmni = targetController.getAttribute('data-omni').toLowerCase();
targetController.setAttribute('data-omni', dataOmni.replace('pause', 'play'));
}
if (targetController.hasAttribute('ga-la')) {
let gaLa = targetController.getAttribute('ga-la').toLowerCase();
targetController.setAttribute('ga-la', gaLa.replace('pause', 'play'));
}
},
pause: function (targetController) {
if (targetController.hasAttribute('data-omni')) {
let dataOmni = targetController.getAttribute('data-omni').toLowerCase();
targetController.setAttribute('data-omni', dataOmni.replace('play', 'pause'));
}
if (targetController.hasAttribute('ga-la')) {
let gaLa = targetController.getAttribute('ga-la').toLowerCase();
targetController.setAttribute('ga-la', gaLa.replace('play', 'pause'));
}
}
};
return {
init: init
}
})();
})();
;
(function () {
window.flagship.features.moveFeature = (function () {
const utils = window.flagship.common.utils;
let els = {};
const init = function () {
els.jumpCta = document.querySelectorAll('.js-jump-cta');
if (!!els.jumpCta) {
setProperty();
bindEvents();
}
};
const setProperty = function () {
for (let i = 0; i < els.jumpCta.length; i++) {
els.jumpCta[i].sectionId = els.jumpCta[i].getAttribute('href');
els.jumpCta[i].section = document.querySelector(`${els.jumpCta[i].sectionId}`);
els.jumpCta[i].returnCta = els.jumpCta[i].section.querySelector('.js-return-cta');
els.jumpCta[i].returnCta.jumpCta = els.jumpCta[i];
els.jumpCta[i].returnCta.section = els.jumpCta[i].section;
}
};
const bindEvents = function () {
eventHandler.click();
eventList.setScene();
eventHandler.scroll();
};
const eventHandler = {
click: function () {
for (let i = 0; i < els.jumpCta.length; i++) {
els.jumpCta[i].addEventListener('click', eventList.clickJumpCta);
els.jumpCta[i].returnCta.addEventListener('click', eventList.clickReturnCta);
}
},
scroll: function () {
window.addEventListener('scroll', eventList.hideReturnCta);
}
};
const eventList = {
setScene: function () {
for(let i=0; i swiper.slides.length -1 ? swiper.slides.length -1 : index + 1;
let videoLength = swiper.el.querySelectorAll('video').length - 1;
let imageLength = swiper.el.querySelectorAll('img').length - 1;
let videoloadComplateLength = swiper.el.querySelectorAll('.is-video-load-complete').length - 1;
let imageloadComplateLength = swiper.el.querySelectorAll('.is-img-load-complete').length - 1;
let nextVideo = swiper.slides[isIndex].querySelector('video');
let nextImage = swiper.slides[isIndex].querySelector('img');
if (videoloadComplateLength != videoLength) {
if (!!nextVideo) {
videoLoader.setResponsiveMedia([nextVideo]);
}
}
if (imageloadComplateLength != imageLength) {
if (!!nextImage) {
imageLoader.setResponsiveMedia([nextImage]);
}
}
},
resetVideo: function(swiper) {
for (let i = 0; i < swiper.slides.length; i++) {
let isVideo = swiper.slides[i].video;
if (!!isVideo && !isVideo.paused) {
isVideo.pause();
isVideo.currentTime = 0;
};
};
},
getCarouselSizeInfo: function(swiper) {
let slideLength = swiper.slides.length;
let slideWidth = swiper.slides[0].clientWidth;
let slideMargin = parseInt(window.getComputedStyle(swiper.slides[0]).margin.split(' ')[isRtl ? 3 : 1]);
let slideSize = slideWidth + slideMargin;
let maxMoveSize = ((slideSize * slideLength) - slideMargin) - swiper.wrapperEl.clientWidth;
let viewWidth = swiper.wrapperEl.clientWidth;
let viewLength = parseInt((viewWidth + slideMargin)/slideSize);
let lastBeforeSize = slideLength == 2 ? 0 : Math.abs((maxMoveSize - slideSize)) + Math.abs((viewWidth - slideWidth));
let isMoveSize = Math.abs(parseInt(window.getComputedStyle(swiper.wrapperEl).transform.split(',')[4]));
return {
slideWidth: slideWidth,
slideMargin: slideMargin,
slideSize: slideSize,
maxMoveSize: maxMoveSize,
viewWidth: viewWidth,
viewLength: viewLength,
lastBeforeSize: lastBeforeSize,
isMoveSize: isMoveSize
}
},
setDimmedSlide: function(swiper) {
if (currDevice != 'mobile') {
for (let i = 0; i < swiper.slides.length; i++) {
let dimmedSlide = (swiper.activeIndex) > i || (swiper.activeIndex + (eventList.getCarouselSizeInfo(swiper).viewLength - 1)) < i;
if (dimmedSlide) {
swiper.slides[i].classList.add(dimmedClass);
} else {
swiper.slides[i].classList.remove(dimmedClass);
}
}
}
},
slideChange: function () {
accessibility.slide(this);
eventList.resetVideo(this);
if (eventList.getCarouselSizeInfo(this).viewLength > 0 && currDevice != 'mobile') eventList.setDimmedSlide(this);
if (this.realIndex > 0) eventList.setMedia(this, this.realIndex);
},
transitionEnd: function() {
if (this.slides.length < 3 && currDevice == 'mobile') return;
setTimeout(() => {
let carouselInfo = eventList.getCarouselSizeInfo(this);
let lastIndex = this.slides.length -1;
let lastSlide = this.slides[lastIndex];
let lastBeforeSlide = this.slides[lastIndex - 1];
if (carouselInfo.isMoveSize > carouselInfo.lastBeforeSize || carouselInfo.maxMoveSize == carouselInfo.isMoveSize) {
eventList.resetVideo(this);
lastSlide.classList.add('is-last-slide');
lastBeforeSlide.classList.add('is-dimmed');
lastSlide.classList.remove('is-dimmed');
utils.offAccessibility(this.slides[lastIndex]);
utils.onAccessibility(this.slides[lastIndex - 1]);
} else if (lastSlide.classList.contains('is-last-slide') && carouselInfo.lastBeforeSize == carouselInfo.isMoveSize) {
eventList.resetVideo(this);
lastSlide.classList.add('is-dimmed');
lastSlide.classList.remove('is-last-slide');
lastBeforeSlide.classList.remove('is-dimmed');
utils.onAccessibility(this.slides[lastIndex]);
utils.offAccessibility(this.slides[lastIndex - 1]);
}
let swiperActiveSlide = els.section.querySelector('.swiper-slide-active');
let lastSlideActive = els.section.querySelector('.is-last-slide');
let isActiveSlide = !!lastSlideActive ? lastSlideActive : swiperActiveSlide;
let isActiveVideo = isActiveSlide.querySelector('video');
if (!!isActiveVideo && !isLowBand) isActiveVideo.play()
}, 0);
},
setScene: function() {
els.section.scene = SCROLLER({
trackElement: els.section
});
},
setVideoType: function() {
if (!!els.videos) {
for (let i = 0; i < els.videos.length; i++) {
els.videos[i].videoHandler.playType = 'scrollPlay';
}
}
},
scroll: function() {
els.section.scene.trackAnimation(function() {
let swiperActiveSlide = els.section.querySelector('.swiper-slide-active');
let lastSlideActive = els.section.querySelector('.is-last-slide');
let isActiveSlide = !!lastSlideActive ? lastSlideActive : swiperActiveSlide;
let isActiveVideo = isActiveSlide.querySelector('video');
if (!!isActiveVideo && !isLowBand) isActiveVideo.videoHandler.scrollActive(this.progress);
});
}
};
const accessibility = {
slide: function (swiper) {
for (let i = 0; i < swiper.slides.length; i++) {
if (i != swiper.activeIndex) {
utils.onAccessibility(swiper.slides[i]);
} else {
utils.offAccessibility(swiper.slides[i]);
}
}
}
};
return {
init: init
}
})();
})();
;
(function () {
window.flagship.features.viewer = (function () {
const utils = window.flagship.common.utils,
resize = window.flagship.common.resize,
common = window.flagship.features.common,
isLow = utils.isLowNetwork();
let els = {},
currDevice = resize.checkResolution();
const init = function () {
// els.viewerBtn = document.querySelector('.viewer-btn');
els.section = document.querySelector('.js-colors');
els.popup = document.querySelector('.js-viewer');
if (!!isLow) {
if (!els.viewerBtn) return;
els.currentWrap = els.popup;
setElements();
setProperty();
popupEvents.set();
bindEvents();
} else {
if (!els.section) return;
els.currentWrap = els.section;
setElements();
setProperty();
bindEvents();
}
};
const setElements = function () {
els.wrapEl = document.querySelector('#wrap');
els.contents = document.querySelector('#contents');
// popup
els.popupWrap = els.currentWrap.querySelector('.js-viewer-wrap');
els.popupInner = els.currentWrap.querySelector('.js-viewer-inner');
els.closeCta = els.currentWrap.querySelector('.js-viewer-close');
els.popupContents = els.currentWrap.querySelector('.js-viewer-contents');
// popup-scroll
els.popupScroll = els.currentWrap.querySelector('.js-viewer-scroll');
els.popupScrollUpBtn = els.currentWrap.querySelector('.js-scroll-up');
els.popupScrollDownBtn = els.currentWrap.querySelector('.js-scroll-down');
// viewer
els.viewerIframe = els.currentWrap.querySelector('iframe');
els.foldBtn = els.currentWrap.querySelector('.js-fold-btn');
els.resetBtn = els.currentWrap.querySelector('.js-reset-btn');
// angle preset
els.presetOpen = els.currentWrap.querySelector('.js-preset-open');
els.presetClose = els.currentWrap.querySelector('.js-preset-close');
els.presetLayer = els.currentWrap.querySelector('.js-preset-layer');
els.angleCta = els.currentWrap.querySelectorAll('.js-angle-cta');
};
const setProperty = function () {
// timeout
els.resizeTimeout = null;
els.resizeInnerTimeout = null;
els.viewerOpener = null;
els.viewerIframe.isHash = false;
els.viewerIframe.isIntroposeReady = false;
els.viewerIframe.isFold = false;
els.viewerIframe.resetTimeout = null;
};
const bindEvents = function () {
eventHandler.load();
eventHandler.message();
eventHandler.click();
resize.add(eventList.resize);
if (!isLow) {
eventList.setScene();
}
};
const eventHandler = {
load: function () {
window.addEventListener('DOMContentLoaded', eventList.load, {
once: true
});
},
message: function () {
window.addEventListener('message', eventList.receiveV3DMessage, false);
},
click: function () {
if (!!isLow) {
els.popupScroll.addEventListener('click', eventList.clickLayerScroll);
}
els.foldBtn && els.foldBtn.addEventListener('click', eventList.clickFold);
els.resetBtn && els.resetBtn.addEventListener('click', eventList.clickReset);
els.presetOpen && els.presetOpen.addEventListener('click', eventList.openPresetPopup);
for (let i = 0; i < els.angleCta.length; i++) {
els.angleCta[i].addEventListener('click', eventList.setAngle);
}
els.contents.addEventListener('click', function (e) {
if (e.target.classList.contains('js-reset-btn') || e.target.classList.contains('js-fold-btn') || e.target.classList.contains('js-preset-open') || e.target.closest('.js-preset-layer')) return;
eventList.closePresetPopup();
});
},
scroll: function () {
window.addEventListener('scroll', eventList.runIntroPose);
}
};
const eventList = {
load: function () {
if (!!isLow) {
eventList.innerWrapHeight();
eventList.layerScroll();
}
accessibility.fold.ariaLabel();
eventList.setFoldClass();
},
receiveV3DMessage: function (e) {
if (e.data == 'V3D.state.popOpen') {
if (currDevice.indexOf('mobile') > -1 || currDevice == 'tablet') {
if (els.closeCta) {
if (!els.popupWrap.classList.contains('is-popup-opened')) els.popupWrap.classList.add('is-popup-opened');
els.closeCta.setAttribute('tabindex', '-1');
els.closeCta.setAttribute('aria-hidden', 'true');
els.closeCta.setAttribute('disabled', 'disabled');
}
}
} else if (e.data == 'V3D.state.popClose') {
if (currDevice.indexOf('mobile') > -1 || currDevice == 'tablet') {
if (els.closeCta) {
if (els.popupWrap.classList.contains('is-popup-opened')) els.popupWrap.classList.remove('is-popup-opened');
els.closeCta.removeAttribute('tabindex');
els.closeCta.removeAttribute('aria-hidden');
els.closeCta.removeAttribute('disabled');
}
}
} else if (e.data == 'V3D.state.introPose.ready') {
if (!isLow) {
els.viewerIframe.isIntroposeReady = true;
eventHandler.scroll();
eventList.runIntroPose();
} else {
els.viewerIframe && els.viewerIframe.contentWindow.postMessage('V3D.introPose.run', '*');
}
} else if (e.data == 'V3D.state.localData.ready') {
els.viewerIframe && els.viewerIframe.contentWindow.postMessage(JSON.stringify(V3DLOCALDATA), '*');
} else if (e.data == 'V3D.state.actionPose.0') {
els.viewerIframe.isFold = true;
eventList.setFoldClass();
} else if (e.data == 'V3D.state.actionPose.1') {
els.viewerIframe.isFold = false;
eventList.setFoldClass();
} else if (e.data == 'V3D.event.pointerdown') {
eventList.closePresetPopup();
}
},
resize: function (currRes) {
currDevice = currRes;
if (utils.detector.isTouchDevice && !utils.detector.isIosDevice) eventList.innerWrapHeight();
eventList.layerScroll();
},
innerWrapHeight: function () {
clearTimeout(els.resizeInnerTimeout);
els.resizeInnerTimeout = setTimeout(function () {
if (els.popupInner) {
els.popupInner.style.height = parseInt(window.innerHeight * 0.9) + 'px';
}
}, 0);
},
layerScroll: function () {
clearTimeout(els.resizeTimeout);
els.resizeTimeout = setTimeout(function () {
eventList.setLayerScroll();
}, 300);
},
setLayerScroll: function () {
if (!els.popupContents) return;
if (els.popupContents.scrollHeight > els.popupContents.clientHeight) {
utils.offAccessibility(els.popupScroll);
els.popupScroll && els.popupScroll.classList.add('is-scroll-btn');
} else {
utils.onAccessibility(els.popupScroll);
els.popupScroll && els.popupScroll.classList.remove('is-scroll-btn');
}
},
clickLayerScroll: function (e) {
e && e.preventDefault();
if (e.target.matches('.js-scroll-btn')) {
let scrollDown = e.target.classList.contains('js-scroll-down'),
$popupContents = $(els.popupContents);
if (scrollDown) {
$popupContents.stop().animate({
scrollTop: $popupContents.scrollTop() + 100
}, {
duration: 300,
complete: function () {
eventList.updateLayerScroll(true);
}
});
} else {
$popupContents.stop().animate({
scrollTop: $popupContents.scrollTop() - 100
}, {
duration: 300,
complete: function () {
eventList.updateLayerScroll(true);
}
});
}
}
},
updateLayerScroll: function (isClicked) {
const offsetTop = els.popupContents.scrollTop,
layerBottom = els.popupContents.scrollHeight - els.popupContents.clientHeight;
els.popupScrollUpBtn.removeAttribute('tabindex');
els.popupScrollUpBtn.removeAttribute('aria-hidden');
els.popupScrollUpBtn.removeAttribute('disabled');
els.popupScrollDownBtn.removeAttribute('tabindex');
els.popupScrollDownBtn.removeAttribute('aria-hidden');
els.popupScrollDownBtn.removeAttribute('disabled');
if (offsetTop == 0) {
isClicked && els.popupScrollDownBtn && els.popupScrollDownBtn.focus();
els.popupScrollUpBtn.setAttribute('tabindex', '-1');
els.popupScrollUpBtn.setAttribute('aria-hidden', 'true');
els.popupScrollUpBtn.setAttribute('disabled', 'disabled');
} else if (offsetTop >= layerBottom - 1) {
isClicked && els.popupScrollUpBtn && els.popupScrollUpBtn.focus();
els.popupScrollDownBtn.setAttribute('tabindex', '-1');
els.popupScrollDownBtn.setAttribute('aria-hidden', 'true');
els.popupScrollDownBtn.setAttribute('disabled', 'disabled');
}
},
setScene: function () {
els.sceneObj = SCROLLER({
trackElement: els.section,
useFixed: false
});
},
runIntroPose: function () {
els.sceneObj.trackAnimation(function () {
let progress = currDevice.indexOf('mobile') > -1 ? 50 : 30;
if (this.progress >= progress && !!els.viewerIframe.isIntroposeReady) {
els.viewerIframe && els.viewerIframe.contentWindow.postMessage('V3D.introPose.run', '*');
window.removeEventListener('scroll', eventList.runIntroPose);
}
});
},
clickFold: function () {
if (!els.viewerIframe.isFold) {
els.viewerIframe.isFold = true;
els.viewerIframe.contentWindow.postMessage('V3D.action.reverse', '*');
} else {
els.viewerIframe.isFold = false;
els.viewerIframe.contentWindow.postMessage('V3D.action', '*');
}
accessibility.fold.ariaLabel();
eventList.setFoldClass();
accessibility.fold.tagging();
},
clickReset: function () {
let viewerSrc = els.viewerIframe.getAttribute('src');
els.viewerIframe.setAttribute('src', `${viewerSrc}#reset=1`);
clearTimeout(els.viewerIframe.resetTimeout);
els.viewerIframe.resetTimeout = setTimeout(function () {
viewerSrc = viewerSrc.split('#reset=1')[0];
els.viewerIframe.setAttribute('src', viewerSrc);
}, 300);
},
openPresetPopup: function () {
if (!els.presetLayer.classList.contains('is-active')) {
els.presetOpen.classList.add('is-open');
els.presetLayer.classList.add('is-active');
els.presetOpen.setAttribute('aria-expanded', true);
els.presetClose.focus();
} else {
eventList.closePresetPopup();
}
els.presetClose && els.presetClose.addEventListener('click', eventList.closePresetPopup);
},
closePresetPopup: function (e) {
if (els.presetLayer.classList.contains('is-active')) {
els.presetOpen.classList.remove('is-open');
els.presetLayer.classList.remove('is-active');
els.presetOpen.setAttribute('aria-expanded', false);
if (e && e.target.classList.contains('js-preset-close')) {
els.presetOpen.focus();
}
}
},
setFoldClass: function () {
if (!els.viewerIframe.isFold) {
if (els.foldBtn.classList.contains('is-folded')) els.foldBtn.classList.remove('is-folded');
els.foldBtn.classList.add('is-fold');
} else {
if (els.foldBtn.classList.contains('is-fold')) els.foldBtn.classList.remove('is-fold');
els.foldBtn.classList.add('is-folded');
}
},
setAngle: function () {
let target = this,
targetAngle = target.innerText.toLowerCase();
if (targetAngle == 'front') {
els.viewerIframe.contentWindow.postMessage('V3D.setPosition.angleX: 0,angleY: 0', '*');
} else if (targetAngle == 'back') {
els.viewerIframe.contentWindow.postMessage('V3D.setPosition.angleX: 0,angleY: 3.141592653589793', '*');
} else if (targetAngle == 'top') {
els.viewerIframe.contentWindow.postMessage('V3D.setPosition.angleX: 1.5707963267948966,angleY: 3.141592653589793', '*');
} else if (targetAngle == 'bottom') {
els.viewerIframe.contentWindow.postMessage('V3D.setPosition.angleX: -1.5707963267948966,angleY: 0', '*');
} else if (targetAngle == 'left') {
els.viewerIframe.contentWindow.postMessage('V3D.setPosition.angleX: 0,angleY: 1.5707963267948966', '*');
} else if (targetAngle == 'right') {
els.viewerIframe.contentWindow.postMessage('V3D.setPosition.angleX: 0,angleY: -1.5707963267948966', '*');
}
accessibility.selected(target);
}
};
const popupEvents = {
set: function () {
utils.layerPopup({
layerPopup: els.popup,
layerPopupClass: '.js-viewer',
openerEvent: {
element: els.viewerBtn,
},
closeCtas: [els.closeCta],
dimmed: els.popupWrap,
moveTarget: document.documentElement,
contents: els.contents,
show: {
start: function (target) {
els.popup.classList.add('is-init');
popupEvents.show(target.openerCta);
},
end: function () {
if (utils.detector.isIosDevice) els.popup.style.display = 'block';
els.popup.classList.add('is-open');
}
},
hide: {
start: function () {
els.popup.classList.remove('is-open');
},
end: function () {
setTimeout(function () {
els.popup.classList.remove('is-init');
}, 300);
popupEvents.hide();
}
}
});
},
show: function (viewerOpener) {
if (viewerOpener.classList.contains('viewer-btn')) {
els.viewerIframe.isHash = false;
els.viewerOpener = viewerOpener;
} else {
els.viewerIframe.isHash = true;
els.viewerOpener = els.viewerBtn;
}
els.viewerIframe.setAttribute('src', common.getViewerUrl());
},
hide: function () {
els.viewerIframe.setAttribute('src', 'about:blank');
if (els.viewerIframe.isHash) {
setTimeout(function () {
els.viewerOpener.focus();
}, 300);
}
},
};
const accessibility = {
fold: {
ariaLabel: function () {
if (!els.viewerIframe.isFold) {
els.foldBtn.setAttribute('aria-label', `${els.foldBtn.getAttribute('data-unfolded')}`);
} else {
els.foldBtn.setAttribute('aria-label', `${els.foldBtn.getAttribute('data-folded')}`);
}
},
tagging: function () {
let dataOmni = els.foldBtn.getAttribute('data-omni'),
gaLa = els.foldBtn.getAttribute('ga-la');
if (!els.viewerIframe.isFold) {
els.foldBtn.setAttribute('data-omni', dataOmni.replace('folded', 'unfolded'));
els.foldBtn.setAttribute('ga-la', gaLa.replace('folded', 'unfolded'));
} else {
els.foldBtn.setAttribute('data-omni', dataOmni.replace('unfolded', 'folded'));
els.foldBtn.setAttribute('ga-la', gaLa.replace('unfolded', 'folded'));
}
},
},
selected: function (target) {
for (let i = 0; i < els.angleCta.length; i++) {
els.angleCta[i].removeAttribute('title');
if (els.angleCta[i].classList.contains('is-selected')) {
els.angleCta[i].classList.remove('is-selected');
}
}
if (!target.classList.contains('is-selected')) {
target.classList.add('is-selected');
}
if (typeof LOCAL_VARI != 'undefined' && !!LOCAL_VARI) {
target.setAttribute('title', LOCAL_VARI.selected);
} else {
target.setAttribute('title', 'Selected');
}
}
};
return {
init: init
}
})();
})();
flagship.features.initialize = (function () {
window.flagship.common.resize.bindEvent();
const init = function () {
flagship.features.flexWindow.init();
flagship.features.ai.init()
flagship.features.clickToVideo.init();
flagship.features.headline.init();
flagship.features.oneColumnCarousel.init();
flagship.features.scrollVideo.init();
flagship.features.interactiveSuggested.init();
flagship.features.threeColumnCarousel.init();
// flagship.features.aiOverview.init();
flagship.features.cameraSpec.init();
flagship.features.faq.init();
flagship.features.highlightsZone.init();
// flagship.features.formfactor.init();
flagship.features.interactiveCircleToSearch.init();
flagship.features.interactiveInterpreter.init();
flagship.features.interactiveNoteAssist.init();
flagship.features.interactive.init();
// flagship.features.moveFeature.init();
flagship.features.performance.init();
flagship.features.photoAssist.init();
flagship.features.viewer.init();
flagship.highlights.colors.init();
flagship.highlights.colors2.init();
};
video1 = '',
video2 = '',
video3 = '',
video0 = '';
$(".js-youtube-popup1").click(function(){
$(".tankuang").show();
//禁止滚动条滚动
$('html,body').css({'overflow': 'hidden'});
$(".video_box").html(video1);
});
$(".tankuang a").click(function(){
$(".tankuang").hide();
$(".video_box").html(video0);
//实现滚动条滚动
$('html,body').css({'overflow': 'auto'});
})
$(".js-youtube-popup2").click(function(){
$(".tankuang").show();
//禁止滚动条滚动
$('html,body').css({'overflow': 'hidden'});
$(".video_box").html(video2);
});
$(".tankuang a").click(function(){
$(".tankuang").hide();
$(".video_box").html(video0);
//实现滚动条滚动
$('html,body').css({'overflow': 'auto'});
})
$(".js-youtube-popup3").click(function(){
$(".tankuang").show();
//禁止滚动条滚动
$('html,body').css({'overflow': 'hidden'});
$(".video_box").html(video3);
});
$(".tankuang a").click(function(){
$(".tankuang").hide();
$(".video_box").html(video0);
//实现滚动条滚动
$('html,body').css({'overflow': 'auto'});
})
return {
init: init
}
})();
flagship.features.initialize.init();
});
");
return e.attr("data-swiper-slide-index") || e.attr("data-swiper-slide-index", t),
i.cache && (this.virtual.cache[t] = e),
e
},
appendSlide: function (e) {
if ("object" == typeof e && "length" in e) for (var t = 0; t < e.length; t += 1) e[t] && this.virtual.slides.push(e[t]);
else this.virtual.slides.push(e);
this.virtual.update(!0)
},
prependSlide: function (e) {
var s, a, t = this.activeIndex,
i = t + 1,
n = 1;
if (Array.isArray(e)) {
for (var o = 0; o < e.length; o += 1) e[o] && this.virtual.slides.unshift(e[o]);
i = t + e.length,
n = e.length
} else this.virtual.slides.unshift(e);
this.params.virtual.cache && (s = this.virtual.cache, a = {},
Object.keys(s).forEach(function (e) {
var t = s[e],
i = t.attr("data-swiper-slide-index");
i && t.attr("data-swiper-slide-index", parseInt(i, 10) + 1),
a[parseInt(e, 10) + n] = t
}), this.virtual.cache = a),
this.virtual.update(!0),
this.slideTo(i, 0)
},
removeSlide: function (e) {
if (null != e) {
var t = this.activeIndex;
if (Array.isArray(e)) for (var i = e.length - 1; 0 <= i; --i) this.virtual.slides.splice(e[i], 1),
this.params.virtual.cache && delete this.virtual.cache[e[i]],
e[i] < t && --t,
t = Math.max(t, 0);
else this.virtual.slides.splice(e, 1),
this.params.virtual.cache && delete this.virtual.cache[e],
e < t && --t,
t = Math.max(t, 0);
this.virtual.update(!0),
this.slideTo(t, 0)
}
},
removeAllSlides: function () {
this.virtual.slides = [],
this.params.virtual.cache && (this.virtual.cache = {}),
this.virtual.update(!0),
this.slideTo(0, 0)
}
},
b = {
name: "virtual",
params: {
virtual: {
enabled: !1,
slides: [],
cache: !0,
renderSlide: null,
renderExternal: null,
addSlidesBefore: 0,
addSlidesAfter: 0
}
},
create: function () {
U.extend(this, {
virtual: {
update: w.update.bind(this),
appendSlide: w.appendSlide.bind(this),
prependSlide: w.prependSlide.bind(this),
removeSlide: w.removeSlide.bind(this),
removeAllSlides: w.removeAllSlides.bind(this),
renderSlide: w.renderSlide.bind(this),
slides: this.params.virtual.slides,
cache: {}
}
})
},
on: {
beforeInit: function () {
var e;
this.params.virtual.enabled && (this.classNames.push(this.params.containerModifierClass + "virtual"), U.extend(this.params, e = {
watchSlidesProgress: !0
}), U.extend(this.originalParams, e), this.params.initialSlide || this.virtual.update())
},
setTranslate: function () {
this.params.virtual.enabled && this.virtual.update()
}
}
},
K = {
handle: function (e) {
var t = this.rtlTranslate,
i = (e = e.originalEvent ? e.originalEvent : e).keyCode || e.charCode;
if (!this.allowSlideNext && (this.isHorizontal() && 39 === i || this.isVertical() && 40 === i || 34 === i)) return !1;
if (!this.allowSlidePrev && (this.isHorizontal() && 37 === i || this.isVertical() && 38 === i || 33 === i)) return !1;
if (!(e.shiftKey || e.altKey || e.ctrlKey || e.metaKey || h.activeElement && h.activeElement.nodeName && ("input" === h.activeElement.nodeName.toLowerCase() || "textarea" === h.activeElement.nodeName.toLowerCase()))) {
if (this.params.keyboard.onlyInViewport && (33 === i || 34 === i || 37 === i || 39 === i || 38 === i || 40 === i)) {
var s = !1;
if (0 < this.$el.parents("." + this.params.slideClass).length && 0 === this.$el.parents("." + this.params.slideActiveClass).length) return;
var a = j.innerWidth,
n = j.innerHeight,
o = this.$el.offset();
t && (o.left -= this.$el[0].scrollLeft);
for (var r = [[o.left, o.top], [o.left + this.width, o.top], [o.left, o.top + this.height], [o.left + this.width, o.top + this.height]], l = 0; l < r.length; l += 1) {
var c = r[l];
0 <= c[0] && c[0] <= a && 0 <= c[1] && c[1] <= n && (s = !0)
}
if (!s) return
}
this.isHorizontal() ? (33 !== i && 34 !== i && 37 !== i && 39 !== i || (e.preventDefault ? e.preventDefault() : e.returnValue = !1), (34 !== i && 39 !== i || t) && (33 !== i && 37 !== i || !t) || this.slideNext(), (33 !== i && 37 !== i || t) && (34 !== i && 39 !== i || !t) || this.slidePrev()) : (33 !== i && 34 !== i && 38 !== i && 40 !== i || (e.preventDefault ? e.preventDefault() : e.returnValue = !1), 34 !== i && 40 !== i || this.slideNext(), 33 !== i && 38 !== i || this.slidePrev()),
this.emit("keyPress", i)
}
},
enable: function () {
this.keyboard.enabled || (T(h).on("keydown", this.keyboard.handle), this.keyboard.enabled = !0)
},
disable: function () {
this.keyboard.enabled && (T(h).off("keydown", this.keyboard.handle), this.keyboard.enabled = !1)
}
},
E = {
name: "keyboard",
params: {
keyboard: {
enabled: !1,
onlyInViewport: !0
}
},
create: function () {
U.extend(this, {
keyboard: {
enabled: !1,
enable: K.enable.bind(this),
disable: K.disable.bind(this),
handle: K.handle.bind(this)
}
})
},
on: {
init: function () {
this.params.keyboard.enabled && this.keyboard.enable()
},
destroy: function () {
this.keyboard.enabled && this.keyboard.disable()
}
}
};
function S() {
for (var i, e = [], t = arguments.length; t--;) e[t] = arguments[t];
i = (i = 1 === e.length && e[0].constructor && e[0].constructor === Object ? e[0] : (n = e[0], e[1])) || {},
i = U.extend({},
i),
n && !i.el && (i.el = n),
d.call(this, i),
Object.keys(G).forEach(function (t) {
Object.keys(G[t]).forEach(function (e) {
S.prototype[e] || (S.prototype[e] = G[t][e])
})
});
var s, a, n, o = this,
r = (void 0 === o.modules && (o.modules = {}), Object.keys(o.modules).forEach(function (e) {
var t, e = o.modules[e];
e.params && (t = Object.keys(e.params)[0], "object" == typeof (e = e.params[t]) && null !== e && t in i && "enabled" in e && (!0 === i[t] && (i[t] = {
enabled: !0
}), "object" != typeof i[t] || "enabled" in i[t] || (i[t].enabled = !0), i[t] || (i[t] = {
enabled: !1
})))
}), U.extend({},
W)),
l = (o.useModulesParams(r), o.params = U.extend({},
r, F, i), o.originalParams = U.extend({},
o.params), o.passedParams = U.extend({},
i), (o.$ = T)(o.params.el));
if (n = l[0]) return 1 < l.length ? (s = [], l.each(function (e, t) {
t = U.extend({},
i, {
el: t
});
s.push(new S(t))
}), s) : (n.swiper = o, l.data("swiper", o), n && n.shadowRoot && n.shadowRoot.querySelector ? (a = T(n.shadowRoot.querySelector("." + o.params.wrapperClass))).children = function (e) {
return l.children(e)
} : a = l.children("." + o.params.wrapperClass), U.extend(o, {
$el: l,
el: n,
$wrapperEl: a,
wrapperEl: a[0],
classNames: [],
slides: T(),
slidesGrid: [],
snapGrid: [],
slidesSizesGrid: [],
isHorizontal: function () {
return "horizontal" === o.params.direction
},
isVertical: function () {
return "vertical" === o.params.direction
},
rtl: "rtl" === n.dir.toLowerCase() || "rtl" === l.css("direction"),
rtlTranslate: "horizontal" === o.params.direction && ("rtl" === n.dir.toLowerCase() || "rtl" === l.css("direction")),
wrongRTL: "-webkit-box" === a.css("display"),
activeIndex: 0,
realIndex: 0,
isBeginning: !0,
isEnd: !1,
translate: 0,
previousTranslate: 0,
progress: 0,
velocity: 0,
animating: !1,
allowSlideNext: o.params.allowSlideNext,
allowSlidePrev: o.params.allowSlidePrev,
touchEvents: (r = y.pointerEvents ? ["pointerdown", "pointermove", "pointerup"] : ["mousedown", "mousemove", "mouseup"], o.touchEventsTouch = {
start: (n = ["touchstart", "touchmove", "touchend", "touchcancel"])[0],
move: n[1],
end: n[2],
cancel: n[3]
},
o.touchEventsDesktop = {
start: r[0],
move: r[1],
end: r[2]
},
y.touch || !o.params.simulateTouch ? o.touchEventsTouch : o.touchEventsDesktop),
touchEventsData: {
isTouched: void 0,
isMoved: void 0,
allowTouchCallbacks: void 0,
touchStartTime: void 0,
isScrolling: void 0,
currentTranslate: void 0,
startTranslate: void 0,
allowThresholdMove: void 0,
formElements: "input, select, option, textarea, button, video",
lastClickTime: U.now(),
clickTimeout: void 0,
velocities: [],
allowMomentumBounce: void 0,
isTouchEvent: void 0,
startMoving: void 0
},
allowClick: !0,
allowTouchMove: o.params.allowTouchMove,
touches: {
startX: 0,
startY: 0,
currentX: 0,
currentY: 0,
diff: 0
},
imagesToLoad: [],
imagesLoaded: 0
}), o.useModules(), o.params.init && o.init(), o)
}
var C = {
lastScrollTime: U.now(),
lastEventBeforeSnap: void 0,
recentWheelEvents: [],
event: function () {
return - 1 < j.navigator.userAgent.indexOf("firefox") ? "DOMMouseScroll" : ((t = "onwheel" in h) || ((e = h.createElement("div")).setAttribute("onwheel", "return;"), t = "function" == typeof e.onwheel), (t = !t && h.implementation && h.implementation.hasFeature && !0 !== h.implementation.hasFeature("", "") ? h.implementation.hasFeature("Events.wheel", "3.0") : t) ? "wheel" : "mousewheel");
var e, t
}, normalize: function (e) {
var t = 0,
i = 0,
s = 0,
a = 0;
return "detail" in e && (i = e.detail),
"wheelDelta" in e && (i = -e.wheelDelta / 120),
"wheelDeltaY" in e && (i = -e.wheelDeltaY / 120),
"wheelDeltaX" in e && (t = -e.wheelDeltaX / 120),
"axis" in e && e.axis === e.HORIZONTAL_AXIS && (t = i, i = 0),
s = 10 * t,
a = 10 * i,
"deltaY" in e && (a = e.deltaY),
"deltaX" in e && (s = e.deltaX),
e.shiftKey && !s && (s = a, a = 0),
(s || a) && e.deltaMode && (1 === e.deltaMode ? (s *= 40, a *= 40) : (s *= 800, a *= 800)),
{
spinX: t = s && !t ? s < 1 ? -1 : 1 : t,
spinY: i = a && !i ? a < 1 ? -1 : 1 : i,
pixelX: s,
pixelY: a
}
},
handleMouseEnter: function () {
this.mouseEntered = !0
},
handleMouseLeave: function () {
this.mouseEntered = !1
},
handle: function (e) {
var t = e,
i = this,
s = i.params.mousewheel;
if (i.params.cssMode && t.preventDefault(), !i.mouseEntered && !s.releaseOnEdges) return !0;
t.originalEvent && (t = t.originalEvent);
var a = 0,
n = i.rtlTranslate ? -1 : 1,
o = C.normalize(t);
if (s.forceToAxis) if (i.isHorizontal()) {
if (!(Math.abs(o.pixelX) > Math.abs(o.pixelY))) return !0;
a = o.pixelX * n
} else {
if (!(Math.abs(o.pixelY) > Math.abs(o.pixelX))) return !0;
a = o.pixelY
} else a = Math.abs(o.pixelX) > Math.abs(o.pixelY) ? -o.pixelX * n : -o.pixelY;
if (0 === a) return !0;
if (s.invert && (a = -a), i.params.freeMode) {
var r = {
time: U.now(),
delta: Math.abs(a),
direction: Math.sign(a)
},
n = i.mousewheel.lastEventBeforeSnap,
o = n && r.time < n.time + 500 && r.delta <= n.delta && r.direction === n.direction;
if (!o) {
i.mousewheel.lastEventBeforeSnap = void 0,
i.params.loop && i.loopFix();
var l, c, n = i.getTranslate() + a * s.sensitivity,
s = i.isBeginning,
d = i.isEnd;
if ((n = n >= i.minTranslate() ? i.minTranslate() : n) <= i.maxTranslate() && (n = i.maxTranslate()), i.setTransition(0), i.setTranslate(n), i.updateProgress(), i.updateActiveIndex(), i.updateSlidesClasses(), (!s && i.isBeginning || !d && i.isEnd) && i.updateSlidesClasses(), i.params.freeModeSticky && (clearTimeout(i.mousewheel.timeout), i.mousewheel.timeout = void 0, 15 <= (l = i.mousewheel.recentWheelEvents).length && l.shift(), s = l.length ? l[l.length - 1] : void 0, d = l[0], l.push(r), s && (r.delta > s.delta || r.direction !== s.direction) ? l.splice(0) : 15 <= l.length && r.time - d.time < 500 && 1 <= d.delta - r.delta && r.delta <= 6 && (c = 0 < a ? .8 : .2, i.mousewheel.lastEventBeforeSnap = r, l.splice(0), i.mousewheel.timeout = U.nextTick(function () {
i.slideToClosest(i.params.speed, !0, void 0, c)
},
0)), i.mousewheel.timeout || (i.mousewheel.timeout = U.nextTick(function () {
i.mousewheel.lastEventBeforeSnap = r,
l.splice(0),
i.slideToClosest(i.params.speed, !0, void 0, .5)
},
500))), o || i.emit("scroll", t), i.params.autoplay && i.params.autoplayDisableOnInteraction && i.autoplay.stop(), n === i.minTranslate() || n === i.maxTranslate()) return !0
}
} else {
s = {
time: U.now(),
delta: Math.abs(a),
direction: Math.sign(a),
raw: e
},
d = i.mousewheel.recentWheelEvents,
o = (2 <= d.length && d.shift(), d.length ? d[d.length - 1] : void 0);
if (d.push(s), (!o || s.direction !== o.direction || s.delta > o.delta) && i.mousewheel.animateSlider(s), i.mousewheel.releaseScroll(s)) return !0
}
return t.preventDefault ? t.preventDefault() : t.returnValue = !1,
!1
},
animateSlider: function (e) {
return 6 <= e.delta && U.now() - this.mousewheel.lastScrollTime < 60 || (e.direction < 0 ? this.isEnd && !this.params.loop || this.animating || (this.slideNext(), this.emit("scroll", e.raw)) : this.isBeginning && !this.params.loop || this.animating || (this.slidePrev(), this.emit("scroll", e.raw)), this.mousewheel.lastScrollTime = (new j.Date).getTime(), !1)
},
releaseScroll: function (e) {
var t = this.params.mousewheel;
if (e.direction < 0) {
if (this.isEnd && !this.params.loop && t.releaseOnEdges) return !0
} else if (this.isBeginning && !this.params.loop && t.releaseOnEdges) return !0;
return !1
},
enable: function () {
var e = C.event();
if (this.params.cssMode) return this.wrapperEl.removeEventListener(e, this.mousewheel.handle),
!0;
if (!e) return !1;
if (this.mousewheel.enabled) return !1;
var t = this.$el;
return (t = "container" !== this.params.mousewheel.eventsTarged ? T(this.params.mousewheel.eventsTarged) : t).on("mouseenter", this.mousewheel.handleMouseEnter),
t.on("mouseleave", this.mousewheel.handleMouseLeave),
t.on(e, this.mousewheel.handle),
this.mousewheel.enabled = !0
},
disable: function () {
var e = C.event();
if (this.params.cssMode) return this.wrapperEl.addEventListener(e, this.mousewheel.handle),
!0;
if (!e) return !1;
if (!this.mousewheel.enabled) return !1;
var t = this.$el;
return (t = "container" !== this.params.mousewheel.eventsTarged ? T(this.params.mousewheel.eventsTarged) : t).off(e, this.mousewheel.handle),
!(this.mousewheel.enabled = !1)
}
},
L = {
update: function () {
var e, t, i = this.params.navigation;
this.params.loop || (e = (t = this.navigation).$nextEl, (t = t.$prevEl) && 0 < t.length && (this.isBeginning ? t.addClass(i.disabledClass) : t.removeClass(i.disabledClass), t[this.params.watchOverflow && this.isLocked ? "addClass" : "removeClass"](i.lockClass)), e && 0 < e.length && (this.isEnd ? e.addClass(i.disabledClass) : e.removeClass(i.disabledClass), e[this.params.watchOverflow && this.isLocked ? "addClass" : "removeClass"](i.lockClass)))
},
onPrevClick: function (e) {
e.preventDefault(),
this.isBeginning && !this.params.loop || this.slidePrev()
},
onNextClick: function (e) {
e.preventDefault(),
this.isEnd && !this.params.loop || this.slideNext()
},
init: function () {
var e, t, i = this.params.navigation; (i.nextEl || i.prevEl) && (i.nextEl && (e = T(i.nextEl), this.params.uniqueNavElements && "string" == typeof i.nextEl && 1 < e.length && 1 === this.$el.find(i.nextEl).length && (e = this.$el.find(i.nextEl))), i.prevEl && (t = T(i.prevEl), this.params.uniqueNavElements && "string" == typeof i.prevEl && 1 < t.length && 1 === this.$el.find(i.prevEl).length && (t = this.$el.find(i.prevEl))), e && 0 < e.length && e.on("click", this.navigation.onNextClick), t && 0 < t.length && t.on("click", this.navigation.onPrevClick), U.extend(this.navigation, {
$nextEl: e,
nextEl: e && e[0],
$prevEl: t,
prevEl: t && t[0]
}))
},
destroy: function () {
var e = this.navigation,
t = e.$nextEl,
e = e.$prevEl;
t && t.length && (t.off("click", this.navigation.onNextClick), t.removeClass(this.params.navigation.disabledClass)),
e && e.length && (e.off("click", this.navigation.onPrevClick), e.removeClass(this.params.navigation.disabledClass))
}
},
k = {
update: function () {
var e = this.rtl,
s = this.params.pagination;
if (s.el && this.pagination.el && this.pagination.$el && 0 !== this.pagination.$el.length) {
var a, t = (this.virtual && this.params.virtual.enabled ? this.virtual : this).slides.length,
i = this.pagination.$el,
n = this.params.loop ? Math.ceil((t - 2 * this.loopedSlides) / this.params.slidesPerGroup) : this.snapGrid.length;
if (this.params.loop ? ((a = Math.ceil((this.activeIndex - this.loopedSlides) / this.params.slidesPerGroup)) > t - 1 - 2 * this.loopedSlides && (a -= t - 2 * this.loopedSlides), n - 1 < a && (a -= n), a < 0 && "bullets" !== this.params.paginationType && (a = n + a)) : a = void 0 !== this.snapIndex ? this.snapIndex : this.activeIndex || 0, "bullets" === s.type && this.pagination.bullets && 0 < this.pagination.bullets.length) {
var o, r, l, c = this.pagination.bullets;
if (s.dynamicBullets && (this.pagination.bulletSize = c.eq(0)[this.isHorizontal() ? "outerWidth" : "outerHeight"](!0), i.css(this.isHorizontal() ? "width" : "height", this.pagination.bulletSize * (s.dynamicMainBullets + 4) + "px"), 1 < s.dynamicMainBullets && void 0 !== this.previousIndex && (this.pagination.dynamicBulletIndex += a - this.previousIndex, this.pagination.dynamicBulletIndex > s.dynamicMainBullets - 1 ? this.pagination.dynamicBulletIndex = s.dynamicMainBullets - 1 : this.pagination.dynamicBulletIndex < 0 && (this.pagination.dynamicBulletIndex = 0)), o = a - this.pagination.dynamicBulletIndex, l = ((r = o + (Math.min(c.length, s.dynamicMainBullets) - 1)) + o) / 2), c.removeClass(s.bulletActiveClass + " " + s.bulletActiveClass + "-next " + s.bulletActiveClass + "-next-next " + s.bulletActiveClass + "-prev " + s.bulletActiveClass + "-prev-prev " + s.bulletActiveClass + "-main"), 1 < i.length) c.each(function (e, t) {
var t = T(t),
i = t.index();
i === a && t.addClass(s.bulletActiveClass),
s.dynamicBullets && (o <= i && i <= r && t.addClass(s.bulletActiveClass + "-main"), i === o && t.prev().addClass(s.bulletActiveClass + "-prev").prev().addClass(s.bulletActiveClass + "-prev-prev"), i === r && t.next().addClass(s.bulletActiveClass + "-next").next().addClass(s.bulletActiveClass + "-next-next"))
});
else {
var t = c.eq(a),
d = t.index();
if (t.addClass(s.bulletActiveClass), s.dynamicBullets) {
for (var t = c.eq(o), h = c.eq(r), u = o; u <= r; u += 1) c.eq(u).addClass(s.bulletActiveClass + "-main");
if (this.params.loop) if (d >= c.length - s.dynamicMainBullets) {
for (var p = s.dynamicMainBullets; 0 <= p; --p) c.eq(c.length - p).addClass(s.bulletActiveClass + "-main");
c.eq(c.length - s.dynamicMainBullets - 1).addClass(s.bulletActiveClass + "-prev")
} else t.prev().addClass(s.bulletActiveClass + "-prev").prev().addClass(s.bulletActiveClass + "-prev-prev"),
h.next().addClass(s.bulletActiveClass + "-next").next().addClass(s.bulletActiveClass + "-next-next");
else t.prev().addClass(s.bulletActiveClass + "-prev").prev().addClass(s.bulletActiveClass + "-prev-prev"),
h.next().addClass(s.bulletActiveClass + "-next").next().addClass(s.bulletActiveClass + "-next-next")
}
}
s.dynamicBullets && (d = Math.min(c.length, s.dynamicMainBullets + 4), t = (this.pagination.bulletSize * d - this.pagination.bulletSize) / 2 - l * this.pagination.bulletSize, h = e ? "right" : "left", c.css(this.isHorizontal() ? h : "top", t + "px"))
}
"fraction" === s.type && (i.find("." + s.currentClass).text(s.formatFractionCurrent(a + 1)), i.find("." + s.totalClass).text(s.formatFractionTotal(n))),
"progressbar" === s.type && (d = s.progressbarOpposite ? this.isHorizontal() ? "vertical" : "horizontal" : this.isHorizontal() ? "horizontal" : "vertical", l = (a + 1) / n, h = e = 1, "horizontal" == d ? e = l : h = l, i.find("." + s.progressbarFillClass).transform("translate3d(0,0,0) scaleX(" + e + ") scaleY(" + h + ")").transition(this.params.speed)),
"custom" === s.type && s.renderCustom ? (i.html(s.renderCustom(this, a + 1, n)), this.emit("paginationRender", this, i[0])) : this.emit("paginationUpdate", this, i[0]),
i[this.params.watchOverflow && this.isLocked ? "addClass" : "removeClass"](s.lockClass)
}
},
render: function () {
var e = this.params.pagination;
if (e.el && this.pagination.el && this.pagination.$el && 0 !== this.pagination.$el.length) {
var t = (this.virtual && this.params.virtual.enabled ? this.virtual : this).slides.length,
i = this.pagination.$el,
s = "";
if ("bullets" === e.type) {
for (var a = this.params.loop ? Math.ceil((t - 2 * this.loopedSlides) / this.params.slidesPerGroup) : this.snapGrid.length, n = 0; n < a; n += 1) e.renderBullet ? s += e.renderBullet.call(this, n, e.bulletClass) : s += "<" + e.bulletElement + ' class="' + e.bulletClass + '">' + e.bulletElement + ">";
i.html(s),
this.pagination.bullets = i.find("." + e.bulletClass)
}
"fraction" === e.type && (s = e.renderFraction ? e.renderFraction.call(this, e.currentClass, e.totalClass) : ' / ', i.html(s)),
"progressbar" === e.type && (s = e.renderProgressbar ? e.renderProgressbar.call(this, e.progressbarFillClass) : '', i.html(s)),
"custom" !== e.type && this.emit("paginationRender", this.pagination.$el[0])
}
},
init: function () {
var e, t = this,
i = t.params.pagination;
i.el && 0 !== (e = T(i.el)).length && (t.params.uniqueNavElements && "string" == typeof i.el && 1 < e.length && 1 === t.$el.find(i.el).length && (e = t.$el.find(i.el)), "bullets" === i.type && i.clickable && e.addClass(i.clickableClass), e.addClass(i.modifierClass + i.type), "bullets" === i.type && i.dynamicBullets && (e.addClass("" + i.modifierClass + i.type + "-dynamic"), t.pagination.dynamicBulletIndex = 0, i.dynamicMainBullets < 1 && (i.dynamicMainBullets = 1)), "progressbar" === i.type && i.progressbarOpposite && e.addClass(i.progressbarOppositeClass), i.clickable && e.on("click", "." + i.bulletClass,
function (e) {
e.preventDefault();
e = T(this).index() * t.params.slidesPerGroup;
t.params.loop && (e += t.loopedSlides),
t.slideTo(e)
}), U.extend(t.pagination, {
$el: e,
el: e[0]
}))
},
destroy: function () {
var e, t = this.params.pagination;
t.el && this.pagination.el && this.pagination.$el && 0 !== this.pagination.$el.length && ((e = this.pagination.$el).removeClass(t.hiddenClass), e.removeClass(t.modifierClass + t.type), this.pagination.bullets && this.pagination.bullets.removeClass(t.bulletActiveClass), t.clickable && e.off("click", "." + t.bulletClass))
}
},
A = {
setTranslate: function () {
var e, t, i, s, a, n, o, r;
this.params.scrollbar.el && this.scrollbar.el && (n = this.scrollbar, e = this.rtlTranslate, r = this.progress, t = n.dragSize, i = n.trackSize, s = n.$dragEl, a = n.$el, n = this.params.scrollbar, r = (i - (o = t)) * r, e ? 0 < (r = -r) ? (o = t - r, r = 0) : i < -r + t && (o = i + r) : r < 0 ? (o = t + r, r = 0) : i < r + t && (o = i - r), this.isHorizontal() ? (s.transform("translate3d(" + r + "px, 0, 0)"), s[0].style.width = o + "px") : (s.transform("translate3d(0px, " + r + "px, 0)"), s[0].style.height = o + "px"), n.hide && (clearTimeout(this.scrollbar.timeout), a[0].style.opacity = 1, this.scrollbar.timeout = setTimeout(function () {
a[0].style.opacity = 0,
a.transition(400)
},
1e3)))
},
setTransition: function (e) {
this.params.scrollbar.el && this.scrollbar.el && this.scrollbar.$dragEl.transition(e)
},
updateSize: function () {
var e, t, i, s, a, n, o;
this.params.scrollbar.el && this.scrollbar.el && (t = (e = this.scrollbar).$dragEl, i = e.$el, t[0].style.width = "", t[0].style.height = "", s = this.isHorizontal() ? i[0].offsetWidth : i[0].offsetHeight, n = (a = this.size / this.virtualSize) * (s / this.size), o = "auto" === this.params.scrollbar.dragSize ? s * a : parseInt(this.params.scrollbar.dragSize, 10), this.isHorizontal() ? t[0].style.width = o + "px" : t[0].style.height = o + "px", i[0].style.display = 1 <= a ? "none" : "", this.params.scrollbar.hide && (i[0].style.opacity = 0), U.extend(e, {
trackSize: s,
divider: a,
moveDivider: n,
dragSize: o
}), e.$el[this.params.watchOverflow && this.isLocked ? "addClass" : "removeClass"](this.params.scrollbar.lockClass))
},
getPointerPosition: function (e) {
return this.isHorizontal() ? ("touchstart" === e.type || "touchmove" === e.type ? e.targetTouches[0] : e).clientX : ("touchstart" === e.type || "touchmove" === e.type ? e.targetTouches[0] : e).clientY
},
setDragPosition: function (e) {
var t = this.scrollbar,
i = this.rtlTranslate,
s = t.$el,
a = t.dragSize,
n = t.trackSize,
o = t.dragStartPos,
t = (t.getPointerPosition(e) - s.offset()[this.isHorizontal() ? "left" : "top"] - (null !== o ? o : a / 2)) / (n - a),
e = (t = Math.max(Math.min(t, 1), 0), i && (t = 1 - t), this.minTranslate() + (this.maxTranslate() - this.minTranslate()) * t);
this.updateProgress(e),
this.setTranslate(e),
this.updateActiveIndex(),
this.updateSlidesClasses()
},
onDragStart: function (e) {
var t = this.params.scrollbar,
i = this.scrollbar,
s = this.$wrapperEl,
a = i.$el,
n = i.$dragEl;
this.scrollbar.isTouched = !0,
this.scrollbar.dragStartPos = e.target === n[0] || e.target === n ? i.getPointerPosition(e) - e.target.getBoundingClientRect()[this.isHorizontal() ? "left" : "top"] : null,
e.preventDefault(),
e.stopPropagation(),
s.transition(100),
n.transition(100),
i.setDragPosition(e),
clearTimeout(this.scrollbar.dragTimeout),
a.transition(0),
t.hide && a.css("opacity", 1),
this.params.cssMode && this.$wrapperEl.css("scroll-snap-type", "none"),
this.emit("scrollbarDragStart", e)
},
onDragMove: function (e) {
var t = this.scrollbar,
i = this.$wrapperEl,
s = t.$el,
a = t.$dragEl;
this.scrollbar.isTouched && (e.preventDefault ? e.preventDefault() : e.returnValue = !1, t.setDragPosition(e), i.transition(0), s.transition(0), a.transition(0), this.emit("scrollbarDragMove", e))
},
onDragEnd: function (e) {
var t = this.params.scrollbar,
i = this.scrollbar,
s = this.$wrapperEl,
a = i.$el;
this.scrollbar.isTouched && (this.scrollbar.isTouched = !1, this.params.cssMode && (this.$wrapperEl.css("scroll-snap-type", ""), s.transition("")), t.hide && (clearTimeout(this.scrollbar.dragTimeout), this.scrollbar.dragTimeout = U.nextTick(function () {
a.css("opacity", 0),
a.transition(400)
},
1e3)), this.emit("scrollbarDragEnd", e), t.snapOnRelease && this.slideToClosest())
},
enableDraggable: function () {
var e, t, i, s, a;
this.params.scrollbar.el && (i = this.scrollbar, e = this.touchEventsTouch, t = this.touchEventsDesktop, a = this.params, i = i.$el[0], s = !(!y.passiveListener || !a.passiveListeners) && {
passive: !1,
capture: !1
},
a = !(!y.passiveListener || !a.passiveListeners) && {
passive: !0,
capture: !1
},
y.touch ? (i.addEventListener(e.start, this.scrollbar.onDragStart, s), i.addEventListener(e.move, this.scrollbar.onDragMove, s), i.addEventListener(e.end, this.scrollbar.onDragEnd, a)) : (i.addEventListener(t.start, this.scrollbar.onDragStart, s), h.addEventListener(t.move, this.scrollbar.onDragMove, s), h.addEventListener(t.end, this.scrollbar.onDragEnd, a)))
},
disableDraggable: function () {
var e, t, i, s, a;
this.params.scrollbar.el && (i = this.scrollbar, e = this.touchEventsTouch, t = this.touchEventsDesktop, a = this.params, i = i.$el[0], s = !(!y.passiveListener || !a.passiveListeners) && {
passive: !1,
capture: !1
},
a = !(!y.passiveListener || !a.passiveListeners) && {
passive: !0,
capture: !1
},
y.touch ? (i.removeEventListener(e.start, this.scrollbar.onDragStart, s), i.removeEventListener(e.move, this.scrollbar.onDragMove, s), i.removeEventListener(e.end, this.scrollbar.onDragEnd, a)) : (i.removeEventListener(t.start, this.scrollbar.onDragStart, s), h.removeEventListener(t.move, this.scrollbar.onDragMove, s), h.removeEventListener(t.end, this.scrollbar.onDragEnd, a)))
},
init: function () {
var e, t, i, s;
this.params.scrollbar.el && (e = this.scrollbar, s = this.$el, i = T((t = this.params.scrollbar).el), 0 === (s = (i = this.params.uniqueNavElements && "string" == typeof t.el && 1 < i.length && 1 === s.find(t.el).length ? s.find(t.el) : i).find("." + this.params.scrollbar.dragClass)).length && (s = T(''), i.append(s)), U.extend(e, {
$el: i,
el: i[0],
$dragEl: s,
dragEl: s[0]
}), t.draggable && e.enableDraggable())
},
destroy: function () {
this.scrollbar.disableDraggable()
}
},
Q = {
setTransform: function (e, t) {
var i = this.rtl,
e = T(e),
i = i ? -1 : 1,
s = e.attr("data-swiper-parallax") || "0",
a = e.attr("data-swiper-parallax-x"),
n = e.attr("data-swiper-parallax-y"),
o = e.attr("data-swiper-parallax-scale"),
r = e.attr("data-swiper-parallax-opacity");
a || n ? (a = a || "0", n = n || "0") : this.isHorizontal() ? (a = s, n = "0") : (n = s, a = "0"),
a = 0 <= a.indexOf("%") ? parseInt(a, 10) * t * i + "%" : a * t * i + "px",
n = 0 <= n.indexOf("%") ? parseInt(n, 10) * t + "%" : n * t + "px",
null != r && (s = r - (r - 1) * (1 - Math.abs(t)), e[0].style.opacity = s),
null == o ? e.transform("translate3d(" + a + ", " + n + ", 0px)") : (i = o - (o - 1) * (1 - Math.abs(t)), e.transform("translate3d(" + a + ", " + n + ", 0px) scale(" + i + ")"))
},
setTranslate: function () {
var s = this,
e = s.$el,
t = s.slides,
a = s.progress,
n = s.snapGrid;
e.children("[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y], [data-swiper-parallax-opacity], [data-swiper-parallax-scale]").each(function (e, t) {
s.parallax.setTransform(t, a)
}),
t.each(function (e, t) {
var i = t.progress;
1 < s.params.slidesPerGroup && "auto" !== s.params.slidesPerView && (i += Math.ceil(e / 2) - a * (n.length - 1)),
i = Math.min(Math.max(i, -1), 1),
T(t).find("[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y], [data-swiper-parallax-opacity], [data-swiper-parallax-scale]").each(function (e, t) {
s.parallax.setTransform(t, i)
})
})
},
setTransition: function (s) {
void 0 === s && (s = this.params.speed),
this.$el.find("[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y], [data-swiper-parallax-opacity], [data-swiper-parallax-scale]").each(function (e, t) {
var t = T(t),
i = parseInt(t.attr("data-swiper-parallax-duration"), 10) || s;
0 === s && (i = 0),
t.transition(i)
})
}
},
Z = {
getDistanceBetweenTouches: function (e) {
if (e.targetTouches.length < 2) return 1;
var t = e.targetTouches[0].pageX,
i = e.targetTouches[0].pageY,
s = e.targetTouches[1].pageX,
e = e.targetTouches[1].pageY;
return Math.sqrt(Math.pow(s - t, 2) + Math.pow(e - i, 2))
},
onGestureStart: function (e) {
var t = this.params.zoom,
i = this.zoom,
s = i.gesture;
if (i.fakeGestureTouched = !1, i.fakeGestureMoved = !1, !y.gestures) {
if ("touchstart" !== e.type || "touchstart" === e.type && e.targetTouches.length < 2) return;
i.fakeGestureTouched = !0,
s.scaleStart = Z.getDistanceBetweenTouches(e)
}
s.$slideEl && s.$slideEl.length || (s.$slideEl = T(e.target).closest(".swiper-slide"), 0 === s.$slideEl.length && (s.$slideEl = this.slides.eq(this.activeIndex)), s.$imageEl = s.$slideEl.find("img, svg, canvas"), s.$imageWrapEl = s.$imageEl.parent("." + t.containerClass), s.maxRatio = s.$imageWrapEl.attr("data-swiper-zoom") || t.maxRatio, 0 !== s.$imageWrapEl.length) ? (s.$imageEl.transition(0), this.zoom.isScaling = !0) : s.$imageEl = void 0
},
onGestureChange: function (e) {
var t = this.params.zoom,
i = this.zoom,
s = i.gesture;
if (!y.gestures) {
if ("touchmove" !== e.type || "touchmove" === e.type && e.targetTouches.length < 2) return;
i.fakeGestureMoved = !0,
s.scaleMove = Z.getDistanceBetweenTouches(e)
}
s.$imageEl && 0 !== s.$imageEl.length && (i.scale = y.gestures ? e.scale * i.currentScale : s.scaleMove / s.scaleStart * i.currentScale, i.scale > s.maxRatio && (i.scale = s.maxRatio - 1 + Math.pow(i.scale - s.maxRatio + 1, .5)), i.scale < t.minRatio && (i.scale = t.minRatio + 1 - Math.pow(t.minRatio - i.scale + 1, .5)), s.$imageEl.transform("translate3d(0,0,0) scale(" + i.scale + ")"))
},
onGestureEnd: function (e) {
var t = this.params.zoom,
i = this.zoom,
s = i.gesture;
if (!y.gestures) {
if (!i.fakeGestureTouched || !i.fakeGestureMoved) return;
if ("touchend" !== e.type || "touchend" === e.type && e.changedTouches.length < 2 && !r.android) return;
i.fakeGestureTouched = !1,
i.fakeGestureMoved = !1
}
s.$imageEl && 0 !== s.$imageEl.length && (i.scale = Math.max(Math.min(i.scale, s.maxRatio), t.minRatio), s.$imageEl.transition(this.params.speed).transform("translate3d(0,0,0) scale(" + i.scale + ")"), i.currentScale = i.scale, i.isScaling = !1, 1 === i.scale && (s.$slideEl = void 0))
},
onTouchStart: function (e) {
var t = this.zoom,
i = t.gesture,
t = t.image;
i.$imageEl && 0 !== i.$imageEl.length && !t.isTouched && (r.android && e.preventDefault(), t.isTouched = !0, t.touchesStart.x = ("touchstart" === e.type ? e.targetTouches[0] : e).pageX, t.touchesStart.y = ("touchstart" === e.type ? e.targetTouches[0] : e).pageY)
},
onTouchMove: function (e) {
var t = this.zoom,
i = t.gesture,
s = t.image,
a = t.velocity;
if (i.$imageEl && 0 !== i.$imageEl.length && (this.allowClick = !1, s.isTouched && i.$slideEl)) {
s.isMoved || (s.width = i.$imageEl[0].offsetWidth, s.height = i.$imageEl[0].offsetHeight, s.startX = U.getTranslate(i.$imageWrapEl[0], "x") || 0, s.startY = U.getTranslate(i.$imageWrapEl[0], "y") || 0, i.slideWidth = i.$slideEl[0].offsetWidth, i.slideHeight = i.$slideEl[0].offsetHeight, i.$imageWrapEl.transition(0), this.rtl && (s.startX = -s.startX, s.startY = -s.startY));
var n = s.width * t.scale,
o = s.height * t.scale;
if (!(n < i.slideWidth && o < i.slideHeight)) {
if (s.minX = Math.min(i.slideWidth / 2 - n / 2, 0), s.maxX = -s.minX, s.minY = Math.min(i.slideHeight / 2 - o / 2, 0), s.maxY = -s.minY, s.touchesCurrent.x = ("touchmove" === e.type ? e.targetTouches[0] : e).pageX, s.touchesCurrent.y = ("touchmove" === e.type ? e.targetTouches[0] : e).pageY, !s.isMoved && !t.isScaling) {
if (this.isHorizontal() && (Math.floor(s.minX) === Math.floor(s.startX) && s.touchesCurrent.x < s.touchesStart.x || Math.floor(s.maxX) === Math.floor(s.startX) && s.touchesCurrent.x > s.touchesStart.x)) return void (s.isTouched = !1);
if (!this.isHorizontal() && (Math.floor(s.minY) === Math.floor(s.startY) && s.touchesCurrent.y < s.touchesStart.y || Math.floor(s.maxY) === Math.floor(s.startY) && s.touchesCurrent.y > s.touchesStart.y)) return void (s.isTouched = !1)
}
e.preventDefault(),
e.stopPropagation(),
s.isMoved = !0,
s.currentX = s.touchesCurrent.x - s.touchesStart.x + s.startX,
s.currentY = s.touchesCurrent.y - s.touchesStart.y + s.startY,
s.currentX < s.minX && (s.currentX = s.minX + 1 - Math.pow(s.minX - s.currentX + 1, .8)),
s.currentX > s.maxX && (s.currentX = s.maxX - 1 + Math.pow(s.currentX - s.maxX + 1, .8)),
s.currentY < s.minY && (s.currentY = s.minY + 1 - Math.pow(s.minY - s.currentY + 1, .8)),
s.currentY > s.maxY && (s.currentY = s.maxY - 1 + Math.pow(s.currentY - s.maxY + 1, .8)),
a.prevPositionX || (a.prevPositionX = s.touchesCurrent.x),
a.prevPositionY || (a.prevPositionY = s.touchesCurrent.y),
a.prevTime || (a.prevTime = Date.now()),
a.x = (s.touchesCurrent.x - a.prevPositionX) / (Date.now() - a.prevTime) / 2,
a.y = (s.touchesCurrent.y - a.prevPositionY) / (Date.now() - a.prevTime) / 2,
Math.abs(s.touchesCurrent.x - a.prevPositionX) < 2 && (a.x = 0),
Math.abs(s.touchesCurrent.y - a.prevPositionY) < 2 && (a.y = 0),
a.prevPositionX = s.touchesCurrent.x,
a.prevPositionY = s.touchesCurrent.y,
a.prevTime = Date.now(),
i.$imageWrapEl.transform("translate3d(" + s.currentX + "px, " + s.currentY + "px,0)")
}
}
},
onTouchEnd: function () {
var e = this.zoom,
t = e.gesture,
i = e.image,
s = e.velocity;
if (t.$imageEl && 0 !== t.$imageEl.length) {
if (!i.isTouched || !i.isMoved) return i.isTouched = !1,
void (i.isMoved = !1);
i.isTouched = !1,
i.isMoved = !1;
var a = 300,
n = 300,
o = s.x * a,
o = i.currentX + o,
r = s.y * n,
r = i.currentY + r,
s = (0 !== s.x && (a = Math.abs((o - i.currentX) / s.x)), 0 !== s.y && (n = Math.abs((r - i.currentY) / s.y)), Math.max(a, n)),
a = (i.currentX = o, i.currentY = r, i.width * e.scale),
n = i.height * e.scale;
i.minX = Math.min(t.slideWidth / 2 - a / 2, 0),
i.maxX = -i.minX,
i.minY = Math.min(t.slideHeight / 2 - n / 2, 0),
i.maxY = -i.minY,
i.currentX = Math.max(Math.min(i.currentX, i.maxX), i.minX),
i.currentY = Math.max(Math.min(i.currentY, i.maxY), i.minY),
t.$imageWrapEl.transition(s).transform("translate3d(" + i.currentX + "px, " + i.currentY + "px,0)")
}
},
onTransitionEnd: function () {
var e = this.zoom,
t = e.gesture;
t.$slideEl && this.previousIndex !== this.activeIndex && (t.$imageEl.transform("translate3d(0,0,0) scale(1)"), t.$imageWrapEl.transform("translate3d(0,0,0)"), e.scale = 1, e.currentScale = 1, t.$slideEl = void 0, t.$imageEl = void 0, t.$imageWrapEl = void 0)
},
toggle: function (e) {
var t = this.zoom;
t.scale && 1 !== t.scale ? t.out() : t.in(e)
},
in: function (e) {
var t, i, s, a, n = this.zoom,
o = this.params.zoom,
r = n.gesture,
l = n.image;
r.$slideEl || (r.$slideEl = this.clickedSlide ? T(this.clickedSlide) : this.slides.eq(this.activeIndex), r.$imageEl = r.$slideEl.find("img, svg, canvas"), r.$imageWrapEl = r.$imageEl.parent("." + o.containerClass)),
r.$imageEl && 0 !== r.$imageEl.length && (r.$slideEl.addClass("" + o.zoomedSlideClass), l = void 0 === l.touchesStart.x && e ? (t = ("touchend" === e.type ? e.changedTouches[0] : e).pageX, ("touchend" === e.type ? e.changedTouches[0] : e).pageY) : (t = l.touchesStart.x, l.touchesStart.y), n.scale = r.$imageWrapEl.attr("data-swiper-zoom") || o.maxRatio, n.currentScale = r.$imageWrapEl.attr("data-swiper-zoom") || o.maxRatio, e ? (o = r.$slideEl[0].offsetWidth, e = r.$slideEl[0].offsetHeight, t = r.$slideEl.offset().left + o / 2 - t, l = r.$slideEl.offset().top + e / 2 - l, s = r.$imageEl[0].offsetWidth, a = r.$imageEl[0].offsetHeight, s = s * n.scale, a = a * n.scale, s = -(o = Math.min(o / 2 - s / 2, 0)), a = -(e = Math.min(e / 2 - a / 2, 0)), s < (i = (i = t * n.scale) < o ? o : i) && (i = s), a < (s = (s = l * n.scale) < e ? e : s) && (s = a)) : s = i = 0, r.$imageWrapEl.transition(300).transform("translate3d(" + i + "px, " + s + "px,0)"), r.$imageEl.transition(300).transform("translate3d(0,0,0) scale(" + n.scale + ")"))
},
out: function () {
var e = this.zoom,
t = this.params.zoom,
i = e.gesture;
i.$slideEl || (i.$slideEl = this.clickedSlide ? T(this.clickedSlide) : this.slides.eq(this.activeIndex), i.$imageEl = i.$slideEl.find("img, svg, canvas"), i.$imageWrapEl = i.$imageEl.parent("." + t.containerClass)),
i.$imageEl && 0 !== i.$imageEl.length && (e.scale = 1, e.currentScale = 1, i.$imageWrapEl.transition(300).transform("translate3d(0,0,0)"), i.$imageEl.transition(300).transform("translate3d(0,0,0) scale(1)"), i.$slideEl.removeClass("" + t.zoomedSlideClass), i.$slideEl = void 0)
},
enable: function () {
var e, t, i = this.zoom;
i.enabled || (i.enabled = !0, e = !("touchstart" !== this.touchEvents.start || !y.passiveListener || !this.params.passiveListeners) && {
passive: !0,
capture: !1
},
t = !y.passiveListener || {
passive: !1,
capture: !0
},
y.gestures ? (this.$wrapperEl.on("gesturestart", ".swiper-slide", i.onGestureStart, e), this.$wrapperEl.on("gesturechange", ".swiper-slide", i.onGestureChange, e), this.$wrapperEl.on("gestureend", ".swiper-slide", i.onGestureEnd, e)) : "touchstart" === this.touchEvents.start && (this.$wrapperEl.on(this.touchEvents.start, ".swiper-slide", i.onGestureStart, e), this.$wrapperEl.on(this.touchEvents.move, ".swiper-slide", i.onGestureChange, t), this.$wrapperEl.on(this.touchEvents.end, ".swiper-slide", i.onGestureEnd, e), this.touchEvents.cancel && this.$wrapperEl.on(this.touchEvents.cancel, ".swiper-slide", i.onGestureEnd, e)), this.$wrapperEl.on(this.touchEvents.move, "." + this.params.zoom.containerClass, i.onTouchMove, t))
},
disable: function () {
var e, t, i = this.zoom;
i.enabled && (this.zoom.enabled = !1, e = !("touchstart" !== this.touchEvents.start || !y.passiveListener || !this.params.passiveListeners) && {
passive: !0,
capture: !1
},
t = !y.passiveListener || {
passive: !1,
capture: !0
},
y.gestures ? (this.$wrapperEl.off("gesturestart", ".swiper-slide", i.onGestureStart, e), this.$wrapperEl.off("gesturechange", ".swiper-slide", i.onGestureChange, e), this.$wrapperEl.off("gestureend", ".swiper-slide", i.onGestureEnd, e)) : "touchstart" === this.touchEvents.start && (this.$wrapperEl.off(this.touchEvents.start, ".swiper-slide", i.onGestureStart, e), this.$wrapperEl.off(this.touchEvents.move, ".swiper-slide", i.onGestureChange, t), this.$wrapperEl.off(this.touchEvents.end, ".swiper-slide", i.onGestureEnd, e), this.touchEvents.cancel && this.$wrapperEl.off(this.touchEvents.cancel, ".swiper-slide", i.onGestureEnd, e)), this.$wrapperEl.off(this.touchEvents.move, "." + this.params.zoom.containerClass, i.onTouchMove, t))
}
},
J = {
loadInSlide: function (e, r) {
void 0 === r && (r = !0);
var l, c = this,
d = c.params.lazy;
void 0 !== e && 0 !== c.slides.length && (e = (l = c.virtual && c.params.virtual.enabled ? c.$wrapperEl.children("." + c.params.slideClass + '[data-swiper-slide-index="' + e + '"]') : c.slides.eq(e)).find("." + d.elementClass + ":not(." + d.loadedClass + "):not(." + d.loadingClass + ")"), 0 !== (e = !l.hasClass(d.elementClass) || l.hasClass(d.loadedClass) || l.hasClass(d.loadingClass) ? e : e.add(l[0])).length && e.each(function (e, t) {
var i = T(t),
s = (i.addClass(d.loadingClass), i.attr("data-background")),
a = i.attr("data-src"),
n = i.attr("data-srcset"),
o = i.attr("data-sizes");
c.loadImage(i[0], a || s, n, o, !1,
function () {
var e, t;
null == c || !c || c && !c.params || c.destroyed || (s ? (i.css("background-image", 'url("' + s + '")'), i.removeAttr("data-background")) : (n && (i.attr("srcset", n), i.removeAttr("data-srcset")), o && (i.attr("sizes", o), i.removeAttr("data-sizes")), a && (i.attr("src", a), i.removeAttr("data-src"))), i.addClass(d.loadedClass).removeClass(d.loadingClass), l.find("." + d.preloaderClass).remove(), c.params.loop && r && (e = l.attr("data-swiper-slide-index"), l.hasClass(c.params.slideDuplicateClass) ? (t = c.$wrapperEl.children('[data-swiper-slide-index="' + e + '"]:not(.' + c.params.slideDuplicateClass + ")"), c.lazy.loadInSlide(t.index(), !1)) : (t = c.$wrapperEl.children("." + c.params.slideDuplicateClass + '[data-swiper-slide-index="' + e + '"]'), c.lazy.loadInSlide(t.index(), !1))), c.emit("lazyImageReady", l[0], i[0]))
}),
c.emit("lazyImageLoad", l[0], i[0])
}))
},
load: function () {
var i = this,
t = i.$wrapperEl,
s = i.params,
a = i.slides,
e = i.activeIndex,
n = i.virtual && s.virtual.enabled,
o = s.lazy,
r = s.slidesPerView;
function l(e) {
if (n) {
if (t.children("." + s.slideClass + '[data-swiper-slide-index="' + e + '"]').length) return 1
} else if (a[e]) return 1
}
function c(e) {
return n ? T(e).attr("data-swiper-slide-index") : T(e).index()
}
if ("auto" === r && (r = 0), i.lazy.initialImageLoaded || (i.lazy.initialImageLoaded = !0), i.params.watchSlidesVisibility) t.children("." + s.slideVisibleClass).each(function (e, t) {
t = n ? T(t).attr("data-swiper-slide-index") : T(t).index();
i.lazy.loadInSlide(t)
});
else if (1 < r) for (var d = e; d < e + r; d += 1) l(d) && i.lazy.loadInSlide(d);
else i.lazy.loadInSlide(e);
if (o.loadPrevNext) if (1 < r || o.loadPrevNextAmount && 1 < o.loadPrevNextAmount) {
for (var o = o.loadPrevNextAmount,
h = r,
u = Math.min(e + h + Math.max(o, h), a.length), h = Math.max(e - Math.max(h, o), 0), p = e + r; p < u; p += 1) l(p) && i.lazy.loadInSlide(p);
for (var m = h; m < e; m += 1) l(m) && i.lazy.loadInSlide(m)
} else {
o = t.children("." + s.slideNextClass),
h = (0 < o.length && i.lazy.loadInSlide(c(o)), t.children("." + s.slidePrevClass));
0 < h.length && i.lazy.loadInSlide(c(h))
}
}
},
I = {
LinearSpline: function (e, t) {
var i, s, a, n, o;
return this.x = e,
this.y = t,
this.lastIndex = e.length - 1,
this.interpolate = function (e) {
return e ? (o = function (e, t) {
for (s = -1, i = e.length; 1 < i - s;) e[a = i + s >> 1] <= t ? s = a : i = a;
return i
}(this.x, e), n = o - 1, (e - this.x[n]) * (this.y[o] - this.y[n]) / (this.x[o] - this.x[n]) + this.y[n]) : 0
},
this
},
getInterpolateFunction: function (e) {
this.controller.spline || (this.controller.spline = this.params.loop ? new I.LinearSpline(this.slidesGrid, e.slidesGrid) : new I.LinearSpline(this.snapGrid, e.snapGrid))
},
setTranslate: function (e, t) {
var i, s, a = this,
n = a.controller.control;
function o(e) {
var t = a.rtlTranslate ? -a.translate : a.translate;
"slide" === a.params.controller.by && (a.controller.getInterpolateFunction(e), s = -a.controller.spline.interpolate(- t)),
s && "container" !== a.params.controller.by || (i = (e.maxTranslate() - e.minTranslate()) / (a.maxTranslate() - a.minTranslate()), s = (t - a.minTranslate()) * i + e.minTranslate()),
a.params.controller.inverse && (s = e.maxTranslate() - s),
e.updateProgress(s),
e.setTranslate(s, a),
e.updateActiveIndex(),
e.updateSlidesClasses()
}
if (Array.isArray(n)) for (var r = 0; r < n.length; r += 1) n[r] !== t && n[r] instanceof p && o(n[r]);
else n instanceof p && t !== n && o(n)
},
setTransition: function (t, e) {
var i, s = this,
a = s.controller.control;
function n(e) {
e.setTransition(t, s),
0 !== t && (e.transitionStart(), e.params.autoHeight && U.nextTick(function () {
e.updateAutoHeight()
}), e.$wrapperEl.transitionEnd(function () {
a && (e.params.loop && "slide" === s.params.controller.by && e.loopFix(), e.transitionEnd())
}))
}
if (Array.isArray(a)) for (i = 0; i < a.length; i += 1) a[i] !== e && a[i] instanceof p && n(a[i]);
else a instanceof p && e !== a && n(a)
}
},
ee = {
makeElFocusable: function (e) {
return e.attr("tabIndex", "0"),
e
},
addElRole: function (e, t) {
return e.attr("role", t),
e
},
addElLabel: function (e, t) {
return e.attr("aria-label", t),
e
},
disableEl: function (e) {
return e.attr("aria-disabled", !0),
e
},
enableEl: function (e) {
return e.attr("aria-disabled", !1),
e
},
onEnterKey: function (e) {
var t = this.params.a11y;
13 === e.keyCode && (e = T(e.target), this.navigation && this.navigation.$nextEl && e.is(this.navigation.$nextEl) && (this.isEnd && !this.params.loop || this.slideNext(), this.isEnd ? this.a11y.notify(t.lastSlideMessage) : this.a11y.notify(t.nextSlideMessage)), this.navigation && this.navigation.$prevEl && e.is(this.navigation.$prevEl) && (this.isBeginning && !this.params.loop || this.slidePrev(), this.isBeginning ? this.a11y.notify(t.firstSlideMessage) : this.a11y.notify(t.prevSlideMessage)), this.pagination && e.is("." + this.params.pagination.bulletClass) && e[0].click())
},
notify: function (e) {
var t = this.a11y.liveRegion;
0 !== t.length && (t.html(""), t.html(e))
},
updateNavigation: function () {
var e, t; !this.params.loop && this.navigation && (e = (t = this.navigation).$nextEl, (t = t.$prevEl) && 0 < t.length && (this.isBeginning ? this.a11y.disableEl(t) : this.a11y.enableEl(t)), e && 0 < e.length && (this.isEnd ? this.a11y.disableEl(e) : this.a11y.enableEl(e)))
},
updatePagination: function () {
var i = this,
s = i.params.a11y;
i.pagination && i.params.pagination.clickable && i.pagination.bullets && i.pagination.bullets.length && i.pagination.bullets.each(function (e, t) {
t = T(t);
i.a11y.makeElFocusable(t),
i.a11y.addElRole(t, "button"),
i.a11y.addElLabel(t, s.paginationBulletMessage.replace(/{{index}}/, t.index() + 1))
})
},
init: function () {
this.$el.append(this.a11y.liveRegion);
var e, t, i = this.params.a11y;
this.navigation && this.navigation.$nextEl && (e = this.navigation.$nextEl),
this.navigation && this.navigation.$prevEl && (t = this.navigation.$prevEl),
e && (this.a11y.makeElFocusable(e), this.a11y.addElRole(e, "button"), this.a11y.addElLabel(e, i.nextSlideMessage), e.on("keydown", this.a11y.onEnterKey)),
t && (this.a11y.makeElFocusable(t), this.a11y.addElRole(t, "button"), this.a11y.addElLabel(t, i.prevSlideMessage), t.on("keydown", this.a11y.onEnterKey)),
this.pagination && this.params.pagination.clickable && this.pagination.bullets && this.pagination.bullets.length && this.pagination.$el.on("keydown", "." + this.params.pagination.bulletClass, this.a11y.onEnterKey)
},
destroy: function () {
var e, t;
this.a11y.liveRegion && 0 < this.a11y.liveRegion.length && this.a11y.liveRegion.remove(),
this.navigation && this.navigation.$nextEl && (e = this.navigation.$nextEl),
this.navigation && this.navigation.$prevEl && (t = this.navigation.$prevEl),
e && e.off("keydown", this.a11y.onEnterKey),
t && t.off("keydown", this.a11y.onEnterKey),
this.pagination && this.params.pagination.clickable && this.pagination.bullets && this.pagination.bullets.length && this.pagination.$el.off("keydown", "." + this.params.pagination.bulletClass, this.a11y.onEnterKey)
}
},
M = {
init: function () {
if (this.params.history) {
if (!j.history || !j.history.pushState) return this.params.history.enabled = !1,
void (this.params.hashNavigation.enabled = !0);
var e = this.history;
e.initialized = !0,
e.paths = M.getPathValues(),
(e.paths.key || e.paths.value) && (e.scrollToSlide(0, e.paths.value, this.params.runCallbacksOnInit), this.params.history.replaceState || j.addEventListener("popstate", this.history.setHistoryPopState))
}
},
destroy: function () {
this.params.history.replaceState || j.removeEventListener("popstate", this.history.setHistoryPopState)
},
setHistoryPopState: function () {
this.history.paths = M.getPathValues(),
this.history.scrollToSlide(this.params.speed, this.history.paths.value, !1)
},
getPathValues: function () {
var e = j.location.pathname.slice(1).split("/").filter(function (e) {
return "" !== e
}),
t = e.length;
return {
key: e[t - 2],
value: e[t - 1]
}
},
setHistory: function (e, t) {
this.history.initialized && this.params.history.enabled && (t = this.slides.eq(t), t = M.slugify(t.attr("data-history")), j.location.pathname.includes(e) || (t = e + "/" + t), (e = j.history.state) && e.value === t || (this.params.history.replaceState ? j.history.replaceState({
value: t
},
null, t) : j.history.pushState({
value: t
},
null, t)))
},
slugify: function (e) {
return e.toString().replace(/\s+/g, "-").replace(/[^\w-]+/g, "").replace(/--+/g, "-").replace(/^-+/, "").replace(/-+$/, "")
},
scrollToSlide: function (e, t, i) {
if (t) for (var s = 0,
a = this.slides.length; s < a; s += 1) {
var n = this.slides.eq(s);
M.slugify(n.attr("data-history")) !== t || n.hasClass(this.params.slideDuplicateClass) || (n = n.index(), this.slideTo(n, e, i))
} else this.slideTo(0, e, i)
}
},
P = {
onHashCange: function () {
var e = h.location.hash.replace("#", "");
e !== this.slides.eq(this.activeIndex).attr("data-hash") && void 0 !== (e = this.$wrapperEl.children("." + this.params.slideClass + '[data-hash="' + e + '"]').index()) && this.slideTo(e)
},
setHash: function () {
var e;
this.hashNavigation.initialized && this.params.hashNavigation.enabled && (this.params.hashNavigation.replaceState && j.history && j.history.replaceState ? j.history.replaceState(null, null, "#" + this.slides.eq(this.activeIndex).attr("data-hash") || "") : (e = (e = this.slides.eq(this.activeIndex)).attr("data-hash") || e.attr("data-history"), h.location.hash = e || ""))
},
init: function () {
if (!(!this.params.hashNavigation.enabled || this.params.history && this.params.history.enabled)) {
this.hashNavigation.initialized = !0;
var e = h.location.hash.replace("#", "");
if (e) for (var t = 0,
i = this.slides.length; t < i; t += 1) {
var s = this.slides.eq(t); (s.attr("data-hash") || s.attr("data-history")) !== e || s.hasClass(this.params.slideDuplicateClass) || (s = s.index(), this.slideTo(s, 0, this.params.runCallbacksOnInit, !0))
}
this.params.hashNavigation.watchState && T(j).on("hashchange", this.hashNavigation.onHashCange)
}
},
destroy: function () {
this.params.hashNavigation.watchState && T(j).off("hashchange", this.hashNavigation.onHashCange)
}
},
z = {
run: function () {
var e = this,
t = e.slides.eq(e.activeIndex),
i = e.params.autoplay.delay;
t.attr("data-swiper-autoplay") && (i = t.attr("data-swiper-autoplay") || e.params.autoplay.delay),
clearTimeout(e.autoplay.timeout),
e.autoplay.timeout = U.nextTick(function () {
e.params.autoplay.reverseDirection ? e.params.loop ? (e.loopFix(), e.slidePrev(e.params.speed, !0, !0), e.emit("autoplay")) : e.isBeginning ? e.params.autoplay.stopOnLastSlide ? e.autoplay.stop() : (e.slideTo(e.slides.length - 1, e.params.speed, !0, !0), e.emit("autoplay")) : (e.slidePrev(e.params.speed, !0, !0), e.emit("autoplay")) : e.params.loop ? (e.loopFix(), e.slideNext(e.params.speed, !0, !0), e.emit("autoplay")) : e.isEnd ? e.params.autoplay.stopOnLastSlide ? e.autoplay.stop() : (e.slideTo(0, e.params.speed, !0, !0), e.emit("autoplay")) : (e.slideNext(e.params.speed, !0, !0), e.emit("autoplay")),
e.params.cssMode && e.autoplay.running && e.autoplay.run()
},
i)
},
start: function () {
return void 0 === this.autoplay.timeout && !this.autoplay.running && (this.autoplay.running = !0, this.emit("autoplayStart"), this.autoplay.run(), !0)
},
stop: function () {
return !!this.autoplay.running && void 0 !== this.autoplay.timeout && (this.autoplay.timeout && (clearTimeout(this.autoplay.timeout), this.autoplay.timeout = void 0), this.autoplay.running = !1, this.emit("autoplayStop"), !0)
},
pause: function (e) {
!this.autoplay.running || this.autoplay.paused || (this.autoplay.timeout && clearTimeout(this.autoplay.timeout), this.autoplay.paused = !0, 0 !== e && this.params.autoplay.waitForTransition ? (this.$wrapperEl[0].addEventListener("transitionend", this.autoplay.onTransitionEnd), this.$wrapperEl[0].addEventListener("webkitTransitionEnd", this.autoplay.onTransitionEnd)) : (this.autoplay.paused = !1, this.autoplay.run()))
}
},
te = {
setTranslate: function () {
for (var e = this.slides,
t = 0; t < e.length; t += 1) {
var i = this.slides.eq(t),
s = -i[0].swiperSlideOffset,
a = (this.params.virtualTranslate || (s -= this.translate), 0),
n = (this.isHorizontal() || (a = s, s = 0), this.params.fadeEffect.crossFade ? Math.max(1 - Math.abs(i[0].progress), 0) : 1 + Math.min(Math.max(i[0].progress, -1), 0));
i.css({
opacity: n
}).transform("translate3d(" + s + "px, " + a + "px, 0px)")
}
},
setTransition: function (e) {
var i, s = this,
t = s.slides,
a = s.$wrapperEl;
t.transition(e),
s.params.virtualTranslate && 0 !== e && (i = !1, t.transitionEnd(function () {
if (!i && s && !s.destroyed) {
i = !0,
s.animating = !1;
for (var e = ["webkitTransitionEnd", "transitionend"], t = 0; t < e.length; t += 1) a.trigger(e[t])
}
}))
}
},
ie = {
setTranslate: function () {
var e, t = this.$el,
i = this.$wrapperEl,
s = this.slides,
a = this.width,
n = this.height,
o = this.rtlTranslate,
r = this.size,
l = this.params.cubeEffect,
c = this.isHorizontal(),
d = this.virtual && this.params.virtual.enabled,
h = 0;
l.shadow && (c ? (0 === (e = i.find(".swiper-cube-shadow")).length && (e = T(''), i.append(e)), e.css({
height: a + "px"
})) : 0 === (e = t.find(".swiper-cube-shadow")).length && (e = T(''), t.append(e)));
for (var u, p = 0; p < s.length; p += 1) {
var m = s.eq(p),
f = p,
v = 90 * (f = d ? parseInt(m.attr("data-swiper-slide-index"), 10) : f),
g = Math.floor(v / 360),
w = (o && (v = -v, g = Math.floor(- v / 360)), Math.max(Math.min(m[0].progress, 1), -1)),
b = 0,
y = 0,
E = 0,
g = (f % 4 == 0 ? (b = 4 * -g * r, E = 0) : (f - 1) % 4 == 0 ? (b = 0, E = 4 * -g * r) : (f - 2) % 4 == 0 ? (b = r + 4 * g * r, E = r) : (f - 3) % 4 == 0 && (b = -r, E = 3 * r + 4 * r * g), o && (b = -b), c || (y = b, b = 0), "rotateX(" + (c ? 0 : -v) + "deg) rotateY(" + (c ? v : 0) + "deg) translate3d(" + b + "px, " + y + "px, " + E + "px)");
w <= 1 && -1 < w && (h = o ? 90 * -f - 90 * w : 90 * f + 90 * w),
m.transform(g),
l.slideShadows && (v = c ? m.find(".swiper-slide-shadow-left") : m.find(".swiper-slide-shadow-top"), b = c ? m.find(".swiper-slide-shadow-right") : m.find(".swiper-slide-shadow-bottom"), 0 === v.length && (v = T(''), m.append(v)), 0 === b.length && (b = T(''), m.append(b)), v.length && (v[0].style.opacity = Math.max(- w, 0)), b.length && (b[0].style.opacity = Math.max(w, 0)))
}
i.css({
"-webkit-transform-origin": "50% 50% -" + r / 2 + "px",
"-moz-transform-origin": "50% 50% -" + r / 2 + "px",
"-ms-transform-origin": "50% 50% -" + r / 2 + "px",
"transform-origin": "50% 50% -" + r / 2 + "px"
}),
l.shadow && (c ? e.transform("translate3d(0px, " + (a / 2 + l.shadowOffset) + "px, " + -a / 2 + "px) rotateX(90deg) rotateZ(0deg) scale(" + l.shadowScale + ")") : (t = Math.abs(h) - 90 * Math.floor(Math.abs(h) / 90), a = 1.5 - (Math.sin(2 * t * Math.PI / 360) / 2 + Math.cos(2 * t * Math.PI / 360) / 2), t = l.shadowScale, a = l.shadowScale / a, u = l.shadowOffset, e.transform("scale3d(" + t + ", 1, " + a + ") translate3d(0px, " + (n / 2 + u) + "px, " + -n / 2 / a + "px) rotateX(-90deg)"))),
i.transform("translate3d(0px,0," + (x.isSafari || x.isUiWebView ? -r / 2 : 0) + "px) rotateX(" + (this.isHorizontal() ? 0 : h) + "deg) rotateY(" + (this.isHorizontal() ? -h : 0) + "deg)")
},
setTransition: function (e) {
var t = this.$el;
this.slides.transition(e).find(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").transition(e),
this.params.cubeEffect.shadow && !this.isHorizontal() && t.find(".swiper-cube-shadow").transition(e)
}
},
se = {
setTranslate: function () {
for (var e = this.slides,
t = this.rtlTranslate,
i = 0; i < e.length; i += 1) {
var s, a, n = e.eq(i),
o = n[0].progress,
r = -180 * (o = this.params.flipEffect.limitRotation ? Math.max(Math.min(n[0].progress, 1), -1) : o),
l = 0,
c = -n[0].swiperSlideOffset,
d = 0;
this.isHorizontal() ? t && (r = -r) : (d = c, l = -r, r = c = 0),
n[0].style.zIndex = -Math.abs(Math.round(o)) + e.length,
this.params.flipEffect.slideShadows && (s = this.isHorizontal() ? n.find(".swiper-slide-shadow-left") : n.find(".swiper-slide-shadow-top"), a = this.isHorizontal() ? n.find(".swiper-slide-shadow-right") : n.find(".swiper-slide-shadow-bottom"), 0 === s.length && (s = T(''), n.append(s)), 0 === a.length && (a = T(''), n.append(a)), s.length && (s[0].style.opacity = Math.max(- o, 0)), a.length && (a[0].style.opacity = Math.max(o, 0))),
n.transform("translate3d(" + c + "px, " + d + "px, 0px) rotateX(" + l + "deg) rotateY(" + r + "deg)")
}
},
setTransition: function (e) {
var i, s = this,
t = s.slides,
a = s.activeIndex,
n = s.$wrapperEl;
t.transition(e).find(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").transition(e),
s.params.virtualTranslate && 0 !== e && (i = !1, t.eq(a).transitionEnd(function () {
if (!i && s && !s.destroyed) {
i = !0,
s.animating = !1;
for (var e = ["webkitTransitionEnd", "transitionend"], t = 0; t < e.length; t += 1) n.trigger(e[t])
}
}))
}
},
ae = {
setTranslate: function () {
for (var e = this.width,
t = this.height,
i = this.slides,
s = this.$wrapperEl,
a = this.slidesSizesGrid,
n = this.params.coverflowEffect,
o = this.isHorizontal(), r = this.translate, l = o ? e / 2 - r : t / 2 - r, c = o ? n.rotate : -n.rotate, d = n.depth, h = 0, u = i.length; h < u; h += 1) {
var p = i.eq(h),
m = a[h],
m = (l - p[0].swiperSlideOffset - m / 2) / m * n.modifier,
f = o ? c * m : 0,
v = o ? 0 : c * m,
g = -d * Math.abs(m),
w = o ? 0 : n.stretch * m,
b = o ? n.stretch * m : 0,
b = (Math.abs(b) < .001 && (b = 0), Math.abs(w) < .001 && (w = 0), Math.abs(g) < .001 && (g = 0), Math.abs(f) < .001 && (f = 0), "translate3d(" + b + "px," + w + "px," + g + "px) rotateX(" + (v = Math.abs(v) < .001 ? 0 : v) + "deg) rotateY(" + f + "deg)");
p.transform(b),
p[0].style.zIndex = 1 - Math.abs(Math.round(m)),
n.slideShadows && (w = o ? p.find(".swiper-slide-shadow-left") : p.find(".swiper-slide-shadow-top"), g = o ? p.find(".swiper-slide-shadow-right") : p.find(".swiper-slide-shadow-bottom"), 0 === w.length && (w = T(''), p.append(w)), 0 === g.length && (g = T(''), p.append(g)), w.length && (w[0].style.opacity = 0 < m ? m : 0), g.length && (g[0].style.opacity = 0 < -m ? -m : 0))
} (y.pointerEvents || y.prefixedPointerEvents) && (s[0].style.perspectiveOrigin = l + "px 50%")
},
setTransition: function (e) {
this.slides.transition(e).find(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").transition(e)
}
},
ne = {
init: function () {
var e = this.params.thumbs,
t = this.constructor;
e.swiper instanceof t ? (this.thumbs.swiper = e.swiper, U.extend(this.thumbs.swiper.originalParams, {
watchSlidesProgress: !0,
slideToClickedSlide: !1
}), U.extend(this.thumbs.swiper.params, {
watchSlidesProgress: !0,
slideToClickedSlide: !1
})) : U.isObject(e.swiper) && (this.thumbs.swiper = new t(U.extend({},
e.swiper, {
watchSlidesVisibility: !0,
watchSlidesProgress: !0,
slideToClickedSlide: !1
})), this.thumbs.swiperCreated = !0),
this.thumbs.swiper.$el.addClass(this.params.thumbs.thumbsContainerClass),
this.thumbs.swiper.on("tap", this.thumbs.onThumbClick)
},
onThumbClick: function () {
var e, t, i, s = this.thumbs.swiper;
s && (e = s.clickedIndex, (i = s.clickedSlide) && T(i).hasClass(this.params.thumbs.slideThumbActiveClass) || null == e || (i = s.params.loop ? parseInt(T(s.clickedSlide).attr("data-swiper-slide-index"), 10) : e, this.params.loop && (s = this.activeIndex, this.slides.eq(s).hasClass(this.params.slideDuplicateClass) && (this.loopFix(), this._clientLeft = this.$wrapperEl[0].clientLeft, s = this.activeIndex), e = this.slides.eq(s).prevAll('[data-swiper-slide-index="' + i + '"]').eq(0).index(), t = this.slides.eq(s).nextAll('[data-swiper-slide-index="' + i + '"]').eq(0).index(), i = void 0 === e || void 0 !== t && t - s < s - e ? t : e), this.slideTo(i)))
},
update: function (e) {
var t = this.thumbs.swiper;
if (t) {
var i, s, a, n = "auto" === t.params.slidesPerView ? t.slidesPerViewDynamic() : t.params.slidesPerView,
o = (this.realIndex !== t.realIndex && (i = t.activeIndex, a = t.params.loop ? (t.slides.eq(i).hasClass(t.params.slideDuplicateClass) && (t.loopFix(), t._clientLeft = t.$wrapperEl[0].clientLeft, i = t.activeIndex), s = t.slides.eq(i).prevAll('[data-swiper-slide-index="' + this.realIndex + '"]').eq(0).index(), a = t.slides.eq(i).nextAll('[data-swiper-slide-index="' + this.realIndex + '"]').eq(0).index(), void 0 === s ? a : void 0 === a ? s : a - i == i - s ? i : a - i < i - s ? a : s) : this.realIndex, t.visibleSlidesIndexes && t.visibleSlidesIndexes.indexOf(a) < 0 && (t.params.centeredSlides ? a = i < a ? a - Math.floor(n / 2) + 1 : a + Math.floor(n / 2) - 1 : i < a && (a = a - n + 1), t.slideTo(a, e ? 0 : void 0))), 1),
r = this.params.thumbs.slideThumbActiveClass;
if (1 < this.params.slidesPerView && !this.params.centeredSlides && (o = this.params.slidesPerView), this.params.thumbs.multipleActiveThumbs || (o = 1), o = Math.floor(o), t.slides.removeClass(r), t.params.loop || t.params.virtual && t.params.virtual.enabled) for (var l = 0; l < o; l += 1) t.$wrapperEl.children('[data-swiper-slide-index="' + (this.realIndex + l) + '"]').addClass(r);
else for (var c = 0; c < o; c += 1) t.slides.eq(this.realIndex + c).addClass(r)
}
}
},
O = [m, Y, X, f, g, b, E, {
name: "mousewheel",
params: {
mousewheel: {
enabled: !1,
releaseOnEdges: !1,
invert: !1,
forceToAxis: !1,
sensitivity: 1,
eventsTarged: "container"
}
},
create: function () {
U.extend(this, {
mousewheel: {
enabled: !1,
enable: C.enable.bind(this),
disable: C.disable.bind(this),
handle: C.handle.bind(this),
handleMouseEnter: C.handleMouseEnter.bind(this),
handleMouseLeave: C.handleMouseLeave.bind(this),
animateSlider: C.animateSlider.bind(this),
releaseScroll: C.releaseScroll.bind(this),
lastScrollTime: U.now(),
lastEventBeforeSnap: void 0,
recentWheelEvents: []
}
})
},
on: {
init: function () {
!this.params.mousewheel.enabled && this.params.cssMode && this.mousewheel.disable(),
this.params.mousewheel.enabled && this.mousewheel.enable()
},
destroy: function () {
this.params.cssMode && this.mousewheel.enable(),
this.mousewheel.enabled && this.mousewheel.disable()
}
}
},
{
name: "navigation",
params: {
navigation: {
nextEl: null,
prevEl: null,
hideOnClick: !1,
disabledClass: "swiper-button-disabled",
hiddenClass: "swiper-button-hidden",
lockClass: "swiper-button-lock"
}
},
create: function () {
U.extend(this, {
navigation: {
init: L.init.bind(this),
update: L.update.bind(this),
destroy: L.destroy.bind(this),
onNextClick: L.onNextClick.bind(this),
onPrevClick: L.onPrevClick.bind(this)
}
})
},
on: {
init: function () {
this.navigation.init(),
this.navigation.update()
},
toEdge: function () {
this.navigation.update()
},
fromEdge: function () {
this.navigation.update()
},
destroy: function () {
this.navigation.destroy()
},
click: function (e) {
var t, i = this.navigation,
s = i.$nextEl,
i = i.$prevEl; !this.params.navigation.hideOnClick || T(e.target).is(i) || T(e.target).is(s) || (s ? t = s.hasClass(this.params.navigation.hiddenClass) : i && (t = i.hasClass(this.params.navigation.hiddenClass)), !0 === t ? this.emit("navigationShow", this) : this.emit("navigationHide", this), s && s.toggleClass(this.params.navigation.hiddenClass), i && i.toggleClass(this.params.navigation.hiddenClass))
}
}
},
{
name: "pagination",
params: {
pagination: {
el: null,
bulletElement: "span",
clickable: !1,
hideOnClick: !1,
renderBullet: null,
renderProgressbar: null,
renderFraction: null,
renderCustom: null,
progressbarOpposite: !1,
type: "bullets",
dynamicBullets: !1,
dynamicMainBullets: 1,
formatFractionCurrent: function (e) {
return e
},
formatFractionTotal: function (e) {
return e
},
bulletClass: "swiper-pagination-bullet",
bulletActiveClass: "swiper-pagination-bullet-active",
modifierClass: "swiper-pagination-",
currentClass: "swiper-pagination-current",
totalClass: "swiper-pagination-total",
hiddenClass: "swiper-pagination-hidden",
progressbarFillClass: "swiper-pagination-progressbar-fill",
progressbarOppositeClass: "swiper-pagination-progressbar-opposite",
clickableClass: "swiper-pagination-clickable",
lockClass: "swiper-pagination-lock"
}
},
create: function () {
U.extend(this, {
pagination: {
init: k.init.bind(this),
render: k.render.bind(this),
update: k.update.bind(this),
destroy: k.destroy.bind(this),
dynamicBulletIndex: 0
}
})
},
on: {
init: function () {
this.pagination.init(),
this.pagination.render(),
this.pagination.update()
},
activeIndexChange: function () {
!this.params.loop && void 0 !== this.snapIndex || this.pagination.update()
},
snapIndexChange: function () {
this.params.loop || this.pagination.update()
},
slidesLengthChange: function () {
this.params.loop && (this.pagination.render(), this.pagination.update())
},
snapGridLengthChange: function () {
this.params.loop || (this.pagination.render(), this.pagination.update())
},
destroy: function () {
this.pagination.destroy()
},
click: function (e) {
this.params.pagination.el && this.params.pagination.hideOnClick && 0 < this.pagination.$el.length && !T(e.target).hasClass(this.params.pagination.bulletClass) && (!0 === this.pagination.$el.hasClass(this.params.pagination.hiddenClass) ? this.emit("paginationShow", this) : this.emit("paginationHide", this), this.pagination.$el.toggleClass(this.params.pagination.hiddenClass))
}
}
},
{
name: "scrollbar",
params: {
scrollbar: {
el: null,
dragSize: "auto",
hide: !1,
draggable: !1,
snapOnRelease: !0,
lockClass: "swiper-scrollbar-lock",
dragClass: "swiper-scrollbar-drag"
}
},
create: function () {
U.extend(this, {
scrollbar: {
init: A.init.bind(this),
destroy: A.destroy.bind(this),
updateSize: A.updateSize.bind(this),
setTranslate: A.setTranslate.bind(this),
setTransition: A.setTransition.bind(this),
enableDraggable: A.enableDraggable.bind(this),
disableDraggable: A.disableDraggable.bind(this),
setDragPosition: A.setDragPosition.bind(this),
getPointerPosition: A.getPointerPosition.bind(this),
onDragStart: A.onDragStart.bind(this),
onDragMove: A.onDragMove.bind(this),
onDragEnd: A.onDragEnd.bind(this),
isTouched: !1,
timeout: null,
dragTimeout: null
}
})
},
on: {
init: function () {
this.scrollbar.init(),
this.scrollbar.updateSize(),
this.scrollbar.setTranslate()
},
update: function () {
this.scrollbar.updateSize()
},
resize: function () {
this.scrollbar.updateSize()
},
observerUpdate: function () {
this.scrollbar.updateSize()
},
setTranslate: function () {
this.scrollbar.setTranslate()
},
setTransition: function (e) {
this.scrollbar.setTransition(e)
},
destroy: function () {
this.scrollbar.destroy()
}
}
},
{
name: "parallax",
params: {
parallax: {
enabled: !1
}
},
create: function () {
U.extend(this, {
parallax: {
setTransform: Q.setTransform.bind(this),
setTranslate: Q.setTranslate.bind(this),
setTransition: Q.setTransition.bind(this)
}
})
},
on: {
beforeInit: function () {
this.params.parallax.enabled && (this.params.watchSlidesProgress = !0, this.originalParams.watchSlidesProgress = !0)
},
init: function () {
this.params.parallax.enabled && this.parallax.setTranslate()
},
setTranslate: function () {
this.params.parallax.enabled && this.parallax.setTranslate()
},
setTransition: function (e) {
this.params.parallax.enabled && this.parallax.setTransition(e)
}
}
},
{
name: "zoom",
params: {
zoom: {
enabled: !1,
maxRatio: 3,
minRatio: 1,
toggle: !0,
containerClass: "swiper-zoom-container",
zoomedSlideClass: "swiper-slide-zoomed"
}
},
create: function () {
var s = this,
t = {
enabled: !1,
scale: 1,
currentScale: 1,
isScaling: !1,
gesture: {
$slideEl: void 0,
slideWidth: void 0,
slideHeight: void 0,
$imageEl: void 0,
$imageWrapEl: void 0,
maxRatio: 3
},
image: {
isTouched: void 0,
isMoved: void 0,
currentX: void 0,
currentY: void 0,
minX: void 0,
minY: void 0,
maxX: void 0,
maxY: void 0,
width: void 0,
height: void 0,
startX: void 0,
startY: void 0,
touchesStart: {},
touchesCurrent: {}
},
velocity: {
x: void 0,
y: void 0,
prevPositionX: void 0,
prevPositionY: void 0,
prevTime: void 0
}
},
a = ("onGestureStart onGestureChange onGestureEnd onTouchStart onTouchMove onTouchEnd onTransitionEnd toggle enable disable in out".split(" ").forEach(function (e) {
t[e] = Z[e].bind(s)
}), U.extend(s, {
zoom: t
}), 1);
Object.defineProperty(s.zoom, "scale", {
get: function () {
return a
},
set: function (e) {
var t, i;
a !== e && (t = s.zoom.gesture.$imageEl ? s.zoom.gesture.$imageEl[0] : void 0, i = s.zoom.gesture.$slideEl ? s.zoom.gesture.$slideEl[0] : void 0, s.emit("zoomChange", e, t, i)),
a = e
}
})
},
on: {
init: function () {
this.params.zoom.enabled && this.zoom.enable()
},
destroy: function () {
this.zoom.disable()
},
touchStart: function (e) {
this.zoom.enabled && this.zoom.onTouchStart(e)
},
touchEnd: function (e) {
this.zoom.enabled && this.zoom.onTouchEnd(e)
},
doubleTap: function (e) {
this.params.zoom.enabled && this.zoom.enabled && this.params.zoom.toggle && this.zoom.toggle(e)
},
transitionEnd: function () {
this.zoom.enabled && this.params.zoom.enabled && this.zoom.onTransitionEnd()
},
slideChange: function () {
this.zoom.enabled && this.params.zoom.enabled && this.params.cssMode && this.zoom.onTransitionEnd()
}
}
},
{
name: "lazy",
params: {
lazy: {
enabled: !1,
loadPrevNext: !1,
loadPrevNextAmount: 1,
loadOnTransitionStart: !1,
elementClass: "swiper-lazy",
loadingClass: "swiper-lazy-loading",
loadedClass: "swiper-lazy-loaded",
preloaderClass: "swiper-lazy-preloader"
}
},
create: function () {
U.extend(this, {
lazy: {
initialImageLoaded: !1,
load: J.load.bind(this),
loadInSlide: J.loadInSlide.bind(this)
}
})
},
on: {
beforeInit: function () {
this.params.lazy.enabled && this.params.preloadImages && (this.params.preloadImages = !1)
},
init: function () {
this.params.lazy.enabled && !this.params.loop && 0 === this.params.initialSlide && this.lazy.load()
},
scroll: function () {
this.params.freeMode && !this.params.freeModeSticky && this.lazy.load()
},
resize: function () {
this.params.lazy.enabled && this.lazy.load()
},
scrollbarDragMove: function () {
this.params.lazy.enabled && this.lazy.load()
},
transitionStart: function () {
this.params.lazy.enabled && (this.params.lazy.loadOnTransitionStart || !this.params.lazy.loadOnTransitionStart && !this.lazy.initialImageLoaded) && this.lazy.load()
},
transitionEnd: function () {
this.params.lazy.enabled && !this.params.lazy.loadOnTransitionStart && this.lazy.load()
},
slideChange: function () {
this.params.lazy.enabled && this.params.cssMode && this.lazy.load()
}
}
},
{
name: "controller",
params: {
controller: {
control: void 0,
inverse: !1,
by: "slide"
}
},
create: function () {
U.extend(this, {
controller: {
control: this.params.controller.control,
getInterpolateFunction: I.getInterpolateFunction.bind(this),
setTranslate: I.setTranslate.bind(this),
setTransition: I.setTransition.bind(this)
}
})
},
on: {
update: function () {
this.controller.control && this.controller.spline && (this.controller.spline = void 0, delete this.controller.spline)
},
resize: function () {
this.controller.control && this.controller.spline && (this.controller.spline = void 0, delete this.controller.spline)
},
observerUpdate: function () {
this.controller.control && this.controller.spline && (this.controller.spline = void 0, delete this.controller.spline)
},
setTranslate: function (e, t) {
this.controller.control && this.controller.setTranslate(e, t)
},
setTransition: function (e, t) {
this.controller.control && this.controller.setTransition(e, t)
}
}
},
{
name: "a11y",
params: {
a11y: {
enabled: !0,
notificationClass: "swiper-notification",
prevSlideMessage: "Previous slide",
nextSlideMessage: "Next slide",
firstSlideMessage: "This is the first slide",
lastSlideMessage: "This is the last slide",
paginationBulletMessage: "Go to slide {{index}}"
}
},
create: function () {
var t = this;
U.extend(t, {
a11y: {
liveRegion: T('')
}
}),
Object.keys(ee).forEach(function (e) {
t.a11y[e] = ee[e].bind(t)
})
},
on: {
init: function () {
this.params.a11y.enabled && (this.a11y.init(), this.a11y.updateNavigation())
},
toEdge: function () {
this.params.a11y.enabled && this.a11y.updateNavigation()
},
fromEdge: function () {
this.params.a11y.enabled && this.a11y.updateNavigation()
},
paginationUpdate: function () {
this.params.a11y.enabled && this.a11y.updatePagination()
},
destroy: function () {
this.params.a11y.enabled && this.a11y.destroy()
}
}
},
{
name: "history",
params: {
history: {
enabled: !1,
replaceState: !1,
key: "slides"
}
},
create: function () {
U.extend(this, {
history: {
init: M.init.bind(this),
setHistory: M.setHistory.bind(this),
setHistoryPopState: M.setHistoryPopState.bind(this),
scrollToSlide: M.scrollToSlide.bind(this),
destroy: M.destroy.bind(this)
}
})
},
on: {
init: function () {
this.params.history.enabled && this.history.init()
},
destroy: function () {
this.params.history.enabled && this.history.destroy()
},
transitionEnd: function () {
this.history.initialized && this.history.setHistory(this.params.history.key, this.activeIndex)
},
slideChange: function () {
this.history.initialized && this.params.cssMode && this.history.setHistory(this.params.history.key, this.activeIndex)
}
}
},
{
name: "hash-navigation",
params: {
hashNavigation: {
enabled: !1,
replaceState: !1,
watchState: !1
}
},
create: function () {
U.extend(this, {
hashNavigation: {
initialized: !1,
init: P.init.bind(this),
destroy: P.destroy.bind(this),
setHash: P.setHash.bind(this),
onHashCange: P.onHashCange.bind(this)
}
})
},
on: {
init: function () {
this.params.hashNavigation.enabled && this.hashNavigation.init()
},
destroy: function () {
this.params.hashNavigation.enabled && this.hashNavigation.destroy()
},
transitionEnd: function () {
this.hashNavigation.initialized && this.hashNavigation.setHash()
},
slideChange: function () {
this.hashNavigation.initialized && this.params.cssMode && this.hashNavigation.setHash()
}
}
},
{
name: "autoplay",
params: {
autoplay: {
enabled: !1,
delay: 3e3,
waitForTransition: !0,
disableOnInteraction: !0,
stopOnLastSlide: !1,
reverseDirection: !1
}
},
create: function () {
var t = this;
U.extend(t, {
autoplay: {
running: !1,
paused: !1,
run: z.run.bind(t),
start: z.start.bind(t),
stop: z.stop.bind(t),
pause: z.pause.bind(t),
onVisibilityChange: function () {
"hidden" === document.visibilityState && t.autoplay.running && t.autoplay.pause(),
"visible" === document.visibilityState && t.autoplay.paused && (t.autoplay.run(), t.autoplay.paused = !1)
},
onTransitionEnd: function (e) {
t && !t.destroyed && t.$wrapperEl && e.target === this && (t.$wrapperEl[0].removeEventListener("transitionend", t.autoplay.onTransitionEnd), t.$wrapperEl[0].removeEventListener("webkitTransitionEnd", t.autoplay.onTransitionEnd), t.autoplay.paused = !1, t.autoplay.running ? t.autoplay.run() : t.autoplay.stop())
}
}
})
},
on: {
init: function () {
this.params.autoplay.enabled && (this.autoplay.start(), document.addEventListener("visibilitychange", this.autoplay.onVisibilityChange))
},
beforeTransitionStart: function (e, t) {
this.autoplay.running && (t || !this.params.autoplay.disableOnInteraction ? this.autoplay.pause(e) : this.autoplay.stop())
},
sliderFirstMove: function () {
this.autoplay.running && (this.params.autoplay.disableOnInteraction ? this.autoplay.stop() : this.autoplay.pause())
},
touchEnd: function () {
this.params.cssMode && this.autoplay.paused && !this.params.autoplay.disableOnInteraction && this.autoplay.run()
},
destroy: function () {
this.autoplay.running && this.autoplay.stop(),
document.removeEventListener("visibilitychange", this.autoplay.onVisibilityChange)
}
}
},
{
name: "effect-fade",
params: {
fadeEffect: {
crossFade: !1
}
},
create: function () {
U.extend(this, {
fadeEffect: {
setTranslate: te.setTranslate.bind(this),
setTransition: te.setTransition.bind(this)
}
})
},
on: {
beforeInit: function () {
var e;
"fade" === this.params.effect && (this.classNames.push(this.params.containerModifierClass + "fade"), U.extend(this.params, e = {
slidesPerView: 1,
slidesPerColumn: 1,
slidesPerGroup: 1,
watchSlidesProgress: !0,
spaceBetween: 0,
virtualTranslate: !0
}), U.extend(this.originalParams, e))
},
setTranslate: function () {
"fade" === this.params.effect && this.fadeEffect.setTranslate()
},
setTransition: function (e) {
"fade" === this.params.effect && this.fadeEffect.setTransition(e)
}
}
},
{
name: "effect-cube",
params: {
cubeEffect: {
slideShadows: !0,
shadow: !0,
shadowOffset: 20,
shadowScale: .94
}
},
create: function () {
U.extend(this, {
cubeEffect: {
setTranslate: ie.setTranslate.bind(this),
setTransition: ie.setTransition.bind(this)
}
})
},
on: {
beforeInit: function () {
var e;
"cube" === this.params.effect && (this.classNames.push(this.params.containerModifierClass + "cube"), this.classNames.push(this.params.containerModifierClass + "3d"), U.extend(this.params, e = {
slidesPerView: 1,
slidesPerColumn: 1,
slidesPerGroup: 1,
watchSlidesProgress: !0,
resistanceRatio: 0,
spaceBetween: 0,
centeredSlides: !1,
virtualTranslate: !0
}), U.extend(this.originalParams, e))
},
setTranslate: function () {
"cube" === this.params.effect && this.cubeEffect.setTranslate()
},
setTransition: function (e) {
"cube" === this.params.effect && this.cubeEffect.setTransition(e)
}
}
},
{
name: "effect-flip",
params: {
flipEffect: {
slideShadows: !0,
limitRotation: !0
}
},
create: function () {
U.extend(this, {
flipEffect: {
setTranslate: se.setTranslate.bind(this),
setTransition: se.setTransition.bind(this)
}
})
},
on: {
beforeInit: function () {
var e;
"flip" === this.params.effect && (this.classNames.push(this.params.containerModifierClass + "flip"), this.classNames.push(this.params.containerModifierClass + "3d"), U.extend(this.params, e = {
slidesPerView: 1,
slidesPerColumn: 1,
slidesPerGroup: 1,
watchSlidesProgress: !0,
spaceBetween: 0,
virtualTranslate: !0
}), U.extend(this.originalParams, e))
},
setTranslate: function () {
"flip" === this.params.effect && this.flipEffect.setTranslate()
},
setTransition: function (e) {
"flip" === this.params.effect && this.flipEffect.setTransition(e)
}
}
},
{
name: "effect-coverflow",
params: {
coverflowEffect: {
rotate: 50,
stretch: 0,
depth: 100,
modifier: 1,
slideShadows: !0
}
},
create: function () {
U.extend(this, {
coverflowEffect: {
setTranslate: ae.setTranslate.bind(this),
setTransition: ae.setTransition.bind(this)
}
})
},
on: {
beforeInit: function () {
"coverflow" === this.params.effect && (this.classNames.push(this.params.containerModifierClass + "coverflow"), this.classNames.push(this.params.containerModifierClass + "3d"), this.params.watchSlidesProgress = !0, this.originalParams.watchSlidesProgress = !0)
},
setTranslate: function () {
"coverflow" === this.params.effect && this.coverflowEffect.setTranslate()
},
setTransition: function (e) {
"coverflow" === this.params.effect && this.coverflowEffect.setTransition(e)
}
}
},
{
name: "thumbs",
params: {
thumbs: {
multipleActiveThumbs: !0,
swiper: null,
slideThumbActiveClass: "swiper-slide-thumb-active",
thumbsContainerClass: "swiper-container-thumbs"
}
},
create: function () {
U.extend(this, {
thumbs: {
swiper: null,
init: ne.init.bind(this),
update: ne.update.bind(this),
onThumbClick: ne.onThumbClick.bind(this)
}
})
},
on: {
beforeInit: function () {
var e = this.params.thumbs;
e && e.swiper && (this.thumbs.init(), this.thumbs.update(!0))
},
slideChange: function () {
this.thumbs.swiper && this.thumbs.update()
},
update: function () {
this.thumbs.swiper && this.thumbs.update()
},
resize: function () {
this.thumbs.swiper && this.thumbs.update()
},
observerUpdate: function () {
this.thumbs.swiper && this.thumbs.update()
},
setTransition: function (e) {
var t = this.thumbs.swiper;
t && t.setTransition(e)
},
beforeDestroy: function () {
var e = this.thumbs.swiper;
e && this.thumbs.swiperCreated && e && e.destroy()
}
}
}];
return void 0 === p.use && (p.use = p.Class.use, p.installModule = p.Class.installModule),
p.use(O),
p
}),
function () {
window.watch5pro = window.watch5pro || {},
window.watch5pro.common = window.watch5pro.common || {};
var e, o, t, i, s, a, n, r, l, c, d, h = {
convertArray: function (e) {
return Array.prototype.slice.call(e)
},
setCookie: function (e, t, i) {
var s = new Date;
s.setTime(s.getTime() + 60 * i * 60 * 24 * 1e3),
document.cookie = e + "=" + t + "; exprires=" + s.toUTCString() + "; path=/"
},
triggerEvent: function (e, t, i, s, a) {
var n, i = i || null,
s = s || !1,
a = a || !0;
null == i ? (n = document.createEvent("HTMLEvents")).initEvent(t, s, a) : (n = document.createEvent("CustomEvent")).initCustomEvent(t, s, a, i),
e.dispatchEvent(n)
},
visibleScroll: function () {
document.documentElement.classList.contains("isTouchDevice") || !0 === this.scrollFlag && (this.scrollFlag = !1, document.body.style.position = "", document.body.style.width = "", document.body.style.top = "", document.body.style.boxSizing = "", document.body.style.paddingRight = "", document.documentElement.style.overflow = "", null !== this.popupEl && (this.popupEl.style.paddingRight = "", this.popupEl = null), window.scrollTo(0, this.currentPos))
},
hiddenScroll: function (e) {
var t;
document.documentElement.classList.contains("isTouchDevice") || (this.popupEl = e || null, this.scrollFlag = !0, this.currentPos = window.pageYOffset || document.documentElement.scrollTop, e = window.innerWidth - document.documentElement.clientWidth, t = 0 < this.currentPos ? "-" + this.currentPos + "px" : 0, document.body.style.position = "fixed", document.body.style.width = "100%", document.body.style.top = t, document.body.style.boxSizing = "border-box", document.body.style.paddingRight = e + "px", document.documentElement.style.overflow = "hidden", null !== this.popupEl && (this.popupEl.style.paddingRight = e + "px"))
},
closest: function (e, t) {
do {
if (e == document.documentElement) return null;
if (e.matches ? e.matches(t) : e.msMatchesSelector(t)) return e
} while (null !== (e = e.parentElement || e.parentNode) || 1 === e.nodeType);
return null
},
onAccessibility: function (e) {
e.setAttribute("aria-hidden", !0),
e.setAttribute("tabindex", -1);
for (var t = e.querySelectorAll("a, button, input, select"), i = 0; i < t.length; i++) {
var s = t[i].getAttribute("data-prev-aria-hidden"),
a = t[i].getAttribute("data-prev-tabindex");
null != s ? t[i].setAttribute("aria-hidden", s) : t[i].setAttribute("aria-hidden", !0),
null != a ? t[i].setAttribute("tabindex", a) : t[i].setAttribute("tabindex", -1),
t[i].removeAttribute("data-prev-aria-hidden"),
t[i].removeAttribute("data-prev-tabindex")
}
},
offAccessibility: function (e) {
e.removeAttribute("aria-hidden"),
e.removeAttribute("tabindex");
for (var t = e.querySelectorAll("a, button, input, select"), i = 0; i < t.length; i++) {
var s = t[i].getAttribute("aria-hidden"),
a = t[i].getAttribute("tabindex");
null != s && t[i].setAttribute("data-prev-aria-hidden", s),
null != a && t[i].setAttribute("data-prev-tabindex", a),
t[i].removeAttribute("aria-hidden"),
t[i].removeAttribute("tabindex")
}
},
extend: function (t, i) {
return Object.keys(i).forEach(function (e) {
t[e] = i[e]
}),
t
},
getHeight: function (e) {
var t, i, s;
return e ? (t = (i = window.getComputedStyle(e)).display, i = parseInt(i.maxHeight), s = 0, "none" != t && 0 != i ? e.offsetHeight : (e.style.position = "absolute", e.style.visibility = "hidden", e.style.display = "block", s = e.offsetHeight, e.style.display = "", e.style.position = "", e.style.visibility = "", s)) : 0
},
setLastActiveItem: function (e) {
this.lastActiveItem = e || null
},
getLastActiveItem: function () {
return null != this.lastActiveItem ? this.lastActiveItem : null
},
isRTL: function () {
return document.documentElement.classList.contains("rtl")
},
checkRegion: function () {
for (var e = document.getElementsByTagName("meta"), t = "", i = 0; i < e.length; i++) if ("sitecode" == e[i].getAttribute("name")) return t = e[i].getAttribute("content");
if ("" == t) return - 1 < document.location.pathname.indexOf("global") ? "global" : "jp"
},
isLowNetwork: function () {
// var e = "global" == h.checkRegion() || "jp" == h.checkRegion() ? "___GALAXY_SPEED" : "__COM_SPEED";
// return null == h.getCookie(e) || null == h.getCookie(e) ? null : "L" == h.getCookie(e) || "H" != h.getCookie(e) && void 0
},
getNavHeight: function () {
// var e, t, i = 0,
// s = document.querySelector(".pd-g-header-navigation") || document.querySelector(".sticky-menu") || document.querySelector(".pd-g-floating-nav");
// return i = s ? s.classList.contains("pd-g-header-navigation") ? (t = (e = s.querySelector(".pd-header-navigation")).querySelector(".pd-header-navigation__menu-wrap"), e.clientHeight + t.clientHeight) : s.clientHeight : i
},
customParallax: function (e) {
var t = e.mode || "center",
i = e.delay || 0,
s = e.ease || "Power0.easeNone",
a = e.transZ || 0,
n = e.duration || .3,
o = e.distance || 0,
r = e.correction || 0,
l = e.windowCorrection ? window.innerHeight * e.windowCorrection : 0,
c = e.direction || 1,
d = e.activeElement,
h = e.targetElement || d,
u = e.wrapperElement || d,
e = e.unit || "px",
p = window.pageYOffset,
m = window.pageYOffset + window.innerHeight,
d = d.getBoundingClientRect(),
f = p + u.getBoundingClientRect().top,
u = f + u.getBoundingClientRect().height,
v = window.innerHeight + d.height + 2 * l,
g = "center" == t ? d.top - (window.innerHeight - d.height) / 2 : d.top - window.innerHeight;
"px" == e && (o = d.height * o / 100),
f <= m + l && p - l <= u && TweenMax.to(h, n, {
y: r + g * ("center" == t ? 2 * o : o) / v * c + e,
z: a,
ease: s,
delay: i
})
},
},
u = (t = !(o = {}), i = null, s = function () {
a(),
n(),
h.isLowNetwork() && document.documentElement.classList.add("low_network"),
window.removeEventListener("load", s)
},
a = function () {
},
n = function () {
for (var e = window.pageYOffset,
t = e + window.innerHeight,
i = 0; i < o.allClickables.length; i++) {
var s = o.allClickables[i],
a = e + s.getBoundingClientRect().top,
n = e + h.getNavHeight();
n <= a && a <= t ? s.isVisible = !0 : (a < n || t < a) && (s.isVisible = !1)
}
},
r = function (e) {
},
l = function (e) {
},
c = function (e) {
var e = e.parentNode,
t = e.getAttribute("id");
return "contents" != t && e != document.body && (!("subnav" != t && !e.classList.contains("sc-s22ultra-popup")) || c(e))
},
d = function () {
this.isClicked = !0
},
{
init: function () {
o.resizeTimeout = null,
o.supClicker = document.querySelectorAll("a.click_sup"),
o.contents = document.getElementById("contents") || document.getElementById("content"),
o.allClickables = o.contents.querySelectorAll("a, button, input, select");
var e = 0;
for (window.addEventListener("load", s), window.addEventListener("resize", a), window.addEventListener("scroll", n), e = 0; e < o.allClickables.length; e++) {
var t = o.allClickables[e];
t.isClicked = !1,
t.isVisible = !1,
t.addEventListener("focusin", l),
t.addEventListener("mousedown", d)
}
for (e = 0; e < o.supClicker.length; e++) o.supClicker[e].addEventListener("click", r);
var i = document.documentElement.classList;
// ANIUTIL && ANIUTIL.imageLoader({
// lazyClass: ".js-img-src",
// responsiveClass: ".js-res-img",
// loadOption: [{
// resolution: 1920,
// attribute: "data-src-pc"
// },
// {
// resolution: 1080,
// attribute: "data-src-tablet"
// },
// {
// resolution: 767,
// attribute: "data-src-mobile"
// },
// {
// resolution: 360,
// attribute: "data-src-mobile-min"
// }],
// visiblePoint: 1
// })
}
});
window.watch5pro.common.utils = h
// u.init()
}(),
function () {
var o, r, e, t, i, s, a, n, l, c, d;
window.watch5pro = window.watch5pro || {},
window.watch5pro.ecosystem = window.watch5pro.ecosystem || {},
watch5pro.ecosystem = (o = {},
r = window.watch5pro.common.utils, e = !1, t = null, i = function () {
o.ecoPopups.forEach(function (e, t) {
t = o.ecoItemButtons[t];
e.classList.contains("is-active") && e.classList.remove("is-active"),
r.onAccessibility(e),
r.offAccessibility(t)
}),
s(),
window.removeEventListener("load", i)
},
s = function () {
e = 1024 <= window.innerWidth ? "desktop" : 768 <= window.innerWidth && window.innerWidth < 1024 ? "tablet" : "mobile",
clearTimeout(o.resizeTimeout),
o.resizeTimeout = setTimeout(function () { },
100),
e != t && (a(), t = e)
},
a = function () { },
n = function () {
r.customParallax({
wrapperElement: o.section,
activeElement: o.ecoItem01,
distance: 10,
direction: -1
}),
r.customParallax({
wrapperElement: o.section,
activeElement: o.ecoItem02,
distance: 5
}),
r.customParallax({
wrapperElement: o.section,
activeElement: o.ecoItem03,
distance: 5,
direction: -2
}),
r.customParallax({
wrapperElement: o.section,
activeElement: o.ecoItem04,
distance: 10,
direction: -1
})
r.customParallax({
wrapperElement: o.section,
activeElement: o.ecoItem05,
distance: 20,
direction: 2
})
},
l = function (e) {
e.preventDefault();
var a = o.ecoItemButtons.indexOf(this),
n = [];
o.ecoPopups.forEach(function (e, t) {
var i = o.ecoItemButtons[t],
s = e.querySelector(".sc-wearable-ecosystem__popup-close");
a == t ? (e.classList.contains("is-active") || e.classList.add("is-active"), r.offAccessibility(e), r.onAccessibility(i), document.removeEventListener("click", d), setTimeout(function () {
s.focus(),
document.addEventListener("click", d)
},
400), r.convertArray(e.querySelectorAll("img")).forEach(function (e) {
e.classList.contains("load-complate") || n.push(e)
})) : (e.classList.contains("is-active") && e.classList.remove("is-active"), r.onAccessibility(e), r.offAccessibility(i))
}),
0 < n.length && imageLoader.setResponsiveImage(n)
},
c = function () {
o.ecoPopups.forEach(function (e, t) {
t = o.ecoItemButtons[t];
e.classList.contains("is-active") && e.classList.remove("is-active"),
r.onAccessibility(e),
r.offAccessibility(t)
});
var e = r.closest(this, ".sc-wearable-ecosystem__item").querySelector(".sc-wearable-ecosystem__item-cta-link");
setTimeout(function () {
e.focus(),
document.removeEventListener("click", d)
},
400)
},
d = function (e) {
null == r.closest(e.target, ".sc-wearable-ecosystem__popup") && (o.ecoPopups.forEach(function (e, t) {
t = o.ecoItemButtons[t];
e.classList.contains("is-active") && e.classList.remove("is-active"),
r.onAccessibility(e),
r.offAccessibility(t)
}), document.removeEventListener("click", d))
},
{
init: function () {
o.section = document.querySelector(".sc-wearable-ecosystem"),
o.section && (o.ecoContents = o.section.querySelector(".sc-wearable-ecosystem__contents"), o.ecoItems = r.convertArray(o.ecoContents.querySelectorAll(".sc-wearable-ecosystem__item")), o.ecoItemButtons = r.convertArray(o.ecoContents.querySelectorAll(".sc-wearable-ecosystem__item-cta-link")), o.ecoPopups = r.convertArray(o.ecoContents.querySelectorAll(".sc-wearable-ecosystem__popup")), o.ecoPopupCloseButtons = r.convertArray(o.ecoContents.querySelectorAll(".sc-wearable-ecosystem__popup-close")), o.ecoItem01 = o.ecoContents.querySelector(".sc-wearable-ecosystem__item--01 .sc-wearable-ecosystem__item-inner"), o.ecoItem02 = o.ecoContents.querySelector(".sc-wearable-ecosystem__item--02 .sc-wearable-ecosystem__item-inner"), o.ecoItem03 = o.ecoContents.querySelector(".sc-wearable-ecosystem__item--03 .sc-wearable-ecosystem__item-inner"), o.ecoItem04 = o.ecoContents.querySelector(".sc-wearable-ecosystem__item--04 .sc-wearable-ecosystem__item-inner"),o.ecoItem05 = o.ecoContents.querySelector(".sc-wearable-ecosystem__item--05 .sc-wearable-ecosystem__item-inner"), window.addEventListener("load", i), window.addEventListener("resize", s), window.addEventListener("scroll", n), o.ecoItemButtons.forEach(function (e) {
e.addEventListener("click", l)
}), o.ecoPopupCloseButtons.forEach(function (e) {
e.addEventListener("click", c)
}))
}
})
}(),
function () {
var t, e, i, s, a, n, o;
window.watch5pro = window.watch5pro || {},
window.watch5pro.fitness = window.watch5pro.fitness || {},
watch5pro.fitness = (t = {},
window.watch5pro.common.utils, e = !1, i = null, s = function () {
a(),
window.removeEventListener("load", s)
},
a = function () {
e = 1024 <= window.innerWidth ? "desktop" : 768 <= window.innerWidth && window.innerWidth < 1024 ? "tablet" : "mobile",
clearTimeout(t.resizeTimeout),
t.resizeTimeout = setTimeout(function () { },
100),
e != i && (n(), i = e)
},
n = function () {
null != t.scroller && (t.scroller.destroy(!0), t.scroller = null);
null == t.scroller && (t.scroller = SCROLLER({
trackElement: t.imageWrap,
useFixed: !1
}))
},
o = function () {
null != t.scroller && t.scroller.trackAnimation(function () {
var e = ANIUTIL.calRange({
targetValue: 20,
progress: this.progress,
startPoint: 0,
endPoint: 100
});
TweenMax.to(t.imageInner, .3, {
y: 10 - e + "%"
})
})
},
{
init: function () {
t.section = document.querySelector(".sc-watch-fitness"),
t.section && (t.scroller = null, t.imageWrap = t.section.querySelector(".sc-watch-fitness__image-wrap"), t.imageInner = t.imageWrap.querySelector(".sc-watch-fitness__image-item02 .sc-watch-fitness__image-inner"), window.addEventListener("load", s), window.addEventListener("resize", a), window.addEventListener("scroll", o))
}
})
}(),
function () {
var t, e, i, s, a, n, o;
window.watch5pro = window.watch5pro || {},
window.watch5pro.monitoring = window.watch5pro.monitoring || {},
watch5pro.monitoring = (t = {},
window.watch5pro.common.utils, e = !1, i = null, s = function () {
a(),
o(),
window.removeEventListener("load", s)
},
a = function () {
e = 1024 <= window.innerWidth ? "desktop" : 768 <= window.innerWidth && window.innerWidth < 1024 ? "tablet" : "mobile",
clearTimeout(t.resizeTimeout),
t.resizeTimeout = setTimeout(function () {
o()
},
100),
e != i && (n(), i = e)
},
n = function () {
null != t.scroller && (t.scroller.destroy(!0), t.scroller = null);
null == t.scroller && (t.scroller = SCROLLER({
trackElement: t.bottomContent,
useFixed: !1
}))
},
o = function () {
null != t.scroller && t.scroller.trackAnimation(function () {
var e = ANIUTIL.calRange({
targetValue: 20,
progress: this.progress,
startPoint: 0,
endPoint: 100
});
TweenMax.to(t.monitoringImage, .3, {
y: 10 - e + "%"
})
})
},
{
init: function () {
t.section = document.querySelector(".sc-watch-monitoring"),
t.section && (t.scroller = null, t.bottomContent = t.section.querySelector(".sc-watch-monitoring__content-bottom"), t.monitoringImage = t.bottomContent.querySelector(".sc-watch-monitoring__visual-image"), window.addEventListener("load", s), window.addEventListener("resize", a), window.addEventListener("scroll", o))
}
})
}(),
window.addEventListener("load",
function () {
setTimeout(function () {
window.GALAXY && window.GALAXY.isGalaxy && watch5pro.subnav.init()
},
5)
}),
watch5pro.ecosystem.init()
watch5pro.monitoring.init()
watch5pro.fitness.init();
// watch5pro.contrast.init();
});
到货提醒
商品到货后将以短信的形式通知到您输入的手机号码上,请留意短信通知
请输入有效的手机号码
产品到货时我们会发邮件给您
谢谢您
产品登记
Quick and easy product registration.. Receive up-to-date personalized services and tips.
Serial Number / IMEI
Enter your Serial Number/IMEI
QR Scan
Scan the QR code on your products for easy registration.
* This feature can only be supported on Samsung Home Appliances and non-smart B2C monitors.
Enter your Serial Number/IMEI
Quick and easy product registration.
Please enter the 11 or 15- digit number.
This product is already registered. Make sure you entered the right serial number or IMEI.
类型
Sub Type
Category
Back view
The serial number and model name are printed on the label located on the lower left side of the device’s exterior, near the front. They are also on a second label, inside the refrigerator compartment on a side wall above the top shelf.
Back view
The serial number and model name are printed on the label located on the lower left side of the device’s exterior, near the front. They are also on a second label, inside the refrigerator compartment on a side wall above the top shelf.
Product registration is almost complete!!
You've entered a valid S/N or IMEI. Now select the model of your product.
建议搜索
No result. Please try again.
Galaxy Book3 Ultra
SM-G996BZKGEUA
Serial Number: R3CR508WNAH
The device you are currently using does not support the camera function.