\n
\n '
)
.concat(
(function (e) {
var t = i.map(function (
t
) {
return '\n - \n '
)
.concat(
t.blind,
'\n '
)
.concat(
null !==
(t =
e[t.title]) &&
void 0 !== t
? t
: "",
"\n
\n "
);
});
return "".concat.apply(
"",
M(t)
);
})(r),
'\n
\n
\n "
)),
e.appendChild(n);
}
this.compareProductList.appendChild(
e
);
},
},
{
key: "itemHeight",
value: function () {
var t =
0 < arguments.length &&
void 0 !== arguments[0]
? arguments[0]
: "init",
e =
this.compareWrap.getElementsByClassName(
"vd-compare-category-item"
),
i =
this.compareProductList.getElementsByClassName(
"compare-product-item"
),
n =
this.compareProductList.getElementsByClassName(
"compare-spec-item"
),
r =
this.compareWrap.querySelectorAll(
".vd-compare-category-list li"
).length,
s = [],
a = [],
o = [];
"resize" === t &&
(M(e).forEach(function (t) {
return (t.style.height = "");
}),
M(n).forEach(function (t) {
return (t.style.height = "");
})),
M(e).forEach(function (t) {
s.push(t.offsetHeight);
}),
M(i).forEach(function (t, e) {
void 0 === a[e] && (a[e] = []),
M(
t.getElementsByClassName(
"compare-spec-item"
)
).forEach(function (t) {
a[e].push(t.offsetHeight);
});
}),
a.push(s),
a.forEach(function (t, e) {
t.forEach(function (t, e) {
(void 0 === o[e] ||
o[e] <= t) &&
(o[e] = t);
});
}),
M(e).forEach(function (t, e) {
t.style.height = "".concat(
o[e],
"px"
);
}),
M(n).forEach(function (t, e) {
t.style.height = "".concat(
o[e % r],
"px"
);
});
},
},
{
key: "tooltipAllClose",
value: function (t) {
var e = this;
M(t).forEach(function (t) {
e.tooltipClose(t);
});
},
},
{
key: "tooltipClose",
value: function (t) {
t.classList.remove("tooltip-click"),
t.nextElementSibling.setAttribute(
"aria-hidden",
!0
),
(t.nextElementSibling.hidden =
!0);
},
},
{
key: "tooltipAction",
value: function (t) {
var e =
this.compareWrap.getElementsByClassName(
"vd-compare-tooltip-btn"
);
-1 ===
t.className.indexOf("tooltip-click")
? (this.tooltipAllClose(e),
t.classList.add(
"tooltip-click"
),
t.nextElementSibling.setAttribute(
"aria-hidden",
!1
),
(t.nextElementSibling.hidden =
!1))
: this.tooltipClose(t);
},
},
{
key: "tooltip",
value: function () {
var i = this,
t =
i.compareWrap.getElementsByClassName(
"vd-compare-tooltip-btn"
),
e =
i.compareWrap.getElementsByClassName(
"vd-compare-tooltip-close"
),
n = [
"vd-compare-tooltip-layer",
"vd-compare-tooltip-close",
"vd-compare-tooltip-btn",
"vd-compare-tooltip-btn tooltip-click",
"icon-help",
];
M(t).forEach(function (n) {
n.addEventListener(
"click",
function (t) {
t.preventDefault(),
i.tooltipAction(n);
}
),
n.addEventListener(
"keyup",
function (t) {
var e = window.innerHeight,
i =
window.pageYOffset +
n.getBoundingClientRect()
.top;
window.scrollTo(
0,
i - e / 2
);
}
),
n.addEventListener(
"keydown",
function (t) {
"enter" ===
t.key.toLowerCase() &&
(t.preventDefault(),
i.tooltipAction(n));
}
);
}),
document.addEventListener(
"click",
function (e) {
void 0 ===
n.find(function (t) {
return t.includes(
e.target.className
);
}) && i.tooltipAllClose(t);
}
),
M(e).forEach(function (i) {
i.addEventListener(
"click",
function (t) {
var e = i
.closest(
".vd-compare-category-tooltip"
)
.getElementsByClassName(
"vd-compare-tooltip-btn"
)[0];
i.focus(),
setTimeout(function () {
e.focus();
}, 100),
setTimeout(function () {
e.classList.remove(
"tooltip-click"
),
t.target.parentNode.setAttribute(
"aria-hidden",
!0
),
(t.target.parentNode.hidden =
!0);
}, 300);
}
),
i.addEventListener(
"keydown",
function (t) {
var e =
t.key.toLowerCase();
(t.shiftKey &&
"tab" === e) ||
("tab" === e &&
(t.target.parentNode.previousElementSibling.classList.remove(
"tooltip-click"
),
t.target.parentNode.setAttribute(
"aria-hidden",
!0
),
(t.target.parentNode.hidden =
!0)));
}
);
});
},
},
{
key: "taggingButton",
value: function (t, e) {
this.compareWrap
.getElementsByClassName(
"btn-compare-select"
)
[e].setAttribute(
"an-la",
"product compare landing:".concat(
t.toLowerCase()
)
);
},
},
{
key: "accessibilityContent",
value: function () {
this.compareProductList.getElementsByClassName(
"compare-product-item"
);
},
},
{
key: "accessibilityKey",
value: function () {
var t = this;
t.compareWrap.getElementsByClassName(
"vd-compare-tooltip-btn"
),
t.compareWrap.getElementsByClassName(
"compare-product-link"
),
t.compareWrap.getElementsByClassName(
"vd-compare-btn"
),
t.compareWrap.getElementsByClassName(
"vd-compare-button-prev"
)[0],
t.compareWrap.getElementsByClassName(
"vd-compare-button-next"
)[0];
M(
t.compareWrap.getElementsByClassName(
"select-list-option"
)
).forEach(function (t) {
t.getElementsByTagName(
"button"
)[0].addEventListener(
"keydown",
function (t) {
var e,
i = t.key.toLowerCase(),
n = t.target.parentElement;
"arrowdown" === i
? (t.preventDefault(),
null !==
(e =
n.nextElementSibling) &&
e
.getElementsByTagName(
"button"
)[0]
.focus())
: "arrowup" === i &&
(t.preventDefault(),
null !==
(n =
n.previousElementSibling) &&
n
.getElementsByTagName(
"button"
)[0]
.focus());
}
);
});
},
},
{
key: "accessibilityResize",
value: function () {
M(this.compareSelectItem).forEach(
function (t, e) {
2 === a
? t
.getElementsByClassName(
"btn-compare-select"
)[0]
.removeAttribute(
"aria-hidden"
)
: t
.getElementsByClassName(
"btn-compare-select"
)[0]
.setAttribute(
"aria-hidden",
!0
),
2 === a
? t
.getElementsByClassName(
"btn-compare-select"
)[0]
.removeAttribute(
"tabindex"
)
: t
.getElementsByClassName(
"btn-compare-select"
)[0]
.setAttribute(
"tabindex",
-1
),
1 === a &&
t.classList.remove("open");
}
),
M(
this.compareWrap.getElementsByClassName(
"compare-select-list"
)
).forEach(function (t) {
return t.setAttribute(
"aria-hidden",
!0
);
}),
M(
this.selectBoxHiddenList
).forEach(function (t) {
2 === a
? t.setAttribute(
"aria-hidden",
!0
)
: t.setAttribute(
"aria-hidden",
!1
),
2 === a
? t.setAttribute(
"tabindex",
-1
)
: t.removeAttribute(
"tabindex"
);
});
},
},
{
key: "resizeCompare",
value: function () {
this.accessibilityResize();
},
},
]),
t
);
})(),
b = new d(),
w = new p(),
T = new _(),
x = new m(),
k = new y();
window.addEventListener("scroll", function () {
(c = window.scrollY),
(function () {
l.curr = window.scrollY;
var t = l.curr < l.accu ? "up" : "down";
l.accu = l.curr;
})(),
u ||
window.requestAnimationFrame(function () {
b.motion(), x.scrollMotion(), (u = !1);
}),
(u = !0);
}),
i.add(function () {
(a = 768 < window.innerWidth ? 2 : 1) !==
o &&
((o = a),
w.imgResize(),
T.setting(),
k.resizeCompare()),
T.sectionPlay(),
k.itemHeight("resize");
}),
window.addEventListener(
"DOMContentLoaded",
function () {
b.motion(),
w.lazy(),
w.imgResize(),
T.setting(),
T.sectionPlay(),
new g(),
new v();
}
);
})();
},
{},
],
},
{},
[1]
);
!(function i(o, a, r) {
function g(t, e) {
if (!a[t]) {
if (!o[t]) {
var n = "function" == typeof require && require;
if (!e && n) return n(t, !0);
if (s) return s(t, !0);
throw (
(((n = new Error(
"Cannot find module '" + t + "'"
)).code = "MODULE_NOT_FOUND"),
n)
);
}
(n = a[t] = { exports: {} }),
o[t][0].call(
n.exports,
function (e) {
return g(o[t][1][e] || e);
},
n,
n.exports,
i,
o,
a,
r
);
}
return a[t].exports;
}
for (
var s = "function" == typeof require && require,
e = 0;
e < r.length;
e++
)
g(r[e]);
return g;
})(
{
1: [
function (e, t, n) {
"use strict";
function i() {
(g.resizeTimeout = null),
(g.gamingBarWrap = g.section.querySelector(
".vd-highlights-gaming__bar"
)),
(g.gamingBar =
g.gamingBarWrap.querySelector(".bar")),
(g.gamingImage = g.section.querySelector(
".vd-highlights-gaming__image"
)),
(g.gamingCoverImage = g.section.querySelector(
".vd-highlights-gaming__cover"
)),
(g.isGrab = !1),
(g.isAction = !1),
(g.gamingCoverLeftWrap =
g.section.querySelector(
".vd-highlights-gaming__tap-left"
)),
(g.gamingCoverLeftBtn =
g.section.querySelector(
".vd-highlights-gaming__tap-left button"
)),
(g.gamingCoverRightBtn =
g.section.querySelector(
".vd-highlights-gaming__tap-right button"
)),
(g.controller = g.section.querySelector(
"button.vd-highlights-gaming__bar-controller"
));
}
function o() {
window.addEventListener("DOMContentLoaded", h, {
once: !0,
}),
window.addEventListener("scroll", w),
window.addEventListener("resize", m),
g.section.addEventListener(
"keydown",
v.onMoveEvent
),
g.section.addEventListener(
"click",
v.onMoveEvent
),
g.section.addEventListener(
"mousedown",
v.onStart
),
g.section.addEventListener(
"mousemove",
v.onMove
),
g.section.addEventListener(
"mouseup",
v.onEnd
),
g.section.addEventListener(
"mouseleave",
v.onEnd
),
g.section.addEventListener(
"touchstart",
v.onStart
),
g.section.addEventListener(
"touchmove",
v.onMove
),
g.section.addEventListener(
"touchend",
v.onEnd
),
g.section.addEventListener(
"touchcancel",
v.onEnd
);
}
function a() {
for (var e = "", t = 0; t < r.length; t++)
window.innerWidth > r[0].resolution
? (e = r[0].resolutionName)
: window.innerWidth <= r[t].resolution &&
(e = r[t].resolutionName);
return e;
}
var r, g, s, c, d, l, u, h, m, w, v;
(window.flagship = window.flagship || {}),
(window.flagship.highlights =
window.flagship.highlights || {}),
(window.flagship.highlights.gaming =
((r = [
{
resolution: 1920,
resolutionName: "desktopL",
},
{
resolution: 1440,
resolutionName: "desktop",
},
{
resolution: 1023,
resolutionName: "tablet",
},
{
resolution: 767,
resolutionName: "mobile",
},
]),
(g = {}),
(s = {}),
(c = "desktop"),
(d = null),
(l = function () {
var e,
t,
n = 0,
i =
document.querySelector(
".pd-g-header-navigation"
) ||
document.querySelector("#subnav") ||
document.querySelector(
".sticky-menu"
) ||
document.querySelector(
".pd-g-floating-nav"
);
return (n = i
? i.classList.contains(
"pd-g-header-navigation"
)
? ((t = (e = i.querySelector(
".pd-header-navigation"
)).querySelector(
".pd-header-navigation__menu-wrap"
)),
e.clientHeight + t.clientHeight)
: i.clientHeight
: n);
}),
(u = function () {
var e = 97.5;
TweenMax.set(g.gamingBar, {
left: "".concat(1.8, "%"),
ease: Power2.easeOut,
}),
TweenMax.set(g.gamingCoverImage, {
width: "".concat(1.8, "%"),
ease: Power2.easeOut,
}),
(s.barAnim = new TimelineLite()),
s.barAnim
.to(g.gamingBar, 1, {
left: "".concat(e, "%"),
ease: Power2.easeOut,
})
.to(g.gamingBar, 1, {
left: "50%",
ease: Power2.easeOut,
}),
(s.imgAnim = new TimelineLite()),
s.imgAnim
.to(g.gamingCoverImage, 1, {
width: "".concat(e, "%"),
ease: Power2.easeOut,
})
.to(g.gamingCoverImage, 1, {
width: "50%",
ease: Power2.easeOut,
}),
TweenMax.set(g.gamingCoverLeftWrap, {
width: "".concat(1.8, "%"),
ease: Power2.easeOut,
}),
(s.imgAnim = new TimelineLite()),
s.imgAnim
.to(g.gamingCoverLeftWrap, 1, {
width: "".concat(e, "%"),
ease: Power2.easeOut,
})
.to(g.gamingCoverLeftWrap, 1, {
width: "50%",
ease: Power2.easeOut,
});
}),
(h = function () {
w();
}),
(m = function () {
(c = a()),
clearTimeout(g.resizeTimeout),
(g.resizeTimeout = setTimeout(
function () {
w();
},
150
)),
c != d && (d = c);
}),
(w = function () {
var e = window.pageYOffset + l(),
t =
window.pageYOffset + window.innerHeight,
n = g.gamingImage.getBoundingClientRect(),
i = window.pageYOffset + n.top,
n = window.pageYOffset + n.bottom;
t - 0.25 * window.innerHeight > i &&
e + 0.25 * window.innerHeight < n &&
!g.isAction &&
(u(), (g.isAction = !0));
}),
(v = {
onStart: function (e) {
e.target.matches(
".vd-highlights-gaming__bar-controller"
) && (g.isGrab = !0);
},
onEnd: function () {
g.isGrab = !1;
},
onMove: function (e) {
var t, n, i;
g.isGrab &&
(e && e.preventDefault(),
(t = +(i =
g.gamingBarWrap.getBoundingClientRect())
.width),
(n = 0 * i.width),
t <
(e =
(e.touches ? e.touches[0] : e).pageX -
i.left)
? (e = t)
: e < n && (e = n),
(i = (e / i.width) * 100),
(g.gamingBar.style.left = i + "%"),
(g.gamingCoverImage.style.width =
i + "%"),
(g.gamingCoverLeftWrap.style.width =
i + "%"));
},
onMoveEvent: function (e) {
var t =
g.gamingBarWrap.getBoundingClientRect(),
n = +t.width,
i = 0 * t.width,
o =
g.gamingBar.getBoundingClientRect()
.left - t.left,
a = Math.ceil(
n /
(-1 < c.indexOf("desktop") ? 8 : 4)
);
(e.target.classList.contains(
"vd-highlights-gaming__tap-button"
) ||
e.target.classList.contains(
"vd-highlights-gaming__bar-controller"
)) &&
("click" == e.type &&
e.target.classList.contains(
"vd-highlights-gaming__tap-button"
) &&
(e.target.parentElement.classList.contains(
"vd-highlights-gaming__tap-left"
)
? (o -= a)
: e.target.parentElement.classList.contains(
"vd-highlights-gaming__tap-right"
) && (o += a)),
!e.target.classList.contains(
"vd-highlights-gaming__bar-controller"
) ||
(39 != e.keyCode &&
37 != e.keyCode) ||
(e && e.preventDefault(),
39 == e.keyCode
? (o += a)
: 37 == e.keyCode && (o -= a)),
o < i ? (o = i) : n < o && (o = n),
(t = (o / t.width) * 100),
TweenMax.to(g.gamingBar, 0.3, {
left: t + "%",
ease: Power2.easeOut,
}),
TweenMax.to(g.gamingCoverImage, 0.3, {
width: t + "%",
ease: Power2.easeOut,
}),
TweenMax.to(
g.gamingCoverLeftWrap,
0.3,
{
width: t + "%",
ease: Power2.easeOut,
}
));
},
}),
{
init: function () {
(g.section =
document.querySelector(
".vd-highlights"
)),
g.section && (i(), o());
},
})),
window.flagship.highlights.gaming.init();
},
{},
],
},
{},
[1]
);
});