/*! thPlayer - v1.0 - 2015-06-12 */ !function () { var a = function (a) { return a.charAt(0).toUpperCase() + a.slice(1) }, b = function (a) { a.$wrap.addClass(a.css.wrap), a.$container.addClass(a.css.container).off(".thScroll").on({ "touchstart.thScroll": function (b) { b.stopPropagation(), a.scrolling = !0, a.previous = b.originalEvent.touches[0][a.coordName] }, "touchend.thScroll": function () { a.scrolling = !1 }, "touchmove.thScroll": function (b) { var c = a.previous - b.originalEvent.touches[0][a.coordName] < 0 ? 1 : 2; !a.$wrap.hasClass(a.css.visible) || a.atSide && a.atSide === c || (b.preventDefault(), a.movePin(a.previous - b.originalEvent.touches[0][a.coordName]), a.previous = b.originalEvent.touches[0][a.coordName]) }, "mousewheel.thScroll DOMMouseScroll.thScroll": function (b) { var c = b.originalEvent.wheelDelta > 0 || b.originalEvent.detail < 0 ? 1 : 2; a.atSide && a.atSide === c || (b.preventDefault(), b.stopPropagation(), a.visible && a.movePin(b.originalEvent.wheelDelta > 0 || b.originalEvent.detail < 0 ? -a.moveStep : a.moveStep)) } }), a.$pin.addClass(a.css.pin).appendTo(a.$wrap).off(".thScroll").on({ "touchstart.thScroll": function (b) { b.preventDefault(), a.start = a.$pin.position()[a.moveSide] - b.originalEvent.touches[0][a.coordName] }, "touchmove.thScroll": function (b) { b.preventDefault(), a.$wrap.hasClass(a.css.visible) && a.movePin(!1, b.originalEvent.touches[0][a.coordName] + a.start) }, "mousedown.thScroll": function (b) { b.preventDefault(), a.visible && 1 === b.which && (a.start = a.$pin.position()[a.moveSide] - b[a.coordName], jQuery(window).on("mousemove.thScroll", function (b) { return a.$wrap.hasClass(a.css.visible) ? void a.movePin(!1, b[a.coordName] + a.start) : void jQuery(window).off(".thScroll") }), jQuery(window).on("mouseup.thScroll", function () { jQuery(window).off(".thScroll") })) } }), a.setDirection(this.direction) }, c = function (a, c, d) { this.id = H(), this.$wrap = a, this.$container = c, this.$pin = jQuery("
"), this.direction = d, this.css = { wrap: "th-scroll-wrap", container: "th-scroll-container", pin: "th-scroll-pin", visible: "th-scroll-visible", direction: "th-scroll-" }, b(this) }; c.prototype = { refresh: function () { b(this) }, movePin: function (b, c) { b = "number" == typeof c ? c : this.$pin.position()[this.moveSide] + b, b = b > this.max ? this.max : 0 > b ? 0 : b; var d = Math.round(b); return this.$pin.css(this.moveSide, d + "px"), this.atSide = 0 === d ? 1 : d >= this.max ? 2 : !1, b *= this.proportion, b = 0 > b ? this.size + b : b, this.$container["scroll" + a(this.moveSide)](b), this }, toElement: function (b, c) { if (b = this.$container.find(b), b.length) { var d = 0, e = b.offset()[this.moveSide] - this.$container.offset()[this.moveSide], f = b["outer" + a(this.property)](); switch (c) { case "middle": var g = f > this.size ? 0 : (f - this.size) / 2; d = e + g; break; case "bottom": d = e + f - this.size; break; case "top": default: d = e } this.movePin(d / this.proportion) } }, resize: function () { var b = this.$container[this.property](), c = this.$container.prop("scroll" + a(this.property)); if (this.size !== b || this.scrollSize !== c) { this.atSide = -1, this.size = b, this.scrollSize = c; var d = this.scrollSize - this.size; if (0 >= d) return this.$wrap.removeClass(this.css.visible), this.visible = !1, this; this.visible = !0, this.$wrap.addClass(this.css.visible); var e = d / this.scrollSize; return this.max = Math.round(e * this.size), this.proportion = d / this.max, this.moveStep = this.defaultStep / this.proportion, this.$pin[this.property](this.size - this.max + "px"), this.$pin.css(this.moveSide, Math.round(this.$container["scroll" + a(this.moveSide)]() / this.proportion) + "px"), this } }, setDirection: function (a) { return this.direction = a, "x" === a || "horizontal" === a ? (this.moveSide = "left", this.coordName = "pageX", this.property = "width", this.defaultStep = 32, this.$wrap.removeClass(this.css.direction + "y").addClass(this.css.direction + "x")) : (this.moveSide = "top", this.coordName = "pageY", this.property = "height", this.defaultStep = 55, this.$wrap.removeClass(this.css.direction + "x").addClass(this.css.direction + "y")), this.resize(), this }, remove: function () { return jQuery(window).off(".thScroll"), this.$wrap.removeClass(this.css.wrap + " " + this.css.visible + " " + this.css.direction + "y " + this.css.direction + "x"), this.$container.removeClass(this.css.container), this.$pin.remove(), this.$pin = null, null } }; var d = function (a) { return "#" === a.charAt(0) ? a.substring(1, 7) : a }, e = function (a) { return parseInt(d(a).substring(0, 2), 16) }, f = function (a) { return parseInt(d(a).substring(2, 4), 16) }, g = function (a) { return parseInt(d(a).substring(4, 6), 16) }, h = function (a, b, c) { b = t(b) ? b : "#000000", this.$container = a, this.$canvas = jQuery("").css({ width: "100%", height: "100%" }), this.$canvas[0].width = 100, this.$canvas[0].height = 100, this.size = 100, this.context = this.$canvas[0].getContext("2d"), this.startDate = new Date, this.number = u(c) ? c : 16, this.color = { red: e(b), green: f(b), blue: g(b) }, this.refresh() }; h.prototype = { draw: function () { if (this.isDisabled()) return this; var a = parseInt((new Date - this.startDate) / 1e3 * this.number) / this.number; this.context.save(), this.context.clearRect(0, 0, this.size, this.size), this.context.translate(this.size / 2, this.size / 2), this.context.rotate(2 * Math.PI * a); for (var b = 0; b < this.number; b++) this.context.beginPath(), this.context.rotate(2 * Math.PI / this.number), this.context.moveTo(this.size / 5, 0), this.context.lineTo(this.size / 2, 0), this.context.lineWidth = this.size / 30, this.context.strokeStyle = "rgba(" + this.color.red + "," + this.color.green + "," + this.color.blue + "," + b / this.number + ")", this.context.stroke(); return this.context.restore(), this }, isDisabled: function () { return this.$canvas.is(":hidden") ? !0 : !1 }, start: function (a) { this.interval && clearInterval(this.interval), a = u(a) ? a : 10; var b = this; return this.interval = setInterval(function () { b.draw() }, 1e3 / a), this }, stop: function () { return this.interval && clearInterval(this.interval), this.interval = !1, this }, remove: function () { return this.stop(), this.$canvas.remove(), null }, refresh: function (a) { return s(a) || (this.$container = a), this.$container && this.$container.length ? (this.$canvas.appendTo(this.$container), this.draw(), this) : (this.stop(), this) } }; var i = function (a, b) { return a = t(a) ? { src: a } : a, a instanceof jQuery && (a = Ga(a)), a.src ? (this.src = a.src, this.type = t(a.type) ? a.type : !1, this.kind = a.kind || b || "video", this.duration = !1, this.available = !1, this.needsCheck = !0, void (this.type && !aa[this.kind].prototype.canPlayType(this.type) && (this.needsCheck = !1))) : !1 }; i.prototype = { check: function (a) { var b = this, c = null; return b.deferred ? b.deferred : b.needsCheck ? (c = aa[this.kind].prototype.check(this, a), b.deferred = c, b.deferred.always(function () { b.deferred = null }), c) : (c = jQuery.Deferred(), b.available ? c.resolve(b) : c.reject(p.error), c) } }; var j = function (a, b) { var c = this; b = jQuery.extend(!0, _a, b || {}), c.items = {}, c.sorted = [], c.controls = {}, c.players = {}, c.current = {}, c.prop = {}, c.player = a, c.atStart = !!b.atStart, s(b.skip) || (c.skipTime = u(b.skip) ? b.skip : !!b.skip), s(b.every) || (c.every = u(b.every) ? b.every : !!b.every), hb(c, b.items), cb(c, c.player.$wrap), gb(c), c.sort(), c.defaultSorted = c.sorted }; j.prototype = { visible: !1, skipTime: !0, every: !1, atStart: !0, getOrder: "_loop", css: { visible: "th-advert-visible", skipable: "th-advert-skipable", hasLink: "th-clickable" }, canSkip: function () { if (!u(this.skipTime)) return !!this.skipTime; var a = ca(this, "time"); return a === !1 ? !1 : this.skipTime <= a }, hasItems: function () { var a = !1; return jQuery.each(this.items, function () { return a = !0, !1 }), a }, count: function () { var a = this; return null !== a.countItems ? a.countItems : (a.countItems = 0, jQuery.each(this.items, function () { ++a.countItems }), a.countItems) }, get: function (a, b) { return t(a) || (b = s(b) ? a.params : b, a = a.method), Z[a] ? Z[a](this, b) : this.items[a] ? this.items[a] : null }, add: function (a) { this.countItems = null, kb(this, a); var b = this.sorted; return this.sort(), this.defaultSorted = this.sorted, this.sorted = b, this }, sort: function (a, b) { return a = a && $[a] ? a : "default", $[a](this, b), this }, show: function (a) { return tb(this, s(a) ? this.getOrder : a), this }, hide: function (a) { return this.visible = !1, fa(this.player, this.css.visible + " " + this.css.skipable), pb(this), this.player.prop.tempDisabled = !1, a || (this.player.$events.trigger("thadverthide"), this.player.play()), this }, skip: function () { return this.canSkip() && this.hide(), this } }; var k = function (a) { var b = this; b.sources = {}, a = Ja(b, a), b.id = a.id || H(), b.name = a.name || a.src || a.id, b.preview = a.preview || null, b.shortDescription = a.shortDescription || null, b.description = a.description || null, b.originalControls = w(a.originalControls) ? a.originalControls : null, b.playerProp = a.playerProp ? a.playerProp : !1, b.noAdverts = w(a.noAdverts) ? a.noAdverts : !1, b.advertsProp = a.advertsProp ? a.advertsProp : !1, b.kind = a.kind || "video", a.sources && jQuery.each(a.sources, function (a, c) { b.addSource(c) }) }; k.prototype = { update: function (a) { var b = this; return a = Ja(b, a), t(a.name) && (b.name = a.name), t(a.preview) && (b.preview = a.preview), t(a.shortDescription) && (b.shortDescription = a.shortDescription), t(a.description) && (b.description = a.description), w(a.originalControls) && (b.originalControls = a.originalControls), s(a.playerProp) || (b.playerProp = a.playerProp), w(a.noAdverts) && (b.noAdverts = a.noAdverts), t(a.kind) && (b.kind = a.kind), s(a.advertsProp) || (b.advertsProp = a.advertsProp), a.sources && jQuery.each(a.sources, function (a, c) { b.addSource(c) }), b }, addSource: function (a) { return a instanceof i || (a = new i(a, this.kind)), a && a.kind === this.kind && (this.sources[a.src] = a), this }, getAvailable: function () { return Ka(this.sources) } }; for (var l = jQuery(document)[0], m = (jQuery([]), "file:" === window.location.protocol, navigator.userAgent.match(/(iPad|iPhone|iPod)/g) ? !0 : !1), n = !m, o = { available: !1, api: {} }, p = { pending: 0, loading: 1, success: 10, buffering: 11, aborted: 20, error: 30, notFound: 31, current: 50 }, q = function (a) { window.console && console.log(a) }, r = function (a) { return '[data-role~="' + a + '"]' }, s = function (a) { return "undefined" == typeof a ? !0 : !1 }, t = function (a) { return "string" == typeof a ? !0 : !1 }, u = function (a) { return "number" == typeof a ? !0 : !1 }, v = function (a) { return "function" == typeof a ? !0 : !1 }, w = function (a) { return a === !0 || a === !1 ? !0 : !1 }, x = function (a, b, c) { return a && a[b] ? a[b].apply(a, c) : !1 }, y = function (a, b) { return b ? (a = (a || jQuery([])).add(b), a.length ? a : !1) : a }, z = function (a, b) { return b ? (a = (a || jQuery([])).not(b), a.length ? a : !1) : a }, A = function (a, b, c, d) { a && (d && (b += "." + d, a.off(b)), a.on(b, c)) }, B = function (a, b, c) { var d = a.find(b); return c || d.length ? d : !1 }, C = function (a) { return '[data-action~="' + a + '"]' }, D = function (a) { if (t(a)) return '[data-group~="' + a + '"]'; var b = []; return jQuery.each(a, function (a, c) { b.push(D(c)) }), b.join(",") }, E = function (a, b, c, d, e) { b && a[c] && A(b, "click", function () { a[c].apply(a, e) }, d) }, F = function (a, b, c, d) { c && (b = "$" + b, a.controls[b] = y(a.controls[b], c), A(c, "thremove", function (d) { d.target === c[0] && (a.controls[b] = z(a.controls[b], c)) }, d)) }, G = function (a, b) { if (!u(a)) return b ? "0" : "0:00"; var c = parseInt(a, 10), d = Math.floor(c / 3600), e = Math.floor((c - 3600 * d) / 60), f = c - 3600 * d - 60 * e; return (!b || d) && d && 10 > e && (e = "0" + e), (!b || e || d) && 10 > f && (f = "0" + f), a = (d ? d + ":" : "") + (!b || d ? e + ":" : "") + f }, H = function () { function a() { return Math.floor(65536 * (1 + Math.random())).toString(16).substring(1) } return a() + a() + "-" + a() + "-" + a() + "-" + a() + "-" + a() + a() + a() }, I = function (a) { var b = new jQuery.Deferred, c = jQuery.ajax({ type: "HEAD", url: a, success: function () { b.resolve.apply(b, arguments) }, error: function () { b.reject.apply(b, arguments) } }); return b.always(function () { c.abort(), c = null }), b }, J = { singleIn: function (a, b, c) { return c ? (c && t(c) && (c = [c]), a[b] === !0 || a[b] && jQuery.inArray(a[b], c) > -1 ? !0 : !1) : !a[b] }, inArray: function (a, b, c) { return c ? a[b] === !0 || a[b] && jQuery.inArray(c, a[b]) > -1 ? !0 : !1 : !(a[b] && a[b] !== !0 && a[b].length) } }, K = [["requestFullscreen", "exitFullscreen", "fullscreenElement", "fullscreenEnabled", "fullscreenchange", "fullscreenerror"], ["webkitRequestFullscreen", "webkitExitFullscreen", "webkitFullscreenElement", "webkitFullscreenEnabled", "webkitfullscreenchange", "webkitfullscreenerror"], ["webkitRequestFullScreen", "webkitCancelFullScreen", "webkitCurrentFullScreenElement", "webkitCancelFullScreen", "webkitfullscreenchange", "webkitfullscreenerror"], ["mozRequestFullScreen", "mozCancelFullScreen", "mozFullScreenElement", "mozFullScreenEnabled", "mozfullscreenchange", "mozfullscreenerror"], ["msRequestFullscreen", "msExitFullscreen", "msFullscreenElement", "msFullscreenEnabled", "MSFullscreenChange", "MSFullscreenError"]], L = 0; L < K.length; L++) if (K[L][1] in l) { o.available = !0; for (var M = 0; M < K[L].length; M++) o.api[K[0][M]] = K[L][M]; break } var N = function (a) { return C("player-" + a) }, O = function (a, b, c) { F(a, b, c, "thControls") }, P = function (a, b, c, d) { E(a, b, c, "thControls", d) }, Q = function (a, b, c) { (c || a.controls.$duration) && (b = G(u(b) ? b : a.duration() || 0), (c || a.controls.$duration).html(b.replace(/(\d)/g, "$1"))) }, R = function (a, b, c) { (c || a.controls.$playedTime) && (b = G(u(b) ? b : a.time() || 0), (c || a.controls.$playedTime).html(b.replace(/(\d)/g, "$1"))) }, S = function (a) { a.sourcesCollection && (a.controls.$title && (a.controls.$title.text(a.sourcesCollection.name), a.controls.$title.attr("title", a.sourcesCollection.name)), a.sourcesCollection.description && a.controls.$description ? (a.controls.$description.html(a.sourcesCollection.description), ea(a, a.css.hasInfo)) : fa(a, a.css.hasInfo)) }, T = function (a, b) { a.$events.off(".thControls").on({ "thloadstart.thControls": function () { Q(a, 0), R(a, 0), S(a) }, "thdurationchange.thControls": function () { Q(a) } }), b.$panel && b.$panel.off(".thControls").on({ "mouseenter.thControls": function () { ea(a, a.css.mouseOverControl) }, "mouseleave.thControls": function () { fa(a, a.css.mouseOverControl) } }), P(a, b.$togglePlay, "togglePlay"), P(a, b.$stop, "stop"), P(a, b.$toggleLoop, "toggleLoop"), P(a, b.$fullscreen, "toggleFullscreen"), P(a, b.$toggleInfo, "toggleInfo") }, U = function (a, b) { var c = {}; return c.$panel = B(b, da("panel")), c.$togglePlay = B(b, N("togglePlay")), c.$stop = B(b, N("stop")), c.$playedTime = B(b, da("playedTime")), c.$duration = B(b, da("duration")), c.$toggleLoop = B(b, N("toggleLoop")), c.$toggleInfo = B(b, N("toggleInfo")), c.$fullscreen = B(b, N("toggleFullscreen")), c.$title = B(b, da("title")), c.$description = B(b, da("description")), c.$prefix = B(b, da("prefix")), O(a, "wrap", b), O(a, "playedTime", c.$playedTime), O(a, "duration", c.$duration), O(a, "title", c.$title), O(a, "description", c.$description), O(a, "prefix", c.$prefix), S(a), R(a, !1, c.$playedTime), Q(a, !1, c.$duration), T(a, c), c.scroll = Sa(a, c.$panel || a.$wrap), c.volume = $a(a, c.$panel || a.$wrap), c }, V = function (a) { a.$events.on({ thskinchange: function () { a.mouseMoveTimer && ea(a, a.css.mouseMove), a.loop(a.prop.loop), a.prop.paused ? (ea(a, a.css.pause), fa(a, a.css.playing)) : (ea(a, a.css.playing), fa(a, a.css.pause)), a.hasError() && ea(a, a.css.error) }, thvolumechange: function () { a.volume() }, thloadstart: function () { a.status = p.loading, a.prop.played = !1, la(a), ia(a), fa(a, a.css.error) }, thabort: function () { a.status = p.aborted, ja(a), fa(a, a.css.showPreview, a.css.playing, a.css.pause), ea(a, a.css.error) }, therror: function () { a.status = p.error, ja(a), fa(a, a.css.showPreview, a.css.playing, a.css.pause), ea(a, a.css.error) }, thloadedmetadata: function () { a.status = p.success, a.prop.paused && (ja(a), ea(a, a.css.pause)) }, thpause: function () { Math.round(a.time()) !== Math.round(a.duration()) && (a.prop.paused = !0, ja(a), fa(a, a.css.playing), ea(a, a.css.pause)) }, thplay: function () { a.prop.played = !0, a.prop.paused = !1, ja(a), fa(a, a.css.pause, a.css.showPreview), ea(a, a.css.playing) }, thtimeupdate: function () { R(a) }, thended: function () { a.keyBinding.moveTimer && clearInterval(a.keyBinding.moveTimer) }, thcanplay: function () { ja(a), a.prop.paused ? ea(a, a.css.pause) : ea(a, a.css.playing) }, thwaiting: function () { a.prop.paused || ia(a) } }) }, W = function (a) { var b = function () { a.mouseMoveTimer ? (clearTimeout(a.mouseMoveTimer), a.mouseMoveTimer = null) : ea(a, a.css.mouseMove), a.mouseMoveTimer = setTimeout(function () { fa(a, a.css.mouseMove), a.mouseMoveTimer = null }, a.hideTimeout) }; a.$fake.on({ click: function () { a.togglePlay() }, dblclick: function () { a.toggleFullscreen() } }), a.$wrap.prop("tabindex", 1).on({ mouseenter: function () { ea(a, a.css.mouseOver) }, mouseleave: function () { fa(a, a.css.mouseOver) }, "mousewheel DOMMouseScroll": function (b) { if (a.playlist) { var c = jQuery(b.target), d = thPlaylistControlsByRole("container"); if (c.is(d) || c.parents(d).length) return } b.preventDefault(), b.stopPropagation(), a.volumeChange(b.originalEvent.wheelDelta > 0 || b.originalEvent.detail < 0 ? a.keyBinding.volumeStep : -a.keyBinding.volumeStep) }, click: b, mousemove: b, touchmove: b, touchstart: b, keydown: function (b) { if (null === a.keyBinding.key) { var c = !0; switch (a.keyBinding.key = b.keyCode, a.keyBinding.key) { case 13: a.toggleFullscreen(); break; case 32: a.togglePlay(); break; case 37: a.keyBinding.func = function () { try { a.canSeek() && a.time(a.time() - a.keyBinding.timeStep) } catch (b) { } }; break; case 39: a.keyBinding.func = function () { try { a.canSeek() && a.time(a.time() + a.keyBinding.timeStep) } catch (b) { } }; break; case 38: a.keyBinding.func = function () { a.volumeChange(a.keyBinding.volumeStep) }; break; case 40: a.keyBinding.func = function () { a.volumeChange(-a.keyBinding.volumeStep) }; break; default: c = !1 } c && b.preventDefault(), a.keyBinding.func ? a.keyBinding.clickTimer = setTimeout(function () { a.keyBinding.clickTimer && (clearTimeout(a.keyBinding.clickTimer), a.keyBinding.clickTimer = null), a.keyBinding.moveTimer = setInterval(a.keyBinding.func, 20, 0, !1) }, 150, !1) : a.keyBinding.key = null } }, keyup: function (b) { null !== a.keyBinding.key && a.keyBinding.key === b.keyCode && (a.keyBinding.moveTimer && clearInterval(a.keyBinding.moveTimer), a.keyBinding.clickTimer && (clearTimeout(a.keyBinding.clickTimer), a.keyBinding.func()), a.keyBinding.key = a.keyBinding.func = a.keyBinding.clickTimer = a.keyBinding.moveTimer = null) } }) }, X = function (a) { a.$events.on({ thinit: function (b, c) { c.autoplay ? a.play() : a.load() }, thended: function () { na(a) } }) }, Y = function (a) { jQuery(l).on(o.api.fullscreenchange, function () { if (l[o.api.fullscreenElement] !== a.$wrap[0]) { if (l[o.api.fullscreenElement] && jQuery(l[o.api.fullscreenElement]).parents(a.$wrap).length) return; a.fullscreen(!1), fa(a, a.css.fullscreen), jQuery("html").removeClass(a.css.rootFullscreen), a.prop.fullscreen = !1, a.resize() } else ea(a, a.css.fullscreen), jQuery("html").addClass(a.css.rootFullscreen), a.prop.fullscreen = !0, a.resize() }).on(o.api.fullscreenerror, function () { l[o.api.fullscreenElement] === a.$wrap[0] && (fa(a, a.css.fullscreen), jQuery("html").removeClass(a.css.rootFullscreen), a.prop.fullscreen = !1, a.resize()) }), jQuery(window).on("resize", function () { a.resize() }), V(a) }, Z = { _playlist: function (a, b) { var c = null; return jQuery.each(a.items, function (a, d) { return J.inArray(d, "playlist", b) ? (c = d, !1) : void 0 }), c }, _loop: function (a) { if (!a.sorted.length) return null; for (var b = a.current.collection ? jQuery.inArray(a.current.collection.id, a.sorted) : -1; a.sorted.length > 0;) { if (b = b + 1 >= a.sorted.length ? 0 : b + 1, a.items[a.sorted[b]]) return a.items[a.sorted[b]]; a.sorted.splice(b, 1) } return null }, _first: function (a) { for (; a.sorted.length;) { if (a.items[a.sorted[0]]) return a.items[a.sorted[0]]; a.sorted.shift() } return null }, _last: function (a) { for (; a.sorted.length;) { if (a.items[a.sorted[a.sorted.length - 1]]) return a.items[a.sorted[a.sorted.length - 1]]; a.sorted.pop() } return null }, _next: function (a) { if (!a.sorted.length) return null; var b = a.current.collection ? jQuery.inArray(a.current.collection.id, a.sorted) : 0; if (-1 === b) return null; for (; a.sorted.length;) { if (b = b + 1 >= a.sorted.length ? b : b + 1, !a.sorted[b]) return null; if (a.items[a.sorted[b]]) return a.items[a.sorted[b]]; a.sorted.splice(b, 1) } return null }, _previous: function (a) { if (!a.sorted.length) return null; var b = a.current.collection ? jQuery.inArray(a.current.collection.id, a.sorted) : 0; if (-1 === b) return null; for (; a.sorted.length;) { if (b = -1 >= b - 1 ? b : b - 1, !a.sorted[b]) return null; if (a.items[a.sorted[b]]) return a.items[a.sorted[b]]; a.sorted.splice(b, 1) } return null } }, $ = { "default": function (a) { a.sorted = [], jQuery.each(a.items, function (b, c) { c.excluded || a.sorted.push(b) }) }, "in": function (a, b) { b = jQuery.isArray(b) ? b : [b], a.sorted = [], jQuery.each(b, function (b, c) { a.items[c] && a.sorted.push(c) }) } }, _ = {}, aa = {}, ba = { skin: "PanelIconsSilver", autoplay: !1, muted: !1, time: 0, volume: 1, logoSrc: !1, logoTitle: !1, logoLink: !1, showPreview: !1, playlist: !0, textTrackList: !0, adverts: !0, texts: { skipAdvert: "Skip advert" } }, ca = function (a, b) { return x(a.current.kind, b, Array.prototype.slice.call(arguments, 2)) }, da = function (a) { return r("player-" + a) }, ea = function (a) { a.controls.$wrap && a.controls.$wrap.addClass(Array.prototype.slice.call(arguments, 1).join(" ")) }, fa = function (a) { a.controls.$wrap && a.controls.$wrap.removeClass(Array.prototype.slice.call(arguments, 1).join(" ")) }, ga = function (a) { a.pause(), a.time(0) }, ha = function (a, b) { a.$events.trigger("thplaystart"), a.canPlay() && (a.prop.paused = !1, u(b) && a.time(b), setTimeout(function () { ca(a, "play") }, 100)) }, ia = function (a) { !a.prop.loading && n && (a.prop.loading = !0, a.loader && a.loader.start(), ea(a, a.css.loading)) }, ja = function (a) { n && (a.prop.loading = !1, fa(a, a.css.loading), a.loader && a.loader.stop()) }, ka = function (a) { a.prop.showPreview && a.sourcesCollection && (a.prop.played ? fa(a, a.css.showPreview) : ea(a, a.css.showPreview)) }, la = function (a) { if (a.$preview && a.sourcesCollection) { var b = a.$preview.is("img") ? a.$preview : a.$preview.find("img"), c = !0, d = a.sourcesCollection.preview; b.length ? d === b.first().attr("src") ? c = !1 : b = jQuery("").appendTo(a.$preview.empty()) : b = jQuery("").appendTo(a.$preview), c && b.attr({ src: d }).hide().off(".thPreview").on("load.thPreview", function () { jQuery(this).show() }), ka(a) } }, ma = function (a) { if (a.$logo && t(a.logo.src)) { var b = a.$logo.is("img") ? a.$logo : jQuery(""), c = t(a.logo.title) ? a.logo.title : ""; b.attr({ src: a.logo.src, title: c, alt: c }), t(a.logo.link) ? b.wrap("").parent().attr({ href: a.logo.link, target: "_blank" }).click(function (b) { b.stopPropagation(), a.pause() }).appendTo(a.$logo.empty()) : b.appendTo(a.$logo.empty()) } }, na = function (a) { ja(a), a.prop.paused = !0, ea(a, a.css.pause), fa(a, a.css.playing) }, oa = function (a) { ca(a, "clean"), ca(a, "detach"), ca(a, "off", ".thsetsource"), a.current.source = null, a.current.kind = null, a.$events.trigger("thclean") }, pa = function (a, b) { var c = da("wrap"); b.is("video") ? b.parents(c).length ? a.$wrap = b.parents(c).first() : (b.wrap("
"), a.$wrap = b.parent()) : a.$wrap = b.is(c) ? b : jQuery("
").appendTo(b), a.$events = jQuery("
"), Y(a) }, qa = function (a) { a.$loader ? a.loader ? a.loader.refresh(a.$loader) : a.loader = new h(a.$loader) : a.loader && (a.loader = a.loader.remove()) }, ra = function (a, b) { b.insertBefore(a.$wrap), jQuery.each(a.players, function (a, b) { b.detach() }), a.$wrap.find("*").trigger("thremove"), a.$wrap.trigger("thremove").remove(), a.$wrap = b, a.$wrap.css({ "padding-top": a.prop.ratio + "%" }), a.$fake = B(b, da("fake")), a.$logo = B(b, da("logo")), a.$preview = B(b, da("preview")), a.$loader = B(b, da("loader")), a.$container = B(b, da("container")) || a.$wrap, ca(a, "append", a.$container), ca(a, "hasControls") ? a.$wrap.addClass(a.css.originalControls) : a.$wrap.removeClass(a.css.originalControls), n || a.$wrap.addClass(a.css.noAutoplay), qa(a), la(a), ma(a) }, sa = function (a, b, c) { if (v(b)) { c = c || H(); var d = {}; d["thloadedmetadata." + c] = function () { b(), a.$events.off("." + c) }, d["thabort." + c] = d["therror." + c] = function () { a.$events.off("." + c) }, a.$events.on(d) } }, ta = function (a) { var b = ["th-player-big", "th-player-normal", "th-player-post-medium", "th-player-medium", "th-player-small"], c = a.$wrap.width(), d = !1; d = c >= 1200 ? b[0] : c >= 768 ? b[1] : c >= 568 ? b[2] : c >= 480 ? b[3] : b[4], ea(a, d), b.splice(b.indexOf(d), 1), fa(a, b.join(" ")) }, ua = function (a, b) { a.current.source = b, a.current.kind = a.players[a.sourcesCollection.kind], a.current.kind.controls(a.sourcesCollection.originalControls, a.sourcesCollection.playerProp).append(a.$container).volume(a.prop.volume).mute(a.prop.muted).loop(a.prop.loop), a.current.kind.hasControls() ? a.$wrap.addClass(a.css.originalControls) : a.$wrap.removeClass(a.css.originalControls), a.current.kind.off(".thsetsource").setSource(b); var c = ["abort", "canplay", "canplaythrough", "durationchange", "emptied", "ended", "error", "loadeddata", "loadedmetadata", "pause", "play", "playing", "progress", "ratechange", "seeked", "seeking", "stalled", "suspend", "timeupdate", "volumechange", "waiting"]; jQuery.each(c, function (b, c) { a.current.kind.on(c + ".thsetsource", function () { a.$events.trigger("th" + c) }) }) }; thPlayerSkins = {}, thPlayerSkinDirectory = "/Widgets/GSAVideoPlayer/skins"; var va = "skin.js", wa = function (a) { var b = thPlayerSkins[a]; if (!(b && b.stylesheets && b.stylesheets.length)) return jQuery.Deferred().resolve(); var c = jQuery.Deferred(), d = []; jQuery.each(b.stylesheets, function (b, c) { var e = a + "/" + c; jQuery('link[href="' + thPlayerSkinDirectory + "/" + e + '"], link[data-href="' + e + '"], style[data-href="' + e + '"]').length || d.push(e) }); var e = d.length, f = function () { c && (clearTimeout(g), c.resolve(), g = null, c = null) }, g = setTimeout(f, 5e3); return jQuery.each(d, function (a, b) { jQuery("", { href: thPlayerSkinDirectory + "/" + b, rel: "stylesheet", type: "text/css" }).appendTo("head").load(function () { e--, 0 >= e && f() }).error(function () { e--, 0 >= e && f() }) }), c }, xa = function (a, b, c) { var d = thPlayerSkins[b]; if (c = c || jQuery.Deferred(), !d) return c.reject(p.error); var e = wa(b); return c.resolve({ skin: d, dfd: e }), c }, ya = function (a, b) { var c = jQuery.Deferred(); return jQuery.getScript(thPlayerSkinDirectory + "/" + b + "/" + va).done(function () { xa(a, b, c) }).fail(function () { c.reject(p.error) }), c }, za = function (a, b) { return thPlayerSkins[b] ? xa(a, b) : ya(a, b) }, Aa = function (a) { var b = thPlayerSkins[a]; if (b && b.stylesheets && b.stylesheets.length) { var c = []; jQuery.each(b.stylesheets, function (b, d) { var e = a + "/" + d; c.push('link[href="' + thPlayerSkinDirectory + "/" + e + '"], link[data-href="' + e + '"], style[data-href="' + e + '"]') }), jQuery(c.join(", ")).remove() } }, Ba = function (a, b) { var c = jQuery(b.template); ra(a, c), U(a, c), a.playlist ? thPlaylistControls(a.playlist, c) : B(c, D(["playlist", "playlist-controls"]), !0).remove(), a.textTrackList ? (thTextTrackListBuild(a.textTrackList, c), thTextTrackListControls(a.textTrackList, c)) : B(c, D(["text-track", "text-track-controls"]), !0).remove(), W(a), a.$events.trigger("thskinchange"), a.resize() }, Ca = function (a, b) { if (a.skin === b) return jQuery.Deferred().reject(p.aborted); var c = a.skin || null; a.skin = b, a.pause(); var d = za(a, b).done(function (b) { Ba(a, b.skin), ja(a), b.dfd.always(function () { a.resize() }), c && Aa(c) }).fail(function () { a.skin = c }); return d }, Da = function (a, b) { b && jQuery.each(b, function (b, c) { a.addSource(c) }), a.$wrap.find("source").each(function (b, c) { var d = jQuery(c); a.addSource(d), d.remove() }) }, Ea = function (a) { var b = {}; return a.data("id") && (b.id = a.data("id")), a.data("name") && (b.name = a.data("name")), a.data("preview") && (b.preview = a.data("preview")), a.data("description") && (b.description = unescape(a.data("description"))), a.data("shortDescription") && (b.shortDescription = a.data("shortDescription")), a.data("originalControls") && (b.originalControls = "on" === a.data("originalControls") ? !0 : !1), a.data("noAdverts") && (b.noAdverts = "yes" === a.data("noAdverts") ? !0 : !1), a.data("playerProp") && (b.playerProp = a.data("playerProp")), a.data("advertsProp") && (b.advertsProp = a.data("advertsProp")), a.data("kind") && (b.kind = a.data("kind")), a.data("duration") && (b.duration = a.data("duration")), b }, Fa = function (a, b, c) { c = jQuery.extend(!0, { description: !1, originalControls: null }, Ea(b), c), a.sourcesCollection = new k(c) }, Ga = function (a) { var b = {}; return a.attr("src") && (b.src = a.attr("src"), a.data("kind") && (b.kind = a.data("kind")), a.attr("kind") && (b.kind = a.attr("kind")), a.attr("type") && (b.type = a.attr("type")), a.data("duration") && (b.duration = a.data("duration"))), b }, Ha = function (a) { var b = Ea(a), c = Ga(a); return c.src && (b.sources = [c]), b }, Ia = function (a, b, c) { return c instanceof jQuery ? (c = Ha(c), c.id && (b.id = c.id), b.update(c)) : (c instanceof i || (c = new i(c)), c && b.addSource(c)), a.players[b.kind] || (a.players[b.kind] = _[b.kind](a.$wrap, a.prop.players[b.kind])), c }, Ja = function (a, b) { if (b instanceof i) { var c = new i(b); b = { sources: [c] } } return b instanceof jQuery && (b = Ha(b)), b }, Ka = function (a, b) { var c = 0, d = 0, e = jQuery.Deferred(), f = []; return jQuery.each(a, function () { ++c }), jQuery.each(a, function (a, g) { var h = g.check(b); f.push(h), h.then(function (a) { if ("pending" === e.state() && e.resolve(a), !b) for (var c = f.length - 1; c >= 0; c--) f[c] && "pending" === f[c].state() && f[c].reject(p.aborted) }, function () { "pending" === e.state() && (++d, c === d && e.reject(p.error)) }) }), e }, La = function (a) { if (a.deferred && (a.deferred.reject(p.aborted), a.deferred = null), a.hasSource()) return jQuery.Deferred().resolve(p.current); oa(a), a.$events.trigger("thloadstart"); var b = a.sourcesCollection.getAvailable(); return a.deferred = b, b.done(function (b) { ua(a, b) }).fail(function () { a.$events.trigger("therror") }).always(function () { a.deferred = null }), b }, Ma = function (a, b) { !a.prop.isScrolling && a.controls.$playedDist && (b = u(b) ? b : a.time(), a.controls.$playedDist.width(b / a.prop.prcToSec + "%")) }, Na = function (a, b, c, d) { b = 0 > b ? 0 : b, c = c > a.duration() ? a.duration() : c; var e = b / a.prop.prcToSec, f = (c - b) / a.prop.prcToSec; return e + f > 100 && (f = 100 - e), e > 100 ? jQuery([]) : (d && jQuery(d) || jQuery("
")).width(f + "%").css("left", e + "%") }, Oa = function (a) { if (a.controls.$buffered) { if (!a.buffered()) return void a.controls.$buffered.empty(); var b = a.controls.$buffered.children(), c = a.buffered(); b.length > c.length && b.slice(c.length).remove(); for (var d = 0; d < c.length; d++) Na(a, c[d][0], c[d][1], b[d]).addClass(a.css.bufferedPart).appendTo(a.controls.$buffered) } }, Pa = function (a) { a.prop.prcToSec = a.duration() / 100, Ma(a), Oa(a) }, Qa = function (a, b, c) { var d = ((c.originalEvent.touches ? c.originalEvent.touches[0].pageX : c.pageX) - b.offset().left) / b.width() * 100; d = 0 > d ? 0 : d > 100 ? 100 : d, a.controls.$playedDist.width(d + "%"), a.time(d * a.prop.prcToSec) }, Ra = function (a, b, c) { a.$events.off(".thTimeline").on({ "thloadstart.thTimeline": function () { Ma(a, 0) }, "thtimeupdate.thTimeline": function () { Ma(a) }, "thloadedmetadata.thTimeline": function () { Pa(a) }, "thprogress.thTimeline": function () { Oa(a) }, "thskinchange.thTimeline": function () { Pa(a) } }), b.$timeline && b.$timeline.off(".thTimeline"), jQuery(window).off(".thTimeline"), c && b.$timeline && b.$timeline.on({ "touchmove.thTimeline": function (c) { c.preventDefault(), Qa(a, b.$timeline, c) }, "mousedown.thTimeline": function (c) { c.preventDefault(), a.canSeek() && 1 === c.which && (a.prop.isScrolling = !0, ea(a, a.css.scrolling), Qa(a, b.$timeline, c), jQuery(window).on({ "mousemove.thTimeline": function (c) { Qa(a, b.$timeline, c) }, "mouseup.thTimeline": function () { jQuery(window).off(".thTimeline"), fa(a, a.css.scrolling), a.prop.isScrolling = !1 } })) } }) }, Sa = function (a, b) { b = b || jQuery("
"); var c = {}; return c.$timeline = B(b, da("timeline")), c.$buffered = B(b, da("buffered")), c.$playedDist = B(b, da("playedDist")), O(a, "timeline", c.$timeline), O(a, "buffered", c.$buffered), O(a, "playedDist", c.$playedDist), Ra(a, c, !0), c }, Ta = !1, Ua = navigator.userAgent.toLowerCase(), Va = /ipad|iphone|ipod|android|blackberry|windows ce|windows phone|webos|playbook/.exec(Ua); Va && ("android" === Va[0] && /gecko/.test(Ua) || (Ta = !0)); var Wa = function (a) { return N("volume-" + a) }, Xa = function (a) { a.prop.muted || 0 === a.prop.volume ? ea(a, a.css.muted) : fa(a, a.css.muted), a.controls.$volumeDist && a.controls.$volumeDist.width(100 * a.prop.volume + "%") }, Ya = function (a, b, c) { var d = ((c.originalEvent.touches ? c.originalEvent.touches[0].pageX : c.pageX) - b.offset().left) / b.width(); d > 0 && a.prop.muted && a.mute(!1), a.volume(d) }, Za = function (a, b, c) { a.$events.off(".thVolume").on({ "thvolumechange.thVolume": function () { Xa(a) }, "thskinchange.thVolume": function () { Xa(a) } }), jQuery(window).off(".thVolume"), b.$volume && b.$volumeDist && (b.$volume.off(".thVolume"), c && b.$volume.on({ "touchmove.thVolume": function (c) { c.preventDefault(), Ya(a, b.$volume, c) }, "mousedown.thVolume": function (c) { c.preventDefault(), 1 === c.which && (ea(a, a.css.scrolling), Ya(a, b.$volume, c), jQuery(window).on({ "mousemove.thVolume": function (c) { Ya(a, b.$volume, c) }, "mouseup.thVolume": function () { jQuery(window).off(".thVolume"), fa(a, a.css.scrolling) } })) } })), P(a, b.$toggler, "toggleVolume"), P(a, b.$down, "volumeChange", [-a.keyBinding.volumeStep]), P(a, b.$up, "volumeChange", [a.keyBinding.volumeStep]) }, $a = function (a, b) { if (b = b || jQuery("
"), Ta) return B(b, D(["volume-controls", "volume-scroll"]), !0).remove(), !1; var c = {}; return c.$toggler = B(b, Wa("toggle")), c.$down = B(b, Wa("down")), c.$up = B(b, Wa("up")), c.$volume = B(b, da("volume")), c.$volumeDist = B(b, da("volumeDist")), c.$volumeDist && O(a, "volumeDist", c.$volumeDist), Za(a, c, !0), c }, _a = { atStart: !0, skip: 5, every: !1 }, ab = function (a) { return r("adverts-" + a) }, bb = function (a) { return C("adverts-" + a) }, cb = function (a, b) { a.controls.$container = B(b, ab("container")), a.controls.$playedDist = B(b, ab("playedDist")), a.controls.$timeLeft = B(b, ab("timeLeft")), a.controls.$timeSkip = B(b, ab("timeSkip")), a.controls.$link = B(b, ab("link")), a.controls.$skip = B(b, bb("skip")), u(a.skipTime) || a.skipTime || !a.controls.$skip || a.controls.$skip.remove(); var c = B(b, ab("skipText")); E(a, a.controls.$skip, "skip", "thAdverts"), c && c.text(a.player.texts.skipAdvert) }, db = function (a) { if (a.player.$events.off(".thAdvertsTrack"), !a.current.noShow) if (u(a.current.every)) { var b = function () { a.player.$events.off("thtimeupdate.thAdvertsTrack").on({ "thtimeupdate.thAdvertsTrack": function () { a.current.mark && !a.player.prop.paused && (a.current.start || (a.current.toShow = a.current.every - ((new Date).getTime() - a.current.mark) / 1e3, (!a.current.toShow||a.current.toShow<0)&&(a.current.toShow=a.current.every,a.player.$events.off("thtimeupdate.thAdvertsTrack"),a.show())))}})};b(),a.player.$events.on({"thadverthide.thAdvertsTrack":function(){a.current.toShow=a.current.every,b()},"thplay.thAdvertsTrack":function(){a.current.mark=(new Date).getTime()-1e3*(a.current.toShow?a.current.every-a.current.toShow:0)},"thplaystart.thAdvertsTrack":function(){a.current.start&&(a.current.start=!1),(!a.current.toShow||a.current.toShow<0)&&(a.current.toShow=a.current.every,a.show())}})}else a.current.atStart&&a.player.$events.on({"thplaystart.thAdvertsTrack":function(){if(a.current.start){if(a.current.start=!1,!a.current.atStart)return;a.show()}}})},eb=function(a){var b=!!a.current.isCustom;a.current.start=!0,a.current.isCustom=!1,a.current.noShow=!1||!!a.player.sourcesCollection.noAdverts,a.current.atStart=a.atStart,a.current.every=a.every,a.sorted=a.defaultSorted;var c=a.player.sourcesCollection.advertsProp;c&&!a.current.noShow&&(a.current.isCustom=!0,a.current.atStart=s(c.atStart)?!0:c.atStart,a.current.every=u(c.every)?c.every:!1,s(c.list)||a.sort("in",c.list)),u(a.current.every)&&(b||a.current.isCustom||s(a.current.toShow))&&(a.current.mark=(new Date).getTime(),a.current.toShow=a.current.atStart?-1:a.current.every)},fb=function(a){eb(a),db(a)},gb=function(a){a.player.$events.off("thAdverts").on({"thskinchange.thAdverts":function(){cb(a,a.player.$wrap),a.visible&&a.current.kind&&a.current.kind.append(a.$container)},"thloadstart.thAdverts":function(){fb(a)},"thtostart.thAdverts":function(){fb(a)},"thtimeupdate.thAdverts":function(){a.visible&&!a.player.prop.paused&&a.player.pause()}})},hb=function(a,b){b&&jQuery.each(b,function(b,c){a.add(c)}),a.player.$wrap.find('advert, [data-role="advert"]').each(function(b,c){var d=jQuery(c);a.add(d),d.remove()})},ib=function(a){var b=Ha(a);return a.data("link")&&(b.link=unescape(a.data("link"))),a.data("excluded")&&(b.excluded="yes"===a.data("excluded")?!0:!1),b},jb=function(a,b){s(b.excluded)||(a.excluded=!!b.excluded),t(b.link)&&(a.link=b.link)},kb=function(a,b){var c=!1;if(!(b instanceof k)){if(b=t(b)?{sources:[{src:b}]}:b,b instanceof jQuery){var d=b;b=ib(d),d.remove()}c=a.items[b.id]?a.items[b.id].update(b):new k(b),jb(c,b)}return a.items[c.id]=c,a.players[c.kind]||(a.players[c.kind]=_[c.kind]()),c},lb=function(a,b,c){b=u(b)?b:ca(a,"time"),a.controls.$playedDist&&a.controls.$playedDist.width(b/a.prop.prcToSec+"%"),a.controls.$timeLeft&&(c=u(c)||ca(a,"duration"),a.controls.$timeLeft.html(G(c-b).replace(/(\d)/g,"$1"))),a.canSkip()?ea(a.player,a.css.skipable):a.controls.$timeSkip&&u(a.skipTime)&&a.controls.$timeSkip.html(G(a.skipTime-b,!0).replace(/(\d)/g,"$1"))},mb=function(a){a.prop.prcToSec=ca(a,"duration")/100,lb(a)},nb=function(a){a.current.kind.off(".thadvsource").on({"loadedmetadata.thadvsource":function(){mb(a)},"durationchange.thadvsource":function(){lb(a)},"timeupdate.thadvsource":function(){lb(a)},"ended.thadvsource":function(){a.hide()}})},ob=function(a,b){a.current.source=b,a.current.kind=a.players[b.kind],a.current.kind.append(a.controls.$container),a.current.kind.setSource(b),nb(a)},pb=function(a){ca(a,"clean"),ca(a,"detach"),ca(a,"off",".thadvsource"),a.current.source=null,a.current.kind=null},qb=function(a,b){pb(a),a.current.collection=b},rb=function(a){a.controls.$link&&(a.atLink=!1,a.controls.$link.off(".thAdvert").removeClass(a.css.hasLink),a.current.collection.link&&a.controls.$link.on("click.thAdvert",function(b){if(b.preventDefault(),a.atLink)return a.atLink=!1,void ca(a,"play");a.atLink=!0,ca(a,"pause");var c=jQuery("").attr({href:a.current.collection.link,target:"_blank"}).hide().appendTo("body");c[0].click(),c.remove(),c=null}).addClass(a.css.hasLink))},sb=function(a,b,c){!c&&a.deferred&&(a.deferred.reject(p.aborted),a.deferred=null),c=c||jQuery.Deferred();var d=a.get(b);if(a.items[b]&&(b=null),d){qb(a,d),rb(a),a.player.$events.trigger("thadvertshow",[a,a.current.collection]);var e=a.current.collection.getAvailable();return a.deferred=c,c.always(function(){a.deferred=null}),e.done(function(b){"pending"===c.state()&&(ob(a,b),c.resolve(p.success))}).fail(function(){"pending"===c.state()&&(b?(c.tries=(c.tries||0)+1,a.current.collection!==a.get(b)&&c.tries0?c[3]:!1}return a},vb={ready:function(a){a.timeout&&(clearTimeout(a.timeout),a.timeout=!1),a.loop(a.props.loop.value),a.volume(a.props.volume.value),a.mute(a.props.muted.value),a.ready=!0,a.paused||a.play(),a.sendMessage("getDuration"),a.sendMessage("addEventListener","loadProgress"),a.sendMessage("addEventListener","playProgress"),a.sendMessage("addEventListener","play"),a.sendMessage("addEventListener","pause"),a.sendMessage("addEventListener","finish"),a.sendMessage("addEventListener","seek"),a.$events.trigger("ready").trigger("canplay")},getDuration:function(a,b){a.duration=parseFloat(b.value),a.$events.trigger("durationchange").trigger("loadedmetadata")},loadProgress:function(a,b){a.duration||(a.duration=parseFloat(b.data.duration));var c=parseFloat(b.data.percent);a.buffered=[[0,c*a.duration]],a.$events.trigger("progress"),1!==c||a.canplaythrough||(a.canplaythrough=!0,a.$events.trigger("canplaythrough"))},playProgress:function(a,b){a.duration||(a.duration=parseFloat(b.data.duration)),a.props.currentTime.value=parseFloat(b.data.seconds),a.$events.trigger("timeupdate")},play:function(a){a.paused=!1,a.$events.trigger("play")},pause:function(a){a.paused=!0,a.$events.trigger("pause")},finish:function(a){a.ended=!0,a.$events.trigger("ended")},seek:function(a,b){a.duration||(a.duration=parseFloat(b.data.duration)),a.props.currentTime.value=parseFloat(b.data.seconds),a.seekedDelay&&(clearTimeout(a.seekedDelay),a.seekedDelay=!1),a.seeking=!0,a.$events.trigger("seeking"),a.seekedDelay=setTimeout(function(){a.seeking=!1,a.$events.trigger("seeked")},500),a.$events.trigger("timeupdate")}},wb=function(a,b){if(!jQuery("#"+a).length)return!1;var c=this;b=b||{},c.id=a,c.$events=jQuery("
"),c.origin=b.origin||"*",c.playerVars=jQuery.extend({badge:1,byline:1,portrait:1,title:1,color:"00adef"},b.playerVars||{}),c.props={loop:{value:!1,method:"setLoop"},volume:{value:1,method:function(a){a=0>a?0:a,a=a>1?1:a,c.props.volume.value=a,c.$events.trigger("volumechange"),c.sendMessage("setVolume",a)}},muted:{value:!1,method:function(a){a?c.sendMessage("setVolume",0):c.sendMessage("setVolume",c.props.volume.value)}},currentTime:{value:0,method:function(a){a=0>a?0:a,a=a>c.duration?c.duration:a,c.props.currentTime.value=a,c.sendMessage("seekTo",a)}},src:{value:null,method:function(b){c.clean(),c.timeout&&(clearTimeout(c.timeout),c.timeout=!1);var d=ub(b),e=["api=1","player_id="+a];return d?(e.push("badge="+c.playerVars.badge),e.push("byline="+c.playerVars.byline),e.push("portrait="+c.playerVars.portrait),e.push("title="+c.playerVars.title),e.push("color="+c.playerVars.color),c.props.src.value="https://player.vimeo.com/video/"+d+"?"+e.join("&"),c.$el.attr("src",c.props.src.value),c.timeout=setTimeout(function(){c.clean(),c.$events.trigger("error")},5e3),void c.$events.trigger("loadstart")):void c.$events.trigger("error")}}},jQuery(window).on("message."+a,function(a){var b=a.originalEvent;if(/^(?:https|http)?:\/\/player.vimeo.com/.test(b.origin)){"*"===c.origin&&(c.origin=b.origin);var d=JSON.parse(b.data);if(d.player_id===c.id){var e=d.method||d.event;vb[e]&&vb[e](c,d,a)}}}),b.height&&(c.height=b.height),b.width&&(c.width=b.width),c.$el=jQuery('').attr({width:c.width,height:c.height});var d=jQuery("#"+a);c.$el.insertBefore(d).attr("id",a),d.remove(),d=null,b.videoId&&c.src(b.videoId)};wb.prototype={height:"100%",width:"100%",buffered:!1,duration:0,ended:!1,paused:!0,seeking:!1,playbackRate:1,ready:!1,seekedDelay:!1,sendMessage:function(a,b){var c={method:a};return s(b)||(c.value=b),this.$el[0].contentWindow.postMessage(c,this.origin),this},prop:function(a,b){return this.props[a]?s(b)?this.props[a].value:(this.props[a].value=b,t(this.props[a].method)?this.sendMessage(this.props[a].method,b):v(this.props[a].method)&&this.props[a].method(b),this):this},src:function(a){return this.prop("src",a)},loop:function(a){return this.prop("loop",!!a)},volume:function(a){return this.prop("volume",a)},mute:function(a){return this.prop("muted",!!a)},currentTime:function(a){return this.prop("currentTime",a)},play:function(){return this.paused=!1,this.sendMessage("play"),this},pause:function(){return this.paused=!0,this.sendMessage("pause"),this},clean:function(){this.$el.attr("src","about:blank"),this.seekedDelay&&(clearTimeout(this.seekedDelay),this.seekedDelay=!1),this.buffered=!1,this.duration=0,this.ended=!1,this.paused=!0,this.seeking=!1,this.playbackRate=1,this.ready=!1,this.props.currentTime.value=0,this.props.src.value=null},on:function(){return this.$events.on.apply(this.$events,arguments),this},off:function(){return this.$events.off.apply(this.$events,arguments),this},remove:function(){jQuery(window).off("message."+this.id),this.$events.remove(),this.$events=null,this.$el&&this.$el.remove()},detach:function(){return this.$el.detach(),this},appendTo:function(a){return this.$el.appendTo(a),this}};var xb=!1,yb=function(a,b,c,d){a=a||jQuery("
").css({visibility:"hidden",position:"absolute",top:"0",left:"0"}).appendTo("body"),c=c||"vm-"+H();var e=ub(b);return e?(jQuery("#"+c).length||jQuery("
").attr("id",c).appendTo(a),new wb(c,{height:"100%",width:"100%",videoId:e,playerVars:d})):!1},zb=function(a){a.available=!1;var b=new jQuery.Deferred,c=yb(!1,a.src),d=function(){var a=c.$el.parent();c.remove(),a.remove()};return c.on({ready:function(){a.available=!0,a.needsCheck=!1},loadedmetadata:function(){a.duration=c.duration,b.resolve(a),d()},error:function(){d(),a.needsCheck=!1,"pending"===b.state()&&b.reject(p.error)}}),b},Ab=function(a){this.id="wm-"+H();var b=jQuery("
").appendTo("body").append(jQuery("
").attr("id",this.id));this.player=new wb(this.id),this.player.detach(),b.remove(),this.controls(a?a.controls:null,a),this.originalProp=jQuery.extend({},this.currentProp)};Ab.prototype={originalProp:!1,currentProp:!1,getProperties:function(){return this.currentProp},controls:function(a,b){var c=this;return c.currentProp=jQuery.extend({controls:!0,badge:1,byline:1,portrait:1,title:1,color:"00adef"},c.originalProp||{}),w(a)&&(c.currentProp.controls=a),b&&jQuery.each(["badge","byline","portrait","title","color"],function(a,d){s(b[d])||(c.currentProp[d]=b[d])}),c},hasControls:function(){return!!this.currentProp.controls},coreMethod:function(a,b){return s(b)?this.player[a]():(this.player[a](b),this)},isReady:function(){return this.player.ready},hasSource:function(){return this.player.src()},canSeek:function(){return this.isReady()&&this.duration()},clean:function(){return this.player.clean(),this},setSource:function(a){var b=this;return a?(a instanceof i?(b.player.playerVars=b.getProperties(),b.player.src(a.src)):jQuery.foreach(a,function(a,c){return c instanceof i?(b.player.playerVars=b.getProperties(),b.player.src(c.src),!1):void 0}),b):b},ended:function(){return this.player.ended},volume:function(a){return this.coreMethod("volume",a)},mute:function(a){return this.coreMethod("mute",a)},time:function(a){return this.coreMethod("currentTime",a)},buffered:function(){return this.player.buffered},duration:function(){return this.player.duration},loop:function(a){return this.coreMethod("loop",a)},play:function(a){return s(a)||this.coreMethod("currentTime",a),this.player.play(),this},pause:function(){return this.player.pause(),this},detach:function(){return this.player.detach(),this},append:function(a){return this.player.appendTo(a),this},on:function(){return this.player.on.apply(this.player,arguments),this},off:function(){return this.player.off.apply(this.player,arguments),this},canPlayType:function(){return!0},check:function(a,b){if(b)return zb(a);var c=jQuery.Deferred(),d=null;return jQuery.when(xb).always(function(){"pending"===c.state()&&(d=zb(a),d.then(function(a){"pending"===c.state()&&c.resolve(a)},function(a){"pending"===c.state()&&c.reject(a)}))}),c.always(function(){d&&"pending"===d.state()&&d.reject(p.aborted),d=null}),xb=c,c}},_.vimeo=function(a,b){return new Ab(b)},aa.vimeo=Ab;var Bb={ended:0,playing:1,paused:2,buffering:3},Cb=!0,Db=!1,Eb=!1,Fb=function(a){if(11===a.length)return a;var b=/.*(?:youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=)([^#\&\?]*).*/,c=a.match(b);return c&&11===c[1].length?c[1]:!1},Gb=function(a,b,c,d){a=a||jQuery("
").css({visibility:"hidden",position:"absolute",top:"-400px",left:"-600px"}).appendTo("body"),c=c||"ut-"+H();var e=jQuery.Deferred(),f=Fb(b);return f?(Db.done(function(){if("pending"===e.state()){jQuery("#"+c).length||jQuery("
").attr("id",c).appendTo(a);var b=new YT.Player(c,{height:"100%",width:"100%",videoId:f,playerVars:d});e.resolve(c,b,a)}}).fail(function(){"pending"===e.state()&&e.reject(p.error)}),e):e.reject(p.error)},Hb=function(a){var b=new jQuery.Deferred;return Gb(!1,a.src).done(function(c,d,e){d.addEventListener("onReady",function(){a.available=!0,a.duration=d.getDuration(),a.needsCheck=!1,"pending"===b.state()&&b.resolve(a)}),d.addEventListener("onError",function(){a.needsCheck=!1,a.available=!1,"pending"===b.state()&&b.reject(p.error)}),b.always(function(){d.removeEventListener("onReady"),d.removeEventListener("onError"),d.stopVideo(),e.remove(),e=d=null})}).fail(function(){"pending"===b.state()&&b.reject(p.error)}),b},Ib=function(a){if(this.id="ut-"+H(),this.controls(a?a.controls:null,a),this.originalProp=jQuery.extend({},this.currentProp),this.$events=jQuery("
"),Cb){Cb=!1,Db=jQuery.Deferred();var b="https://www.youtube.com/iframe_api",c=!1;"undefined"!=typeof onYouTubeIframeAPIReady&&(c=onYouTubeIframeAPIReady),onYouTubeIframeAPIReady=function(){c&&c(),Db.resolve(p.success)},jQuery('script[src="'+b+'"]').length||jQuery("