"use strict"; !
function(t, e, i, s) {
var n = "jwcarousel";
function a(i, s) {
this.element = i,
this.elementwidth = 0,
this._name = n,
this.item = null,
this.delta = 1,
this.isanimating = !1,
this.isdragging = !1,
this.timer = 0,
this._timeoutid1 = 0,
this._timeoutid2 = 0,
this.resizetimer = 0,
this._dotcontrollertimeid = 0,
this._lastviewport = 0,
this.viewport = null,
this.responsiverefreshrate = 200,
this.itemwidth = 0,
this._clones = 0,
this._items = 0,
this.windowwidth = t(e).width(),
this._itemcoordinate = [],
this.coordinate = {
x: 0,
y: 0
},
this.prevcoordinate = {
x: 0,
y: 0,
diff: 0,
dragpointer: -1
},
this._defaults = t.fn.jwcarousel.defaults,
this.options = t.extend({},
this._defaults, s),
2 !== this.options.nav_text.length && (console.warn("nav text must be need two control element!"), this.options.nav_text = ["<", ">"]),
this.options.speed > this.options.interval && (this.options.speed = this.options.interval),
this.init()
}
t.extend(a.prototype, {
init: function() {
this.buildcache(),
this.createhtmldom(),
this.applybasicstyle(),
this.bindevents(),
this.triggeronstart(),
this.options.autoplay && this.startloop()
},
animationtype: function(t) {
return void 0 !== this.options.animationtype && this.options.animationtype === t
},
triggeronstart: function() {
if (this.options.dot_indicator && this.options.dots) {
var t = this.$dotcontainer.find("li.active");
this.animatedotindicator(t, "start")
}
},
destroy: function() {
this.unbindevents(),
this.$outerstage.children(".clone").remove(),
this.$outerstage.unwrap(),
this.$outerstage.children().unwrap(),
this.$sliderlist.unwrap(),
this.options.dots && this.$dotcontainer.parent(".jwpf-carousel-extended-dots").remove(),
this.options.nav && this.$nextbtn.parent(".jwpf-carousel-extended-nav-control").remove(),
this.$element.removedata(this._name)
},
buildcache: function() {
this.$element = t(this.element)
},
unbindevents: function() {
this.$element.off("." + this._name)
},
createhtmldom: function() {
this.createouterstage(),
void 0 !== this.options.responsive && this.parseresponsiveviewport(),
this.itemprofessor(),
this.options.nav && this.createnavigationcontroller(),
this.options.dots && this.createdotscontroller(),
this.cloneitems()
},
itemprofessor: function() {
this._numberofitems = this.$element.find(".jwpf-carousel-extended-item").length;
var t = this.options.centerpadding;
null !== this.viewport && (this.options.items = void 0 === this.viewport.items ? this.options.items: this.viewport.items, t = void 0 === this.viewport.centerpadding ? this.options.centerpadding: this.viewport.centerpadding),
this.elementwidth = this.$element.outerwidth() + this.options.margin,
this.itemwidth = this.options.center ? math.abs((this.elementwidth - 2 * t) / this.options.items) : math.abs(this.elementwidth / this.options.items),
this._clones = this._numberofitems > this.options.items ? math.ceil(this._numberofitems / 2) : this.options.items,
this._maxl = this.itemwidth * (this._numberofitems + (this._clones - 1)),
this._minl = !1 === this.options.center ? this.itemwidth * this._clones: this.itemwidth * this._clones - t
},
cloneitems: function() {
for (var t = [], e = [], i = this.animationtype("fadein") ? {
opacity: 1
}: {},
s = 0; s < this._clones; s++) s < this.options.items && this.$element.find(".jwpf-carousel-extended-item:nth-child(" + (s + 1) + ")").addclass("active").css(i),
t.push(this.$element.find(".jwpf-carousel-extended-item:nth-child(" + (this._numberofitems - s) + ")").clone(!0).addclass("clone").removeclass("active")),
e.push(this.$element.find(".jwpf-carousel-extended-item:nth-child(" + (s + 1) + ")").clone(!0).addclass("clone").removeclass("active"));
this.options.center && this.applycentermode(0, this.options.items - 1),
this.appendbefore(t),
this.appendafter(e),
this.calculateitemcoordinate()
},
appendbefore: function(t) {
var e = this;
t.map(function(t) {
e.$outerstage.prepend(t)
})
},
appendafter: function(t) {
var e = this;
t.map(function(t) {
// e.$outerstage.append(t)
$(e.$outerstage).append(t)
})
},
calculateitemcoordinate: function() {
var t = this;
this.$outerstage.children().each(function(e, i) {
t._itemcoordinate.push((e + 1) * t.itemwidth)
})
},
createouterstage: function() {
this.sliderlist = i.createelement("div"),
this.sliderlist.setattribute("class", "jwpf-carousel-extended-list"),
this.outerstage = i.createelement("div"),
this.outerstage.setattribute("class", "jwpf-carousel-extended-outer-stage"),
this.outerstage.innerhtml = this.$element.html(),
!0 === this.options.center && this.$element.addclass("jwpf-carousel-extended-center"),
this.animationtype("fadein") && this.$element.addclass("jwpf-carousel-fadein"),
this.animationtype("fadeout") && this.$element.addclass("jwpf-carousel-fadeout"),
// this.sliderlist.append(this.outerstage),
$(this.sliderlist).append(this.outerstage),
this.$element.html(this.sliderlist),
this.$outerstage = t(this.outerstage),
this.$sliderlist = t(this.sliderlist)
},
createnavigationcontroller: function() {
var e = i.createelement("div");
e.setattribute("class", "jwpf-carousel-extended-nav-control"),
// this.$element.append(e),
$(this.$element).append(e),
this.nextbtn = i.createelement("span"),
this.nextbtn.setattribute("class", "next-control nav-control"),
this.prevbtn = i.createelement("span"),
this.prevbtn.setattribute("class", "prev-control nav-control"),
// e.append(this.nextbtn),
// e.append(this.prevbtn),
$(e).append(this.nextbtn),
$(e).append(this.prevbtn),
this.nextbtn.innerhtml = this.options.nav_text[1],
this.prevbtn.innerhtml = this.options.nav_text[0],
this.$nextbtn = t(this.nextbtn),
this.$prevbtn = t(this.prevbtn)
},
createdotscontroller: function() {
var e = i.createelement("div");
e.setattribute("class", "jwpf-carousel-extended-dots"),
// this.$element.append(e);
$(this.$element).append(e);
var s = i.createelement("ul"),
n = null;
void 0 !== this.options.responsive && (n = this.parseresponsiveviewport());
var a = null === n ? this.options.items: void 0 === n.items ? this.options.items: n.items,
o = math.floor(this._numberofitems / a);
if (o > 1) for (var r = 0; r < o; r++) {
var h = i.createelement("li");
if (h.setattribute("class", "jwpf-carousel-extended-dot-" + r), t(h).css({
"-webkit-transition": "all 0.5s ease 0s",
transition: "all 0.5s ease 0s"
}), 0 === r && t(h).addclass("active"), this.options.dot_indicator) {
var d = i.createelement("span");
d.setattribute("class", "jwpf-carousel-extended-dot-indicator"),
// h.append(d)
$(h).append(d)
}
// s.append(h)
$(s).append(h)
}
// e.append(s),
$(e).append(s),
// this.$element.append(e),
$(this.$element).append(e),
this.$dotcontainer = t(s)
},
applybasicstyle: function() {
var e = 0,
i = {};
if (i.width = this.itemwidth - this.options.margin + "px", this.options.margin > 0 && (i.marginright = this.options.margin + "px"), this.animationtype("fadein") && (i.transition = "opacity " + this.options.speed + "ms"), this.$element.find(".jwpf-carousel-extended-item").each(function() {
e++,
t(this).css(i)
}), this._currentposition = this._clones * this.itemwidth, !0 === this.options.center) {
var s = void 0 === this.viewport.centerpadding ? this.options.centerpadding: this.viewport.centerpadding;
this._currentposition = this._clones * this.itemwidth - s
}
this.$outerstage.css({
"-ms-transition-duration": "0s",
"-ms-transform": "translate3d(-" + this._currentposition + "px,0px,0px)",
"-webkit-transition-duration": "0s",
"-webkit-transform": "translate3d(-" + this._currentposition + "px,0px,0px)",
"transition-duration": "0s",
"transform": "translate3d(-" + this._currentposition + "px,0px,0px)",
width: e * this.itemwidth + "px"
}),
this._items = e,
this.updateresponsiveview()
},
startloop: function() {
var t = this;
this.timer = setinterval(function() { ! 1 === t.isanimating && t.next()
},
this.options.interval)
},
stoploop: function() {
clearinterval(this.timer),
this.timer = 0
},
next: function() { - 1 === this.delta && (this.delta = 1),
this.updateitemstyle()
},
prev: function() {
1 === this.delta && (this.delta = -1),
this.updateitemstyle()
},
slidefromposition: function(t, e) {
var i = this.itemwidth * (this.options.items * t),
s = 0 === t ? this._minl: this._minl + i,
n = this.animationtype("fadein") ? "0s": "all " + this.options.speed + "ms ease 0s";
this.$outerstage.css({
"-webkit-transition": n,
transition: n,
"-webkit-transform": "translate3d(-" + s + "px,0px,0px)",
transform: "translate3d(-" + s + "px,0px,0px)"
}),
this._currentposition = s,
this.delta = e,
this.processactivationworker()
},
updatedotsfromposition: function(t) {
var e = this,
i = this.$dotcontainer.find("li.active").removeclass("active"),
s = this.$dotcontainer.find("li:nth-child(" + t + ")").addclass("active");
this.options.dot_indicator && (this.animatedotindicator(i, "stop"), this._dotcontrollertimeid > 0 && (cleartimeout(this._dotcontrollertimeid), this._dotcontrollertimeid = 0), this._dotcontrollertimeid = settimeout(function() {
e.animatedotindicator(s, "start")
},
this.options.speed)),
s.css({
"-webkit-transition": "all 0.5s ease 0s",
transition: "all 0.5s ease 0s"
})
},
animatedotindicator: function(t, e) {
if ("stop" === e && t.find(".jwpf-carousel-extended-dot-indicator").removeclass("active").css({
"-webkit-transition-duration": "0s",
"transition-duration": "0s"
}), "start" === e) {
var i = math.abs(this.options.interval - this.options.speed);
t.find(".jwpf-carousel-extended-dot-indicator").addclass("active").css({
"-webkit-transition-duration": i + "ms",
"transition-duration": i + "ms"
})
}
},
updateitemstyle: function() {
var t = this;
this._timeoutid1 > 0 && (cleartimeout(this._timeoutid1), this._timeoutid1 = 0);
var e = -1 === this.prevcoordinate.dragpointer ? 0 : this.prevcoordinate.dragpointer,
i = this._currentposition,
s = this.itemwidth;
this.options.items > 1 && (s += parseint(e));
var n = 1 === this.delta ? i + s: i - s;
if (n > this._maxl && (this.$outerstage.css({
"-webkit-transition": "0s",
transition: "0s",
"-webkit-transform": "translate3d(-" + (this._minl - this.itemwidth) + "px,0px,0px)",
transform: "translate3d(-" + (this._minl - this.itemwidth) + "px,0px,0px)"
}), n = this._minl), i < this._minl && (this.$outerstage.css({
transition: "0s",
"-webkit-transform": "translate3d(-" + this._maxl + "px,0px,0px)",
transform: "translate3d(-" + this._maxl + "px,0px,0px)"
}), n = this._maxl - this.itemwidth), this.isdragging && this.options.items > 1) for (var a = this._itemcoordinate,
o = void 0 === this.viewport.centerpadding ? this.options.centerpadding: this.viewport.centerpadding, r = !1, h = 0; h < a.length && (a[h] > n && (n = !0 === this.options.center ? a[h] - o: a[h], r = !0), !0 !== r); h++);
var d = function() {
var e = t.animationtype("fadein") ? "0s": "all " + t.options.speed + "ms ease 0s";
t.$outerstage.css({
"-webkit-transition": e,
transition: e,
"-webkit-transform": "translate3d(-" + n + "px,0px,0px)",
transform: "translate3d(-" + n + "px,0px,0px)"
}),
t.$outerstage.bind("transitionend",
function() {
t.checktransitionendcallback.call(t)
})
};
this.animationtype("fadein") ? d() : this._timeoutid1 = settimeout(d, 100),
this._currentposition = n,
this.processactivationworker(),
this.options.autoplay && 0 === this.timer && this.startloop()
},
getnextactiveitems: function() {
return this.$outerstage.find(".active")
},
getstartandendindex: function() {
var t = this._currentposition,
e = math.floor(t / this.itemwidth);
return {
startindex: e = this.options.center ? e + 1 : e,
endindex: math.floor(math.abs(this.options.items + e))
}
},
resetfadestate: function() {
this.$outerstage.children(":not(.active)").css({
left: 0,
transition: "",
opacity: 0,
zindex: ""
})
},
processactivationworker: function() {
this.animationtype("fadein") && this.resetfadestate();
var t = this.getstartandendindex(),
e = t.startindex,
i = t.endindex,
s = this.getnextactiveitems();
s.removeclass("active");
for (var n = e; n < i; n++) {
var a = this.$outerstage.children(":eq(" + n + ")");
if (a.addclass("active"), this.animationtype("fadein")) {
var o = s.index(),
r = math.abs(o - n);
r = o + 1 === math.abs(this._clones - this._items) && 1 === this.delta ? -1 * r: r;
var h = {
left: this.delta * (this.itemwidth * r) + "px",
transition: "",
zindex: 1,
opacity: 1
};
s.css(h),
a.css({
transition: "opacity " + this.options.speed + "ms ease",
zindex: 2,
opacity: 1
}),
a.bind("transitionend", this.resetfadestate.bind(this))
}
}
this.options.center && this.applycentermode(e, i);
var d = math.floor((e - this._clones) / this.options.items) + 1;
this.options.dots && (this.$dotcontainer.find(".active").removeclass("active"), this.$dotcontainer.find("li:nth-child(" + d + ")").addclass("active"))
},
applycentermode: function(t, e) {
var i = math.floor((t + e) / 2);
this.$outerstage.find(".jwpf-carousel-extended-item-center").removeclass("jwpf-carousel-extended-item-center"),
this.$outerstage.children(":eq(" + i + ")").addclass("jwpf-carousel-extended-item-center")
},
dragoveractiontonextitem: function(t) {
var e = this,
i = this._currentposition + parseint(t);
i > this._maxl && (i = this._minl - this.itemwidth + parseint(t)),
this._timeoutid2 > 0 && (cleartimeout(this._timeoutid2), this._timeoutid2 = 0),
this._timeoutid2 = settimeout(function() {
e.$outerstage.css({
"-webkit-transition": "0s",
transition: "0s",
"-webkit-transform": "translate3d(-" + i + "px,0px,0px)",
transform: "translate3d(-" + i + "px,0px,0px)"
})
},
0)
},
dragoveractiontoprevitem: function(t) {
var e = this,
i = this._currentposition - parseint(t);
i < this._minl - this.itemwidth && (i = this._maxl - parseint(t)),
this._timeoutid2 > 0 && (cleartimeout(this._timeoutid2), this._timeoutid2 = 0),
this._timeoutid2 = settimeout(function() {
e.$outerstage.css({
"-webkit-transition": "0s",
transition: "0s",
"-webkit-transform": "translate3d(-" + i + "px,0px,0px)",
transform: "translate3d(-" + i + "px,0px,0px)"
})
},
0)
},
resetcoordiante: function() {
this.prevcoordinate = {
x: 0,
y: 0,
diff: 0,
dragpointer: -1
},
this.coordinate = {
x: 0,
y: 0
},
this.options.autoplay && 0 === this.timer && this.startloop()
},
backtostage: function() {},
bindevents: function() {
var i = this;
i.options.nav && (i.$nextbtn.on("click." + i._name,
function(t) { ! 1 === i.isanimating && (i.options.autoplay && i.stoploop(), i.next(), i.checkcallbackmethod.call(i))
}), i.$prevbtn.on("click." + i._name,
function(t) { ! 1 === i.isanimating && (i.prev(), i.options.autoplay && i.stoploop(), i.checkcallbackmethod.call(i))
})),
i.options.dots && i.$dotcontainer.find("li").each(function(e) {
t(this).on("click." + i._name,
function(s) {
if (t(this).hasclass("active") || !0 === i.isanimating) return ! 1;
i.options.autoplay && i.stoploop();
var n = t(this).parent().find("li.active"),
a = i.$dotcontainer.find("li").index(n) > e ? -1 : 1;
i.slidefromposition(e, a),
i.updatedotsfromposition(e + 1),
i.checkcallbackmethod.call(i)
})
}),
i.$outerstage.on("mousedown." + i._name, t.proxy(i.ondragstart, i)),
i.$outerstage.on("mouseup." + i._name + " touchend." + i._name, t.proxy(i.ondragend, i)),
i.$outerstage.on("touchstart." + i._name, t.proxy(i.ondragstart, i)),
i.$outerstage.on("touchcancel." + i._name, t.proxy(i.ondragend, i)),
t(e).focus(function() {
i.options.autoplay && 0 === i.timer && i.startloop()
}),
t(e).blur(function() {
i.options.autoplay && i.stoploop()
}),
t(e).on("resize." + i._name, t.proxy(i.windowresize, i))
},
windowresize: function(i) {
void 0 !== i && this.options.responsive && this.windowwidth !== t(e).width() && (cleartimeout(this.resizetimer), this.resizetimer = settimeout(this.onresize.bind(this), this.responsiverefreshrate))
},
onresize: function() {
this.destroy(),
this.init()
},
parseresponsiveviewport: function() {
var t = this.options.responsive;
if (void 0 !== t) {
for (var i = null,
s = e.innerwidth,
n = 0; n < t.length; n++) if (s > t[n].viewport) {
i = t[n];
break
}
return null === i && (i = t[t.length - 1]),
this.viewport = i,
i
}
},
updateresponsiveview: function() {
if (void 0 !== this.options.responsive) {
var t = e.innerheight,
i = this.parseresponsiveviewport();
if ("full" === i.height) {
if (this.$outerstage.css({
height: t + "px"
}), this._lastviewport === t) return;
this._lastviewport = t
} else {
if (this.$outerstage.css({
height: i.height
}), this._lastviewport === i.height) return;
this._lastviewport = i.height
}
}
},
getposition: function(t) {
var i = {
x: null,
y: null
};
return (t = (t = t.originalevent || t || e.event).touches && t.touches.length ? t.touches[0] : t.changedtouches && t.changedtouches.length ? t.changedtouches[0] : t).pagex ? (i.x = t.pagex, i.y = t.pagey) : (i.x = t.clientx, i.y = t.clienty),
i
},
ondragstart: function(e) {
if (3 === e.which || 2 === e.which || this.animationtype("fadein")) return ! 1;
var s = this,
n = s.getposition(e);
s.coordinate.x = n.x,
s.coordinate.y = n.y,
t(i).one("mousemove." + s._name + " touchmove." + s._name, t.proxy(function(e) {
t(i).on("mousemove." + s._name + " touchmove." + s._name, t.proxy(s.ondragmove, s)),
e.preventdefault()
},
this)),
s.isdragging = !0
},
ondragmove: function(t) {
var e = this;
if (!1 !== e.isdragging) {
e.options.autoplay && e.stoploop();
var i = e.getposition(t),
s = e.coordinate;
if (e.prevcoordinate.x !== i.x) {
var n = s.x - i.x,
a = (1 * math.abs(n)).tofixed(0);
e.prevcoordinate = {
x: i.x,
y: i.y,
diff: n,
dragpointer: a
},
n > 0 && e.dragoveractiontonextitem(a),
n < 0 && e.dragoveractiontoprevitem(a)
}
t.preventdefault()
}
},
ondragend: function(t) {
var e = this;
if (e.isdragging) {
var i = e.prevcoordinate.diff;
math.abs(i) > 100 ? (i > 0 && e.next(), i < 0 && e.prev()) : e.backtostage(),
e.isdragging = !1
}
e.resetcoordiante()
},
checkcallbackmethod: function() {
this.callback()
},
checktransitionendcallback: function() {
var t = this.options.transitionend;
if ("function" == typeof t) {
var e = this.$element.find(".jwpf-carousel-extended-item").length,
i = {
item: this.item,
items: e,
element: this.$element
};
t.call(this.element, i)
}
},
callback: function() {
var t = this.options.onchange;
if ("function" == typeof t) {
var e = this.$element.find(".jwpf-carousel-extended-item").length,
i = {
item: this.item,
items: e,
element: this.$element
};
t.call(this.element, i)
}
}
}),
t.fn.jwcarousel = function(e) {
return this.each(function() {
t.data(this, n) || t.data(this, n, new a(this, e))
}),
this
},
t.fn.jwcarousel.defaults = {
animationtype: "slide",
items: 4,
autoplay: !1,
center: !1,
centerpadding: 50,
margin: 10,
speed: 800,
interval: 4500,
onchange: null,
dots: !0,
dot_indicator: !1,
nav: !0,
nav_text: ["<", ">"]
}
} (jquery, window, document),
function(t) {
t(document).on("ready",
function() {
t(".jwpf-carousel-extended").each(function() {
var e = t(this),
i = e.data("image-layout"),
s = e.data("item-number"),
n = e.data("item-number-sm"),
a = e.data("item-number-xs"),
o = e.data("autoplay");
o = 1 === o;
var r = e.data("speed"),
h = e.data("interval"),
d = e.data("margin"),
p = !1,
l = 180,
c = 90,
m = 50,
u = e.data("fade"),
v = "slide";
"layout3" !== i && "layout4" !== i || (p = !0),
"layout3" === i && (s = 1, n = 1, a = 1),
p && (l = e.data("padding"), c = e.data("padding-sm"), m = e.data("padding-xs")),
"layout1" === i && (s = 1, n = 1, a = 1, l = 0, d = 0, u && (v = "fadein"));
var f = e.data("height"),
g = e.data("height-sm"),
x = e.data("height-xs"),
_ = e.data("testi-layout"),
b = e.data("team-layout"); (_ && !i || b) && (f = "auto", g = "auto", x = "auto");
var y = e.data("arrow");
y = 1 === y;
var w = e.data("dots");
w = 1 === w;
var c = e.data("left-arrow"),
i = e.data("right-arrow");
e.jwcarousel({
autoplay: o,
items: s,
speed: r,
interval: h,
margin: d,
center: p,
centerpadding: l,
dots: w,
dot_indicator: w,
nav: y,
nav_text: ['', ''],
animationtype: v,
responsive: [{
viewport: 1170,
height: f,
items: s
},
{
viewport: 767,
height: g,
items: n,
centerpadding: c
},
{
viewport: 320,
height: x,
items: a,
centerpadding: m
}]
})
});
new mutationobserver(function(e) {
e.foreach(function(e) {
var i = e.addednodes;
null !== i && t(i).each(function() {
t(this).find(".jwpf-carousel-extended").each(function() {
var e = t(this),
i = e.data("image-layout"),
s = e.data("item-number"),
n = e.data("item-number-sm"),
a = e.data("item-number-xs"),
o = e.data("autoplay");
o = 1 === o;
var r = e.data("speed"),
h = e.data("interval"),
d = e.data("margin"),
p = !1,
l = e.data("fade"),
c = "slide";
"layout3" !== i && "layout4" !== i || (p = !0);
var m = 180,
u = 90,
v = 50;
p && (m = e.data("padding"), u = e.data("padding-sm"), v = e.data("padding-xs")),
"layout3" === i && (s = 1, n = 1, a = 1),
"layout1" === i && (s = 1, n = 1, a = 1, m = 0, d = 0, l && (c = "fadein"));
var f = e.data("height"),
g = e.data("height-sm"),
x = e.data("height-xs"),
_ = e.data("testi-layout"),
b = e.data("team-layout"); (_ && !i || b) && (f = "auto", g = "auto", x = "auto");
var y = e.data("arrow");
y = 1 === y;
var w = e.data("dots");
w = 1 === w;
var c = e.data("left-arrow"),
i = e.data("right-arrow");
e.jwcarousel({
autoplay: o,
items: s,
speed: r,
interval: h,
margin: d,
center: p,
centerpadding: m,
dots: w,
dot_indicator: w,
nav: y,
nav_text: ['', ''],
animationtype: c,
responsive: [{
viewport: 1170,
height: f,
items: s
},
{
viewport: 767,
height: g,
items: n,
centerpadding: u
},
{
viewport: 320,
height: x,
items: a,
centerpadding: v
}]
})
})
})
})
}).observe(document.body, {
childlist: !0,
subtree: !0
})
})
} (jquery);