").attr({ id: i, role: "tooltip" }).addClass("ui-tooltip ui-widget ui-corner-all ui-widget-content " + (this.options.tooltipClass || "")); return t("
").addClass("ui-tooltip-content").appendTo(n), n.appendTo(this.document[0].body), this.tooltips[i] = e, n }, _find: function (e) { var i = e.data("ui-tooltip-id"); return i ? t("#" + i) : t() }, _removeTooltip: function (t) { t.remove(), delete this.tooltips[t.attr("id")] }, _destroy: function () { var e = this; t.each(this.tooltips, function (i, s) { var n = t.Event("blur"); n.target = n.currentTarget = s[0], e.close(n, !0), t("#" + i).remove(), s.data("ui-tooltip-title") && (s.attr("title", s.data("ui-tooltip-title")), s.removeData("ui-tooltip-title")) }) } }) })(jQuery); (function (t, e) { var i = "ui-effects-"; t.effects = { effect: {} }, function (t, e) { function i(t, e, i) { var s = u[e.type] || {}; return null == t ? i || !e.def ? null : e.def : (t = s.floor ? ~~t : parseFloat(t), isNaN(t) ? e.def : s.mod ? (t + s.mod) % s.mod : 0 > t ? 0 : t > s.max ? s.max : t) } function s(i) { var s = h(), n = s._rgba = []; return i = i.toLowerCase(), f(l, function (t, a) { var o, r = a.re.exec(i), l = r && a.parse(r), h = a.space || "rgba"; return l ? (o = s[h](l), s[c[h].cache] = o[c[h].cache], n = s._rgba = o._rgba, !1) : e }), n.length ? ("0,0,0,0" === n.join() && t.extend(n, a.transparent), s) : a[i] } function n(t, e, i) { return i = (i + 1) % 1, 1 > 6 * i ? t + 6 * (e - t) * i : 1 > 2 * i ? e : 2 > 3 * i ? t + 6 * (e - t) * (2 / 3 - i) : t } var a, o = "backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor", r = /^([\-+])=\s*(\d+\.?\d*)/, l = [{ re: /rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/, parse: function (t) { return [t[1], t[2], t[3], t[4]] } }, { re: /rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/, parse: function (t) { return [2.55 * t[1], 2.55 * t[2], 2.55 * t[3], t[4]] } }, { re: /#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/, parse: function (t) { return [parseInt(t[1], 16), parseInt(t[2], 16), parseInt(t[3], 16)] } }, { re: /#([a-f0-9])([a-f0-9])([a-f0-9])/, parse: function (t) { return [parseInt(t[1] + t[1], 16), parseInt(t[2] + t[2], 16), parseInt(t[3] + t[3], 16)] } }, { re: /hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/, space: "hsla", parse: function (t) { return [t[1], t[2] / 100, t[3] / 100, t[4]] } }], h = t.Color = function (e, i, s, n) { return new t.Color.fn.parse(e, i, s, n) }, c = { rgba: { props: { red: { idx: 0, type: "byte" }, green: { idx: 1, type: "byte" }, blue: { idx: 2, type: "byte" } } }, hsla: { props: { hue: { idx: 0, type: "degrees" }, saturation: { idx: 1, type: "percent" }, lightness: { idx: 2, type: "percent" } } } }, u = { "byte": { floor: !0, max: 255 }, percent: { max: 1 }, degrees: { mod: 360, floor: !0 } }, d = h.support = {}, p = t("
")[0], f = t.each; p.style.cssText = "background-color:rgba(1,1,1,.5)", d.rgba = p.style.backgroundColor.indexOf("rgba") > -1, f(c, function (t, e) { e.cache = "_" + t, e.props.alpha = { idx: 3, type: "percent", def: 1 } }), h.fn = t.extend(h.prototype, { parse: function (n, o, r, l) { if (n === e) return this._rgba = [null, null, null, null], this; (n.jquery || n.nodeType) && (n = t(n).css(o), o = e); var u = this, d = t.type(n), p = this._rgba = []; return o !== e && (n = [n, o, r, l], d = "array"), "string" === d ? this.parse(s(n) || a._default) : "array" === d ? (f(c.rgba.props, function (t, e) { p[e.idx] = i(n[e.idx], e) }), this) : "object" === d ? (n instanceof h ? f(c, function (t, e) { n[e.cache] && (u[e.cache] = n[e.cache].slice()) }) : f(c, function (e, s) { var a = s.cache; f(s.props, function (t, e) { if (!u[a] && s.to) { if ("alpha" === t || null == n[t]) return; u[a] = s.to(u._rgba) } u[a][e.idx] = i(n[t], e, !0) }), u[a] && 0 > t.inArray(null, u[a].slice(0, 3)) && (u[a][3] = 1, s.from && (u._rgba = s.from(u[a]))) }), this) : e }, is: function (t) { var i = h(t), s = !0, n = this; return f(c, function (t, a) { var o, r = i[a.cache]; return r && (o = n[a.cache] || a.to && a.to(n._rgba) || [], f(a.props, function (t, i) { return null != r[i.idx] ? s = r[i.idx] === o[i.idx] : e })), s }), s }, _space: function () { var t = [], e = this; return f(c, function (i, s) { e[s.cache] && t.push(i) }), t.pop() }, transition: function (t, e) { var s = h(t), n = s._space(), a = c[n], o = 0 === this.alpha() ? h("transparent") : this, r = o[a.cache] || a.to(o._rgba), l = r.slice(); return s = s[a.cache], f(a.props, function (t, n) { var a = n.idx, o = r[a], h = s[a], c = u[n.type] || {}; null !== h && (null === o ? l[a] = h : (c.mod && (h - o > c.mod / 2 ? o += c.mod : o - h > c.mod / 2 && (o -= c.mod)), l[a] = i((h - o) * e + o, n))) }), this[n](l) }, blend: function (e) { if (1 === this._rgba[3]) return this; var i = this._rgba.slice(), s = i.pop(), n = h(e)._rgba; return h(t.map(i, function (t, e) { return (1 - s) * n[e] + s * t })) }, toRgbaString: function () { var e = "rgba(", i = t.map(this._rgba, function (t, e) { return null == t ? e > 2 ? 1 : 0 : t }); return 1 === i[3] && (i.pop(), e = "rgb("), e + i.join() + ")" }, toHslaString: function () { var e = "hsla(", i = t.map(this.hsla(), function (t, e) { return null == t && (t = e > 2 ? 1 : 0), e && 3 > e && (t = Math.round(100 * t) + "%"), t }); return 1 === i[3] && (i.pop(), e = "hsl("), e + i.join() + ")" }, toHexString: function (e) { var i = this._rgba.slice(), s = i.pop(); return e && i.push(~~(255 * s)), "#" + t.map(i, function (t) { return t = (t || 0).toString(16), 1 === t.length ? "0" + t : t }).join("") }, toString: function () { return 0 === this._rgba[3] ? "transparent" : this.toRgbaString() } }), h.fn.parse.prototype = h.fn, c.hsla.to = function (t) { if (null == t[0] || null == t[1] || null == t[2]) return [null, null, null, t[3]]; var e, i, s = t[0] / 255, n = t[1] / 255, a = t[2] / 255, o = t[3], r = Math.max(s, n, a), l = Math.min(s, n, a), h = r - l, c = r + l, u = .5 * c; return e = l === r ? 0 : s === r ? 60 * (n - a) / h + 360 : n === r ? 60 * (a - s) / h + 120 : 60 * (s - n) / h + 240, i = 0 === h ? 0 : .5 >= u ? h / c : h / (2 - c), [Math.round(e) % 360, i, u, null == o ? 1 : o] }, c.hsla.from = function (t) { if (null == t[0] || null == t[1] || null == t[2]) return [null, null, null, t[3]]; var e = t[0] / 360, i = t[1], s = t[2], a = t[3], o = .5 >= s ? s * (1 + i) : s + i - s * i, r = 2 * s - o; return [Math.round(255 * n(r, o, e + 1 / 3)), Math.round(255 * n(r, o, e)), Math.round(255 * n(r, o, e - 1 / 3)), a] }, f(c, function (s, n) { var a = n.props, o = n.cache, l = n.to, c = n.from; h.fn[s] = function (s) { if (l && !this[o] && (this[o] = l(this._rgba)), s === e) return this[o].slice(); var n, r = t.type(s), u = "array" === r || "object" === r ? s : arguments, d = this[o].slice(); return f(a, function (t, e) { var s = u["object" === r ? t : e.idx]; null == s && (s = d[e.idx]), d[e.idx] = i(s, e) }), c ? (n = h(c(d)), n[o] = d, n) : h(d) }, f(a, function (e, i) { h.fn[e] || (h.fn[e] = function (n) { var a, o = t.type(n), l = "alpha" === e ? this._hsla ? "hsla" : "rgba" : s, h = this[l](), c = h[i.idx]; return "undefined" === o ? c : ("function" === o && (n = n.call(this, c), o = t.type(n)), null == n && i.empty ? this : ("string" === o && (a = r.exec(n), a && (n = c + parseFloat(a[2]) * ("+" === a[1] ? 1 : -1))), h[i.idx] = n, this[l](h))) }) }) }), h.hook = function (e) { var i = e.split(" "); f(i, function (e, i) { t.cssHooks[i] = { set: function (e, n) { var a, o, r = ""; if ("transparent" !== n && ("string" !== t.type(n) || (a = s(n)))) { if (n = h(a || n), !d.rgba && 1 !== n._rgba[3]) { for (o = "backgroundColor" === i ? e.parentNode : e; ("" === r || "transparent" === r) && o && o.style;) try { r = t.css(o, "backgroundColor"), o = o.parentNode } catch (l) { } n = n.blend(r && "transparent" !== r ? r : "_default") } n = n.toRgbaString() } try { e.style[i] = n } catch (l) { } } }, t.fx.step[i] = function (e) { e.colorInit || (e.start = h(e.elem, i), e.end = h(e.end), e.colorInit = !0), t.cssHooks[i].set(e.elem, e.start.transition(e.end, e.pos)) } }) }, h.hook(o), t.cssHooks.borderColor = { expand: function (t) { var e = {}; return f(["Top", "Right", "Bottom", "Left"], function (i, s) { e["border" + s + "Color"] = t }), e } }, a = t.Color.names = { aqua: "#00ffff", black: "#000000", blue: "#0000ff", fuchsia: "#ff00ff", gray: "#808080", green: "#008000", lime: "#00ff00", maroon: "#800000", navy: "#000080", olive: "#808000", purple: "#800080", red: "#ff0000", silver: "#c0c0c0", teal: "#008080", white: "#ffffff", yellow: "#ffff00", transparent: [null, null, null, 0], _default: "#ffffff" } }(jQuery), function () { function i(e) { var i, s, n = e.ownerDocument.defaultView ? e.ownerDocument.defaultView.getComputedStyle(e, null) : e.currentStyle, a = {}; if (n && n.length && n[0] && n[n[0]]) for (s = n.length; s--;) i = n[s], "string" == typeof n[i] && (a[t.camelCase(i)] = n[i]); else for (i in n) "string" == typeof n[i] && (a[i] = n[i]); return a } function s(e, i) { var s, n, o = {}; for (s in i) n = i[s], e[s] !== n && (a[s] || (t.fx.step[s] || !isNaN(parseFloat(n))) && (o[s] = n)); return o } var n = ["add", "remove", "toggle"], a = { border: 1, borderBottom: 1, borderColor: 1, borderLeft: 1, borderRight: 1, borderTop: 1, borderWidth: 1, margin: 1, padding: 1 }; t.each(["borderLeftStyle", "borderRightStyle", "borderBottomStyle", "borderTopStyle"], function (e, i) { t.fx.step[i] = function (t) { ("none" !== t.end && !t.setAttr || 1 === t.pos && !t.setAttr) && (jQuery.style(t.elem, i, t.end), t.setAttr = !0) } }), t.fn.addBack || (t.fn.addBack = function (t) { return this.add(null == t ? this.prevObject : this.prevObject.filter(t)) }), t.effects.animateClass = function (e, a, o, r) { var l = t.speed(a, o, r); return this.queue(function () { var a, o = t(this), r = o.attr("class") || "", h = l.children ? o.find("*").addBack() : o; h = h.map(function () { var e = t(this); return { el: e, start: i(this) } }), a = function () { t.each(n, function (t, i) { e[i] && o[i + "Class"](e[i]) }) }, a(), h = h.map(function () { return this.end = i(this.el[0]), this.diff = s(this.start, this.end), this }), o.attr("class", r), h = h.map(function () { var e = this, i = t.Deferred(), s = t.extend({}, l, { queue: !1, complete: function () { i.resolve(e) } }); return this.el.animate(this.diff, s), i.promise() }), t.when.apply(t, h.get()).done(function () { a(), t.each(arguments, function () { var e = this.el; t.each(this.diff, function (t) { e.css(t, "") }) }), l.complete.call(o[0]) }) }) }, t.fn.extend({ addClass: function (e) { return function (i, s, n, a) { return s ? t.effects.animateClass.call(this, { add: i }, s, n, a) : e.apply(this, arguments) } }(t.fn.addClass), removeClass: function (e) { return function (i, s, n, a) { return arguments.length > 1 ? t.effects.animateClass.call(this, { remove: i }, s, n, a) : e.apply(this, arguments) } }(t.fn.removeClass), toggleClass: function (i) { return function (s, n, a, o, r) { return "boolean" == typeof n || n === e ? a ? t.effects.animateClass.call(this, n ? { add: s } : { remove: s }, a, o, r) : i.apply(this, arguments) : t.effects.animateClass.call(this, { toggle: s }, n, a, o) } }(t.fn.toggleClass), switchClass: function (e, i, s, n, a) { return t.effects.animateClass.call(this, { add: i, remove: e }, s, n, a) } }) }(), function () { function s(e, i, s, n) { return t.isPlainObject(e) && (i = e, e = e.effect), e = { effect: e }, null == i && (i = {}), t.isFunction(i) && (n = i, s = null, i = {}), ("number" == typeof i || t.fx.speeds[i]) && (n = s, s = i, i = {}), t.isFunction(s) && (n = s, s = null), i && t.extend(e, i), s = s || i.duration, e.duration = t.fx.off ? 0 : "number" == typeof s ? s : s in t.fx.speeds ? t.fx.speeds[s] : t.fx.speeds._default, e.complete = n || i.complete, e } function n(e) { return !e || "number" == typeof e || t.fx.speeds[e] ? !0 : "string" != typeof e || t.effects.effect[e] ? t.isFunction(e) ? !0 : "object" != typeof e || e.effect ? !1 : !0 : !0 } t.extend(t.effects, { version: "1.10.4", save: function (t, e) { for (var s = 0; e.length > s; s++) null !== e[s] && t.data(i + e[s], t[0].style[e[s]]) }, restore: function (t, s) { var n, a; for (a = 0; s.length > a; a++) null !== s[a] && (n = t.data(i + s[a]), n === e && (n = ""), t.css(s[a], n)) }, setMode: function (t, e) { return "toggle" === e && (e = t.is(":hidden") ? "show" : "hide"), e }, getBaseline: function (t, e) { var i, s; switch (t[0]) { case "top": i = 0; break; case "middle": i = .5; break; case "bottom": i = 1; break; default: i = t[0] / e.height } switch (t[1]) { case "left": s = 0; break; case "center": s = .5; break; case "right": s = 1; break; default: s = t[1] / e.width } return { x: s, y: i } }, createWrapper: function (e) { if (e.parent().is(".ui-effects-wrapper")) return e.parent(); var i = { width: e.outerWidth(!0), height: e.outerHeight(!0), "float": e.css("float") }, s = t("
").addClass("ui-effects-wrapper").css({ fontSize: "100%", background: "transparent", border: "none", margin: 0, padding: 0 }), n = { width: e.width(), height: e.height() }, a = document.activeElement; try { a.id } catch (o) { a = document.body } return e.wrap(s), (e[0] === a || t.contains(e[0], a)) && t(a).focus(), s = e.parent(), "static" === e.css("position") ? (s.css({ position: "relative" }), e.css({ position: "relative" })) : (t.extend(i, { position: e.css("position"), zIndex: e.css("z-index") }), t.each(["top", "left", "bottom", "right"], function (t, s) { i[s] = e.css(s), isNaN(parseInt(i[s], 10)) && (i[s] = "auto") }), e.css({ position: "relative", top: 0, left: 0, right: "auto", bottom: "auto" })), e.css(n), s.css(i).show() }, removeWrapper: function (e) { var i = document.activeElement; return e.parent().is(".ui-effects-wrapper") && (e.parent().replaceWith(e), (e[0] === i || t.contains(e[0], i)) && t(i).focus()), e }, setTransition: function (e, i, s, n) { return n = n || {}, t.each(i, function (t, i) { var a = e.cssUnit(i); a[0] > 0 && (n[i] = a[0] * s + a[1]) }), n } }), t.fn.extend({ effect: function () { function e(e) { function s() { t.isFunction(a) && a.call(n[0]), t.isFunction(e) && e() } var n = t(this), a = i.complete, r = i.mode; (n.is(":hidden") ? "hide" === r : "show" === r) ? (n[r](), s()) : o.call(n[0], i, s) } var i = s.apply(this, arguments), n = i.mode, a = i.queue, o = t.effects.effect[i.effect]; return t.fx.off || !o ? n ? this[n](i.duration, i.complete) : this.each(function () { i.complete && i.complete.call(this) }) : a === !1 ? this.each(e) : this.queue(a || "fx", e) }, show: function (t) { return function (e) { if (n(e)) return t.apply(this, arguments); var i = s.apply(this, arguments); return i.mode = "show", this.effect.call(this, i) } }(t.fn.show), hide: function (t) { return function (e) { if (n(e)) return t.apply(this, arguments); var i = s.apply(this, arguments); return i.mode = "hide", this.effect.call(this, i) } }(t.fn.hide), toggle: function (t) { return function (e) { if (n(e) || "boolean" == typeof e) return t.apply(this, arguments); var i = s.apply(this, arguments); return i.mode = "toggle", this.effect.call(this, i) } }(t.fn.toggle), cssUnit: function (e) { var i = this.css(e), s = []; return t.each(["em", "px", "%", "pt"], function (t, e) { i.indexOf(e) > 0 && (s = [parseFloat(i), e]) }), s } }) }(), function () { var e = {}; t.each(["Quad", "Cubic", "Quart", "Quint", "Expo"], function (t, i) { e[i] = function (e) { return Math.pow(e, t + 2) } }), t.extend(e, { Sine: function (t) { return 1 - Math.cos(t * Math.PI / 2) }, Circ: function (t) { return 1 - Math.sqrt(1 - t * t) }, Elastic: function (t) { return 0 === t || 1 === t ? t : -Math.pow(2, 8 * (t - 1)) * Math.sin((80 * (t - 1) - 7.5) * Math.PI / 15) }, Back: function (t) { return t * t * (3 * t - 2) }, Bounce: function (t) { for (var e, i = 4; ((e = Math.pow(2, --i)) - 1) / 11 > t;); return 1 / Math.pow(4, 3 - i) - 7.5625 * Math.pow((3 * e - 2) / 22 - t, 2) } }), t.each(e, function (e, i) { t.easing["easeIn" + e] = i, t.easing["easeOut" + e] = function (t) { return 1 - i(1 - t) }, t.easing["easeInOut" + e] = function (t) { return .5 > t ? i(2 * t) / 2 : 1 - i(-2 * t + 2) / 2 } }) }() })(jQuery); (function (t) { var e = /up|down|vertical/, i = /up|left|vertical|horizontal/; t.effects.effect.blind = function (s, n) { var a, o, r, l = t(this), h = ["position", "top", "bottom", "left", "right", "height", "width"], c = t.effects.setMode(l, s.mode || "hide"), u = s.direction || "up", d = e.test(u), p = d ? "height" : "width", f = d ? "top" : "left", g = i.test(u), m = {}, v = "show" === c; l.parent().is(".ui-effects-wrapper") ? t.effects.save(l.parent(), h) : t.effects.save(l, h), l.show(), a = t.effects.createWrapper(l).css({ overflow: "hidden" }), o = a[p](), r = parseFloat(a.css(f)) || 0, m[p] = v ? o : 0, g || (l.css(d ? "bottom" : "right", 0).css(d ? "top" : "left", "auto").css({ position: "absolute" }), m[f] = v ? r : o + r), v && (a.css(p, 0), g || a.css(f, r + o)), a.animate(m, { duration: s.duration, easing: s.easing, queue: !1, complete: function () { "hide" === c && l.hide(), t.effects.restore(l, h), t.effects.removeWrapper(l), n() } }) } })(jQuery); (function (t) { t.effects.effect.bounce = function (e, i) { var s, n, a, o = t(this), r = ["position", "top", "bottom", "left", "right", "height", "width"], l = t.effects.setMode(o, e.mode || "effect"), h = "hide" === l, c = "show" === l, u = e.direction || "up", d = e.distance, p = e.times || 5, f = 2 * p + (c || h ? 1 : 0), g = e.duration / f, m = e.easing, v = "up" === u || "down" === u ? "top" : "left", _ = "up" === u || "left" === u, b = o.queue(), y = b.length; for ((c || h) && r.push("opacity"), t.effects.save(o, r), o.show(), t.effects.createWrapper(o), d || (d = o["top" === v ? "outerHeight" : "outerWidth"]() / 3), c && (a = { opacity: 1 }, a[v] = 0, o.css("opacity", 0).css(v, _ ? 2 * -d : 2 * d).animate(a, g, m)), h && (d /= Math.pow(2, p - 1)), a = {}, a[v] = 0, s = 0; p > s; s++) n = {}, n[v] = (_ ? "-=" : "+=") + d, o.animate(n, g, m).animate(a, g, m), d = h ? 2 * d : d / 2; h && (n = { opacity: 0 }, n[v] = (_ ? "-=" : "+=") + d, o.animate(n, g, m)), o.queue(function () { h && o.hide(), t.effects.restore(o, r), t.effects.removeWrapper(o), i() }), y > 1 && b.splice.apply(b, [1, 0].concat(b.splice(y, f + 1))), o.dequeue() } })(jQuery); (function (t) { t.effects.effect.clip = function (e, i) { var s, n, a, o = t(this), r = ["position", "top", "bottom", "left", "right", "height", "width"], l = t.effects.setMode(o, e.mode || "hide"), h = "show" === l, c = e.direction || "vertical", u = "vertical" === c, d = u ? "height" : "width", p = u ? "top" : "left", f = {}; t.effects.save(o, r), o.show(), s = t.effects.createWrapper(o).css({ overflow: "hidden" }), n = "IMG" === o[0].tagName ? s : o, a = n[d](), h && (n.css(d, 0), n.css(p, a / 2)), f[d] = h ? a : 0, f[p] = h ? 0 : a / 2, n.animate(f, { queue: !1, duration: e.duration, easing: e.easing, complete: function () { h || o.hide(), t.effects.restore(o, r), t.effects.removeWrapper(o), i() } }) } })(jQuery); (function (t) { t.effects.effect.drop = function (e, i) { var s, n = t(this), a = ["position", "top", "bottom", "left", "right", "opacity", "height", "width"], o = t.effects.setMode(n, e.mode || "hide"), r = "show" === o, l = e.direction || "left", h = "up" === l || "down" === l ? "top" : "left", c = "up" === l || "left" === l ? "pos" : "neg", u = { opacity: r ? 1 : 0 }; t.effects.save(n, a), n.show(), t.effects.createWrapper(n), s = e.distance || n["top" === h ? "outerHeight" : "outerWidth"](!0) / 2, r && n.css("opacity", 0).css(h, "pos" === c ? -s : s), u[h] = (r ? "pos" === c ? "+=" : "-=" : "pos" === c ? "-=" : "+=") + s, n.animate(u, { queue: !1, duration: e.duration, easing: e.easing, complete: function () { "hide" === o && n.hide(), t.effects.restore(n, a), t.effects.removeWrapper(n), i() } }) } })(jQuery); (function (t) { t.effects.effect.explode = function (e, i) { function s() { b.push(this), b.length === u * d && n() } function n() { p.css({ visibility: "visible" }), t(b).remove(), g || p.hide(), i() } var a, o, r, l, h, c, u = e.pieces ? Math.round(Math.sqrt(e.pieces)) : 3, d = u, p = t(this), f = t.effects.setMode(p, e.mode || "hide"), g = "show" === f, m = p.show().css("visibility", "hidden").offset(), v = Math.ceil(p.outerWidth() / d), _ = Math.ceil(p.outerHeight() / u), b = []; for (a = 0; u > a; a++) for (l = m.top + a * _, c = a - (u - 1) / 2, o = 0; d > o; o++) r = m.left + o * v, h = o - (d - 1) / 2, p.clone().appendTo("body").wrap("
").css({ position: "absolute", visibility: "visible", left: -o * v, top: -a * _ }).parent().addClass("ui-effects-explode").css({ position: "absolute", overflow: "hidden", width: v, height: _, left: r + (g ? h * v : 0), top: l + (g ? c * _ : 0), opacity: g ? 0 : 1 }).animate({ left: r + (g ? 0 : h * v), top: l + (g ? 0 : c * _), opacity: g ? 1 : 0 }, e.duration || 500, e.easing, s) } })(jQuery); (function (t) { t.effects.effect.fade = function (e, i) { var s = t(this), n = t.effects.setMode(s, e.mode || "toggle"); s.animate({ opacity: n }, { queue: !1, duration: e.duration, easing: e.easing, complete: i }) } })(jQuery); (function (t) { t.effects.effect.fold = function (e, i) { var s, n, a = t(this), o = ["position", "top", "bottom", "left", "right", "height", "width"], r = t.effects.setMode(a, e.mode || "hide"), l = "show" === r, h = "hide" === r, c = e.size || 15, u = /([0-9]+)%/.exec(c), d = !!e.horizFirst, p = l !== d, f = p ? ["width", "height"] : ["height", "width"], g = e.duration / 2, m = {}, v = {}; t.effects.save(a, o), a.show(), s = t.effects.createWrapper(a).css({ overflow: "hidden" }), n = p ? [s.width(), s.height()] : [s.height(), s.width()], u && (c = parseInt(u[1], 10) / 100 * n[h ? 0 : 1]), l && s.css(d ? { height: 0, width: c } : { height: c, width: 0 }), m[f[0]] = l ? n[0] : c, v[f[1]] = l ? n[1] : 0, s.animate(m, g, e.easing).animate(v, g, e.easing, function () { h && a.hide(), t.effects.restore(a, o), t.effects.removeWrapper(a), i() }) } })(jQuery); (function (t) { t.effects.effect.highlight = function (e, i) { var s = t(this), n = ["backgroundImage", "backgroundColor", "opacity"], a = t.effects.setMode(s, e.mode || "show"), o = { backgroundColor: s.css("backgroundColor") }; "hide" === a && (o.opacity = 0), t.effects.save(s, n), s.show().css({ backgroundImage: "none", backgroundColor: e.color || "#ffff99" }).animate(o, { queue: !1, duration: e.duration, easing: e.easing, complete: function () { "hide" === a && s.hide(), t.effects.restore(s, n), i() } }) } })(jQuery); (function (t) { t.effects.effect.pulsate = function (e, i) { var s, n = t(this), a = t.effects.setMode(n, e.mode || "show"), o = "show" === a, r = "hide" === a, l = o || "hide" === a, h = 2 * (e.times || 5) + (l ? 1 : 0), c = e.duration / h, u = 0, d = n.queue(), p = d.length; for ((o || !n.is(":visible")) && (n.css("opacity", 0).show(), u = 1), s = 1; h > s; s++) n.animate({ opacity: u }, c, e.easing), u = 1 - u; n.animate({ opacity: u }, c, e.easing), n.queue(function () { r && n.hide(), i() }), p > 1 && d.splice.apply(d, [1, 0].concat(d.splice(p, h + 1))), n.dequeue() } })(jQuery); (function (t) { t.effects.effect.puff = function (e, i) { var s = t(this), n = t.effects.setMode(s, e.mode || "hide"), a = "hide" === n, o = parseInt(e.percent, 10) || 150, r = o / 100, l = { height: s.height(), width: s.width(), outerHeight: s.outerHeight(), outerWidth: s.outerWidth() }; t.extend(e, { effect: "scale", queue: !1, fade: !0, mode: n, complete: i, percent: a ? o : 100, from: a ? l : { height: l.height * r, width: l.width * r, outerHeight: l.outerHeight * r, outerWidth: l.outerWidth * r } }), s.effect(e) }, t.effects.effect.scale = function (e, i) { var s = t(this), n = t.extend(!0, {}, e), a = t.effects.setMode(s, e.mode || "effect"), o = parseInt(e.percent, 10) || (0 === parseInt(e.percent, 10) ? 0 : "hide" === a ? 0 : 100), r = e.direction || "both", l = e.origin, h = { height: s.height(), width: s.width(), outerHeight: s.outerHeight(), outerWidth: s.outerWidth() }, c = { y: "horizontal" !== r ? o / 100 : 1, x: "vertical" !== r ? o / 100 : 1 }; n.effect = "size", n.queue = !1, n.complete = i, "effect" !== a && (n.origin = l || ["middle", "center"], n.restore = !0), n.from = e.from || ("show" === a ? { height: 0, width: 0, outerHeight: 0, outerWidth: 0 } : h), n.to = { height: h.height * c.y, width: h.width * c.x, outerHeight: h.outerHeight * c.y, outerWidth: h.outerWidth * c.x }, n.fade && ("show" === a && (n.from.opacity = 0, n.to.opacity = 1), "hide" === a && (n.from.opacity = 1, n.to.opacity = 0)), s.effect(n) }, t.effects.effect.size = function (e, i) { var s, n, a, o = t(this), r = ["position", "top", "bottom", "left", "right", "width", "height", "overflow", "opacity"], l = ["position", "top", "bottom", "left", "right", "overflow", "opacity"], h = ["width", "height", "overflow"], c = ["fontSize"], u = ["borderTopWidth", "borderBottomWidth", "paddingTop", "paddingBottom"], d = ["borderLeftWidth", "borderRightWidth", "paddingLeft", "paddingRight"], p = t.effects.setMode(o, e.mode || "effect"), f = e.restore || "effect" !== p, g = e.scale || "both", m = e.origin || ["middle", "center"], v = o.css("position"), _ = f ? r : l, b = { height: 0, width: 0, outerHeight: 0, outerWidth: 0 }; "show" === p && o.show(), s = { height: o.height(), width: o.width(), outerHeight: o.outerHeight(), outerWidth: o.outerWidth() }, "toggle" === e.mode && "show" === p ? (o.from = e.to || b, o.to = e.from || s) : (o.from = e.from || ("show" === p ? b : s), o.to = e.to || ("hide" === p ? b : s)), a = { from: { y: o.from.height / s.height, x: o.from.width / s.width }, to: { y: o.to.height / s.height, x: o.to.width / s.width } }, ("box" === g || "both" === g) && (a.from.y !== a.to.y && (_ = _.concat(u), o.from = t.effects.setTransition(o, u, a.from.y, o.from), o.to = t.effects.setTransition(o, u, a.to.y, o.to)), a.from.x !== a.to.x && (_ = _.concat(d), o.from = t.effects.setTransition(o, d, a.from.x, o.from), o.to = t.effects.setTransition(o, d, a.to.x, o.to))), ("content" === g || "both" === g) && a.from.y !== a.to.y && (_ = _.concat(c).concat(h), o.from = t.effects.setTransition(o, c, a.from.y, o.from), o.to = t.effects.setTransition(o, c, a.to.y, o.to)), t.effects.save(o, _), o.show(), t.effects.createWrapper(o), o.css("overflow", "hidden").css(o.from), m && (n = t.effects.getBaseline(m, s), o.from.top = (s.outerHeight - o.outerHeight()) * n.y, o.from.left = (s.outerWidth - o.outerWidth()) * n.x, o.to.top = (s.outerHeight - o.to.outerHeight) * n.y, o.to.left = (s.outerWidth - o.to.outerWidth) * n.x), o.css(o.from), ("content" === g || "both" === g) && (u = u.concat(["marginTop", "marginBottom"]).concat(c), d = d.concat(["marginLeft", "marginRight"]), h = r.concat(u).concat(d), o.find("*[width]").each(function () { var i = t(this), s = { height: i.height(), width: i.width(), outerHeight: i.outerHeight(), outerWidth: i.outerWidth() }; f && t.effects.save(i, h), i.from = { height: s.height * a.from.y, width: s.width * a.from.x, outerHeight: s.outerHeight * a.from.y, outerWidth: s.outerWidth * a.from.x }, i.to = { height: s.height * a.to.y, width: s.width * a.to.x, outerHeight: s.height * a.to.y, outerWidth: s.width * a.to.x }, a.from.y !== a.to.y && (i.from = t.effects.setTransition(i, u, a.from.y, i.from), i.to = t.effects.setTransition(i, u, a.to.y, i.to)), a.from.x !== a.to.x && (i.from = t.effects.setTransition(i, d, a.from.x, i.from), i.to = t.effects.setTransition(i, d, a.to.x, i.to)), i.css(i.from), i.animate(i.to, e.duration, e.easing, function () { f && t.effects.restore(i, h) }) })), o.animate(o.to, { queue: !1, duration: e.duration, easing: e.easing, complete: function () { 0 === o.to.opacity && o.css("opacity", o.from.opacity), "hide" === p && o.hide(), t.effects.restore(o, _), f || ("static" === v ? o.css({ position: "relative", top: o.to.top, left: o.to.left }) : t.each(["top", "left"], function (t, e) { o.css(e, function (e, i) { var s = parseInt(i, 10), n = t ? o.to.left : o.to.top; return "auto" === i ? n + "px" : s + n + "px" }) })), t.effects.removeWrapper(o), i() } }) } })(jQuery); (function (t) { t.effects.effect.shake = function (e, i) { var s, n = t(this), a = ["position", "top", "bottom", "left", "right", "height", "width"], o = t.effects.setMode(n, e.mode || "effect"), r = e.direction || "left", l = e.distance || 20, h = e.times || 3, c = 2 * h + 1, u = Math.round(e.duration / c), d = "up" === r || "down" === r ? "top" : "left", p = "up" === r || "left" === r, f = {}, g = {}, m = {}, v = n.queue(), _ = v.length; for (t.effects.save(n, a), n.show(), t.effects.createWrapper(n), f[d] = (p ? "-=" : "+=") + l, g[d] = (p ? "+=" : "-=") + 2 * l, m[d] = (p ? "-=" : "+=") + 2 * l, n.animate(f, u, e.easing), s = 1; h > s; s++) n.animate(g, u, e.easing).animate(m, u, e.easing); n.animate(g, u, e.easing).animate(f, u / 2, e.easing).queue(function () { "hide" === o && n.hide(), t.effects.restore(n, a), t.effects.removeWrapper(n), i() }), _ > 1 && v.splice.apply(v, [1, 0].concat(v.splice(_, c + 1))), n.dequeue() } })(jQuery); (function (t) { t.effects.effect.slide = function (e, i) { var s, n = t(this), a = ["position", "top", "bottom", "left", "right", "width", "height"], o = t.effects.setMode(n, e.mode || "show"), r = "show" === o, l = e.direction || "left", h = "up" === l || "down" === l ? "top" : "left", c = "up" === l || "left" === l, u = {}; t.effects.save(n, a), n.show(), s = e.distance || n["top" === h ? "outerHeight" : "outerWidth"](!0), t.effects.createWrapper(n).css({ overflow: "hidden" }), r && n.css(h, c ? isNaN(s) ? "-" + s : -s : s), u[h] = (r ? c ? "+=" : "-=" : c ? "-=" : "+=") + s, n.animate(u, { queue: !1, duration: e.duration, easing: e.easing, complete: function () { "hide" === o && n.hide(), t.effects.restore(n, a), t.effects.removeWrapper(n), i() } }) } })(jQuery); (function (t) { t.effects.effect.transfer = function (e, i) { var s = t(this), n = t(e.to), a = "fixed" === n.css("position"), o = t("body"), r = a ? o.scrollTop() : 0, l = a ? o.scrollLeft() : 0, h = n.offset(), c = { top: h.top - r, left: h.left - l, height: n.innerHeight(), width: n.innerWidth() }, u = s.offset(), d = t("
").appendTo(document.body).addClass(e.className).css({ top: u.top - r, left: u.left - l, height: s.innerHeight(), width: s.innerWidth(), position: a ? "fixed" : "absolute" }).animate(c, e.duration, e.easing, function () { d.remove(), i() }) } })(jQuery);
/* Brazilian initialisation for the jQuery UI date picker plugin. */
/* Written by Leonildo Costa Silva (leocsilva@gmail.com). */
jQuery(function ($) {
$.datepicker.regional['pt-BR'] = {
closeText: 'Fechar',
prevText: '<Anterior',
nextText: 'Próximo>',
currentText: 'Hoje',
monthNames: ['Janeiro', 'Fevereiro', 'Março', 'Abril', 'Maio', 'Junho',
'Julho', 'Agosto', 'Setembro', 'Outubro', 'Novembro', 'Dezembro'],
monthNamesShort: ['Jan', 'Fev', 'Mar', 'Abr', 'Mai', 'Jun',
'Jul', 'Ago', 'Set', 'Out', 'Nov', 'Dez'],
dayNames: ['Domingo', 'Segunda-feira', 'Terça-feira', 'Quarta-feira', 'Quinta-feira', 'Sexta-feira', 'Sabado'],
dayNamesShort: ['Dom', 'Seg', 'Ter', 'Qua', 'Qui', 'Sex', 'Sab'],
dayNamesMin: ['Dom', 'Seg', 'Ter', 'Qua', 'Qui', 'Sex', 'Sab'],
weekHeader: 'Sm',
dateFormat: 'dd/mm/yy',
firstDay: 0,
isRTL: false,
showMonthAfterYear: false,
yearSuffix: ''
};
$.datepicker.setDefaults($.datepicker.regional['pt-BR']);
});
/*! rangeslider.js - v2.2.1 | (c) 2016 @andreruffert | MIT license | https://github.com/andreruffert/rangeslider.js */
!function (a) { "use strict"; "function" == typeof define && define.amd ? define(["jquery"], a) : "object" == typeof exports ? module.exports = a(require("jquery")) : a(jQuery) }(function (a) { "use strict"; function b() { var a = document.createElement("input"); return a.setAttribute("type", "range"), "text" !== a.type } function c(a, b) { var c = Array.prototype.slice.call(arguments, 2); return setTimeout(function () { return a.apply(null, c) }, b) } function d(a, b) { return b = b || 100, function () { if (!a.debouncing) { var c = Array.prototype.slice.apply(arguments); a.lastReturnVal = a.apply(window, c), a.debouncing = !0 } return clearTimeout(a.debounceTimeout), a.debounceTimeout = setTimeout(function () { a.debouncing = !1 }, b), a.lastReturnVal } } function e(a) { return a && (0 === a.offsetWidth || 0 === a.offsetHeight || a.open === !1) } function f(a) { for (var b = [], c = a.parentNode; e(c);)b.push(c), c = c.parentNode; return b } function g(a, b) { function c(a) { "undefined" != typeof a.open && (a.open = !a.open) } var d = f(a), e = d.length, g = [], h = a[b]; if (e) { for (var i = 0; e > i; i++)g[i] = d[i].style.cssText, d[i].style.setProperty ? d[i].style.setProperty("display", "block", "important") : d[i].style.cssText += ";display: block !important", d[i].style.height = "0", d[i].style.overflow = "hidden", d[i].style.visibility = "hidden", c(d[i]); h = a[b]; for (var j = 0; e > j; j++)d[j].style.cssText = g[j], c(d[j]) } return h } function h(a, b) { var c = parseFloat(a); return Number.isNaN(c) ? b : c } function i(a) { return a.charAt(0).toUpperCase() + a.substr(1) } function j(b, e) { if (this.$window = a(window), this.$document = a(document), this.$element = a(b), this.options = a.extend({}, n, e), this.polyfill = this.options.polyfill, this.orientation = this.$element[0].getAttribute("data-orientation") || this.options.orientation, this.onInit = this.options.onInit, this.onSlide = this.options.onSlide, this.onSlideEnd = this.options.onSlideEnd, this.DIMENSION = o.orientation[this.orientation].dimension, this.DIRECTION = o.orientation[this.orientation].direction, this.DIRECTION_STYLE = o.orientation[this.orientation].directionStyle, this.COORDINATE = o.orientation[this.orientation].coordinate, this.polyfill && m) return !1; this.identifier = "js-" + k + "-" + l++, this.startEvent = this.options.startEvent.join("." + this.identifier + " ") + "." + this.identifier, this.moveEvent = this.options.moveEvent.join("." + this.identifier + " ") + "." + this.identifier, this.endEvent = this.options.endEvent.join("." + this.identifier + " ") + "." + this.identifier, this.toFixed = (this.step + "").replace(".", "").length - 1, this.$fill = a('
'), this.$handle = a('
'), this.$range = a('
').insertAfter(this.$element).prepend(this.$fill, this.$handle), this.$element.css({ position: "absolute", width: "1px", height: "1px", overflow: "hidden", opacity: "0" }), this.handleDown = a.proxy(this.handleDown, this), this.handleMove = a.proxy(this.handleMove, this), this.handleEnd = a.proxy(this.handleEnd, this), this.init(); var f = this; this.$window.on("resize." + this.identifier, d(function () { c(function () { f.update(!1, !1) }, 300) }, 20)), this.$document.on(this.startEvent, "#" + this.identifier + ":not(." + this.options.disabledClass + ")", this.handleDown), this.$element.on("change." + this.identifier, function (a, b) { if (!b || b.origin !== f.identifier) { var c = a.target.value, d = f.getPositionFromValue(c); f.setPosition(d) } }) } Number.isNaN = Number.isNaN || function (a) { return "number" == typeof a && a !== a }; var k = "rangeslider", l = 0, m = b(), n = { polyfill: !0, orientation: "horizontal", rangeClass: "rangeslider", disabledClass: "rangeslider--disabled", horizontalClass: "rangeslider--horizontal", verticalClass: "rangeslider--vertical", fillClass: "rangeslider__fill", handleClass: "rangeslider__handle", startEvent: ["mousedown", "touchstart", "pointerdown"], moveEvent: ["mousemove", "touchmove", "pointermove"], endEvent: ["mouseup", "touchend", "pointerup"] }, o = { orientation: { horizontal: { dimension: "width", direction: "left", directionStyle: "left", coordinate: "x" }, vertical: { dimension: "height", direction: "top", directionStyle: "bottom", coordinate: "y" } } }; return j.prototype.init = function () { this.update(!0, !1), this.onInit && "function" == typeof this.onInit && this.onInit() }, j.prototype.update = function (a, b) { a = a || !1, a && (this.min = h(this.$element[0].getAttribute("min"), 0), this.max = h(this.$element[0].getAttribute("max"), 100), this.value = h(this.$element[0].value, Math.round(this.min + (this.max - this.min) / 2)), this.step = h(this.$element[0].getAttribute("step"), 1)), this.handleDimension = g(this.$handle[0], "offset" + i(this.DIMENSION)), this.rangeDimension = g(this.$range[0], "offset" + i(this.DIMENSION)), this.maxHandlePos = this.rangeDimension - this.handleDimension, this.grabPos = this.handleDimension / 2, this.position = this.getPositionFromValue(this.value), this.$element[0].disabled ? this.$range.addClass(this.options.disabledClass) : this.$range.removeClass(this.options.disabledClass), this.setPosition(this.position, b) }, j.prototype.handleDown = function (a) { if (this.$document.on(this.moveEvent, this.handleMove), this.$document.on(this.endEvent, this.handleEnd), !((" " + a.target.className + " ").replace(/[\n\t]/g, " ").indexOf(this.options.handleClass) > -1)) { var b = this.getRelativePosition(a), c = this.$range[0].getBoundingClientRect()[this.DIRECTION], d = this.getPositionFromNode(this.$handle[0]) - c, e = "vertical" === this.orientation ? this.maxHandlePos - (b - this.grabPos) : b - this.grabPos; this.setPosition(e), b >= d && b < d + this.handleDimension && (this.grabPos = b - d) } }, j.prototype.handleMove = function (a) { a.preventDefault(); var b = this.getRelativePosition(a), c = "vertical" === this.orientation ? this.maxHandlePos - (b - this.grabPos) : b - this.grabPos; this.setPosition(c) }, j.prototype.handleEnd = function (a) { a.preventDefault(), this.$document.off(this.moveEvent, this.handleMove), this.$document.off(this.endEvent, this.handleEnd), this.$element.trigger("change", { origin: this.identifier }), this.onSlideEnd && "function" == typeof this.onSlideEnd && this.onSlideEnd(this.position, this.value) }, j.prototype.cap = function (a, b, c) { return b > a ? b : a > c ? c : a }, j.prototype.setPosition = function (a, b) { var c, d; void 0 === b && (b = !0), c = this.getValueFromPosition(this.cap(a, 0, this.maxHandlePos)), d = this.getPositionFromValue(c), this.$fill[0].style[this.DIMENSION] = d + this.grabPos + "px", this.$handle[0].style[this.DIRECTION_STYLE] = d + "px", this.setValue(c), this.position = d, this.value = c, b && this.onSlide && "function" == typeof this.onSlide && this.onSlide(d, c) }, j.prototype.getPositionFromNode = function (a) { for (var b = 0; null !== a;)b += a.offsetLeft, a = a.offsetParent; return b }, j.prototype.getRelativePosition = function (a) { var b = i(this.COORDINATE), c = this.$range[0].getBoundingClientRect()[this.DIRECTION], d = 0; return "undefined" != typeof a["page" + b] ? d = a["page" + b] : "undefined" != typeof a.originalEvent["client" + b] ? d = a.originalEvent["client" + b] : a.originalEvent.touches && a.originalEvent.touches[0] && "undefined" != typeof a.originalEvent.touches[0]["page" + b] ? d = a.originalEvent.touches[0]["page" + b] : a.currentPoint && "undefined" != typeof a.currentPoint[this.COORDINATE] && (d = a.currentPoint[this.COORDINATE]), d - c }, j.prototype.getPositionFromValue = function (a) { var b, c; return b = (a - this.min) / (this.max - this.min), c = Number.isNaN(b) ? 0 : b * this.maxHandlePos }, j.prototype.getValueFromPosition = function (a) { var b, c; return b = a / (this.maxHandlePos || 1), c = this.step * Math.round(b * (this.max - this.min) / this.step) + this.min, Number(c.toFixed(this.toFixed)) }, j.prototype.setValue = function (a) { a === this.value && "" !== this.$element[0].value || this.$element.val(a).trigger("input", { origin: this.identifier }) }, j.prototype.destroy = function () { this.$document.off("." + this.identifier), this.$window.off("." + this.identifier), this.$element.off("." + this.identifier).removeAttr("style").removeData("plugin_" + k), this.$range && this.$range.length && this.$range[0].parentNode.removeChild(this.$range[0]) }, a.fn[k] = function (b) { var c = Array.prototype.slice.call(arguments, 1); return this.each(function () { var d = a(this), e = d.data("plugin_" + k); e || d.data("plugin_" + k, e = new j(this, b)), "string" == typeof b && e[b].apply(e, c) }) }, "rangeslider.js is available in jQuery context e.g $(selector).rangeslider(options);" });
// Ion.RangeSlider, 2.3.1, © Denis Ineshin, 2010 - 2019, IonDen.com, Build date: 2019-12-19 16:56:44
!function (i) { "undefined" != typeof jQuery && jQuery || "function" != typeof define || !define.amd ? "undefined" != typeof jQuery && jQuery || "object" != typeof exports ? i(jQuery, document, window, navigator) : i(require("jquery"), document, window, navigator) : define(["jquery"], function (t) { return i(t, document, window, navigator) }) }(function (a, c, l, t, _) { "use strict"; var i, s, o = 0, e = (i = t.userAgent, s = /msie\s\d+/i, 0 < i.search(s) && s.exec(i).toString().split(" ")[1] < 9 && (a("html").addClass("lt-ie9"), !0)); Function.prototype.bind || (Function.prototype.bind = function (o) { var e = this, h = [].slice; if ("function" != typeof e) throw new TypeError; var r = h.call(arguments, 1), n = function () { if (this instanceof n) { var t = function () { }; t.prototype = e.prototype; var i = new t, s = e.apply(i, r.concat(h.call(arguments))); return Object(s) === s ? s : i } return e.apply(o, r.concat(h.call(arguments))) }; return n }), Array.prototype.indexOf || (Array.prototype.indexOf = function (t, i) { var s; if (null == this) throw new TypeError('"this" is null or not defined'); var o = Object(this), e = o.length >>> 0; if (0 == e) return -1; var h = +i || 0; if (Math.abs(h) === 1 / 0 && (h = 0), e <= h) return -1; for (s = Math.max(0 <= h ? h : e - Math.abs(h), 0); s < e;) { if (s in o && o[s] === t) return s; s++ } return -1 }); function h(t, i, s) { this.VERSION = "2.3.1", this.input = t, this.plugin_count = s, this.current_plugin = 0, this.calc_count = 0, this.update_tm = 0, this.old_from = 0, this.old_to = 0, this.old_min_interval = null, this.raf_id = null, this.dragging = !1, this.force_redraw = !1, this.no_diapason = !1, this.has_tab_index = !0, this.is_key = !1, this.is_update = !1, this.is_start = !0, this.is_finish = !1, this.is_active = !1, this.is_resize = !1, this.is_click = !1, i = i || {}, this.$cache = { win: a(l), body: a(c.body), input: a(t), cont: null, rs: null, min: null, max: null, from: null, to: null, single: null, bar: null, line: null, s_single: null, s_from: null, s_to: null, shad_single: null, shad_from: null, shad_to: null, edge: null, grid: null, grid_labels: [] }, this.coords = { x_gap: 0, x_pointer: 0, w_rs: 0, w_rs_old: 0, w_handle: 0, p_gap: 0, p_gap_left: 0, p_gap_right: 0, p_step: 0, p_pointer: 0, p_handle: 0, p_single_fake: 0, p_single_real: 0, p_from_fake: 0, p_from_real: 0, p_to_fake: 0, p_to_real: 0, p_bar_x: 0, p_bar_w: 0, grid_gap: 0, big_num: 0, big: [], big_w: [], big_p: [], big_x: [] }, this.labels = { w_min: 0, w_max: 0, w_from: 0, w_to: 0, w_single: 0, p_min: 0, p_max: 0, p_from_fake: 0, p_from_left: 0, p_to_fake: 0, p_to_left: 0, p_single_fake: 0, p_single_left: 0 }; var o, e, h, r = this.$cache.input, n = r.prop("value"); for (h in o = { skin: "flat", type: "single", min: 10, max: 100, from: null, to: null, step: 1, min_interval: 0, max_interval: 0, drag_interval: !1, values: [], p_values: [], from_fixed: !1, from_min: null, from_max: null, from_shadow: !1, to_fixed: !1, to_min: null, to_max: null, to_shadow: !1, prettify_enabled: !0, prettify_separator: " ", prettify: null, force_edges: !1, keyboard: !0, grid: !1, grid_margin: !0, grid_num: 4, grid_snap: !1, hide_min_max: !1, hide_from_to: !1, prefix: "", postfix: "", max_postfix: "", decorate_both: !0, values_separator: " — ", input_values_separator: ";", disable: !1, block: !1, extra_classes: "", scope: null, onStart: null, onChange: null, onFinish: null, onUpdate: null }, "INPUT" !== r[0].nodeName && console && console.warn && console.warn("Base element should be
!", r[0]), (e = { skin: r.data("skin"), type: r.data("type"), min: r.data("min"), max: r.data("max"), from: r.data("from"), to: r.data("to"), step: r.data("step"), min_interval: r.data("minInterval"), max_interval: r.data("maxInterval"), drag_interval: r.data("dragInterval"), values: r.data("values"), from_fixed: r.data("fromFixed"), from_min: r.data("fromMin"), from_max: r.data("fromMax"), from_shadow: r.data("fromShadow"), to_fixed: r.data("toFixed"), to_min: r.data("toMin"), to_max: r.data("toMax"), to_shadow: r.data("toShadow"), prettify_enabled: r.data("prettifyEnabled"), prettify_separator: r.data("prettifySeparator"), force_edges: r.data("forceEdges"), keyboard: r.data("keyboard"), grid: r.data("grid"), grid_margin: r.data("gridMargin"), grid_num: r.data("gridNum"), grid_snap: r.data("gridSnap"), hide_min_max: r.data("hideMinMax"), hide_from_to: r.data("hideFromTo"), prefix: r.data("prefix"), postfix: r.data("postfix"), max_postfix: r.data("maxPostfix"), decorate_both: r.data("decorateBoth"), values_separator: r.data("valuesSeparator"), input_values_separator: r.data("inputValuesSeparator"), disable: r.data("disable"), block: r.data("block"), extra_classes: r.data("extraClasses") }).values = e.values && e.values.split(","), e) e.hasOwnProperty(h) && (e[h] !== _ && "" !== e[h] || delete e[h]); n !== _ && "" !== n && ((n = n.split(e.input_values_separator || i.input_values_separator || ";"))[0] && n[0] == +n[0] && (n[0] = +n[0]), n[1] && n[1] == +n[1] && (n[1] = +n[1]), i && i.values && i.values.length ? (o.from = n[0] && i.values.indexOf(n[0]), o.to = n[1] && i.values.indexOf(n[1])) : (o.from = n[0] && +n[0], o.to = n[1] && +n[1])), a.extend(o, i), a.extend(o, e), this.options = o, this.update_check = {}, this.validate(), this.result = { input: this.$cache.input, slider: null, min: this.options.min, max: this.options.max, from: this.options.from, from_percent: 0, from_value: null, to: this.options.to, to_percent: 0, to_value: null }, this.init() } h.prototype = { init: function (t) { this.no_diapason = !1, this.coords.p_step = this.convertToPercent(this.options.step, !0), this.target = "base", this.toggleInput(), this.append(), this.setMinMax(), t ? (this.force_redraw = !0, this.calc(!0), this.callOnUpdate()) : (this.force_redraw = !0, this.calc(!0), this.callOnStart()), this.updateScene() }, append: function () { var t = '
'; this.$cache.input.before(t), this.$cache.input.prop("readonly", !0), this.$cache.cont = this.$cache.input.prev(), this.result.slider = this.$cache.cont, this.$cache.cont.html('
0 1 0 0 0 '), this.$cache.rs = this.$cache.cont.find(".irs"), this.$cache.min = this.$cache.cont.find(".irs-min"), this.$cache.max = this.$cache.cont.find(".irs-max"), this.$cache.from = this.$cache.cont.find(".irs-from"), this.$cache.to = this.$cache.cont.find(".irs-to"), this.$cache.single = this.$cache.cont.find(".irs-single"), this.$cache.line = this.$cache.cont.find(".irs-line"), this.$cache.grid = this.$cache.cont.find(".irs-grid"), "single" === this.options.type ? (this.$cache.cont.append('
'), this.$cache.bar = this.$cache.cont.find(".irs-bar"), this.$cache.edge = this.$cache.cont.find(".irs-bar-edge"), this.$cache.s_single = this.$cache.cont.find(".single"), this.$cache.from[0].style.visibility = "hidden", this.$cache.to[0].style.visibility = "hidden", this.$cache.shad_single = this.$cache.cont.find(".shadow-single")) : (this.$cache.cont.append('
'), this.$cache.bar = this.$cache.cont.find(".irs-bar"), this.$cache.s_from = this.$cache.cont.find(".from"), this.$cache.s_to = this.$cache.cont.find(".to"), this.$cache.shad_from = this.$cache.cont.find(".shadow-from"), this.$cache.shad_to = this.$cache.cont.find(".shadow-to"), this.setTopHandler()), this.options.hide_from_to && (this.$cache.from[0].style.display = "none", this.$cache.to[0].style.display = "none", this.$cache.single[0].style.display = "none"), this.appendGrid(), this.options.disable ? (this.appendDisableMask(), this.$cache.input[0].disabled = !0) : (this.$cache.input[0].disabled = !1, this.removeDisableMask(), this.bindEvents()), this.options.disable || (this.options.block ? this.appendDisableMask() : this.removeDisableMask()), this.options.drag_interval && (this.$cache.bar[0].style.cursor = "ew-resize") }, setTopHandler: function () { var t = this.options.min, i = this.options.max, s = this.options.from, o = this.options.to; t < s && o === i ? this.$cache.s_from.addClass("type_last") : o < i && this.$cache.s_to.addClass("type_last") }, changeLevel: function (t) { switch (t) { case "single": this.coords.p_gap = this.toFixed(this.coords.p_pointer - this.coords.p_single_fake), this.$cache.s_single.addClass("state_hover"); break; case "from": this.coords.p_gap = this.toFixed(this.coords.p_pointer - this.coords.p_from_fake), this.$cache.s_from.addClass("state_hover"), this.$cache.s_from.addClass("type_last"), this.$cache.s_to.removeClass("type_last"); break; case "to": this.coords.p_gap = this.toFixed(this.coords.p_pointer - this.coords.p_to_fake), this.$cache.s_to.addClass("state_hover"), this.$cache.s_to.addClass("type_last"), this.$cache.s_from.removeClass("type_last"); break; case "both": this.coords.p_gap_left = this.toFixed(this.coords.p_pointer - this.coords.p_from_fake), this.coords.p_gap_right = this.toFixed(this.coords.p_to_fake - this.coords.p_pointer), this.$cache.s_to.removeClass("type_last"), this.$cache.s_from.removeClass("type_last") } }, appendDisableMask: function () { this.$cache.cont.append('
'), this.$cache.cont.addClass("irs-disabled") }, removeDisableMask: function () { this.$cache.cont.remove(".irs-disable-mask"), this.$cache.cont.removeClass("irs-disabled") }, remove: function () { this.$cache.cont.remove(), this.$cache.cont = null, this.$cache.line.off("keydown.irs_" + this.plugin_count), this.$cache.body.off("touchmove.irs_" + this.plugin_count), this.$cache.body.off("mousemove.irs_" + this.plugin_count), this.$cache.win.off("touchend.irs_" + this.plugin_count), this.$cache.win.off("mouseup.irs_" + this.plugin_count), e && (this.$cache.body.off("mouseup.irs_" + this.plugin_count), this.$cache.body.off("mouseleave.irs_" + this.plugin_count)), this.$cache.grid_labels = [], this.coords.big = [], this.coords.big_w = [], this.coords.big_p = [], this.coords.big_x = [], cancelAnimationFrame(this.raf_id) }, bindEvents: function () { this.no_diapason || (this.$cache.body.on("touchmove.irs_" + this.plugin_count, this.pointerMove.bind(this)), this.$cache.body.on("mousemove.irs_" + this.plugin_count, this.pointerMove.bind(this)), this.$cache.win.on("touchend.irs_" + this.plugin_count, this.pointerUp.bind(this)), this.$cache.win.on("mouseup.irs_" + this.plugin_count, this.pointerUp.bind(this)), this.$cache.line.on("touchstart.irs_" + this.plugin_count, this.pointerClick.bind(this, "click")), this.$cache.line.on("mousedown.irs_" + this.plugin_count, this.pointerClick.bind(this, "click")), this.$cache.line.on("focus.irs_" + this.plugin_count, this.pointerFocus.bind(this)), this.options.drag_interval && "double" === this.options.type ? (this.$cache.bar.on("touchstart.irs_" + this.plugin_count, this.pointerDown.bind(this, "both")), this.$cache.bar.on("mousedown.irs_" + this.plugin_count, this.pointerDown.bind(this, "both"))) : (this.$cache.bar.on("touchstart.irs_" + this.plugin_count, this.pointerClick.bind(this, "click")), this.$cache.bar.on("mousedown.irs_" + this.plugin_count, this.pointerClick.bind(this, "click"))), "single" === this.options.type ? (this.$cache.single.on("touchstart.irs_" + this.plugin_count, this.pointerDown.bind(this, "single")), this.$cache.s_single.on("touchstart.irs_" + this.plugin_count, this.pointerDown.bind(this, "single")), this.$cache.shad_single.on("touchstart.irs_" + this.plugin_count, this.pointerClick.bind(this, "click")), this.$cache.single.on("mousedown.irs_" + this.plugin_count, this.pointerDown.bind(this, "single")), this.$cache.s_single.on("mousedown.irs_" + this.plugin_count, this.pointerDown.bind(this, "single")), this.$cache.edge.on("mousedown.irs_" + this.plugin_count, this.pointerClick.bind(this, "click")), this.$cache.shad_single.on("mousedown.irs_" + this.plugin_count, this.pointerClick.bind(this, "click"))) : (this.$cache.single.on("touchstart.irs_" + this.plugin_count, this.pointerDown.bind(this, null)), this.$cache.single.on("mousedown.irs_" + this.plugin_count, this.pointerDown.bind(this, null)), this.$cache.from.on("touchstart.irs_" + this.plugin_count, this.pointerDown.bind(this, "from")), this.$cache.s_from.on("touchstart.irs_" + this.plugin_count, this.pointerDown.bind(this, "from")), this.$cache.to.on("touchstart.irs_" + this.plugin_count, this.pointerDown.bind(this, "to")), this.$cache.s_to.on("touchstart.irs_" + this.plugin_count, this.pointerDown.bind(this, "to")), this.$cache.shad_from.on("touchstart.irs_" + this.plugin_count, this.pointerClick.bind(this, "click")), this.$cache.shad_to.on("touchstart.irs_" + this.plugin_count, this.pointerClick.bind(this, "click")), this.$cache.from.on("mousedown.irs_" + this.plugin_count, this.pointerDown.bind(this, "from")), this.$cache.s_from.on("mousedown.irs_" + this.plugin_count, this.pointerDown.bind(this, "from")), this.$cache.to.on("mousedown.irs_" + this.plugin_count, this.pointerDown.bind(this, "to")), this.$cache.s_to.on("mousedown.irs_" + this.plugin_count, this.pointerDown.bind(this, "to")), this.$cache.shad_from.on("mousedown.irs_" + this.plugin_count, this.pointerClick.bind(this, "click")), this.$cache.shad_to.on("mousedown.irs_" + this.plugin_count, this.pointerClick.bind(this, "click"))), this.options.keyboard && this.$cache.line.on("keydown.irs_" + this.plugin_count, this.key.bind(this, "keyboard")), e && (this.$cache.body.on("mouseup.irs_" + this.plugin_count, this.pointerUp.bind(this)), this.$cache.body.on("mouseleave.irs_" + this.plugin_count, this.pointerUp.bind(this)))) }, pointerFocus: function (t) { var i, s; this.target || (i = (s = "single" === this.options.type ? this.$cache.single : this.$cache.from).offset().left, i += s.width() / 2 - 1, this.pointerClick("single", { preventDefault: function () { }, pageX: i })) }, pointerMove: function (t) { if (this.dragging) { var i = t.pageX || t.originalEvent.touches && t.originalEvent.touches[0].pageX; this.coords.x_pointer = i - this.coords.x_gap, this.calc() } }, pointerUp: function (t) { this.current_plugin === this.plugin_count && this.is_active && (this.is_active = !1, this.$cache.cont.find(".state_hover").removeClass("state_hover"), this.force_redraw = !0, e && a("*").prop("unselectable", !1), this.updateScene(), this.restoreOriginalMinInterval(), (a.contains(this.$cache.cont[0], t.target) || this.dragging) && this.callOnFinish(), this.dragging = !1) }, pointerDown: function (t, i) { i.preventDefault(); var s = i.pageX || i.originalEvent.touches && i.originalEvent.touches[0].pageX; 2 !== i.button && ("both" === t && this.setTempMinInterval(), t = t || (this.target || "from"), this.current_plugin = this.plugin_count, this.target = t, this.is_active = !0, this.dragging = !0, this.coords.x_gap = this.$cache.rs.offset().left, this.coords.x_pointer = s - this.coords.x_gap, this.calcPointerPercent(), this.changeLevel(t), e && a("*").prop("unselectable", !0), this.$cache.line.trigger("focus"), this.updateScene()) }, pointerClick: function (t, i) { i.preventDefault(); var s = i.pageX || i.originalEvent.touches && i.originalEvent.touches[0].pageX; 2 !== i.button && (this.current_plugin = this.plugin_count, this.target = t, this.is_click = !0, this.coords.x_gap = this.$cache.rs.offset().left, this.coords.x_pointer = +(s - this.coords.x_gap).toFixed(), this.force_redraw = !0, this.calc(), this.$cache.line.trigger("focus")) }, key: function (t, i) { if (!(this.current_plugin !== this.plugin_count || i.altKey || i.ctrlKey || i.shiftKey || i.metaKey)) { switch (i.which) { case 83: case 65: case 40: case 37: i.preventDefault(), this.moveByKey(!1); break; case 87: case 68: case 38: case 39: i.preventDefault(), this.moveByKey(!0) }return !0 } }, moveByKey: function (t) { var i = this.coords.p_pointer, s = (this.options.max - this.options.min) / 100; s = this.options.step / s, t ? i += s : i -= s, this.coords.x_pointer = this.toFixed(this.coords.w_rs / 100 * i), this.is_key = !0, this.calc() }, setMinMax: function () { if (this.options) { if (this.options.hide_min_max) return this.$cache.min[0].style.display = "none", void (this.$cache.max[0].style.display = "none"); if (this.options.values.length) this.$cache.min.html(this.decorate(this.options.p_values[this.options.min])), this.$cache.max.html(this.decorate(this.options.p_values[this.options.max])); else { var t = this._prettify(this.options.min), i = this._prettify(this.options.max); this.result.min_pretty = t, this.result.max_pretty = i, this.$cache.min.html(this.decorate(t, this.options.min)), this.$cache.max.html(this.decorate(i, this.options.max)) } this.labels.w_min = this.$cache.min.outerWidth(!1), this.labels.w_max = this.$cache.max.outerWidth(!1) } }, setTempMinInterval: function () { var t = this.result.to - this.result.from; null === this.old_min_interval && (this.old_min_interval = this.options.min_interval), this.options.min_interval = t }, restoreOriginalMinInterval: function () { null !== this.old_min_interval && (this.options.min_interval = this.old_min_interval, this.old_min_interval = null) }, calc: function (t) { if (this.options && (this.calc_count++, 10 !== this.calc_count && !t || (this.calc_count = 0, this.coords.w_rs = this.$cache.rs.outerWidth(!1), this.calcHandlePercent()), this.coords.w_rs)) { this.calcPointerPercent(); var i = this.getHandleX(); switch ("both" === this.target && (this.coords.p_gap = 0, i = this.getHandleX()), "click" === this.target && (this.coords.p_gap = this.coords.p_handle / 2, i = this.getHandleX(), this.options.drag_interval ? this.target = "both_one" : this.target = this.chooseHandle(i)), this.target) { case "base": var s = (this.options.max - this.options.min) / 100, o = (this.result.from - this.options.min) / s, e = (this.result.to - this.options.min) / s; this.coords.p_single_real = this.toFixed(o), this.coords.p_from_real = this.toFixed(o), this.coords.p_to_real = this.toFixed(e), this.coords.p_single_real = this.checkDiapason(this.coords.p_single_real, this.options.from_min, this.options.from_max), this.coords.p_from_real = this.checkDiapason(this.coords.p_from_real, this.options.from_min, this.options.from_max), this.coords.p_to_real = this.checkDiapason(this.coords.p_to_real, this.options.to_min, this.options.to_max), this.coords.p_single_fake = this.convertToFakePercent(this.coords.p_single_real), this.coords.p_from_fake = this.convertToFakePercent(this.coords.p_from_real), this.coords.p_to_fake = this.convertToFakePercent(this.coords.p_to_real), this.target = null; break; case "single": if (this.options.from_fixed) break; this.coords.p_single_real = this.convertToRealPercent(i), this.coords.p_single_real = this.calcWithStep(this.coords.p_single_real), this.coords.p_single_real = this.checkDiapason(this.coords.p_single_real, this.options.from_min, this.options.from_max), this.coords.p_single_fake = this.convertToFakePercent(this.coords.p_single_real); break; case "from": if (this.options.from_fixed) break; this.coords.p_from_real = this.convertToRealPercent(i), this.coords.p_from_real = this.calcWithStep(this.coords.p_from_real), this.coords.p_from_real > this.coords.p_to_real && (this.coords.p_from_real = this.coords.p_to_real), this.coords.p_from_real = this.checkDiapason(this.coords.p_from_real, this.options.from_min, this.options.from_max), this.coords.p_from_real = this.checkMinInterval(this.coords.p_from_real, this.coords.p_to_real, "from"), this.coords.p_from_real = this.checkMaxInterval(this.coords.p_from_real, this.coords.p_to_real, "from"), this.coords.p_from_fake = this.convertToFakePercent(this.coords.p_from_real); break; case "to": if (this.options.to_fixed) break; this.coords.p_to_real = this.convertToRealPercent(i), this.coords.p_to_real = this.calcWithStep(this.coords.p_to_real), this.coords.p_to_real < this.coords.p_from_real && (this.coords.p_to_real = this.coords.p_from_real), this.coords.p_to_real = this.checkDiapason(this.coords.p_to_real, this.options.to_min, this.options.to_max), this.coords.p_to_real = this.checkMinInterval(this.coords.p_to_real, this.coords.p_from_real, "to"), this.coords.p_to_real = this.checkMaxInterval(this.coords.p_to_real, this.coords.p_from_real, "to"), this.coords.p_to_fake = this.convertToFakePercent(this.coords.p_to_real); break; case "both": if (this.options.from_fixed || this.options.to_fixed) break; i = this.toFixed(i + .001 * this.coords.p_handle), this.coords.p_from_real = this.convertToRealPercent(i) - this.coords.p_gap_left, this.coords.p_from_real = this.calcWithStep(this.coords.p_from_real), this.coords.p_from_real = this.checkDiapason(this.coords.p_from_real, this.options.from_min, this.options.from_max), this.coords.p_from_real = this.checkMinInterval(this.coords.p_from_real, this.coords.p_to_real, "from"), this.coords.p_from_fake = this.convertToFakePercent(this.coords.p_from_real), this.coords.p_to_real = this.convertToRealPercent(i) + this.coords.p_gap_right, this.coords.p_to_real = this.calcWithStep(this.coords.p_to_real), this.coords.p_to_real = this.checkDiapason(this.coords.p_to_real, this.options.to_min, this.options.to_max), this.coords.p_to_real = this.checkMinInterval(this.coords.p_to_real, this.coords.p_from_real, "to"), this.coords.p_to_fake = this.convertToFakePercent(this.coords.p_to_real); break; case "both_one": if (this.options.from_fixed || this.options.to_fixed) break; var h = this.convertToRealPercent(i), r = this.result.from_percent, n = this.result.to_percent - r, a = n / 2, c = h - a, l = h + a; c < 0 && (l = (c = 0) + n), 100 < l && (c = (l = 100) - n), this.coords.p_from_real = this.calcWithStep(c), this.coords.p_from_real = this.checkDiapason(this.coords.p_from_real, this.options.from_min, this.options.from_max), this.coords.p_from_fake = this.convertToFakePercent(this.coords.p_from_real), this.coords.p_to_real = this.calcWithStep(l), this.coords.p_to_real = this.checkDiapason(this.coords.p_to_real, this.options.to_min, this.options.to_max), this.coords.p_to_fake = this.convertToFakePercent(this.coords.p_to_real) }"single" === this.options.type ? (this.coords.p_bar_x = this.coords.p_handle / 2, this.coords.p_bar_w = this.coords.p_single_fake, this.result.from_percent = this.coords.p_single_real, this.result.from = this.convertToValue(this.coords.p_single_real), this.result.from_pretty = this._prettify(this.result.from), this.options.values.length && (this.result.from_value = this.options.values[this.result.from])) : (this.coords.p_bar_x = this.toFixed(this.coords.p_from_fake + this.coords.p_handle / 2), this.coords.p_bar_w = this.toFixed(this.coords.p_to_fake - this.coords.p_from_fake), this.result.from_percent = this.coords.p_from_real, this.result.from = this.convertToValue(this.coords.p_from_real), this.result.from_pretty = this._prettify(this.result.from), this.result.to_percent = this.coords.p_to_real, this.result.to = this.convertToValue(this.coords.p_to_real), this.result.to_pretty = this._prettify(this.result.to), this.options.values.length && (this.result.from_value = this.options.values[this.result.from], this.result.to_value = this.options.values[this.result.to])), this.calcMinMax(), this.calcLabels() } }, calcPointerPercent: function () { this.coords.w_rs ? (this.coords.x_pointer < 0 || isNaN(this.coords.x_pointer) ? this.coords.x_pointer = 0 : this.coords.x_pointer > this.coords.w_rs && (this.coords.x_pointer = this.coords.w_rs), this.coords.p_pointer = this.toFixed(this.coords.x_pointer / this.coords.w_rs * 100)) : this.coords.p_pointer = 0 }, convertToRealPercent: function (t) { return t / (100 - this.coords.p_handle) * 100 }, convertToFakePercent: function (t) { return t / 100 * (100 - this.coords.p_handle) }, getHandleX: function () { var t = 100 - this.coords.p_handle, i = this.toFixed(this.coords.p_pointer - this.coords.p_gap); return i < 0 ? i = 0 : t < i && (i = t), i }, calcHandlePercent: function () { "single" === this.options.type ? this.coords.w_handle = this.$cache.s_single.outerWidth(!1) : this.coords.w_handle = this.$cache.s_from.outerWidth(!1), this.coords.p_handle = this.toFixed(this.coords.w_handle / this.coords.w_rs * 100) }, chooseHandle: function (t) { return "single" === this.options.type ? "single" : this.coords.p_from_real + (this.coords.p_to_real - this.coords.p_from_real) / 2 <= t ? this.options.to_fixed ? "from" : "to" : this.options.from_fixed ? "to" : "from" }, calcMinMax: function () { this.coords.w_rs && (this.labels.p_min = this.labels.w_min / this.coords.w_rs * 100, this.labels.p_max = this.labels.w_max / this.coords.w_rs * 100) }, calcLabels: function () { this.coords.w_rs && !this.options.hide_from_to && ("single" === this.options.type ? (this.labels.w_single = this.$cache.single.outerWidth(!1), this.labels.p_single_fake = this.labels.w_single / this.coords.w_rs * 100, this.labels.p_single_left = this.coords.p_single_fake + this.coords.p_handle / 2 - this.labels.p_single_fake / 2) : (this.labels.w_from = this.$cache.from.outerWidth(!1), this.labels.p_from_fake = this.labels.w_from / this.coords.w_rs * 100, this.labels.p_from_left = this.coords.p_from_fake + this.coords.p_handle / 2 - this.labels.p_from_fake / 2, this.labels.p_from_left = this.toFixed(this.labels.p_from_left), this.labels.p_from_left = this.checkEdges(this.labels.p_from_left, this.labels.p_from_fake), this.labels.w_to = this.$cache.to.outerWidth(!1), this.labels.p_to_fake = this.labels.w_to / this.coords.w_rs * 100, this.labels.p_to_left = this.coords.p_to_fake + this.coords.p_handle / 2 - this.labels.p_to_fake / 2, this.labels.p_to_left = this.toFixed(this.labels.p_to_left), this.labels.p_to_left = this.checkEdges(this.labels.p_to_left, this.labels.p_to_fake), this.labels.w_single = this.$cache.single.outerWidth(!1), this.labels.p_single_fake = this.labels.w_single / this.coords.w_rs * 100, this.labels.p_single_left = (this.labels.p_from_left + this.labels.p_to_left + this.labels.p_to_fake) / 2 - this.labels.p_single_fake / 2, this.labels.p_single_left = this.toFixed(this.labels.p_single_left)), this.labels.p_single_left = this.checkEdges(this.labels.p_single_left, this.labels.p_single_fake)) }, updateScene: function () { this.raf_id && (cancelAnimationFrame(this.raf_id), this.raf_id = null), clearTimeout(this.update_tm), this.update_tm = null, this.options && (this.drawHandles(), this.is_active ? this.raf_id = requestAnimationFrame(this.updateScene.bind(this)) : this.update_tm = setTimeout(this.updateScene.bind(this), 300)) }, drawHandles: function () { this.coords.w_rs = this.$cache.rs.outerWidth(!1), this.coords.w_rs && (this.coords.w_rs !== this.coords.w_rs_old && (this.target = "base", this.is_resize = !0), this.coords.w_rs === this.coords.w_rs_old && !this.force_redraw || (this.setMinMax(), this.calc(!0), this.drawLabels(), this.options.grid && (this.calcGridMargin(), this.calcGridLabels()), this.force_redraw = !0, this.coords.w_rs_old = this.coords.w_rs, this.drawShadow()), this.coords.w_rs && (this.dragging || this.force_redraw || this.is_key) && ((this.old_from !== this.result.from || this.old_to !== this.result.to || this.force_redraw || this.is_key) && (this.drawLabels(), this.$cache.bar[0].style.left = this.coords.p_bar_x + "%", this.$cache.bar[0].style.width = this.coords.p_bar_w + "%", "single" === this.options.type ? (this.$cache.bar[0].style.left = 0, this.$cache.bar[0].style.width = this.coords.p_bar_w + this.coords.p_bar_x + "%", this.$cache.s_single[0].style.left = this.coords.p_single_fake + "%") : (this.$cache.s_from[0].style.left = this.coords.p_from_fake + "%", this.$cache.s_to[0].style.left = this.coords.p_to_fake + "%", this.old_from === this.result.from && !this.force_redraw || (this.$cache.from[0].style.left = this.labels.p_from_left + "%"), this.old_to === this.result.to && !this.force_redraw || (this.$cache.to[0].style.left = this.labels.p_to_left + "%")), this.$cache.single[0].style.left = this.labels.p_single_left + "%", this.writeToInput(), this.old_from === this.result.from && this.old_to === this.result.to || this.is_start || (this.$cache.input.trigger("change"), this.$cache.input.trigger("input")), this.old_from = this.result.from, this.old_to = this.result.to, this.is_resize || this.is_update || this.is_start || this.is_finish || this.callOnChange(), (this.is_key || this.is_click) && (this.is_key = !1, this.is_click = !1, this.callOnFinish()), this.is_update = !1, this.is_resize = !1, this.is_finish = !1), this.is_start = !1, this.is_key = !1, this.is_click = !1, this.force_redraw = !1)) }, drawLabels: function () { if (this.options) { var t, i, s, o, e, h = this.options.values.length, r = this.options.p_values; if (!this.options.hide_from_to) if ("single" === this.options.type) t = h ? this.decorate(r[this.result.from]) : (o = this._prettify(this.result.from), this.decorate(o, this.result.from)), this.$cache.single.html(t), this.calcLabels(), this.labels.p_single_left < this.labels.p_min + 1 ? this.$cache.min[0].style.visibility = "hidden" : this.$cache.min[0].style.visibility = "visible", this.labels.p_single_left + this.labels.p_single_fake > 100 - this.labels.p_max - 1 ? this.$cache.max[0].style.visibility = "hidden" : this.$cache.max[0].style.visibility = "visible"; else { s = h ? (this.options.decorate_both ? (t = this.decorate(r[this.result.from]), t += this.options.values_separator, t += this.decorate(r[this.result.to])) : t = this.decorate(r[this.result.from] + this.options.values_separator + r[this.result.to]), i = this.decorate(r[this.result.from]), this.decorate(r[this.result.to])) : (o = this._prettify(this.result.from), e = this._prettify(this.result.to), this.options.decorate_both ? (t = this.decorate(o, this.result.from), t += this.options.values_separator, t += this.decorate(e, this.result.to)) : t = this.decorate(o + this.options.values_separator + e, this.result.to), i = this.decorate(o, this.result.from), this.decorate(e, this.result.to)), this.$cache.single.html(t), this.$cache.from.html(i), this.$cache.to.html(s), this.calcLabels(); var n = Math.min(this.labels.p_single_left, this.labels.p_from_left), a = this.labels.p_single_left + this.labels.p_single_fake, c = this.labels.p_to_left + this.labels.p_to_fake, l = Math.max(a, c); this.labels.p_from_left + this.labels.p_from_fake >= this.labels.p_to_left ? (this.$cache.from[0].style.visibility = "hidden", this.$cache.to[0].style.visibility = "hidden", this.$cache.single[0].style.visibility = "visible", l = this.result.from === this.result.to ? ("from" === this.target ? this.$cache.from[0].style.visibility = "visible" : "to" === this.target ? this.$cache.to[0].style.visibility = "visible" : this.target || (this.$cache.from[0].style.visibility = "visible"), this.$cache.single[0].style.visibility = "hidden", c) : (this.$cache.from[0].style.visibility = "hidden", this.$cache.to[0].style.visibility = "hidden", this.$cache.single[0].style.visibility = "visible", Math.max(a, c))) : (this.$cache.from[0].style.visibility = "visible", this.$cache.to[0].style.visibility = "visible", this.$cache.single[0].style.visibility = "hidden"), n < this.labels.p_min + 1 ? this.$cache.min[0].style.visibility = "hidden" : this.$cache.min[0].style.visibility = "visible", l > 100 - this.labels.p_max - 1 ? this.$cache.max[0].style.visibility = "hidden" : this.$cache.max[0].style.visibility = "visible" } } }, drawShadow: function () { var t, i, s, o, e = this.options, h = this.$cache, r = "number" == typeof e.from_min && !isNaN(e.from_min), n = "number" == typeof e.from_max && !isNaN(e.from_max), a = "number" == typeof e.to_min && !isNaN(e.to_min), c = "number" == typeof e.to_max && !isNaN(e.to_max); "single" === e.type ? e.from_shadow && (r || n) ? (t = this.convertToPercent(r ? e.from_min : e.min), i = this.convertToPercent(n ? e.from_max : e.max) - t, t = this.toFixed(t - this.coords.p_handle / 100 * t), i = this.toFixed(i - this.coords.p_handle / 100 * i), t += this.coords.p_handle / 2, h.shad_single[0].style.display = "block", h.shad_single[0].style.left = t + "%", h.shad_single[0].style.width = i + "%") : h.shad_single[0].style.display = "none" : (e.from_shadow && (r || n) ? (t = this.convertToPercent(r ? e.from_min : e.min), i = this.convertToPercent(n ? e.from_max : e.max) - t, t = this.toFixed(t - this.coords.p_handle / 100 * t), i = this.toFixed(i - this.coords.p_handle / 100 * i), t += this.coords.p_handle / 2, h.shad_from[0].style.display = "block", h.shad_from[0].style.left = t + "%", h.shad_from[0].style.width = i + "%") : h.shad_from[0].style.display = "none", e.to_shadow && (a || c) ? (s = this.convertToPercent(a ? e.to_min : e.min), o = this.convertToPercent(c ? e.to_max : e.max) - s, s = this.toFixed(s - this.coords.p_handle / 100 * s), o = this.toFixed(o - this.coords.p_handle / 100 * o), s += this.coords.p_handle / 2, h.shad_to[0].style.display = "block", h.shad_to[0].style.left = s + "%", h.shad_to[0].style.width = o + "%") : h.shad_to[0].style.display = "none") }, writeToInput: function () { "single" === this.options.type ? (this.options.values.length ? this.$cache.input.prop("value", this.result.from_value) : this.$cache.input.prop("value", this.result.from), this.$cache.input.data("from", this.result.from)) : (this.options.values.length ? this.$cache.input.prop("value", this.result.from_value + this.options.input_values_separator + this.result.to_value) : this.$cache.input.prop("value", this.result.from + this.options.input_values_separator + this.result.to), this.$cache.input.data("from", this.result.from), this.$cache.input.data("to", this.result.to)) }, callOnStart: function () { this.writeToInput(), this.options.onStart && "function" == typeof this.options.onStart && (this.options.scope ? this.options.onStart.call(this.options.scope, this.result) : this.options.onStart(this.result)) }, callOnChange: function () { this.writeToInput(), this.options.onChange && "function" == typeof this.options.onChange && (this.options.scope ? this.options.onChange.call(this.options.scope, this.result) : this.options.onChange(this.result)) }, callOnFinish: function () { this.writeToInput(), this.options.onFinish && "function" == typeof this.options.onFinish && (this.options.scope ? this.options.onFinish.call(this.options.scope, this.result) : this.options.onFinish(this.result)) }, callOnUpdate: function () { this.writeToInput(), this.options.onUpdate && "function" == typeof this.options.onUpdate && (this.options.scope ? this.options.onUpdate.call(this.options.scope, this.result) : this.options.onUpdate(this.result)) }, toggleInput: function () { this.$cache.input.toggleClass("irs-hidden-input"), this.has_tab_index ? this.$cache.input.prop("tabindex", -1) : this.$cache.input.removeProp("tabindex"), this.has_tab_index = !this.has_tab_index }, convertToPercent: function (t, i) { var s, o = this.options.max - this.options.min, e = o / 100; return o ? (s = (i ? t : t - this.options.min) / e, this.toFixed(s)) : (this.no_diapason = !0, 0) }, convertToValue: function (t) { var i, s, o = this.options.min, e = this.options.max, h = o.toString().split(".")[1], r = e.toString().split(".")[1], n = 0, a = 0; if (0 === t) return this.options.min; if (100 === t) return this.options.max; h && (n = i = h.length), r && (n = s = r.length), i && s && (n = s <= i ? i : s), o < 0 && (o = +(o + (a = Math.abs(o))).toFixed(n), e = +(e + a).toFixed(n)); var c, l = (e - o) / 100 * t + o, _ = this.options.step.toString().split(".")[1]; return l = _ ? +l.toFixed(_.length) : (l /= this.options.step, +(l *= this.options.step).toFixed(0)), a && (l -= a), (c = _ ? +l.toFixed(_.length) : this.toFixed(l)) < this.options.min ? c = this.options.min : c > this.options.max && (c = this.options.max), c }, calcWithStep: function (t) { var i = Math.round(t / this.coords.p_step) * this.coords.p_step; return 100 < i && (i = 100), 100 === t && (i = 100), this.toFixed(i) }, checkMinInterval: function (t, i, s) { var o, e, h = this.options; return h.min_interval ? (o = this.convertToValue(t), e = this.convertToValue(i), "from" === s ? e - o < h.min_interval && (o = e - h.min_interval) : o - e < h.min_interval && (o = e + h.min_interval), this.convertToPercent(o)) : t }, checkMaxInterval: function (t, i, s) { var o, e, h = this.options; return h.max_interval ? (o = this.convertToValue(t), e = this.convertToValue(i), "from" === s ? e - o > h.max_interval && (o = e - h.max_interval) : o - e > h.max_interval && (o = e + h.max_interval), this.convertToPercent(o)) : t }, checkDiapason: function (t, i, s) { var o = this.convertToValue(t), e = this.options; return "number" != typeof i && (i = e.min), "number" != typeof s && (s = e.max), o < i && (o = i), s < o && (o = s), this.convertToPercent(o) }, toFixed: function (t) { return +(t = t.toFixed(20)) }, _prettify: function (t) { return this.options.prettify_enabled ? this.options.prettify && "function" == typeof this.options.prettify ? this.options.prettify(t) : this.prettify(t) : t }, prettify: function (t) { return t.toString().replace(/(\d{1,3}(?=(?:\d\d\d)+(?!\d)))/g, "$1" + this.options.prettify_separator) }, checkEdges: function (t, i) { return this.options.force_edges && (t < 0 ? t = 0 : 100 - i < t && (t = 100 - i)), this.toFixed(t) }, validate: function () { var t, i, s = this.options, o = this.result, e = s.values, h = e.length; if ("string" == typeof s.min && (s.min = +s.min), "string" == typeof s.max && (s.max = +s.max), "string" == typeof s.from && (s.from = +s.from), "string" == typeof s.to && (s.to = +s.to), "string" == typeof s.step && (s.step = +s.step), "string" == typeof s.from_min && (s.from_min = +s.from_min), "string" == typeof s.from_max && (s.from_max = +s.from_max), "string" == typeof s.to_min && (s.to_min = +s.to_min), "string" == typeof s.to_max && (s.to_max = +s.to_max), "string" == typeof s.grid_num && (s.grid_num = +s.grid_num), s.max < s.min && (s.max = s.min), h) for (s.p_values = [], s.min = 0, s.max = h - 1, s.step = 1, s.grid_num = s.max, s.grid_snap = !0, i = 0; i < h; i++)t = +e[i], t = isNaN(t) ? e[i] : (e[i] = t, this._prettify(t)), s.p_values.push(t); "number" == typeof s.from && !isNaN(s.from) || (s.from = s.min), "number" == typeof s.to && !isNaN(s.to) || (s.to = s.max), "single" === s.type ? (s.from < s.min && (s.from = s.min), s.from > s.max && (s.from = s.max)) : (s.from < s.min && (s.from = s.min), s.from > s.max && (s.from = s.max), s.to < s.min && (s.to = s.min), s.to > s.max && (s.to = s.max), this.update_check.from && (this.update_check.from !== s.from && s.from > s.to && (s.from = s.to), this.update_check.to !== s.to && s.to < s.from && (s.to = s.from)), s.from > s.to && (s.from = s.to), s.to < s.from && (s.to = s.from)), ("number" != typeof s.step || isNaN(s.step) || !s.step || s.step < 0) && (s.step = 1), "number" == typeof s.from_min && s.from < s.from_min && (s.from = s.from_min), "number" == typeof s.from_max && s.from > s.from_max && (s.from = s.from_max), "number" == typeof s.to_min && s.to < s.to_min && (s.to = s.to_min), "number" == typeof s.to_max && s.from > s.to_max && (s.to = s.to_max), o && (o.min !== s.min && (o.min = s.min), o.max !== s.max && (o.max = s.max), (o.from < o.min || o.from > o.max) && (o.from = s.from), (o.to < o.min || o.to > o.max) && (o.to = s.to)), ("number" != typeof s.min_interval || isNaN(s.min_interval) || !s.min_interval || s.min_interval < 0) && (s.min_interval = 0), ("number" != typeof s.max_interval || isNaN(s.max_interval) || !s.max_interval || s.max_interval < 0) && (s.max_interval = 0), s.min_interval && s.min_interval > s.max - s.min && (s.min_interval = s.max - s.min), s.max_interval && s.max_interval > s.max - s.min && (s.max_interval = s.max - s.min) }, decorate: function (t, i) { var s = "", o = this.options; return o.prefix && (s += o.prefix), s += t, o.max_postfix && (o.values.length && t === o.p_values[o.max] ? (s += o.max_postfix, o.postfix && (s += " ")) : i === o.max && (s += o.max_postfix, o.postfix && (s += " "))), o.postfix && (s += o.postfix), s }, updateFrom: function () { this.result.from = this.options.from, this.result.from_percent = this.convertToPercent(this.result.from), this.result.from_pretty = this._prettify(this.result.from), this.options.values && (this.result.from_value = this.options.values[this.result.from]) }, updateTo: function () { this.result.to = this.options.to, this.result.to_percent = this.convertToPercent(this.result.to), this.result.to_pretty = this._prettify(this.result.to), this.options.values && (this.result.to_value = this.options.values[this.result.to]) }, updateResult: function () { this.result.min = this.options.min, this.result.max = this.options.max, this.updateFrom(), this.updateTo() }, appendGrid: function () { if (this.options.grid) { var t, i, s, o, e, h, r = this.options, n = r.max - r.min, a = r.grid_num, c = 0, l = 4, _ = ""; for (this.calcGridMargin(), r.grid_snap && (a = n / r.step), 50 < a && (a = 50), s = this.toFixed(100 / a), 4 < a && (l = 3), 7 < a && (l = 2), 14 < a && (l = 1), 28 < a && (l = 0), t = 0; t < a + 1; t++) { for (o = l, 100 < (c = this.toFixed(s * t)) && (c = 100), e = ((this.coords.big[t] = c) - s * (t - 1)) / (o + 1), i = 1; i <= o && 0 !== c; i++)_ += '
'; _ += '
', h = this.convertToValue(c), _ += '
' + (h = r.values.length ? r.p_values[h] : this._prettify(h)) + " " } this.coords.big_num = Math.ceil(a + 1), this.$cache.cont.addClass("irs-with-grid"), this.$cache.grid.html(_), this.cacheGridLabels() } }, cacheGridLabels: function () { var t, i, s = this.coords.big_num; for (i = 0; i < s; i++)t = this.$cache.grid.find(".js-grid-text-" + i), this.$cache.grid_labels.push(t); this.calcGridLabels() }, calcGridLabels: function () { var t, i, s = [], o = [], e = this.coords.big_num; for (t = 0; t < e; t++)this.coords.big_w[t] = this.$cache.grid_labels[t].outerWidth(!1), this.coords.big_p[t] = this.toFixed(this.coords.big_w[t] / this.coords.w_rs * 100), this.coords.big_x[t] = this.toFixed(this.coords.big_p[t] / 2), s[t] = this.toFixed(this.coords.big[t] - this.coords.big_x[t]), o[t] = this.toFixed(s[t] + this.coords.big_p[t]); for (this.options.force_edges && (s[0] < -this.coords.grid_gap && (s[0] = -this.coords.grid_gap, o[0] = this.toFixed(s[0] + this.coords.big_p[0]), this.coords.big_x[0] = this.coords.grid_gap), o[e - 1] > 100 + this.coords.grid_gap && (o[e - 1] = 100 + this.coords.grid_gap, s[e - 1] = this.toFixed(o[e - 1] - this.coords.big_p[e - 1]), this.coords.big_x[e - 1] = this.toFixed(this.coords.big_p[e - 1] - this.coords.grid_gap))), this.calcGridCollision(2, s, o), this.calcGridCollision(4, s, o), t = 0; t < e; t++)i = this.$cache.grid_labels[t][0], this.coords.big_x[t] !== Number.POSITIVE_INFINITY && (i.style.marginLeft = -this.coords.big_x[t] + "%") }, calcGridCollision: function (t, i, s) { var o, e, h, r = this.coords.big_num; for (o = 0; o < r && !(r <= (e = o + t / 2)); o += t)h = this.$cache.grid_labels[e][0], s[o] <= i[e] ? h.style.visibility = "visible" : h.style.visibility = "hidden" }, calcGridMargin: function () { this.options.grid_margin && (this.coords.w_rs = this.$cache.rs.outerWidth(!1), this.coords.w_rs && ("single" === this.options.type ? this.coords.w_handle = this.$cache.s_single.outerWidth(!1) : this.coords.w_handle = this.$cache.s_from.outerWidth(!1), this.coords.p_handle = this.toFixed(this.coords.w_handle / this.coords.w_rs * 100), this.coords.grid_gap = this.toFixed(this.coords.p_handle / 2 - .1), this.$cache.grid[0].style.width = this.toFixed(100 - this.coords.p_handle) + "%", this.$cache.grid[0].style.left = this.coords.grid_gap + "%")) }, update: function (t) { this.input && (this.is_update = !0, this.options.from = this.result.from, this.options.to = this.result.to, this.update_check.from = this.result.from, this.update_check.to = this.result.to, this.options = a.extend(this.options, t), this.validate(), this.updateResult(t), this.toggleInput(), this.remove(), this.init(!0)) }, reset: function () { this.input && (this.updateResult(), this.update()) }, destroy: function () { this.input && (this.toggleInput(), this.$cache.input.prop("readonly", !1), a.data(this.input, "ionRangeSlider", null), this.remove(), this.input = null, this.options = null) } }, a.fn.ionRangeSlider = function (t) { return this.each(function () { a.data(this, "ionRangeSlider") || a.data(this, "ionRangeSlider", new h(this, t, o++)) }) }, function () { for (var h = 0, t = ["ms", "moz", "webkit", "o"], i = 0; i < t.length && !l.requestAnimationFrame; ++i)l.requestAnimationFrame = l[t[i] + "RequestAnimationFrame"], l.cancelAnimationFrame = l[t[i] + "CancelAnimationFrame"] || l[t[i] + "CancelRequestAnimationFrame"]; l.requestAnimationFrame || (l.requestAnimationFrame = function (t, i) { var s = (new Date).getTime(), o = Math.max(0, 16 - (s - h)), e = l.setTimeout(function () { t(s + o) }, o); return h = s + o, e }), l.cancelAnimationFrame || (l.cancelAnimationFrame = function (t) { clearTimeout(t) }) }() });
/*!
* Select2 4.0.2
* https://select2.github.io
*
* Released under the MIT license
* https://github.com/select2/select2/blob/master/LICENSE.md
*/
(function (factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['jquery'], factory);
} else if (typeof exports === 'object') {
// Node/CommonJS
factory(require('jquery'));
} else {
// Browser globals
factory(jQuery);
}
}(function (jQuery) {
// This is needed so we can catch the AMD loader configuration and use it
// The inner file should be wrapped (by `banner.start.js`) in a function that
// returns the AMD loader references.
var S2 =
(function () {
// Restore the Select2 AMD loader so it can be used
// Needed mostly in the language files, where the loader is not inserted
if (jQuery && jQuery.fn && jQuery.fn.select2 && jQuery.fn.select2.amd) {
var S2 = jQuery.fn.select2.amd;
}
var S2; (function () {
if (!S2 || !S2.requirejs) {
if (!S2) { S2 = {}; } else { require = S2; }
/**
* @license almond 0.3.1 Copyright (c) 2011-2014, The Dojo Foundation All Rights Reserved.
* Available via the MIT or new BSD license.
* see: http://github.com/jrburke/almond for details
*/
//Going sloppy to avoid 'use strict' string cost, but strict practices should
//be followed.
/*jslint sloppy: true */
/*global setTimeout: false */
var requirejs, require, define;
(function (undef) {
var main, req, makeMap, handlers,
defined = {},
waiting = {},
config = {},
defining = {},
hasOwn = Object.prototype.hasOwnProperty,
aps = [].slice,
jsSuffixRegExp = /\.js$/;
function hasProp(obj, prop) {
return hasOwn.call(obj, prop);
}
/**
* Given a relative module name, like ./something, normalize it to
* a real name that can be mapped to a path.
* @param {String} name the relative name
* @param {String} baseName a real name that the name arg is relative
* to.
* @returns {String} normalized name
*/
function normalize(name, baseName) {
var nameParts, nameSegment, mapValue, foundMap, lastIndex,
foundI, foundStarMap, starI, i, j, part,
baseParts = baseName && baseName.split("/"),
map = config.map,
starMap = (map && map['*']) || {};
//Adjust any relative paths.
if (name && name.charAt(0) === ".") {
//If have a base name, try to normalize against it,
//otherwise, assume it is a top-level require that will
//be relative to baseUrl in the end.
if (baseName) {
name = name.split('/');
lastIndex = name.length - 1;
// Node .js allowance:
if (config.nodeIdCompat && jsSuffixRegExp.test(name[lastIndex])) {
name[lastIndex] = name[lastIndex].replace(jsSuffixRegExp, '');
}
//Lop off the last part of baseParts, so that . matches the
//"directory" and not name of the baseName's module. For instance,
//baseName of "one/two/three", maps to "one/two/three.js", but we
//want the directory, "one/two" for this normalization.
name = baseParts.slice(0, baseParts.length - 1).concat(name);
//start trimDots
for (i = 0; i < name.length; i += 1) {
part = name[i];
if (part === ".") {
name.splice(i, 1);
i -= 1;
} else if (part === "..") {
if (i === 1 && (name[2] === '..' || name[0] === '..')) {
//End of the line. Keep at least one non-dot
//path segment at the front so it can be mapped
//correctly to disk. Otherwise, there is likely
//no path mapping for a path starting with '..'.
//This can still fail, but catches the most reasonable
//uses of ..
break;
} else if (i > 0) {
name.splice(i - 1, 2);
i -= 2;
}
}
}
//end trimDots
name = name.join("/");
} else if (name.indexOf('./') === 0) {
// No baseName, so this is ID is resolved relative
// to baseUrl, pull off the leading dot.
name = name.substring(2);
}
}
//Apply map config if available.
if ((baseParts || starMap) && map) {
nameParts = name.split('/');
for (i = nameParts.length; i > 0; i -= 1) {
nameSegment = nameParts.slice(0, i).join("/");
if (baseParts) {
//Find the longest baseName segment match in the config.
//So, do joins on the biggest to smallest lengths of baseParts.
for (j = baseParts.length; j > 0; j -= 1) {
mapValue = map[baseParts.slice(0, j).join('/')];
//baseName segment has config, find if it has one for
//this name.
if (mapValue) {
mapValue = mapValue[nameSegment];
if (mapValue) {
//Match, update name to the new value.
foundMap = mapValue;
foundI = i;
break;
}
}
}
}
if (foundMap) {
break;
}
//Check for a star map match, but just hold on to it,
//if there is a shorter segment match later in a matching
//config, then favor over this star map.
if (!foundStarMap && starMap && starMap[nameSegment]) {
foundStarMap = starMap[nameSegment];
starI = i;
}
}
if (!foundMap && foundStarMap) {
foundMap = foundStarMap;
foundI = starI;
}
if (foundMap) {
nameParts.splice(0, foundI, foundMap);
name = nameParts.join('/');
}
}
return name;
}
function makeRequire(relName, forceSync) {
return function () {
//A version of a require function that passes a moduleName
//value for items that may need to
//look up paths relative to the moduleName
var args = aps.call(arguments, 0);
//If first arg is not require('string'), and there is only
//one arg, it is the array form without a callback. Insert
//a null so that the following concat is correct.
if (typeof args[0] !== 'string' && args.length === 1) {
args.push(null);
}
return req.apply(undef, args.concat([relName, forceSync]));
};
}
function makeNormalize(relName) {
return function (name) {
return normalize(name, relName);
};
}
function makeLoad(depName) {
return function (value) {
defined[depName] = value;
};
}
function callDep(name) {
if (hasProp(waiting, name)) {
var args = waiting[name];
delete waiting[name];
defining[name] = true;
main.apply(undef, args);
}
if (!hasProp(defined, name) && !hasProp(defining, name)) {
throw new Error('No ' + name);
}
return defined[name];
}
//Turns a plugin!resource to [plugin, resource]
//with the plugin being undefined if the name
//did not have a plugin prefix.
function splitPrefix(name) {
var prefix,
index = name ? name.indexOf('!') : -1;
if (index > -1) {
prefix = name.substring(0, index);
name = name.substring(index + 1, name.length);
}
return [prefix, name];
}
/**
* Makes a name map, normalizing the name, and using a plugin
* for normalization if necessary. Grabs a ref to plugin
* too, as an optimization.
*/
makeMap = function (name, relName) {
var plugin,
parts = splitPrefix(name),
prefix = parts[0];
name = parts[1];
if (prefix) {
prefix = normalize(prefix, relName);
plugin = callDep(prefix);
}
//Normalize according
if (prefix) {
if (plugin && plugin.normalize) {
name = plugin.normalize(name, makeNormalize(relName));
} else {
name = normalize(name, relName);
}
} else {
name = normalize(name, relName);
parts = splitPrefix(name);
prefix = parts[0];
name = parts[1];
if (prefix) {
plugin = callDep(prefix);
}
}
//Using ridiculous property names for space reasons
return {
f: prefix ? prefix + '!' + name : name, //fullName
n: name,
pr: prefix,
p: plugin
};
};
function makeConfig(name) {
return function () {
return (config && config.config && config.config[name]) || {};
};
}
handlers = {
require: function (name) {
return makeRequire(name);
},
exports: function (name) {
var e = defined[name];
if (typeof e !== 'undefined') {
return e;
} else {
return (defined[name] = {});
}
},
module: function (name) {
return {
id: name,
uri: '',
exports: defined[name],
config: makeConfig(name)
};
}
};
main = function (name, deps, callback, relName) {
var cjsModule, depName, ret, map, i,
args = [],
callbackType = typeof callback,
usingExports;
//Use name if no relName
relName = relName || name;
//Call the callback to define the module, if necessary.
if (callbackType === 'undefined' || callbackType === 'function') {
//Pull out the defined dependencies and pass the ordered
//values to the callback.
//Default to [require, exports, module] if no deps
deps = !deps.length && callback.length ? ['require', 'exports', 'module'] : deps;
for (i = 0; i < deps.length; i += 1) {
map = makeMap(deps[i], relName);
depName = map.f;
//Fast path CommonJS standard dependencies.
if (depName === "require") {
args[i] = handlers.require(name);
} else if (depName === "exports") {
//CommonJS module spec 1.1
args[i] = handlers.exports(name);
usingExports = true;
} else if (depName === "module") {
//CommonJS module spec 1.1
cjsModule = args[i] = handlers.module(name);
} else if (hasProp(defined, depName) ||
hasProp(waiting, depName) ||
hasProp(defining, depName)) {
args[i] = callDep(depName);
} else if (map.p) {
map.p.load(map.n, makeRequire(relName, true), makeLoad(depName), {});
args[i] = defined[depName];
} else {
throw new Error(name + ' missing ' + depName);
}
}
ret = callback ? callback.apply(defined[name], args) : undefined;
if (name) {
//If setting exports via "module" is in play,
//favor that over return value and exports. After that,
//favor a non-undefined return value over exports use.
if (cjsModule && cjsModule.exports !== undef &&
cjsModule.exports !== defined[name]) {
defined[name] = cjsModule.exports;
} else if (ret !== undef || !usingExports) {
//Use the return value from the function.
defined[name] = ret;
}
}
} else if (name) {
//May just be an object definition for the module. Only
//worry about defining if have a module name.
defined[name] = callback;
}
};
requirejs = require = req = function (deps, callback, relName, forceSync, alt) {
if (typeof deps === "string") {
if (handlers[deps]) {
//callback in this case is really relName
return handlers[deps](callback);
}
//Just return the module wanted. In this scenario, the
//deps arg is the module name, and second arg (if passed)
//is just the relName.
//Normalize module name, if it contains . or ..
return callDep(makeMap(deps, callback).f);
} else if (!deps.splice) {
//deps is a config object, not an array.
config = deps;
if (config.deps) {
req(config.deps, config.callback);
}
if (!callback) {
return;
}
if (callback.splice) {
//callback is an array, which means it is a dependency list.
//Adjust args if there are dependencies
deps = callback;
callback = relName;
relName = null;
} else {
deps = undef;
}
}
//Support require(['a'])
callback = callback || function () { };
//If relName is a function, it is an errback handler,
//so remove it.
if (typeof relName === 'function') {
relName = forceSync;
forceSync = alt;
}
//Simulate async callback;
if (forceSync) {
main(undef, deps, callback, relName);
} else {
//Using a non-zero value because of concern for what old browsers
//do, and latest browsers "upgrade" to 4 if lower value is used:
//http://www.whatwg.org/specs/web-apps/current-work/multipage/timers.html#dom-windowtimers-settimeout:
//If want a value immediately, use require('id') instead -- something
//that works in almond on the global level, but not guaranteed and
//unlikely to work in other AMD implementations.
setTimeout(function () {
main(undef, deps, callback, relName);
}, 4);
}
return req;
};
/**
* Just drops the config on the floor, but returns req in case
* the config return value is used.
*/
req.config = function (cfg) {
return req(cfg);
};
/**
* Expose module registry for debugging and tooling
*/
requirejs._defined = defined;
define = function (name, deps, callback) {
if (typeof name !== 'string') {
throw new Error('See almond README: incorrect module build, no module name');
}
//This module may not have dependencies
if (!deps.splice) {
//deps is not an array, so probably means
//an object literal or factory function for
//the value. Adjust args.
callback = deps;
deps = [];
}
if (!hasProp(defined, name) && !hasProp(waiting, name)) {
waiting[name] = [name, deps, callback];
}
};
define.amd = {
jQuery: true
};
}());
S2.requirejs = requirejs; S2.require = require; S2.define = define;
}
}());
S2.define("almond", function () { });
/* global jQuery:false, $:false */
S2.define('jquery', [], function () {
var _$ = jQuery || $;
if (_$ == null && console && console.error) {
console.error(
'Select2: An instance of jQuery or a jQuery-compatible library was not ' +
'found. Make sure that you are including jQuery before Select2 on your ' +
'web page.'
);
}
return _$;
});
S2.define('select2/utils', [
'jquery'
], function ($) {
var Utils = {};
Utils.Extend = function (ChildClass, SuperClass) {
var __hasProp = {}.hasOwnProperty;
function BaseConstructor() {
this.constructor = ChildClass;
}
for (var key in SuperClass) {
if (__hasProp.call(SuperClass, key)) {
ChildClass[key] = SuperClass[key];
}
}
BaseConstructor.prototype = SuperClass.prototype;
ChildClass.prototype = new BaseConstructor();
ChildClass.__super__ = SuperClass.prototype;
return ChildClass;
};
function getMethods(theClass) {
var proto = theClass.prototype;
var methods = [];
for (var methodName in proto) {
var m = proto[methodName];
if (typeof m !== 'function') {
continue;
}
if (methodName === 'constructor') {
continue;
}
methods.push(methodName);
}
return methods;
}
Utils.Decorate = function (SuperClass, DecoratorClass) {
var decoratedMethods = getMethods(DecoratorClass);
var superMethods = getMethods(SuperClass);
function DecoratedClass() {
var unshift = Array.prototype.unshift;
var argCount = DecoratorClass.prototype.constructor.length;
var calledConstructor = SuperClass.prototype.constructor;
if (argCount > 0) {
unshift.call(arguments, SuperClass.prototype.constructor);
calledConstructor = DecoratorClass.prototype.constructor;
}
calledConstructor.apply(this, arguments);
}
DecoratorClass.displayName = SuperClass.displayName;
function ctr() {
this.constructor = DecoratedClass;
}
DecoratedClass.prototype = new ctr();
for (var m = 0; m < superMethods.length; m++) {
var superMethod = superMethods[m];
DecoratedClass.prototype[superMethod] =
SuperClass.prototype[superMethod];
}
var calledMethod = function (methodName) {
// Stub out the original method if it's not decorating an actual method
var originalMethod = function () { };
if (methodName in DecoratedClass.prototype) {
originalMethod = DecoratedClass.prototype[methodName];
}
var decoratedMethod = DecoratorClass.prototype[methodName];
return function () {
var unshift = Array.prototype.unshift;
unshift.call(arguments, originalMethod);
return decoratedMethod.apply(this, arguments);
};
};
for (var d = 0; d < decoratedMethods.length; d++) {
var decoratedMethod = decoratedMethods[d];
DecoratedClass.prototype[decoratedMethod] = calledMethod(decoratedMethod);
}
return DecoratedClass;
};
var Observable = function () {
this.listeners = {};
};
Observable.prototype.on = function (event, callback) {
this.listeners = this.listeners || {};
if (event in this.listeners) {
this.listeners[event].push(callback);
} else {
this.listeners[event] = [callback];
}
};
Observable.prototype.trigger = function (event) {
var slice = Array.prototype.slice;
this.listeners = this.listeners || {};
if (event in this.listeners) {
this.invoke(this.listeners[event], slice.call(arguments, 1));
}
if ('*' in this.listeners) {
this.invoke(this.listeners['*'], arguments);
}
};
Observable.prototype.invoke = function (listeners, params) {
for (var i = 0, len = listeners.length; i < len; i++) {
listeners[i].apply(this, params);
}
};
Utils.Observable = Observable;
Utils.generateChars = function (length) {
var chars = '';
for (var i = 0; i < length; i++) {
var randomChar = Math.floor(Math.random() * 36);
chars += randomChar.toString(36);
}
return chars;
};
Utils.bind = function (func, context) {
return function () {
func.apply(context, arguments);
};
};
Utils._convertData = function (data) {
for (var originalKey in data) {
var keys = originalKey.split('-');
var dataLevel = data;
if (keys.length === 1) {
continue;
}
for (var k = 0; k < keys.length; k++) {
var key = keys[k];
// Lowercase the first letter
// By default, dash-separated becomes camelCase
key = key.substring(0, 1).toLowerCase() + key.substring(1);
if (!(key in dataLevel)) {
dataLevel[key] = {};
}
if (k == keys.length - 1) {
dataLevel[key] = data[originalKey];
}
dataLevel = dataLevel[key];
}
delete data[originalKey];
}
return data;
};
Utils.hasScroll = function (index, el) {
// Adapted from the function created by @ShadowScripter
// and adapted by @BillBarry on the Stack Exchange Code Review website.
// The original code can be found at
// http://codereview.stackexchange.com/q/13338
// and was designed to be used with the Sizzle selector engine.
var $el = $(el);
var overflowX = el.style.overflowX;
var overflowY = el.style.overflowY;
//Check both x and y declarations
if (overflowX === overflowY &&
(overflowY === 'hidden' || overflowY === 'visible')) {
return false;
}
if (overflowX === 'scroll' || overflowY === 'scroll') {
return true;
}
return ($el.innerHeight() < el.scrollHeight ||
$el.innerWidth() < el.scrollWidth);
};
Utils.escapeMarkup = function (markup) {
var replaceMap = {
'\\': '\',
'&': '&',
'<': '<',
'>': '>',
'"': '"',
'\'': ''',
'/': '/'
};
// Do not try to escape the markup if it's not a string
if (typeof markup !== 'string') {
return markup;
}
return String(markup).replace(/[&<>"'\/\\]/g, function (match) {
return replaceMap[match];
});
};
// Append an array of jQuery nodes to a given element.
Utils.appendMany = function ($element, $nodes) {
// jQuery 1.7.x does not support $.fn.append() with an array
// Fall back to a jQuery object collection using $.fn.add()
if ($.fn.jquery.substr(0, 3) === '1.7') {
var $jqNodes = $();
$.map($nodes, function (node) {
$jqNodes = $jqNodes.add(node);
});
$nodes = $jqNodes;
}
$element.append($nodes);
};
return Utils;
});
S2.define('select2/results', [
'jquery',
'./utils'
], function ($, Utils) {
function Results($element, options, dataAdapter) {
this.$element = $element;
this.data = dataAdapter;
this.options = options;
Results.__super__.constructor.call(this);
}
Utils.Extend(Results, Utils.Observable);
Results.prototype.render = function () {
var $results = $(
'
'
);
if (this.options.get('multiple')) {
$results.attr('aria-multiselectable', 'true');
}
this.$results = $results;
return $results;
};
Results.prototype.clear = function () {
this.$results.empty();
};
Results.prototype.displayMessage = function (params) {
var escapeMarkup = this.options.get('escapeMarkup');
this.clear();
this.hideLoading();
var $message = $(
'
'
);
var message = this.options.get('translations').get(params.message);
$message.append(
escapeMarkup(
message(params.args)
)
);
$message[0].className += ' select2-results__message';
this.$results.append($message);
};
Results.prototype.hideMessages = function () {
this.$results.find('.select2-results__message').remove();
};
Results.prototype.append = function (data) {
this.hideLoading();
var $options = [];
if (data.results == null || data.results.length === 0) {
if (this.$results.children().length === 0) {
this.trigger('results:message', {
message: 'noResults'
});
}
return;
}
data.results = this.sort(data.results);
for (var d = 0; d < data.results.length; d++) {
var item = data.results[d];
var $option = this.option(item);
$options.push($option);
}
this.$results.append($options);
};
Results.prototype.position = function ($results, $dropdown) {
var $resultsContainer = $dropdown.find('.select2-results');
$resultsContainer.append($results);
};
Results.prototype.sort = function (data) {
var sorter = this.options.get('sorter');
return sorter(data);
};
Results.prototype.setClasses = function () {
var self = this;
this.data.current(function (selected) {
var selectedIds = $.map(selected, function (s) {
return s.id.toString();
});
var $options = self.$results
.find('.select2-results__option[aria-selected]');
$options.each(function () {
var $option = $(this);
var item = $.data(this, 'data');
// id needs to be converted to a string when comparing
var id = '' + item.id;
if ((item.element != null && item.element.selected) ||
(item.element == null && $.inArray(id, selectedIds) > -1)) {
$option.attr('aria-selected', 'true');
} else {
$option.attr('aria-selected', 'false');
}
});
var $selected = $options.filter('[aria-selected=true]');
// Check if there are any selected options
if ($selected.length > 0) {
// If there are selected options, highlight the first
$selected.first().trigger('mouseenter');
} else {
// If there are no selected options, highlight the first option
// in the dropdown
$options.first().trigger('mouseenter');
}
});
};
Results.prototype.showLoading = function (params) {
this.hideLoading();
var loadingMore = this.options.get('translations').get('searching');
var loading = {
disabled: true,
loading: true,
text: loadingMore(params)
};
var $loading = this.option(loading);
$loading.className += ' loading-results';
this.$results.prepend($loading);
};
Results.prototype.hideLoading = function () {
this.$results.find('.loading-results').remove();
};
Results.prototype.option = function (data) {
var option = document.createElement('li');
option.className = 'select2-results__option';
var attrs = {
'role': 'treeitem',
'aria-selected': 'false'
};
if (data.disabled) {
delete attrs['aria-selected'];
attrs['aria-disabled'] = 'true';
}
if (data.id == null) {
delete attrs['aria-selected'];
}
if (data._resultId != null) {
option.id = data._resultId;
}
if (data.title) {
option.title = data.title;
}
if (data.children) {
attrs.role = 'group';
attrs['aria-label'] = data.text;
delete attrs['aria-selected'];
}
for (var attr in attrs) {
var val = attrs[attr];
option.setAttribute(attr, val);
}
if (data.children) {
var $option = $(option);
var label = document.createElement('strong');
label.className = 'select2-results__group';
var $label = $(label);
this.template(data, label);
var $children = [];
for (var c = 0; c < data.children.length; c++) {
var child = data.children[c];
var $child = this.option(child);
$children.push($child);
}
var $childrenContainer = $('
', {
'class': 'select2-results__options select2-results__options--nested'
});
$childrenContainer.append($children);
$option.append(label);
$option.append($childrenContainer);
} else {
this.template(data, option);
}
$.data(option, 'data', data);
return option;
};
Results.prototype.bind = function (container, $container) {
var self = this;
var id = container.id + '-results';
this.$results.attr('id', id);
container.on('results:all', function (params) {
self.clear();
self.append(params.data);
if (container.isOpen()) {
self.setClasses();
}
});
container.on('results:append', function (params) {
self.append(params.data);
if (container.isOpen()) {
self.setClasses();
}
});
container.on('query', function (params) {
self.hideMessages();
self.showLoading(params);
});
container.on('select', function () {
if (!container.isOpen()) {
return;
}
self.setClasses();
});
container.on('unselect', function () {
if (!container.isOpen()) {
return;
}
self.setClasses();
});
container.on('open', function () {
// When the dropdown is open, aria-expended="true"
self.$results.attr('aria-expanded', 'true');
self.$results.attr('aria-hidden', 'false');
self.setClasses();
self.ensureHighlightVisible();
});
container.on('close', function () {
// When the dropdown is closed, aria-expended="false"
self.$results.attr('aria-expanded', 'false');
self.$results.attr('aria-hidden', 'true');
self.$results.removeAttr('aria-activedescendant');
});
container.on('results:toggle', function () {
var $highlighted = self.getHighlightedResults();
if ($highlighted.length === 0) {
return;
}
$highlighted.trigger('mouseup');
});
container.on('results:select', function () {
var $highlighted = self.getHighlightedResults();
if ($highlighted.length === 0) {
return;
}
var data = $highlighted.data('data');
if ($highlighted.attr('aria-selected') == 'true') {
self.trigger('close', {});
} else {
self.trigger('select', {
data: data
});
}
});
container.on('results:previous', function () {
var $highlighted = self.getHighlightedResults();
var $options = self.$results.find('[aria-selected]');
var currentIndex = $options.index($highlighted);
// If we are already at te top, don't move further
if (currentIndex === 0) {
return;
}
var nextIndex = currentIndex - 1;
// If none are highlighted, highlight the first
if ($highlighted.length === 0) {
nextIndex = 0;
}
var $next = $options.eq(nextIndex);
$next.trigger('mouseenter');
var currentOffset = self.$results.offset().top;
var nextTop = $next.offset().top;
var nextOffset = self.$results.scrollTop() + (nextTop - currentOffset);
if (nextIndex === 0) {
self.$results.scrollTop(0);
} else if (nextTop - currentOffset < 0) {
self.$results.scrollTop(nextOffset);
}
});
container.on('results:next', function () {
var $highlighted = self.getHighlightedResults();
var $options = self.$results.find('[aria-selected]');
var currentIndex = $options.index($highlighted);
var nextIndex = currentIndex + 1;
// If we are at the last option, stay there
if (nextIndex >= $options.length) {
return;
}
var $next = $options.eq(nextIndex);
$next.trigger('mouseenter');
var currentOffset = self.$results.offset().top +
self.$results.outerHeight(false);
var nextBottom = $next.offset().top + $next.outerHeight(false);
var nextOffset = self.$results.scrollTop() + nextBottom - currentOffset;
if (nextIndex === 0) {
self.$results.scrollTop(0);
} else if (nextBottom > currentOffset) {
self.$results.scrollTop(nextOffset);
}
});
container.on('results:focus', function (params) {
params.element.addClass('select2-results__option--highlighted');
});
container.on('results:message', function (params) {
self.displayMessage(params);
});
if ($.fn.mousewheel) {
this.$results.on('mousewheel', function (e) {
var top = self.$results.scrollTop();
var bottom = self.$results.get(0).scrollHeight - top + e.deltaY;
var isAtTop = e.deltaY > 0 && top - e.deltaY <= 0;
var isAtBottom = e.deltaY < 0 && bottom <= self.$results.height();
if (isAtTop) {
self.$results.scrollTop(0);
e.preventDefault();
e.stopPropagation();
} else if (isAtBottom) {
self.$results.scrollTop(
self.$results.get(0).scrollHeight - self.$results.height()
);
e.preventDefault();
e.stopPropagation();
}
});
}
this.$results.on('mouseup', '.select2-results__option[aria-selected]',
function (evt) {
var $this = $(this);
var data = $this.data('data');
if ($this.attr('aria-selected') === 'true') {
if (self.options.get('multiple')) {
self.trigger('unselect', {
originalEvent: evt,
data: data
});
} else {
self.trigger('close', {});
}
return;
}
self.trigger('select', {
originalEvent: evt,
data: data
});
});
this.$results.on('mouseenter', '.select2-results__option[aria-selected]',
function (evt) {
var data = $(this).data('data');
self.getHighlightedResults()
.removeClass('select2-results__option--highlighted');
self.trigger('results:focus', {
data: data,
element: $(this)
});
});
};
Results.prototype.getHighlightedResults = function () {
var $highlighted = this.$results
.find('.select2-results__option--highlighted');
return $highlighted;
};
Results.prototype.destroy = function () {
this.$results.remove();
};
Results.prototype.ensureHighlightVisible = function () {
var $highlighted = this.getHighlightedResults();
if ($highlighted.length === 0) {
return;
}
var $options = this.$results.find('[aria-selected]');
var currentIndex = $options.index($highlighted);
var currentOffset = this.$results.offset().top;
var nextTop = $highlighted.offset().top;
var nextOffset = this.$results.scrollTop() + (nextTop - currentOffset);
var offsetDelta = nextTop - currentOffset;
nextOffset -= $highlighted.outerHeight(false) * 2;
if (currentIndex <= 2) {
this.$results.scrollTop(0);
} else if (offsetDelta > this.$results.outerHeight() || offsetDelta < 0) {
this.$results.scrollTop(nextOffset);
}
};
Results.prototype.template = function (result, container) {
var template = this.options.get('templateResult');
var escapeMarkup = this.options.get('escapeMarkup');
var content = template(result, container);
if (content == null) {
container.style.display = 'none';
} else if (typeof content === 'string') {
container.innerHTML = escapeMarkup(content);
} else {
$(container).append(content);
}
};
return Results;
});
S2.define('select2/keys', [
], function () {
var KEYS = {
BACKSPACE: 8,
TAB: 9,
ENTER: 13,
SHIFT: 16,
CTRL: 17,
ALT: 18,
ESC: 27,
SPACE: 32,
PAGE_UP: 33,
PAGE_DOWN: 34,
END: 35,
HOME: 36,
LEFT: 37,
UP: 38,
RIGHT: 39,
DOWN: 40,
DELETE: 46
};
return KEYS;
});
S2.define('select2/selection/base', [
'jquery',
'../utils',
'../keys'
], function ($, Utils, KEYS) {
function BaseSelection($element, options) {
this.$element = $element;
this.options = options;
BaseSelection.__super__.constructor.call(this);
}
Utils.Extend(BaseSelection, Utils.Observable);
BaseSelection.prototype.render = function () {
var $selection = $(
'
' +
' '
);
this._tabindex = 0;
if (this.$element.data('old-tabindex') != null) {
this._tabindex = this.$element.data('old-tabindex');
} else if (this.$element.attr('tabindex') != null) {
this._tabindex = this.$element.attr('tabindex');
}
$selection.attr('title', this.$element.attr('title'));
$selection.attr('tabindex', this._tabindex);
this.$selection = $selection;
return $selection;
};
BaseSelection.prototype.bind = function (container, $container) {
var self = this;
var id = container.id + '-container';
var resultsId = container.id + '-results';
this.container = container;
this.$selection.on('focus', function (evt) {
self.trigger('focus', evt);
});
this.$selection.on('blur', function (evt) {
self._handleBlur(evt);
});
this.$selection.on('keydown', function (evt) {
self.trigger('keypress', evt);
if (evt.which === KEYS.SPACE) {
evt.preventDefault();
}
});
container.on('results:focus', function (params) {
self.$selection.attr('aria-activedescendant', params.data._resultId);
});
container.on('selection:update', function (params) {
self.update(params.data);
});
container.on('open', function () {
// When the dropdown is open, aria-expanded="true"
self.$selection.attr('aria-expanded', 'true');
self.$selection.attr('aria-owns', resultsId);
self._attachCloseHandler(container);
});
container.on('close', function () {
// When the dropdown is closed, aria-expanded="false"
self.$selection.attr('aria-expanded', 'false');
self.$selection.removeAttr('aria-activedescendant');
self.$selection.removeAttr('aria-owns');
self.$selection.focus();
self._detachCloseHandler(container);
});
container.on('enable', function () {
self.$selection.attr('tabindex', self._tabindex);
});
container.on('disable', function () {
self.$selection.attr('tabindex', '-1');
});
};
BaseSelection.prototype._handleBlur = function (evt) {
var self = this;
// This needs to be delayed as the active element is the body when the tab
// key is pressed, possibly along with others.
window.setTimeout(function () {
// Don't trigger `blur` if the focus is still in the selection
if (
(document.activeElement == self.$selection[0]) ||
($.contains(self.$selection[0], document.activeElement))
) {
return;
}
self.trigger('blur', evt);
}, 1);
};
BaseSelection.prototype._attachCloseHandler = function (container) {
var self = this;
$(document.body).on('mousedown.select2.' + container.id, function (e) {
var $target = $(e.target);
var $select = $target.closest('.select2');
var $all = $('.select2.select2-container--open');
$all.each(function () {
var $this = $(this);
if (this == $select[0]) {
return;
}
var $element = $this.data('element');
$element.select2('close');
});
});
};
BaseSelection.prototype._detachCloseHandler = function (container) {
$(document.body).off('mousedown.select2.' + container.id);
};
BaseSelection.prototype.position = function ($selection, $container) {
var $selectionContainer = $container.find('.selection');
$selectionContainer.append($selection);
};
BaseSelection.prototype.destroy = function () {
this._detachCloseHandler(this.container);
};
BaseSelection.prototype.update = function (data) {
throw new Error('The `update` method must be defined in child classes.');
};
return BaseSelection;
});
S2.define('select2/selection/single', [
'jquery',
'./base',
'../utils',
'../keys'
], function ($, BaseSelection, Utils, KEYS) {
function SingleSelection() {
SingleSelection.__super__.constructor.apply(this, arguments);
}
Utils.Extend(SingleSelection, BaseSelection);
SingleSelection.prototype.render = function () {
var $selection = SingleSelection.__super__.render.call(this);
$selection.addClass('select2-selection--single');
$selection.html(
'
' +
'
' +
' ' +
' '
);
return $selection;
};
SingleSelection.prototype.bind = function (container, $container) {
var self = this;
SingleSelection.__super__.bind.apply(this, arguments);
var id = container.id + '-container';
this.$selection.find('.select2-selection__rendered').attr('id', id);
this.$selection.attr('aria-labelledby', id);
this.$selection.on('mousedown', function (evt) {
// Only respond to left clicks
if (evt.which !== 1) {
return;
}
self.trigger('toggle', {
originalEvent: evt
});
});
this.$selection.on('focus', function (evt) {
// User focuses on the container
});
this.$selection.on('blur', function (evt) {
// User exits the container
});
container.on('selection:update', function (params) {
self.update(params.data);
});
};
SingleSelection.prototype.clear = function () {
this.$selection.find('.select2-selection__rendered').empty();
};
SingleSelection.prototype.display = function (data, container) {
var template = this.options.get('templateSelection');
var escapeMarkup = this.options.get('escapeMarkup');
return escapeMarkup(template(data, container));
};
SingleSelection.prototype.selectionContainer = function () {
return $('
');
};
SingleSelection.prototype.update = function (data) {
if (data.length === 0) {
this.clear();
return;
}
var selection = data[0];
var $rendered = this.$selection.find('.select2-selection__rendered');
var formatted = this.display(selection, $rendered);
$rendered.empty().append(formatted);
$rendered.prop('title', selection.title || selection.text);
};
return SingleSelection;
});
S2.define('select2/selection/multiple', [
'jquery',
'./base',
'../utils'
], function ($, BaseSelection, Utils) {
function MultipleSelection($element, options) {
MultipleSelection.__super__.constructor.apply(this, arguments);
}
Utils.Extend(MultipleSelection, BaseSelection);
MultipleSelection.prototype.render = function () {
var $selection = MultipleSelection.__super__.render.call(this);
$selection.addClass('select2-selection--multiple');
$selection.html(
'
'
);
return $selection;
};
MultipleSelection.prototype.bind = function (container, $container) {
var self = this;
MultipleSelection.__super__.bind.apply(this, arguments);
this.$selection.on('click', function (evt) {
self.trigger('toggle', {
originalEvent: evt
});
});
this.$selection.on(
'click',
'.select2-selection__choice__remove',
function (evt) {
// Ignore the event if it is disabled
if (self.options.get('disabled')) {
return;
}
var $remove = $(this);
var $selection = $remove.parent();
var data = $selection.data('data');
self.trigger('unselect', {
originalEvent: evt,
data: data
});
}
);
};
MultipleSelection.prototype.clear = function () {
this.$selection.find('.select2-selection__rendered').empty();
};
MultipleSelection.prototype.display = function (data, container) {
var template = this.options.get('templateSelection');
var escapeMarkup = this.options.get('escapeMarkup');
return escapeMarkup(template(data, container));
};
MultipleSelection.prototype.selectionContainer = function () {
var $container = $(
'
' +
'' +
'×' +
' ' +
' '
);
return $container;
};
MultipleSelection.prototype.update = function (data) {
this.clear();
if (data.length === 0) {
return;
}
var $selections = [];
for (var d = 0; d < data.length; d++) {
var selection = data[d];
var $selection = this.selectionContainer();
var formatted = this.display(selection, $selection);
$selection.append(formatted);
$selection.prop('title', selection.title || selection.text);
$selection.data('data', selection);
$selections.push($selection);
}
var $rendered = this.$selection.find('.select2-selection__rendered');
Utils.appendMany($rendered, $selections);
};
return MultipleSelection;
});
S2.define('select2/selection/placeholder', [
'../utils'
], function (Utils) {
function Placeholder(decorated, $element, options) {
this.placeholder = this.normalizePlaceholder(options.get('placeholder'));
decorated.call(this, $element, options);
}
Placeholder.prototype.normalizePlaceholder = function (_, placeholder) {
if (typeof placeholder === 'string') {
placeholder = {
id: '',
text: placeholder
};
}
return placeholder;
};
Placeholder.prototype.createPlaceholder = function (decorated, placeholder) {
var $placeholder = this.selectionContainer();
$placeholder.html(this.display(placeholder));
$placeholder.addClass('select2-selection__placeholder')
.removeClass('select2-selection__choice');
return $placeholder;
};
Placeholder.prototype.update = function (decorated, data) {
var singlePlaceholder = (
data.length == 1 && data[0].id != this.placeholder.id
);
var multipleSelections = data.length > 1;
if (multipleSelections || singlePlaceholder) {
return decorated.call(this, data);
}
this.clear();
var $placeholder = this.createPlaceholder(this.placeholder);
this.$selection.find('.select2-selection__rendered').append($placeholder);
};
return Placeholder;
});
S2.define('select2/selection/allowClear', [
'jquery',
'../keys'
], function ($, KEYS) {
function AllowClear() { }
AllowClear.prototype.bind = function (decorated, container, $container) {
var self = this;
decorated.call(this, container, $container);
if (this.placeholder == null) {
if (this.options.get('debug') && window.console && console.error) {
console.error(
'Select2: The `allowClear` option should be used in combination ' +
'with the `placeholder` option.'
);
}
}
this.$selection.on('mousedown', '.select2-selection__clear',
function (evt) {
self._handleClear(evt);
});
container.on('keypress', function (evt) {
self._handleKeyboardClear(evt, container);
});
};
AllowClear.prototype._handleClear = function (_, evt) {
// Ignore the event if it is disabled
if (this.options.get('disabled')) {
return;
}
var $clear = this.$selection.find('.select2-selection__clear');
// Ignore the event if nothing has been selected
if ($clear.length === 0) {
return;
}
evt.stopPropagation();
var data = $clear.data('data');
for (var d = 0; d < data.length; d++) {
var unselectData = {
data: data[d]
};
// Trigger the `unselect` event, so people can prevent it from being
// cleared.
this.trigger('unselect', unselectData);
// If the event was prevented, don't clear it out.
if (unselectData.prevented) {
return;
}
}
this.$element.val(this.placeholder.id).trigger('change');
this.trigger('toggle', {});
};
AllowClear.prototype._handleKeyboardClear = function (_, evt, container) {
if (container.isOpen()) {
return;
}
if (evt.which == KEYS.DELETE || evt.which == KEYS.BACKSPACE) {
this._handleClear(evt);
}
};
AllowClear.prototype.update = function (decorated, data) {
decorated.call(this, data);
if (this.$selection.find('.select2-selection__placeholder').length > 0 ||
data.length === 0) {
return;
}
var $remove = $(
'
' +
'×' +
' '
);
$remove.data('data', data);
this.$selection.find('.select2-selection__rendered').prepend($remove);
};
return AllowClear;
});
S2.define('select2/selection/search', [
'jquery',
'../utils',
'../keys'
], function ($, Utils, KEYS) {
function Search(decorated, $element, options) {
decorated.call(this, $element, options);
}
Search.prototype.render = function (decorated) {
var $search = $(
'
' +
' ' +
' '
);
this.$searchContainer = $search;
this.$search = $search.find('input');
var $rendered = decorated.call(this);
this._transferTabIndex();
return $rendered;
};
Search.prototype.bind = function (decorated, container, $container) {
var self = this;
decorated.call(this, container, $container);
container.on('open', function () {
self.$search.trigger('focus');
});
container.on('close', function () {
self.$search.val('');
self.$search.removeAttr('aria-activedescendant');
self.$search.trigger('focus');
});
container.on('enable', function () {
self.$search.prop('disabled', false);
self._transferTabIndex();
});
container.on('disable', function () {
self.$search.prop('disabled', true);
});
container.on('focus', function (evt) {
self.$search.trigger('focus');
});
container.on('results:focus', function (params) {
self.$search.attr('aria-activedescendant', params.id);
});
this.$selection.on('focusin', '.select2-search--inline', function (evt) {
self.trigger('focus', evt);
});
this.$selection.on('focusout', '.select2-search--inline', function (evt) {
self._handleBlur(evt);
});
this.$selection.on('keydown', '.select2-search--inline', function (evt) {
evt.stopPropagation();
self.trigger('keypress', evt);
self._keyUpPrevented = evt.isDefaultPrevented();
var key = evt.which;
if (key === KEYS.BACKSPACE && self.$search.val() === '') {
var $previousChoice = self.$searchContainer
.prev('.select2-selection__choice');
if ($previousChoice.length > 0) {
var item = $previousChoice.data('data');
self.searchRemoveChoice(item);
evt.preventDefault();
}
}
});
// Try to detect the IE version should the `documentMode` property that
// is stored on the document. This is only implemented in IE and is
// slightly cleaner than doing a user agent check.
// This property is not available in Edge, but Edge also doesn't have
// this bug.
var msie = document.documentMode;
var disableInputEvents = msie && msie <= 11;
// Workaround for browsers which do not support the `input` event
// This will prevent double-triggering of events for browsers which support
// both the `keyup` and `input` events.
this.$selection.on(
'input.searchcheck',
'.select2-search--inline',
function (evt) {
// IE will trigger the `input` event when a placeholder is used on a
// search box. To get around this issue, we are forced to ignore all
// `input` events in IE and keep using `keyup`.
if (disableInputEvents) {
self.$selection.off('input.search input.searchcheck');
return;
}
// Unbind the duplicated `keyup` event
self.$selection.off('keyup.search');
}
);
this.$selection.on(
'keyup.search input.search',
'.select2-search--inline',
function (evt) {
// IE will trigger the `input` event when a placeholder is used on a
// search box. To get around this issue, we are forced to ignore all
// `input` events in IE and keep using `keyup`.
if (disableInputEvents && evt.type === 'input') {
self.$selection.off('input.search input.searchcheck');
return;
}
var key = evt.which;
// We can freely ignore events from modifier keys
if (key == KEYS.SHIFT || key == KEYS.CTRL || key == KEYS.ALT) {
return;
}
// Tabbing will be handled during the `keydown` phase
if (key == KEYS.TAB) {
return;
}
self.handleSearch(evt);
}
);
};
/**
* This method will transfer the tabindex attribute from the rendered
* selection to the search box. This allows for the search box to be used as
* the primary focus instead of the selection container.
*
* @private
*/
Search.prototype._transferTabIndex = function (decorated) {
this.$search.attr('tabindex', this.$selection.attr('tabindex'));
this.$selection.attr('tabindex', '-1');
};
Search.prototype.createPlaceholder = function (decorated, placeholder) {
this.$search.attr('placeholder', placeholder.text);
};
Search.prototype.update = function (decorated, data) {
var searchHadFocus = this.$search[0] == document.activeElement;
this.$search.attr('placeholder', '');
decorated.call(this, data);
this.$selection.find('.select2-selection__rendered')
.append(this.$searchContainer);
this.resizeSearch();
if (searchHadFocus) {
this.$search.focus();
}
};
Search.prototype.handleSearch = function () {
this.resizeSearch();
if (!this._keyUpPrevented) {
var input = this.$search.val();
this.trigger('query', {
term: input
});
}
this._keyUpPrevented = false;
};
Search.prototype.searchRemoveChoice = function (decorated, item) {
this.trigger('unselect', {
data: item
});
this.$search.val(item.text);
this.handleSearch();
};
Search.prototype.resizeSearch = function () {
this.$search.css('width', '25px');
var width = '';
if (this.$search.attr('placeholder') !== '') {
width = this.$selection.find('.select2-selection__rendered').innerWidth();
} else {
var minimumWidth = this.$search.val().length + 1;
width = (minimumWidth * 0.75) + 'em';
}
this.$search.css('width', width);
};
return Search;
});
S2.define('select2/selection/eventRelay', [
'jquery'
], function ($) {
function EventRelay() { }
EventRelay.prototype.bind = function (decorated, container, $container) {
var self = this;
var relayEvents = [
'open', 'opening',
'close', 'closing',
'select', 'selecting',
'unselect', 'unselecting'
];
var preventableEvents = ['opening', 'closing', 'selecting', 'unselecting'];
decorated.call(this, container, $container);
container.on('*', function (name, params) {
// Ignore events that should not be relayed
if ($.inArray(name, relayEvents) === -1) {
return;
}
// The parameters should always be an object
params = params || {};
// Generate the jQuery event for the Select2 event
var evt = $.Event('select2:' + name, {
params: params
});
self.$element.trigger(evt);
// Only handle preventable events if it was one
if ($.inArray(name, preventableEvents) === -1) {
return;
}
params.prevented = evt.isDefaultPrevented();
});
};
return EventRelay;
});
S2.define('select2/translation', [
'jquery',
'require'
], function ($, require) {
function Translation(dict) {
this.dict = dict || {};
}
Translation.prototype.all = function () {
return this.dict;
};
Translation.prototype.get = function (key) {
return this.dict[key];
};
Translation.prototype.extend = function (translation) {
this.dict = $.extend({}, translation.all(), this.dict);
};
// Static functions
Translation._cache = {};
Translation.loadPath = function (path) {
if (!(path in Translation._cache)) {
var translations = require(path);
Translation._cache[path] = translations;
}
return new Translation(Translation._cache[path]);
};
return Translation;
});
S2.define('select2/diacritics', [
], function () {
var diacritics = {
'\u24B6': 'A',
'\uFF21': 'A',
'\u00C0': 'A',
'\u00C1': 'A',
'\u00C2': 'A',
'\u1EA6': 'A',
'\u1EA4': 'A',
'\u1EAA': 'A',
'\u1EA8': 'A',
'\u00C3': 'A',
'\u0100': 'A',
'\u0102': 'A',
'\u1EB0': 'A',
'\u1EAE': 'A',
'\u1EB4': 'A',
'\u1EB2': 'A',
'\u0226': 'A',
'\u01E0': 'A',
'\u00C4': 'A',
'\u01DE': 'A',
'\u1EA2': 'A',
'\u00C5': 'A',
'\u01FA': 'A',
'\u01CD': 'A',
'\u0200': 'A',
'\u0202': 'A',
'\u1EA0': 'A',
'\u1EAC': 'A',
'\u1EB6': 'A',
'\u1E00': 'A',
'\u0104': 'A',
'\u023A': 'A',
'\u2C6F': 'A',
'\uA732': 'AA',
'\u00C6': 'AE',
'\u01FC': 'AE',
'\u01E2': 'AE',
'\uA734': 'AO',
'\uA736': 'AU',
'\uA738': 'AV',
'\uA73A': 'AV',
'\uA73C': 'AY',
'\u24B7': 'B',
'\uFF22': 'B',
'\u1E02': 'B',
'\u1E04': 'B',
'\u1E06': 'B',
'\u0243': 'B',
'\u0182': 'B',
'\u0181': 'B',
'\u24B8': 'C',
'\uFF23': 'C',
'\u0106': 'C',
'\u0108': 'C',
'\u010A': 'C',
'\u010C': 'C',
'\u00C7': 'C',
'\u1E08': 'C',
'\u0187': 'C',
'\u023B': 'C',
'\uA73E': 'C',
'\u24B9': 'D',
'\uFF24': 'D',
'\u1E0A': 'D',
'\u010E': 'D',
'\u1E0C': 'D',
'\u1E10': 'D',
'\u1E12': 'D',
'\u1E0E': 'D',
'\u0110': 'D',
'\u018B': 'D',
'\u018A': 'D',
'\u0189': 'D',
'\uA779': 'D',
'\u01F1': 'DZ',
'\u01C4': 'DZ',
'\u01F2': 'Dz',
'\u01C5': 'Dz',
'\u24BA': 'E',
'\uFF25': 'E',
'\u00C8': 'E',
'\u00C9': 'E',
'\u00CA': 'E',
'\u1EC0': 'E',
'\u1EBE': 'E',
'\u1EC4': 'E',
'\u1EC2': 'E',
'\u1EBC': 'E',
'\u0112': 'E',
'\u1E14': 'E',
'\u1E16': 'E',
'\u0114': 'E',
'\u0116': 'E',
'\u00CB': 'E',
'\u1EBA': 'E',
'\u011A': 'E',
'\u0204': 'E',
'\u0206': 'E',
'\u1EB8': 'E',
'\u1EC6': 'E',
'\u0228': 'E',
'\u1E1C': 'E',
'\u0118': 'E',
'\u1E18': 'E',
'\u1E1A': 'E',
'\u0190': 'E',
'\u018E': 'E',
'\u24BB': 'F',
'\uFF26': 'F',
'\u1E1E': 'F',
'\u0191': 'F',
'\uA77B': 'F',
'\u24BC': 'G',
'\uFF27': 'G',
'\u01F4': 'G',
'\u011C': 'G',
'\u1E20': 'G',
'\u011E': 'G',
'\u0120': 'G',
'\u01E6': 'G',
'\u0122': 'G',
'\u01E4': 'G',
'\u0193': 'G',
'\uA7A0': 'G',
'\uA77D': 'G',
'\uA77E': 'G',
'\u24BD': 'H',
'\uFF28': 'H',
'\u0124': 'H',
'\u1E22': 'H',
'\u1E26': 'H',
'\u021E': 'H',
'\u1E24': 'H',
'\u1E28': 'H',
'\u1E2A': 'H',
'\u0126': 'H',
'\u2C67': 'H',
'\u2C75': 'H',
'\uA78D': 'H',
'\u24BE': 'I',
'\uFF29': 'I',
'\u00CC': 'I',
'\u00CD': 'I',
'\u00CE': 'I',
'\u0128': 'I',
'\u012A': 'I',
'\u012C': 'I',
'\u0130': 'I',
'\u00CF': 'I',
'\u1E2E': 'I',
'\u1EC8': 'I',
'\u01CF': 'I',
'\u0208': 'I',
'\u020A': 'I',
'\u1ECA': 'I',
'\u012E': 'I',
'\u1E2C': 'I',
'\u0197': 'I',
'\u24BF': 'J',
'\uFF2A': 'J',
'\u0134': 'J',
'\u0248': 'J',
'\u24C0': 'K',
'\uFF2B': 'K',
'\u1E30': 'K',
'\u01E8': 'K',
'\u1E32': 'K',
'\u0136': 'K',
'\u1E34': 'K',
'\u0198': 'K',
'\u2C69': 'K',
'\uA740': 'K',
'\uA742': 'K',
'\uA744': 'K',
'\uA7A2': 'K',
'\u24C1': 'L',
'\uFF2C': 'L',
'\u013F': 'L',
'\u0139': 'L',
'\u013D': 'L',
'\u1E36': 'L',
'\u1E38': 'L',
'\u013B': 'L',
'\u1E3C': 'L',
'\u1E3A': 'L',
'\u0141': 'L',
'\u023D': 'L',
'\u2C62': 'L',
'\u2C60': 'L',
'\uA748': 'L',
'\uA746': 'L',
'\uA780': 'L',
'\u01C7': 'LJ',
'\u01C8': 'Lj',
'\u24C2': 'M',
'\uFF2D': 'M',
'\u1E3E': 'M',
'\u1E40': 'M',
'\u1E42': 'M',
'\u2C6E': 'M',
'\u019C': 'M',
'\u24C3': 'N',
'\uFF2E': 'N',
'\u01F8': 'N',
'\u0143': 'N',
'\u00D1': 'N',
'\u1E44': 'N',
'\u0147': 'N',
'\u1E46': 'N',
'\u0145': 'N',
'\u1E4A': 'N',
'\u1E48': 'N',
'\u0220': 'N',
'\u019D': 'N',
'\uA790': 'N',
'\uA7A4': 'N',
'\u01CA': 'NJ',
'\u01CB': 'Nj',
'\u24C4': 'O',
'\uFF2F': 'O',
'\u00D2': 'O',
'\u00D3': 'O',
'\u00D4': 'O',
'\u1ED2': 'O',
'\u1ED0': 'O',
'\u1ED6': 'O',
'\u1ED4': 'O',
'\u00D5': 'O',
'\u1E4C': 'O',
'\u022C': 'O',
'\u1E4E': 'O',
'\u014C': 'O',
'\u1E50': 'O',
'\u1E52': 'O',
'\u014E': 'O',
'\u022E': 'O',
'\u0230': 'O',
'\u00D6': 'O',
'\u022A': 'O',
'\u1ECE': 'O',
'\u0150': 'O',
'\u01D1': 'O',
'\u020C': 'O',
'\u020E': 'O',
'\u01A0': 'O',
'\u1EDC': 'O',
'\u1EDA': 'O',
'\u1EE0': 'O',
'\u1EDE': 'O',
'\u1EE2': 'O',
'\u1ECC': 'O',
'\u1ED8': 'O',
'\u01EA': 'O',
'\u01EC': 'O',
'\u00D8': 'O',
'\u01FE': 'O',
'\u0186': 'O',
'\u019F': 'O',
'\uA74A': 'O',
'\uA74C': 'O',
'\u01A2': 'OI',
'\uA74E': 'OO',
'\u0222': 'OU',
'\u24C5': 'P',
'\uFF30': 'P',
'\u1E54': 'P',
'\u1E56': 'P',
'\u01A4': 'P',
'\u2C63': 'P',
'\uA750': 'P',
'\uA752': 'P',
'\uA754': 'P',
'\u24C6': 'Q',
'\uFF31': 'Q',
'\uA756': 'Q',
'\uA758': 'Q',
'\u024A': 'Q',
'\u24C7': 'R',
'\uFF32': 'R',
'\u0154': 'R',
'\u1E58': 'R',
'\u0158': 'R',
'\u0210': 'R',
'\u0212': 'R',
'\u1E5A': 'R',
'\u1E5C': 'R',
'\u0156': 'R',
'\u1E5E': 'R',
'\u024C': 'R',
'\u2C64': 'R',
'\uA75A': 'R',
'\uA7A6': 'R',
'\uA782': 'R',
'\u24C8': 'S',
'\uFF33': 'S',
'\u1E9E': 'S',
'\u015A': 'S',
'\u1E64': 'S',
'\u015C': 'S',
'\u1E60': 'S',
'\u0160': 'S',
'\u1E66': 'S',
'\u1E62': 'S',
'\u1E68': 'S',
'\u0218': 'S',
'\u015E': 'S',
'\u2C7E': 'S',
'\uA7A8': 'S',
'\uA784': 'S',
'\u24C9': 'T',
'\uFF34': 'T',
'\u1E6A': 'T',
'\u0164': 'T',
'\u1E6C': 'T',
'\u021A': 'T',
'\u0162': 'T',
'\u1E70': 'T',
'\u1E6E': 'T',
'\u0166': 'T',
'\u01AC': 'T',
'\u01AE': 'T',
'\u023E': 'T',
'\uA786': 'T',
'\uA728': 'TZ',
'\u24CA': 'U',
'\uFF35': 'U',
'\u00D9': 'U',
'\u00DA': 'U',
'\u00DB': 'U',
'\u0168': 'U',
'\u1E78': 'U',
'\u016A': 'U',
'\u1E7A': 'U',
'\u016C': 'U',
'\u00DC': 'U',
'\u01DB': 'U',
'\u01D7': 'U',
'\u01D5': 'U',
'\u01D9': 'U',
'\u1EE6': 'U',
'\u016E': 'U',
'\u0170': 'U',
'\u01D3': 'U',
'\u0214': 'U',
'\u0216': 'U',
'\u01AF': 'U',
'\u1EEA': 'U',
'\u1EE8': 'U',
'\u1EEE': 'U',
'\u1EEC': 'U',
'\u1EF0': 'U',
'\u1EE4': 'U',
'\u1E72': 'U',
'\u0172': 'U',
'\u1E76': 'U',
'\u1E74': 'U',
'\u0244': 'U',
'\u24CB': 'V',
'\uFF36': 'V',
'\u1E7C': 'V',
'\u1E7E': 'V',
'\u01B2': 'V',
'\uA75E': 'V',
'\u0245': 'V',
'\uA760': 'VY',
'\u24CC': 'W',
'\uFF37': 'W',
'\u1E80': 'W',
'\u1E82': 'W',
'\u0174': 'W',
'\u1E86': 'W',
'\u1E84': 'W',
'\u1E88': 'W',
'\u2C72': 'W',
'\u24CD': 'X',
'\uFF38': 'X',
'\u1E8A': 'X',
'\u1E8C': 'X',
'\u24CE': 'Y',
'\uFF39': 'Y',
'\u1EF2': 'Y',
'\u00DD': 'Y',
'\u0176': 'Y',
'\u1EF8': 'Y',
'\u0232': 'Y',
'\u1E8E': 'Y',
'\u0178': 'Y',
'\u1EF6': 'Y',
'\u1EF4': 'Y',
'\u01B3': 'Y',
'\u024E': 'Y',
'\u1EFE': 'Y',
'\u24CF': 'Z',
'\uFF3A': 'Z',
'\u0179': 'Z',
'\u1E90': 'Z',
'\u017B': 'Z',
'\u017D': 'Z',
'\u1E92': 'Z',
'\u1E94': 'Z',
'\u01B5': 'Z',
'\u0224': 'Z',
'\u2C7F': 'Z',
'\u2C6B': 'Z',
'\uA762': 'Z',
'\u24D0': 'a',
'\uFF41': 'a',
'\u1E9A': 'a',
'\u00E0': 'a',
'\u00E1': 'a',
'\u00E2': 'a',
'\u1EA7': 'a',
'\u1EA5': 'a',
'\u1EAB': 'a',
'\u1EA9': 'a',
'\u00E3': 'a',
'\u0101': 'a',
'\u0103': 'a',
'\u1EB1': 'a',
'\u1EAF': 'a',
'\u1EB5': 'a',
'\u1EB3': 'a',
'\u0227': 'a',
'\u01E1': 'a',
'\u00E4': 'a',
'\u01DF': 'a',
'\u1EA3': 'a',
'\u00E5': 'a',
'\u01FB': 'a',
'\u01CE': 'a',
'\u0201': 'a',
'\u0203': 'a',
'\u1EA1': 'a',
'\u1EAD': 'a',
'\u1EB7': 'a',
'\u1E01': 'a',
'\u0105': 'a',
'\u2C65': 'a',
'\u0250': 'a',
'\uA733': 'aa',
'\u00E6': 'ae',
'\u01FD': 'ae',
'\u01E3': 'ae',
'\uA735': 'ao',
'\uA737': 'au',
'\uA739': 'av',
'\uA73B': 'av',
'\uA73D': 'ay',
'\u24D1': 'b',
'\uFF42': 'b',
'\u1E03': 'b',
'\u1E05': 'b',
'\u1E07': 'b',
'\u0180': 'b',
'\u0183': 'b',
'\u0253': 'b',
'\u24D2': 'c',
'\uFF43': 'c',
'\u0107': 'c',
'\u0109': 'c',
'\u010B': 'c',
'\u010D': 'c',
'\u00E7': 'c',
'\u1E09': 'c',
'\u0188': 'c',
'\u023C': 'c',
'\uA73F': 'c',
'\u2184': 'c',
'\u24D3': 'd',
'\uFF44': 'd',
'\u1E0B': 'd',
'\u010F': 'd',
'\u1E0D': 'd',
'\u1E11': 'd',
'\u1E13': 'd',
'\u1E0F': 'd',
'\u0111': 'd',
'\u018C': 'd',
'\u0256': 'd',
'\u0257': 'd',
'\uA77A': 'd',
'\u01F3': 'dz',
'\u01C6': 'dz',
'\u24D4': 'e',
'\uFF45': 'e',
'\u00E8': 'e',
'\u00E9': 'e',
'\u00EA': 'e',
'\u1EC1': 'e',
'\u1EBF': 'e',
'\u1EC5': 'e',
'\u1EC3': 'e',
'\u1EBD': 'e',
'\u0113': 'e',
'\u1E15': 'e',
'\u1E17': 'e',
'\u0115': 'e',
'\u0117': 'e',
'\u00EB': 'e',
'\u1EBB': 'e',
'\u011B': 'e',
'\u0205': 'e',
'\u0207': 'e',
'\u1EB9': 'e',
'\u1EC7': 'e',
'\u0229': 'e',
'\u1E1D': 'e',
'\u0119': 'e',
'\u1E19': 'e',
'\u1E1B': 'e',
'\u0247': 'e',
'\u025B': 'e',
'\u01DD': 'e',
'\u24D5': 'f',
'\uFF46': 'f',
'\u1E1F': 'f',
'\u0192': 'f',
'\uA77C': 'f',
'\u24D6': 'g',
'\uFF47': 'g',
'\u01F5': 'g',
'\u011D': 'g',
'\u1E21': 'g',
'\u011F': 'g',
'\u0121': 'g',
'\u01E7': 'g',
'\u0123': 'g',
'\u01E5': 'g',
'\u0260': 'g',
'\uA7A1': 'g',
'\u1D79': 'g',
'\uA77F': 'g',
'\u24D7': 'h',
'\uFF48': 'h',
'\u0125': 'h',
'\u1E23': 'h',
'\u1E27': 'h',
'\u021F': 'h',
'\u1E25': 'h',
'\u1E29': 'h',
'\u1E2B': 'h',
'\u1E96': 'h',
'\u0127': 'h',
'\u2C68': 'h',
'\u2C76': 'h',
'\u0265': 'h',
'\u0195': 'hv',
'\u24D8': 'i',
'\uFF49': 'i',
'\u00EC': 'i',
'\u00ED': 'i',
'\u00EE': 'i',
'\u0129': 'i',
'\u012B': 'i',
'\u012D': 'i',
'\u00EF': 'i',
'\u1E2F': 'i',
'\u1EC9': 'i',
'\u01D0': 'i',
'\u0209': 'i',
'\u020B': 'i',
'\u1ECB': 'i',
'\u012F': 'i',
'\u1E2D': 'i',
'\u0268': 'i',
'\u0131': 'i',
'\u24D9': 'j',
'\uFF4A': 'j',
'\u0135': 'j',
'\u01F0': 'j',
'\u0249': 'j',
'\u24DA': 'k',
'\uFF4B': 'k',
'\u1E31': 'k',
'\u01E9': 'k',
'\u1E33': 'k',
'\u0137': 'k',
'\u1E35': 'k',
'\u0199': 'k',
'\u2C6A': 'k',
'\uA741': 'k',
'\uA743': 'k',
'\uA745': 'k',
'\uA7A3': 'k',
'\u24DB': 'l',
'\uFF4C': 'l',
'\u0140': 'l',
'\u013A': 'l',
'\u013E': 'l',
'\u1E37': 'l',
'\u1E39': 'l',
'\u013C': 'l',
'\u1E3D': 'l',
'\u1E3B': 'l',
'\u017F': 'l',
'\u0142': 'l',
'\u019A': 'l',
'\u026B': 'l',
'\u2C61': 'l',
'\uA749': 'l',
'\uA781': 'l',
'\uA747': 'l',
'\u01C9': 'lj',
'\u24DC': 'm',
'\uFF4D': 'm',
'\u1E3F': 'm',
'\u1E41': 'm',
'\u1E43': 'm',
'\u0271': 'm',
'\u026F': 'm',
'\u24DD': 'n',
'\uFF4E': 'n',
'\u01F9': 'n',
'\u0144': 'n',
'\u00F1': 'n',
'\u1E45': 'n',
'\u0148': 'n',
'\u1E47': 'n',
'\u0146': 'n',
'\u1E4B': 'n',
'\u1E49': 'n',
'\u019E': 'n',
'\u0272': 'n',
'\u0149': 'n',
'\uA791': 'n',
'\uA7A5': 'n',
'\u01CC': 'nj',
'\u24DE': 'o',
'\uFF4F': 'o',
'\u00F2': 'o',
'\u00F3': 'o',
'\u00F4': 'o',
'\u1ED3': 'o',
'\u1ED1': 'o',
'\u1ED7': 'o',
'\u1ED5': 'o',
'\u00F5': 'o',
'\u1E4D': 'o',
'\u022D': 'o',
'\u1E4F': 'o',
'\u014D': 'o',
'\u1E51': 'o',
'\u1E53': 'o',
'\u014F': 'o',
'\u022F': 'o',
'\u0231': 'o',
'\u00F6': 'o',
'\u022B': 'o',
'\u1ECF': 'o',
'\u0151': 'o',
'\u01D2': 'o',
'\u020D': 'o',
'\u020F': 'o',
'\u01A1': 'o',
'\u1EDD': 'o',
'\u1EDB': 'o',
'\u1EE1': 'o',
'\u1EDF': 'o',
'\u1EE3': 'o',
'\u1ECD': 'o',
'\u1ED9': 'o',
'\u01EB': 'o',
'\u01ED': 'o',
'\u00F8': 'o',
'\u01FF': 'o',
'\u0254': 'o',
'\uA74B': 'o',
'\uA74D': 'o',
'\u0275': 'o',
'\u01A3': 'oi',
'\u0223': 'ou',
'\uA74F': 'oo',
'\u24DF': 'p',
'\uFF50': 'p',
'\u1E55': 'p',
'\u1E57': 'p',
'\u01A5': 'p',
'\u1D7D': 'p',
'\uA751': 'p',
'\uA753': 'p',
'\uA755': 'p',
'\u24E0': 'q',
'\uFF51': 'q',
'\u024B': 'q',
'\uA757': 'q',
'\uA759': 'q',
'\u24E1': 'r',
'\uFF52': 'r',
'\u0155': 'r',
'\u1E59': 'r',
'\u0159': 'r',
'\u0211': 'r',
'\u0213': 'r',
'\u1E5B': 'r',
'\u1E5D': 'r',
'\u0157': 'r',
'\u1E5F': 'r',
'\u024D': 'r',
'\u027D': 'r',
'\uA75B': 'r',
'\uA7A7': 'r',
'\uA783': 'r',
'\u24E2': 's',
'\uFF53': 's',
'\u00DF': 's',
'\u015B': 's',
'\u1E65': 's',
'\u015D': 's',
'\u1E61': 's',
'\u0161': 's',
'\u1E67': 's',
'\u1E63': 's',
'\u1E69': 's',
'\u0219': 's',
'\u015F': 's',
'\u023F': 's',
'\uA7A9': 's',
'\uA785': 's',
'\u1E9B': 's',
'\u24E3': 't',
'\uFF54': 't',
'\u1E6B': 't',
'\u1E97': 't',
'\u0165': 't',
'\u1E6D': 't',
'\u021B': 't',
'\u0163': 't',
'\u1E71': 't',
'\u1E6F': 't',
'\u0167': 't',
'\u01AD': 't',
'\u0288': 't',
'\u2C66': 't',
'\uA787': 't',
'\uA729': 'tz',
'\u24E4': 'u',
'\uFF55': 'u',
'\u00F9': 'u',
'\u00FA': 'u',
'\u00FB': 'u',
'\u0169': 'u',
'\u1E79': 'u',
'\u016B': 'u',
'\u1E7B': 'u',
'\u016D': 'u',
'\u00FC': 'u',
'\u01DC': 'u',
'\u01D8': 'u',
'\u01D6': 'u',
'\u01DA': 'u',
'\u1EE7': 'u',
'\u016F': 'u',
'\u0171': 'u',
'\u01D4': 'u',
'\u0215': 'u',
'\u0217': 'u',
'\u01B0': 'u',
'\u1EEB': 'u',
'\u1EE9': 'u',
'\u1EEF': 'u',
'\u1EED': 'u',
'\u1EF1': 'u',
'\u1EE5': 'u',
'\u1E73': 'u',
'\u0173': 'u',
'\u1E77': 'u',
'\u1E75': 'u',
'\u0289': 'u',
'\u24E5': 'v',
'\uFF56': 'v',
'\u1E7D': 'v',
'\u1E7F': 'v',
'\u028B': 'v',
'\uA75F': 'v',
'\u028C': 'v',
'\uA761': 'vy',
'\u24E6': 'w',
'\uFF57': 'w',
'\u1E81': 'w',
'\u1E83': 'w',
'\u0175': 'w',
'\u1E87': 'w',
'\u1E85': 'w',
'\u1E98': 'w',
'\u1E89': 'w',
'\u2C73': 'w',
'\u24E7': 'x',
'\uFF58': 'x',
'\u1E8B': 'x',
'\u1E8D': 'x',
'\u24E8': 'y',
'\uFF59': 'y',
'\u1EF3': 'y',
'\u00FD': 'y',
'\u0177': 'y',
'\u1EF9': 'y',
'\u0233': 'y',
'\u1E8F': 'y',
'\u00FF': 'y',
'\u1EF7': 'y',
'\u1E99': 'y',
'\u1EF5': 'y',
'\u01B4': 'y',
'\u024F': 'y',
'\u1EFF': 'y',
'\u24E9': 'z',
'\uFF5A': 'z',
'\u017A': 'z',
'\u1E91': 'z',
'\u017C': 'z',
'\u017E': 'z',
'\u1E93': 'z',
'\u1E95': 'z',
'\u01B6': 'z',
'\u0225': 'z',
'\u0240': 'z',
'\u2C6C': 'z',
'\uA763': 'z',
'\u0386': '\u0391',
'\u0388': '\u0395',
'\u0389': '\u0397',
'\u038A': '\u0399',
'\u03AA': '\u0399',
'\u038C': '\u039F',
'\u038E': '\u03A5',
'\u03AB': '\u03A5',
'\u038F': '\u03A9',
'\u03AC': '\u03B1',
'\u03AD': '\u03B5',
'\u03AE': '\u03B7',
'\u03AF': '\u03B9',
'\u03CA': '\u03B9',
'\u0390': '\u03B9',
'\u03CC': '\u03BF',
'\u03CD': '\u03C5',
'\u03CB': '\u03C5',
'\u03B0': '\u03C5',
'\u03C9': '\u03C9',
'\u03C2': '\u03C3'
};
return diacritics;
});
S2.define('select2/data/base', [
'../utils'
], function (Utils) {
function BaseAdapter($element, options) {
BaseAdapter.__super__.constructor.call(this);
}
Utils.Extend(BaseAdapter, Utils.Observable);
BaseAdapter.prototype.current = function (callback) {
throw new Error('The `current` method must be defined in child classes.');
};
BaseAdapter.prototype.query = function (params, callback) {
throw new Error('The `query` method must be defined in child classes.');
};
BaseAdapter.prototype.bind = function (container, $container) {
// Can be implemented in subclasses
};
BaseAdapter.prototype.destroy = function () {
// Can be implemented in subclasses
};
BaseAdapter.prototype.generateResultId = function (container, data) {
var id = container.id + '-result-';
id += Utils.generateChars(4);
if (data.id != null) {
id += '-' + data.id.toString();
} else {
id += '-' + Utils.generateChars(4);
}
return id;
};
return BaseAdapter;
});
S2.define('select2/data/select', [
'./base',
'../utils',
'jquery'
], function (BaseAdapter, Utils, $) {
function SelectAdapter($element, options) {
this.$element = $element;
this.options = options;
SelectAdapter.__super__.constructor.call(this);
}
Utils.Extend(SelectAdapter, BaseAdapter);
SelectAdapter.prototype.current = function (callback) {
var data = [];
var self = this;
this.$element.find(':selected').each(function () {
var $option = $(this);
var option = self.item($option);
data.push(option);
});
callback(data);
};
SelectAdapter.prototype.select = function (data) {
var self = this;
data.selected = true;
// If data.element is a DOM node, use it instead
if ($(data.element).is('option')) {
data.element.selected = true;
this.$element.trigger('change');
return;
}
if (this.$element.prop('multiple')) {
this.current(function (currentData) {
var val = [];
data = [data];
data.push.apply(data, currentData);
for (var d = 0; d < data.length; d++) {
var id = data[d].id;
if ($.inArray(id, val) === -1) {
val.push(id);
}
}
self.$element.val(val);
self.$element.trigger('change');
});
} else {
var val = data.id;
this.$element.val(val);
this.$element.trigger('change');
}
};
SelectAdapter.prototype.unselect = function (data) {
var self = this;
if (!this.$element.prop('multiple')) {
return;
}
data.selected = false;
if ($(data.element).is('option')) {
data.element.selected = false;
this.$element.trigger('change');
return;
}
this.current(function (currentData) {
var val = [];
for (var d = 0; d < currentData.length; d++) {
var id = currentData[d].id;
if (id !== data.id && $.inArray(id, val) === -1) {
val.push(id);
}
}
self.$element.val(val);
self.$element.trigger('change');
});
};
SelectAdapter.prototype.bind = function (container, $container) {
var self = this;
this.container = container;
container.on('select', function (params) {
self.select(params.data);
});
container.on('unselect', function (params) {
self.unselect(params.data);
});
};
SelectAdapter.prototype.destroy = function () {
// Remove anything added to child elements
this.$element.find('*').each(function () {
// Remove any custom data set by Select2
$.removeData(this, 'data');
});
};
SelectAdapter.prototype.query = function (params, callback) {
var data = [];
var self = this;
var $options = this.$element.children();
$options.each(function () {
var $option = $(this);
if (!$option.is('option') && !$option.is('optgroup')) {
return;
}
var option = self.item($option);
var matches = self.matches(params, option);
if (matches !== null) {
data.push(matches);
}
});
callback({
results: data
});
};
SelectAdapter.prototype.addOptions = function ($options) {
Utils.appendMany(this.$element, $options);
};
SelectAdapter.prototype.option = function (data) {
var option;
if (data.children) {
option = document.createElement('optgroup');
option.label = data.text;
} else {
option = document.createElement('option');
if (option.textContent !== undefined) {
option.textContent = data.text;
} else {
option.innerText = data.text;
}
}
if (data.id) {
option.value = data.id;
}
if (data.disabled) {
option.disabled = true;
}
if (data.selected) {
option.selected = true;
}
if (data.title) {
option.title = data.title;
}
var $option = $(option);
var normalizedData = this._normalizeItem(data);
normalizedData.element = option;
// Override the option's data with the combined data
$.data(option, 'data', normalizedData);
return $option;
};
SelectAdapter.prototype.item = function ($option) {
var data = {};
data = $.data($option[0], 'data');
if (data != null) {
return data;
}
if ($option.is('option')) {
data = {
id: $option.val(),
text: $option.text(),
disabled: $option.prop('disabled'),
selected: $option.prop('selected'),
title: $option.prop('title')
};
} else if ($option.is('optgroup')) {
data = {
text: $option.prop('label'),
children: [],
title: $option.prop('title')
};
var $children = $option.children('option');
var children = [];
for (var c = 0; c < $children.length; c++) {
var $child = $($children[c]);
var child = this.item($child);
children.push(child);
}
data.children = children;
}
data = this._normalizeItem(data);
data.element = $option[0];
$.data($option[0], 'data', data);
return data;
};
SelectAdapter.prototype._normalizeItem = function (item) {
if (!$.isPlainObject(item)) {
item = {
id: item,
text: item
};
}
item = $.extend({}, {
text: ''
}, item);
var defaults = {
selected: false,
disabled: false
};
if (item.id != null) {
item.id = item.id.toString();
}
if (item.text != null) {
item.text = item.text.toString();
}
if (item._resultId == null && item.id && this.container != null) {
item._resultId = this.generateResultId(this.container, item);
}
return $.extend({}, defaults, item);
};
SelectAdapter.prototype.matches = function (params, data) {
var matcher = this.options.get('matcher');
return matcher(params, data);
};
return SelectAdapter;
});
S2.define('select2/data/array', [
'./select',
'../utils',
'jquery'
], function (SelectAdapter, Utils, $) {
function ArrayAdapter($element, options) {
var data = options.get('data') || [];
ArrayAdapter.__super__.constructor.call(this, $element, options);
this.addOptions(this.convertToOptions(data));
}
Utils.Extend(ArrayAdapter, SelectAdapter);
ArrayAdapter.prototype.select = function (data) {
var $option = this.$element.find('option').filter(function (i, elm) {
return elm.value == data.id.toString();
});
if ($option.length === 0) {
$option = this.option(data);
this.addOptions($option);
}
ArrayAdapter.__super__.select.call(this, data);
};
ArrayAdapter.prototype.convertToOptions = function (data) {
var self = this;
var $existing = this.$element.find('option');
var existingIds = $existing.map(function () {
return self.item($(this)).id;
}).get();
var $options = [];
// Filter out all items except for the one passed in the argument
function onlyItem(item) {
return function () {
return $(this).val() == item.id;
};
}
for (var d = 0; d < data.length; d++) {
var item = this._normalizeItem(data[d]);
// Skip items which were pre-loaded, only merge the data
if ($.inArray(item.id, existingIds) >= 0) {
var $existingOption = $existing.filter(onlyItem(item));
var existingData = this.item($existingOption);
var newData = $.extend(true, {}, item, existingData);
var $newOption = this.option(newData);
$existingOption.replaceWith($newOption);
continue;
}
var $option = this.option(item);
if (item.children) {
var $children = this.convertToOptions(item.children);
Utils.appendMany($option, $children);
}
$options.push($option);
}
return $options;
};
return ArrayAdapter;
});
S2.define('select2/data/ajax', [
'./array',
'../utils',
'jquery'
], function (ArrayAdapter, Utils, $) {
function AjaxAdapter($element, options) {
this.ajaxOptions = this._applyDefaults(options.get('ajax'));
if (this.ajaxOptions.processResults != null) {
this.processResults = this.ajaxOptions.processResults;
}
AjaxAdapter.__super__.constructor.call(this, $element, options);
}
Utils.Extend(AjaxAdapter, ArrayAdapter);
AjaxAdapter.prototype._applyDefaults = function (options) {
var defaults = {
data: function (params) {
return $.extend({}, params, {
q: params.term
});
},
transport: function (params, success, failure) {
var $request = $.ajax(params);
$request.then(success);
$request.fail(failure);
return $request;
}
};
return $.extend({}, defaults, options, true);
};
AjaxAdapter.prototype.processResults = function (results) {
return results;
};
AjaxAdapter.prototype.query = function (params, callback) {
var matches = [];
var self = this;
if (this._request != null) {
// JSONP requests cannot always be aborted
if ($.isFunction(this._request.abort)) {
this._request.abort();
}
this._request = null;
}
var options = $.extend({
type: 'GET'
}, this.ajaxOptions);
if (typeof options.url === 'function') {
options.url = options.url.call(this.$element, params);
}
if (typeof options.data === 'function') {
options.data = options.data.call(this.$element, params);
}
function request() {
var $request = options.transport(options, function (data) {
var results = self.processResults(data, params);
if (self.options.get('debug') && window.console && console.error) {
// Check to make sure that the response included a `results` key.
if (!results || !results.results || !$.isArray(results.results)) {
console.error(
'Select2: The AJAX results did not return an array in the ' +
'`results` key of the response.'
);
}
}
callback(results);
}, function () {
self.trigger('results:message', {
message: 'errorLoading'
});
});
self._request = $request;
}
if (this.ajaxOptions.delay && params.term !== '') {
if (this._queryTimeout) {
window.clearTimeout(this._queryTimeout);
}
this._queryTimeout = window.setTimeout(request, this.ajaxOptions.delay);
} else {
request();
}
};
return AjaxAdapter;
});
S2.define('select2/data/tags', [
'jquery'
], function ($) {
function Tags(decorated, $element, options) {
var tags = options.get('tags');
var createTag = options.get('createTag');
if (createTag !== undefined) {
this.createTag = createTag;
}
var insertTag = options.get('insertTag');
if (insertTag !== undefined) {
this.insertTag = insertTag;
}
decorated.call(this, $element, options);
if ($.isArray(tags)) {
for (var t = 0; t < tags.length; t++) {
var tag = tags[t];
var item = this._normalizeItem(tag);
var $option = this.option(item);
this.$element.append($option);
}
}
}
Tags.prototype.query = function (decorated, params, callback) {
var self = this;
this._removeOldTags();
if (params.term == null || params.page != null) {
decorated.call(this, params, callback);
return;
}
function wrapper(obj, child) {
var data = obj.results;
for (var i = 0; i < data.length; i++) {
var option = data[i];
var checkChildren = (
option.children != null &&
!wrapper({
results: option.children
}, true)
);
var checkText = option.text === params.term;
if (checkText || checkChildren) {
if (child) {
return false;
}
obj.data = data;
callback(obj);
return;
}
}
if (child) {
return true;
}
var tag = self.createTag(params);
if (tag != null) {
var $option = self.option(tag);
$option.attr('data-select2-tag', true);
self.addOptions([$option]);
self.insertTag(data, tag);
}
obj.results = data;
callback(obj);
}
decorated.call(this, params, wrapper);
};
Tags.prototype.createTag = function (decorated, params) {
var term = $.trim(params.term);
if (term === '') {
return null;
}
return {
id: term,
text: term
};
};
Tags.prototype.insertTag = function (_, data, tag) {
data.unshift(tag);
};
Tags.prototype._removeOldTags = function (_) {
var tag = this._lastTag;
var $options = this.$element.find('option[data-select2-tag]');
$options.each(function () {
if (this.selected) {
return;
}
$(this).remove();
});
};
return Tags;
});
S2.define('select2/data/tokenizer', [
'jquery'
], function ($) {
function Tokenizer(decorated, $element, options) {
var tokenizer = options.get('tokenizer');
if (tokenizer !== undefined) {
this.tokenizer = tokenizer;
}
decorated.call(this, $element, options);
}
Tokenizer.prototype.bind = function (decorated, container, $container) {
decorated.call(this, container, $container);
this.$search = container.dropdown.$search || container.selection.$search ||
$container.find('.select2-search__field');
};
Tokenizer.prototype.query = function (decorated, params, callback) {
var self = this;
function select(data) {
self.trigger('select', {
data: data
});
}
params.term = params.term || '';
var tokenData = this.tokenizer(params, this.options, select);
if (tokenData.term !== params.term) {
// Replace the search term if we have the search box
if (this.$search.length) {
this.$search.val(tokenData.term);
this.$search.focus();
}
params.term = tokenData.term;
}
decorated.call(this, params, callback);
};
Tokenizer.prototype.tokenizer = function (_, params, options, callback) {
var separators = options.get('tokenSeparators') || [];
var term = params.term;
var i = 0;
var createTag = this.createTag || function (params) {
return {
id: params.term,
text: params.term
};
};
while (i < term.length) {
var termChar = term[i];
if ($.inArray(termChar, separators) === -1) {
i++;
continue;
}
var part = term.substr(0, i);
var partParams = $.extend({}, params, {
term: part
});
var data = createTag(partParams);
if (data == null) {
i++;
continue;
}
callback(data);
// Reset the term to not include the tokenized portion
term = term.substr(i + 1) || '';
i = 0;
}
return {
term: term
};
};
return Tokenizer;
});
S2.define('select2/data/minimumInputLength', [
], function () {
function MinimumInputLength(decorated, $e, options) {
this.minimumInputLength = options.get('minimumInputLength');
decorated.call(this, $e, options);
}
MinimumInputLength.prototype.query = function (decorated, params, callback) {
params.term = params.term || '';
if (params.term.length < this.minimumInputLength) {
this.trigger('results:message', {
message: 'inputTooShort',
args: {
minimum: this.minimumInputLength,
input: params.term,
params: params
}
});
return;
}
decorated.call(this, params, callback);
};
return MinimumInputLength;
});
S2.define('select2/data/maximumInputLength', [
], function () {
function MaximumInputLength(decorated, $e, options) {
this.maximumInputLength = options.get('maximumInputLength');
decorated.call(this, $e, options);
}
MaximumInputLength.prototype.query = function (decorated, params, callback) {
params.term = params.term || '';
if (this.maximumInputLength > 0 &&
params.term.length > this.maximumInputLength) {
this.trigger('results:message', {
message: 'inputTooLong',
args: {
maximum: this.maximumInputLength,
input: params.term,
params: params
}
});
return;
}
decorated.call(this, params, callback);
};
return MaximumInputLength;
});
S2.define('select2/data/maximumSelectionLength', [
], function () {
function MaximumSelectionLength(decorated, $e, options) {
this.maximumSelectionLength = options.get('maximumSelectionLength');
decorated.call(this, $e, options);
}
MaximumSelectionLength.prototype.query =
function (decorated, params, callback) {
var self = this;
this.current(function (currentData) {
var count = currentData != null ? currentData.length : 0;
if (self.maximumSelectionLength > 0 &&
count >= self.maximumSelectionLength) {
self.trigger('results:message', {
message: 'maximumSelected',
args: {
maximum: self.maximumSelectionLength
}
});
return;
}
decorated.call(self, params, callback);
});
};
return MaximumSelectionLength;
});
S2.define('select2/dropdown', [
'jquery',
'./utils'
], function ($, Utils) {
function Dropdown($element, options) {
this.$element = $element;
this.options = options;
Dropdown.__super__.constructor.call(this);
}
Utils.Extend(Dropdown, Utils.Observable);
Dropdown.prototype.render = function () {
var $dropdown = $(
'
' +
' ' +
' '
);
$dropdown.attr('dir', this.options.get('dir'));
this.$dropdown = $dropdown;
return $dropdown;
};
Dropdown.prototype.bind = function () {
// Should be implemented in subclasses
};
Dropdown.prototype.position = function ($dropdown, $container) {
// Should be implmented in subclasses
};
Dropdown.prototype.destroy = function () {
// Remove the dropdown from the DOM
this.$dropdown.remove();
};
return Dropdown;
});
S2.define('select2/dropdown/search', [
'jquery',
'../utils'
], function ($, Utils) {
function Search() { }
Search.prototype.render = function (decorated) {
var $rendered = decorated.call(this);
var $search = $(
'
' +
' ' +
' '
);
this.$searchContainer = $search;
this.$search = $search.find('input');
$rendered.prepend($search);
return $rendered;
};
Search.prototype.bind = function (decorated, container, $container) {
var self = this;
decorated.call(this, container, $container);
this.$search.on('keydown', function (evt) {
self.trigger('keypress', evt);
self._keyUpPrevented = evt.isDefaultPrevented();
});
// Workaround for browsers which do not support the `input` event
// This will prevent double-triggering of events for browsers which support
// both the `keyup` and `input` events.
this.$search.on('input', function (evt) {
// Unbind the duplicated `keyup` event
$(this).off('keyup');
});
this.$search.on('keyup input', function (evt) {
self.handleSearch(evt);
});
container.on('open', function () {
self.$search.attr('tabindex', 0);
self.$search.focus();
window.setTimeout(function () {
self.$search.focus();
}, 0);
});
container.on('close', function () {
self.$search.attr('tabindex', -1);
self.$search.val('');
});
container.on('results:all', function (params) {
if (params.query.term == null || params.query.term === '') {
var showSearch = self.showSearch(params);
if (showSearch) {
self.$searchContainer.removeClass('select2-search--hide');
} else {
self.$searchContainer.addClass('select2-search--hide');
}
}
});
};
Search.prototype.handleSearch = function (evt) {
if (!this._keyUpPrevented) {
var input = this.$search.val();
this.trigger('query', {
term: input
});
}
this._keyUpPrevented = false;
};
Search.prototype.showSearch = function (_, params) {
return true;
};
return Search;
});
S2.define('select2/dropdown/hidePlaceholder', [
], function () {
function HidePlaceholder(decorated, $element, options, dataAdapter) {
this.placeholder = this.normalizePlaceholder(options.get('placeholder'));
decorated.call(this, $element, options, dataAdapter);
}
HidePlaceholder.prototype.append = function (decorated, data) {
data.results = this.removePlaceholder(data.results);
decorated.call(this, data);
};
HidePlaceholder.prototype.normalizePlaceholder = function (_, placeholder) {
if (typeof placeholder === 'string') {
placeholder = {
id: '',
text: placeholder
};
}
return placeholder;
};
HidePlaceholder.prototype.removePlaceholder = function (_, data) {
var modifiedData = data.slice(0);
for (var d = data.length - 1; d >= 0; d--) {
var item = data[d];
if (this.placeholder.id === item.id) {
modifiedData.splice(d, 1);
}
}
return modifiedData;
};
return HidePlaceholder;
});
S2.define('select2/dropdown/infiniteScroll', [
'jquery'
], function ($) {
function InfiniteScroll(decorated, $element, options, dataAdapter) {
this.lastParams = {};
decorated.call(this, $element, options, dataAdapter);
this.$loadingMore = this.createLoadingMore();
this.loading = false;
}
InfiniteScroll.prototype.append = function (decorated, data) {
this.$loadingMore.remove();
this.loading = false;
decorated.call(this, data);
if (this.showLoadingMore(data)) {
this.$results.append(this.$loadingMore);
}
};
InfiniteScroll.prototype.bind = function (decorated, container, $container) {
var self = this;
decorated.call(this, container, $container);
container.on('query', function (params) {
self.lastParams = params;
self.loading = true;
});
container.on('query:append', function (params) {
self.lastParams = params;
self.loading = true;
});
this.$results.on('scroll', function () {
var isLoadMoreVisible = $.contains(
document.documentElement,
self.$loadingMore[0]
);
if (self.loading || !isLoadMoreVisible) {
return;
}
var currentOffset = self.$results.offset().top +
self.$results.outerHeight(false);
var loadingMoreOffset = self.$loadingMore.offset().top +
self.$loadingMore.outerHeight(false);
if (currentOffset + 50 >= loadingMoreOffset) {
self.loadMore();
}
});
};
InfiniteScroll.prototype.loadMore = function () {
this.loading = true;
var params = $.extend({}, { page: 1 }, this.lastParams);
params.page++;
this.trigger('query:append', params);
};
InfiniteScroll.prototype.showLoadingMore = function (_, data) {
return data.pagination && data.pagination.more;
};
InfiniteScroll.prototype.createLoadingMore = function () {
var $option = $(
'
'
);
var message = this.options.get('translations').get('loadingMore');
$option.html(message(this.lastParams));
return $option;
};
return InfiniteScroll;
});
S2.define('select2/dropdown/attachBody', [
'jquery',
'../utils'
], function ($, Utils) {
function AttachBody(decorated, $element, options) {
this.$dropdownParent = options.get('dropdownParent') || $(document.body);
decorated.call(this, $element, options);
}
AttachBody.prototype.bind = function (decorated, container, $container) {
var self = this;
var setupResultsEvents = false;
decorated.call(this, container, $container);
container.on('open', function () {
self._showDropdown();
self._attachPositioningHandler(container);
if (!setupResultsEvents) {
setupResultsEvents = true;
container.on('results:all', function () {
self._positionDropdown();
self._resizeDropdown();
});
container.on('results:append', function () {
self._positionDropdown();
self._resizeDropdown();
});
}
});
container.on('close', function () {
self._hideDropdown();
self._detachPositioningHandler(container);
});
this.$dropdownContainer.on('mousedown', function (evt) {
evt.stopPropagation();
});
};
AttachBody.prototype.destroy = function (decorated) {
decorated.call(this);
this.$dropdownContainer.remove();
};
AttachBody.prototype.position = function (decorated, $dropdown, $container) {
// Clone all of the container classes
$dropdown.attr('class', $container.attr('class'));
$dropdown.removeClass('select2');
$dropdown.addClass('select2-container--open');
$dropdown.css({
position: 'absolute',
top: -999999
});
this.$container = $container;
};
AttachBody.prototype.render = function (decorated) {
var $container = $('
');
var $dropdown = decorated.call(this);
$container.append($dropdown);
this.$dropdownContainer = $container;
return $container;
};
AttachBody.prototype._hideDropdown = function (decorated) {
this.$dropdownContainer.detach();
};
AttachBody.prototype._attachPositioningHandler =
function (decorated, container) {
var self = this;
var scrollEvent = 'scroll.select2.' + container.id;
var resizeEvent = 'resize.select2.' + container.id;
var orientationEvent = 'orientationchange.select2.' + container.id;
var $watchers = this.$container.parents().filter(Utils.hasScroll);
$watchers.each(function () {
$(this).data('select2-scroll-position', {
x: $(this).scrollLeft(),
y: $(this).scrollTop()
});
});
$watchers.on(scrollEvent, function (ev) {
var position = $(this).data('select2-scroll-position');
$(this).scrollTop(position.y);
});
$(window).on(scrollEvent + ' ' + resizeEvent + ' ' + orientationEvent,
function (e) {
self._positionDropdown();
self._resizeDropdown();
});
};
AttachBody.prototype._detachPositioningHandler =
function (decorated, container) {
var scrollEvent = 'scroll.select2.' + container.id;
var resizeEvent = 'resize.select2.' + container.id;
var orientationEvent = 'orientationchange.select2.' + container.id;
var $watchers = this.$container.parents().filter(Utils.hasScroll);
$watchers.off(scrollEvent);
$(window).off(scrollEvent + ' ' + resizeEvent + ' ' + orientationEvent);
};
AttachBody.prototype._positionDropdown = function () {
var $window = $(window);
var isCurrentlyAbove = this.$dropdown.hasClass('select2-dropdown--above');
var isCurrentlyBelow = this.$dropdown.hasClass('select2-dropdown--below');
var newDirection = null;
var offset = this.$container.offset();
offset.bottom = offset.top + this.$container.outerHeight(false);
var container = {
height: this.$container.outerHeight(false)
};
container.top = offset.top;
container.bottom = offset.top + container.height;
var dropdown = {
height: this.$dropdown.outerHeight(false)
};
var viewport = {
top: $window.scrollTop(),
bottom: $window.scrollTop() + $window.height()
};
var enoughRoomAbove = viewport.top < (offset.top - dropdown.height);
var enoughRoomBelow = viewport.bottom > (offset.bottom + dropdown.height);
var css = {
left: offset.left,
top: container.bottom
};
// Determine what the parent element is to use for calciulating the offset
var $offsetParent = this.$dropdownParent;
// For statically positoned elements, we need to get the element
// that is determining the offset
if ($offsetParent.css('position') === 'static') {
$offsetParent = $offsetParent.offsetParent();
}
var parentOffset = $offsetParent.offset();
css.top -= parentOffset.top;
css.left -= parentOffset.left;
if (!isCurrentlyAbove && !isCurrentlyBelow) {
newDirection = 'below';
}
if (!enoughRoomBelow && enoughRoomAbove && !isCurrentlyAbove) {
newDirection = 'above';
} else if (!enoughRoomAbove && enoughRoomBelow && isCurrentlyAbove) {
newDirection = 'below';
}
if (newDirection == 'above' ||
(isCurrentlyAbove && newDirection !== 'below')) {
css.top = container.top - dropdown.height;
}
if (newDirection != null) {
this.$dropdown
.removeClass('select2-dropdown--below select2-dropdown--above')
.addClass('select2-dropdown--' + newDirection);
this.$container
.removeClass('select2-container--below select2-container--above')
.addClass('select2-container--' + newDirection);
}
this.$dropdownContainer.css(css);
};
AttachBody.prototype._resizeDropdown = function () {
var css = {
width: this.$container.outerWidth(false) + 'px'
};
if (this.options.get('dropdownAutoWidth')) {
css.minWidth = css.width;
css.width = 'auto';
}
this.$dropdown.css(css);
};
AttachBody.prototype._showDropdown = function (decorated) {
this.$dropdownContainer.appendTo(this.$dropdownParent);
this._positionDropdown();
this._resizeDropdown();
};
return AttachBody;
});
S2.define('select2/dropdown/minimumResultsForSearch', [
], function () {
function countResults(data) {
var count = 0;
for (var d = 0; d < data.length; d++) {
var item = data[d];
if (item.children) {
count += countResults(item.children);
} else {
count++;
}
}
return count;
}
function MinimumResultsForSearch(decorated, $element, options, dataAdapter) {
this.minimumResultsForSearch = options.get('minimumResultsForSearch');
if (this.minimumResultsForSearch < 0) {
this.minimumResultsForSearch = Infinity;
}
decorated.call(this, $element, options, dataAdapter);
}
MinimumResultsForSearch.prototype.showSearch = function (decorated, params) {
if (countResults(params.data.results) < this.minimumResultsForSearch) {
return false;
}
return decorated.call(this, params);
};
return MinimumResultsForSearch;
});
S2.define('select2/dropdown/selectOnClose', [
], function () {
function SelectOnClose() { }
SelectOnClose.prototype.bind = function (decorated, container, $container) {
var self = this;
decorated.call(this, container, $container);
container.on('close', function () {
self._handleSelectOnClose();
});
};
SelectOnClose.prototype._handleSelectOnClose = function () {
var $highlightedResults = this.getHighlightedResults();
// Only select highlighted results
if ($highlightedResults.length < 1) {
return;
}
var data = $highlightedResults.data('data');
// Don't re-select already selected resulte
if (
(data.element != null && data.element.selected) ||
(data.element == null && data.selected)
) {
return;
}
this.trigger('select', {
data: data
});
};
return SelectOnClose;
});
S2.define('select2/dropdown/closeOnSelect', [
], function () {
function CloseOnSelect() { }
CloseOnSelect.prototype.bind = function (decorated, container, $container) {
var self = this;
decorated.call(this, container, $container);
container.on('select', function (evt) {
self._selectTriggered(evt);
});
container.on('unselect', function (evt) {
self._selectTriggered(evt);
});
};
CloseOnSelect.prototype._selectTriggered = function (_, evt) {
var originalEvent = evt.originalEvent;
// Don't close if the control key is being held
if (originalEvent && originalEvent.ctrlKey) {
return;
}
this.trigger('close', {});
};
return CloseOnSelect;
});
S2.define('select2/i18n/en', [], function () {
// English
return {
errorLoading: function () {
return 'The results could not be loaded.';
},
inputTooLong: function (args) {
var overChars = args.input.length - args.maximum;
var message = 'Please delete ' + overChars + ' character';
if (overChars != 1) {
message += 's';
}
return message;
},
inputTooShort: function (args) {
var remainingChars = args.minimum - args.input.length;
var message = 'Please enter ' + remainingChars + ' or more characters';
return message;
},
loadingMore: function () {
return 'Loading more results…';
},
maximumSelected: function (args) {
var message = 'You can only select ' + args.maximum + ' item';
if (args.maximum != 1) {
message += 's';
}
return message;
},
noResults: function () {
return 'No results found';
},
searching: function () {
return 'Searching…';
}
};
});
S2.define('select2/defaults', [
'jquery',
'require',
'./results',
'./selection/single',
'./selection/multiple',
'./selection/placeholder',
'./selection/allowClear',
'./selection/search',
'./selection/eventRelay',
'./utils',
'./translation',
'./diacritics',
'./data/select',
'./data/array',
'./data/ajax',
'./data/tags',
'./data/tokenizer',
'./data/minimumInputLength',
'./data/maximumInputLength',
'./data/maximumSelectionLength',
'./dropdown',
'./dropdown/search',
'./dropdown/hidePlaceholder',
'./dropdown/infiniteScroll',
'./dropdown/attachBody',
'./dropdown/minimumResultsForSearch',
'./dropdown/selectOnClose',
'./dropdown/closeOnSelect',
'./i18n/en'
], function ($, require,
ResultsList,
SingleSelection, MultipleSelection, Placeholder, AllowClear,
SelectionSearch, EventRelay,
Utils, Translation, DIACRITICS,
SelectData, ArrayData, AjaxData, Tags, Tokenizer,
MinimumInputLength, MaximumInputLength, MaximumSelectionLength,
Dropdown, DropdownSearch, HidePlaceholder, InfiniteScroll,
AttachBody, MinimumResultsForSearch, SelectOnClose, CloseOnSelect,
EnglishTranslation) {
function Defaults() {
this.reset();
}
Defaults.prototype.apply = function (options) {
options = $.extend(true, {}, this.defaults, options);
if (options.dataAdapter == null) {
if (options.ajax != null) {
options.dataAdapter = AjaxData;
} else if (options.data != null) {
options.dataAdapter = ArrayData;
} else {
options.dataAdapter = SelectData;
}
if (options.minimumInputLength > 0) {
options.dataAdapter = Utils.Decorate(
options.dataAdapter,
MinimumInputLength
);
}
if (options.maximumInputLength > 0) {
options.dataAdapter = Utils.Decorate(
options.dataAdapter,
MaximumInputLength
);
}
if (options.maximumSelectionLength > 0) {
options.dataAdapter = Utils.Decorate(
options.dataAdapter,
MaximumSelectionLength
);
}
if (options.tags) {
options.dataAdapter = Utils.Decorate(options.dataAdapter, Tags);
}
if (options.tokenSeparators != null || options.tokenizer != null) {
options.dataAdapter = Utils.Decorate(
options.dataAdapter,
Tokenizer
);
}
if (options.query != null) {
var Query = require(options.amdBase + 'compat/query');
options.dataAdapter = Utils.Decorate(
options.dataAdapter,
Query
);
}
if (options.initSelection != null) {
var InitSelection = require(options.amdBase + 'compat/initSelection');
options.dataAdapter = Utils.Decorate(
options.dataAdapter,
InitSelection
);
}
}
if (options.resultsAdapter == null) {
options.resultsAdapter = ResultsList;
if (options.ajax != null) {
options.resultsAdapter = Utils.Decorate(
options.resultsAdapter,
InfiniteScroll
);
}
if (options.placeholder != null) {
options.resultsAdapter = Utils.Decorate(
options.resultsAdapter,
HidePlaceholder
);
}
if (options.selectOnClose) {
options.resultsAdapter = Utils.Decorate(
options.resultsAdapter,
SelectOnClose
);
}
}
if (options.dropdownAdapter == null) {
if (options.multiple) {
options.dropdownAdapter = Dropdown;
} else {
var SearchableDropdown = Utils.Decorate(Dropdown, DropdownSearch);
options.dropdownAdapter = SearchableDropdown;
}
if (options.minimumResultsForSearch !== 0) {
options.dropdownAdapter = Utils.Decorate(
options.dropdownAdapter,
MinimumResultsForSearch
);
}
if (options.closeOnSelect) {
options.dropdownAdapter = Utils.Decorate(
options.dropdownAdapter,
CloseOnSelect
);
}
if (
options.dropdownCssClass != null ||
options.dropdownCss != null ||
options.adaptDropdownCssClass != null
) {
var DropdownCSS = require(options.amdBase + 'compat/dropdownCss');
options.dropdownAdapter = Utils.Decorate(
options.dropdownAdapter,
DropdownCSS
);
}
options.dropdownAdapter = Utils.Decorate(
options.dropdownAdapter,
AttachBody
);
}
if (options.selectionAdapter == null) {
if (options.multiple) {
options.selectionAdapter = MultipleSelection;
} else {
options.selectionAdapter = SingleSelection;
}
// Add the placeholder mixin if a placeholder was specified
if (options.placeholder != null) {
options.selectionAdapter = Utils.Decorate(
options.selectionAdapter,
Placeholder
);
}
if (options.allowClear) {
options.selectionAdapter = Utils.Decorate(
options.selectionAdapter,
AllowClear
);
}
if (options.multiple) {
options.selectionAdapter = Utils.Decorate(
options.selectionAdapter,
SelectionSearch
);
}
if (
options.containerCssClass != null ||
options.containerCss != null ||
options.adaptContainerCssClass != null
) {
var ContainerCSS = require(options.amdBase + 'compat/containerCss');
options.selectionAdapter = Utils.Decorate(
options.selectionAdapter,
ContainerCSS
);
}
options.selectionAdapter = Utils.Decorate(
options.selectionAdapter,
EventRelay
);
}
if (typeof options.language === 'string') {
// Check if the language is specified with a region
if (options.language.indexOf('-') > 0) {
// Extract the region information if it is included
var languageParts = options.language.split('-');
var baseLanguage = languageParts[0];
options.language = [options.language, baseLanguage];
} else {
options.language = [options.language];
}
}
if ($.isArray(options.language)) {
var languages = new Translation();
options.language.push('en');
var languageNames = options.language;
for (var l = 0; l < languageNames.length; l++) {
var name = languageNames[l];
var language = {};
try {
// Try to load it with the original name
language = Translation.loadPath(name);
} catch (e) {
try {
// If we couldn't load it, check if it wasn't the full path
name = this.defaults.amdLanguageBase + name;
language = Translation.loadPath(name);
} catch (ex) {
// The translation could not be loaded at all. Sometimes this is
// because of a configuration problem, other times this can be
// because of how Select2 helps load all possible translation files.
if (options.debug && window.console && console.warn) {
console.warn(
'Select2: The language file for "' + name + '" could not be ' +
'automatically loaded. A fallback will be used instead.'
);
}
continue;
}
}
languages.extend(language);
}
options.translations = languages;
} else {
var baseTranslation = Translation.loadPath(
this.defaults.amdLanguageBase + 'en'
);
var customTranslation = new Translation(options.language);
customTranslation.extend(baseTranslation);
options.translations = customTranslation;
}
return options;
};
Defaults.prototype.reset = function () {
function stripDiacritics(text) {
// Used 'uni range + named function' from http://jsperf.com/diacritics/18
function match(a) {
return DIACRITICS[a] || a;
}
return text.replace(/[^\u0000-\u007E]/g, match);
}
function matcher(params, data) {
// Always return the object if there is nothing to compare
if ($.trim(params.term) === '') {
return data;
}
// Do a recursive check for options with children
if (data.children && data.children.length > 0) {
// Clone the data object if there are children
// This is required as we modify the object to remove any non-matches
var match = $.extend(true, {}, data);
// Check each child of the option
for (var c = data.children.length - 1; c >= 0; c--) {
var child = data.children[c];
var matches = matcher(params, child);
// If there wasn't a match, remove the object in the array
if (matches == null) {
match.children.splice(c, 1);
}
}
// If any children matched, return the new object
if (match.children.length > 0) {
return match;
}
// If there were no matching children, check just the plain object
return matcher(params, match);
}
var original = stripDiacritics(data.text).toUpperCase();
var term = stripDiacritics(params.term).toUpperCase();
// Check if the text contains the term
if (original.indexOf(term) > -1) {
return data;
}
// If it doesn't contain the term, don't return anything
return null;
}
this.defaults = {
amdBase: './',
amdLanguageBase: './i18n/',
closeOnSelect: true,
debug: false,
dropdownAutoWidth: false,
escapeMarkup: Utils.escapeMarkup,
language: EnglishTranslation,
matcher: matcher,
minimumInputLength: 0,
maximumInputLength: 0,
maximumSelectionLength: 0,
minimumResultsForSearch: 0,
selectOnClose: false,
sorter: function (data) {
return data;
},
templateResult: function (result) {
return result.text;
},
templateSelection: function (selection) {
return selection.text;
},
theme: 'default',
width: 'resolve'
};
};
Defaults.prototype.set = function (key, value) {
var camelKey = $.camelCase(key);
var data = {};
data[camelKey] = value;
var convertedData = Utils._convertData(data);
$.extend(this.defaults, convertedData);
};
var defaults = new Defaults();
return defaults;
});
S2.define('select2/options', [
'require',
'jquery',
'./defaults',
'./utils'
], function (require, $, Defaults, Utils) {
function Options(options, $element) {
this.options = options;
if ($element != null) {
this.fromElement($element);
}
this.options = Defaults.apply(this.options);
if ($element && $element.is('input')) {
var InputCompat = require(this.get('amdBase') + 'compat/inputData');
this.options.dataAdapter = Utils.Decorate(
this.options.dataAdapter,
InputCompat
);
}
}
Options.prototype.fromElement = function ($e) {
var excludedData = ['select2'];
if (this.options.multiple == null) {
this.options.multiple = $e.prop('multiple');
}
if (this.options.disabled == null) {
this.options.disabled = $e.prop('disabled');
}
if (this.options.language == null) {
if ($e.prop('lang')) {
this.options.language = $e.prop('lang').toLowerCase();
} else if ($e.closest('[lang]').prop('lang')) {
this.options.language = $e.closest('[lang]').prop('lang');
}
}
if (this.options.dir == null) {
if ($e.prop('dir')) {
this.options.dir = $e.prop('dir');
} else if ($e.closest('[dir]').prop('dir')) {
this.options.dir = $e.closest('[dir]').prop('dir');
} else {
this.options.dir = 'ltr';
}
}
$e.prop('disabled', this.options.disabled);
$e.prop('multiple', this.options.multiple);
if ($e.data('select2Tags')) {
if (this.options.debug && window.console && console.warn) {
console.warn(
'Select2: The `data-select2-tags` attribute has been changed to ' +
'use the `data-data` and `data-tags="true"` attributes and will be ' +
'removed in future versions of Select2.'
);
}
$e.data('data', $e.data('select2Tags'));
$e.data('tags', true);
}
if ($e.data('ajaxUrl')) {
if (this.options.debug && window.console && console.warn) {
console.warn(
'Select2: The `data-ajax-url` attribute has been changed to ' +
'`data-ajax--url` and support for the old attribute will be removed' +
' in future versions of Select2.'
);
}
$e.attr('ajax--url', $e.data('ajaxUrl'));
$e.data('ajax--url', $e.data('ajaxUrl'));
}
var dataset = {};
// Prefer the element's `dataset` attribute if it exists
// jQuery 1.x does not correctly handle data attributes with multiple dashes
if ($.fn.jquery && $.fn.jquery.substr(0, 2) == '1.' && $e[0].dataset) {
dataset = $.extend(true, {}, $e[0].dataset, $e.data());
} else {
dataset = $e.data();
}
var data = $.extend(true, {}, dataset);
data = Utils._convertData(data);
for (var key in data) {
if ($.inArray(key, excludedData) > -1) {
continue;
}
if ($.isPlainObject(this.options[key])) {
$.extend(this.options[key], data[key]);
} else {
this.options[key] = data[key];
}
}
return this;
};
Options.prototype.get = function (key) {
return this.options[key];
};
Options.prototype.set = function (key, val) {
this.options[key] = val;
};
return Options;
});
S2.define('select2/core', [
'jquery',
'./options',
'./utils',
'./keys'
], function ($, Options, Utils, KEYS) {
var Select2 = function ($element, options) {
if ($element.data('select2') != null) {
$element.data('select2').destroy();
}
this.$element = $element;
this.id = this._generateId($element);
options = options || {};
this.options = new Options(options, $element);
Select2.__super__.constructor.call(this);
// Set up the tabindex
var tabindex = $element.attr('tabindex') || 0;
$element.data('old-tabindex', tabindex);
$element.attr('tabindex', '-1');
// Set up containers and adapters
var DataAdapter = this.options.get('dataAdapter');
this.dataAdapter = new DataAdapter($element, this.options);
var $container = this.render();
this._placeContainer($container);
var SelectionAdapter = this.options.get('selectionAdapter');
this.selection = new SelectionAdapter($element, this.options);
this.$selection = this.selection.render();
this.selection.position(this.$selection, $container);
var DropdownAdapter = this.options.get('dropdownAdapter');
this.dropdown = new DropdownAdapter($element, this.options);
this.$dropdown = this.dropdown.render();
this.dropdown.position(this.$dropdown, $container);
var ResultsAdapter = this.options.get('resultsAdapter');
this.results = new ResultsAdapter($element, this.options, this.dataAdapter);
this.$results = this.results.render();
this.results.position(this.$results, this.$dropdown);
// Bind events
var self = this;
// Bind the container to all of the adapters
this._bindAdapters();
// Register any DOM event handlers
this._registerDomEvents();
// Register any internal event handlers
this._registerDataEvents();
this._registerSelectionEvents();
this._registerDropdownEvents();
this._registerResultsEvents();
this._registerEvents();
// Set the initial state
this.dataAdapter.current(function (initialData) {
self.trigger('selection:update', {
data: initialData
});
});
// Hide the original select
$element.addClass('select2-hidden-accessible');
$element.attr('aria-hidden', 'true');
// Synchronize any monitored attributes
this._syncAttributes();
$element.data('select2', this);
};
Utils.Extend(Select2, Utils.Observable);
Select2.prototype._generateId = function ($element) {
var id = '';
if ($element.attr('id') != null) {
id = $element.attr('id');
} else if ($element.attr('name') != null) {
id = $element.attr('name') + '-' + Utils.generateChars(2);
} else {
id = Utils.generateChars(4);
}
id = id.replace(/(:|\.|\[|\]|,)/g, '');
id = 'select2-' + id;
return id;
};
Select2.prototype._placeContainer = function ($container) {
$container.insertAfter(this.$element);
var width = this._resolveWidth(this.$element, this.options.get('width'));
if (width != null) {
$container.css('width', width);
}
};
Select2.prototype._resolveWidth = function ($element, method) {
var WIDTH = /^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;
if (method == 'resolve') {
var styleWidth = this._resolveWidth($element, 'style');
if (styleWidth != null) {
return styleWidth;
}
return this._resolveWidth($element, 'element');
}
if (method == 'element') {
var elementWidth = $element.outerWidth(false);
if (elementWidth <= 0) {
return 'auto';
}
return elementWidth + 'px';
}
if (method == 'style') {
var style = $element.attr('style');
if (typeof (style) !== 'string') {
return null;
}
var attrs = style.split(';');
for (var i = 0, l = attrs.length; i < l; i = i + 1) {
var attr = attrs[i].replace(/\s/g, '');
var matches = attr.match(WIDTH);
if (matches !== null && matches.length >= 1) {
return matches[1];
}
}
return null;
}
return method;
};
Select2.prototype._bindAdapters = function () {
this.dataAdapter.bind(this, this.$container);
this.selection.bind(this, this.$container);
this.dropdown.bind(this, this.$container);
this.results.bind(this, this.$container);
};
Select2.prototype._registerDomEvents = function () {
var self = this;
this.$element.on('change.select2', function () {
self.dataAdapter.current(function (data) {
self.trigger('selection:update', {
data: data
});
});
});
this._sync = Utils.bind(this._syncAttributes, this);
if (this.$element[0].attachEvent) {
this.$element[0].attachEvent('onpropertychange', this._sync);
}
var observer = window.MutationObserver ||
window.WebKitMutationObserver ||
window.MozMutationObserver
;
if (observer != null) {
this._observer = new observer(function (mutations) {
$.each(mutations, self._sync);
});
this._observer.observe(this.$element[0], {
attributes: true,
subtree: false
});
} else if (this.$element[0].addEventListener) {
this.$element[0].addEventListener('DOMAttrModified', self._sync, false);
}
};
Select2.prototype._registerDataEvents = function () {
var self = this;
this.dataAdapter.on('*', function (name, params) {
self.trigger(name, params);
});
};
Select2.prototype._registerSelectionEvents = function () {
var self = this;
var nonRelayEvents = ['toggle', 'focus'];
this.selection.on('toggle', function () {
self.toggleDropdown();
});
this.selection.on('focus', function (params) {
self.focus(params);
});
this.selection.on('*', function (name, params) {
if ($.inArray(name, nonRelayEvents) !== -1) {
return;
}
self.trigger(name, params);
});
};
Select2.prototype._registerDropdownEvents = function () {
var self = this;
this.dropdown.on('*', function (name, params) {
self.trigger(name, params);
});
};
Select2.prototype._registerResultsEvents = function () {
var self = this;
this.results.on('*', function (name, params) {
self.trigger(name, params);
});
};
Select2.prototype._registerEvents = function () {
var self = this;
this.on('open', function () {
self.$container.addClass('select2-container--open');
});
this.on('close', function () {
self.$container.removeClass('select2-container--open');
});
this.on('enable', function () {
self.$container.removeClass('select2-container--disabled');
});
this.on('disable', function () {
self.$container.addClass('select2-container--disabled');
});
this.on('blur', function () {
self.$container.removeClass('select2-container--focus');
});
this.on('query', function (params) {
if (!self.isOpen()) {
self.trigger('open', {});
}
this.dataAdapter.query(params, function (data) {
self.trigger('results:all', {
data: data,
query: params
});
});
});
this.on('query:append', function (params) {
this.dataAdapter.query(params, function (data) {
self.trigger('results:append', {
data: data,
query: params
});
});
});
this.on('keypress', function (evt) {
var key = evt.which;
if (self.isOpen()) {
if (key === KEYS.ESC || key === KEYS.TAB ||
(key === KEYS.UP && evt.altKey)) {
self.close();
evt.preventDefault();
} else if (key === KEYS.ENTER) {
self.trigger('results:select', {});
evt.preventDefault();
} else if ((key === KEYS.SPACE && evt.ctrlKey)) {
self.trigger('results:toggle', {});
evt.preventDefault();
} else if (key === KEYS.UP) {
self.trigger('results:previous', {});
evt.preventDefault();
} else if (key === KEYS.DOWN) {
self.trigger('results:next', {});
evt.preventDefault();
}
} else {
if (key === KEYS.ENTER || key === KEYS.SPACE ||
(key === KEYS.DOWN && evt.altKey)) {
self.open();
evt.preventDefault();
}
}
});
};
Select2.prototype._syncAttributes = function () {
this.options.set('disabled', this.$element.prop('disabled'));
if (this.options.get('disabled')) {
if (this.isOpen()) {
this.close();
}
this.trigger('disable', {});
} else {
this.trigger('enable', {});
}
};
/**
* Override the trigger method to automatically trigger pre-events when
* there are events that can be prevented.
*/
Select2.prototype.trigger = function (name, args) {
var actualTrigger = Select2.__super__.trigger;
var preTriggerMap = {
'open': 'opening',
'close': 'closing',
'select': 'selecting',
'unselect': 'unselecting'
};
if (args === undefined) {
args = {};
}
if (name in preTriggerMap) {
var preTriggerName = preTriggerMap[name];
var preTriggerArgs = {
prevented: false,
name: name,
args: args
};
actualTrigger.call(this, preTriggerName, preTriggerArgs);
if (preTriggerArgs.prevented) {
args.prevented = true;
return;
}
}
actualTrigger.call(this, name, args);
};
Select2.prototype.toggleDropdown = function () {
if (this.options.get('disabled')) {
return;
}
if (this.isOpen()) {
this.close();
} else {
this.open();
}
};
Select2.prototype.open = function () {
if (this.isOpen()) {
return;
}
this.trigger('query', {});
};
Select2.prototype.close = function () {
if (!this.isOpen()) {
return;
}
this.trigger('close', {});
};
Select2.prototype.isOpen = function () {
return this.$container.hasClass('select2-container--open');
};
Select2.prototype.hasFocus = function () {
return this.$container.hasClass('select2-container--focus');
};
Select2.prototype.focus = function (data) {
// No need to re-trigger focus events if we are already focused
if (this.hasFocus()) {
return;
}
this.$container.addClass('select2-container--focus');
this.trigger('focus', {});
};
Select2.prototype.enable = function (args) {
if (this.options.get('debug') && window.console && console.warn) {
console.warn(
'Select2: The `select2("enable")` method has been deprecated and will' +
' be removed in later Select2 versions. Use $element.prop("disabled")' +
' instead.'
);
}
if (args == null || args.length === 0) {
args = [true];
}
var disabled = !args[0];
this.$element.prop('disabled', disabled);
};
Select2.prototype.data = function () {
if (this.options.get('debug') &&
arguments.length > 0 && window.console && console.warn) {
console.warn(
'Select2: Data can no longer be set using `select2("data")`. You ' +
'should consider setting the value instead using `$element.val()`.'
);
}
var data = [];
this.dataAdapter.current(function (currentData) {
data = currentData;
});
return data;
};
Select2.prototype.val = function (args) {
if (this.options.get('debug') && window.console && console.warn) {
console.warn(
'Select2: The `select2("val")` method has been deprecated and will be' +
' removed in later Select2 versions. Use $element.val() instead.'
);
}
if (args == null || args.length === 0) {
return this.$element.val();
}
var newVal = args[0];
if ($.isArray(newVal)) {
newVal = $.map(newVal, function (obj) {
return obj.toString();
});
}
this.$element.val(newVal).trigger('change');
};
Select2.prototype.destroy = function () {
this.$container.remove();
if (this.$element[0].detachEvent) {
this.$element[0].detachEvent('onpropertychange', this._sync);
}
if (this._observer != null) {
this._observer.disconnect();
this._observer = null;
} else if (this.$element[0].removeEventListener) {
this.$element[0]
.removeEventListener('DOMAttrModified', this._sync, false);
}
this._sync = null;
this.$element.off('.select2');
this.$element.attr('tabindex', this.$element.data('old-tabindex'));
this.$element.removeClass('select2-hidden-accessible');
this.$element.attr('aria-hidden', 'false');
this.$element.removeData('select2');
this.dataAdapter.destroy();
this.selection.destroy();
this.dropdown.destroy();
this.results.destroy();
this.dataAdapter = null;
this.selection = null;
this.dropdown = null;
this.results = null;
};
Select2.prototype.render = function () {
var $container = $(
'
' +
' ' +
' ' +
' '
);
$container.attr('dir', this.options.get('dir'));
this.$container = $container;
this.$container.addClass('select2-container--' + this.options.get('theme'));
$container.data('element', this.$element);
return $container;
};
return Select2;
});
S2.define('jquery-mousewheel', [
'jquery'
], function ($) {
// Used to shim jQuery.mousewheel for non-full builds.
return $;
});
S2.define('jquery.select2', [
'jquery',
'jquery-mousewheel',
'./select2/core',
'./select2/defaults'
], function ($, _, Select2, Defaults) {
if ($.fn.select2 == null) {
// All methods that should return the element
var thisMethods = ['open', 'close', 'destroy'];
$.fn.select2 = function (options) {
options = options || {};
if (typeof options === 'object') {
this.each(function () {
var instanceOptions = $.extend(true, {}, options);
var instance = new Select2($(this), instanceOptions);
});
return this;
} else if (typeof options === 'string') {
var ret;
this.each(function () {
var instance = $(this).data('select2');
if (instance == null && window.console && console.error) {
console.error(
'The select2(\'' + options + '\') method was called on an ' +
'element that is not using Select2.'
);
}
var args = Array.prototype.slice.call(arguments, 1);
ret = instance[options].apply(instance, args);
});
// Check if we should be returning `this`
if ($.inArray(options, thisMethods) > -1) {
return this;
}
return ret;
} else {
throw new Error('Invalid arguments for Select2: ' + options);
}
};
}
if ($.fn.select2.defaults == null) {
$.fn.select2.defaults = Defaults;
}
return Select2;
});
// Return the AMD loader configuration so it can be used outside of this file
return {
define: S2.define,
require: S2.require
};
}());
// Autoload the jQuery bindings
// We know that all of the modules exist above this, so we're safe
var select2 = S2.require('jquery.select2');
// Hold the AMD module references on the jQuery function that was just loaded
// This allows Select2 to use the internal loader outside of this file, such
// as in the language files.
jQuery.fn.select2.amd = S2;
// Return the Select2 instance for anyone who is importing it.
return select2;
}));
/*!
Buttons for DataTables 1.2.2
©2016 SpryMedia Ltd - datatables.net/license
*/
(function (d) { "function" === typeof define && define.amd ? define(["jquery", "datatables.net"], function (n) { return d(n, window, document) }) : "object" === typeof exports ? module.exports = function (n, o) { n || (n = window); if (!o || !o.fn.dataTable) o = require("datatables.net")(n, o).$; return d(o, n, n.document) } : d(jQuery, window, document) })(function (d, n, o, m) {
var i = d.fn.dataTable, u = 0, v = 0, j = i.ext.buttons, l = function (a, b) {
!0 === b && (b = {}); d.isArray(b) && (b = { buttons: b }); this.c = d.extend(!0, {}, l.defaults, b); b.buttons && (this.c.buttons = b.buttons);
this.s = { dt: new i.Api(a), buttons: [], listenKeys: "", namespace: "dtb" + u++ }; this.dom = { container: d("<" + this.c.dom.container.tag + "/>").addClass(this.c.dom.container.className) }; this._constructor()
}; d.extend(l.prototype, {
action: function (a, b) { var c = this._nodeToButton(a); if (b === m) return c.conf.action; c.conf.action = b; return this }, active: function (a, b) { var c = this._nodeToButton(a), e = this.c.dom.button.active, c = d(c.node); if (b === m) return c.hasClass(e); c.toggleClass(e, b === m ? !0 : b); return this }, add: function (a, b) {
var c =
this.s.buttons; if ("string" === typeof b) { for (var e = b.split("-"), c = this.s, d = 0, h = e.length - 1; d < h; d++)c = c.buttons[1 * e[d]]; c = c.buttons; b = 1 * e[e.length - 1] } this._expandButton(c, a, !1, b); this._draw(); return this
}, container: function () { return this.dom.container }, disable: function (a) { a = this._nodeToButton(a); d(a.node).addClass(this.c.dom.button.disabled); return this }, destroy: function () {
d("body").off("keyup." + this.s.namespace); var a = this.s.buttons.slice(), b, c; b = 0; for (c = a.length; b < c; b++)this.remove(a[b].node); this.dom.container.remove();
a = this.s.dt.settings()[0]; b = 0; for (c = a.length; b < c; b++)if (a.inst === this) { a.splice(b, 1); break } return this
}, enable: function (a, b) { if (!1 === b) return this.disable(a); var c = this._nodeToButton(a); d(c.node).removeClass(this.c.dom.button.disabled); return this }, name: function () { return this.c.name }, node: function (a) { a = this._nodeToButton(a); return d(a.node) }, remove: function (a) {
var b = this._nodeToButton(a), c = this._nodeToHost(a), e = this.s.dt; if (b.buttons.length) for (var g = b.buttons.length - 1; 0 <= g; g--)this.remove(b.buttons[g].node);
b.conf.destroy && b.conf.destroy.call(e.button(a), e, d(a), b.conf); this._removeKey(b.conf); d(b.node).remove(); a = d.inArray(b, c); c.splice(a, 1); return this
}, text: function (a, b) { var c = this._nodeToButton(a), e = this.c.dom.collection.buttonLiner, e = c.inCollection && e && e.tag ? e.tag : this.c.dom.buttonLiner.tag, g = this.s.dt, h = d(c.node), f = function (a) { return "function" === typeof a ? a(g, h, c.conf) : a }; if (b === m) return f(c.conf.text); c.conf.text = b; e ? h.children(e).html(f(b)) : h.html(f(b)); return this }, _constructor: function () {
var a =
this, b = this.s.dt, c = b.settings()[0], e = this.c.buttons; c._buttons || (c._buttons = []); c._buttons.push({ inst: this, name: this.c.name }); for (var c = 0, g = e.length; c < g; c++)this.add(e[c]); b.on("destroy", function () { a.destroy() }); d("body").on("keyup." + this.s.namespace, function (b) { if (!o.activeElement || o.activeElement === o.body) { var c = String.fromCharCode(b.keyCode).toLowerCase(); a.s.listenKeys.toLowerCase().indexOf(c) !== -1 && a._keypress(c, b) } })
}, _addKey: function (a) {
a.key && (this.s.listenKeys += d.isPlainObject(a.key) ? a.key.key :
a.key)
}, _draw: function (a, b) { a || (a = this.dom.container, b = this.s.buttons); a.children().detach(); for (var c = 0, e = b.length; c < e; c++)a.append(b[c].inserter), b[c].buttons && b[c].buttons.length && this._draw(b[c].collection, b[c].buttons) }, _expandButton: function (a, b, c, e) {
for (var g = this.s.dt, h = 0, b = !d.isArray(b) ? [b] : b, f = 0, r = b.length; f < r; f++) {
var k = this._resolveExtends(b[f]); if (k) if (d.isArray(k)) this._expandButton(a, k, c, e); else {
var p = this._buildButton(k, c); if (p) {
e !== m ? (a.splice(e, 0, p), e++) : a.push(p); if (p.conf.buttons) {
var s =
this.c.dom.collection; p.collection = d("<" + s.tag + "/>").addClass(s.className); p.conf._collection = p.collection; this._expandButton(p.buttons, p.conf.buttons, !0, e)
} k.init && k.init.call(g.button(p.node), g, d(p.node), k); h++
}
}
}
}, _buildButton: function (a, b) {
var c = this.c.dom.button, e = this.c.dom.buttonLiner, g = this.c.dom.collection, h = this.s.dt, f = function (b) { return "function" === typeof b ? b(h, k, a) : b }; b && g.button && (c = g.button); b && g.buttonLiner && (e = g.buttonLiner); if (a.available && !a.available(h, a)) return !1; var r = function (a,
b, c, e) { e.action.call(b.button(c), a, b, c, e); d(b.table().node()).triggerHandler("buttons-action.dt", [b.button(c), b, c, e]) }, k = d("<" + c.tag + "/>").addClass(c.className).attr("tabindex", this.s.dt.settings()[0].iTabIndex).attr("aria-controls", this.s.dt.table().node().id).on("click.dtb", function (b) { b.preventDefault(); !k.hasClass(c.disabled) && a.action && r(b, h, k, a); k.blur() }).on("keyup.dtb", function (b) { b.keyCode === 13 && !k.hasClass(c.disabled) && a.action && r(b, h, k, a) }); "a" === c.tag.toLowerCase() && k.attr("href", "#");
e.tag ? (g = d("<" + e.tag + "/>").html(f(a.text)).addClass(e.className), "a" === e.tag.toLowerCase() && g.attr("href", "#"), k.append(g)) : k.html(f(a.text)); !1 === a.enabled && k.addClass(c.disabled); a.className && k.addClass(a.className); a.titleAttr && k.attr("title", a.titleAttr); a.namespace || (a.namespace = ".dt-button-" + v++); e = (e = this.c.dom.buttonContainer) && e.tag ? d("<" + e.tag + "/>").addClass(e.className).append(k) : k; this._addKey(a); return { conf: a, node: k.get(0), inserter: e, buttons: [], inCollection: b, collection: null }
}, _nodeToButton: function (a,
b) { b || (b = this.s.buttons); for (var c = 0, e = b.length; c < e; c++) { if (b[c].node === a) return b[c]; if (b[c].buttons.length) { var d = this._nodeToButton(a, b[c].buttons); if (d) return d } } }, _nodeToHost: function (a, b) { b || (b = this.s.buttons); for (var c = 0, e = b.length; c < e; c++) { if (b[c].node === a) return b; if (b[c].buttons.length) { var d = this._nodeToHost(a, b[c].buttons); if (d) return d } } }, _keypress: function (a, b) {
var c = function (e) {
for (var g = 0, h = e.length; g < h; g++) {
var f = e[g].conf, r = e[g].node; if (f.key) if (f.key === a) d(r).click(); else if (d.isPlainObject(f.key) &&
f.key.key === a && (!f.key.shiftKey || b.shiftKey)) if (!f.key.altKey || b.altKey) if (!f.key.ctrlKey || b.ctrlKey) (!f.key.metaKey || b.metaKey) && d(r).click(); e[g].buttons.length && c(e[g].buttons)
}
}; c(this.s.buttons)
}, _removeKey: function (a) { if (a.key) { var b = d.isPlainObject(a.key) ? a.key.key : a.key, a = this.s.listenKeys.split(""), b = d.inArray(b, a); a.splice(b, 1); this.s.listenKeys = a.join("") } }, _resolveExtends: function (a) {
for (var b = this.s.dt, c, e, g = function (c) {
for (var e = 0; !d.isPlainObject(c) && !d.isArray(c);) {
if (c === m) return;
if ("function" === typeof c) { if (c = c(b, a), !c) return !1 } else if ("string" === typeof c) { if (!j[c]) throw "Unknown button type: " + c; c = j[c] } e++; if (30 < e) throw "Buttons: Too many iterations";
} return d.isArray(c) ? c : d.extend({}, c)
}, a = g(a); a && a.extend;) {
if (!j[a.extend]) throw "Cannot extend unknown button type: " + a.extend; var h = g(j[a.extend]); if (d.isArray(h)) return h; if (!h) return !1; c = h.className; a = d.extend({}, h, a); c && a.className !== c && (a.className = c + " " + a.className); var f = a.postfixButtons; if (f) {
a.buttons || (a.buttons = []);
c = 0; for (e = f.length; c < e; c++)a.buttons.push(f[c]); a.postfixButtons = null
} if (f = a.prefixButtons) { a.buttons || (a.buttons = []); c = 0; for (e = f.length; c < e; c++)a.buttons.splice(c, 0, f[c]); a.prefixButtons = null } a.extend = h.extend
} return a
}
}); l.background = function (a, b, c) { c === m && (c = 400); a ? d("
").addClass(b).css("display", "none").appendTo("body").fadeIn(c) : d("body > div." + b).fadeOut(c, function () { d(this).removeClass(b).remove() }) }; l.instanceSelector = function (a, b) {
if (!a) return d.map(b, function (a) { return a.inst }); var c =
[], e = d.map(b, function (a) { return a.name }), g = function (a) { if (d.isArray(a)) for (var f = 0, r = a.length; f < r; f++)g(a[f]); else "string" === typeof a ? -1 !== a.indexOf(",") ? g(a.split(",")) : (a = d.inArray(d.trim(a), e), -1 !== a && c.push(b[a].inst)) : "number" === typeof a && c.push(b[a].inst) }; g(a); return c
}; l.buttonSelector = function (a, b) {
for (var c = [], e = function (a, b, c) { for (var d, g, f = 0, h = b.length; f < h; f++)if (d = b[f]) g = c !== m ? c + f : f + "", a.push({ node: d.node, name: d.conf.name, idx: g }), d.buttons && e(a, d.buttons, g + "-") }, g = function (a, b) {
var f,
h, i = []; e(i, b.s.buttons); f = d.map(i, function (a) { return a.node }); if (d.isArray(a) || a instanceof d) { f = 0; for (h = a.length; f < h; f++)g(a[f], b) } else if (null === a || a === m || "*" === a) { f = 0; for (h = i.length; f < h; f++)c.push({ inst: b, node: i[f].node }) } else if ("number" === typeof a) c.push({ inst: b, node: b.s.buttons[a].node }); else if ("string" === typeof a) if (-1 !== a.indexOf(",")) { i = a.split(","); f = 0; for (h = i.length; f < h; f++)g(d.trim(i[f]), b) } else if (a.match(/^\d+(\-\d+)*$/)) f = d.map(i, function (a) { return a.idx }), c.push({
inst: b, node: i[d.inArray(a,
f)].node
}); else if (-1 !== a.indexOf(":name")) { var j = a.replace(":name", ""); f = 0; for (h = i.length; f < h; f++)i[f].name === j && c.push({ inst: b, node: i[f].node }) } else d(f).filter(a).each(function () { c.push({ inst: b, node: this }) }); else "object" === typeof a && a.nodeName && (i = d.inArray(a, f), -1 !== i && c.push({ inst: b, node: f[i] }))
}, h = 0, f = a.length; h < f; h++)g(b, a[h]); return c
}; l.defaults = {
buttons: ["copy", "excel", "csv", "pdf", "print"], name: "main", tabIndex: 0, dom: {
container: { tag: "div", className: "dt-buttons" }, collection: { tag: "div", className: "dt-button-collection" },
button: { tag: "a", className: "dt-button", active: "active", disabled: "disabled" }, buttonLiner: { tag: "span", className: "" }
}
}; l.version = "1.2.2"; d.extend(j, {
collection: {
text: function (a) { return a.i18n("buttons.collection", "Collection") }, className: "buttons-collection", action: function (a, b, c, e) {
var a = c.offset(), g = d(b.table().container()), h = !1; d("div.dt-button-background").length && (h = d("div.dt-button-collection").offset(), d("body").trigger("click.dtb-collection")); e._collection.addClass(e.collectionLayout).css("display",
"none").appendTo("body").fadeIn(e.fade); var f = e._collection.css("position"); h && "absolute" === f ? e._collection.css({ top: h.top + 5, left: h.left + 5 }) : "absolute" === f ? (e._collection.css({ top: a.top + c.outerHeight(), left: a.left }), c = a.left + e._collection.outerWidth(), g = g.offset().left + g.width(), c > g && e._collection.css("left", a.left - (c - g))) : (a = e._collection.height() / 2, a > d(n).height() / 2 && (a = d(n).height() / 2), e._collection.css("marginTop", -1 * a)); e.background && l.background(!0, e.backgroundClassName, e.fade); setTimeout(function () {
d("div.dt-button-background").on("click.dtb-collection",
function () { }); d("body").on("click.dtb-collection", function (a) { var c = d.fn.addBack ? "addBack" : "andSelf"; if (!d(a.target).parents()[c]().filter(e._collection).length) { e._collection.fadeOut(e.fade, function () { e._collection.detach() }); d("div.dt-button-background").off("click.dtb-collection"); l.background(false, e.backgroundClassName, e.fade); d("body").off("click.dtb-collection"); b.off("buttons-action.b-internal") } })
}, 10); if (e.autoClose) b.on("buttons-action.b-internal", function () { d("div.dt-button-background").click() })
},
background: !0, collectionLayout: "", backgroundClassName: "dt-button-background", autoClose: !1, fade: 400
}, copy: function (a, b) { if (j.copyHtml5) return "copyHtml5"; if (j.copyFlash && j.copyFlash.available(a, b)) return "copyFlash" }, csv: function (a, b) { if (j.csvHtml5 && j.csvHtml5.available(a, b)) return "csvHtml5"; if (j.csvFlash && j.csvFlash.available(a, b)) return "csvFlash" }, excel: function (a, b) { if (j.excelHtml5 && j.excelHtml5.available(a, b)) return "excelHtml5"; if (j.excelFlash && j.excelFlash.available(a, b)) return "excelFlash" }, pdf: function (a,
b) { if (j.pdfHtml5 && j.pdfHtml5.available(a, b)) return "pdfHtml5"; if (j.pdfFlash && j.pdfFlash.available(a, b)) return "pdfFlash" }, pageLength: function (a) {
var a = a.settings()[0].aLengthMenu, b = d.isArray(a[0]) ? a[0] : a, c = d.isArray(a[0]) ? a[1] : a, e = function (a) { return a.i18n("buttons.pageLength", { "-1": "Show all rows", _: "Show %d rows" }, a.page.len()) }; return {
extend: "collection", text: e, className: "buttons-page-length", autoClose: !0, buttons: d.map(b, function (a, b) {
return {
text: c[b], action: function (b, c) { c.page.len(a).draw() }, init: function (b,
c, e) { var d = this, c = function () { d.active(b.page.len() === a) }; b.on("length.dt" + e.namespace, c); c() }, destroy: function (a, b, c) { a.off("length.dt" + c.namespace) }
}
}), init: function (a, b, c) { var d = this; a.on("length.dt" + c.namespace, function () { d.text(e(a)) }) }, destroy: function (a, b, c) { a.off("length.dt" + c.namespace) }
}
}
}); i.Api.register("buttons()", function (a, b) {
b === m && (b = a, a = m); this.selector.buttonGroup = a; var c = this.iterator(!0, "table", function (c) {
if (c._buttons) return l.buttonSelector(l.instanceSelector(a, c._buttons),
b)
}, !0); c._groupSelector = a; return c
}); i.Api.register("button()", function (a, b) { var c = this.buttons(a, b); 1 < c.length && c.splice(1, c.length); return c }); i.Api.registerPlural("buttons().active()", "button().active()", function (a) { return a === m ? this.map(function (a) { return a.inst.active(a.node) }) : this.each(function (b) { b.inst.active(b.node, a) }) }); i.Api.registerPlural("buttons().action()", "button().action()", function (a) {
return a === m ? this.map(function (a) { return a.inst.action(a.node) }) : this.each(function (b) {
b.inst.action(b.node,
a)
})
}); i.Api.register(["buttons().enable()", "button().enable()"], function (a) { return this.each(function (b) { b.inst.enable(b.node, a) }) }); i.Api.register(["buttons().disable()", "button().disable()"], function () { return this.each(function (a) { a.inst.disable(a.node) }) }); i.Api.registerPlural("buttons().nodes()", "button().node()", function () { var a = d(); d(this.each(function (b) { a = a.add(b.inst.node(b.node)) })); return a }); i.Api.registerPlural("buttons().text()", "button().text()", function (a) {
return a === m ? this.map(function (a) { return a.inst.text(a.node) }) :
this.each(function (b) { b.inst.text(b.node, a) })
}); i.Api.registerPlural("buttons().trigger()", "button().trigger()", function () { return this.each(function (a) { a.inst.node(a.node).trigger("click") }) }); i.Api.registerPlural("buttons().containers()", "buttons().container()", function () { var a = d(), b = this._groupSelector; this.iterator(!0, "table", function (c) { if (c._buttons) for (var c = l.instanceSelector(b, c._buttons), d = 0, g = c.length; d < g; d++)a = a.add(c[d].container()) }); return a }); i.Api.register("button().add()", function (a,
b) { var c = this.context; c.length && (c = l.instanceSelector(this._groupSelector, c[0]._buttons), c.length && c[0].add(b, a)); return this.button(this._groupSelector, a) }); i.Api.register("buttons().destroy()", function () { this.pluck("inst").unique().each(function (a) { a.destroy() }); return this }); i.Api.registerPlural("buttons().remove()", "buttons().remove()", function () { this.each(function (a) { a.inst.remove(a.node) }); return this }); var q; i.Api.register("buttons.info()", function (a, b, c) {
var e = this; if (!1 === a) return d("#datatables_buttons_info").fadeOut(function () { d(this).remove() }),
clearTimeout(q), q = null, this; q && clearTimeout(q); d("#datatables_buttons_info").length && d("#datatables_buttons_info").remove(); d('
').html(a ? "
" + a + " " : "").append(d("
")["string" === typeof b ? "html" : "append"](b)).css("display", "none").appendTo("body").fadeIn(); c !== m && 0 !== c && (q = setTimeout(function () { e.buttons.info(!1) }, c)); return this
}); i.Api.register("buttons.exportData()", function (a) {
if (this.context.length) {
for (var b = new i.Api(this.context[0]),
c = d.extend(!0, {}, { rows: null, columns: "", modifier: { search: "applied", order: "applied" }, orthogonal: "display", stripHtml: !0, stripNewlines: !0, decodeEntities: !0, trim: !0, format: { header: function (a) { return e(a) }, footer: function (a) { return e(a) }, body: function (a) { return e(a) } } }, a), e = function (a) { if ("string" !== typeof a) return a; c.stripHtml && (a = a.replace(/<[^>]*>/g, "")); c.trim && (a = a.replace(/^\s+|\s+$/g, "")); c.stripNewlines && (a = a.replace(/\n/g, " ")); c.decodeEntities && (t.innerHTML = a, a = t.value); return a }, a = b.columns(c.columns).indexes().map(function (a) {
var d =
b.column(a).header(); return c.format.header(d.innerHTML, a, d)
}).toArray(), g = b.table().footer() ? b.columns(c.columns).indexes().map(function (a) { var d = b.column(a).footer(); return c.format.footer(d ? d.innerHTML : "", a, d) }).toArray() : null, h = b.rows(c.rows, c.modifier).indexes().toArray(), f = b.cells(h, c.columns).render(c.orthogonal).toArray(), h = b.cells(h, c.columns).nodes().toArray(), j = a.length, k = 0 < j ? f.length / j : 0, l = Array(k), m = 0, n = 0; n < k; n++) {
for (var o = Array(j), q = 0; q < j; q++)o[q] = c.format.body(f[m], n, q, h[m]), m++; l[n] =
o
} return { header: a, footer: g, body: l }
}
}); var t = d("
")[0]; d.fn.dataTable.Buttons = l; d.fn.DataTable.Buttons = l; d(o).on("init.dt plugin-init.dt", function (a, b) { if ("dt" === a.namespace) { var c = b.oInit.buttons || i.defaults.buttons; c && !b._buttons && (new l(b, c)).container() } }); i.ext.feature.push({ fnInit: function (a) { var a = new i.Api(a), b = a.init().buttons || i.defaults.buttons; return (new l(a, b)).container() }, cFeature: "B" }); return l
});
/*!
JSZip - A Javascript class for generating and reading zip files
(c) 2009-2014 Stuart Knightley
Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/master/LICENSE.markdown.
JSZip uses the library pako released under the MIT license :
https://github.com/nodeca/pako/blob/master/LICENSE
*/
!function (a) { if ("object" == typeof exports && "undefined" != typeof module) module.exports = a(); else if ("function" == typeof define && define.amd) define([], a); else { var b; "undefined" != typeof window ? b = window : "undefined" != typeof global ? b = global : "undefined" != typeof self && (b = self), b.JSZip = a() } }(function () {
return function a(b, c, d) { function e(g, h) { if (!c[g]) { if (!b[g]) { var i = "function" == typeof require && require; if (!h && i) return i(g, !0); if (f) return f(g, !0); throw new Error("Cannot find module '" + g + "'") } var j = c[g] = { exports: {} }; b[g][0].call(j.exports, function (a) { var c = b[g][1][a]; return e(c ? c : a) }, j, j.exports, a, b, c, d) } return c[g].exports } for (var f = "function" == typeof require && require, g = 0; g < d.length; g++)e(d[g]); return e }({
1: [function (a, b, c) { "use strict"; var d = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; c.encode = function (a) { for (var b, c, e, f, g, h, i, j = "", k = 0; k < a.length;)b = a.charCodeAt(k++), c = a.charCodeAt(k++), e = a.charCodeAt(k++), f = b >> 2, g = (3 & b) << 4 | c >> 4, h = (15 & c) << 2 | e >> 6, i = 63 & e, isNaN(c) ? h = i = 64 : isNaN(e) && (i = 64), j = j + d.charAt(f) + d.charAt(g) + d.charAt(h) + d.charAt(i); return j }, c.decode = function (a) { var b, c, e, f, g, h, i, j = "", k = 0; for (a = a.replace(/[^A-Za-z0-9\+\/\=]/g, ""); k < a.length;)f = d.indexOf(a.charAt(k++)), g = d.indexOf(a.charAt(k++)), h = d.indexOf(a.charAt(k++)), i = d.indexOf(a.charAt(k++)), b = f << 2 | g >> 4, c = (15 & g) << 4 | h >> 2, e = (3 & h) << 6 | i, j += String.fromCharCode(b), 64 != h && (j += String.fromCharCode(c)), 64 != i && (j += String.fromCharCode(e)); return j } }, {}], 2: [function (a, b) { "use strict"; function c() { this.compressedSize = 0, this.uncompressedSize = 0, this.crc32 = 0, this.compressionMethod = null, this.compressedContent = null } c.prototype = { getContent: function () { return null }, getCompressedContent: function () { return null } }, b.exports = c }, {}], 3: [function (a, b, c) { "use strict"; c.STORE = { magic: "\x00\x00", compress: function (a) { return a }, uncompress: function (a) { return a }, compressInputType: null, uncompressInputType: null }, c.DEFLATE = a("./flate") }, { "./flate": 8 }], 4: [function (a, b) { "use strict"; var c = a("./utils"), d = [0, 1996959894, 3993919788, 2567524794, 124634137, 1886057615, 3915621685, 2657392035, 249268274, 2044508324, 3772115230, 2547177864, 162941995, 2125561021, 3887607047, 2428444049, 498536548, 1789927666, 4089016648, 2227061214, 450548861, 1843258603, 4107580753, 2211677639, 325883990, 1684777152, 4251122042, 2321926636, 335633487, 1661365465, 4195302755, 2366115317, 997073096, 1281953886, 3579855332, 2724688242, 1006888145, 1258607687, 3524101629, 2768942443, 901097722, 1119000684, 3686517206, 2898065728, 853044451, 1172266101, 3705015759, 2882616665, 651767980, 1373503546, 3369554304, 3218104598, 565507253, 1454621731, 3485111705, 3099436303, 671266974, 1594198024, 3322730930, 2970347812, 795835527, 1483230225, 3244367275, 3060149565, 1994146192, 31158534, 2563907772, 4023717930, 1907459465, 112637215, 2680153253, 3904427059, 2013776290, 251722036, 2517215374, 3775830040, 2137656763, 141376813, 2439277719, 3865271297, 1802195444, 476864866, 2238001368, 4066508878, 1812370925, 453092731, 2181625025, 4111451223, 1706088902, 314042704, 2344532202, 4240017532, 1658658271, 366619977, 2362670323, 4224994405, 1303535960, 984961486, 2747007092, 3569037538, 1256170817, 1037604311, 2765210733, 3554079995, 1131014506, 879679996, 2909243462, 3663771856, 1141124467, 855842277, 2852801631, 3708648649, 1342533948, 654459306, 3188396048, 3373015174, 1466479909, 544179635, 3110523913, 3462522015, 1591671054, 702138776, 2966460450, 3352799412, 1504918807, 783551873, 3082640443, 3233442989, 3988292384, 2596254646, 62317068, 1957810842, 3939845945, 2647816111, 81470997, 1943803523, 3814918930, 2489596804, 225274430, 2053790376, 3826175755, 2466906013, 167816743, 2097651377, 4027552580, 2265490386, 503444072, 1762050814, 4150417245, 2154129355, 426522225, 1852507879, 4275313526, 2312317920, 282753626, 1742555852, 4189708143, 2394877945, 397917763, 1622183637, 3604390888, 2714866558, 953729732, 1340076626, 3518719985, 2797360999, 1068828381, 1219638859, 3624741850, 2936675148, 906185462, 1090812512, 3747672003, 2825379669, 829329135, 1181335161, 3412177804, 3160834842, 628085408, 1382605366, 3423369109, 3138078467, 570562233, 1426400815, 3317316542, 2998733608, 733239954, 1555261956, 3268935591, 3050360625, 752459403, 1541320221, 2607071920, 3965973030, 1969922972, 40735498, 2617837225, 3943577151, 1913087877, 83908371, 2512341634, 3803740692, 2075208622, 213261112, 2463272603, 3855990285, 2094854071, 198958881, 2262029012, 4057260610, 1759359992, 534414190, 2176718541, 4139329115, 1873836001, 414664567, 2282248934, 4279200368, 1711684554, 285281116, 2405801727, 4167216745, 1634467795, 376229701, 2685067896, 3608007406, 1308918612, 956543938, 2808555105, 3495958263, 1231636301, 1047427035, 2932959818, 3654703836, 1088359270, 936918e3, 2847714899, 3736837829, 1202900863, 817233897, 3183342108, 3401237130, 1404277552, 615818150, 3134207493, 3453421203, 1423857449, 601450431, 3009837614, 3294710456, 1567103746, 711928724, 3020668471, 3272380065, 1510334235, 755167117]; b.exports = function (a, b) { if ("undefined" == typeof a || !a.length) return 0; var e = "string" !== c.getTypeOf(a); "undefined" == typeof b && (b = 0); var f = 0, g = 0, h = 0; b = -1 ^ b; for (var i = 0, j = a.length; j > i; i++)h = e ? a[i] : a.charCodeAt(i), g = 255 & (b ^ h), f = d[g], b = b >>> 8 ^ f; return -1 ^ b } }, { "./utils": 21 }], 5: [function (a, b) { "use strict"; function c() { this.data = null, this.length = 0, this.index = 0 } var d = a("./utils"); c.prototype = { checkOffset: function (a) { this.checkIndex(this.index + a) }, checkIndex: function (a) { if (this.length < a || 0 > a) throw new Error("End of data reached (data length = " + this.length + ", asked index = " + a + "). Corrupted zip ?") }, setIndex: function (a) { this.checkIndex(a), this.index = a }, skip: function (a) { this.setIndex(this.index + a) }, byteAt: function () { }, readInt: function (a) { var b, c = 0; for (this.checkOffset(a), b = this.index + a - 1; b >= this.index; b--)c = (c << 8) + this.byteAt(b); return this.index += a, c }, readString: function (a) { return d.transformTo("string", this.readData(a)) }, readData: function () { }, lastIndexOfSignature: function () { }, readDate: function () { var a = this.readInt(4); return new Date((a >> 25 & 127) + 1980, (a >> 21 & 15) - 1, a >> 16 & 31, a >> 11 & 31, a >> 5 & 63, (31 & a) << 1) } }, b.exports = c }, { "./utils": 21 }], 6: [function (a, b, c) { "use strict"; c.base64 = !1, c.binary = !1, c.dir = !1, c.createFolders = !1, c.date = null, c.compression = null, c.compressionOptions = null, c.comment = null, c.unixPermissions = null, c.dosPermissions = null }, {}], 7: [function (a, b, c) { "use strict"; var d = a("./utils"); c.string2binary = function (a) { return d.string2binary(a) }, c.string2Uint8Array = function (a) { return d.transformTo("uint8array", a) }, c.uint8Array2String = function (a) { return d.transformTo("string", a) }, c.string2Blob = function (a) { var b = d.transformTo("arraybuffer", a); return d.arrayBuffer2Blob(b) }, c.arrayBuffer2Blob = function (a) { return d.arrayBuffer2Blob(a) }, c.transformTo = function (a, b) { return d.transformTo(a, b) }, c.getTypeOf = function (a) { return d.getTypeOf(a) }, c.checkSupport = function (a) { return d.checkSupport(a) }, c.MAX_VALUE_16BITS = d.MAX_VALUE_16BITS, c.MAX_VALUE_32BITS = d.MAX_VALUE_32BITS, c.pretty = function (a) { return d.pretty(a) }, c.findCompression = function (a) { return d.findCompression(a) }, c.isRegExp = function (a) { return d.isRegExp(a) } }, { "./utils": 21 }], 8: [function (a, b, c) { "use strict"; var d = "undefined" != typeof Uint8Array && "undefined" != typeof Uint16Array && "undefined" != typeof Uint32Array, e = a("pako"); c.uncompressInputType = d ? "uint8array" : "array", c.compressInputType = d ? "uint8array" : "array", c.magic = "\b\x00", c.compress = function (a, b) { return e.deflateRaw(a, { level: b.level || -1 }) }, c.uncompress = function (a) { return e.inflateRaw(a) } }, { pako: 24 }], 9: [function (a, b) { "use strict"; function c(a, b) { return this instanceof c ? (this.files = {}, this.comment = null, this.root = "", a && this.load(a, b), void (this.clone = function () { var a = new c; for (var b in this) "function" != typeof this[b] && (a[b] = this[b]); return a })) : new c(a, b) } var d = a("./base64"); c.prototype = a("./object"), c.prototype.load = a("./load"), c.support = a("./support"), c.defaults = a("./defaults"), c.utils = a("./deprecatedPublicUtils"), c.base64 = { encode: function (a) { return d.encode(a) }, decode: function (a) { return d.decode(a) } }, c.compressions = a("./compressions"), b.exports = c }, { "./base64": 1, "./compressions": 3, "./defaults": 6, "./deprecatedPublicUtils": 7, "./load": 10, "./object": 13, "./support": 17 }], 10: [function (a, b) { "use strict"; var c = a("./base64"), d = a("./zipEntries"); b.exports = function (a, b) { var e, f, g, h; for (b = b || {}, b.base64 && (a = c.decode(a)), f = new d(a, b), e = f.files, g = 0; g < e.length; g++)h = e[g], this.file(h.fileName, h.decompressed, { binary: !0, optimizedBinaryString: !0, date: h.date, dir: h.dir, comment: h.fileComment.length ? h.fileComment : null, unixPermissions: h.unixPermissions, dosPermissions: h.dosPermissions, createFolders: b.createFolders }); return f.zipComment.length && (this.comment = f.zipComment), this } }, { "./base64": 1, "./zipEntries": 22 }], 11: [function (a, b) { (function (a) { "use strict"; b.exports = function (b, c) { return new a(b, c) }, b.exports.test = function (b) { return a.isBuffer(b) } }).call(this, "undefined" != typeof Buffer ? Buffer : void 0) }, {}], 12: [function (a, b) { "use strict"; function c(a) { this.data = a, this.length = this.data.length, this.index = 0 } var d = a("./uint8ArrayReader"); c.prototype = new d, c.prototype.readData = function (a) { this.checkOffset(a); var b = this.data.slice(this.index, this.index + a); return this.index += a, b }, b.exports = c }, { "./uint8ArrayReader": 18 }], 13: [function (a, b) { "use strict"; var c = a("./support"), d = a("./utils"), e = a("./crc32"), f = a("./signature"), g = a("./defaults"), h = a("./base64"), i = a("./compressions"), j = a("./compressedObject"), k = a("./nodeBuffer"), l = a("./utf8"), m = a("./stringWriter"), n = a("./uint8ArrayWriter"), o = function (a) { if (a._data instanceof j && (a._data = a._data.getContent(), a.options.binary = !0, a.options.base64 = !1, "uint8array" === d.getTypeOf(a._data))) { var b = a._data; a._data = new Uint8Array(b.length), 0 !== b.length && a._data.set(b, 0) } return a._data }, p = function (a) { var b = o(a), e = d.getTypeOf(b); return "string" === e ? !a.options.binary && c.nodebuffer ? k(b, "utf-8") : a.asBinary() : b }, q = function (a) { var b = o(this); return null === b || "undefined" == typeof b ? "" : (this.options.base64 && (b = h.decode(b)), b = a && this.options.binary ? D.utf8decode(b) : d.transformTo("string", b), a || this.options.binary || (b = d.transformTo("string", D.utf8encode(b))), b) }, r = function (a, b, c) { this.name = a, this.dir = c.dir, this.date = c.date, this.comment = c.comment, this.unixPermissions = c.unixPermissions, this.dosPermissions = c.dosPermissions, this._data = b, this.options = c, this._initialMetadata = { dir: c.dir, date: c.date } }; r.prototype = { asText: function () { return q.call(this, !0) }, asBinary: function () { return q.call(this, !1) }, asNodeBuffer: function () { var a = p(this); return d.transformTo("nodebuffer", a) }, asUint8Array: function () { var a = p(this); return d.transformTo("uint8array", a) }, asArrayBuffer: function () { return this.asUint8Array().buffer } }; var s = function (a, b) { var c, d = ""; for (c = 0; b > c; c++)d += String.fromCharCode(255 & a), a >>>= 8; return d }, t = function () { var a, b, c = {}; for (a = 0; a < arguments.length; a++)for (b in arguments[a]) arguments[a].hasOwnProperty(b) && "undefined" == typeof c[b] && (c[b] = arguments[a][b]); return c }, u = function (a) { return a = a || {}, a.base64 !== !0 || null !== a.binary && void 0 !== a.binary || (a.binary = !0), a = t(a, g), a.date = a.date || new Date, null !== a.compression && (a.compression = a.compression.toUpperCase()), a }, v = function (a, b, c) { var e, f = d.getTypeOf(b); if (c = u(c), "string" == typeof c.unixPermissions && (c.unixPermissions = parseInt(c.unixPermissions, 8)), c.unixPermissions && 16384 & c.unixPermissions && (c.dir = !0), c.dosPermissions && 16 & c.dosPermissions && (c.dir = !0), c.dir && (a = x(a)), c.createFolders && (e = w(a)) && y.call(this, e, !0), c.dir || null === b || "undefined" == typeof b) c.base64 = !1, c.binary = !1, b = null, f = null; else if ("string" === f) c.binary && !c.base64 && c.optimizedBinaryString !== !0 && (b = d.string2binary(b)); else { if (c.base64 = !1, c.binary = !0, !(f || b instanceof j)) throw new Error("The data of '" + a + "' is in an unsupported format !"); "arraybuffer" === f && (b = d.transformTo("uint8array", b)) } var g = new r(a, b, c); return this.files[a] = g, g }, w = function (a) { "/" == a.slice(-1) && (a = a.substring(0, a.length - 1)); var b = a.lastIndexOf("/"); return b > 0 ? a.substring(0, b) : "" }, x = function (a) { return "/" != a.slice(-1) && (a += "/"), a }, y = function (a, b) { return b = "undefined" != typeof b ? b : !1, a = x(a), this.files[a] || v.call(this, a, null, { dir: !0, createFolders: b }), this.files[a] }, z = function (a, b, c) { var f, g = new j; return a._data instanceof j ? (g.uncompressedSize = a._data.uncompressedSize, g.crc32 = a._data.crc32, 0 === g.uncompressedSize || a.dir ? (b = i.STORE, g.compressedContent = "", g.crc32 = 0) : a._data.compressionMethod === b.magic ? g.compressedContent = a._data.getCompressedContent() : (f = a._data.getContent(), g.compressedContent = b.compress(d.transformTo(b.compressInputType, f), c))) : (f = p(a), (!f || 0 === f.length || a.dir) && (b = i.STORE, f = ""), g.uncompressedSize = f.length, g.crc32 = e(f), g.compressedContent = b.compress(d.transformTo(b.compressInputType, f), c)), g.compressedSize = g.compressedContent.length, g.compressionMethod = b.magic, g }, A = function (a, b) { var c = a; return a || (c = b ? 16893 : 33204), (65535 & c) << 16 }, B = function (a) { return 63 & (a || 0) }, C = function (a, b, c, g, h) { var i, j, k, m, n = (c.compressedContent, d.transformTo("string", l.utf8encode(b.name))), o = b.comment || "", p = d.transformTo("string", l.utf8encode(o)), q = n.length !== b.name.length, r = p.length !== o.length, t = b.options, u = "", v = "", w = ""; k = b._initialMetadata.dir !== b.dir ? b.dir : t.dir, m = b._initialMetadata.date !== b.date ? b.date : t.date; var x = 0, y = 0; k && (x |= 16), "UNIX" === h ? (y = 798, x |= A(b.unixPermissions, k)) : (y = 20, x |= B(b.dosPermissions, k)), i = m.getHours(), i <<= 6, i |= m.getMinutes(), i <<= 5, i |= m.getSeconds() / 2, j = m.getFullYear() - 1980, j <<= 4, j |= m.getMonth() + 1, j <<= 5, j |= m.getDate(), q && (v = s(1, 1) + s(e(n), 4) + n, u += "up" + s(v.length, 2) + v), r && (w = s(1, 1) + s(this.crc32(p), 4) + p, u += "uc" + s(w.length, 2) + w); var z = ""; z += "\n\x00", z += q || r ? "\x00\b" : "\x00\x00", z += c.compressionMethod, z += s(i, 2), z += s(j, 2), z += s(c.crc32, 4), z += s(c.compressedSize, 4), z += s(c.uncompressedSize, 4), z += s(n.length, 2), z += s(u.length, 2); var C = f.LOCAL_FILE_HEADER + z + n + u, D = f.CENTRAL_FILE_HEADER + s(y, 2) + z + s(p.length, 2) + "\x00\x00\x00\x00" + s(x, 4) + s(g, 4) + n + u + p; return { fileRecord: C, dirRecord: D, compressedObject: c } }, D = { load: function () { throw new Error("Load method is not defined. Is the file jszip-load.js included ?") }, filter: function (a) { var b, c, d, e, f = []; for (b in this.files) this.files.hasOwnProperty(b) && (d = this.files[b], e = new r(d.name, d._data, t(d.options)), c = b.slice(this.root.length, b.length), b.slice(0, this.root.length) === this.root && a(c, e) && f.push(e)); return f }, file: function (a, b, c) { if (1 === arguments.length) { if (d.isRegExp(a)) { var e = a; return this.filter(function (a, b) { return !b.dir && e.test(a) }) } return this.filter(function (b, c) { return !c.dir && b === a })[0] || null } return a = this.root + a, v.call(this, a, b, c), this }, folder: function (a) { if (!a) return this; if (d.isRegExp(a)) return this.filter(function (b, c) { return c.dir && a.test(b) }); var b = this.root + a, c = y.call(this, b), e = this.clone(); return e.root = c.name, e }, remove: function (a) { a = this.root + a; var b = this.files[a]; if (b || ("/" != a.slice(-1) && (a += "/"), b = this.files[a]), b && !b.dir) delete this.files[a]; else for (var c = this.filter(function (b, c) { return c.name.slice(0, a.length) === a }), d = 0; d < c.length; d++)delete this.files[c[d].name]; return this }, generate: function (a) { a = t(a || {}, { base64: !0, compression: "STORE", compressionOptions: null, type: "base64", platform: "DOS", comment: null, mimeType: "application/zip" }), d.checkSupport(a.type), ("darwin" === a.platform || "freebsd" === a.platform || "linux" === a.platform || "sunos" === a.platform) && (a.platform = "UNIX"), "win32" === a.platform && (a.platform = "DOS"); var b, c, e = [], g = 0, j = 0, k = d.transformTo("string", this.utf8encode(a.comment || this.comment || "")); for (var l in this.files) if (this.files.hasOwnProperty(l)) { var o = this.files[l], p = o.options.compression || a.compression.toUpperCase(), q = i[p]; if (!q) throw new Error(p + " is not a valid compression method !"); var r = o.options.compressionOptions || a.compressionOptions || {}, u = z.call(this, o, q, r), v = C.call(this, l, o, u, g, a.platform); g += v.fileRecord.length + u.compressedSize, j += v.dirRecord.length, e.push(v) } var w = ""; w = f.CENTRAL_DIRECTORY_END + "\x00\x00\x00\x00" + s(e.length, 2) + s(e.length, 2) + s(j, 4) + s(g, 4) + s(k.length, 2) + k; var x = a.type.toLowerCase(); for (b = "uint8array" === x || "arraybuffer" === x || "blob" === x || "nodebuffer" === x ? new n(g + j + w.length) : new m(g + j + w.length), c = 0; c < e.length; c++)b.append(e[c].fileRecord), b.append(e[c].compressedObject.compressedContent); for (c = 0; c < e.length; c++)b.append(e[c].dirRecord); b.append(w); var y = b.finalize(); switch (a.type.toLowerCase()) { case "uint8array": case "arraybuffer": case "nodebuffer": return d.transformTo(a.type.toLowerCase(), y); case "blob": return d.arrayBuffer2Blob(d.transformTo("arraybuffer", y), a.mimeType); case "base64": return a.base64 ? h.encode(y) : y; default: return y } }, crc32: function (a, b) { return e(a, b) }, utf8encode: function (a) { return d.transformTo("string", l.utf8encode(a)) }, utf8decode: function (a) { return l.utf8decode(a) } }; b.exports = D }, { "./base64": 1, "./compressedObject": 2, "./compressions": 3, "./crc32": 4, "./defaults": 6, "./nodeBuffer": 11, "./signature": 14, "./stringWriter": 16, "./support": 17, "./uint8ArrayWriter": 19, "./utf8": 20, "./utils": 21 }], 14: [function (a, b, c) { "use strict"; c.LOCAL_FILE_HEADER = "PK", c.CENTRAL_FILE_HEADER = "PK", c.CENTRAL_DIRECTORY_END = "PK", c.ZIP64_CENTRAL_DIRECTORY_LOCATOR = "PK", c.ZIP64_CENTRAL_DIRECTORY_END = "PK", c.DATA_DESCRIPTOR = "PK\b" }, {}], 15: [function (a, b) { "use strict"; function c(a, b) { this.data = a, b || (this.data = e.string2binary(this.data)), this.length = this.data.length, this.index = 0 } var d = a("./dataReader"), e = a("./utils"); c.prototype = new d, c.prototype.byteAt = function (a) { return this.data.charCodeAt(a) }, c.prototype.lastIndexOfSignature = function (a) { return this.data.lastIndexOf(a) }, c.prototype.readData = function (a) { this.checkOffset(a); var b = this.data.slice(this.index, this.index + a); return this.index += a, b }, b.exports = c }, { "./dataReader": 5, "./utils": 21 }], 16: [function (a, b) { "use strict"; var c = a("./utils"), d = function () { this.data = [] }; d.prototype = { append: function (a) { a = c.transformTo("string", a), this.data.push(a) }, finalize: function () { return this.data.join("") } }, b.exports = d }, { "./utils": 21 }], 17: [function (a, b, c) { (function (a) { "use strict"; if (c.base64 = !0, c.array = !0, c.string = !0, c.arraybuffer = "undefined" != typeof ArrayBuffer && "undefined" != typeof Uint8Array, c.nodebuffer = "undefined" != typeof a, c.uint8array = "undefined" != typeof Uint8Array, "undefined" == typeof ArrayBuffer) c.blob = !1; else { var b = new ArrayBuffer(0); try { c.blob = 0 === new Blob([b], { type: "application/zip" }).size } catch (d) { try { var e = window.BlobBuilder || window.WebKitBlobBuilder || window.MozBlobBuilder || window.MSBlobBuilder, f = new e; f.append(b), c.blob = 0 === f.getBlob("application/zip").size } catch (d) { c.blob = !1 } } } }).call(this, "undefined" != typeof Buffer ? Buffer : void 0) }, {}], 18: [function (a, b) { "use strict"; function c(a) { a && (this.data = a, this.length = this.data.length, this.index = 0) } var d = a("./dataReader"); c.prototype = new d, c.prototype.byteAt = function (a) { return this.data[a] }, c.prototype.lastIndexOfSignature = function (a) { for (var b = a.charCodeAt(0), c = a.charCodeAt(1), d = a.charCodeAt(2), e = a.charCodeAt(3), f = this.length - 4; f >= 0; --f)if (this.data[f] === b && this.data[f + 1] === c && this.data[f + 2] === d && this.data[f + 3] === e) return f; return -1 }, c.prototype.readData = function (a) { if (this.checkOffset(a), 0 === a) return new Uint8Array(0); var b = this.data.subarray(this.index, this.index + a); return this.index += a, b }, b.exports = c }, { "./dataReader": 5 }], 19: [function (a, b) { "use strict"; var c = a("./utils"), d = function (a) { this.data = new Uint8Array(a), this.index = 0 }; d.prototype = { append: function (a) { 0 !== a.length && (a = c.transformTo("uint8array", a), this.data.set(a, this.index), this.index += a.length) }, finalize: function () { return this.data } }, b.exports = d }, { "./utils": 21 }], 20: [function (a, b, c) { "use strict"; for (var d = a("./utils"), e = a("./support"), f = a("./nodeBuffer"), g = new Array(256), h = 0; 256 > h; h++)g[h] = h >= 252 ? 6 : h >= 248 ? 5 : h >= 240 ? 4 : h >= 224 ? 3 : h >= 192 ? 2 : 1; g[254] = g[254] = 1; var i = function (a) { var b, c, d, f, g, h = a.length, i = 0; for (f = 0; h > f; f++)c = a.charCodeAt(f), 55296 === (64512 & c) && h > f + 1 && (d = a.charCodeAt(f + 1), 56320 === (64512 & d) && (c = 65536 + (c - 55296 << 10) + (d - 56320), f++)), i += 128 > c ? 1 : 2048 > c ? 2 : 65536 > c ? 3 : 4; for (b = e.uint8array ? new Uint8Array(i) : new Array(i), g = 0, f = 0; i > g; f++)c = a.charCodeAt(f), 55296 === (64512 & c) && h > f + 1 && (d = a.charCodeAt(f + 1), 56320 === (64512 & d) && (c = 65536 + (c - 55296 << 10) + (d - 56320), f++)), 128 > c ? b[g++] = c : 2048 > c ? (b[g++] = 192 | c >>> 6, b[g++] = 128 | 63 & c) : 65536 > c ? (b[g++] = 224 | c >>> 12, b[g++] = 128 | c >>> 6 & 63, b[g++] = 128 | 63 & c) : (b[g++] = 240 | c >>> 18, b[g++] = 128 | c >>> 12 & 63, b[g++] = 128 | c >>> 6 & 63, b[g++] = 128 | 63 & c); return b }, j = function (a, b) { var c; for (b = b || a.length, b > a.length && (b = a.length), c = b - 1; c >= 0 && 128 === (192 & a[c]);)c--; return 0 > c ? b : 0 === c ? b : c + g[a[c]] > b ? c : b }, k = function (a) { var b, c, e, f, h = a.length, i = new Array(2 * h); for (c = 0, b = 0; h > b;)if (e = a[b++], 128 > e) i[c++] = e; else if (f = g[e], f > 4) i[c++] = 65533, b += f - 1; else { for (e &= 2 === f ? 31 : 3 === f ? 15 : 7; f > 1 && h > b;)e = e << 6 | 63 & a[b++], f--; f > 1 ? i[c++] = 65533 : 65536 > e ? i[c++] = e : (e -= 65536, i[c++] = 55296 | e >> 10 & 1023, i[c++] = 56320 | 1023 & e) } return i.length !== c && (i.subarray ? i = i.subarray(0, c) : i.length = c), d.applyFromCharCode(i) }; c.utf8encode = function (a) { return e.nodebuffer ? f(a, "utf-8") : i(a) }, c.utf8decode = function (a) { if (e.nodebuffer) return d.transformTo("nodebuffer", a).toString("utf-8"); a = d.transformTo(e.uint8array ? "uint8array" : "array", a); for (var b = [], c = 0, f = a.length, g = 65536; f > c;) { var h = j(a, Math.min(c + g, f)); b.push(e.uint8array ? k(a.subarray(c, h)) : k(a.slice(c, h))), c = h } return b.join("") } }, { "./nodeBuffer": 11, "./support": 17, "./utils": 21 }], 21: [function (a, b, c) { "use strict"; function d(a) { return a } function e(a, b) { for (var c = 0; c < a.length; ++c)b[c] = 255 & a.charCodeAt(c); return b } function f(a) { var b = 65536, d = [], e = a.length, f = c.getTypeOf(a), g = 0, h = !0; try { switch (f) { case "uint8array": String.fromCharCode.apply(null, new Uint8Array(0)); break; case "nodebuffer": String.fromCharCode.apply(null, j(0)) } } catch (i) { h = !1 } if (!h) { for (var k = "", l = 0; l < a.length; l++)k += String.fromCharCode(a[l]); return k } for (; e > g && b > 1;)try { d.push("array" === f || "nodebuffer" === f ? String.fromCharCode.apply(null, a.slice(g, Math.min(g + b, e))) : String.fromCharCode.apply(null, a.subarray(g, Math.min(g + b, e)))), g += b } catch (i) { b = Math.floor(b / 2) } return d.join("") } function g(a, b) { for (var c = 0; c < a.length; c++)b[c] = a[c]; return b } var h = a("./support"), i = a("./compressions"), j = a("./nodeBuffer"); c.string2binary = function (a) { for (var b = "", c = 0; c < a.length; c++)b += String.fromCharCode(255 & a.charCodeAt(c)); return b }, c.arrayBuffer2Blob = function (a, b) { c.checkSupport("blob"), b = b || "application/zip"; try { return new Blob([a], { type: b }) } catch (d) { try { var e = window.BlobBuilder || window.WebKitBlobBuilder || window.MozBlobBuilder || window.MSBlobBuilder, f = new e; return f.append(a), f.getBlob(b) } catch (d) { throw new Error("Bug : can't construct the Blob.") } } }, c.applyFromCharCode = f; var k = {}; k.string = { string: d, array: function (a) { return e(a, new Array(a.length)) }, arraybuffer: function (a) { return k.string.uint8array(a).buffer }, uint8array: function (a) { return e(a, new Uint8Array(a.length)) }, nodebuffer: function (a) { return e(a, j(a.length)) } }, k.array = { string: f, array: d, arraybuffer: function (a) { return new Uint8Array(a).buffer }, uint8array: function (a) { return new Uint8Array(a) }, nodebuffer: function (a) { return j(a) } }, k.arraybuffer = { string: function (a) { return f(new Uint8Array(a)) }, array: function (a) { return g(new Uint8Array(a), new Array(a.byteLength)) }, arraybuffer: d, uint8array: function (a) { return new Uint8Array(a) }, nodebuffer: function (a) { return j(new Uint8Array(a)) } }, k.uint8array = { string: f, array: function (a) { return g(a, new Array(a.length)) }, arraybuffer: function (a) { return a.buffer }, uint8array: d, nodebuffer: function (a) { return j(a) } }, k.nodebuffer = { string: f, array: function (a) { return g(a, new Array(a.length)) }, arraybuffer: function (a) { return k.nodebuffer.uint8array(a).buffer }, uint8array: function (a) { return g(a, new Uint8Array(a.length)) }, nodebuffer: d }, c.transformTo = function (a, b) { if (b || (b = ""), !a) return b; c.checkSupport(a); var d = c.getTypeOf(b), e = k[d][a](b); return e }, c.getTypeOf = function (a) { return "string" == typeof a ? "string" : "[object Array]" === Object.prototype.toString.call(a) ? "array" : h.nodebuffer && j.test(a) ? "nodebuffer" : h.uint8array && a instanceof Uint8Array ? "uint8array" : h.arraybuffer && a instanceof ArrayBuffer ? "arraybuffer" : void 0 }, c.checkSupport = function (a) { var b = h[a.toLowerCase()]; if (!b) throw new Error(a + " is not supported by this browser") }, c.MAX_VALUE_16BITS = 65535, c.MAX_VALUE_32BITS = -1, c.pretty = function (a) { var b, c, d = ""; for (c = 0; c < (a || "").length; c++)b = a.charCodeAt(c), d += "\\x" + (16 > b ? "0" : "") + b.toString(16).toUpperCase(); return d }, c.findCompression = function (a) { for (var b in i) if (i.hasOwnProperty(b) && i[b].magic === a) return i[b]; return null }, c.isRegExp = function (a) { return "[object RegExp]" === Object.prototype.toString.call(a) } }, { "./compressions": 3, "./nodeBuffer": 11, "./support": 17 }], 22: [function (a, b) { "use strict"; function c(a, b) { this.files = [], this.loadOptions = b, a && this.load(a) } var d = a("./stringReader"), e = a("./nodeBufferReader"), f = a("./uint8ArrayReader"), g = a("./utils"), h = a("./signature"), i = a("./zipEntry"), j = a("./support"), k = a("./object"); c.prototype = { checkSignature: function (a) { var b = this.reader.readString(4); if (b !== a) throw new Error("Corrupted zip or bug : unexpected signature (" + g.pretty(b) + ", expected " + g.pretty(a) + ")") }, readBlockEndOfCentral: function () { this.diskNumber = this.reader.readInt(2), this.diskWithCentralDirStart = this.reader.readInt(2), this.centralDirRecordsOnThisDisk = this.reader.readInt(2), this.centralDirRecords = this.reader.readInt(2), this.centralDirSize = this.reader.readInt(4), this.centralDirOffset = this.reader.readInt(4), this.zipCommentLength = this.reader.readInt(2), this.zipComment = this.reader.readString(this.zipCommentLength), this.zipComment = k.utf8decode(this.zipComment) }, readBlockZip64EndOfCentral: function () { this.zip64EndOfCentralSize = this.reader.readInt(8), this.versionMadeBy = this.reader.readString(2), this.versionNeeded = this.reader.readInt(2), this.diskNumber = this.reader.readInt(4), this.diskWithCentralDirStart = this.reader.readInt(4), this.centralDirRecordsOnThisDisk = this.reader.readInt(8), this.centralDirRecords = this.reader.readInt(8), this.centralDirSize = this.reader.readInt(8), this.centralDirOffset = this.reader.readInt(8), this.zip64ExtensibleData = {}; for (var a, b, c, d = this.zip64EndOfCentralSize - 44, e = 0; d > e;)a = this.reader.readInt(2), b = this.reader.readInt(4), c = this.reader.readString(b), this.zip64ExtensibleData[a] = { id: a, length: b, value: c } }, readBlockZip64EndOfCentralLocator: function () { if (this.diskWithZip64CentralDirStart = this.reader.readInt(4), this.relativeOffsetEndOfZip64CentralDir = this.reader.readInt(8), this.disksCount = this.reader.readInt(4), this.disksCount > 1) throw new Error("Multi-volumes zip are not supported") }, readLocalFiles: function () { var a, b; for (a = 0; a < this.files.length; a++)b = this.files[a], this.reader.setIndex(b.localHeaderOffset), this.checkSignature(h.LOCAL_FILE_HEADER), b.readLocalPart(this.reader), b.handleUTF8(), b.processAttributes() }, readCentralDir: function () { var a; for (this.reader.setIndex(this.centralDirOffset); this.reader.readString(4) === h.CENTRAL_FILE_HEADER;)a = new i({ zip64: this.zip64 }, this.loadOptions), a.readCentralPart(this.reader), this.files.push(a) }, readEndOfCentral: function () { var a = this.reader.lastIndexOfSignature(h.CENTRAL_DIRECTORY_END); if (-1 === a) { var b = !0; try { this.reader.setIndex(0), this.checkSignature(h.LOCAL_FILE_HEADER), b = !1 } catch (c) { } throw new Error(b ? "Can't find end of central directory : is this a zip file ? If it is, see http://stuk.github.io/jszip/documentation/howto/read_zip.html" : "Corrupted zip : can't find end of central directory") } if (this.reader.setIndex(a), this.checkSignature(h.CENTRAL_DIRECTORY_END), this.readBlockEndOfCentral(), this.diskNumber === g.MAX_VALUE_16BITS || this.diskWithCentralDirStart === g.MAX_VALUE_16BITS || this.centralDirRecordsOnThisDisk === g.MAX_VALUE_16BITS || this.centralDirRecords === g.MAX_VALUE_16BITS || this.centralDirSize === g.MAX_VALUE_32BITS || this.centralDirOffset === g.MAX_VALUE_32BITS) { if (this.zip64 = !0, a = this.reader.lastIndexOfSignature(h.ZIP64_CENTRAL_DIRECTORY_LOCATOR), -1 === a) throw new Error("Corrupted zip : can't find the ZIP64 end of central directory locator"); this.reader.setIndex(a), this.checkSignature(h.ZIP64_CENTRAL_DIRECTORY_LOCATOR), this.readBlockZip64EndOfCentralLocator(), this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir), this.checkSignature(h.ZIP64_CENTRAL_DIRECTORY_END), this.readBlockZip64EndOfCentral() } }, prepareReader: function (a) { var b = g.getTypeOf(a); this.reader = "string" !== b || j.uint8array ? "nodebuffer" === b ? new e(a) : new f(g.transformTo("uint8array", a)) : new d(a, this.loadOptions.optimizedBinaryString) }, load: function (a) { this.prepareReader(a), this.readEndOfCentral(), this.readCentralDir(), this.readLocalFiles() } }, b.exports = c }, { "./nodeBufferReader": 12, "./object": 13, "./signature": 14, "./stringReader": 15, "./support": 17, "./uint8ArrayReader": 18, "./utils": 21, "./zipEntry": 23 }], 23: [function (a, b) {
"use strict"; function c(a, b) { this.options = a, this.loadOptions = b } var d = a("./stringReader"), e = a("./utils"), f = a("./compressedObject"), g = a("./object"), h = 0, i = 3; c.prototype = {
isEncrypted: function () { return 1 === (1 & this.bitFlag) }, useUTF8: function () { return 2048 === (2048 & this.bitFlag) }, prepareCompressedContent: function (a, b, c) { return function () { var d = a.index; a.setIndex(b); var e = a.readData(c); return a.setIndex(d), e } }, prepareContent: function (a, b, c, d, f) { return function () { var a = e.transformTo(d.uncompressInputType, this.getCompressedContent()), b = d.uncompress(a); if (b.length !== f) throw new Error("Bug : uncompressed data size mismatch"); return b } }, readLocalPart: function (a) { var b, c; if (a.skip(22), this.fileNameLength = a.readInt(2), c = a.readInt(2), this.fileName = a.readString(this.fileNameLength), a.skip(c), -1 == this.compressedSize || -1 == this.uncompressedSize) throw new Error("Bug or corrupted zip : didn't get enough informations from the central directory (compressedSize == -1 || uncompressedSize == -1)"); if (b = e.findCompression(this.compressionMethod), null === b) throw new Error("Corrupted zip : compression " + e.pretty(this.compressionMethod) + " unknown (inner file : " + this.fileName + ")"); if (this.decompressed = new f, this.decompressed.compressedSize = this.compressedSize, this.decompressed.uncompressedSize = this.uncompressedSize, this.decompressed.crc32 = this.crc32, this.decompressed.compressionMethod = this.compressionMethod, this.decompressed.getCompressedContent = this.prepareCompressedContent(a, a.index, this.compressedSize, b), this.decompressed.getContent = this.prepareContent(a, a.index, this.compressedSize, b, this.uncompressedSize), this.loadOptions.checkCRC32 && (this.decompressed = e.transformTo("string", this.decompressed.getContent()), g.crc32(this.decompressed) !== this.crc32)) throw new Error("Corrupted zip : CRC32 mismatch") }, readCentralPart: function (a) { if (this.versionMadeBy = a.readInt(2), this.versionNeeded = a.readInt(2), this.bitFlag = a.readInt(2), this.compressionMethod = a.readString(2), this.date = a.readDate(), this.crc32 = a.readInt(4), this.compressedSize = a.readInt(4), this.uncompressedSize = a.readInt(4), this.fileNameLength = a.readInt(2), this.extraFieldsLength = a.readInt(2), this.fileCommentLength = a.readInt(2), this.diskNumberStart = a.readInt(2), this.internalFileAttributes = a.readInt(2), this.externalFileAttributes = a.readInt(4), this.localHeaderOffset = a.readInt(4), this.isEncrypted()) throw new Error("Encrypted zip are not supported"); this.fileName = a.readString(this.fileNameLength), this.readExtraFields(a), this.parseZIP64ExtraField(a), this.fileComment = a.readString(this.fileCommentLength) }, processAttributes: function () { this.unixPermissions = null, this.dosPermissions = null; var a = this.versionMadeBy >> 8; this.dir = 16 & this.externalFileAttributes ? !0 : !1, a === h && (this.dosPermissions = 63 & this.externalFileAttributes), a === i && (this.unixPermissions = this.externalFileAttributes >> 16 & 65535), this.dir || "/" !== this.fileName.slice(-1) || (this.dir = !0) }, parseZIP64ExtraField: function () { if (this.extraFields[1]) { var a = new d(this.extraFields[1].value); this.uncompressedSize === e.MAX_VALUE_32BITS && (this.uncompressedSize = a.readInt(8)), this.compressedSize === e.MAX_VALUE_32BITS && (this.compressedSize = a.readInt(8)), this.localHeaderOffset === e.MAX_VALUE_32BITS && (this.localHeaderOffset = a.readInt(8)), this.diskNumberStart === e.MAX_VALUE_32BITS && (this.diskNumberStart = a.readInt(4)) } }, readExtraFields: function (a) { var b, c, d, e = a.index; for (this.extraFields = this.extraFields || {}; a.index < e + this.extraFieldsLength;)b = a.readInt(2), c = a.readInt(2), d = a.readString(c), this.extraFields[b] = { id: b, length: c, value: d } }, handleUTF8: function () { if (this.useUTF8()) this.fileName = g.utf8decode(this.fileName), this.fileComment = g.utf8decode(this.fileComment); else { var a = this.findExtraFieldUnicodePath(); null !== a && (this.fileName = a); var b = this.findExtraFieldUnicodeComment(); null !== b && (this.fileComment = b) } }, findExtraFieldUnicodePath: function () {
var a = this.extraFields[28789]; if (a) {
var b = new d(a.value); return 1 !== b.readInt(1) ? null : g.crc32(this.fileName) !== b.readInt(4) ? null : g.utf8decode(b.readString(a.length - 5))
} return null
}, findExtraFieldUnicodeComment: function () { var a = this.extraFields[25461]; if (a) { var b = new d(a.value); return 1 !== b.readInt(1) ? null : g.crc32(this.fileComment) !== b.readInt(4) ? null : g.utf8decode(b.readString(a.length - 5)) } return null }
}, b.exports = c
}, { "./compressedObject": 2, "./object": 13, "./stringReader": 15, "./utils": 21 }], 24: [function (a, b) { "use strict"; var c = a("./lib/utils/common").assign, d = a("./lib/deflate"), e = a("./lib/inflate"), f = a("./lib/zlib/constants"), g = {}; c(g, d, e, f), b.exports = g }, { "./lib/deflate": 25, "./lib/inflate": 26, "./lib/utils/common": 27, "./lib/zlib/constants": 30 }], 25: [function (a, b, c) { "use strict"; function d(a, b) { var c = new s(b); if (c.push(a, !0), c.err) throw c.msg; return c.result } function e(a, b) { return b = b || {}, b.raw = !0, d(a, b) } function f(a, b) { return b = b || {}, b.gzip = !0, d(a, b) } var g = a("./zlib/deflate.js"), h = a("./utils/common"), i = a("./utils/strings"), j = a("./zlib/messages"), k = a("./zlib/zstream"), l = 0, m = 4, n = 0, o = 1, p = -1, q = 0, r = 8, s = function (a) { this.options = h.assign({ level: p, method: r, chunkSize: 16384, windowBits: 15, memLevel: 8, strategy: q, to: "" }, a || {}); var b = this.options; b.raw && b.windowBits > 0 ? b.windowBits = -b.windowBits : b.gzip && b.windowBits > 0 && b.windowBits < 16 && (b.windowBits += 16), this.err = 0, this.msg = "", this.ended = !1, this.chunks = [], this.strm = new k, this.strm.avail_out = 0; var c = g.deflateInit2(this.strm, b.level, b.method, b.windowBits, b.memLevel, b.strategy); if (c !== n) throw new Error(j[c]); b.header && g.deflateSetHeader(this.strm, b.header) }; s.prototype.push = function (a, b) { var c, d, e = this.strm, f = this.options.chunkSize; if (this.ended) return !1; d = b === ~~b ? b : b === !0 ? m : l, e.input = "string" == typeof a ? i.string2buf(a) : a, e.next_in = 0, e.avail_in = e.input.length; do { if (0 === e.avail_out && (e.output = new h.Buf8(f), e.next_out = 0, e.avail_out = f), c = g.deflate(e, d), c !== o && c !== n) return this.onEnd(c), this.ended = !0, !1; (0 === e.avail_out || 0 === e.avail_in && d === m) && this.onData("string" === this.options.to ? i.buf2binstring(h.shrinkBuf(e.output, e.next_out)) : h.shrinkBuf(e.output, e.next_out)) } while ((e.avail_in > 0 || 0 === e.avail_out) && c !== o); return d === m ? (c = g.deflateEnd(this.strm), this.onEnd(c), this.ended = !0, c === n) : !0 }, s.prototype.onData = function (a) { this.chunks.push(a) }, s.prototype.onEnd = function (a) { a === n && (this.result = "string" === this.options.to ? this.chunks.join("") : h.flattenChunks(this.chunks)), this.chunks = [], this.err = a, this.msg = this.strm.msg }, c.Deflate = s, c.deflate = d, c.deflateRaw = e, c.gzip = f }, { "./utils/common": 27, "./utils/strings": 28, "./zlib/deflate.js": 32, "./zlib/messages": 37, "./zlib/zstream": 39 }], 26: [function (a, b, c) { "use strict"; function d(a, b) { var c = new m(b); if (c.push(a, !0), c.err) throw c.msg; return c.result } function e(a, b) { return b = b || {}, b.raw = !0, d(a, b) } var f = a("./zlib/inflate.js"), g = a("./utils/common"), h = a("./utils/strings"), i = a("./zlib/constants"), j = a("./zlib/messages"), k = a("./zlib/zstream"), l = a("./zlib/gzheader"), m = function (a) { this.options = g.assign({ chunkSize: 16384, windowBits: 0, to: "" }, a || {}); var b = this.options; b.raw && b.windowBits >= 0 && b.windowBits < 16 && (b.windowBits = -b.windowBits, 0 === b.windowBits && (b.windowBits = -15)), !(b.windowBits >= 0 && b.windowBits < 16) || a && a.windowBits || (b.windowBits += 32), b.windowBits > 15 && b.windowBits < 48 && 0 === (15 & b.windowBits) && (b.windowBits |= 15), this.err = 0, this.msg = "", this.ended = !1, this.chunks = [], this.strm = new k, this.strm.avail_out = 0; var c = f.inflateInit2(this.strm, b.windowBits); if (c !== i.Z_OK) throw new Error(j[c]); this.header = new l, f.inflateGetHeader(this.strm, this.header) }; m.prototype.push = function (a, b) { var c, d, e, j, k, l = this.strm, m = this.options.chunkSize; if (this.ended) return !1; d = b === ~~b ? b : b === !0 ? i.Z_FINISH : i.Z_NO_FLUSH, l.input = "string" == typeof a ? h.binstring2buf(a) : a, l.next_in = 0, l.avail_in = l.input.length; do { if (0 === l.avail_out && (l.output = new g.Buf8(m), l.next_out = 0, l.avail_out = m), c = f.inflate(l, i.Z_NO_FLUSH), c !== i.Z_STREAM_END && c !== i.Z_OK) return this.onEnd(c), this.ended = !0, !1; l.next_out && (0 === l.avail_out || c === i.Z_STREAM_END || 0 === l.avail_in && d === i.Z_FINISH) && ("string" === this.options.to ? (e = h.utf8border(l.output, l.next_out), j = l.next_out - e, k = h.buf2string(l.output, e), l.next_out = j, l.avail_out = m - j, j && g.arraySet(l.output, l.output, e, j, 0), this.onData(k)) : this.onData(g.shrinkBuf(l.output, l.next_out))) } while (l.avail_in > 0 && c !== i.Z_STREAM_END); return c === i.Z_STREAM_END && (d = i.Z_FINISH), d === i.Z_FINISH ? (c = f.inflateEnd(this.strm), this.onEnd(c), this.ended = !0, c === i.Z_OK) : !0 }, m.prototype.onData = function (a) { this.chunks.push(a) }, m.prototype.onEnd = function (a) { a === i.Z_OK && (this.result = "string" === this.options.to ? this.chunks.join("") : g.flattenChunks(this.chunks)), this.chunks = [], this.err = a, this.msg = this.strm.msg }, c.Inflate = m, c.inflate = d, c.inflateRaw = e, c.ungzip = d }, { "./utils/common": 27, "./utils/strings": 28, "./zlib/constants": 30, "./zlib/gzheader": 33, "./zlib/inflate.js": 35, "./zlib/messages": 37, "./zlib/zstream": 39 }], 27: [function (a, b, c) { "use strict"; var d = "undefined" != typeof Uint8Array && "undefined" != typeof Uint16Array && "undefined" != typeof Int32Array; c.assign = function (a) { for (var b = Array.prototype.slice.call(arguments, 1); b.length;) { var c = b.shift(); if (c) { if ("object" != typeof c) throw new TypeError(c + "must be non-object"); for (var d in c) c.hasOwnProperty(d) && (a[d] = c[d]) } } return a }, c.shrinkBuf = function (a, b) { return a.length === b ? a : a.subarray ? a.subarray(0, b) : (a.length = b, a) }; var e = { arraySet: function (a, b, c, d, e) { if (b.subarray && a.subarray) return void a.set(b.subarray(c, c + d), e); for (var f = 0; d > f; f++)a[e + f] = b[c + f] }, flattenChunks: function (a) { var b, c, d, e, f, g; for (d = 0, b = 0, c = a.length; c > b; b++)d += a[b].length; for (g = new Uint8Array(d), e = 0, b = 0, c = a.length; c > b; b++)f = a[b], g.set(f, e), e += f.length; return g } }, f = { arraySet: function (a, b, c, d, e) { for (var f = 0; d > f; f++)a[e + f] = b[c + f] }, flattenChunks: function (a) { return [].concat.apply([], a) } }; c.setTyped = function (a) { a ? (c.Buf8 = Uint8Array, c.Buf16 = Uint16Array, c.Buf32 = Int32Array, c.assign(c, e)) : (c.Buf8 = Array, c.Buf16 = Array, c.Buf32 = Array, c.assign(c, f)) }, c.setTyped(d) }, {}], 28: [function (a, b, c) { "use strict"; function d(a, b) { if (65537 > b && (a.subarray && g || !a.subarray && f)) return String.fromCharCode.apply(null, e.shrinkBuf(a, b)); for (var c = "", d = 0; b > d; d++)c += String.fromCharCode(a[d]); return c } var e = a("./common"), f = !0, g = !0; try { String.fromCharCode.apply(null, [0]) } catch (h) { f = !1 } try { String.fromCharCode.apply(null, new Uint8Array(1)) } catch (h) { g = !1 } for (var i = new e.Buf8(256), j = 0; 256 > j; j++)i[j] = j >= 252 ? 6 : j >= 248 ? 5 : j >= 240 ? 4 : j >= 224 ? 3 : j >= 192 ? 2 : 1; i[254] = i[254] = 1, c.string2buf = function (a) { var b, c, d, f, g, h = a.length, i = 0; for (f = 0; h > f; f++)c = a.charCodeAt(f), 55296 === (64512 & c) && h > f + 1 && (d = a.charCodeAt(f + 1), 56320 === (64512 & d) && (c = 65536 + (c - 55296 << 10) + (d - 56320), f++)), i += 128 > c ? 1 : 2048 > c ? 2 : 65536 > c ? 3 : 4; for (b = new e.Buf8(i), g = 0, f = 0; i > g; f++)c = a.charCodeAt(f), 55296 === (64512 & c) && h > f + 1 && (d = a.charCodeAt(f + 1), 56320 === (64512 & d) && (c = 65536 + (c - 55296 << 10) + (d - 56320), f++)), 128 > c ? b[g++] = c : 2048 > c ? (b[g++] = 192 | c >>> 6, b[g++] = 128 | 63 & c) : 65536 > c ? (b[g++] = 224 | c >>> 12, b[g++] = 128 | c >>> 6 & 63, b[g++] = 128 | 63 & c) : (b[g++] = 240 | c >>> 18, b[g++] = 128 | c >>> 12 & 63, b[g++] = 128 | c >>> 6 & 63, b[g++] = 128 | 63 & c); return b }, c.buf2binstring = function (a) { return d(a, a.length) }, c.binstring2buf = function (a) { for (var b = new e.Buf8(a.length), c = 0, d = b.length; d > c; c++)b[c] = a.charCodeAt(c); return b }, c.buf2string = function (a, b) { var c, e, f, g, h = b || a.length, j = new Array(2 * h); for (e = 0, c = 0; h > c;)if (f = a[c++], 128 > f) j[e++] = f; else if (g = i[f], g > 4) j[e++] = 65533, c += g - 1; else { for (f &= 2 === g ? 31 : 3 === g ? 15 : 7; g > 1 && h > c;)f = f << 6 | 63 & a[c++], g--; g > 1 ? j[e++] = 65533 : 65536 > f ? j[e++] = f : (f -= 65536, j[e++] = 55296 | f >> 10 & 1023, j[e++] = 56320 | 1023 & f) } return d(j, e) }, c.utf8border = function (a, b) { var c; for (b = b || a.length, b > a.length && (b = a.length), c = b - 1; c >= 0 && 128 === (192 & a[c]);)c--; return 0 > c ? b : 0 === c ? b : c + i[a[c]] > b ? c : b } }, { "./common": 27 }], 29: [function (a, b) { "use strict"; function c(a, b, c, d) { for (var e = 65535 & a | 0, f = a >>> 16 & 65535 | 0, g = 0; 0 !== c;) { g = c > 2e3 ? 2e3 : c, c -= g; do e = e + b[d++] | 0, f = f + e | 0; while (--g); e %= 65521, f %= 65521 } return e | f << 16 | 0 } b.exports = c }, {}], 30: [function (a, b) { b.exports = { Z_NO_FLUSH: 0, Z_PARTIAL_FLUSH: 1, Z_SYNC_FLUSH: 2, Z_FULL_FLUSH: 3, Z_FINISH: 4, Z_BLOCK: 5, Z_TREES: 6, Z_OK: 0, Z_STREAM_END: 1, Z_NEED_DICT: 2, Z_ERRNO: -1, Z_STREAM_ERROR: -2, Z_DATA_ERROR: -3, Z_BUF_ERROR: -5, Z_NO_COMPRESSION: 0, Z_BEST_SPEED: 1, Z_BEST_COMPRESSION: 9, Z_DEFAULT_COMPRESSION: -1, Z_FILTERED: 1, Z_HUFFMAN_ONLY: 2, Z_RLE: 3, Z_FIXED: 4, Z_DEFAULT_STRATEGY: 0, Z_BINARY: 0, Z_TEXT: 1, Z_UNKNOWN: 2, Z_DEFLATED: 8 } }, {}], 31: [function (a, b) { "use strict"; function c() { for (var a, b = [], c = 0; 256 > c; c++) { a = c; for (var d = 0; 8 > d; d++)a = 1 & a ? 3988292384 ^ a >>> 1 : a >>> 1; b[c] = a } return b } function d(a, b, c, d) { var f = e, g = d + c; a = -1 ^ a; for (var h = d; g > h; h++)a = a >>> 8 ^ f[255 & (a ^ b[h])]; return -1 ^ a } var e = c(); b.exports = d }, {}], 32: [function (a, b, c) { "use strict"; function d(a, b) { return a.msg = G[b], b } function e(a) { return (a << 1) - (a > 4 ? 9 : 0) } function f(a) { for (var b = a.length; --b >= 0;)a[b] = 0 } function g(a) { var b = a.state, c = b.pending; c > a.avail_out && (c = a.avail_out), 0 !== c && (C.arraySet(a.output, b.pending_buf, b.pending_out, c, a.next_out), a.next_out += c, b.pending_out += c, a.total_out += c, a.avail_out -= c, b.pending -= c, 0 === b.pending && (b.pending_out = 0)) } function h(a, b) { D._tr_flush_block(a, a.block_start >= 0 ? a.block_start : -1, a.strstart - a.block_start, b), a.block_start = a.strstart, g(a.strm) } function i(a, b) { a.pending_buf[a.pending++] = b } function j(a, b) { a.pending_buf[a.pending++] = b >>> 8 & 255, a.pending_buf[a.pending++] = 255 & b } function k(a, b, c, d) { var e = a.avail_in; return e > d && (e = d), 0 === e ? 0 : (a.avail_in -= e, C.arraySet(b, a.input, a.next_in, e, c), 1 === a.state.wrap ? a.adler = E(a.adler, b, e, c) : 2 === a.state.wrap && (a.adler = F(a.adler, b, e, c)), a.next_in += e, a.total_in += e, e) } function l(a, b) { var c, d, e = a.max_chain_length, f = a.strstart, g = a.prev_length, h = a.nice_match, i = a.strstart > a.w_size - jb ? a.strstart - (a.w_size - jb) : 0, j = a.window, k = a.w_mask, l = a.prev, m = a.strstart + ib, n = j[f + g - 1], o = j[f + g]; a.prev_length >= a.good_match && (e >>= 2), h > a.lookahead && (h = a.lookahead); do if (c = b, j[c + g] === o && j[c + g - 1] === n && j[c] === j[f] && j[++c] === j[f + 1]) { f += 2, c++; do; while (j[++f] === j[++c] && j[++f] === j[++c] && j[++f] === j[++c] && j[++f] === j[++c] && j[++f] === j[++c] && j[++f] === j[++c] && j[++f] === j[++c] && j[++f] === j[++c] && m > f); if (d = ib - (m - f), f = m - ib, d > g) { if (a.match_start = b, g = d, d >= h) break; n = j[f + g - 1], o = j[f + g] } } while ((b = l[b & k]) > i && 0 !== --e); return g <= a.lookahead ? g : a.lookahead } function m(a) { var b, c, d, e, f, g = a.w_size; do { if (e = a.window_size - a.lookahead - a.strstart, a.strstart >= g + (g - jb)) { C.arraySet(a.window, a.window, g, g, 0), a.match_start -= g, a.strstart -= g, a.block_start -= g, c = a.hash_size, b = c; do d = a.head[--b], a.head[b] = d >= g ? d - g : 0; while (--c); c = g, b = c; do d = a.prev[--b], a.prev[b] = d >= g ? d - g : 0; while (--c); e += g } if (0 === a.strm.avail_in) break; if (c = k(a.strm, a.window, a.strstart + a.lookahead, e), a.lookahead += c, a.lookahead + a.insert >= hb) for (f = a.strstart - a.insert, a.ins_h = a.window[f], a.ins_h = (a.ins_h << a.hash_shift ^ a.window[f + 1]) & a.hash_mask; a.insert && (a.ins_h = (a.ins_h << a.hash_shift ^ a.window[f + hb - 1]) & a.hash_mask, a.prev[f & a.w_mask] = a.head[a.ins_h], a.head[a.ins_h] = f, f++, a.insert--, !(a.lookahead + a.insert < hb));); } while (a.lookahead < jb && 0 !== a.strm.avail_in) } function n(a, b) { var c = 65535; for (c > a.pending_buf_size - 5 && (c = a.pending_buf_size - 5); ;) { if (a.lookahead <= 1) { if (m(a), 0 === a.lookahead && b === H) return sb; if (0 === a.lookahead) break } a.strstart += a.lookahead, a.lookahead = 0; var d = a.block_start + c; if ((0 === a.strstart || a.strstart >= d) && (a.lookahead = a.strstart - d, a.strstart = d, h(a, !1), 0 === a.strm.avail_out)) return sb; if (a.strstart - a.block_start >= a.w_size - jb && (h(a, !1), 0 === a.strm.avail_out)) return sb } return a.insert = 0, b === K ? (h(a, !0), 0 === a.strm.avail_out ? ub : vb) : a.strstart > a.block_start && (h(a, !1), 0 === a.strm.avail_out) ? sb : sb } function o(a, b) { for (var c, d; ;) { if (a.lookahead < jb) { if (m(a), a.lookahead < jb && b === H) return sb; if (0 === a.lookahead) break } if (c = 0, a.lookahead >= hb && (a.ins_h = (a.ins_h << a.hash_shift ^ a.window[a.strstart + hb - 1]) & a.hash_mask, c = a.prev[a.strstart & a.w_mask] = a.head[a.ins_h], a.head[a.ins_h] = a.strstart), 0 !== c && a.strstart - c <= a.w_size - jb && (a.match_length = l(a, c)), a.match_length >= hb) if (d = D._tr_tally(a, a.strstart - a.match_start, a.match_length - hb), a.lookahead -= a.match_length, a.match_length <= a.max_lazy_match && a.lookahead >= hb) { a.match_length--; do a.strstart++, a.ins_h = (a.ins_h << a.hash_shift ^ a.window[a.strstart + hb - 1]) & a.hash_mask, c = a.prev[a.strstart & a.w_mask] = a.head[a.ins_h], a.head[a.ins_h] = a.strstart; while (0 !== --a.match_length); a.strstart++ } else a.strstart += a.match_length, a.match_length = 0, a.ins_h = a.window[a.strstart], a.ins_h = (a.ins_h << a.hash_shift ^ a.window[a.strstart + 1]) & a.hash_mask; else d = D._tr_tally(a, 0, a.window[a.strstart]), a.lookahead--, a.strstart++; if (d && (h(a, !1), 0 === a.strm.avail_out)) return sb } return a.insert = a.strstart < hb - 1 ? a.strstart : hb - 1, b === K ? (h(a, !0), 0 === a.strm.avail_out ? ub : vb) : a.last_lit && (h(a, !1), 0 === a.strm.avail_out) ? sb : tb } function p(a, b) { for (var c, d, e; ;) { if (a.lookahead < jb) { if (m(a), a.lookahead < jb && b === H) return sb; if (0 === a.lookahead) break } if (c = 0, a.lookahead >= hb && (a.ins_h = (a.ins_h << a.hash_shift ^ a.window[a.strstart + hb - 1]) & a.hash_mask, c = a.prev[a.strstart & a.w_mask] = a.head[a.ins_h], a.head[a.ins_h] = a.strstart), a.prev_length = a.match_length, a.prev_match = a.match_start, a.match_length = hb - 1, 0 !== c && a.prev_length < a.max_lazy_match && a.strstart - c <= a.w_size - jb && (a.match_length = l(a, c), a.match_length <= 5 && (a.strategy === S || a.match_length === hb && a.strstart - a.match_start > 4096) && (a.match_length = hb - 1)), a.prev_length >= hb && a.match_length <= a.prev_length) { e = a.strstart + a.lookahead - hb, d = D._tr_tally(a, a.strstart - 1 - a.prev_match, a.prev_length - hb), a.lookahead -= a.prev_length - 1, a.prev_length -= 2; do ++a.strstart <= e && (a.ins_h = (a.ins_h << a.hash_shift ^ a.window[a.strstart + hb - 1]) & a.hash_mask, c = a.prev[a.strstart & a.w_mask] = a.head[a.ins_h], a.head[a.ins_h] = a.strstart); while (0 !== --a.prev_length); if (a.match_available = 0, a.match_length = hb - 1, a.strstart++, d && (h(a, !1), 0 === a.strm.avail_out)) return sb } else if (a.match_available) { if (d = D._tr_tally(a, 0, a.window[a.strstart - 1]), d && h(a, !1), a.strstart++, a.lookahead--, 0 === a.strm.avail_out) return sb } else a.match_available = 1, a.strstart++, a.lookahead-- } return a.match_available && (d = D._tr_tally(a, 0, a.window[a.strstart - 1]), a.match_available = 0), a.insert = a.strstart < hb - 1 ? a.strstart : hb - 1, b === K ? (h(a, !0), 0 === a.strm.avail_out ? ub : vb) : a.last_lit && (h(a, !1), 0 === a.strm.avail_out) ? sb : tb } function q(a, b) { for (var c, d, e, f, g = a.window; ;) { if (a.lookahead <= ib) { if (m(a), a.lookahead <= ib && b === H) return sb; if (0 === a.lookahead) break } if (a.match_length = 0, a.lookahead >= hb && a.strstart > 0 && (e = a.strstart - 1, d = g[e], d === g[++e] && d === g[++e] && d === g[++e])) { f = a.strstart + ib; do; while (d === g[++e] && d === g[++e] && d === g[++e] && d === g[++e] && d === g[++e] && d === g[++e] && d === g[++e] && d === g[++e] && f > e); a.match_length = ib - (f - e), a.match_length > a.lookahead && (a.match_length = a.lookahead) } if (a.match_length >= hb ? (c = D._tr_tally(a, 1, a.match_length - hb), a.lookahead -= a.match_length, a.strstart += a.match_length, a.match_length = 0) : (c = D._tr_tally(a, 0, a.window[a.strstart]), a.lookahead--, a.strstart++), c && (h(a, !1), 0 === a.strm.avail_out)) return sb } return a.insert = 0, b === K ? (h(a, !0), 0 === a.strm.avail_out ? ub : vb) : a.last_lit && (h(a, !1), 0 === a.strm.avail_out) ? sb : tb } function r(a, b) { for (var c; ;) { if (0 === a.lookahead && (m(a), 0 === a.lookahead)) { if (b === H) return sb; break } if (a.match_length = 0, c = D._tr_tally(a, 0, a.window[a.strstart]), a.lookahead--, a.strstart++, c && (h(a, !1), 0 === a.strm.avail_out)) return sb } return a.insert = 0, b === K ? (h(a, !0), 0 === a.strm.avail_out ? ub : vb) : a.last_lit && (h(a, !1), 0 === a.strm.avail_out) ? sb : tb } function s(a) { a.window_size = 2 * a.w_size, f(a.head), a.max_lazy_match = B[a.level].max_lazy, a.good_match = B[a.level].good_length, a.nice_match = B[a.level].nice_length, a.max_chain_length = B[a.level].max_chain, a.strstart = 0, a.block_start = 0, a.lookahead = 0, a.insert = 0, a.match_length = a.prev_length = hb - 1, a.match_available = 0, a.ins_h = 0 } function t() { this.strm = null, this.status = 0, this.pending_buf = null, this.pending_buf_size = 0, this.pending_out = 0, this.pending = 0, this.wrap = 0, this.gzhead = null, this.gzindex = 0, this.method = Y, this.last_flush = -1, this.w_size = 0, this.w_bits = 0, this.w_mask = 0, this.window = null, this.window_size = 0, this.prev = null, this.head = null, this.ins_h = 0, this.hash_size = 0, this.hash_bits = 0, this.hash_mask = 0, this.hash_shift = 0, this.block_start = 0, this.match_length = 0, this.prev_match = 0, this.match_available = 0, this.strstart = 0, this.match_start = 0, this.lookahead = 0, this.prev_length = 0, this.max_chain_length = 0, this.max_lazy_match = 0, this.level = 0, this.strategy = 0, this.good_match = 0, this.nice_match = 0, this.dyn_ltree = new C.Buf16(2 * fb), this.dyn_dtree = new C.Buf16(2 * (2 * db + 1)), this.bl_tree = new C.Buf16(2 * (2 * eb + 1)), f(this.dyn_ltree), f(this.dyn_dtree), f(this.bl_tree), this.l_desc = null, this.d_desc = null, this.bl_desc = null, this.bl_count = new C.Buf16(gb + 1), this.heap = new C.Buf16(2 * cb + 1), f(this.heap), this.heap_len = 0, this.heap_max = 0, this.depth = new C.Buf16(2 * cb + 1), f(this.depth), this.l_buf = 0, this.lit_bufsize = 0, this.last_lit = 0, this.d_buf = 0, this.opt_len = 0, this.static_len = 0, this.matches = 0, this.insert = 0, this.bi_buf = 0, this.bi_valid = 0 } function u(a) { var b; return a && a.state ? (a.total_in = a.total_out = 0, a.data_type = X, b = a.state, b.pending = 0, b.pending_out = 0, b.wrap < 0 && (b.wrap = -b.wrap), b.status = b.wrap ? lb : qb, a.adler = 2 === b.wrap ? 0 : 1, b.last_flush = H, D._tr_init(b), M) : d(a, O) } function v(a) { var b = u(a); return b === M && s(a.state), b } function w(a, b) { return a && a.state ? 2 !== a.state.wrap ? O : (a.state.gzhead = b, M) : O } function x(a, b, c, e, f, g) { if (!a) return O; var h = 1; if (b === R && (b = 6), 0 > e ? (h = 0, e = -e) : e > 15 && (h = 2, e -= 16), 1 > f || f > Z || c !== Y || 8 > e || e > 15 || 0 > b || b > 9 || 0 > g || g > V) return d(a, O); 8 === e && (e = 9); var i = new t; return a.state = i, i.strm = a, i.wrap = h, i.gzhead = null, i.w_bits = e, i.w_size = 1 << i.w_bits, i.w_mask = i.w_size - 1, i.hash_bits = f + 7, i.hash_size = 1 << i.hash_bits, i.hash_mask = i.hash_size - 1, i.hash_shift = ~~((i.hash_bits + hb - 1) / hb), i.window = new C.Buf8(2 * i.w_size), i.head = new C.Buf16(i.hash_size), i.prev = new C.Buf16(i.w_size), i.lit_bufsize = 1 << f + 6, i.pending_buf_size = 4 * i.lit_bufsize, i.pending_buf = new C.Buf8(i.pending_buf_size), i.d_buf = i.lit_bufsize >> 1, i.l_buf = 3 * i.lit_bufsize, i.level = b, i.strategy = g, i.method = c, v(a) } function y(a, b) { return x(a, b, Y, $, _, W) } function z(a, b) { var c, h, k, l; if (!a || !a.state || b > L || 0 > b) return a ? d(a, O) : O; if (h = a.state, !a.output || !a.input && 0 !== a.avail_in || h.status === rb && b !== K) return d(a, 0 === a.avail_out ? Q : O); if (h.strm = a, c = h.last_flush, h.last_flush = b, h.status === lb) if (2 === h.wrap) a.adler = 0, i(h, 31), i(h, 139), i(h, 8), h.gzhead ? (i(h, (h.gzhead.text ? 1 : 0) + (h.gzhead.hcrc ? 2 : 0) + (h.gzhead.extra ? 4 : 0) + (h.gzhead.name ? 8 : 0) + (h.gzhead.comment ? 16 : 0)), i(h, 255 & h.gzhead.time), i(h, h.gzhead.time >> 8 & 255), i(h, h.gzhead.time >> 16 & 255), i(h, h.gzhead.time >> 24 & 255), i(h, 9 === h.level ? 2 : h.strategy >= T || h.level < 2 ? 4 : 0), i(h, 255 & h.gzhead.os), h.gzhead.extra && h.gzhead.extra.length && (i(h, 255 & h.gzhead.extra.length), i(h, h.gzhead.extra.length >> 8 & 255)), h.gzhead.hcrc && (a.adler = F(a.adler, h.pending_buf, h.pending, 0)), h.gzindex = 0, h.status = mb) : (i(h, 0), i(h, 0), i(h, 0), i(h, 0), i(h, 0), i(h, 9 === h.level ? 2 : h.strategy >= T || h.level < 2 ? 4 : 0), i(h, wb), h.status = qb); else { var m = Y + (h.w_bits - 8 << 4) << 8, n = -1; n = h.strategy >= T || h.level < 2 ? 0 : h.level < 6 ? 1 : 6 === h.level ? 2 : 3, m |= n << 6, 0 !== h.strstart && (m |= kb), m += 31 - m % 31, h.status = qb, j(h, m), 0 !== h.strstart && (j(h, a.adler >>> 16), j(h, 65535 & a.adler)), a.adler = 1 } if (h.status === mb) if (h.gzhead.extra) { for (k = h.pending; h.gzindex < (65535 & h.gzhead.extra.length) && (h.pending !== h.pending_buf_size || (h.gzhead.hcrc && h.pending > k && (a.adler = F(a.adler, h.pending_buf, h.pending - k, k)), g(a), k = h.pending, h.pending !== h.pending_buf_size));)i(h, 255 & h.gzhead.extra[h.gzindex]), h.gzindex++; h.gzhead.hcrc && h.pending > k && (a.adler = F(a.adler, h.pending_buf, h.pending - k, k)), h.gzindex === h.gzhead.extra.length && (h.gzindex = 0, h.status = nb) } else h.status = nb; if (h.status === nb) if (h.gzhead.name) { k = h.pending; do { if (h.pending === h.pending_buf_size && (h.gzhead.hcrc && h.pending > k && (a.adler = F(a.adler, h.pending_buf, h.pending - k, k)), g(a), k = h.pending, h.pending === h.pending_buf_size)) { l = 1; break } l = h.gzindex < h.gzhead.name.length ? 255 & h.gzhead.name.charCodeAt(h.gzindex++) : 0, i(h, l) } while (0 !== l); h.gzhead.hcrc && h.pending > k && (a.adler = F(a.adler, h.pending_buf, h.pending - k, k)), 0 === l && (h.gzindex = 0, h.status = ob) } else h.status = ob; if (h.status === ob) if (h.gzhead.comment) { k = h.pending; do { if (h.pending === h.pending_buf_size && (h.gzhead.hcrc && h.pending > k && (a.adler = F(a.adler, h.pending_buf, h.pending - k, k)), g(a), k = h.pending, h.pending === h.pending_buf_size)) { l = 1; break } l = h.gzindex < h.gzhead.comment.length ? 255 & h.gzhead.comment.charCodeAt(h.gzindex++) : 0, i(h, l) } while (0 !== l); h.gzhead.hcrc && h.pending > k && (a.adler = F(a.adler, h.pending_buf, h.pending - k, k)), 0 === l && (h.status = pb) } else h.status = pb; if (h.status === pb && (h.gzhead.hcrc ? (h.pending + 2 > h.pending_buf_size && g(a), h.pending + 2 <= h.pending_buf_size && (i(h, 255 & a.adler), i(h, a.adler >> 8 & 255), a.adler = 0, h.status = qb)) : h.status = qb), 0 !== h.pending) { if (g(a), 0 === a.avail_out) return h.last_flush = -1, M } else if (0 === a.avail_in && e(b) <= e(c) && b !== K) return d(a, Q); if (h.status === rb && 0 !== a.avail_in) return d(a, Q); if (0 !== a.avail_in || 0 !== h.lookahead || b !== H && h.status !== rb) { var o = h.strategy === T ? r(h, b) : h.strategy === U ? q(h, b) : B[h.level].func(h, b); if ((o === ub || o === vb) && (h.status = rb), o === sb || o === ub) return 0 === a.avail_out && (h.last_flush = -1), M; if (o === tb && (b === I ? D._tr_align(h) : b !== L && (D._tr_stored_block(h, 0, 0, !1), b === J && (f(h.head), 0 === h.lookahead && (h.strstart = 0, h.block_start = 0, h.insert = 0))), g(a), 0 === a.avail_out)) return h.last_flush = -1, M } return b !== K ? M : h.wrap <= 0 ? N : (2 === h.wrap ? (i(h, 255 & a.adler), i(h, a.adler >> 8 & 255), i(h, a.adler >> 16 & 255), i(h, a.adler >> 24 & 255), i(h, 255 & a.total_in), i(h, a.total_in >> 8 & 255), i(h, a.total_in >> 16 & 255), i(h, a.total_in >> 24 & 255)) : (j(h, a.adler >>> 16), j(h, 65535 & a.adler)), g(a), h.wrap > 0 && (h.wrap = -h.wrap), 0 !== h.pending ? M : N) } function A(a) { var b; return a && a.state ? (b = a.state.status, b !== lb && b !== mb && b !== nb && b !== ob && b !== pb && b !== qb && b !== rb ? d(a, O) : (a.state = null, b === qb ? d(a, P) : M)) : O } var B, C = a("../utils/common"), D = a("./trees"), E = a("./adler32"), F = a("./crc32"), G = a("./messages"), H = 0, I = 1, J = 3, K = 4, L = 5, M = 0, N = 1, O = -2, P = -3, Q = -5, R = -1, S = 1, T = 2, U = 3, V = 4, W = 0, X = 2, Y = 8, Z = 9, $ = 15, _ = 8, ab = 29, bb = 256, cb = bb + 1 + ab, db = 30, eb = 19, fb = 2 * cb + 1, gb = 15, hb = 3, ib = 258, jb = ib + hb + 1, kb = 32, lb = 42, mb = 69, nb = 73, ob = 91, pb = 103, qb = 113, rb = 666, sb = 1, tb = 2, ub = 3, vb = 4, wb = 3, xb = function (a, b, c, d, e) { this.good_length = a, this.max_lazy = b, this.nice_length = c, this.max_chain = d, this.func = e }; B = [new xb(0, 0, 0, 0, n), new xb(4, 4, 8, 4, o), new xb(4, 5, 16, 8, o), new xb(4, 6, 32, 32, o), new xb(4, 4, 16, 16, p), new xb(8, 16, 32, 32, p), new xb(8, 16, 128, 128, p), new xb(8, 32, 128, 256, p), new xb(32, 128, 258, 1024, p), new xb(32, 258, 258, 4096, p)], c.deflateInit = y, c.deflateInit2 = x, c.deflateReset = v, c.deflateResetKeep = u, c.deflateSetHeader = w, c.deflate = z, c.deflateEnd = A, c.deflateInfo = "pako deflate (from Nodeca project)" }, { "../utils/common": 27, "./adler32": 29, "./crc32": 31, "./messages": 37, "./trees": 38 }], 33: [function (a, b) { "use strict"; function c() { this.text = 0, this.time = 0, this.xflags = 0, this.os = 0, this.extra = null, this.extra_len = 0, this.name = "", this.comment = "", this.hcrc = 0, this.done = !1 } b.exports = c }, {}], 34: [function (a, b) { "use strict"; var c = 30, d = 12; b.exports = function (a, b) { var e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, A, B, C; e = a.state, f = a.next_in, B = a.input, g = f + (a.avail_in - 5), h = a.next_out, C = a.output, i = h - (b - a.avail_out), j = h + (a.avail_out - 257), k = e.dmax, l = e.wsize, m = e.whave, n = e.wnext, o = e.window, p = e.hold, q = e.bits, r = e.lencode, s = e.distcode, t = (1 << e.lenbits) - 1, u = (1 << e.distbits) - 1; a: do { 15 > q && (p += B[f++] << q, q += 8, p += B[f++] << q, q += 8), v = r[p & t]; b: for (; ;) { if (w = v >>> 24, p >>>= w, q -= w, w = v >>> 16 & 255, 0 === w) C[h++] = 65535 & v; else { if (!(16 & w)) { if (0 === (64 & w)) { v = r[(65535 & v) + (p & (1 << w) - 1)]; continue b } if (32 & w) { e.mode = d; break a } a.msg = "invalid literal/length code", e.mode = c; break a } x = 65535 & v, w &= 15, w && (w > q && (p += B[f++] << q, q += 8), x += p & (1 << w) - 1, p >>>= w, q -= w), 15 > q && (p += B[f++] << q, q += 8, p += B[f++] << q, q += 8), v = s[p & u]; c: for (; ;) { if (w = v >>> 24, p >>>= w, q -= w, w = v >>> 16 & 255, !(16 & w)) { if (0 === (64 & w)) { v = s[(65535 & v) + (p & (1 << w) - 1)]; continue c } a.msg = "invalid distance code", e.mode = c; break a } if (y = 65535 & v, w &= 15, w > q && (p += B[f++] << q, q += 8, w > q && (p += B[f++] << q, q += 8)), y += p & (1 << w) - 1, y > k) { a.msg = "invalid distance too far back", e.mode = c; break a } if (p >>>= w, q -= w, w = h - i, y > w) { if (w = y - w, w > m && e.sane) { a.msg = "invalid distance too far back", e.mode = c; break a } if (z = 0, A = o, 0 === n) { if (z += l - w, x > w) { x -= w; do C[h++] = o[z++]; while (--w); z = h - y, A = C } } else if (w > n) { if (z += l + n - w, w -= n, x > w) { x -= w; do C[h++] = o[z++]; while (--w); if (z = 0, x > n) { w = n, x -= w; do C[h++] = o[z++]; while (--w); z = h - y, A = C } } } else if (z += n - w, x > w) { x -= w; do C[h++] = o[z++]; while (--w); z = h - y, A = C } for (; x > 2;)C[h++] = A[z++], C[h++] = A[z++], C[h++] = A[z++], x -= 3; x && (C[h++] = A[z++], x > 1 && (C[h++] = A[z++])) } else { z = h - y; do C[h++] = C[z++], C[h++] = C[z++], C[h++] = C[z++], x -= 3; while (x > 2); x && (C[h++] = C[z++], x > 1 && (C[h++] = C[z++])) } break } } break } } while (g > f && j > h); x = q >> 3, f -= x, q -= x << 3, p &= (1 << q) - 1, a.next_in = f, a.next_out = h, a.avail_in = g > f ? 5 + (g - f) : 5 - (f - g), a.avail_out = j > h ? 257 + (j - h) : 257 - (h - j), e.hold = p, e.bits = q } }, {}], 35: [function (a, b, c) {
"use strict"; function d(a) { return (a >>> 24 & 255) + (a >>> 8 & 65280) + ((65280 & a) << 8) + ((255 & a) << 24) } function e() { this.mode = 0, this.last = !1, this.wrap = 0, this.havedict = !1, this.flags = 0, this.dmax = 0, this.check = 0, this.total = 0, this.head = null, this.wbits = 0, this.wsize = 0, this.whave = 0, this.wnext = 0, this.window = null, this.hold = 0, this.bits = 0, this.length = 0, this.offset = 0, this.extra = 0, this.lencode = null, this.distcode = null, this.lenbits = 0, this.distbits = 0, this.ncode = 0, this.nlen = 0, this.ndist = 0, this.have = 0, this.next = null, this.lens = new r.Buf16(320), this.work = new r.Buf16(288), this.lendyn = null, this.distdyn = null, this.sane = 0, this.back = 0, this.was = 0 } function f(a) { var b; return a && a.state ? (b = a.state, a.total_in = a.total_out = b.total = 0, a.msg = "", b.wrap && (a.adler = 1 & b.wrap), b.mode = K, b.last = 0, b.havedict = 0, b.dmax = 32768, b.head = null, b.hold = 0, b.bits = 0, b.lencode = b.lendyn = new r.Buf32(ob), b.distcode = b.distdyn = new r.Buf32(pb), b.sane = 1, b.back = -1, C) : F } function g(a) { var b; return a && a.state ? (b = a.state, b.wsize = 0, b.whave = 0, b.wnext = 0, f(a)) : F } function h(a, b) { var c, d; return a && a.state ? (d = a.state, 0 > b ? (c = 0, b = -b) : (c = (b >> 4) + 1, 48 > b && (b &= 15)), b && (8 > b || b > 15) ? F : (null !== d.window && d.wbits !== b && (d.window = null), d.wrap = c, d.wbits = b, g(a))) : F } function i(a, b) { var c, d; return a ? (d = new e, a.state = d, d.window = null, c = h(a, b), c !== C && (a.state = null), c) : F } function j(a) { return i(a, rb) } function k(a) { if (sb) { var b; for (p = new r.Buf32(512), q = new r.Buf32(32), b = 0; 144 > b;)a.lens[b++] = 8; for (; 256 > b;)a.lens[b++] = 9; for (; 280 > b;)a.lens[b++] = 7; for (; 288 > b;)a.lens[b++] = 8; for (v(x, a.lens, 0, 288, p, 0, a.work, { bits: 9 }), b = 0; 32 > b;)a.lens[b++] = 5; v(y, a.lens, 0, 32, q, 0, a.work, { bits: 5 }), sb = !1 } a.lencode = p, a.lenbits = 9, a.distcode = q, a.distbits = 5 } function l(a, b, c, d) { var e, f = a.state; return null === f.window && (f.wsize = 1 << f.wbits, f.wnext = 0, f.whave = 0, f.window = new r.Buf8(f.wsize)), d >= f.wsize ? (r.arraySet(f.window, b, c - f.wsize, f.wsize, 0), f.wnext = 0, f.whave = f.wsize) : (e = f.wsize - f.wnext, e > d && (e = d), r.arraySet(f.window, b, c - d, e, f.wnext), d -= e, d ? (r.arraySet(f.window, b, c - d, d, 0), f.wnext = d, f.whave = f.wsize) : (f.wnext += e, f.wnext === f.wsize && (f.wnext = 0), f.whave < f.wsize && (f.whave += e))), 0 } function m(a, b) {
var c, e, f, g, h, i, j, m, n, o, p, q, ob, pb, qb, rb, sb, tb, ub, vb, wb, xb, yb, zb, Ab = 0, Bb = new r.Buf8(4), Cb = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]; if (!a || !a.state || !a.output || !a.input && 0 !== a.avail_in) return F; c = a.state, c.mode === V && (c.mode = W), h = a.next_out, f = a.output, j = a.avail_out, g = a.next_in, e = a.input, i = a.avail_in, m = c.hold, n = c.bits, o = i, p = j, xb = C; a: for (; ;)switch (c.mode) {
case K: if (0 === c.wrap) { c.mode = W; break } for (; 16 > n;) { if (0 === i) break a; i--, m += e[g++] << n, n += 8 } if (2 & c.wrap && 35615 === m) { c.check = 0, Bb[0] = 255 & m, Bb[1] = m >>> 8 & 255, c.check = t(c.check, Bb, 2, 0), m = 0, n = 0, c.mode = L; break } if (c.flags = 0, c.head && (c.head.done = !1), !(1 & c.wrap) || (((255 & m) << 8) + (m >> 8)) % 31) { a.msg = "incorrect header check", c.mode = lb; break } if ((15 & m) !== J) { a.msg = "unknown compression method", c.mode = lb; break } if (m >>>= 4, n -= 4, wb = (15 & m) + 8, 0 === c.wbits) c.wbits = wb; else if (wb > c.wbits) { a.msg = "invalid window size", c.mode = lb; break } c.dmax = 1 << wb, a.adler = c.check = 1, c.mode = 512 & m ? T : V, m = 0, n = 0; break; case L: for (; 16 > n;) { if (0 === i) break a; i--, m += e[g++] << n, n += 8 } if (c.flags = m, (255 & c.flags) !== J) { a.msg = "unknown compression method", c.mode = lb; break } if (57344 & c.flags) { a.msg = "unknown header flags set", c.mode = lb; break } c.head && (c.head.text = m >> 8 & 1), 512 & c.flags && (Bb[0] = 255 & m, Bb[1] = m >>> 8 & 255, c.check = t(c.check, Bb, 2, 0)), m = 0, n = 0, c.mode = M; case M: for (; 32 > n;) { if (0 === i) break a; i--, m += e[g++] << n, n += 8 } c.head && (c.head.time = m), 512 & c.flags && (Bb[0] = 255 & m, Bb[1] = m >>> 8 & 255, Bb[2] = m >>> 16 & 255, Bb[3] = m >>> 24 & 255, c.check = t(c.check, Bb, 4, 0)), m = 0, n = 0, c.mode = N; case N: for (; 16 > n;) { if (0 === i) break a; i--, m += e[g++] << n, n += 8 } c.head && (c.head.xflags = 255 & m, c.head.os = m >> 8), 512 & c.flags && (Bb[0] = 255 & m, Bb[1] = m >>> 8 & 255, c.check = t(c.check, Bb, 2, 0)), m = 0, n = 0, c.mode = O; case O: if (1024 & c.flags) { for (; 16 > n;) { if (0 === i) break a; i--, m += e[g++] << n, n += 8 } c.length = m, c.head && (c.head.extra_len = m), 512 & c.flags && (Bb[0] = 255 & m, Bb[1] = m >>> 8 & 255, c.check = t(c.check, Bb, 2, 0)), m = 0, n = 0 } else c.head && (c.head.extra = null); c.mode = P; case P: if (1024 & c.flags && (q = c.length, q > i && (q = i), q && (c.head && (wb = c.head.extra_len - c.length, c.head.extra || (c.head.extra = new Array(c.head.extra_len)), r.arraySet(c.head.extra, e, g, q, wb)), 512 & c.flags && (c.check = t(c.check, e, q, g)), i -= q, g += q, c.length -= q), c.length)) break a; c.length = 0, c.mode = Q; case Q: if (2048 & c.flags) { if (0 === i) break a; q = 0; do wb = e[g + q++], c.head && wb && c.length < 65536 && (c.head.name += String.fromCharCode(wb)); while (wb && i > q); if (512 & c.flags && (c.check = t(c.check, e, q, g)), i -= q, g += q, wb) break a } else c.head && (c.head.name = null); c.length = 0, c.mode = R; case R: if (4096 & c.flags) { if (0 === i) break a; q = 0; do wb = e[g + q++], c.head && wb && c.length < 65536 && (c.head.comment += String.fromCharCode(wb)); while (wb && i > q); if (512 & c.flags && (c.check = t(c.check, e, q, g)), i -= q, g += q, wb) break a } else c.head && (c.head.comment = null); c.mode = S; case S: if (512 & c.flags) { for (; 16 > n;) { if (0 === i) break a; i--, m += e[g++] << n, n += 8 } if (m !== (65535 & c.check)) { a.msg = "header crc mismatch", c.mode = lb; break } m = 0, n = 0 } c.head && (c.head.hcrc = c.flags >> 9 & 1, c.head.done = !0), a.adler = c.check = 0, c.mode = V; break; case T: for (; 32 > n;) { if (0 === i) break a; i--, m += e[g++] << n, n += 8 } a.adler = c.check = d(m), m = 0, n = 0, c.mode = U; case U: if (0 === c.havedict) return a.next_out = h, a.avail_out = j, a.next_in = g, a.avail_in = i, c.hold = m, c.bits = n, E; a.adler = c.check = 1, c.mode = V; case V: if (b === A || b === B) break a; case W: if (c.last) { m >>>= 7 & n, n -= 7 & n, c.mode = ib; break } for (; 3 > n;) { if (0 === i) break a; i--, m += e[g++] << n, n += 8 } switch (c.last = 1 & m, m >>>= 1, n -= 1, 3 & m) { case 0: c.mode = X; break; case 1: if (k(c), c.mode = bb, b === B) { m >>>= 2, n -= 2; break a } break; case 2: c.mode = $; break; case 3: a.msg = "invalid block type", c.mode = lb }m >>>= 2, n -= 2; break; case X: for (m >>>= 7 & n, n -= 7 & n; 32 > n;) { if (0 === i) break a; i--, m += e[g++] << n, n += 8 } if ((65535 & m) !== (m >>> 16 ^ 65535)) { a.msg = "invalid stored block lengths", c.mode = lb; break } if (c.length = 65535 & m, m = 0, n = 0, c.mode = Y, b === B) break a; case Y: c.mode = Z; case Z: if (q = c.length) { if (q > i && (q = i), q > j && (q = j), 0 === q) break a; r.arraySet(f, e, g, q, h), i -= q, g += q, j -= q, h += q, c.length -= q; break } c.mode = V; break; case $: for (; 14 > n;) { if (0 === i) break a; i--, m += e[g++] << n, n += 8 } if (c.nlen = (31 & m) + 257, m >>>= 5, n -= 5, c.ndist = (31 & m) + 1, m >>>= 5, n -= 5, c.ncode = (15 & m) + 4, m >>>= 4, n -= 4, c.nlen > 286 || c.ndist > 30) { a.msg = "too many length or distance symbols", c.mode = lb; break } c.have = 0, c.mode = _; case _: for (; c.have < c.ncode;) { for (; 3 > n;) { if (0 === i) break a; i--, m += e[g++] << n, n += 8 } c.lens[Cb[c.have++]] = 7 & m, m >>>= 3, n -= 3 } for (; c.have < 19;)c.lens[Cb[c.have++]] = 0; if (c.lencode = c.lendyn, c.lenbits = 7, yb = { bits: c.lenbits }, xb = v(w, c.lens, 0, 19, c.lencode, 0, c.work, yb), c.lenbits = yb.bits, xb) { a.msg = "invalid code lengths set", c.mode = lb; break } c.have = 0, c.mode = ab; case ab: for (; c.have < c.nlen + c.ndist;) { for (; Ab = c.lencode[m & (1 << c.lenbits) - 1], qb = Ab >>> 24, rb = Ab >>> 16 & 255, sb = 65535 & Ab, !(n >= qb);) { if (0 === i) break a; i--, m += e[g++] << n, n += 8 } if (16 > sb) m >>>= qb, n -= qb, c.lens[c.have++] = sb; else { if (16 === sb) { for (zb = qb + 2; zb > n;) { if (0 === i) break a; i--, m += e[g++] << n, n += 8 } if (m >>>= qb, n -= qb, 0 === c.have) { a.msg = "invalid bit length repeat", c.mode = lb; break } wb = c.lens[c.have - 1], q = 3 + (3 & m), m >>>= 2, n -= 2 } else if (17 === sb) { for (zb = qb + 3; zb > n;) { if (0 === i) break a; i--, m += e[g++] << n, n += 8 } m >>>= qb, n -= qb, wb = 0, q = 3 + (7 & m), m >>>= 3, n -= 3 } else { for (zb = qb + 7; zb > n;) { if (0 === i) break a; i--, m += e[g++] << n, n += 8 } m >>>= qb, n -= qb, wb = 0, q = 11 + (127 & m), m >>>= 7, n -= 7 } if (c.have + q > c.nlen + c.ndist) { a.msg = "invalid bit length repeat", c.mode = lb; break } for (; q--;)c.lens[c.have++] = wb } } if (c.mode === lb) break; if (0 === c.lens[256]) { a.msg = "invalid code -- missing end-of-block", c.mode = lb; break } if (c.lenbits = 9, yb = { bits: c.lenbits }, xb = v(x, c.lens, 0, c.nlen, c.lencode, 0, c.work, yb), c.lenbits = yb.bits, xb) { a.msg = "invalid literal/lengths set", c.mode = lb; break } if (c.distbits = 6, c.distcode = c.distdyn, yb = { bits: c.distbits }, xb = v(y, c.lens, c.nlen, c.ndist, c.distcode, 0, c.work, yb), c.distbits = yb.bits, xb) { a.msg = "invalid distances set", c.mode = lb; break } if (c.mode = bb, b === B) break a; case bb: c.mode = cb; case cb: if (i >= 6 && j >= 258) {
a.next_out = h, a.avail_out = j, a.next_in = g, a.avail_in = i, c.hold = m, c.bits = n, u(a, p), h = a.next_out, f = a.output, j = a.avail_out, g = a.next_in, e = a.input, i = a.avail_in, m = c.hold, n = c.bits, c.mode === V && (c.back = -1);
break
} for (c.back = 0; Ab = c.lencode[m & (1 << c.lenbits) - 1], qb = Ab >>> 24, rb = Ab >>> 16 & 255, sb = 65535 & Ab, !(n >= qb);) { if (0 === i) break a; i--, m += e[g++] << n, n += 8 } if (rb && 0 === (240 & rb)) { for (tb = qb, ub = rb, vb = sb; Ab = c.lencode[vb + ((m & (1 << tb + ub) - 1) >> tb)], qb = Ab >>> 24, rb = Ab >>> 16 & 255, sb = 65535 & Ab, !(n >= tb + qb);) { if (0 === i) break a; i--, m += e[g++] << n, n += 8 } m >>>= tb, n -= tb, c.back += tb } if (m >>>= qb, n -= qb, c.back += qb, c.length = sb, 0 === rb) { c.mode = hb; break } if (32 & rb) { c.back = -1, c.mode = V; break } if (64 & rb) { a.msg = "invalid literal/length code", c.mode = lb; break } c.extra = 15 & rb, c.mode = db; case db: if (c.extra) { for (zb = c.extra; zb > n;) { if (0 === i) break a; i--, m += e[g++] << n, n += 8 } c.length += m & (1 << c.extra) - 1, m >>>= c.extra, n -= c.extra, c.back += c.extra } c.was = c.length, c.mode = eb; case eb: for (; Ab = c.distcode[m & (1 << c.distbits) - 1], qb = Ab >>> 24, rb = Ab >>> 16 & 255, sb = 65535 & Ab, !(n >= qb);) { if (0 === i) break a; i--, m += e[g++] << n, n += 8 } if (0 === (240 & rb)) { for (tb = qb, ub = rb, vb = sb; Ab = c.distcode[vb + ((m & (1 << tb + ub) - 1) >> tb)], qb = Ab >>> 24, rb = Ab >>> 16 & 255, sb = 65535 & Ab, !(n >= tb + qb);) { if (0 === i) break a; i--, m += e[g++] << n, n += 8 } m >>>= tb, n -= tb, c.back += tb } if (m >>>= qb, n -= qb, c.back += qb, 64 & rb) { a.msg = "invalid distance code", c.mode = lb; break } c.offset = sb, c.extra = 15 & rb, c.mode = fb; case fb: if (c.extra) { for (zb = c.extra; zb > n;) { if (0 === i) break a; i--, m += e[g++] << n, n += 8 } c.offset += m & (1 << c.extra) - 1, m >>>= c.extra, n -= c.extra, c.back += c.extra } if (c.offset > c.dmax) { a.msg = "invalid distance too far back", c.mode = lb; break } c.mode = gb; case gb: if (0 === j) break a; if (q = p - j, c.offset > q) { if (q = c.offset - q, q > c.whave && c.sane) { a.msg = "invalid distance too far back", c.mode = lb; break } q > c.wnext ? (q -= c.wnext, ob = c.wsize - q) : ob = c.wnext - q, q > c.length && (q = c.length), pb = c.window } else pb = f, ob = h - c.offset, q = c.length; q > j && (q = j), j -= q, c.length -= q; do f[h++] = pb[ob++]; while (--q); 0 === c.length && (c.mode = cb); break; case hb: if (0 === j) break a; f[h++] = c.length, j--, c.mode = cb; break; case ib: if (c.wrap) { for (; 32 > n;) { if (0 === i) break a; i--, m |= e[g++] << n, n += 8 } if (p -= j, a.total_out += p, c.total += p, p && (a.adler = c.check = c.flags ? t(c.check, f, p, h - p) : s(c.check, f, p, h - p)), p = j, (c.flags ? m : d(m)) !== c.check) { a.msg = "incorrect data check", c.mode = lb; break } m = 0, n = 0 } c.mode = jb; case jb: if (c.wrap && c.flags) { for (; 32 > n;) { if (0 === i) break a; i--, m += e[g++] << n, n += 8 } if (m !== (4294967295 & c.total)) { a.msg = "incorrect length check", c.mode = lb; break } m = 0, n = 0 } c.mode = kb; case kb: xb = D; break a; case lb: xb = G; break a; case mb: return H; case nb: default: return F
}return a.next_out = h, a.avail_out = j, a.next_in = g, a.avail_in = i, c.hold = m, c.bits = n, (c.wsize || p !== a.avail_out && c.mode < lb && (c.mode < ib || b !== z)) && l(a, a.output, a.next_out, p - a.avail_out) ? (c.mode = mb, H) : (o -= a.avail_in, p -= a.avail_out, a.total_in += o, a.total_out += p, c.total += p, c.wrap && p && (a.adler = c.check = c.flags ? t(c.check, f, p, a.next_out - p) : s(c.check, f, p, a.next_out - p)), a.data_type = c.bits + (c.last ? 64 : 0) + (c.mode === V ? 128 : 0) + (c.mode === bb || c.mode === Y ? 256 : 0), (0 === o && 0 === p || b === z) && xb === C && (xb = I), xb)
} function n(a) { if (!a || !a.state) return F; var b = a.state; return b.window && (b.window = null), a.state = null, C } function o(a, b) { var c; return a && a.state ? (c = a.state, 0 === (2 & c.wrap) ? F : (c.head = b, b.done = !1, C)) : F } var p, q, r = a("../utils/common"), s = a("./adler32"), t = a("./crc32"), u = a("./inffast"), v = a("./inftrees"), w = 0, x = 1, y = 2, z = 4, A = 5, B = 6, C = 0, D = 1, E = 2, F = -2, G = -3, H = -4, I = -5, J = 8, K = 1, L = 2, M = 3, N = 4, O = 5, P = 6, Q = 7, R = 8, S = 9, T = 10, U = 11, V = 12, W = 13, X = 14, Y = 15, Z = 16, $ = 17, _ = 18, ab = 19, bb = 20, cb = 21, db = 22, eb = 23, fb = 24, gb = 25, hb = 26, ib = 27, jb = 28, kb = 29, lb = 30, mb = 31, nb = 32, ob = 852, pb = 592, qb = 15, rb = qb, sb = !0; c.inflateReset = g, c.inflateReset2 = h, c.inflateResetKeep = f, c.inflateInit = j, c.inflateInit2 = i, c.inflate = m, c.inflateEnd = n, c.inflateGetHeader = o, c.inflateInfo = "pako inflate (from Nodeca project)"
}, { "../utils/common": 27, "./adler32": 29, "./crc32": 31, "./inffast": 34, "./inftrees": 36 }], 36: [function (a, b) { "use strict"; var c = a("../utils/common"), d = 15, e = 852, f = 592, g = 0, h = 1, i = 2, j = [3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0], k = [16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78], l = [1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577, 0, 0], m = [16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29, 29, 64, 64]; b.exports = function (a, b, n, o, p, q, r, s) { var t, u, v, w, x, y, z, A, B, C = s.bits, D = 0, E = 0, F = 0, G = 0, H = 0, I = 0, J = 0, K = 0, L = 0, M = 0, N = null, O = 0, P = new c.Buf16(d + 1), Q = new c.Buf16(d + 1), R = null, S = 0; for (D = 0; d >= D; D++)P[D] = 0; for (E = 0; o > E; E++)P[b[n + E]]++; for (H = C, G = d; G >= 1 && 0 === P[G]; G--); if (H > G && (H = G), 0 === G) return p[q++] = 20971520, p[q++] = 20971520, s.bits = 1, 0; for (F = 1; G > F && 0 === P[F]; F++); for (F > H && (H = F), K = 1, D = 1; d >= D; D++)if (K <<= 1, K -= P[D], 0 > K) return -1; if (K > 0 && (a === g || 1 !== G)) return -1; for (Q[1] = 0, D = 1; d > D; D++)Q[D + 1] = Q[D] + P[D]; for (E = 0; o > E; E++)0 !== b[n + E] && (r[Q[b[n + E]]++] = E); if (a === g ? (N = R = r, y = 19) : a === h ? (N = j, O -= 257, R = k, S -= 257, y = 256) : (N = l, R = m, y = -1), M = 0, E = 0, D = F, x = q, I = H, J = 0, v = -1, L = 1 << H, w = L - 1, a === h && L > e || a === i && L > f) return 1; for (var T = 0; ;) { T++, z = D - J, r[E] < y ? (A = 0, B = r[E]) : r[E] > y ? (A = R[S + r[E]], B = N[O + r[E]]) : (A = 96, B = 0), t = 1 << D - J, u = 1 << I, F = u; do u -= t, p[x + (M >> J) + u] = z << 24 | A << 16 | B | 0; while (0 !== u); for (t = 1 << D - 1; M & t;)t >>= 1; if (0 !== t ? (M &= t - 1, M += t) : M = 0, E++, 0 === --P[D]) { if (D === G) break; D = b[n + r[E]] } if (D > H && (M & w) !== v) { for (0 === J && (J = H), x += F, I = D - J, K = 1 << I; G > I + J && (K -= P[I + J], !(0 >= K));)I++, K <<= 1; if (L += 1 << I, a === h && L > e || a === i && L > f) return 1; v = M & w, p[v] = H << 24 | I << 16 | x - q | 0 } } return 0 !== M && (p[x + M] = D - J << 24 | 64 << 16 | 0), s.bits = H, 0 } }, { "../utils/common": 27 }], 37: [function (a, b) { "use strict"; b.exports = { 2: "need dictionary", 1: "stream end", 0: "", "-1": "file error", "-2": "stream error", "-3": "data error", "-4": "insufficient memory", "-5": "buffer error", "-6": "incompatible version" } }, {}], 38: [function (a, b, c) { "use strict"; function d(a) { for (var b = a.length; --b >= 0;)a[b] = 0 } function e(a) { return 256 > a ? gb[a] : gb[256 + (a >>> 7)] } function f(a, b) { a.pending_buf[a.pending++] = 255 & b, a.pending_buf[a.pending++] = b >>> 8 & 255 } function g(a, b, c) { a.bi_valid > V - c ? (a.bi_buf |= b << a.bi_valid & 65535, f(a, a.bi_buf), a.bi_buf = b >> V - a.bi_valid, a.bi_valid += c - V) : (a.bi_buf |= b << a.bi_valid & 65535, a.bi_valid += c) } function h(a, b, c) { g(a, c[2 * b], c[2 * b + 1]) } function i(a, b) { var c = 0; do c |= 1 & a, a >>>= 1, c <<= 1; while (--b > 0); return c >>> 1 } function j(a) { 16 === a.bi_valid ? (f(a, a.bi_buf), a.bi_buf = 0, a.bi_valid = 0) : a.bi_valid >= 8 && (a.pending_buf[a.pending++] = 255 & a.bi_buf, a.bi_buf >>= 8, a.bi_valid -= 8) } function k(a, b) { var c, d, e, f, g, h, i = b.dyn_tree, j = b.max_code, k = b.stat_desc.static_tree, l = b.stat_desc.has_stree, m = b.stat_desc.extra_bits, n = b.stat_desc.extra_base, o = b.stat_desc.max_length, p = 0; for (f = 0; U >= f; f++)a.bl_count[f] = 0; for (i[2 * a.heap[a.heap_max] + 1] = 0, c = a.heap_max + 1; T > c; c++)d = a.heap[c], f = i[2 * i[2 * d + 1] + 1] + 1, f > o && (f = o, p++), i[2 * d + 1] = f, d > j || (a.bl_count[f]++, g = 0, d >= n && (g = m[d - n]), h = i[2 * d], a.opt_len += h * (f + g), l && (a.static_len += h * (k[2 * d + 1] + g))); if (0 !== p) { do { for (f = o - 1; 0 === a.bl_count[f];)f--; a.bl_count[f]--, a.bl_count[f + 1] += 2, a.bl_count[o]--, p -= 2 } while (p > 0); for (f = o; 0 !== f; f--)for (d = a.bl_count[f]; 0 !== d;)e = a.heap[--c], e > j || (i[2 * e + 1] !== f && (a.opt_len += (f - i[2 * e + 1]) * i[2 * e], i[2 * e + 1] = f), d--) } } function l(a, b, c) { var d, e, f = new Array(U + 1), g = 0; for (d = 1; U >= d; d++)f[d] = g = g + c[d - 1] << 1; for (e = 0; b >= e; e++) { var h = a[2 * e + 1]; 0 !== h && (a[2 * e] = i(f[h]++, h)) } } function m() { var a, b, c, d, e, f = new Array(U + 1); for (c = 0, d = 0; O - 1 > d; d++)for (ib[d] = c, a = 0; a < 1 << _[d]; a++)hb[c++] = d; for (hb[c - 1] = d, e = 0, d = 0; 16 > d; d++)for (jb[d] = e, a = 0; a < 1 << ab[d]; a++)gb[e++] = d; for (e >>= 7; R > d; d++)for (jb[d] = e << 7, a = 0; a < 1 << ab[d] - 7; a++)gb[256 + e++] = d; for (b = 0; U >= b; b++)f[b] = 0; for (a = 0; 143 >= a;)eb[2 * a + 1] = 8, a++, f[8]++; for (; 255 >= a;)eb[2 * a + 1] = 9, a++, f[9]++; for (; 279 >= a;)eb[2 * a + 1] = 7, a++, f[7]++; for (; 287 >= a;)eb[2 * a + 1] = 8, a++, f[8]++; for (l(eb, Q + 1, f), a = 0; R > a; a++)fb[2 * a + 1] = 5, fb[2 * a] = i(a, 5); kb = new nb(eb, _, P + 1, Q, U), lb = new nb(fb, ab, 0, R, U), mb = new nb(new Array(0), bb, 0, S, W) } function n(a) { var b; for (b = 0; Q > b; b++)a.dyn_ltree[2 * b] = 0; for (b = 0; R > b; b++)a.dyn_dtree[2 * b] = 0; for (b = 0; S > b; b++)a.bl_tree[2 * b] = 0; a.dyn_ltree[2 * X] = 1, a.opt_len = a.static_len = 0, a.last_lit = a.matches = 0 } function o(a) { a.bi_valid > 8 ? f(a, a.bi_buf) : a.bi_valid > 0 && (a.pending_buf[a.pending++] = a.bi_buf), a.bi_buf = 0, a.bi_valid = 0 } function p(a, b, c, d) { o(a), d && (f(a, c), f(a, ~c)), E.arraySet(a.pending_buf, a.window, b, c, a.pending), a.pending += c } function q(a, b, c, d) { var e = 2 * b, f = 2 * c; return a[e] < a[f] || a[e] === a[f] && d[b] <= d[c] } function r(a, b, c) { for (var d = a.heap[c], e = c << 1; e <= a.heap_len && (e < a.heap_len && q(b, a.heap[e + 1], a.heap[e], a.depth) && e++, !q(b, d, a.heap[e], a.depth));)a.heap[c] = a.heap[e], c = e, e <<= 1; a.heap[c] = d } function s(a, b, c) { var d, f, i, j, k = 0; if (0 !== a.last_lit) do d = a.pending_buf[a.d_buf + 2 * k] << 8 | a.pending_buf[a.d_buf + 2 * k + 1], f = a.pending_buf[a.l_buf + k], k++, 0 === d ? h(a, f, b) : (i = hb[f], h(a, i + P + 1, b), j = _[i], 0 !== j && (f -= ib[i], g(a, f, j)), d--, i = e(d), h(a, i, c), j = ab[i], 0 !== j && (d -= jb[i], g(a, d, j))); while (k < a.last_lit); h(a, X, b) } function t(a, b) { var c, d, e, f = b.dyn_tree, g = b.stat_desc.static_tree, h = b.stat_desc.has_stree, i = b.stat_desc.elems, j = -1; for (a.heap_len = 0, a.heap_max = T, c = 0; i > c; c++)0 !== f[2 * c] ? (a.heap[++a.heap_len] = j = c, a.depth[c] = 0) : f[2 * c + 1] = 0; for (; a.heap_len < 2;)e = a.heap[++a.heap_len] = 2 > j ? ++j : 0, f[2 * e] = 1, a.depth[e] = 0, a.opt_len--, h && (a.static_len -= g[2 * e + 1]); for (b.max_code = j, c = a.heap_len >> 1; c >= 1; c--)r(a, f, c); e = i; do c = a.heap[1], a.heap[1] = a.heap[a.heap_len--], r(a, f, 1), d = a.heap[1], a.heap[--a.heap_max] = c, a.heap[--a.heap_max] = d, f[2 * e] = f[2 * c] + f[2 * d], a.depth[e] = (a.depth[c] >= a.depth[d] ? a.depth[c] : a.depth[d]) + 1, f[2 * c + 1] = f[2 * d + 1] = e, a.heap[1] = e++, r(a, f, 1); while (a.heap_len >= 2); a.heap[--a.heap_max] = a.heap[1], k(a, b), l(f, j, a.bl_count) } function u(a, b, c) { var d, e, f = -1, g = b[1], h = 0, i = 7, j = 4; for (0 === g && (i = 138, j = 3), b[2 * (c + 1) + 1] = 65535, d = 0; c >= d; d++)e = g, g = b[2 * (d + 1) + 1], ++h < i && e === g || (j > h ? a.bl_tree[2 * e] += h : 0 !== e ? (e !== f && a.bl_tree[2 * e]++, a.bl_tree[2 * Y]++) : 10 >= h ? a.bl_tree[2 * Z]++ : a.bl_tree[2 * $]++, h = 0, f = e, 0 === g ? (i = 138, j = 3) : e === g ? (i = 6, j = 3) : (i = 7, j = 4)) } function v(a, b, c) { var d, e, f = -1, i = b[1], j = 0, k = 7, l = 4; for (0 === i && (k = 138, l = 3), d = 0; c >= d; d++)if (e = i, i = b[2 * (d + 1) + 1], !(++j < k && e === i)) { if (l > j) { do h(a, e, a.bl_tree); while (0 !== --j) } else 0 !== e ? (e !== f && (h(a, e, a.bl_tree), j--), h(a, Y, a.bl_tree), g(a, j - 3, 2)) : 10 >= j ? (h(a, Z, a.bl_tree), g(a, j - 3, 3)) : (h(a, $, a.bl_tree), g(a, j - 11, 7)); j = 0, f = e, 0 === i ? (k = 138, l = 3) : e === i ? (k = 6, l = 3) : (k = 7, l = 4) } } function w(a) { var b; for (u(a, a.dyn_ltree, a.l_desc.max_code), u(a, a.dyn_dtree, a.d_desc.max_code), t(a, a.bl_desc), b = S - 1; b >= 3 && 0 === a.bl_tree[2 * cb[b] + 1]; b--); return a.opt_len += 3 * (b + 1) + 5 + 5 + 4, b } function x(a, b, c, d) { var e; for (g(a, b - 257, 5), g(a, c - 1, 5), g(a, d - 4, 4), e = 0; d > e; e++)g(a, a.bl_tree[2 * cb[e] + 1], 3); v(a, a.dyn_ltree, b - 1), v(a, a.dyn_dtree, c - 1) } function y(a) { var b, c = 4093624447; for (b = 0; 31 >= b; b++, c >>>= 1)if (1 & c && 0 !== a.dyn_ltree[2 * b]) return G; if (0 !== a.dyn_ltree[18] || 0 !== a.dyn_ltree[20] || 0 !== a.dyn_ltree[26]) return H; for (b = 32; P > b; b++)if (0 !== a.dyn_ltree[2 * b]) return H; return G } function z(a) { pb || (m(), pb = !0), a.l_desc = new ob(a.dyn_ltree, kb), a.d_desc = new ob(a.dyn_dtree, lb), a.bl_desc = new ob(a.bl_tree, mb), a.bi_buf = 0, a.bi_valid = 0, n(a) } function A(a, b, c, d) { g(a, (J << 1) + (d ? 1 : 0), 3), p(a, b, c, !0) } function B(a) { g(a, K << 1, 3), h(a, X, eb), j(a) } function C(a, b, c, d) { var e, f, h = 0; a.level > 0 ? (a.strm.data_type === I && (a.strm.data_type = y(a)), t(a, a.l_desc), t(a, a.d_desc), h = w(a), e = a.opt_len + 3 + 7 >>> 3, f = a.static_len + 3 + 7 >>> 3, e >= f && (e = f)) : e = f = c + 5, e >= c + 4 && -1 !== b ? A(a, b, c, d) : a.strategy === F || f === e ? (g(a, (K << 1) + (d ? 1 : 0), 3), s(a, eb, fb)) : (g(a, (L << 1) + (d ? 1 : 0), 3), x(a, a.l_desc.max_code + 1, a.d_desc.max_code + 1, h + 1), s(a, a.dyn_ltree, a.dyn_dtree)), n(a), d && o(a) } function D(a, b, c) { return a.pending_buf[a.d_buf + 2 * a.last_lit] = b >>> 8 & 255, a.pending_buf[a.d_buf + 2 * a.last_lit + 1] = 255 & b, a.pending_buf[a.l_buf + a.last_lit] = 255 & c, a.last_lit++, 0 === b ? a.dyn_ltree[2 * c]++ : (a.matches++, b--, a.dyn_ltree[2 * (hb[c] + P + 1)]++, a.dyn_dtree[2 * e(b)]++), a.last_lit === a.lit_bufsize - 1 } var E = a("../utils/common"), F = 4, G = 0, H = 1, I = 2, J = 0, K = 1, L = 2, M = 3, N = 258, O = 29, P = 256, Q = P + 1 + O, R = 30, S = 19, T = 2 * Q + 1, U = 15, V = 16, W = 7, X = 256, Y = 16, Z = 17, $ = 18, _ = [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0], ab = [0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13], bb = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 7], cb = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15], db = 512, eb = new Array(2 * (Q + 2)); d(eb); var fb = new Array(2 * R); d(fb); var gb = new Array(db); d(gb); var hb = new Array(N - M + 1); d(hb); var ib = new Array(O); d(ib); var jb = new Array(R); d(jb); var kb, lb, mb, nb = function (a, b, c, d, e) { this.static_tree = a, this.extra_bits = b, this.extra_base = c, this.elems = d, this.max_length = e, this.has_stree = a && a.length }, ob = function (a, b) { this.dyn_tree = a, this.max_code = 0, this.stat_desc = b }, pb = !1; c._tr_init = z, c._tr_stored_block = A, c._tr_flush_block = C, c._tr_tally = D, c._tr_align = B }, { "../utils/common": 27 }], 39: [function (a, b) { "use strict"; function c() { this.input = null, this.next_in = 0, this.avail_in = 0, this.total_in = 0, this.output = null, this.next_out = 0, this.avail_out = 0, this.total_out = 0, this.msg = "", this.state = null, this.data_type = 2, this.adler = 0 } b.exports = c }, {}]
}, {}, [9])(9)
});
(function (g) { "function" === typeof define && define.amd ? define(["jquery", "datatables.net", "datatables.net-buttons"], function (i) { return g(i, window, document) }) : "object" === typeof exports ? module.exports = function (i, j, t, u) { i || (i = window); if (!j || !j.fn.dataTable) j = require("datatables.net")(i, j).$; j.fn.dataTable.Buttons || require("datatables.net-buttons")(i, j); return g(j, i, i.document, t, u) } : g(jQuery, window, document) })(function (g, i, j, t, u, o) {
function E(a, b) {
v === o && (v = -1 === y.serializeToString(g.parseXML(F["xl/worksheets/sheet1.xml"])).indexOf("xmlns:r"));
g.each(b, function (b, c) {
if (g.isPlainObject(c)) { var f = a.folder(b); E(f, c) } else {
if (v) { var f = c.childNodes[0], e, h, l = []; for (e = f.attributes.length - 1; 0 <= e; e--) { h = f.attributes[e].nodeName; var n = f.attributes[e].nodeValue; -1 !== h.indexOf(":") && (l.push({ name: h, value: n }), f.removeAttribute(h)) } e = 0; for (h = l.length; e < h; e++)n = c.createAttribute(l[e].name.replace(":", "_dt_b_namespace_token_")), n.value = l[e].value, f.setAttributeNode(n) } f = y.serializeToString(c); v && (-1 === f.indexOf("' +
f), f = f.replace(/_dt_b_namespace_token_/g, ":")); f = f.replace(//g, ""); a.file(b, f)
}
})
} function p(a, b, d) { var c = a.createElement(b); d && (d.attr && g(c).attr(d.attr), d.children && g.each(d.children, function (a, b) { c.appendChild(b) }), d.text && c.appendChild(a.createTextNode(d.text))); return c } function N(a, b) {
var d = a.header[b].length, c; a.footer && a.footer[b].length > d && (d = a.footer[b].length); for (var f = 0, e = a.body.length; f < e && !(c = a.body[f][b].toString().length, c > d &&
(d = c), 40 < d); f++); return 5 < d ? d : 5
} var r = g.fn.dataTable, q; var h = "undefined" !== typeof self && self || "undefined" !== typeof i && i || this.content; if ("undefined" !== typeof navigator && /MSIE [1-9]\./.test(navigator.userAgent)) q = void 0; else {
var w = h.document.createElementNS("http://www.w3.org/1999/xhtml", "a"), O = "download" in w, G = /Version\/[\d\.]+.*Safari/.test(navigator.userAgent), z = h.webkitRequestFileSystem, H = h.requestFileSystem || z || h.mozRequestFileSystem, P = function (a) {
(h.setImmediate || h.setTimeout)(function () {
throw a;
}, 0)
}, A = 0, B = function (a) { setTimeout(function () { "string" === typeof a ? (h.URL || h.webkitURL || h).revokeObjectURL(a) : a.remove() }, 4E4) }, C = function (a, b, d) { for (var b = [].concat(b), c = b.length; c--;) { var f = a["on" + b[c]]; if ("function" === typeof f) try { f.call(a, d || a) } catch (e) { P(e) } } }, I = function (a) { return /^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(a.type) ? new Blob(["", a], { type: a.type }) : a }, J = function (a, b, d) {
d || (a = I(a)); var c = this, d = a.type, f = !1, e, g, l = function () {
C(c, ["writestart", "progress",
"write", "writeend"])
}, n = function () { if (g && G && "undefined" !== typeof FileReader) { var b = new FileReader; b.onloadend = function () { var a = b.result; g.location.href = "data:attachment/file" + a.slice(a.search(/[,;]/)); c.readyState = c.DONE; l() }; b.readAsDataURL(a); c.readyState = c.INIT } else { if (f || !e) e = (h.URL || h.webkitURL || h).createObjectURL(a); g ? g.location.href = e : h.open(e, "_blank") === o && G && (h.location.href = e); c.readyState = c.DONE; l(); B(e) } }, m = function (a) { return function () { if (c.readyState !== c.DONE) return a.apply(this, arguments) } },
i = { create: !0, exclusive: !1 }, s; c.readyState = c.INIT; b || (b = "download"); if (O) e = (h.URL || h.webkitURL || h).createObjectURL(a), setTimeout(function () { w.href = e; w.download = b; var a = new MouseEvent("click"); w.dispatchEvent(a); l(); B(e); c.readyState = c.DONE }); else {
h.chrome && (d && "application/octet-stream" !== d) && (s = a.slice || a.webkitSlice, a = s.call(a, 0, a.size, "application/octet-stream"), f = !0); z && "download" !== b && (b += ".download"); if ("application/octet-stream" === d || z) g = h; H ? (A += a.size, H(h.TEMPORARY, A, m(function (d) {
d.root.getDirectory("saved",
i, m(function (d) {
var e = function () { d.getFile(b, i, m(function (b) { b.createWriter(m(function (d) { d.onwriteend = function (a) { g.location.href = b.toURL(); c.readyState = c.DONE; C(c, "writeend", a); B(b) }; d.onerror = function () { var a = d.error; a.code !== a.ABORT_ERR && n() };["writestart", "progress", "write", "abort"].forEach(function (a) { d["on" + a] = c["on" + a] }); d.write(a); c.abort = function () { d.abort(); c.readyState = c.DONE }; c.readyState = c.WRITING }), n) }), n) }; d.getFile(b, { create: false }, m(function (a) { a.remove(); e() }), m(function (a) {
a.code ===
a.NOT_FOUND_ERR ? e() : n()
}))
}), n)
}), n)) : n()
}
}, k = J.prototype; "undefined" !== typeof navigator && navigator.msSaveOrOpenBlob ? q = function (a, b, d) { d || (a = I(a)); return navigator.msSaveOrOpenBlob(a, b || "download") } : (k.abort = function () { this.readyState = this.DONE; C(this, "abort") }, k.readyState = k.INIT = 0, k.WRITING = 1, k.DONE = 2, k.error = k.onwritestart = k.onprogress = k.onwrite = k.onabort = k.onerror = k.onwriteend = null, q = function (a, b, d) { return new J(a, b, d) })
} r.fileSave = q; var x = function (a, b) {
var d = "*" === a.filename && "*" !== a.title &&
a.title !== o ? a.title : a.filename; "function" === typeof d && (d = d()); -1 !== d.indexOf("*") && (d = g.trim(d.replace("*", g("title").text()))); d = d.replace(/[^a-zA-Z0-9_\u00A1-\uFFFF\.,\-_ !\(\)]/g, ""); return b === o || !0 === b ? d + a.extension : d
}, Q = function (a) { var b = "Sheet1"; a.sheetName && (b = a.sheetName.replace(/[\[\]\*\/\\\?\:]/g, "")); return b }, R = function (a) { a = a.title; "function" === typeof a && (a = a()); return -1 !== a.indexOf("*") ? a.replace("*", g("title").text() || "Exported data") : a }, K = function (a) {
return a.newline ? a.newline : navigator.userAgent.match(/Windows/) ?
"\r\n" : "\n"
}, L = function (a, b) { for (var d = K(b), c = a.buttons.exportData(b.exportOptions), f = b.fieldBoundary, e = b.fieldSeparator, g = RegExp(f, "g"), l = b.escapeChar !== o ? b.escapeChar : "\\", h = function (a) { for (var b = "", c = 0, d = a.length; c < d; c++)0 < c && (b += e), b += f ? f + ("" + a[c]).replace(g, l + f) + f : a[c]; return b }, i = b.header ? h(c.header) + d : "", j = b.footer && c.footer ? d + h(c.footer) : "", s = [], D = 0, k = c.body.length; D < k; D++)s.push(h(c.body[D])); return { str: i + s.join(d) + j, rows: s.length } }, M = function () {
return -1 !== navigator.userAgent.indexOf("Safari") &&
-1 === navigator.userAgent.indexOf("Chrome") && -1 === navigator.userAgent.indexOf("Opera")
}; try { var y = new XMLSerializer, v } catch (S) { } var F = {
"_rels/.rels": ' ', "xl/_rels/workbook.xml.rels": ' ',
"[Content_Types].xml": ' ',
"xl/workbook.xml": ' ',
"xl/worksheets/sheet1.xml": ' ', "xl/styles.xml": ' '
};
r.ext.buttons.copyHtml5 = {
className: "buttons-copy buttons-html5", text: function (a) { return a.i18n("buttons.copy", "Copy") }, action: function (a, b, d, c) {
var a = L(b, c), f = a.str, d = g("
").css({ height: 1, width: 1, overflow: "hidden", position: "fixed", top: 0, left: 0 }); c.customize && (f = c.customize(f, c)); c = g("").val(f).appendTo(d); if (j.queryCommandSupported("copy")) {
d.appendTo(b.table().container()); c[0].focus(); c[0].select(); try {
var e = j.execCommand("copy"); d.remove(); if (e) {
b.buttons.info(b.i18n("buttons.copyTitle",
"Copy to clipboard"), b.i18n("buttons.copySuccess", { 1: "Copied one row to clipboard", _: "Copied %d rows to clipboard" }, a.rows), 2E3); return
}
} catch (h) { }
} e = g("" + b.i18n("buttons.copyKeys", "Press ctrl or ⌘ + C to copy the table data to your system clipboard. To cancel, click this message or press escape.") + " ").append(d); b.buttons.info(b.i18n("buttons.copyTitle", "Copy to clipboard"), e, 0); c[0].focus(); c[0].select(); var l = g(e).closest(".dt-button-info"), i = function () {
l.off("click.buttons-copy");
g(j).off(".buttons-copy"); b.buttons.info(!1)
}; l.on("click.buttons-copy", i); g(j).on("keydown.buttons-copy", function (a) { 27 === a.keyCode && i() }).on("copy.buttons-copy cut.buttons-copy", function () { i() })
}, exportOptions: {}, fieldSeparator: "\t", fieldBoundary: "", header: !0, footer: !1
}; r.ext.buttons.csvHtml5 = {
bom: !1, className: "buttons-csv buttons-html5", available: function () { return i.FileReader !== o && i.Blob }, text: function (a) { return a.i18n("buttons.csv", "CSV") }, action: function (a, b, d, c) {
a = L(b, c).str; b = c.charset; c.customize &&
(a = c.customize(a, c)); !1 !== b ? (b || (b = j.characterSet || j.charset), b && (b = ";charset=" + b)) : b = ""; c.bom && (a = "" + a); q(new Blob([a], { type: "text/csv" + b }), x(c), !0)
}, filename: "*", extension: ".csv", exportOptions: {}, fieldSeparator: ",", fieldBoundary: '"', escapeChar: '"', charset: null, header: !0, footer: !1
}; r.ext.buttons.excelHtml5 = {
className: "buttons-excel buttons-html5", available: function () { return i.FileReader !== o && (t || i.JSZip) !== o && !M() && y }, text: function (a) { return a.i18n("buttons.excel", "Excel") }, action: function (a, b,
d, c) {
var f = 0, a = function (a) { return g.parseXML(F[a]) }, e = a("xl/worksheets/sheet1.xml"), h = e.getElementsByTagName("sheetData")[0], a = { _rels: { ".rels": a("_rels/.rels") }, xl: { _rels: { "workbook.xml.rels": a("xl/_rels/workbook.xml.rels") }, "workbook.xml": a("xl/workbook.xml"), "styles.xml": a("xl/styles.xml"), worksheets: { "sheet1.xml": e } }, "[Content_Types].xml": a("[Content_Types].xml") }, b = b.buttons.exportData(c.exportOptions), l, j, d = function (a) {
l = f + 1; j = p(e, "row", { attr: { r: l } }); for (var b = 0, c = a.length; b < c; b++) {
for (var d =
b, i = ""; 0 <= d;)i = String.fromCharCode(d % 26 + 65) + i, d = Math.floor(d / 26) - 1; d = i + "" + l; if (null === a[b] || a[b] === o) a[b] = ""; "number" === typeof a[b] || a[b].match && g.trim(a[b]).match(/^-?\d+(\.\d+)?$/) && !g.trim(a[b]).match(/^0\d+/) ? d = p(e, "c", { attr: { t: "n", r: d }, children: [p(e, "v", { text: a[b] })] }) : (i = !a[b].replace ? a[b] : a[b].replace(/[\x00-\x09\x0B\x0C\x0E-\x1F\x7F-\x9F]/g, ""), d = p(e, "c", { attr: { t: "inlineStr", r: d }, children: { row: p(e, "is", { children: { row: p(e, "t", { text: i }) } }) } })); j.appendChild(d)
} h.appendChild(j); f++
}; g("sheets sheet",
a.xl["workbook.xml"]).attr("name", Q(c)); c.customizeData && c.customizeData(b); c.header && (d(b.header, f), g("row c", e).attr("s", "2")); for (var m = 0, k = b.body.length; m < k; m++)d(b.body[m], f); c.footer && b.footer && (d(b.footer, f), g("row:last c", e).attr("s", "2")); d = p(e, "cols"); g("worksheet", e).prepend(d); m = 0; for (k = b.header.length; m < k; m++)d.appendChild(p(e, "col", { attr: { min: m + 1, max: m + 1, width: N(b, m), customWidth: 1 } })); c.customize && c.customize(a); b = new (t || i.JSZip); d = { type: "blob", mimeType: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" };
E(b, a); b.generateAsync ? b.generateAsync(d).then(function (a) { q(a, x(c)) }) : q(b.generate(d), x(c))
}, filename: "*", extension: ".xlsx", exportOptions: {}, header: !0, footer: !1
}; r.ext.buttons.pdfHtml5 = {
className: "buttons-pdf buttons-html5", available: function () { return i.FileReader !== o && (u || i.pdfMake) }, text: function (a) { return a.i18n("buttons.pdf", "PDF") }, action: function (a, b, d, c) {
K(c); var a = b.buttons.exportData(c.exportOptions), f = []; c.header && f.push(g.map(a.header, function (a) {
return {
text: "string" === typeof a ? a : a + "",
style: "tableHeader"
}
})); for (var e = 0, h = a.body.length; e < h; e++)f.push(g.map(a.body[e], function (a) { return { text: "string" === typeof a ? a : a + "", style: e % 2 ? "tableBodyEven" : "tableBodyOdd" } })); c.footer && a.footer && f.push(g.map(a.footer, function (a) { return { text: "string" === typeof a ? a : a + "", style: "tableFooter" } })); a = {
pageSize: c.pageSize, pageOrientation: c.orientation, content: [{ table: { headerRows: 1, body: f }, layout: "noBorders" }], styles: {
tableHeader: { bold: !0, fontSize: 11, color: "white", fillColor: "#2d4154", alignment: "center" },
tableBodyEven: {}, tableBodyOdd: { fillColor: "#f3f3f3" }, tableFooter: { bold: !0, fontSize: 11, color: "white", fillColor: "#2d4154" }, title: { alignment: "center", fontSize: 15 }, message: {}
}, defaultStyle: { fontSize: 10 }
}; c.message && a.content.unshift({ text: "function" == typeof c.message ? c.message(b, d, c) : c.message, style: "message", margin: [0, 0, 0, 12] }); c.title && a.content.unshift({ text: R(c, !1), style: "title", margin: [0, 0, 0, 12] }); c.customize && c.customize(a, c); b = (u || i.pdfMake).createPdf(a); "open" === c.download && !M() ? b.open() : b.getBuffer(function (a) {
a =
new Blob([a], { type: "application/pdf" }); q(a, x(c))
})
}, title: "*", filename: "*", extension: ".pdf", exportOptions: {}, orientation: "portrait", pageSize: "A4", header: !0, footer: !1, message: null, customize: null, download: "download"
}; return r.Buttons
});
/*!
* Lightbox v2.11.2
* by Lokesh Dhakar
*
* More info:
* http://lokeshdhakar.com/projects/lightbox2/
*
* Copyright Lokesh Dhakar
* Released under the MIT license
* https://github.com/lokesh/lightbox2/blob/master/LICENSE
*
* @preserve
*/
// Uses Node, AMD or browser globals to create a module.
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['jquery'], factory);
} else if (typeof exports === 'object') {
// Node. Does not work with strict CommonJS, but
// only CommonJS-like environments that support module.exports,
// like Node.
module.exports = factory(require('jquery'));
} else {
// Browser globals (root is window)
root.lightbox = factory(root.jQuery);
}
}(this, function ($) {
function Lightbox(options) {
this.album = [];
this.currentImageIndex = void 0;
this.init();
// options
this.options = $.extend({}, this.constructor.defaults);
this.option(options);
}
// Descriptions of all options available on the demo site:
// http://lokeshdhakar.com/projects/lightbox2/index.html#options
Lightbox.defaults = {
albumLabel: 'Image %1 of %2',
alwaysShowNavOnTouchDevices: false,
fadeDuration: 600,
fitImagesInViewport: true,
imageFadeDuration: 600,
// maxWidth: 800,
// maxHeight: 600,
positionFromTop: 50,
resizeDuration: 700,
showImageNumberLabel: true,
wrapAround: false,
disableScrolling: false,
/*
Sanitize Title
If the caption data is trusted, for example you are hardcoding it in, then leave this to false.
This will free you to add html tags, such as links, in the caption.
If the caption data is user submitted or from some other untrusted source, then set this to true
to prevent xss and other injection attacks.
*/
sanitizeTitle: false
};
Lightbox.prototype.option = function (options) {
$.extend(this.options, options);
};
Lightbox.prototype.imageCountLabel = function (currentImageNum, totalImages) {
return this.options.albumLabel.replace(/%1/g, currentImageNum).replace(/%2/g, totalImages);
};
Lightbox.prototype.init = function () {
var self = this;
// Both enable and build methods require the body tag to be in the DOM.
$(document).ready(function () {
self.enable();
self.build();
});
};
// Loop through anchors and areamaps looking for either data-lightbox attributes or rel attributes
// that contain 'lightbox'. When these are clicked, start lightbox.
Lightbox.prototype.enable = function () {
var self = this;
$('body').on('click', 'a[rel^=lightbox], area[rel^=lightbox], a[data-lightbox], area[data-lightbox]', function (event) {
self.start($(event.currentTarget));
return false;
});
};
// Build html for the lightbox and the overlay.
// Attach event handlers to the new DOM elements. click click click
Lightbox.prototype.build = function () {
if ($('#lightbox').length > 0) {
return;
}
var self = this;
// The two root notes generated, #lightboxOverlay and #lightbox are given
// tabindex attrs so they are focusable. We attach our keyboard event
// listeners to these two elements, and not the document. Clicking anywhere
// while Lightbox is opened will keep the focus on or inside one of these
// two elements.
//
// We do this so we can prevent propogation of the Esc keypress when
// Lightbox is open. This prevents it from intefering with other components
// on the page below.
//
// Github issue: https://github.com/lokesh/lightbox2/issues/663
$('
').appendTo($('body'));
// Cache jQuery objects
this.$lightbox = $('#lightbox');
this.$overlay = $('#lightboxOverlay');
this.$outerContainer = this.$lightbox.find('.lb-outerContainer');
this.$container = this.$lightbox.find('.lb-container');
this.$image = this.$lightbox.find('.lb-image');
this.$nav = this.$lightbox.find('.lb-nav');
// Store css values for future lookup
this.containerPadding = {
top: parseInt(this.$container.css('padding-top'), 10),
right: parseInt(this.$container.css('padding-right'), 10),
bottom: parseInt(this.$container.css('padding-bottom'), 10),
left: parseInt(this.$container.css('padding-left'), 10)
};
this.imageBorderWidth = {
top: parseInt(this.$image.css('border-top-width'), 10),
right: parseInt(this.$image.css('border-right-width'), 10),
bottom: parseInt(this.$image.css('border-bottom-width'), 10),
left: parseInt(this.$image.css('border-left-width'), 10)
};
// Attach event handlers to the newly minted DOM elements
this.$overlay.hide().on('click', function () {
self.end();
return false;
});
this.$lightbox.hide().on('click', function (event) {
if ($(event.target).attr('id') === 'lightbox') {
self.end();
}
});
this.$outerContainer.on('click', function (event) {
if ($(event.target).attr('id') === 'lightbox') {
self.end();
}
return false;
});
this.$lightbox.find('.lb-prev').on('click', function () {
if (self.currentImageIndex === 0) {
self.changeImage(self.album.length - 1);
} else {
self.changeImage(self.currentImageIndex - 1);
}
return false;
});
this.$lightbox.find('.lb-next').on('click', function () {
if (self.currentImageIndex === self.album.length - 1) {
self.changeImage(0);
} else {
self.changeImage(self.currentImageIndex + 1);
}
return false;
});
/*
Show context menu for image on right-click
There is a div containing the navigation that spans the entire image and lives above of it. If
you right-click, you are right clicking this div and not the image. This prevents users from
saving the image or using other context menu actions with the image.
To fix this, when we detect the right mouse button is pressed down, but not yet clicked, we
set pointer-events to none on the nav div. This is so that the upcoming right-click event on
the next mouseup will bubble down to the image. Once the right-click/contextmenu event occurs
we set the pointer events back to auto for the nav div so it can capture hover and left-click
events as usual.
*/
this.$nav.on('mousedown', function (event) {
if (event.which === 3) {
self.$nav.css('pointer-events', 'none');
self.$lightbox.one('contextmenu', function () {
setTimeout(function () {
this.$nav.css('pointer-events', 'auto');
}.bind(self), 0);
});
}
});
this.$lightbox.find('.lb-loader, .lb-close').on('click', function () {
self.end();
return false;
});
};
// Show overlay and lightbox. If the image is part of a set, add siblings to album array.
Lightbox.prototype.start = function ($link) {
var self = this;
var $window = $(window);
$window.on('resize', $.proxy(this.sizeOverlay, this));
this.sizeOverlay();
this.album = [];
var imageNumber = 0;
function addToAlbum($link) {
self.album.push({
alt: $link.attr('data-alt'),
link: $link.attr('href'),
title: $link.attr('data-title') || $link.attr('title')
});
}
// Support both data-lightbox attribute and rel attribute implementations
var dataLightboxValue = $link.attr('data-lightbox');
var $links;
if (dataLightboxValue) {
$links = $($link.prop('tagName') + '[data-lightbox="' + dataLightboxValue + '"]');
for (var i = 0; i < $links.length; i = ++i) {
addToAlbum($($links[i]));
if ($links[i] === $link[0]) {
imageNumber = i;
}
}
} else {
if ($link.attr('rel') === 'lightbox') {
// If image is not part of a set
addToAlbum($link);
} else {
// If image is part of a set
$links = $($link.prop('tagName') + '[rel="' + $link.attr('rel') + '"]');
for (var j = 0; j < $links.length; j = ++j) {
addToAlbum($($links[j]));
if ($links[j] === $link[0]) {
imageNumber = j;
}
}
}
}
// Position Lightbox
var top = $window.scrollTop() + this.options.positionFromTop;
var left = $window.scrollLeft();
this.$lightbox.css({
top: top + 'px',
left: left + 'px'
}).fadeIn(this.options.fadeDuration);
// Disable scrolling of the page while open
if (this.options.disableScrolling) {
$('body').addClass('lb-disable-scrolling');
}
this.changeImage(imageNumber);
};
// Hide most UI elements in preparation for the animated resizing of the lightbox.
Lightbox.prototype.changeImage = function (imageNumber) {
var self = this;
var filename = this.album[imageNumber].link;
var filetype = filename.split('.').slice(-1)[0];
var $image = this.$lightbox.find('.lb-image');
// Disable keyboard nav during transitions
this.disableKeyboardNav();
// Show loading state
this.$overlay.fadeIn(this.options.fadeDuration);
$('.lb-loader').fadeIn('slow');
this.$lightbox.find('.lb-image, .lb-nav, .lb-prev, .lb-next, .lb-dataContainer, .lb-numbers, .lb-caption').hide();
this.$outerContainer.addClass('animating');
// When image to show is preloaded, we send the width and height to sizeContainer()
var preloader = new Image();
preloader.onload = function () {
var $preloader;
var imageHeight;
var imageWidth;
var maxImageHeight;
var maxImageWidth;
var windowHeight;
var windowWidth;
$image.attr({
'alt': self.album[imageNumber].alt,
'src': filename
});
$preloader = $(preloader);
$image.width(preloader.width);
$image.height(preloader.height);
windowWidth = $(window).width();
windowHeight = $(window).height();
// Calculate the max image dimensions for the current viewport.
// Take into account the border around the image and an additional 10px gutter on each side.
maxImageWidth = windowWidth - self.containerPadding.left - self.containerPadding.right - self.imageBorderWidth.left - self.imageBorderWidth.right - 20;
maxImageHeight = windowHeight - self.containerPadding.top - self.containerPadding.bottom - self.imageBorderWidth.top - self.imageBorderWidth.bottom - self.options.positionFromTop - 70;
/*
Since many SVGs have small intrinsic dimensions, but they support scaling
up without quality loss because of their vector format, max out their
size.
*/
if (filetype === 'svg') {
$image.width(maxImageWidth);
$image.height(maxImageHeight);
}
// Fit image inside the viewport.
if (self.options.fitImagesInViewport) {
// Check if image size is larger then maxWidth|maxHeight in settings
if (self.options.maxWidth && self.options.maxWidth < maxImageWidth) {
maxImageWidth = self.options.maxWidth;
}
if (self.options.maxHeight && self.options.maxHeight < maxImageHeight) {
maxImageHeight = self.options.maxHeight;
}
} else {
maxImageWidth = self.options.maxWidth || preloader.width || maxImageWidth;
maxImageHeight = self.options.maxHeight || preloader.height || maxImageHeight;
}
// Is the current image's width or height is greater than the maxImageWidth or maxImageHeight
// option than we need to size down while maintaining the aspect ratio.
if ((preloader.width > maxImageWidth) || (preloader.height > maxImageHeight)) {
if ((preloader.width / maxImageWidth) > (preloader.height / maxImageHeight)) {
imageWidth = maxImageWidth;
imageHeight = parseInt(preloader.height / (preloader.width / imageWidth), 10);
$image.width(imageWidth);
$image.height(imageHeight);
} else {
imageHeight = maxImageHeight;
imageWidth = parseInt(preloader.width / (preloader.height / imageHeight), 10);
$image.width(imageWidth);
$image.height(imageHeight);
}
}
self.sizeContainer($image.width(), $image.height());
};
// Preload image before showing
preloader.src = this.album[imageNumber].link;
this.currentImageIndex = imageNumber;
};
// Stretch overlay to fit the viewport
Lightbox.prototype.sizeOverlay = function () {
var self = this;
/*
We use a setTimeout 0 to pause JS execution and let the rendering catch-up.
Why do this? If the `disableScrolling` option is set to true, a class is added to the body
tag that disables scrolling and hides the scrollbar. We want to make sure the scrollbar is
hidden before we measure the document width, as the presence of the scrollbar will affect the
number.
*/
setTimeout(function () {
self.$overlay
.width($(document).width())
.height($(document).height());
}, 0);
};
// Animate the size of the lightbox to fit the image we are showing
// This method also shows the the image.
Lightbox.prototype.sizeContainer = function (imageWidth, imageHeight) {
var self = this;
var oldWidth = this.$outerContainer.outerWidth();
var oldHeight = this.$outerContainer.outerHeight();
var newWidth = imageWidth + this.containerPadding.left + this.containerPadding.right + this.imageBorderWidth.left + this.imageBorderWidth.right;
var newHeight = imageHeight + this.containerPadding.top + this.containerPadding.bottom + this.imageBorderWidth.top + this.imageBorderWidth.bottom;
function postResize() {
self.$lightbox.find('.lb-dataContainer').width(newWidth);
self.$lightbox.find('.lb-prevLink').height(newHeight);
self.$lightbox.find('.lb-nextLink').height(newHeight);
// Set focus on one of the two root nodes so keyboard events are captured.
self.$overlay.focus();
self.showImage();
}
if (oldWidth !== newWidth || oldHeight !== newHeight) {
this.$outerContainer.animate({
width: newWidth,
height: newHeight
}, this.options.resizeDuration, 'swing', function () {
postResize();
});
} else {
postResize();
}
};
// Display the image and its details and begin preload neighboring images.
Lightbox.prototype.showImage = function () {
this.$lightbox.find('.lb-loader').stop(true).hide();
this.$lightbox.find('.lb-image').fadeIn(this.options.imageFadeDuration);
this.updateNav();
this.updateDetails();
this.preloadNeighboringImages();
this.enableKeyboardNav();
};
// Display previous and next navigation if appropriate.
Lightbox.prototype.updateNav = function () {
// Check to see if the browser supports touch events. If so, we take the conservative approach
// and assume that mouse hover events are not supported and always show prev/next navigation
// arrows in image sets.
var alwaysShowNav = false;
try {
document.createEvent('TouchEvent');
alwaysShowNav = (this.options.alwaysShowNavOnTouchDevices) ? true : false;
} catch (e) { }
this.$lightbox.find('.lb-nav').show();
if (this.album.length > 1) {
if (this.options.wrapAround) {
if (alwaysShowNav) {
this.$lightbox.find('.lb-prev, .lb-next').css('opacity', '1');
}
this.$lightbox.find('.lb-prev, .lb-next').show();
} else {
if (this.currentImageIndex > 0) {
this.$lightbox.find('.lb-prev').show();
if (alwaysShowNav) {
this.$lightbox.find('.lb-prev').css('opacity', '1');
}
}
if (this.currentImageIndex < this.album.length - 1) {
this.$lightbox.find('.lb-next').show();
if (alwaysShowNav) {
this.$lightbox.find('.lb-next').css('opacity', '1');
}
}
}
}
};
// Display caption, image number, and closing button.
Lightbox.prototype.updateDetails = function () {
var self = this;
// Enable anchor clicks in the injected caption html.
// Thanks Nate Wright for the fix. @https://github.com/NateWr
if (typeof this.album[this.currentImageIndex].title !== 'undefined' &&
this.album[this.currentImageIndex].title !== '') {
var $caption = this.$lightbox.find('.lb-caption');
if (this.options.sanitizeTitle) {
$caption.text(this.album[this.currentImageIndex].title);
} else {
$caption.html(this.album[this.currentImageIndex].title);
}
$caption.fadeIn('fast');
}
if (this.album.length > 1 && this.options.showImageNumberLabel) {
var labelText = this.imageCountLabel(this.currentImageIndex + 1, this.album.length);
this.$lightbox.find('.lb-number').text(labelText).fadeIn('fast');
} else {
this.$lightbox.find('.lb-number').hide();
}
this.$outerContainer.removeClass('animating');
this.$lightbox.find('.lb-dataContainer').fadeIn(this.options.resizeDuration, function () {
return self.sizeOverlay();
});
};
// Preload previous and next images in set.
Lightbox.prototype.preloadNeighboringImages = function () {
if (this.album.length > this.currentImageIndex + 1) {
var preloadNext = new Image();
preloadNext.src = this.album[this.currentImageIndex + 1].link;
}
if (this.currentImageIndex > 0) {
var preloadPrev = new Image();
preloadPrev.src = this.album[this.currentImageIndex - 1].link;
}
};
Lightbox.prototype.enableKeyboardNav = function () {
this.$lightbox.on('keyup.keyboard', $.proxy(this.keyboardAction, this));
this.$overlay.on('keyup.keyboard', $.proxy(this.keyboardAction, this));
};
Lightbox.prototype.disableKeyboardNav = function () {
this.$lightbox.off('.keyboard');
this.$overlay.off('.keyboard');
};
Lightbox.prototype.keyboardAction = function (event) {
var KEYCODE_ESC = 27;
var KEYCODE_LEFTARROW = 37;
var KEYCODE_RIGHTARROW = 39;
var keycode = event.keyCode;
if (keycode === KEYCODE_ESC) {
// Prevent bubbling so as to not affect other components on the page.
event.stopPropagation();
this.end();
} else if (keycode === KEYCODE_LEFTARROW) {
if (this.currentImageIndex !== 0) {
this.changeImage(this.currentImageIndex - 1);
} else if (this.options.wrapAround && this.album.length > 1) {
this.changeImage(this.album.length - 1);
}
} else if (keycode === KEYCODE_RIGHTARROW) {
if (this.currentImageIndex !== this.album.length - 1) {
this.changeImage(this.currentImageIndex + 1);
} else if (this.options.wrapAround && this.album.length > 1) {
this.changeImage(0);
}
}
};
// Closing time. :-(
Lightbox.prototype.end = function () {
this.disableKeyboardNav();
$(window).off('resize', this.sizeOverlay);
this.$lightbox.fadeOut(this.options.fadeDuration);
this.$overlay.fadeOut(this.options.fadeDuration);
if (this.options.disableScrolling) {
$('body').removeClass('lb-disable-scrolling');
}
};
return new Lightbox();
}));
/*!
* Chart.js v2.8.0
* https://www.chartjs.org
* (c) 2019 Chart.js Contributors
* Released under the MIT License
*/
!function (t, e) { "object" == typeof exports && "undefined" != typeof module ? module.exports = e(function () { try { return require("moment") } catch (t) { } }()) : "function" == typeof define && define.amd ? define(["require"], function (t) { return e(function () { try { return t("moment") } catch (t) { } }()) }) : t.Chart = e(t.moment) }(this, function (t) { "use strict"; t = t && t.hasOwnProperty("default") ? t.default : t; var e = { rgb2hsl: i, rgb2hsv: n, rgb2hwb: a, rgb2cmyk: o, rgb2keyword: s, rgb2xyz: l, rgb2lab: d, rgb2lch: function (t) { return x(d(t)) }, hsl2rgb: u, hsl2hsv: function (t) { var e = t[0], i = t[1] / 100, n = t[2] / 100; if (0 === n) return [0, 0, 0]; return [e, 100 * (2 * (i *= (n *= 2) <= 1 ? n : 2 - n) / (n + i)), 100 * ((n + i) / 2)] }, hsl2hwb: function (t) { return a(u(t)) }, hsl2cmyk: function (t) { return o(u(t)) }, hsl2keyword: function (t) { return s(u(t)) }, hsv2rgb: h, hsv2hsl: function (t) { var e, i, n = t[0], a = t[1] / 100, o = t[2] / 100; return e = a * o, [n, 100 * (e = (e /= (i = (2 - a) * o) <= 1 ? i : 2 - i) || 0), 100 * (i /= 2)] }, hsv2hwb: function (t) { return a(h(t)) }, hsv2cmyk: function (t) { return o(h(t)) }, hsv2keyword: function (t) { return s(h(t)) }, hwb2rgb: c, hwb2hsl: function (t) { return i(c(t)) }, hwb2hsv: function (t) { return n(c(t)) }, hwb2cmyk: function (t) { return o(c(t)) }, hwb2keyword: function (t) { return s(c(t)) }, cmyk2rgb: f, cmyk2hsl: function (t) { return i(f(t)) }, cmyk2hsv: function (t) { return n(f(t)) }, cmyk2hwb: function (t) { return a(f(t)) }, cmyk2keyword: function (t) { return s(f(t)) }, keyword2rgb: w, keyword2hsl: function (t) { return i(w(t)) }, keyword2hsv: function (t) { return n(w(t)) }, keyword2hwb: function (t) { return a(w(t)) }, keyword2cmyk: function (t) { return o(w(t)) }, keyword2lab: function (t) { return d(w(t)) }, keyword2xyz: function (t) { return l(w(t)) }, xyz2rgb: p, xyz2lab: m, xyz2lch: function (t) { return x(m(t)) }, lab2xyz: v, lab2rgb: y, lab2lch: x, lch2lab: k, lch2xyz: function (t) { return v(k(t)) }, lch2rgb: function (t) { return y(k(t)) } }; function i(t) { var e, i, n = t[0] / 255, a = t[1] / 255, o = t[2] / 255, r = Math.min(n, a, o), s = Math.max(n, a, o), l = s - r; return s == r ? e = 0 : n == s ? e = (a - o) / l : a == s ? e = 2 + (o - n) / l : o == s && (e = 4 + (n - a) / l), (e = Math.min(60 * e, 360)) < 0 && (e += 360), i = (r + s) / 2, [e, 100 * (s == r ? 0 : i <= .5 ? l / (s + r) : l / (2 - s - r)), 100 * i] } function n(t) { var e, i, n = t[0], a = t[1], o = t[2], r = Math.min(n, a, o), s = Math.max(n, a, o), l = s - r; return i = 0 == s ? 0 : l / s * 1e3 / 10, s == r ? e = 0 : n == s ? e = (a - o) / l : a == s ? e = 2 + (o - n) / l : o == s && (e = 4 + (n - a) / l), (e = Math.min(60 * e, 360)) < 0 && (e += 360), [e, i, s / 255 * 1e3 / 10] } function a(t) { var e = t[0], n = t[1], a = t[2]; return [i(t)[0], 100 * (1 / 255 * Math.min(e, Math.min(n, a))), 100 * (a = 1 - 1 / 255 * Math.max(e, Math.max(n, a)))] } function o(t) { var e, i = t[0] / 255, n = t[1] / 255, a = t[2] / 255; return [100 * ((1 - i - (e = Math.min(1 - i, 1 - n, 1 - a))) / (1 - e) || 0), 100 * ((1 - n - e) / (1 - e) || 0), 100 * ((1 - a - e) / (1 - e) || 0), 100 * e] } function s(t) { return _[JSON.stringify(t)] } function l(t) { var e = t[0] / 255, i = t[1] / 255, n = t[2] / 255; return [100 * (.4124 * (e = e > .04045 ? Math.pow((e + .055) / 1.055, 2.4) : e / 12.92) + .3576 * (i = i > .04045 ? Math.pow((i + .055) / 1.055, 2.4) : i / 12.92) + .1805 * (n = n > .04045 ? Math.pow((n + .055) / 1.055, 2.4) : n / 12.92)), 100 * (.2126 * e + .7152 * i + .0722 * n), 100 * (.0193 * e + .1192 * i + .9505 * n)] } function d(t) { var e = l(t), i = e[0], n = e[1], a = e[2]; return n /= 100, a /= 108.883, i = (i /= 95.047) > .008856 ? Math.pow(i, 1 / 3) : 7.787 * i + 16 / 116, [116 * (n = n > .008856 ? Math.pow(n, 1 / 3) : 7.787 * n + 16 / 116) - 16, 500 * (i - n), 200 * (n - (a = a > .008856 ? Math.pow(a, 1 / 3) : 7.787 * a + 16 / 116))] } function u(t) { var e, i, n, a, o, r = t[0] / 360, s = t[1] / 100, l = t[2] / 100; if (0 == s) return [o = 255 * l, o, o]; e = 2 * l - (i = l < .5 ? l * (1 + s) : l + s - l * s), a = [0, 0, 0]; for (var d = 0; d < 3; d++)(n = r + 1 / 3 * -(d - 1)) < 0 && n++, n > 1 && n--, o = 6 * n < 1 ? e + 6 * (i - e) * n : 2 * n < 1 ? i : 3 * n < 2 ? e + (i - e) * (2 / 3 - n) * 6 : e, a[d] = 255 * o; return a } function h(t) { var e = t[0] / 60, i = t[1] / 100, n = t[2] / 100, a = Math.floor(e) % 6, o = e - Math.floor(e), r = 255 * n * (1 - i), s = 255 * n * (1 - i * o), l = 255 * n * (1 - i * (1 - o)); n *= 255; switch (a) { case 0: return [n, l, r]; case 1: return [s, n, r]; case 2: return [r, n, l]; case 3: return [r, s, n]; case 4: return [l, r, n]; case 5: return [n, r, s] } } function c(t) { var e, i, n, a, o = t[0] / 360, s = t[1] / 100, l = t[2] / 100, d = s + l; switch (d > 1 && (s /= d, l /= d), n = 6 * o - (e = Math.floor(6 * o)), 0 != (1 & e) && (n = 1 - n), a = s + n * ((i = 1 - l) - s), e) { default: case 6: case 0: r = i, g = a, b = s; break; case 1: r = a, g = i, b = s; break; case 2: r = s, g = i, b = a; break; case 3: r = s, g = a, b = i; break; case 4: r = a, g = s, b = i; break; case 5: r = i, g = s, b = a }return [255 * r, 255 * g, 255 * b] } function f(t) { var e = t[0] / 100, i = t[1] / 100, n = t[2] / 100, a = t[3] / 100; return [255 * (1 - Math.min(1, e * (1 - a) + a)), 255 * (1 - Math.min(1, i * (1 - a) + a)), 255 * (1 - Math.min(1, n * (1 - a) + a))] } function p(t) { var e, i, n, a = t[0] / 100, o = t[1] / 100, r = t[2] / 100; return i = -.9689 * a + 1.8758 * o + .0415 * r, n = .0557 * a + -.204 * o + 1.057 * r, e = (e = 3.2406 * a + -1.5372 * o + -.4986 * r) > .0031308 ? 1.055 * Math.pow(e, 1 / 2.4) - .055 : e *= 12.92, i = i > .0031308 ? 1.055 * Math.pow(i, 1 / 2.4) - .055 : i *= 12.92, n = n > .0031308 ? 1.055 * Math.pow(n, 1 / 2.4) - .055 : n *= 12.92, [255 * (e = Math.min(Math.max(0, e), 1)), 255 * (i = Math.min(Math.max(0, i), 1)), 255 * (n = Math.min(Math.max(0, n), 1))] } function m(t) { var e = t[0], i = t[1], n = t[2]; return i /= 100, n /= 108.883, e = (e /= 95.047) > .008856 ? Math.pow(e, 1 / 3) : 7.787 * e + 16 / 116, [116 * (i = i > .008856 ? Math.pow(i, 1 / 3) : 7.787 * i + 16 / 116) - 16, 500 * (e - i), 200 * (i - (n = n > .008856 ? Math.pow(n, 1 / 3) : 7.787 * n + 16 / 116))] } function v(t) { var e, i, n, a, o = t[0], r = t[1], s = t[2]; return o <= 8 ? a = (i = 100 * o / 903.3) / 100 * 7.787 + 16 / 116 : (i = 100 * Math.pow((o + 16) / 116, 3), a = Math.pow(i / 100, 1 / 3)), [e = e / 95.047 <= .008856 ? e = 95.047 * (r / 500 + a - 16 / 116) / 7.787 : 95.047 * Math.pow(r / 500 + a, 3), i, n = n / 108.883 <= .008859 ? n = 108.883 * (a - s / 200 - 16 / 116) / 7.787 : 108.883 * Math.pow(a - s / 200, 3)] } function x(t) { var e, i = t[0], n = t[1], a = t[2]; return (e = 360 * Math.atan2(a, n) / 2 / Math.PI) < 0 && (e += 360), [i, Math.sqrt(n * n + a * a), e] } function y(t) { return p(v(t)) } function k(t) { var e, i = t[0], n = t[1]; return e = t[2] / 360 * 2 * Math.PI, [i, n * Math.cos(e), n * Math.sin(e)] } function w(t) { return M[t] } var M = { aliceblue: [240, 248, 255], antiquewhite: [250, 235, 215], aqua: [0, 255, 255], aquamarine: [127, 255, 212], azure: [240, 255, 255], beige: [245, 245, 220], bisque: [255, 228, 196], black: [0, 0, 0], blanchedalmond: [255, 235, 205], blue: [0, 0, 255], blueviolet: [138, 43, 226], brown: [165, 42, 42], burlywood: [222, 184, 135], cadetblue: [95, 158, 160], chartreuse: [127, 255, 0], chocolate: [210, 105, 30], coral: [255, 127, 80], cornflowerblue: [100, 149, 237], cornsilk: [255, 248, 220], crimson: [220, 20, 60], cyan: [0, 255, 255], darkblue: [0, 0, 139], darkcyan: [0, 139, 139], darkgoldenrod: [184, 134, 11], darkgray: [169, 169, 169], darkgreen: [0, 100, 0], darkgrey: [169, 169, 169], darkkhaki: [189, 183, 107], darkmagenta: [139, 0, 139], darkolivegreen: [85, 107, 47], darkorange: [255, 140, 0], darkorchid: [153, 50, 204], darkred: [139, 0, 0], darksalmon: [233, 150, 122], darkseagreen: [143, 188, 143], darkslateblue: [72, 61, 139], darkslategray: [47, 79, 79], darkslategrey: [47, 79, 79], darkturquoise: [0, 206, 209], darkviolet: [148, 0, 211], deeppink: [255, 20, 147], deepskyblue: [0, 191, 255], dimgray: [105, 105, 105], dimgrey: [105, 105, 105], dodgerblue: [30, 144, 255], firebrick: [178, 34, 34], floralwhite: [255, 250, 240], forestgreen: [34, 139, 34], fuchsia: [255, 0, 255], gainsboro: [220, 220, 220], ghostwhite: [248, 248, 255], gold: [255, 215, 0], goldenrod: [218, 165, 32], gray: [128, 128, 128], green: [0, 128, 0], greenyellow: [173, 255, 47], grey: [128, 128, 128], honeydew: [240, 255, 240], hotpink: [255, 105, 180], indianred: [205, 92, 92], indigo: [75, 0, 130], ivory: [255, 255, 240], khaki: [240, 230, 140], lavender: [230, 230, 250], lavenderblush: [255, 240, 245], lawngreen: [124, 252, 0], lemonchiffon: [255, 250, 205], lightblue: [173, 216, 230], lightcoral: [240, 128, 128], lightcyan: [224, 255, 255], lightgoldenrodyellow: [250, 250, 210], lightgray: [211, 211, 211], lightgreen: [144, 238, 144], lightgrey: [211, 211, 211], lightpink: [255, 182, 193], lightsalmon: [255, 160, 122], lightseagreen: [32, 178, 170], lightskyblue: [135, 206, 250], lightslategray: [119, 136, 153], lightslategrey: [119, 136, 153], lightsteelblue: [176, 196, 222], lightyellow: [255, 255, 224], lime: [0, 255, 0], limegreen: [50, 205, 50], linen: [250, 240, 230], magenta: [255, 0, 255], maroon: [128, 0, 0], mediumaquamarine: [102, 205, 170], mediumblue: [0, 0, 205], mediumorchid: [186, 85, 211], mediumpurple: [147, 112, 219], mediumseagreen: [60, 179, 113], mediumslateblue: [123, 104, 238], mediumspringgreen: [0, 250, 154], mediumturquoise: [72, 209, 204], mediumvioletred: [199, 21, 133], midnightblue: [25, 25, 112], mintcream: [245, 255, 250], mistyrose: [255, 228, 225], moccasin: [255, 228, 181], navajowhite: [255, 222, 173], navy: [0, 0, 128], oldlace: [253, 245, 230], olive: [128, 128, 0], olivedrab: [107, 142, 35], orange: [255, 165, 0], orangered: [255, 69, 0], orchid: [218, 112, 214], palegoldenrod: [238, 232, 170], palegreen: [152, 251, 152], paleturquoise: [175, 238, 238], palevioletred: [219, 112, 147], papayawhip: [255, 239, 213], peachpuff: [255, 218, 185], peru: [205, 133, 63], pink: [255, 192, 203], plum: [221, 160, 221], powderblue: [176, 224, 230], purple: [128, 0, 128], rebeccapurple: [102, 51, 153], red: [255, 0, 0], rosybrown: [188, 143, 143], royalblue: [65, 105, 225], saddlebrown: [139, 69, 19], salmon: [250, 128, 114], sandybrown: [244, 164, 96], seagreen: [46, 139, 87], seashell: [255, 245, 238], sienna: [160, 82, 45], silver: [192, 192, 192], skyblue: [135, 206, 235], slateblue: [106, 90, 205], slategray: [112, 128, 144], slategrey: [112, 128, 144], snow: [255, 250, 250], springgreen: [0, 255, 127], steelblue: [70, 130, 180], tan: [210, 180, 140], teal: [0, 128, 128], thistle: [216, 191, 216], tomato: [255, 99, 71], turquoise: [64, 224, 208], violet: [238, 130, 238], wheat: [245, 222, 179], white: [255, 255, 255], whitesmoke: [245, 245, 245], yellow: [255, 255, 0], yellowgreen: [154, 205, 50] }, _ = {}; for (var C in M) _[JSON.stringify(M[C])] = C; var S = function () { return new T }; for (var P in e) { S[P + "Raw"] = function (t) { return function (i) { return "number" == typeof i && (i = Array.prototype.slice.call(arguments)), e[t](i) } }(P); var I = /(\w+)2(\w+)/.exec(P), A = I[1], D = I[2]; (S[A] = S[A] || {})[D] = S[P] = function (t) { return function (i) { "number" == typeof i && (i = Array.prototype.slice.call(arguments)); var n = e[t](i); if ("string" == typeof n || void 0 === n) return n; for (var a = 0; a < n.length; a++)n[a] = Math.round(n[a]); return n } }(P) } var T = function () { this.convs = {} }; T.prototype.routeSpace = function (t, e) { var i = e[0]; return void 0 === i ? this.getValues(t) : ("number" == typeof i && (i = Array.prototype.slice.call(e)), this.setValues(t, i)) }, T.prototype.setValues = function (t, e) { return this.space = t, this.convs = {}, this.convs[t] = e, this }, T.prototype.getValues = function (t) { var e = this.convs[t]; if (!e) { var i = this.space, n = this.convs[i]; e = S[i][t](n), this.convs[t] = e } return e }, ["rgb", "hsl", "hsv", "cmyk", "keyword"].forEach(function (t) { T.prototype[t] = function (e) { return this.routeSpace(t, arguments) } }); var F = S, L = { aliceblue: [240, 248, 255], antiquewhite: [250, 235, 215], aqua: [0, 255, 255], aquamarine: [127, 255, 212], azure: [240, 255, 255], beige: [245, 245, 220], bisque: [255, 228, 196], black: [0, 0, 0], blanchedalmond: [255, 235, 205], blue: [0, 0, 255], blueviolet: [138, 43, 226], brown: [165, 42, 42], burlywood: [222, 184, 135], cadetblue: [95, 158, 160], chartreuse: [127, 255, 0], chocolate: [210, 105, 30], coral: [255, 127, 80], cornflowerblue: [100, 149, 237], cornsilk: [255, 248, 220], crimson: [220, 20, 60], cyan: [0, 255, 255], darkblue: [0, 0, 139], darkcyan: [0, 139, 139], darkgoldenrod: [184, 134, 11], darkgray: [169, 169, 169], darkgreen: [0, 100, 0], darkgrey: [169, 169, 169], darkkhaki: [189, 183, 107], darkmagenta: [139, 0, 139], darkolivegreen: [85, 107, 47], darkorange: [255, 140, 0], darkorchid: [153, 50, 204], darkred: [139, 0, 0], darksalmon: [233, 150, 122], darkseagreen: [143, 188, 143], darkslateblue: [72, 61, 139], darkslategray: [47, 79, 79], darkslategrey: [47, 79, 79], darkturquoise: [0, 206, 209], darkviolet: [148, 0, 211], deeppink: [255, 20, 147], deepskyblue: [0, 191, 255], dimgray: [105, 105, 105], dimgrey: [105, 105, 105], dodgerblue: [30, 144, 255], firebrick: [178, 34, 34], floralwhite: [255, 250, 240], forestgreen: [34, 139, 34], fuchsia: [255, 0, 255], gainsboro: [220, 220, 220], ghostwhite: [248, 248, 255], gold: [255, 215, 0], goldenrod: [218, 165, 32], gray: [128, 128, 128], green: [0, 128, 0], greenyellow: [173, 255, 47], grey: [128, 128, 128], honeydew: [240, 255, 240], hotpink: [255, 105, 180], indianred: [205, 92, 92], indigo: [75, 0, 130], ivory: [255, 255, 240], khaki: [240, 230, 140], lavender: [230, 230, 250], lavenderblush: [255, 240, 245], lawngreen: [124, 252, 0], lemonchiffon: [255, 250, 205], lightblue: [173, 216, 230], lightcoral: [240, 128, 128], lightcyan: [224, 255, 255], lightgoldenrodyellow: [250, 250, 210], lightgray: [211, 211, 211], lightgreen: [144, 238, 144], lightgrey: [211, 211, 211], lightpink: [255, 182, 193], lightsalmon: [255, 160, 122], lightseagreen: [32, 178, 170], lightskyblue: [135, 206, 250], lightslategray: [119, 136, 153], lightslategrey: [119, 136, 153], lightsteelblue: [176, 196, 222], lightyellow: [255, 255, 224], lime: [0, 255, 0], limegreen: [50, 205, 50], linen: [250, 240, 230], magenta: [255, 0, 255], maroon: [128, 0, 0], mediumaquamarine: [102, 205, 170], mediumblue: [0, 0, 205], mediumorchid: [186, 85, 211], mediumpurple: [147, 112, 219], mediumseagreen: [60, 179, 113], mediumslateblue: [123, 104, 238], mediumspringgreen: [0, 250, 154], mediumturquoise: [72, 209, 204], mediumvioletred: [199, 21, 133], midnightblue: [25, 25, 112], mintcream: [245, 255, 250], mistyrose: [255, 228, 225], moccasin: [255, 228, 181], navajowhite: [255, 222, 173], navy: [0, 0, 128], oldlace: [253, 245, 230], olive: [128, 128, 0], olivedrab: [107, 142, 35], orange: [255, 165, 0], orangered: [255, 69, 0], orchid: [218, 112, 214], palegoldenrod: [238, 232, 170], palegreen: [152, 251, 152], paleturquoise: [175, 238, 238], palevioletred: [219, 112, 147], papayawhip: [255, 239, 213], peachpuff: [255, 218, 185], peru: [205, 133, 63], pink: [255, 192, 203], plum: [221, 160, 221], powderblue: [176, 224, 230], purple: [128, 0, 128], rebeccapurple: [102, 51, 153], red: [255, 0, 0], rosybrown: [188, 143, 143], royalblue: [65, 105, 225], saddlebrown: [139, 69, 19], salmon: [250, 128, 114], sandybrown: [244, 164, 96], seagreen: [46, 139, 87], seashell: [255, 245, 238], sienna: [160, 82, 45], silver: [192, 192, 192], skyblue: [135, 206, 235], slateblue: [106, 90, 205], slategray: [112, 128, 144], slategrey: [112, 128, 144], snow: [255, 250, 250], springgreen: [0, 255, 127], steelblue: [70, 130, 180], tan: [210, 180, 140], teal: [0, 128, 128], thistle: [216, 191, 216], tomato: [255, 99, 71], turquoise: [64, 224, 208], violet: [238, 130, 238], wheat: [245, 222, 179], white: [255, 255, 255], whitesmoke: [245, 245, 245], yellow: [255, 255, 0], yellowgreen: [154, 205, 50] }, R = { getRgba: O, getHsla: z, getRgb: function (t) { var e = O(t); return e && e.slice(0, 3) }, getHsl: function (t) { var e = z(t); return e && e.slice(0, 3) }, getHwb: B, getAlpha: function (t) { var e = O(t); if (e) return e[3]; if (e = z(t)) return e[3]; if (e = B(t)) return e[3] }, hexString: function (t, e) { var e = void 0 !== e && 3 === t.length ? e : t[3]; return "#" + H(t[0]) + H(t[1]) + H(t[2]) + (e >= 0 && e < 1 ? H(Math.round(255 * e)) : "") }, rgbString: function (t, e) { if (e < 1 || t[3] && t[3] < 1) return N(t, e); return "rgb(" + t[0] + ", " + t[1] + ", " + t[2] + ")" }, rgbaString: N, percentString: function (t, e) { if (e < 1 || t[3] && t[3] < 1) return W(t, e); var i = Math.round(t[0] / 255 * 100), n = Math.round(t[1] / 255 * 100), a = Math.round(t[2] / 255 * 100); return "rgb(" + i + "%, " + n + "%, " + a + "%)" }, percentaString: W, hslString: function (t, e) { if (e < 1 || t[3] && t[3] < 1) return V(t, e); return "hsl(" + t[0] + ", " + t[1] + "%, " + t[2] + "%)" }, hslaString: V, hwbString: function (t, e) { void 0 === e && (e = void 0 !== t[3] ? t[3] : 1); return "hwb(" + t[0] + ", " + t[1] + "%, " + t[2] + "%" + (void 0 !== e && 1 !== e ? ", " + e : "") + ")" }, keyword: function (t) { return j[t.slice(0, 3)] } }; function O(t) { if (t) { var e = [0, 0, 0], i = 1, n = t.match(/^#([a-fA-F0-9]{3,4})$/i), a = ""; if (n) { a = (n = n[1])[3]; for (var o = 0; o < e.length; o++)e[o] = parseInt(n[o] + n[o], 16); a && (i = Math.round(parseInt(a + a, 16) / 255 * 100) / 100) } else if (n = t.match(/^#([a-fA-F0-9]{6}([a-fA-F0-9]{2})?)$/i)) { a = n[2], n = n[1]; for (o = 0; o < e.length; o++)e[o] = parseInt(n.slice(2 * o, 2 * o + 2), 16); a && (i = Math.round(parseInt(a, 16) / 255 * 100) / 100) } else if (n = t.match(/^rgba?\(\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/i)) { for (o = 0; o < e.length; o++)e[o] = parseInt(n[o + 1]); i = parseFloat(n[4]) } else if (n = t.match(/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/i)) { for (o = 0; o < e.length; o++)e[o] = Math.round(2.55 * parseFloat(n[o + 1])); i = parseFloat(n[4]) } else if (n = t.match(/(\w+)/)) { if ("transparent" == n[1]) return [0, 0, 0, 0]; if (!(e = L[n[1]])) return } for (o = 0; o < e.length; o++)e[o] = E(e[o], 0, 255); return i = i || 0 == i ? E(i, 0, 1) : 1, e[3] = i, e } } function z(t) { if (t) { var e = t.match(/^hsla?\(\s*([+-]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)/); if (e) { var i = parseFloat(e[4]); return [E(parseInt(e[1]), 0, 360), E(parseFloat(e[2]), 0, 100), E(parseFloat(e[3]), 0, 100), E(isNaN(i) ? 1 : i, 0, 1)] } } } function B(t) { if (t) { var e = t.match(/^hwb\(\s*([+-]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)/); if (e) { var i = parseFloat(e[4]); return [E(parseInt(e[1]), 0, 360), E(parseFloat(e[2]), 0, 100), E(parseFloat(e[3]), 0, 100), E(isNaN(i) ? 1 : i, 0, 1)] } } } function N(t, e) { return void 0 === e && (e = void 0 !== t[3] ? t[3] : 1), "rgba(" + t[0] + ", " + t[1] + ", " + t[2] + ", " + e + ")" } function W(t, e) { return "rgba(" + Math.round(t[0] / 255 * 100) + "%, " + Math.round(t[1] / 255 * 100) + "%, " + Math.round(t[2] / 255 * 100) + "%, " + (e || t[3] || 1) + ")" } function V(t, e) { return void 0 === e && (e = void 0 !== t[3] ? t[3] : 1), "hsla(" + t[0] + ", " + t[1] + "%, " + t[2] + "%, " + e + ")" } function E(t, e, i) { return Math.min(Math.max(e, t), i) } function H(t) { var e = t.toString(16).toUpperCase(); return e.length < 2 ? "0" + e : e } var j = {}; for (var q in L) j[L[q]] = q; var Y = function (t) { return t instanceof Y ? t : this instanceof Y ? (this.valid = !1, this.values = { rgb: [0, 0, 0], hsl: [0, 0, 0], hsv: [0, 0, 0], hwb: [0, 0, 0], cmyk: [0, 0, 0, 0], alpha: 1 }, void ("string" == typeof t ? (e = R.getRgba(t)) ? this.setValues("rgb", e) : (e = R.getHsla(t)) ? this.setValues("hsl", e) : (e = R.getHwb(t)) && this.setValues("hwb", e) : "object" == typeof t && (void 0 !== (e = t).r || void 0 !== e.red ? this.setValues("rgb", e) : void 0 !== e.l || void 0 !== e.lightness ? this.setValues("hsl", e) : void 0 !== e.v || void 0 !== e.value ? this.setValues("hsv", e) : void 0 !== e.w || void 0 !== e.whiteness ? this.setValues("hwb", e) : void 0 === e.c && void 0 === e.cyan || this.setValues("cmyk", e)))) : new Y(t); var e }; Y.prototype = { isValid: function () { return this.valid }, rgb: function () { return this.setSpace("rgb", arguments) }, hsl: function () { return this.setSpace("hsl", arguments) }, hsv: function () { return this.setSpace("hsv", arguments) }, hwb: function () { return this.setSpace("hwb", arguments) }, cmyk: function () { return this.setSpace("cmyk", arguments) }, rgbArray: function () { return this.values.rgb }, hslArray: function () { return this.values.hsl }, hsvArray: function () { return this.values.hsv }, hwbArray: function () { var t = this.values; return 1 !== t.alpha ? t.hwb.concat([t.alpha]) : t.hwb }, cmykArray: function () { return this.values.cmyk }, rgbaArray: function () { var t = this.values; return t.rgb.concat([t.alpha]) }, hslaArray: function () { var t = this.values; return t.hsl.concat([t.alpha]) }, alpha: function (t) { return void 0 === t ? this.values.alpha : (this.setValues("alpha", t), this) }, red: function (t) { return this.setChannel("rgb", 0, t) }, green: function (t) { return this.setChannel("rgb", 1, t) }, blue: function (t) { return this.setChannel("rgb", 2, t) }, hue: function (t) { return t && (t = (t %= 360) < 0 ? 360 + t : t), this.setChannel("hsl", 0, t) }, saturation: function (t) { return this.setChannel("hsl", 1, t) }, lightness: function (t) { return this.setChannel("hsl", 2, t) }, saturationv: function (t) { return this.setChannel("hsv", 1, t) }, whiteness: function (t) { return this.setChannel("hwb", 1, t) }, blackness: function (t) { return this.setChannel("hwb", 2, t) }, value: function (t) { return this.setChannel("hsv", 2, t) }, cyan: function (t) { return this.setChannel("cmyk", 0, t) }, magenta: function (t) { return this.setChannel("cmyk", 1, t) }, yellow: function (t) { return this.setChannel("cmyk", 2, t) }, black: function (t) { return this.setChannel("cmyk", 3, t) }, hexString: function () { return R.hexString(this.values.rgb) }, rgbString: function () { return R.rgbString(this.values.rgb, this.values.alpha) }, rgbaString: function () { return R.rgbaString(this.values.rgb, this.values.alpha) }, percentString: function () { return R.percentString(this.values.rgb, this.values.alpha) }, hslString: function () { return R.hslString(this.values.hsl, this.values.alpha) }, hslaString: function () { return R.hslaString(this.values.hsl, this.values.alpha) }, hwbString: function () { return R.hwbString(this.values.hwb, this.values.alpha) }, keyword: function () { return R.keyword(this.values.rgb, this.values.alpha) }, rgbNumber: function () { var t = this.values.rgb; return t[0] << 16 | t[1] << 8 | t[2] }, luminosity: function () { for (var t = this.values.rgb, e = [], i = 0; i < t.length; i++) { var n = t[i] / 255; e[i] = n <= .03928 ? n / 12.92 : Math.pow((n + .055) / 1.055, 2.4) } return .2126 * e[0] + .7152 * e[1] + .0722 * e[2] }, contrast: function (t) { var e = this.luminosity(), i = t.luminosity(); return e > i ? (e + .05) / (i + .05) : (i + .05) / (e + .05) }, level: function (t) { var e = this.contrast(t); return e >= 7.1 ? "AAA" : e >= 4.5 ? "AA" : "" }, dark: function () { var t = this.values.rgb; return (299 * t[0] + 587 * t[1] + 114 * t[2]) / 1e3 < 128 }, light: function () { return !this.dark() }, negate: function () { for (var t = [], e = 0; e < 3; e++)t[e] = 255 - this.values.rgb[e]; return this.setValues("rgb", t), this }, lighten: function (t) { var e = this.values.hsl; return e[2] += e[2] * t, this.setValues("hsl", e), this }, darken: function (t) { var e = this.values.hsl; return e[2] -= e[2] * t, this.setValues("hsl", e), this }, saturate: function (t) { var e = this.values.hsl; return e[1] += e[1] * t, this.setValues("hsl", e), this }, desaturate: function (t) { var e = this.values.hsl; return e[1] -= e[1] * t, this.setValues("hsl", e), this }, whiten: function (t) { var e = this.values.hwb; return e[1] += e[1] * t, this.setValues("hwb", e), this }, blacken: function (t) { var e = this.values.hwb; return e[2] += e[2] * t, this.setValues("hwb", e), this }, greyscale: function () { var t = this.values.rgb, e = .3 * t[0] + .59 * t[1] + .11 * t[2]; return this.setValues("rgb", [e, e, e]), this }, clearer: function (t) { var e = this.values.alpha; return this.setValues("alpha", e - e * t), this }, opaquer: function (t) { var e = this.values.alpha; return this.setValues("alpha", e + e * t), this }, rotate: function (t) { var e = this.values.hsl, i = (e[0] + t) % 360; return e[0] = i < 0 ? 360 + i : i, this.setValues("hsl", e), this }, mix: function (t, e) { var i = t, n = void 0 === e ? .5 : e, a = 2 * n - 1, o = this.alpha() - i.alpha(), r = ((a * o == -1 ? a : (a + o) / (1 + a * o)) + 1) / 2, s = 1 - r; return this.rgb(r * this.red() + s * i.red(), r * this.green() + s * i.green(), r * this.blue() + s * i.blue()).alpha(this.alpha() * n + i.alpha() * (1 - n)) }, toJSON: function () { return this.rgb() }, clone: function () { var t, e, i = new Y, n = this.values, a = i.values; for (var o in n) n.hasOwnProperty(o) && (t = n[o], "[object Array]" === (e = {}.toString.call(t)) ? a[o] = t.slice(0) : "[object Number]" === e ? a[o] = t : console.error("unexpected color value:", t)); return i } }, Y.prototype.spaces = { rgb: ["red", "green", "blue"], hsl: ["hue", "saturation", "lightness"], hsv: ["hue", "saturation", "value"], hwb: ["hue", "whiteness", "blackness"], cmyk: ["cyan", "magenta", "yellow", "black"] }, Y.prototype.maxes = { rgb: [255, 255, 255], hsl: [360, 100, 100], hsv: [360, 100, 100], hwb: [360, 100, 100], cmyk: [100, 100, 100, 100] }, Y.prototype.getValues = function (t) { for (var e = this.values, i = {}, n = 0; n < t.length; n++)i[t.charAt(n)] = e[t][n]; return 1 !== e.alpha && (i.a = e.alpha), i }, Y.prototype.setValues = function (t, e) { var i, n, a = this.values, o = this.spaces, r = this.maxes, s = 1; if (this.valid = !0, "alpha" === t) s = e; else if (e.length) a[t] = e.slice(0, t.length), s = e[t.length]; else if (void 0 !== e[t.charAt(0)]) { for (i = 0; i < t.length; i++)a[t][i] = e[t.charAt(i)]; s = e.a } else if (void 0 !== e[o[t][0]]) { var l = o[t]; for (i = 0; i < t.length; i++)a[t][i] = e[l[i]]; s = e.alpha } if (a.alpha = Math.max(0, Math.min(1, void 0 === s ? a.alpha : s)), "alpha" === t) return !1; for (i = 0; i < t.length; i++)n = Math.max(0, Math.min(r[t][i], a[t][i])), a[t][i] = Math.round(n); for (var d in o) d !== t && (a[d] = F[t][d](a[t])); return !0 }, Y.prototype.setSpace = function (t, e) { var i = e[0]; return void 0 === i ? this.getValues(t) : ("number" == typeof i && (i = Array.prototype.slice.call(e)), this.setValues(t, i), this) }, Y.prototype.setChannel = function (t, e, i) { var n = this.values[t]; return void 0 === i ? n[e] : i === n[e] ? this : (n[e] = i, this.setValues(t, n), this) }, "undefined" != typeof window && (window.Color = Y); var U, X = Y, K = { noop: function () { }, uid: (U = 0, function () { return U++ }), isNullOrUndef: function (t) { return null == t }, isArray: function (t) { if (Array.isArray && Array.isArray(t)) return !0; var e = Object.prototype.toString.call(t); return "[object" === e.substr(0, 7) && "Array]" === e.substr(-6) }, isObject: function (t) { return null !== t && "[object Object]" === Object.prototype.toString.call(t) }, isFinite: function (t) { return ("number" == typeof t || t instanceof Number) && isFinite(t) }, valueOrDefault: function (t, e) { return void 0 === t ? e : t }, valueAtIndexOrDefault: function (t, e, i) { return K.valueOrDefault(K.isArray(t) ? t[e] : t, i) }, callback: function (t, e, i) { if (t && "function" == typeof t.call) return t.apply(i, e) }, each: function (t, e, i, n) { var a, o, r; if (K.isArray(t)) if (o = t.length, n) for (a = o - 1; a >= 0; a--)e.call(i, t[a], a); else for (a = 0; a < o; a++)e.call(i, t[a], a); else if (K.isObject(t)) for (o = (r = Object.keys(t)).length, a = 0; a < o; a++)e.call(i, t[r[a]], r[a]) }, arrayEquals: function (t, e) { var i, n, a, o; if (!t || !e || t.length !== e.length) return !1; for (i = 0, n = t.length; i < n; ++i)if (a = t[i], o = e[i], a instanceof Array && o instanceof Array) { if (!K.arrayEquals(a, o)) return !1 } else if (a !== o) return !1; return !0 }, clone: function (t) { if (K.isArray(t)) return t.map(K.clone); if (K.isObject(t)) { for (var e = {}, i = Object.keys(t), n = i.length, a = 0; a < n; ++a)e[i[a]] = K.clone(t[i[a]]); return e } return t }, _merger: function (t, e, i, n) { var a = e[t], o = i[t]; K.isObject(a) && K.isObject(o) ? K.merge(a, o, n) : e[t] = K.clone(o) }, _mergerIf: function (t, e, i) { var n = e[t], a = i[t]; K.isObject(n) && K.isObject(a) ? K.mergeIf(n, a) : e.hasOwnProperty(t) || (e[t] = K.clone(a)) }, merge: function (t, e, i) { var n, a, o, r, s, l = K.isArray(e) ? e : [e], d = l.length; if (!K.isObject(t)) return t; for (n = (i = i || {}).merger || K._merger, a = 0; a < d; ++a)if (e = l[a], K.isObject(e)) for (s = 0, r = (o = Object.keys(e)).length; s < r; ++s)n(o[s], t, e, i); return t }, mergeIf: function (t, e) { return K.merge(t, e, { merger: K._mergerIf }) }, extend: function (t) { for (var e = function (e, i) { t[i] = e }, i = 1, n = arguments.length; i < n; ++i)K.each(arguments[i], e); return t }, inherits: function (t) { var e = this, i = t && t.hasOwnProperty("constructor") ? t.constructor : function () { return e.apply(this, arguments) }, n = function () { this.constructor = i }; return n.prototype = e.prototype, i.prototype = new n, i.extend = K.inherits, t && K.extend(i.prototype, t), i.__super__ = e.prototype, i } }, G = K; K.callCallback = K.callback, K.indexOf = function (t, e, i) { return Array.prototype.indexOf.call(t, e, i) }, K.getValueOrDefault = K.valueOrDefault, K.getValueAtIndexOrDefault = K.valueAtIndexOrDefault; var Z = { linear: function (t) { return t }, easeInQuad: function (t) { return t * t }, easeOutQuad: function (t) { return -t * (t - 2) }, easeInOutQuad: function (t) { return (t /= .5) < 1 ? .5 * t * t : -.5 * (--t * (t - 2) - 1) }, easeInCubic: function (t) { return t * t * t }, easeOutCubic: function (t) { return (t -= 1) * t * t + 1 }, easeInOutCubic: function (t) { return (t /= .5) < 1 ? .5 * t * t * t : .5 * ((t -= 2) * t * t + 2) }, easeInQuart: function (t) { return t * t * t * t }, easeOutQuart: function (t) { return -((t -= 1) * t * t * t - 1) }, easeInOutQuart: function (t) { return (t /= .5) < 1 ? .5 * t * t * t * t : -.5 * ((t -= 2) * t * t * t - 2) }, easeInQuint: function (t) { return t * t * t * t * t }, easeOutQuint: function (t) { return (t -= 1) * t * t * t * t + 1 }, easeInOutQuint: function (t) { return (t /= .5) < 1 ? .5 * t * t * t * t * t : .5 * ((t -= 2) * t * t * t * t + 2) }, easeInSine: function (t) { return 1 - Math.cos(t * (Math.PI / 2)) }, easeOutSine: function (t) { return Math.sin(t * (Math.PI / 2)) }, easeInOutSine: function (t) { return -.5 * (Math.cos(Math.PI * t) - 1) }, easeInExpo: function (t) { return 0 === t ? 0 : Math.pow(2, 10 * (t - 1)) }, easeOutExpo: function (t) { return 1 === t ? 1 : 1 - Math.pow(2, -10 * t) }, easeInOutExpo: function (t) { return 0 === t ? 0 : 1 === t ? 1 : (t /= .5) < 1 ? .5 * Math.pow(2, 10 * (t - 1)) : .5 * (2 - Math.pow(2, -10 * --t)) }, easeInCirc: function (t) { return t >= 1 ? t : -(Math.sqrt(1 - t * t) - 1) }, easeOutCirc: function (t) { return Math.sqrt(1 - (t -= 1) * t) }, easeInOutCirc: function (t) { return (t /= .5) < 1 ? -.5 * (Math.sqrt(1 - t * t) - 1) : .5 * (Math.sqrt(1 - (t -= 2) * t) + 1) }, easeInElastic: function (t) { var e = 1.70158, i = 0, n = 1; return 0 === t ? 0 : 1 === t ? 1 : (i || (i = .3), n < 1 ? (n = 1, e = i / 4) : e = i / (2 * Math.PI) * Math.asin(1 / n), -n * Math.pow(2, 10 * (t -= 1)) * Math.sin((t - e) * (2 * Math.PI) / i)) }, easeOutElastic: function (t) { var e = 1.70158, i = 0, n = 1; return 0 === t ? 0 : 1 === t ? 1 : (i || (i = .3), n < 1 ? (n = 1, e = i / 4) : e = i / (2 * Math.PI) * Math.asin(1 / n), n * Math.pow(2, -10 * t) * Math.sin((t - e) * (2 * Math.PI) / i) + 1) }, easeInOutElastic: function (t) { var e = 1.70158, i = 0, n = 1; return 0 === t ? 0 : 2 == (t /= .5) ? 1 : (i || (i = .45), n < 1 ? (n = 1, e = i / 4) : e = i / (2 * Math.PI) * Math.asin(1 / n), t < 1 ? n * Math.pow(2, 10 * (t -= 1)) * Math.sin((t - e) * (2 * Math.PI) / i) * -.5 : n * Math.pow(2, -10 * (t -= 1)) * Math.sin((t - e) * (2 * Math.PI) / i) * .5 + 1) }, easeInBack: function (t) { var e = 1.70158; return t * t * ((e + 1) * t - e) }, easeOutBack: function (t) { var e = 1.70158; return (t -= 1) * t * ((e + 1) * t + e) + 1 }, easeInOutBack: function (t) { var e = 1.70158; return (t /= .5) < 1 ? t * t * ((1 + (e *= 1.525)) * t - e) * .5 : .5 * ((t -= 2) * t * ((1 + (e *= 1.525)) * t + e) + 2) }, easeInBounce: function (t) { return 1 - Z.easeOutBounce(1 - t) }, easeOutBounce: function (t) { return t < 1 / 2.75 ? 7.5625 * t * t : t < 2 / 2.75 ? 7.5625 * (t -= 1.5 / 2.75) * t + .75 : t < 2.5 / 2.75 ? 7.5625 * (t -= 2.25 / 2.75) * t + .9375 : 7.5625 * (t -= 2.625 / 2.75) * t + .984375 }, easeInOutBounce: function (t) { return t < .5 ? .5 * Z.easeInBounce(2 * t) : .5 * Z.easeOutBounce(2 * t - 1) + .5 } }, $ = { effects: Z }; G.easingEffects = Z; var J = Math.PI, Q = J / 180, tt = 2 * J, et = J / 2, it = J / 4, nt = 2 * J / 3, at = { clear: function (t) { t.ctx.clearRect(0, 0, t.width, t.height) }, roundedRect: function (t, e, i, n, a, o) { if (o) { var r = Math.min(o, a / 2, n / 2), s = e + r, l = i + r, d = e + n - r, u = i + a - r; t.moveTo(e, l), s < d && l < u ? (t.arc(s, l, r, -J, -et), t.arc(d, l, r, -et, 0), t.arc(d, u, r, 0, et), t.arc(s, u, r, et, J)) : s < d ? (t.moveTo(s, i), t.arc(d, l, r, -et, et), t.arc(s, l, r, et, J + et)) : l < u ? (t.arc(s, l, r, -J, 0), t.arc(s, u, r, 0, J)) : t.arc(s, l, r, -J, J), t.closePath(), t.moveTo(e, i) } else t.rect(e, i, n, a) }, drawPoint: function (t, e, i, n, a, o) { var r, s, l, d, u, h = (o || 0) * Q; if (!e || "object" != typeof e || "[object HTMLImageElement]" !== (r = e.toString()) && "[object HTMLCanvasElement]" !== r) { if (!(isNaN(i) || i <= 0)) { switch (t.beginPath(), e) { default: t.arc(n, a, i, 0, tt), t.closePath(); break; case "triangle": t.moveTo(n + Math.sin(h) * i, a - Math.cos(h) * i), h += nt, t.lineTo(n + Math.sin(h) * i, a - Math.cos(h) * i), h += nt, t.lineTo(n + Math.sin(h) * i, a - Math.cos(h) * i), t.closePath(); break; case "rectRounded": d = i - (u = .516 * i), s = Math.cos(h + it) * d, l = Math.sin(h + it) * d, t.arc(n - s, a - l, u, h - J, h - et), t.arc(n + l, a - s, u, h - et, h), t.arc(n + s, a + l, u, h, h + et), t.arc(n - l, a + s, u, h + et, h + J), t.closePath(); break; case "rect": if (!o) { d = Math.SQRT1_2 * i, t.rect(n - d, a - d, 2 * d, 2 * d); break } h += it; case "rectRot": s = Math.cos(h) * i, l = Math.sin(h) * i, t.moveTo(n - s, a - l), t.lineTo(n + l, a - s), t.lineTo(n + s, a + l), t.lineTo(n - l, a + s), t.closePath(); break; case "crossRot": h += it; case "cross": s = Math.cos(h) * i, l = Math.sin(h) * i, t.moveTo(n - s, a - l), t.lineTo(n + s, a + l), t.moveTo(n + l, a - s), t.lineTo(n - l, a + s); break; case "star": s = Math.cos(h) * i, l = Math.sin(h) * i, t.moveTo(n - s, a - l), t.lineTo(n + s, a + l), t.moveTo(n + l, a - s), t.lineTo(n - l, a + s), h += it, s = Math.cos(h) * i, l = Math.sin(h) * i, t.moveTo(n - s, a - l), t.lineTo(n + s, a + l), t.moveTo(n + l, a - s), t.lineTo(n - l, a + s); break; case "line": s = Math.cos(h) * i, l = Math.sin(h) * i, t.moveTo(n - s, a - l), t.lineTo(n + s, a + l); break; case "dash": t.moveTo(n, a), t.lineTo(n + Math.cos(h) * i, a + Math.sin(h) * i) }t.fill(), t.stroke() } } else t.drawImage(e, n - e.width / 2, a - e.height / 2, e.width, e.height) }, _isPointInArea: function (t, e) { return t.x > e.left - 1e-6 && t.x < e.right + 1e-6 && t.y > e.top - 1e-6 && t.y < e.bottom + 1e-6 }, clipArea: function (t, e) { t.save(), t.beginPath(), t.rect(e.left, e.top, e.right - e.left, e.bottom - e.top), t.clip() }, unclipArea: function (t) { t.restore() }, lineTo: function (t, e, i, n) { var a = i.steppedLine; if (a) { if ("middle" === a) { var o = (e.x + i.x) / 2; t.lineTo(o, n ? i.y : e.y), t.lineTo(o, n ? e.y : i.y) } else "after" === a && !n || "after" !== a && n ? t.lineTo(e.x, i.y) : t.lineTo(i.x, e.y); t.lineTo(i.x, i.y) } else i.tension ? t.bezierCurveTo(n ? e.controlPointPreviousX : e.controlPointNextX, n ? e.controlPointPreviousY : e.controlPointNextY, n ? i.controlPointNextX : i.controlPointPreviousX, n ? i.controlPointNextY : i.controlPointPreviousY, i.x, i.y) : t.lineTo(i.x, i.y) } }, ot = at; G.clear = at.clear, G.drawRoundedRectangle = function (t) { t.beginPath(), at.roundedRect.apply(at, arguments) }; var rt = { _set: function (t, e) { return G.merge(this[t] || (this[t] = {}), e) } }; rt._set("global", { defaultColor: "rgba(0,0,0,0.1)", defaultFontColor: "#666", defaultFontFamily: "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif", defaultFontSize: 12, defaultFontStyle: "normal", defaultLineHeight: 1.2, showLines: !0 }); var st = rt, lt = G.valueOrDefault; var dt = { toLineHeight: function (t, e) { var i = ("" + t).match(/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/); if (!i || "normal" === i[1]) return 1.2 * e; switch (t = +i[2], i[3]) { case "px": return t; case "%": t /= 100 }return e * t }, toPadding: function (t) { var e, i, n, a; return G.isObject(t) ? (e = +t.top || 0, i = +t.right || 0, n = +t.bottom || 0, a = +t.left || 0) : e = i = n = a = +t || 0, { top: e, right: i, bottom: n, left: a, height: e + n, width: a + i } }, _parseFont: function (t) { var e = st.global, i = lt(t.fontSize, e.defaultFontSize), n = { family: lt(t.fontFamily, e.defaultFontFamily), lineHeight: G.options.toLineHeight(lt(t.lineHeight, e.defaultLineHeight), i), size: i, style: lt(t.fontStyle, e.defaultFontStyle), weight: null, string: "" }; return n.string = function (t) { return !t || G.isNullOrUndef(t.size) || G.isNullOrUndef(t.family) ? null : (t.style ? t.style + " " : "") + (t.weight ? t.weight + " " : "") + t.size + "px " + t.family }(n), n }, resolve: function (t, e, i) { var n, a, o; for (n = 0, a = t.length; n < a; ++n)if (void 0 !== (o = t[n]) && (void 0 !== e && "function" == typeof o && (o = o(e)), void 0 !== i && G.isArray(o) && (o = o[i]), void 0 !== o)) return o } }, ut = G, ht = $, ct = ot, ft = dt; ut.easing = ht, ut.canvas = ct, ut.options = ft; var gt = function (t) { ut.extend(this, t), this.initialize.apply(this, arguments) }; ut.extend(gt.prototype, { initialize: function () { this.hidden = !1 }, pivot: function () { var t = this; return t._view || (t._view = ut.clone(t._model)), t._start = {}, t }, transition: function (t) { var e = this, i = e._model, n = e._start, a = e._view; return i && 1 !== t ? (a || (a = e._view = {}), n || (n = e._start = {}), function (t, e, i, n) { var a, o, r, s, l, d, u, h, c, f = Object.keys(i); for (a = 0, o = f.length; a < o; ++a)if (d = i[r = f[a]], e.hasOwnProperty(r) || (e[r] = d), (s = e[r]) !== d && "_" !== r[0]) { if (t.hasOwnProperty(r) || (t[r] = s), (u = typeof d) == typeof (l = t[r])) if ("string" === u) { if ((h = X(l)).valid && (c = X(d)).valid) { e[r] = c.mix(h, n).rgbString(); continue } } else if (ut.isFinite(l) && ut.isFinite(d)) { e[r] = l + (d - l) * n; continue } e[r] = d } }(n, a, i, t), e) : (e._view = i, e._start = null, e) }, tooltipPosition: function () { return { x: this._model.x, y: this._model.y } }, hasValue: function () { return ut.isNumber(this._model.x) && ut.isNumber(this._model.y) } }), gt.extend = ut.inherits; var pt = gt, mt = pt.extend({ chart: null, currentStep: 0, numSteps: 60, easing: "", render: null, onAnimationProgress: null, onAnimationComplete: null }), vt = mt; Object.defineProperty(mt.prototype, "animationObject", { get: function () { return this } }), Object.defineProperty(mt.prototype, "chartInstance", { get: function () { return this.chart }, set: function (t) { this.chart = t } }), st._set("global", { animation: { duration: 1e3, easing: "easeOutQuart", onProgress: ut.noop, onComplete: ut.noop } }); var bt = { animations: [], request: null, addAnimation: function (t, e, i, n) { var a, o, r = this.animations; for (e.chart = t, e.startTime = Date.now(), e.duration = i, n || (t.animating = !0), a = 0, o = r.length; a < o; ++a)if (r[a].chart === t) return void (r[a] = e); r.push(e), 1 === r.length && this.requestAnimationFrame() }, cancelAnimation: function (t) { var e = ut.findIndex(this.animations, function (e) { return e.chart === t }); -1 !== e && (this.animations.splice(e, 1), t.animating = !1) }, requestAnimationFrame: function () { var t = this; null === t.request && (t.request = ut.requestAnimFrame.call(window, function () { t.request = null, t.startDigest() })) }, startDigest: function () { this.advance(), this.animations.length > 0 && this.requestAnimationFrame() }, advance: function () { for (var t, e, i, n, a = this.animations, o = 0; o < a.length;)e = (t = a[o]).chart, i = t.numSteps, n = Math.floor((Date.now() - t.startTime) / t.duration * i) + 1, t.currentStep = Math.min(n, i), ut.callback(t.render, [e, t], e), ut.callback(t.onAnimationProgress, [t], e), t.currentStep >= i ? (ut.callback(t.onAnimationComplete, [t], e), e.animating = !1, a.splice(o, 1)) : ++o } }, xt = ut.options.resolve, yt = ["push", "pop", "shift", "splice", "unshift"]; function kt(t, e) { var i = t._chartjs; if (i) { var n = i.listeners, a = n.indexOf(e); -1 !== a && n.splice(a, 1), n.length > 0 || (yt.forEach(function (e) { delete t[e] }), delete t._chartjs) } } var wt = function (t, e) { this.initialize(t, e) }; ut.extend(wt.prototype, { datasetElementType: null, dataElementType: null, initialize: function (t, e) { this.chart = t, this.index = e, this.linkScales(), this.addElements() }, updateIndex: function (t) { this.index = t }, linkScales: function () { var t = this, e = t.getMeta(), i = t.getDataset(); null !== e.xAxisID && e.xAxisID in t.chart.scales || (e.xAxisID = i.xAxisID || t.chart.options.scales.xAxes[0].id), null !== e.yAxisID && e.yAxisID in t.chart.scales || (e.yAxisID = i.yAxisID || t.chart.options.scales.yAxes[0].id) }, getDataset: function () { return this.chart.data.datasets[this.index] }, getMeta: function () { return this.chart.getDatasetMeta(this.index) }, getScaleForId: function (t) { return this.chart.scales[t] }, _getValueScaleId: function () { return this.getMeta().yAxisID }, _getIndexScaleId: function () { return this.getMeta().xAxisID }, _getValueScale: function () { return this.getScaleForId(this._getValueScaleId()) }, _getIndexScale: function () { return this.getScaleForId(this._getIndexScaleId()) }, reset: function () { this.update(!0) }, destroy: function () { this._data && kt(this._data, this) }, createMetaDataset: function () { var t = this.datasetElementType; return t && new t({ _chart: this.chart, _datasetIndex: this.index }) }, createMetaData: function (t) { var e = this.dataElementType; return e && new e({ _chart: this.chart, _datasetIndex: this.index, _index: t }) }, addElements: function () { var t, e, i = this.getMeta(), n = this.getDataset().data || [], a = i.data; for (t = 0, e = n.length; t < e; ++t)a[t] = a[t] || this.createMetaData(t); i.dataset = i.dataset || this.createMetaDataset() }, addElementAndReset: function (t) { var e = this.createMetaData(t); this.getMeta().data.splice(t, 0, e), this.updateElement(e, t, !0) }, buildOrUpdateElements: function () { var t, e, i = this, n = i.getDataset(), a = n.data || (n.data = []); i._data !== a && (i._data && kt(i._data, i), a && Object.isExtensible(a) && (e = i, (t = a)._chartjs ? t._chartjs.listeners.push(e) : (Object.defineProperty(t, "_chartjs", { configurable: !0, enumerable: !1, value: { listeners: [e] } }), yt.forEach(function (e) { var i = "onData" + e.charAt(0).toUpperCase() + e.slice(1), n = t[e]; Object.defineProperty(t, e, { configurable: !0, enumerable: !1, value: function () { var e = Array.prototype.slice.call(arguments), a = n.apply(this, e); return ut.each(t._chartjs.listeners, function (t) { "function" == typeof t[i] && t[i].apply(t, e) }), a } }) }))), i._data = a), i.resyncElements() }, update: ut.noop, transition: function (t) { for (var e = this.getMeta(), i = e.data || [], n = i.length, a = 0; a < n; ++a)i[a].transition(t); e.dataset && e.dataset.transition(t) }, draw: function () { var t = this.getMeta(), e = t.data || [], i = e.length, n = 0; for (t.dataset && t.dataset.draw(); n < i; ++n)e[n].draw() }, removeHoverStyle: function (t) { ut.merge(t._model, t.$previousStyle || {}), delete t.$previousStyle }, setHoverStyle: function (t) { var e = this.chart.data.datasets[t._datasetIndex], i = t._index, n = t.custom || {}, a = t._model, o = ut.getHoverColor; t.$previousStyle = { backgroundColor: a.backgroundColor, borderColor: a.borderColor, borderWidth: a.borderWidth }, a.backgroundColor = xt([n.hoverBackgroundColor, e.hoverBackgroundColor, o(a.backgroundColor)], void 0, i), a.borderColor = xt([n.hoverBorderColor, e.hoverBorderColor, o(a.borderColor)], void 0, i), a.borderWidth = xt([n.hoverBorderWidth, e.hoverBorderWidth, a.borderWidth], void 0, i) }, resyncElements: function () { var t = this.getMeta(), e = this.getDataset().data, i = t.data.length, n = e.length; n < i ? t.data.splice(n, i - n) : n > i && this.insertElements(i, n - i) }, insertElements: function (t, e) { for (var i = 0; i < e; ++i)this.addElementAndReset(t + i) }, onDataPush: function () { var t = arguments.length; this.insertElements(this.getDataset().data.length - t, t) }, onDataPop: function () { this.getMeta().data.pop() }, onDataShift: function () { this.getMeta().data.shift() }, onDataSplice: function (t, e) { this.getMeta().data.splice(t, e), this.insertElements(t, arguments.length - 2) }, onDataUnshift: function () { this.insertElements(0, arguments.length) } }), wt.extend = ut.inherits; var Mt = wt; st._set("global", { elements: { arc: { backgroundColor: st.global.defaultColor, borderColor: "#fff", borderWidth: 2, borderAlign: "center" } } }); var _t = pt.extend({ inLabelRange: function (t) { var e = this._view; return !!e && Math.pow(t - e.x, 2) < Math.pow(e.radius + e.hoverRadius, 2) }, inRange: function (t, e) { var i = this._view; if (i) { for (var n = ut.getAngleFromPoint(i, { x: t, y: e }), a = n.angle, o = n.distance, r = i.startAngle, s = i.endAngle; s < r;)s += 2 * Math.PI; for (; a > s;)a -= 2 * Math.PI; for (; a < r;)a += 2 * Math.PI; var l = a >= r && a <= s, d = o >= i.innerRadius && o <= i.outerRadius; return l && d } return !1 }, getCenterPoint: function () { var t = this._view, e = (t.startAngle + t.endAngle) / 2, i = (t.innerRadius + t.outerRadius) / 2; return { x: t.x + Math.cos(e) * i, y: t.y + Math.sin(e) * i } }, getArea: function () { var t = this._view; return Math.PI * ((t.endAngle - t.startAngle) / (2 * Math.PI)) * (Math.pow(t.outerRadius, 2) - Math.pow(t.innerRadius, 2)) }, tooltipPosition: function () { var t = this._view, e = t.startAngle + (t.endAngle - t.startAngle) / 2, i = (t.outerRadius - t.innerRadius) / 2 + t.innerRadius; return { x: t.x + Math.cos(e) * i, y: t.y + Math.sin(e) * i } }, draw: function () { var t, e = this._chart.ctx, i = this._view, n = i.startAngle, a = i.endAngle, o = "inner" === i.borderAlign ? .33 : 0; e.save(), e.beginPath(), e.arc(i.x, i.y, Math.max(i.outerRadius - o, 0), n, a), e.arc(i.x, i.y, i.innerRadius, a, n, !0), e.closePath(), e.fillStyle = i.backgroundColor, e.fill(), i.borderWidth && ("inner" === i.borderAlign ? (e.beginPath(), t = o / i.outerRadius, e.arc(i.x, i.y, i.outerRadius, n - t, a + t), i.innerRadius > o ? (t = o / i.innerRadius, e.arc(i.x, i.y, i.innerRadius - o, a + t, n - t, !0)) : e.arc(i.x, i.y, o, a + Math.PI / 2, n - Math.PI / 2), e.closePath(), e.clip(), e.beginPath(), e.arc(i.x, i.y, i.outerRadius, n, a), e.arc(i.x, i.y, i.innerRadius, a, n, !0), e.closePath(), e.lineWidth = 2 * i.borderWidth, e.lineJoin = "round") : (e.lineWidth = i.borderWidth, e.lineJoin = "bevel"), e.strokeStyle = i.borderColor, e.stroke()), e.restore() } }), Ct = ut.valueOrDefault, St = st.global.defaultColor; st._set("global", { elements: { line: { tension: .4, backgroundColor: St, borderWidth: 3, borderColor: St, borderCapStyle: "butt", borderDash: [], borderDashOffset: 0, borderJoinStyle: "miter", capBezierPoints: !0, fill: !0 } } }); var Pt = pt.extend({ draw: function () { var t, e, i, n, a = this._view, o = this._chart.ctx, r = a.spanGaps, s = this._children.slice(), l = st.global, d = l.elements.line, u = -1; for (this._loop && s.length && s.push(s[0]), o.save(), o.lineCap = a.borderCapStyle || d.borderCapStyle, o.setLineDash && o.setLineDash(a.borderDash || d.borderDash), o.lineDashOffset = Ct(a.borderDashOffset, d.borderDashOffset), o.lineJoin = a.borderJoinStyle || d.borderJoinStyle, o.lineWidth = Ct(a.borderWidth, d.borderWidth), o.strokeStyle = a.borderColor || l.defaultColor, o.beginPath(), u = -1, t = 0; t < s.length; ++t)e = s[t], i = ut.previousItem(s, t), n = e._view, 0 === t ? n.skip || (o.moveTo(n.x, n.y), u = t) : (i = -1 === u ? i : s[u], n.skip || (u !== t - 1 && !r || -1 === u ? o.moveTo(n.x, n.y) : ut.canvas.lineTo(o, i._view, e._view), u = t)); o.stroke(), o.restore() } }), It = ut.valueOrDefault, At = st.global.defaultColor; function Dt(t) { var e = this._view; return !!e && Math.abs(t - e.x) < e.radius + e.hitRadius } st._set("global", { elements: { point: { radius: 3, pointStyle: "circle", backgroundColor: At, borderColor: At, borderWidth: 1, hitRadius: 1, hoverRadius: 4, hoverBorderWidth: 1 } } }); var Tt = pt.extend({ inRange: function (t, e) { var i = this._view; return !!i && Math.pow(t - i.x, 2) + Math.pow(e - i.y, 2) < Math.pow(i.hitRadius + i.radius, 2) }, inLabelRange: Dt, inXRange: Dt, inYRange: function (t) { var e = this._view; return !!e && Math.abs(t - e.y) < e.radius + e.hitRadius }, getCenterPoint: function () { var t = this._view; return { x: t.x, y: t.y } }, getArea: function () { return Math.PI * Math.pow(this._view.radius, 2) }, tooltipPosition: function () { var t = this._view; return { x: t.x, y: t.y, padding: t.radius + t.borderWidth } }, draw: function (t) { var e = this._view, i = this._chart.ctx, n = e.pointStyle, a = e.rotation, o = e.radius, r = e.x, s = e.y, l = st.global, d = l.defaultColor; e.skip || (void 0 === t || ut.canvas._isPointInArea(e, t)) && (i.strokeStyle = e.borderColor || d, i.lineWidth = It(e.borderWidth, l.elements.point.borderWidth), i.fillStyle = e.backgroundColor || d, ut.canvas.drawPoint(i, n, o, r, s, a)) } }), Ft = st.global.defaultColor; function Lt(t) { return t && void 0 !== t.width } function Rt(t) { var e, i, n, a, o; return Lt(t) ? (o = t.width / 2, e = t.x - o, i = t.x + o, n = Math.min(t.y, t.base), a = Math.max(t.y, t.base)) : (o = t.height / 2, e = Math.min(t.x, t.base), i = Math.max(t.x, t.base), n = t.y - o, a = t.y + o), { left: e, top: n, right: i, bottom: a } } function Ot(t, e, i) { return t === e ? i : t === i ? e : t } function zt(t, e, i) { var n, a, o, r, s = t.borderWidth, l = function (t) { var e = t.borderSkipped, i = {}; return e ? (t.horizontal ? t.base > t.x && (e = Ot(e, "left", "right")) : t.base < t.y && (e = Ot(e, "bottom", "top")), i[e] = !0, i) : i }(t); return ut.isObject(s) ? (n = +s.top || 0, a = +s.right || 0, o = +s.bottom || 0, r = +s.left || 0) : n = a = o = r = +s || 0, { t: l.top || n < 0 ? 0 : n > i ? i : n, r: l.right || a < 0 ? 0 : a > e ? e : a, b: l.bottom || o < 0 ? 0 : o > i ? i : o, l: l.left || r < 0 ? 0 : r > e ? e : r } } function Bt(t, e, i) { var n = null === e, a = null === i, o = !(!t || n && a) && Rt(t); return o && (n || e >= o.left && e <= o.right) && (a || i >= o.top && i <= o.bottom) } st._set("global", { elements: { rectangle: { backgroundColor: Ft, borderColor: Ft, borderSkipped: "bottom", borderWidth: 0 } } }); var Nt = pt.extend({ draw: function () { var t = this._chart.ctx, e = this._view, i = function (t) { var e = Rt(t), i = e.right - e.left, n = e.bottom - e.top, a = zt(t, i / 2, n / 2); return { outer: { x: e.left, y: e.top, w: i, h: n }, inner: { x: e.left + a.l, y: e.top + a.t, w: i - a.l - a.r, h: n - a.t - a.b } } }(e), n = i.outer, a = i.inner; t.fillStyle = e.backgroundColor, t.fillRect(n.x, n.y, n.w, n.h), n.w === a.w && n.h === a.h || (t.save(), t.beginPath(), t.rect(n.x, n.y, n.w, n.h), t.clip(), t.fillStyle = e.borderColor, t.rect(a.x, a.y, a.w, a.h), t.fill("evenodd"), t.restore()) }, height: function () { var t = this._view; return t.base - t.y }, inRange: function (t, e) { return Bt(this._view, t, e) }, inLabelRange: function (t, e) { var i = this._view; return Lt(i) ? Bt(i, t, null) : Bt(i, null, e) }, inXRange: function (t) { return Bt(this._view, t, null) }, inYRange: function (t) { return Bt(this._view, null, t) }, getCenterPoint: function () { var t, e, i = this._view; return Lt(i) ? (t = i.x, e = (i.y + i.base) / 2) : (t = (i.x + i.base) / 2, e = i.y), { x: t, y: e } }, getArea: function () { var t = this._view; return Lt(t) ? t.width * Math.abs(t.y - t.base) : t.height * Math.abs(t.x - t.base) }, tooltipPosition: function () { var t = this._view; return { x: t.x, y: t.y } } }), Wt = {}, Vt = _t, Et = Pt, Ht = Tt, jt = Nt; Wt.Arc = Vt, Wt.Line = Et, Wt.Point = Ht, Wt.Rectangle = jt; var qt = ut.options.resolve; st._set("bar", { hover: { mode: "label" }, scales: { xAxes: [{ type: "category", categoryPercentage: .8, barPercentage: .9, offset: !0, gridLines: { offsetGridLines: !0 } }], yAxes: [{ type: "linear" }] } }); var Yt = Mt.extend({ dataElementType: Wt.Rectangle, initialize: function () { var t; Mt.prototype.initialize.apply(this, arguments), (t = this.getMeta()).stack = this.getDataset().stack, t.bar = !0 }, update: function (t) { var e, i, n = this.getMeta().data; for (this._ruler = this.getRuler(), e = 0, i = n.length; e < i; ++e)this.updateElement(n[e], e, t) }, updateElement: function (t, e, i) { var n = this, a = n.getMeta(), o = n.getDataset(), r = n._resolveElementOptions(t, e); t._xScale = n.getScaleForId(a.xAxisID), t._yScale = n.getScaleForId(a.yAxisID), t._datasetIndex = n.index, t._index = e, t._model = { backgroundColor: r.backgroundColor, borderColor: r.borderColor, borderSkipped: r.borderSkipped, borderWidth: r.borderWidth, datasetLabel: o.label, label: n.chart.data.labels[e] }, n._updateElementGeometry(t, e, i), t.pivot() }, _updateElementGeometry: function (t, e, i) { var n = this, a = t._model, o = n._getValueScale(), r = o.getBasePixel(), s = o.isHorizontal(), l = n._ruler || n.getRuler(), d = n.calculateBarValuePixels(n.index, e), u = n.calculateBarIndexPixels(n.index, e, l); a.horizontal = s, a.base = i ? r : d.base, a.x = s ? i ? r : d.head : u.center, a.y = s ? u.center : i ? r : d.head, a.height = s ? u.size : void 0, a.width = s ? void 0 : u.size }, _getStacks: function (t) { var e, i, n = this.chart, a = this._getIndexScale().options.stacked, o = void 0 === t ? n.data.datasets.length : t + 1, r = []; for (e = 0; e < o; ++e)(i = n.getDatasetMeta(e)).bar && n.isDatasetVisible(e) && (!1 === a || !0 === a && -1 === r.indexOf(i.stack) || void 0 === a && (void 0 === i.stack || -1 === r.indexOf(i.stack))) && r.push(i.stack); return r }, getStackCount: function () { return this._getStacks().length }, getStackIndex: function (t, e) { var i = this._getStacks(t), n = void 0 !== e ? i.indexOf(e) : -1; return -1 === n ? i.length - 1 : n }, getRuler: function () { var t, e, i = this._getIndexScale(), n = this.getStackCount(), a = this.index, o = i.isHorizontal(), r = o ? i.left : i.top, s = r + (o ? i.width : i.height), l = []; for (t = 0, e = this.getMeta().data.length; t < e; ++t)l.push(i.getPixelForValue(null, t, a)); return { min: ut.isNullOrUndef(i.options.barThickness) ? function (t, e) { var i, n, a, o, r = t.isHorizontal() ? t.width : t.height, s = t.getTicks(); for (a = 1, o = e.length; a < o; ++a)r = Math.min(r, Math.abs(e[a] - e[a - 1])); for (a = 0, o = s.length; a < o; ++a)n = t.getPixelForTick(a), r = a > 0 ? Math.min(r, n - i) : r, i = n; return r }(i, l) : -1, pixels: l, start: r, end: s, stackCount: n, scale: i } }, calculateBarValuePixels: function (t, e) { var i, n, a, o, r, s, l = this.chart, d = this.getMeta(), u = this._getValueScale(), h = u.isHorizontal(), c = l.data.datasets, f = +u.getRightValue(c[t].data[e]), g = u.options.minBarLength, p = u.options.stacked, m = d.stack, v = 0; if (p || void 0 === p && void 0 !== m) for (i = 0; i < t; ++i)(n = l.getDatasetMeta(i)).bar && n.stack === m && n.controller._getValueScaleId() === u.id && l.isDatasetVisible(i) && (a = +u.getRightValue(c[i].data[e]), (f < 0 && a < 0 || f >= 0 && a > 0) && (v += a)); return o = u.getPixelForValue(v), s = (r = u.getPixelForValue(v + f)) - o, void 0 !== g && Math.abs(s) < g && (s = g, r = f >= 0 && !h || f < 0 && h ? o - g : o + g), { size: s, base: o, head: r, center: r + s / 2 } }, calculateBarIndexPixels: function (t, e, i) { var n = i.scale.options, a = "flex" === n.barThickness ? function (t, e, i) { var n, a = e.pixels, o = a[t], r = t > 0 ? a[t - 1] : null, s = t < a.length - 1 ? a[t + 1] : null, l = i.categoryPercentage; return null === r && (r = o - (null === s ? e.end - e.start : s - o)), null === s && (s = o + o - r), n = o - (o - Math.min(r, s)) / 2 * l, { chunk: Math.abs(s - r) / 2 * l / e.stackCount, ratio: i.barPercentage, start: n } }(e, i, n) : function (t, e, i) { var n, a, o = i.barThickness, r = e.stackCount, s = e.pixels[t]; return ut.isNullOrUndef(o) ? (n = e.min * i.categoryPercentage, a = i.barPercentage) : (n = o * r, a = 1), { chunk: n / r, ratio: a, start: s - n / 2 } }(e, i, n), o = this.getStackIndex(t, this.getMeta().stack), r = a.start + a.chunk * o + a.chunk / 2, s = Math.min(ut.valueOrDefault(n.maxBarThickness, 1 / 0), a.chunk * a.ratio); return { base: r - s / 2, head: r + s / 2, center: r, size: s } }, draw: function () { var t = this.chart, e = this._getValueScale(), i = this.getMeta().data, n = this.getDataset(), a = i.length, o = 0; for (ut.canvas.clipArea(t.ctx, t.chartArea); o < a; ++o)isNaN(e.getRightValue(n.data[o])) || i[o].draw(); ut.canvas.unclipArea(t.ctx) }, _resolveElementOptions: function (t, e) { var i, n, a, o = this.chart, r = o.data.datasets[this.index], s = t.custom || {}, l = o.options.elements.rectangle, d = {}, u = { chart: o, dataIndex: e, dataset: r, datasetIndex: this.index }, h = ["backgroundColor", "borderColor", "borderSkipped", "borderWidth"]; for (i = 0, n = h.length; i < n; ++i)d[a = h[i]] = qt([s[a], r[a], l[a]], u, e); return d } }), Ut = ut.valueOrDefault, Xt = ut.options.resolve; st._set("bubble", { hover: { mode: "single" }, scales: { xAxes: [{ type: "linear", position: "bottom", id: "x-axis-0" }], yAxes: [{ type: "linear", position: "left", id: "y-axis-0" }] }, tooltips: { callbacks: { title: function () { return "" }, label: function (t, e) { var i = e.datasets[t.datasetIndex].label || "", n = e.datasets[t.datasetIndex].data[t.index]; return i + ": (" + t.xLabel + ", " + t.yLabel + ", " + n.r + ")" } } } }); var Kt = Mt.extend({ dataElementType: Wt.Point, update: function (t) { var e = this, i = e.getMeta().data; ut.each(i, function (i, n) { e.updateElement(i, n, t) }) }, updateElement: function (t, e, i) { var n = this, a = n.getMeta(), o = t.custom || {}, r = n.getScaleForId(a.xAxisID), s = n.getScaleForId(a.yAxisID), l = n._resolveElementOptions(t, e), d = n.getDataset().data[e], u = n.index, h = i ? r.getPixelForDecimal(.5) : r.getPixelForValue("object" == typeof d ? d : NaN, e, u), c = i ? s.getBasePixel() : s.getPixelForValue(d, e, u); t._xScale = r, t._yScale = s, t._options = l, t._datasetIndex = u, t._index = e, t._model = { backgroundColor: l.backgroundColor, borderColor: l.borderColor, borderWidth: l.borderWidth, hitRadius: l.hitRadius, pointStyle: l.pointStyle, rotation: l.rotation, radius: i ? 0 : l.radius, skip: o.skip || isNaN(h) || isNaN(c), x: h, y: c }, t.pivot() }, setHoverStyle: function (t) { var e = t._model, i = t._options, n = ut.getHoverColor; t.$previousStyle = { backgroundColor: e.backgroundColor, borderColor: e.borderColor, borderWidth: e.borderWidth, radius: e.radius }, e.backgroundColor = Ut(i.hoverBackgroundColor, n(i.backgroundColor)), e.borderColor = Ut(i.hoverBorderColor, n(i.borderColor)), e.borderWidth = Ut(i.hoverBorderWidth, i.borderWidth), e.radius = i.radius + i.hoverRadius }, _resolveElementOptions: function (t, e) { var i, n, a, o = this.chart, r = o.data.datasets[this.index], s = t.custom || {}, l = o.options.elements.point, d = r.data[e], u = {}, h = { chart: o, dataIndex: e, dataset: r, datasetIndex: this.index }, c = ["backgroundColor", "borderColor", "borderWidth", "hoverBackgroundColor", "hoverBorderColor", "hoverBorderWidth", "hoverRadius", "hitRadius", "pointStyle", "rotation"]; for (i = 0, n = c.length; i < n; ++i)u[a = c[i]] = Xt([s[a], r[a], l[a]], h, e); return u.radius = Xt([s.radius, d ? d.r : void 0, r.radius, l.radius], h, e), u } }), Gt = ut.options.resolve, Zt = ut.valueOrDefault; st._set("doughnut", { animation: { animateRotate: !0, animateScale: !1 }, hover: { mode: "single" }, legendCallback: function (t) { var e = []; e.push(''); var i = t.data, n = i.datasets, a = i.labels; if (n.length) for (var o = 0; o < n[0].data.length; ++o)e.push(' '), a[o] && e.push(a[o]), e.push(" "); return e.push(" "), e.join("") }, legend: { labels: { generateLabels: function (t) { var e = t.data; return e.labels.length && e.datasets.length ? e.labels.map(function (i, n) { var a = t.getDatasetMeta(0), o = e.datasets[0], r = a.data[n], s = r && r.custom || {}, l = t.options.elements.arc; return { text: i, fillStyle: Gt([s.backgroundColor, o.backgroundColor, l.backgroundColor], void 0, n), strokeStyle: Gt([s.borderColor, o.borderColor, l.borderColor], void 0, n), lineWidth: Gt([s.borderWidth, o.borderWidth, l.borderWidth], void 0, n), hidden: isNaN(o.data[n]) || a.data[n].hidden, index: n } }) : [] } }, onClick: function (t, e) { var i, n, a, o = e.index, r = this.chart; for (i = 0, n = (r.data.datasets || []).length; i < n; ++i)(a = r.getDatasetMeta(i)).data[o] && (a.data[o].hidden = !a.data[o].hidden); r.update() } }, cutoutPercentage: 50, rotation: -.5 * Math.PI, circumference: 2 * Math.PI, tooltips: { callbacks: { title: function () { return "" }, label: function (t, e) { var i = e.labels[t.index], n = ": " + e.datasets[t.datasetIndex].data[t.index]; return ut.isArray(i) ? (i = i.slice())[0] += n : i += n, i } } } }); var $t = Mt.extend({ dataElementType: Wt.Arc, linkScales: ut.noop, getRingIndex: function (t) { for (var e = 0, i = 0; i < t; ++i)this.chart.isDatasetVisible(i) && ++e; return e }, update: function (t) { var e, i, n = this, a = n.chart, o = a.chartArea, r = a.options, s = o.right - o.left, l = o.bottom - o.top, d = Math.min(s, l), u = { x: 0, y: 0 }, h = n.getMeta(), c = h.data, f = r.cutoutPercentage, g = r.circumference, p = n._getRingWeight(n.index); if (g < 2 * Math.PI) { var m = r.rotation % (2 * Math.PI), v = (m += 2 * Math.PI * (m >= Math.PI ? -1 : m < -Math.PI ? 1 : 0)) + g, b = { x: Math.cos(m), y: Math.sin(m) }, x = { x: Math.cos(v), y: Math.sin(v) }, y = m <= 0 && v >= 0 || m <= 2 * Math.PI && 2 * Math.PI <= v, k = m <= .5 * Math.PI && .5 * Math.PI <= v || m <= 2.5 * Math.PI && 2.5 * Math.PI <= v, w = m <= -Math.PI && -Math.PI <= v || m <= Math.PI && Math.PI <= v, M = m <= .5 * -Math.PI && .5 * -Math.PI <= v || m <= 1.5 * Math.PI && 1.5 * Math.PI <= v, _ = f / 100, C = { x: w ? -1 : Math.min(b.x * (b.x < 0 ? 1 : _), x.x * (x.x < 0 ? 1 : _)), y: M ? -1 : Math.min(b.y * (b.y < 0 ? 1 : _), x.y * (x.y < 0 ? 1 : _)) }, S = { x: y ? 1 : Math.max(b.x * (b.x > 0 ? 1 : _), x.x * (x.x > 0 ? 1 : _)), y: k ? 1 : Math.max(b.y * (b.y > 0 ? 1 : _), x.y * (x.y > 0 ? 1 : _)) }, P = { width: .5 * (S.x - C.x), height: .5 * (S.y - C.y) }; d = Math.min(s / P.width, l / P.height), u = { x: -.5 * (S.x + C.x), y: -.5 * (S.y + C.y) } } for (e = 0, i = c.length; e < i; ++e)c[e]._options = n._resolveElementOptions(c[e], e); for (a.borderWidth = n.getMaxBorderWidth(), a.outerRadius = Math.max((d - a.borderWidth) / 2, 0), a.innerRadius = Math.max(f ? a.outerRadius / 100 * f : 0, 0), a.radiusLength = (a.outerRadius - a.innerRadius) / (n._getVisibleDatasetWeightTotal() || 1), a.offsetX = u.x * a.outerRadius, a.offsetY = u.y * a.outerRadius, h.total = n.calculateTotal(), n.outerRadius = a.outerRadius - a.radiusLength * n._getRingWeightOffset(n.index), n.innerRadius = Math.max(n.outerRadius - a.radiusLength * p, 0), e = 0, i = c.length; e < i; ++e)n.updateElement(c[e], e, t) }, updateElement: function (t, e, i) { var n = this, a = n.chart, o = a.chartArea, r = a.options, s = r.animation, l = (o.left + o.right) / 2, d = (o.top + o.bottom) / 2, u = r.rotation, h = r.rotation, c = n.getDataset(), f = i && s.animateRotate ? 0 : t.hidden ? 0 : n.calculateCircumference(c.data[e]) * (r.circumference / (2 * Math.PI)), g = i && s.animateScale ? 0 : n.innerRadius, p = i && s.animateScale ? 0 : n.outerRadius, m = t._options || {}; ut.extend(t, { _datasetIndex: n.index, _index: e, _model: { backgroundColor: m.backgroundColor, borderColor: m.borderColor, borderWidth: m.borderWidth, borderAlign: m.borderAlign, x: l + a.offsetX, y: d + a.offsetY, startAngle: u, endAngle: h, circumference: f, outerRadius: p, innerRadius: g, label: ut.valueAtIndexOrDefault(c.label, e, a.data.labels[e]) } }); var v = t._model; i && s.animateRotate || (v.startAngle = 0 === e ? r.rotation : n.getMeta().data[e - 1]._model.endAngle, v.endAngle = v.startAngle + v.circumference), t.pivot() }, calculateTotal: function () { var t, e = this.getDataset(), i = this.getMeta(), n = 0; return ut.each(i.data, function (i, a) { t = e.data[a], isNaN(t) || i.hidden || (n += Math.abs(t)) }), n }, calculateCircumference: function (t) { var e = this.getMeta().total; return e > 0 && !isNaN(t) ? 2 * Math.PI * (Math.abs(t) / e) : 0 }, getMaxBorderWidth: function (t) { var e, i, n, a, o, r, s, l, d = 0, u = this.chart; if (!t) for (e = 0, i = u.data.datasets.length; e < i; ++e)if (u.isDatasetVisible(e)) { t = (n = u.getDatasetMeta(e)).data, e !== this.index && (o = n.controller); break } if (!t) return 0; for (e = 0, i = t.length; e < i; ++e)a = t[e], "inner" !== (r = o ? o._resolveElementOptions(a, e) : a._options).borderAlign && (s = r.borderWidth, d = (l = r.hoverBorderWidth) > (d = s > d ? s : d) ? l : d); return d }, setHoverStyle: function (t) { var e = t._model, i = t._options, n = ut.getHoverColor; t.$previousStyle = { backgroundColor: e.backgroundColor, borderColor: e.borderColor, borderWidth: e.borderWidth }, e.backgroundColor = Zt(i.hoverBackgroundColor, n(i.backgroundColor)), e.borderColor = Zt(i.hoverBorderColor, n(i.borderColor)), e.borderWidth = Zt(i.hoverBorderWidth, i.borderWidth) }, _resolveElementOptions: function (t, e) { var i, n, a, o = this.chart, r = this.getDataset(), s = t.custom || {}, l = o.options.elements.arc, d = {}, u = { chart: o, dataIndex: e, dataset: r, datasetIndex: this.index }, h = ["backgroundColor", "borderColor", "borderWidth", "borderAlign", "hoverBackgroundColor", "hoverBorderColor", "hoverBorderWidth"]; for (i = 0, n = h.length; i < n; ++i)d[a = h[i]] = Gt([s[a], r[a], l[a]], u, e); return d }, _getRingWeightOffset: function (t) { for (var e = 0, i = 0; i < t; ++i)this.chart.isDatasetVisible(i) && (e += this._getRingWeight(i)); return e }, _getRingWeight: function (t) { return Math.max(Zt(this.chart.data.datasets[t].weight, 1), 0) }, _getVisibleDatasetWeightTotal: function () { return this._getRingWeightOffset(this.chart.data.datasets.length) } }); st._set("horizontalBar", { hover: { mode: "index", axis: "y" }, scales: { xAxes: [{ type: "linear", position: "bottom" }], yAxes: [{ type: "category", position: "left", categoryPercentage: .8, barPercentage: .9, offset: !0, gridLines: { offsetGridLines: !0 } }] }, elements: { rectangle: { borderSkipped: "left" } }, tooltips: { mode: "index", axis: "y" } }); var Jt = Yt.extend({ _getValueScaleId: function () { return this.getMeta().xAxisID }, _getIndexScaleId: function () { return this.getMeta().yAxisID } }), Qt = ut.valueOrDefault, te = ut.options.resolve, ee = ut.canvas._isPointInArea; function ie(t, e) { return Qt(t.showLine, e.showLines) } st._set("line", { showLines: !0, spanGaps: !1, hover: { mode: "label" }, scales: { xAxes: [{ type: "category", id: "x-axis-0" }], yAxes: [{ type: "linear", id: "y-axis-0" }] } }); var ne = Mt.extend({ datasetElementType: Wt.Line, dataElementType: Wt.Point, update: function (t) { var e, i, n = this, a = n.getMeta(), o = a.dataset, r = a.data || [], s = n.getScaleForId(a.yAxisID), l = n.getDataset(), d = ie(l, n.chart.options); for (d && (void 0 !== l.tension && void 0 === l.lineTension && (l.lineTension = l.tension), o._scale = s, o._datasetIndex = n.index, o._children = r, o._model = n._resolveLineOptions(o), o.pivot()), e = 0, i = r.length; e < i; ++e)n.updateElement(r[e], e, t); for (d && 0 !== o._model.tension && n.updateBezierControlPoints(), e = 0, i = r.length; e < i; ++e)r[e].pivot() }, updateElement: function (t, e, i) { var n, a, o = this, r = o.getMeta(), s = t.custom || {}, l = o.getDataset(), d = o.index, u = l.data[e], h = o.getScaleForId(r.yAxisID), c = o.getScaleForId(r.xAxisID), f = r.dataset._model, g = o._resolvePointOptions(t, e); n = c.getPixelForValue("object" == typeof u ? u : NaN, e, d), a = i ? h.getBasePixel() : o.calculatePointY(u, e, d), t._xScale = c, t._yScale = h, t._options = g, t._datasetIndex = d, t._index = e, t._model = { x: n, y: a, skip: s.skip || isNaN(n) || isNaN(a), radius: g.radius, pointStyle: g.pointStyle, rotation: g.rotation, backgroundColor: g.backgroundColor, borderColor: g.borderColor, borderWidth: g.borderWidth, tension: Qt(s.tension, f ? f.tension : 0), steppedLine: !!f && f.steppedLine, hitRadius: g.hitRadius } }, _resolvePointOptions: function (t, e) { var i, n, a, o = this.chart, r = o.data.datasets[this.index], s = t.custom || {}, l = o.options.elements.point, d = {}, u = { chart: o, dataIndex: e, dataset: r, datasetIndex: this.index }, h = { backgroundColor: "pointBackgroundColor", borderColor: "pointBorderColor", borderWidth: "pointBorderWidth", hitRadius: "pointHitRadius", hoverBackgroundColor: "pointHoverBackgroundColor", hoverBorderColor: "pointHoverBorderColor", hoverBorderWidth: "pointHoverBorderWidth", hoverRadius: "pointHoverRadius", pointStyle: "pointStyle", radius: "pointRadius", rotation: "pointRotation" }, c = Object.keys(h); for (i = 0, n = c.length; i < n; ++i)d[a = c[i]] = te([s[a], r[h[a]], r[a], l[a]], u, e); return d }, _resolveLineOptions: function (t) { var e, i, n, a = this.chart, o = a.data.datasets[this.index], r = t.custom || {}, s = a.options, l = s.elements.line, d = {}, u = ["backgroundColor", "borderWidth", "borderColor", "borderCapStyle", "borderDash", "borderDashOffset", "borderJoinStyle", "fill", "cubicInterpolationMode"]; for (e = 0, i = u.length; e < i; ++e)d[n = u[e]] = te([r[n], o[n], l[n]]); return d.spanGaps = Qt(o.spanGaps, s.spanGaps), d.tension = Qt(o.lineTension, l.tension), d.steppedLine = te([r.steppedLine, o.steppedLine, l.stepped]), d }, calculatePointY: function (t, e, i) { var n, a, o, r = this.chart, s = this.getMeta(), l = this.getScaleForId(s.yAxisID), d = 0, u = 0; if (l.options.stacked) { for (n = 0; n < i; n++)if (a = r.data.datasets[n], "line" === (o = r.getDatasetMeta(n)).type && o.yAxisID === l.id && r.isDatasetVisible(n)) { var h = Number(l.getRightValue(a.data[e])); h < 0 ? u += h || 0 : d += h || 0 } var c = Number(l.getRightValue(t)); return c < 0 ? l.getPixelForValue(u + c) : l.getPixelForValue(d + c) } return l.getPixelForValue(t) }, updateBezierControlPoints: function () { var t, e, i, n, a = this.chart, o = this.getMeta(), r = o.dataset._model, s = a.chartArea, l = o.data || []; function d(t, e, i) { return Math.max(Math.min(t, i), e) } if (r.spanGaps && (l = l.filter(function (t) { return !t._model.skip })), "monotone" === r.cubicInterpolationMode) ut.splineCurveMonotone(l); else for (t = 0, e = l.length; t < e; ++t)i = l[t]._model, n = ut.splineCurve(ut.previousItem(l, t)._model, i, ut.nextItem(l, t)._model, r.tension), i.controlPointPreviousX = n.previous.x, i.controlPointPreviousY = n.previous.y, i.controlPointNextX = n.next.x, i.controlPointNextY = n.next.y; if (a.options.elements.line.capBezierPoints) for (t = 0, e = l.length; t < e; ++t)i = l[t]._model, ee(i, s) && (t > 0 && ee(l[t - 1]._model, s) && (i.controlPointPreviousX = d(i.controlPointPreviousX, s.left, s.right), i.controlPointPreviousY = d(i.controlPointPreviousY, s.top, s.bottom)), t < l.length - 1 && ee(l[t + 1]._model, s) && (i.controlPointNextX = d(i.controlPointNextX, s.left, s.right), i.controlPointNextY = d(i.controlPointNextY, s.top, s.bottom))) }, draw: function () { var t, e = this.chart, i = this.getMeta(), n = i.data || [], a = e.chartArea, o = n.length, r = 0; for (ie(this.getDataset(), e.options) && (t = (i.dataset._model.borderWidth || 0) / 2, ut.canvas.clipArea(e.ctx, { left: a.left, right: a.right, top: a.top - t, bottom: a.bottom + t }), i.dataset.draw(), ut.canvas.unclipArea(e.ctx)); r < o; ++r)n[r].draw(a) }, setHoverStyle: function (t) { var e = t._model, i = t._options, n = ut.getHoverColor; t.$previousStyle = { backgroundColor: e.backgroundColor, borderColor: e.borderColor, borderWidth: e.borderWidth, radius: e.radius }, e.backgroundColor = Qt(i.hoverBackgroundColor, n(i.backgroundColor)), e.borderColor = Qt(i.hoverBorderColor, n(i.borderColor)), e.borderWidth = Qt(i.hoverBorderWidth, i.borderWidth), e.radius = Qt(i.hoverRadius, i.radius) } }), ae = ut.options.resolve; st._set("polarArea", { scale: { type: "radialLinear", angleLines: { display: !1 }, gridLines: { circular: !0 }, pointLabels: { display: !1 }, ticks: { beginAtZero: !0 } }, animation: { animateRotate: !0, animateScale: !0 }, startAngle: -.5 * Math.PI, legendCallback: function (t) { var e = []; e.push(''); var i = t.data, n = i.datasets, a = i.labels; if (n.length) for (var o = 0; o < n[0].data.length; ++o)e.push(' '), a[o] && e.push(a[o]), e.push(" "); return e.push(" "), e.join("") }, legend: { labels: { generateLabels: function (t) { var e = t.data; return e.labels.length && e.datasets.length ? e.labels.map(function (i, n) { var a = t.getDatasetMeta(0), o = e.datasets[0], r = a.data[n].custom || {}, s = t.options.elements.arc; return { text: i, fillStyle: ae([r.backgroundColor, o.backgroundColor, s.backgroundColor], void 0, n), strokeStyle: ae([r.borderColor, o.borderColor, s.borderColor], void 0, n), lineWidth: ae([r.borderWidth, o.borderWidth, s.borderWidth], void 0, n), hidden: isNaN(o.data[n]) || a.data[n].hidden, index: n } }) : [] } }, onClick: function (t, e) { var i, n, a, o = e.index, r = this.chart; for (i = 0, n = (r.data.datasets || []).length; i < n; ++i)(a = r.getDatasetMeta(i)).data[o].hidden = !a.data[o].hidden; r.update() } }, tooltips: { callbacks: { title: function () { return "" }, label: function (t, e) { return e.labels[t.index] + ": " + t.yLabel } } } }); var oe = Mt.extend({ dataElementType: Wt.Arc, linkScales: ut.noop, update: function (t) { var e, i, n, a = this, o = a.getDataset(), r = a.getMeta(), s = a.chart.options.startAngle || 0, l = a._starts = [], d = a._angles = [], u = r.data; for (a._updateRadius(), r.count = a.countVisibleElements(), e = 0, i = o.data.length; e < i; e++)l[e] = s, n = a._computeAngle(e), d[e] = n, s += n; for (e = 0, i = u.length; e < i; ++e)u[e]._options = a._resolveElementOptions(u[e], e), a.updateElement(u[e], e, t) }, _updateRadius: function () { var t = this, e = t.chart, i = e.chartArea, n = e.options, a = Math.min(i.right - i.left, i.bottom - i.top); e.outerRadius = Math.max(a / 2, 0), e.innerRadius = Math.max(n.cutoutPercentage ? e.outerRadius / 100 * n.cutoutPercentage : 1, 0), e.radiusLength = (e.outerRadius - e.innerRadius) / e.getVisibleDatasetCount(), t.outerRadius = e.outerRadius - e.radiusLength * t.index, t.innerRadius = t.outerRadius - e.radiusLength }, updateElement: function (t, e, i) { var n = this, a = n.chart, o = n.getDataset(), r = a.options, s = r.animation, l = a.scale, d = a.data.labels, u = l.xCenter, h = l.yCenter, c = r.startAngle, f = t.hidden ? 0 : l.getDistanceFromCenterForValue(o.data[e]), g = n._starts[e], p = g + (t.hidden ? 0 : n._angles[e]), m = s.animateScale ? 0 : l.getDistanceFromCenterForValue(o.data[e]), v = t._options || {}; ut.extend(t, { _datasetIndex: n.index, _index: e, _scale: l, _model: { backgroundColor: v.backgroundColor, borderColor: v.borderColor, borderWidth: v.borderWidth, borderAlign: v.borderAlign, x: u, y: h, innerRadius: 0, outerRadius: i ? m : f, startAngle: i && s.animateRotate ? c : g, endAngle: i && s.animateRotate ? c : p, label: ut.valueAtIndexOrDefault(d, e, d[e]) } }), t.pivot() }, countVisibleElements: function () { var t = this.getDataset(), e = this.getMeta(), i = 0; return ut.each(e.data, function (e, n) { isNaN(t.data[n]) || e.hidden || i++ }), i }, setHoverStyle: function (t) { var e = t._model, i = t._options, n = ut.getHoverColor, a = ut.valueOrDefault; t.$previousStyle = { backgroundColor: e.backgroundColor, borderColor: e.borderColor, borderWidth: e.borderWidth }, e.backgroundColor = a(i.hoverBackgroundColor, n(i.backgroundColor)), e.borderColor = a(i.hoverBorderColor, n(i.borderColor)), e.borderWidth = a(i.hoverBorderWidth, i.borderWidth) }, _resolveElementOptions: function (t, e) { var i, n, a, o = this.chart, r = this.getDataset(), s = t.custom || {}, l = o.options.elements.arc, d = {}, u = { chart: o, dataIndex: e, dataset: r, datasetIndex: this.index }, h = ["backgroundColor", "borderColor", "borderWidth", "borderAlign", "hoverBackgroundColor", "hoverBorderColor", "hoverBorderWidth"]; for (i = 0, n = h.length; i < n; ++i)d[a = h[i]] = ae([s[a], r[a], l[a]], u, e); return d }, _computeAngle: function (t) { var e = this, i = this.getMeta().count, n = e.getDataset(), a = e.getMeta(); if (isNaN(n.data[t]) || a.data[t].hidden) return 0; var o = { chart: e.chart, dataIndex: t, dataset: n, datasetIndex: e.index }; return ae([e.chart.options.elements.arc.angle, 2 * Math.PI / i], o, t) } }); st._set("pie", ut.clone(st.doughnut)), st._set("pie", { cutoutPercentage: 0 }); var re = $t, se = ut.valueOrDefault, le = ut.options.resolve; st._set("radar", { scale: { type: "radialLinear" }, elements: { line: { tension: 0 } } }); var de = Mt.extend({ datasetElementType: Wt.Line, dataElementType: Wt.Point, linkScales: ut.noop, update: function (t) { var e, i, n = this, a = n.getMeta(), o = a.dataset, r = a.data || [], s = n.chart.scale, l = n.getDataset(); for (void 0 !== l.tension && void 0 === l.lineTension && (l.lineTension = l.tension), o._scale = s, o._datasetIndex = n.index, o._children = r, o._loop = !0, o._model = n._resolveLineOptions(o), o.pivot(), e = 0, i = r.length; e < i; ++e)n.updateElement(r[e], e, t); for (n.updateBezierControlPoints(), e = 0, i = r.length; e < i; ++e)r[e].pivot() }, updateElement: function (t, e, i) { var n = this, a = t.custom || {}, o = n.getDataset(), r = n.chart.scale, s = r.getPointPositionForValue(e, o.data[e]), l = n._resolvePointOptions(t, e), d = n.getMeta().dataset._model, u = i ? r.xCenter : s.x, h = i ? r.yCenter : s.y; t._scale = r, t._options = l, t._datasetIndex = n.index, t._index = e, t._model = { x: u, y: h, skip: a.skip || isNaN(u) || isNaN(h), radius: l.radius, pointStyle: l.pointStyle, rotation: l.rotation, backgroundColor: l.backgroundColor, borderColor: l.borderColor, borderWidth: l.borderWidth, tension: se(a.tension, d ? d.tension : 0), hitRadius: l.hitRadius } }, _resolvePointOptions: function (t, e) { var i, n, a, o = this.chart, r = o.data.datasets[this.index], s = t.custom || {}, l = o.options.elements.point, d = {}, u = { chart: o, dataIndex: e, dataset: r, datasetIndex: this.index }, h = { backgroundColor: "pointBackgroundColor", borderColor: "pointBorderColor", borderWidth: "pointBorderWidth", hitRadius: "pointHitRadius", hoverBackgroundColor: "pointHoverBackgroundColor", hoverBorderColor: "pointHoverBorderColor", hoverBorderWidth: "pointHoverBorderWidth", hoverRadius: "pointHoverRadius", pointStyle: "pointStyle", radius: "pointRadius", rotation: "pointRotation" }, c = Object.keys(h); for (i = 0, n = c.length; i < n; ++i)d[a = c[i]] = le([s[a], r[h[a]], r[a], l[a]], u, e); return d }, _resolveLineOptions: function (t) { var e, i, n, a = this.chart, o = a.data.datasets[this.index], r = t.custom || {}, s = a.options.elements.line, l = {}, d = ["backgroundColor", "borderWidth", "borderColor", "borderCapStyle", "borderDash", "borderDashOffset", "borderJoinStyle", "fill"]; for (e = 0, i = d.length; e < i; ++e)l[n = d[e]] = le([r[n], o[n], s[n]]); return l.tension = se(o.lineTension, s.tension), l }, updateBezierControlPoints: function () { var t, e, i, n, a = this.getMeta(), o = this.chart.chartArea, r = a.data || []; function s(t, e, i) { return Math.max(Math.min(t, i), e) } for (t = 0, e = r.length; t < e; ++t)i = r[t]._model, n = ut.splineCurve(ut.previousItem(r, t, !0)._model, i, ut.nextItem(r, t, !0)._model, i.tension), i.controlPointPreviousX = s(n.previous.x, o.left, o.right), i.controlPointPreviousY = s(n.previous.y, o.top, o.bottom), i.controlPointNextX = s(n.next.x, o.left, o.right), i.controlPointNextY = s(n.next.y, o.top, o.bottom) }, setHoverStyle: function (t) { var e = t._model, i = t._options, n = ut.getHoverColor; t.$previousStyle = { backgroundColor: e.backgroundColor, borderColor: e.borderColor, borderWidth: e.borderWidth, radius: e.radius }, e.backgroundColor = se(i.hoverBackgroundColor, n(i.backgroundColor)), e.borderColor = se(i.hoverBorderColor, n(i.borderColor)), e.borderWidth = se(i.hoverBorderWidth, i.borderWidth), e.radius = se(i.hoverRadius, i.radius) } }); st._set("scatter", { hover: { mode: "single" }, scales: { xAxes: [{ id: "x-axis-1", type: "linear", position: "bottom" }], yAxes: [{ id: "y-axis-1", type: "linear", position: "left" }] }, showLines: !1, tooltips: { callbacks: { title: function () { return "" }, label: function (t) { return "(" + t.xLabel + ", " + t.yLabel + ")" } } } }); var ue = { bar: Yt, bubble: Kt, doughnut: $t, horizontalBar: Jt, line: ne, polarArea: oe, pie: re, radar: de, scatter: ne }; function he(t, e) { return t.native ? { x: t.x, y: t.y } : ut.getRelativePosition(t, e) } function ce(t, e) { var i, n, a, o, r; for (n = 0, o = t.data.datasets.length; n < o; ++n)if (t.isDatasetVisible(n)) for (a = 0, r = (i = t.getDatasetMeta(n)).data.length; a < r; ++a) { var s = i.data[a]; s._view.skip || e(s) } } function fe(t, e) { var i = []; return ce(t, function (t) { t.inRange(e.x, e.y) && i.push(t) }), i } function ge(t, e, i, n) { var a = Number.POSITIVE_INFINITY, o = []; return ce(t, function (t) { if (!i || t.inRange(e.x, e.y)) { var r = t.getCenterPoint(), s = n(e, r); s < a ? (o = [t], a = s) : s === a && o.push(t) } }), o } function pe(t) { var e = -1 !== t.indexOf("x"), i = -1 !== t.indexOf("y"); return function (t, n) { var a = e ? Math.abs(t.x - n.x) : 0, o = i ? Math.abs(t.y - n.y) : 0; return Math.sqrt(Math.pow(a, 2) + Math.pow(o, 2)) } } function me(t, e, i) { var n = he(e, t); i.axis = i.axis || "x"; var a = pe(i.axis), o = i.intersect ? fe(t, n) : ge(t, n, !1, a), r = []; return o.length ? (t.data.datasets.forEach(function (e, i) { if (t.isDatasetVisible(i)) { var n = t.getDatasetMeta(i).data[o[0]._index]; n && !n._view.skip && r.push(n) } }), r) : [] } var ve = { modes: { single: function (t, e) { var i = he(e, t), n = []; return ce(t, function (t) { if (t.inRange(i.x, i.y)) return n.push(t), n }), n.slice(0, 1) }, label: me, index: me, dataset: function (t, e, i) { var n = he(e, t); i.axis = i.axis || "xy"; var a = pe(i.axis), o = i.intersect ? fe(t, n) : ge(t, n, !1, a); return o.length > 0 && (o = t.getDatasetMeta(o[0]._datasetIndex).data), o }, "x-axis": function (t, e) { return me(t, e, { intersect: !1 }) }, point: function (t, e) { return fe(t, he(e, t)) }, nearest: function (t, e, i) { var n = he(e, t); i.axis = i.axis || "xy"; var a = pe(i.axis); return ge(t, n, i.intersect, a) }, x: function (t, e, i) { var n = he(e, t), a = [], o = !1; return ce(t, function (t) { t.inXRange(n.x) && a.push(t), t.inRange(n.x, n.y) && (o = !0) }), i.intersect && !o && (a = []), a }, y: function (t, e, i) { var n = he(e, t), a = [], o = !1; return ce(t, function (t) { t.inYRange(n.y) && a.push(t), t.inRange(n.x, n.y) && (o = !0) }), i.intersect && !o && (a = []), a } } }; function be(t, e) { return ut.where(t, function (t) { return t.position === e }) } function xe(t, e) { t.forEach(function (t, e) { return t._tmpIndex_ = e, t }), t.sort(function (t, i) { var n = e ? i : t, a = e ? t : i; return n.weight === a.weight ? n._tmpIndex_ - a._tmpIndex_ : n.weight - a.weight }), t.forEach(function (t) { delete t._tmpIndex_ }) } function ye(t, e) { ut.each(t, function (t) { e[t.position] += t.isHorizontal() ? t.height : t.width }) } st._set("global", { layout: { padding: { top: 0, right: 0, bottom: 0, left: 0 } } }); var ke = { defaults: {}, addBox: function (t, e) { t.boxes || (t.boxes = []), e.fullWidth = e.fullWidth || !1, e.position = e.position || "top", e.weight = e.weight || 0, t.boxes.push(e) }, removeBox: function (t, e) { var i = t.boxes ? t.boxes.indexOf(e) : -1; -1 !== i && t.boxes.splice(i, 1) }, configure: function (t, e, i) { for (var n, a = ["fullWidth", "position", "weight"], o = a.length, r = 0; r < o; ++r)n = a[r], i.hasOwnProperty(n) && (e[n] = i[n]) }, update: function (t, e, i) { if (t) { var n = t.options.layout || {}, a = ut.options.toPadding(n.padding), o = a.left, r = a.right, s = a.top, l = a.bottom, d = be(t.boxes, "left"), u = be(t.boxes, "right"), h = be(t.boxes, "top"), c = be(t.boxes, "bottom"), f = be(t.boxes, "chartArea"); xe(d, !0), xe(u, !1), xe(h, !0), xe(c, !1); var g, p = d.concat(u), m = h.concat(c), v = p.concat(m), b = e - o - r, x = i - s - l, y = (e - b / 2) / p.length, k = b, w = x, M = { top: s, left: o, bottom: l, right: r }, _ = []; ut.each(v, function (t) { var e, i = t.isHorizontal(); i ? (e = t.update(t.fullWidth ? b : k, x / 2), w -= e.height) : (e = t.update(y, w), k -= e.width), _.push({ horizontal: i, width: e.width, box: t }) }), g = function (t) { var e = 0, i = 0, n = 0, a = 0; return ut.each(t, function (t) { if (t.getPadding) { var o = t.getPadding(); e = Math.max(e, o.top), i = Math.max(i, o.left), n = Math.max(n, o.bottom), a = Math.max(a, o.right) } }), { top: e, left: i, bottom: n, right: a } }(v), ut.each(p, T), ye(p, M), ut.each(m, T), ye(m, M), ut.each(p, function (t) { var e = ut.findNextWhere(_, function (e) { return e.box === t }), i = { left: 0, right: 0, top: M.top, bottom: M.bottom }; e && t.update(e.width, w, i) }), ye(v, M = { top: s, left: o, bottom: l, right: r }); var C = Math.max(g.left - M.left, 0); M.left += C, M.right += Math.max(g.right - M.right, 0); var S = Math.max(g.top - M.top, 0); M.top += S, M.bottom += Math.max(g.bottom - M.bottom, 0); var P = i - M.top - M.bottom, I = e - M.left - M.right; I === k && P === w || (ut.each(p, function (t) { t.height = P }), ut.each(m, function (t) { t.fullWidth || (t.width = I) }), w = P, k = I); var A = o + C, D = s + S; ut.each(d.concat(h), F), A += k, D += w, ut.each(u, F), ut.each(c, F), t.chartArea = { left: M.left, top: M.top, right: M.left + k, bottom: M.top + w }, ut.each(f, function (e) { e.left = t.chartArea.left, e.top = t.chartArea.top, e.right = t.chartArea.right, e.bottom = t.chartArea.bottom, e.update(k, w) }) } function T(t) { var e = ut.findNextWhere(_, function (e) { return e.box === t }); if (e) if (e.horizontal) { var i = { left: Math.max(M.left, g.left), right: Math.max(M.right, g.right), top: 0, bottom: 0 }; t.update(t.fullWidth ? b : k, x / 2, i) } else t.update(e.width, w) } function F(t) { t.isHorizontal() ? (t.left = t.fullWidth ? o : M.left, t.right = t.fullWidth ? e - r : M.left + k, t.top = D, t.bottom = D + t.height, D = t.bottom) : (t.left = A, t.right = A + t.width, t.top = M.top, t.bottom = M.top + w, A = t.right) } } }; var we, Me = (we = Object.freeze({ default: "@keyframes chartjs-render-animation{from{opacity:.99}to{opacity:1}}.chartjs-render-monitor{animation:chartjs-render-animation 1ms}.chartjs-size-monitor,.chartjs-size-monitor-expand,.chartjs-size-monitor-shrink{position:absolute;direction:ltr;left:0;top:0;right:0;bottom:0;overflow:hidden;pointer-events:none;visibility:hidden;z-index:-1}.chartjs-size-monitor-expand>div{position:absolute;width:1000000px;height:1000000px;left:0;top:0}.chartjs-size-monitor-shrink>div{position:absolute;width:200%;height:200%;left:0;top:0}" })) && we.default || we, _e = "$chartjs", Ce = "chartjs-size-monitor", Se = "chartjs-render-monitor", Pe = "chartjs-render-animation", Ie = ["animationstart", "webkitAnimationStart"], Ae = { touchstart: "mousedown", touchmove: "mousemove", touchend: "mouseup", pointerenter: "mouseenter", pointerdown: "mousedown", pointermove: "mousemove", pointerup: "mouseup", pointerleave: "mouseout", pointerout: "mouseout" }; function De(t, e) { var i = ut.getStyle(t, e), n = i && i.match(/^(\d+)(\.\d+)?px$/); return n ? Number(n[1]) : void 0 } var Te = !!function () { var t = !1; try { var e = Object.defineProperty({}, "passive", { get: function () { t = !0 } }); window.addEventListener("e", null, e) } catch (t) { } return t }() && { passive: !0 }; function Fe(t, e, i) { t.addEventListener(e, i, Te) } function Le(t, e, i) { t.removeEventListener(e, i, Te) } function Re(t, e, i, n, a) { return { type: t, chart: e, native: a || null, x: void 0 !== i ? i : null, y: void 0 !== n ? n : null } } function Oe(t) { var e = document.createElement("div"); return e.className = t || "", e } function ze(t, e, i) { var n, a, o, r, s = t[_e] || (t[_e] = {}), l = s.resizer = function (t) { var e = Oe(Ce), i = Oe(Ce + "-expand"), n = Oe(Ce + "-shrink"); i.appendChild(Oe()), n.appendChild(Oe()), e.appendChild(i), e.appendChild(n), e._reset = function () { i.scrollLeft = 1e6, i.scrollTop = 1e6, n.scrollLeft = 1e6, n.scrollTop = 1e6 }; var a = function () { e._reset(), t() }; return Fe(i, "scroll", a.bind(i, "expand")), Fe(n, "scroll", a.bind(n, "shrink")), e }((n = function () { if (s.resizer) { var n = i.options.maintainAspectRatio && t.parentNode, a = n ? n.clientWidth : 0; e(Re("resize", i)), n && n.clientWidth < a && i.canvas && e(Re("resize", i)) } }, o = !1, r = [], function () { r = Array.prototype.slice.call(arguments), a = a || this, o || (o = !0, ut.requestAnimFrame.call(window, function () { o = !1, n.apply(a, r) })) })); !function (t, e) { var i = t[_e] || (t[_e] = {}), n = i.renderProxy = function (t) { t.animationName === Pe && e() }; ut.each(Ie, function (e) { Fe(t, e, n) }), i.reflow = !!t.offsetParent, t.classList.add(Se) }(t, function () { if (s.resizer) { var e = t.parentNode; e && e !== l.parentNode && e.insertBefore(l, e.firstChild), l._reset() } }) } function Be(t) { var e = t[_e] || {}, i = e.resizer; delete e.resizer, function (t) { var e = t[_e] || {}, i = e.renderProxy; i && (ut.each(Ie, function (e) { Le(t, e, i) }), delete e.renderProxy), t.classList.remove(Se) }(t), i && i.parentNode && i.parentNode.removeChild(i) } var Ne = { disableCSSInjection: !1, _enabled: "undefined" != typeof window && "undefined" != typeof document, _ensureLoaded: function () { var t, e, i; this._loaded || (this._loaded = !0, this.disableCSSInjection || (e = Me, i = (t = this)._style || document.createElement("style"), t._style || (t._style = i, e = "/* Chart.js */\n" + e, i.setAttribute("type", "text/css"), document.getElementsByTagName("head")[0].appendChild(i)), i.appendChild(document.createTextNode(e)))) }, acquireContext: function (t, e) { "string" == typeof t ? t = document.getElementById(t) : t.length && (t = t[0]), t && t.canvas && (t = t.canvas); var i = t && t.getContext && t.getContext("2d"); return this._ensureLoaded(), i && i.canvas === t ? (function (t, e) { var i = t.style, n = t.getAttribute("height"), a = t.getAttribute("width"); if (t[_e] = { initial: { height: n, width: a, style: { display: i.display, height: i.height, width: i.width } } }, i.display = i.display || "block", null === a || "" === a) { var o = De(t, "width"); void 0 !== o && (t.width = o) } if (null === n || "" === n) if ("" === t.style.height) t.height = t.width / (e.options.aspectRatio || 2); else { var r = De(t, "height"); void 0 !== o && (t.height = r) } }(t, e), i) : null }, releaseContext: function (t) { var e = t.canvas; if (e[_e]) { var i = e[_e].initial;["height", "width"].forEach(function (t) { var n = i[t]; ut.isNullOrUndef(n) ? e.removeAttribute(t) : e.setAttribute(t, n) }), ut.each(i.style || {}, function (t, i) { e.style[i] = t }), e.width = e.width, delete e[_e] } }, addEventListener: function (t, e, i) { var n = t.canvas; if ("resize" !== e) { var a = i[_e] || (i[_e] = {}); Fe(n, e, (a.proxies || (a.proxies = {}))[t.id + "_" + e] = function (e) { i(function (t, e) { var i = Ae[t.type] || t.type, n = ut.getRelativePosition(t, e); return Re(i, e, n.x, n.y, t) }(e, t)) }) } else ze(n, i, t) }, removeEventListener: function (t, e, i) { var n = t.canvas; if ("resize" !== e) { var a = ((i[_e] || {}).proxies || {})[t.id + "_" + e]; a && Le(n, e, a) } else Be(n) } }; ut.addEvent = Fe, ut.removeEvent = Le; var We = Ne._enabled ? Ne : { acquireContext: function (t) { return t && t.canvas && (t = t.canvas), t && t.getContext("2d") || null } }, Ve = ut.extend({ initialize: function () { }, acquireContext: function () { }, releaseContext: function () { }, addEventListener: function () { }, removeEventListener: function () { } }, We); st._set("global", { plugins: {} }); var Ee = { _plugins: [], _cacheId: 0, register: function (t) { var e = this._plugins;[].concat(t).forEach(function (t) { -1 === e.indexOf(t) && e.push(t) }), this._cacheId++ }, unregister: function (t) { var e = this._plugins;[].concat(t).forEach(function (t) { var i = e.indexOf(t); -1 !== i && e.splice(i, 1) }), this._cacheId++ }, clear: function () { this._plugins = [], this._cacheId++ }, count: function () { return this._plugins.length }, getAll: function () { return this._plugins }, notify: function (t, e, i) { var n, a, o, r, s, l = this.descriptors(t), d = l.length; for (n = 0; n < d; ++n)if ("function" == typeof (s = (o = (a = l[n]).plugin)[e]) && ((r = [t].concat(i || [])).push(a.options), !1 === s.apply(o, r))) return !1; return !0 }, descriptors: function (t) { var e = t.$plugins || (t.$plugins = {}); if (e.id === this._cacheId) return e.descriptors; var i = [], n = [], a = t && t.config || {}, o = a.options && a.options.plugins || {}; return this._plugins.concat(a.plugins || []).forEach(function (t) { if (-1 === i.indexOf(t)) { var e = t.id, a = o[e]; !1 !== a && (!0 === a && (a = ut.clone(st.global.plugins[e])), i.push(t), n.push({ plugin: t, options: a || {} })) } }), e.descriptors = n, e.id = this._cacheId, n }, _invalidate: function (t) { delete t.$plugins } }, He = { constructors: {}, defaults: {}, registerScaleType: function (t, e, i) { this.constructors[t] = e, this.defaults[t] = ut.clone(i) }, getScaleConstructor: function (t) { return this.constructors.hasOwnProperty(t) ? this.constructors[t] : void 0 }, getScaleDefaults: function (t) { return this.defaults.hasOwnProperty(t) ? ut.merge({}, [st.scale, this.defaults[t]]) : {} }, updateScaleDefaults: function (t, e) { this.defaults.hasOwnProperty(t) && (this.defaults[t] = ut.extend(this.defaults[t], e)) }, addScalesToLayout: function (t) { ut.each(t.scales, function (e) { e.fullWidth = e.options.fullWidth, e.position = e.options.position, e.weight = e.options.weight, ke.addBox(t, e) }) } }, je = ut.valueOrDefault; st._set("global", { tooltips: { enabled: !0, custom: null, mode: "nearest", position: "average", intersect: !0, backgroundColor: "rgba(0,0,0,0.8)", titleFontStyle: "bold", titleSpacing: 2, titleMarginBottom: 6, titleFontColor: "#fff", titleAlign: "left", bodySpacing: 2, bodyFontColor: "#fff", bodyAlign: "left", footerFontStyle: "bold", footerSpacing: 2, footerMarginTop: 6, footerFontColor: "#fff", footerAlign: "left", yPadding: 6, xPadding: 6, caretPadding: 2, caretSize: 5, cornerRadius: 6, multiKeyBackground: "#fff", displayColors: !0, borderColor: "rgba(0,0,0,0)", borderWidth: 0, callbacks: { beforeTitle: ut.noop, title: function (t, e) { var i = "", n = e.labels, a = n ? n.length : 0; if (t.length > 0) { var o = t[0]; o.label ? i = o.label : o.xLabel ? i = o.xLabel : a > 0 && o.index < a && (i = n[o.index]) } return i }, afterTitle: ut.noop, beforeBody: ut.noop, beforeLabel: ut.noop, label: function (t, e) { var i = e.datasets[t.datasetIndex].label || ""; return i && (i += ": "), ut.isNullOrUndef(t.value) ? i += t.yLabel : i += t.value, i }, labelColor: function (t, e) { var i = e.getDatasetMeta(t.datasetIndex).data[t.index]._view; return { borderColor: i.borderColor, backgroundColor: i.backgroundColor } }, labelTextColor: function () { return this._options.bodyFontColor }, afterLabel: ut.noop, afterBody: ut.noop, beforeFooter: ut.noop, footer: ut.noop, afterFooter: ut.noop } } }); var qe = { average: function (t) { if (!t.length) return !1; var e, i, n = 0, a = 0, o = 0; for (e = 0, i = t.length; e < i; ++e) { var r = t[e]; if (r && r.hasValue()) { var s = r.tooltipPosition(); n += s.x, a += s.y, ++o } } return { x: n / o, y: a / o } }, nearest: function (t, e) { var i, n, a, o = e.x, r = e.y, s = Number.POSITIVE_INFINITY; for (i = 0, n = t.length; i < n; ++i) { var l = t[i]; if (l && l.hasValue()) { var d = l.getCenterPoint(), u = ut.distanceBetweenPoints(e, d); u < s && (s = u, a = l) } } if (a) { var h = a.tooltipPosition(); o = h.x, r = h.y } return { x: o, y: r } } }; function Ye(t, e) { return e && (ut.isArray(e) ? Array.prototype.push.apply(t, e) : t.push(e)), t } function Ue(t) { return ("string" == typeof t || t instanceof String) && t.indexOf("\n") > -1 ? t.split("\n") : t } function Xe(t) { var e = st.global; return { xPadding: t.xPadding, yPadding: t.yPadding, xAlign: t.xAlign, yAlign: t.yAlign, bodyFontColor: t.bodyFontColor, _bodyFontFamily: je(t.bodyFontFamily, e.defaultFontFamily), _bodyFontStyle: je(t.bodyFontStyle, e.defaultFontStyle), _bodyAlign: t.bodyAlign, bodyFontSize: je(t.bodyFontSize, e.defaultFontSize), bodySpacing: t.bodySpacing, titleFontColor: t.titleFontColor, _titleFontFamily: je(t.titleFontFamily, e.defaultFontFamily), _titleFontStyle: je(t.titleFontStyle, e.defaultFontStyle), titleFontSize: je(t.titleFontSize, e.defaultFontSize), _titleAlign: t.titleAlign, titleSpacing: t.titleSpacing, titleMarginBottom: t.titleMarginBottom, footerFontColor: t.footerFontColor, _footerFontFamily: je(t.footerFontFamily, e.defaultFontFamily), _footerFontStyle: je(t.footerFontStyle, e.defaultFontStyle), footerFontSize: je(t.footerFontSize, e.defaultFontSize), _footerAlign: t.footerAlign, footerSpacing: t.footerSpacing, footerMarginTop: t.footerMarginTop, caretSize: t.caretSize, cornerRadius: t.cornerRadius, backgroundColor: t.backgroundColor, opacity: 0, legendColorBackground: t.multiKeyBackground, displayColors: t.displayColors, borderColor: t.borderColor, borderWidth: t.borderWidth } } function Ke(t, e) { return "center" === e ? t.x + t.width / 2 : "right" === e ? t.x + t.width - t.xPadding : t.x + t.xPadding } function Ge(t) { return Ye([], Ue(t)) } var Ze = pt.extend({ initialize: function () { this._model = Xe(this._options), this._lastActive = [] }, getTitle: function () { var t = this._options.callbacks, e = t.beforeTitle.apply(this, arguments), i = t.title.apply(this, arguments), n = t.afterTitle.apply(this, arguments), a = []; return a = Ye(a, Ue(e)), a = Ye(a, Ue(i)), a = Ye(a, Ue(n)) }, getBeforeBody: function () { return Ge(this._options.callbacks.beforeBody.apply(this, arguments)) }, getBody: function (t, e) { var i = this, n = i._options.callbacks, a = []; return ut.each(t, function (t) { var o = { before: [], lines: [], after: [] }; Ye(o.before, Ue(n.beforeLabel.call(i, t, e))), Ye(o.lines, n.label.call(i, t, e)), Ye(o.after, Ue(n.afterLabel.call(i, t, e))), a.push(o) }), a }, getAfterBody: function () { return Ge(this._options.callbacks.afterBody.apply(this, arguments)) }, getFooter: function () { var t = this._options.callbacks, e = t.beforeFooter.apply(this, arguments), i = t.footer.apply(this, arguments), n = t.afterFooter.apply(this, arguments), a = []; return a = Ye(a, Ue(e)), a = Ye(a, Ue(i)), a = Ye(a, Ue(n)) }, update: function (t) { var e, i, n, a, o, r, s, l, d, u, h = this, c = h._options, f = h._model, g = h._model = Xe(c), p = h._active, m = h._data, v = { xAlign: f.xAlign, yAlign: f.yAlign }, b = { x: f.x, y: f.y }, x = { width: f.width, height: f.height }, y = { x: f.caretX, y: f.caretY }; if (p.length) { g.opacity = 1; var k = [], w = []; y = qe[c.position].call(h, p, h._eventPosition); var M = []; for (e = 0, i = p.length; e < i; ++e)M.push((n = p[e], a = void 0, o = void 0, r = void 0, s = void 0, l = void 0, d = void 0, u = void 0, a = n._xScale, o = n._yScale || n._scale, r = n._index, s = n._datasetIndex, l = n._chart.getDatasetMeta(s).controller, d = l._getIndexScale(), u = l._getValueScale(), { xLabel: a ? a.getLabelForIndex(r, s) : "", yLabel: o ? o.getLabelForIndex(r, s) : "", label: d ? "" + d.getLabelForIndex(r, s) : "", value: u ? "" + u.getLabelForIndex(r, s) : "", index: r, datasetIndex: s, x: n._model.x, y: n._model.y })); c.filter && (M = M.filter(function (t) { return c.filter(t, m) })), c.itemSort && (M = M.sort(function (t, e) { return c.itemSort(t, e, m) })), ut.each(M, function (t) { k.push(c.callbacks.labelColor.call(h, t, h._chart)), w.push(c.callbacks.labelTextColor.call(h, t, h._chart)) }), g.title = h.getTitle(M, m), g.beforeBody = h.getBeforeBody(M, m), g.body = h.getBody(M, m), g.afterBody = h.getAfterBody(M, m), g.footer = h.getFooter(M, m), g.x = y.x, g.y = y.y, g.caretPadding = c.caretPadding, g.labelColors = k, g.labelTextColors = w, g.dataPoints = M, x = function (t, e) { var i = t._chart.ctx, n = 2 * e.yPadding, a = 0, o = e.body, r = o.reduce(function (t, e) { return t + e.before.length + e.lines.length + e.after.length }, 0); r += e.beforeBody.length + e.afterBody.length; var s = e.title.length, l = e.footer.length, d = e.titleFontSize, u = e.bodyFontSize, h = e.footerFontSize; n += s * d, n += s ? (s - 1) * e.titleSpacing : 0, n += s ? e.titleMarginBottom : 0, n += r * u, n += r ? (r - 1) * e.bodySpacing : 0, n += l ? e.footerMarginTop : 0, n += l * h, n += l ? (l - 1) * e.footerSpacing : 0; var c = 0, f = function (t) { a = Math.max(a, i.measureText(t).width + c) }; return i.font = ut.fontString(d, e._titleFontStyle, e._titleFontFamily), ut.each(e.title, f), i.font = ut.fontString(u, e._bodyFontStyle, e._bodyFontFamily), ut.each(e.beforeBody.concat(e.afterBody), f), c = e.displayColors ? u + 2 : 0, ut.each(o, function (t) { ut.each(t.before, f), ut.each(t.lines, f), ut.each(t.after, f) }), c = 0, i.font = ut.fontString(h, e._footerFontStyle, e._footerFontFamily), ut.each(e.footer, f), { width: a += 2 * e.xPadding, height: n } }(this, g), b = function (t, e, i, n) { var a = t.x, o = t.y, r = t.caretSize, s = t.caretPadding, l = t.cornerRadius, d = i.xAlign, u = i.yAlign, h = r + s, c = l + s; return "right" === d ? a -= e.width : "center" === d && ((a -= e.width / 2) + e.width > n.width && (a = n.width - e.width), a < 0 && (a = 0)), "top" === u ? o += h : o -= "bottom" === u ? e.height + h : e.height / 2, "center" === u ? "left" === d ? a += h : "right" === d && (a -= h) : "left" === d ? a -= c : "right" === d && (a += c), { x: a, y: o } }(g, x, v = function (t, e) { var i, n, a, o, r, s = t._model, l = t._chart, d = t._chart.chartArea, u = "center", h = "center"; s.y < e.height ? h = "top" : s.y > l.height - e.height && (h = "bottom"); var c = (d.left + d.right) / 2, f = (d.top + d.bottom) / 2; "center" === h ? (i = function (t) { return t <= c }, n = function (t) { return t > c }) : (i = function (t) { return t <= e.width / 2 }, n = function (t) { return t >= l.width - e.width / 2 }), a = function (t) { return t + e.width + s.caretSize + s.caretPadding > l.width }, o = function (t) { return t - e.width - s.caretSize - s.caretPadding < 0 }, r = function (t) { return t <= f ? "top" : "bottom" }, i(s.x) ? (u = "left", a(s.x) && (u = "center", h = r(s.y))) : n(s.x) && (u = "right", o(s.x) && (u = "center", h = r(s.y))); var g = t._options; return { xAlign: g.xAlign ? g.xAlign : u, yAlign: g.yAlign ? g.yAlign : h } }(this, x), h._chart) } else g.opacity = 0; return g.xAlign = v.xAlign, g.yAlign = v.yAlign, g.x = b.x, g.y = b.y, g.width = x.width, g.height = x.height, g.caretX = y.x, g.caretY = y.y, h._model = g, t && c.custom && c.custom.call(h, g), h }, drawCaret: function (t, e) { var i = this._chart.ctx, n = this._view, a = this.getCaretPosition(t, e, n); i.lineTo(a.x1, a.y1), i.lineTo(a.x2, a.y2), i.lineTo(a.x3, a.y3) }, getCaretPosition: function (t, e, i) { var n, a, o, r, s, l, d = i.caretSize, u = i.cornerRadius, h = i.xAlign, c = i.yAlign, f = t.x, g = t.y, p = e.width, m = e.height; if ("center" === c) s = g + m / 2, "left" === h ? (a = (n = f) - d, o = n, r = s + d, l = s - d) : (a = (n = f + p) + d, o = n, r = s - d, l = s + d); else if ("left" === h ? (n = (a = f + u + d) - d, o = a + d) : "right" === h ? (n = (a = f + p - u - d) - d, o = a + d) : (n = (a = i.caretX) - d, o = a + d), "top" === c) s = (r = g) - d, l = r; else { s = (r = g + m) + d, l = r; var v = o; o = n, n = v } return { x1: n, x2: a, x3: o, y1: r, y2: s, y3: l } }, drawTitle: function (t, e, i) { var n = e.title; if (n.length) { t.x = Ke(e, e._titleAlign), i.textAlign = e._titleAlign, i.textBaseline = "top"; var a, o, r = e.titleFontSize, s = e.titleSpacing; for (i.fillStyle = e.titleFontColor, i.font = ut.fontString(r, e._titleFontStyle, e._titleFontFamily), a = 0, o = n.length; a < o; ++a)i.fillText(n[a], t.x, t.y), t.y += r + s, a + 1 === n.length && (t.y += e.titleMarginBottom - s) } }, drawBody: function (t, e, i) { var n, a = e.bodyFontSize, o = e.bodySpacing, r = e._bodyAlign, s = e.body, l = e.displayColors, d = e.labelColors, u = 0, h = l ? Ke(e, "left") : 0; i.textAlign = r, i.textBaseline = "top", i.font = ut.fontString(a, e._bodyFontStyle, e._bodyFontFamily), t.x = Ke(e, r); var c = function (e) { i.fillText(e, t.x + u, t.y), t.y += a + o }; i.fillStyle = e.bodyFontColor, ut.each(e.beforeBody, c), u = l && "right" !== r ? "center" === r ? a / 2 + 1 : a + 2 : 0, ut.each(s, function (o, r) { n = e.labelTextColors[r], i.fillStyle = n, ut.each(o.before, c), ut.each(o.lines, function (o) { l && (i.fillStyle = e.legendColorBackground, i.fillRect(h, t.y, a, a), i.lineWidth = 1, i.strokeStyle = d[r].borderColor, i.strokeRect(h, t.y, a, a), i.fillStyle = d[r].backgroundColor, i.fillRect(h + 1, t.y + 1, a - 2, a - 2), i.fillStyle = n), c(o) }), ut.each(o.after, c) }), u = 0, ut.each(e.afterBody, c), t.y -= o }, drawFooter: function (t, e, i) { var n = e.footer; n.length && (t.x = Ke(e, e._footerAlign), t.y += e.footerMarginTop, i.textAlign = e._footerAlign, i.textBaseline = "top", i.fillStyle = e.footerFontColor, i.font = ut.fontString(e.footerFontSize, e._footerFontStyle, e._footerFontFamily), ut.each(n, function (n) { i.fillText(n, t.x, t.y), t.y += e.footerFontSize + e.footerSpacing })) }, drawBackground: function (t, e, i, n) { i.fillStyle = e.backgroundColor, i.strokeStyle = e.borderColor, i.lineWidth = e.borderWidth; var a = e.xAlign, o = e.yAlign, r = t.x, s = t.y, l = n.width, d = n.height, u = e.cornerRadius; i.beginPath(), i.moveTo(r + u, s), "top" === o && this.drawCaret(t, n), i.lineTo(r + l - u, s), i.quadraticCurveTo(r + l, s, r + l, s + u), "center" === o && "right" === a && this.drawCaret(t, n), i.lineTo(r + l, s + d - u), i.quadraticCurveTo(r + l, s + d, r + l - u, s + d), "bottom" === o && this.drawCaret(t, n), i.lineTo(r + u, s + d), i.quadraticCurveTo(r, s + d, r, s + d - u), "center" === o && "left" === a && this.drawCaret(t, n), i.lineTo(r, s + u), i.quadraticCurveTo(r, s, r + u, s), i.closePath(), i.fill(), e.borderWidth > 0 && i.stroke() }, draw: function () { var t = this._chart.ctx, e = this._view; if (0 !== e.opacity) { var i = { width: e.width, height: e.height }, n = { x: e.x, y: e.y }, a = Math.abs(e.opacity < .001) ? 0 : e.opacity, o = e.title.length || e.beforeBody.length || e.body.length || e.afterBody.length || e.footer.length; this._options.enabled && o && (t.save(), t.globalAlpha = a, this.drawBackground(n, e, t, i), n.y += e.yPadding, this.drawTitle(n, e, t), this.drawBody(n, e, t), this.drawFooter(n, e, t), t.restore()) } }, handleEvent: function (t) { var e, i = this, n = i._options; return i._lastActive = i._lastActive || [], "mouseout" === t.type ? i._active = [] : i._active = i._chart.getElementsAtEventForMode(t, n.mode, n), (e = !ut.arrayEquals(i._active, i._lastActive)) && (i._lastActive = i._active, (n.enabled || n.custom) && (i._eventPosition = { x: t.x, y: t.y }, i.update(!0), i.pivot())), e } }), $e = qe, Je = Ze; Je.positioners = $e; var Qe = ut.valueOrDefault; function ti() { return ut.merge({}, [].slice.call(arguments), { merger: function (t, e, i, n) { if ("xAxes" === t || "yAxes" === t) { var a, o, r, s = i[t].length; for (e[t] || (e[t] = []), a = 0; a < s; ++a)r = i[t][a], o = Qe(r.type, "xAxes" === t ? "category" : "linear"), a >= e[t].length && e[t].push({}), !e[t][a].type || r.type && r.type !== e[t][a].type ? ut.merge(e[t][a], [He.getScaleDefaults(o), r]) : ut.merge(e[t][a], r) } else ut._merger(t, e, i, n) } }) } function ei() { return ut.merge({}, [].slice.call(arguments), { merger: function (t, e, i, n) { var a = e[t] || {}, o = i[t]; "scales" === t ? e[t] = ti(a, o) : "scale" === t ? e[t] = ut.merge(a, [He.getScaleDefaults(o.type), o]) : ut._merger(t, e, i, n) } }) } function ii(t) { return "top" === t || "bottom" === t } st._set("global", { elements: {}, events: ["mousemove", "mouseout", "click", "touchstart", "touchmove"], hover: { onHover: null, mode: "nearest", intersect: !0, animationDuration: 400 }, onClick: null, maintainAspectRatio: !0, responsive: !0, responsiveAnimationDuration: 0 }); var ni = function (t, e) { return this.construct(t, e), this }; ut.extend(ni.prototype, { construct: function (t, e) { var i = this; e = function (t) { var e = (t = t || {}).data = t.data || {}; return e.datasets = e.datasets || [], e.labels = e.labels || [], t.options = ei(st.global, st[t.type], t.options || {}), t }(e); var n = Ve.acquireContext(t, e), a = n && n.canvas, o = a && a.height, r = a && a.width; i.id = ut.uid(), i.ctx = n, i.canvas = a, i.config = e, i.width = r, i.height = o, i.aspectRatio = o ? r / o : null, i.options = e.options, i._bufferedRender = !1, i.chart = i, i.controller = i, ni.instances[i.id] = i, Object.defineProperty(i, "data", { get: function () { return i.config.data }, set: function (t) { i.config.data = t } }), n && a ? (i.initialize(), i.update()) : console.error("Failed to create chart: can't acquire context from the given item") }, initialize: function () { var t = this; return Ee.notify(t, "beforeInit"), ut.retinaScale(t, t.options.devicePixelRatio), t.bindEvents(), t.options.responsive && t.resize(!0), t.ensureScalesHaveIDs(), t.buildOrUpdateScales(), t.initToolTip(), Ee.notify(t, "afterInit"), t }, clear: function () { return ut.canvas.clear(this), this }, stop: function () { return bt.cancelAnimation(this), this }, resize: function (t) { var e = this, i = e.options, n = e.canvas, a = i.maintainAspectRatio && e.aspectRatio || null, o = Math.max(0, Math.floor(ut.getMaximumWidth(n))), r = Math.max(0, Math.floor(a ? o / a : ut.getMaximumHeight(n))); if ((e.width !== o || e.height !== r) && (n.width = e.width = o, n.height = e.height = r, n.style.width = o + "px", n.style.height = r + "px", ut.retinaScale(e, i.devicePixelRatio), !t)) { var s = { width: o, height: r }; Ee.notify(e, "resize", [s]), i.onResize && i.onResize(e, s), e.stop(), e.update({ duration: i.responsiveAnimationDuration }) } }, ensureScalesHaveIDs: function () { var t = this.options, e = t.scales || {}, i = t.scale; ut.each(e.xAxes, function (t, e) { t.id = t.id || "x-axis-" + e }), ut.each(e.yAxes, function (t, e) { t.id = t.id || "y-axis-" + e }), i && (i.id = i.id || "scale") }, buildOrUpdateScales: function () { var t = this, e = t.options, i = t.scales || {}, n = [], a = Object.keys(i).reduce(function (t, e) { return t[e] = !1, t }, {}); e.scales && (n = n.concat((e.scales.xAxes || []).map(function (t) { return { options: t, dtype: "category", dposition: "bottom" } }), (e.scales.yAxes || []).map(function (t) { return { options: t, dtype: "linear", dposition: "left" } }))), e.scale && n.push({ options: e.scale, dtype: "radialLinear", isDefault: !0, dposition: "chartArea" }), ut.each(n, function (e) { var n = e.options, o = n.id, r = Qe(n.type, e.dtype); ii(n.position) !== ii(e.dposition) && (n.position = e.dposition), a[o] = !0; var s = null; if (o in i && i[o].type === r) (s = i[o]).options = n, s.ctx = t.ctx, s.chart = t; else { var l = He.getScaleConstructor(r); if (!l) return; s = new l({ id: o, type: r, options: n, ctx: t.ctx, chart: t }), i[s.id] = s } s.mergeTicksOptions(), e.isDefault && (t.scale = s) }), ut.each(a, function (t, e) { t || delete i[e] }), t.scales = i, He.addScalesToLayout(this) }, buildOrUpdateControllers: function () { var t = this, e = []; return ut.each(t.data.datasets, function (i, n) { var a = t.getDatasetMeta(n), o = i.type || t.config.type; if (a.type && a.type !== o && (t.destroyDatasetMeta(n), a = t.getDatasetMeta(n)), a.type = o, a.controller) a.controller.updateIndex(n), a.controller.linkScales(); else { var r = ue[a.type]; if (void 0 === r) throw new Error('"' + a.type + '" is not a chart type.'); a.controller = new r(t, n), e.push(a.controller) } }, t), e }, resetElements: function () { var t = this; ut.each(t.data.datasets, function (e, i) { t.getDatasetMeta(i).controller.reset() }, t) }, reset: function () { this.resetElements(), this.tooltip.initialize() }, update: function (t) { var e, i, n = this; if (t && "object" == typeof t || (t = { duration: t, lazy: arguments[1] }), i = (e = n).options, ut.each(e.scales, function (t) { ke.removeBox(e, t) }), i = ei(st.global, st[e.config.type], i), e.options = e.config.options = i, e.ensureScalesHaveIDs(), e.buildOrUpdateScales(), e.tooltip._options = i.tooltips, e.tooltip.initialize(), Ee._invalidate(n), !1 !== Ee.notify(n, "beforeUpdate")) { n.tooltip._data = n.data; var a = n.buildOrUpdateControllers(); ut.each(n.data.datasets, function (t, e) { n.getDatasetMeta(e).controller.buildOrUpdateElements() }, n), n.updateLayout(), n.options.animation && n.options.animation.duration && ut.each(a, function (t) { t.reset() }), n.updateDatasets(), n.tooltip.initialize(), n.lastActive = [], Ee.notify(n, "afterUpdate"), n._bufferedRender ? n._bufferedRequest = { duration: t.duration, easing: t.easing, lazy: t.lazy } : n.render(t) } }, updateLayout: function () { !1 !== Ee.notify(this, "beforeLayout") && (ke.update(this, this.width, this.height), Ee.notify(this, "afterScaleUpdate"), Ee.notify(this, "afterLayout")) }, updateDatasets: function () { if (!1 !== Ee.notify(this, "beforeDatasetsUpdate")) { for (var t = 0, e = this.data.datasets.length; t < e; ++t)this.updateDataset(t); Ee.notify(this, "afterDatasetsUpdate") } }, updateDataset: function (t) { var e = this.getDatasetMeta(t), i = { meta: e, index: t }; !1 !== Ee.notify(this, "beforeDatasetUpdate", [i]) && (e.controller.update(), Ee.notify(this, "afterDatasetUpdate", [i])) }, render: function (t) { var e = this; t && "object" == typeof t || (t = { duration: t, lazy: arguments[1] }); var i = e.options.animation, n = Qe(t.duration, i && i.duration), a = t.lazy; if (!1 !== Ee.notify(e, "beforeRender")) { var o = function (t) { Ee.notify(e, "afterRender"), ut.callback(i && i.onComplete, [t], e) }; if (i && n) { var r = new vt({ numSteps: n / 16.66, easing: t.easing || i.easing, render: function (t, e) { var i = ut.easing.effects[e.easing], n = e.currentStep, a = n / e.numSteps; t.draw(i(a), a, n) }, onAnimationProgress: i.onProgress, onAnimationComplete: o }); bt.addAnimation(e, r, n, a) } else e.draw(), o(new vt({ numSteps: 0, chart: e })); return e } }, draw: function (t) { var e = this; e.clear(), ut.isNullOrUndef(t) && (t = 1), e.transition(t), e.width <= 0 || e.height <= 0 || !1 !== Ee.notify(e, "beforeDraw", [t]) && (ut.each(e.boxes, function (t) { t.draw(e.chartArea) }, e), e.drawDatasets(t), e._drawTooltip(t), Ee.notify(e, "afterDraw", [t])) }, transition: function (t) { for (var e = 0, i = (this.data.datasets || []).length; e < i; ++e)this.isDatasetVisible(e) && this.getDatasetMeta(e).controller.transition(t); this.tooltip.transition(t) }, drawDatasets: function (t) { var e = this; if (!1 !== Ee.notify(e, "beforeDatasetsDraw", [t])) { for (var i = (e.data.datasets || []).length - 1; i >= 0; --i)e.isDatasetVisible(i) && e.drawDataset(i, t); Ee.notify(e, "afterDatasetsDraw", [t]) } }, drawDataset: function (t, e) { var i = this.getDatasetMeta(t), n = { meta: i, index: t, easingValue: e }; !1 !== Ee.notify(this, "beforeDatasetDraw", [n]) && (i.controller.draw(e), Ee.notify(this, "afterDatasetDraw", [n])) }, _drawTooltip: function (t) { var e = this.tooltip, i = { tooltip: e, easingValue: t }; !1 !== Ee.notify(this, "beforeTooltipDraw", [i]) && (e.draw(), Ee.notify(this, "afterTooltipDraw", [i])) }, getElementAtEvent: function (t) { return ve.modes.single(this, t) }, getElementsAtEvent: function (t) { return ve.modes.label(this, t, { intersect: !0 }) }, getElementsAtXAxis: function (t) { return ve.modes["x-axis"](this, t, { intersect: !0 }) }, getElementsAtEventForMode: function (t, e, i) { var n = ve.modes[e]; return "function" == typeof n ? n(this, t, i) : [] }, getDatasetAtEvent: function (t) { return ve.modes.dataset(this, t, { intersect: !0 }) }, getDatasetMeta: function (t) { var e = this.data.datasets[t]; e._meta || (e._meta = {}); var i = e._meta[this.id]; return i || (i = e._meta[this.id] = { type: null, data: [], dataset: null, controller: null, hidden: null, xAxisID: null, yAxisID: null }), i }, getVisibleDatasetCount: function () { for (var t = 0, e = 0, i = this.data.datasets.length; e < i; ++e)this.isDatasetVisible(e) && t++; return t }, isDatasetVisible: function (t) { var e = this.getDatasetMeta(t); return "boolean" == typeof e.hidden ? !e.hidden : !this.data.datasets[t].hidden }, generateLegend: function () { return this.options.legendCallback(this) }, destroyDatasetMeta: function (t) { var e = this.id, i = this.data.datasets[t], n = i._meta && i._meta[e]; n && (n.controller.destroy(), delete i._meta[e]) }, destroy: function () { var t, e, i = this, n = i.canvas; for (i.stop(), t = 0, e = i.data.datasets.length; t < e; ++t)i.destroyDatasetMeta(t); n && (i.unbindEvents(), ut.canvas.clear(i), Ve.releaseContext(i.ctx), i.canvas = null, i.ctx = null), Ee.notify(i, "destroy"), delete ni.instances[i.id] }, toBase64Image: function () { return this.canvas.toDataURL.apply(this.canvas, arguments) }, initToolTip: function () { var t = this; t.tooltip = new Je({ _chart: t, _chartInstance: t, _data: t.data, _options: t.options.tooltips }, t) }, bindEvents: function () { var t = this, e = t._listeners = {}, i = function () { t.eventHandler.apply(t, arguments) }; ut.each(t.options.events, function (n) { Ve.addEventListener(t, n, i), e[n] = i }), t.options.responsive && (i = function () { t.resize() }, Ve.addEventListener(t, "resize", i), e.resize = i) }, unbindEvents: function () { var t = this, e = t._listeners; e && (delete t._listeners, ut.each(e, function (e, i) { Ve.removeEventListener(t, i, e) })) }, updateHoverStyle: function (t, e, i) { var n, a, o, r = i ? "setHoverStyle" : "removeHoverStyle"; for (a = 0, o = t.length; a < o; ++a)(n = t[a]) && this.getDatasetMeta(n._datasetIndex).controller[r](n) }, eventHandler: function (t) { var e = this, i = e.tooltip; if (!1 !== Ee.notify(e, "beforeEvent", [t])) { e._bufferedRender = !0, e._bufferedRequest = null; var n = e.handleEvent(t); i && (n = i._start ? i.handleEvent(t) : n | i.handleEvent(t)), Ee.notify(e, "afterEvent", [t]); var a = e._bufferedRequest; return a ? e.render(a) : n && !e.animating && (e.stop(), e.render({ duration: e.options.hover.animationDuration, lazy: !0 })), e._bufferedRender = !1, e._bufferedRequest = null, e } }, handleEvent: function (t) { var e, i = this, n = i.options || {}, a = n.hover; return i.lastActive = i.lastActive || [], "mouseout" === t.type ? i.active = [] : i.active = i.getElementsAtEventForMode(t, a.mode, a), ut.callback(n.onHover || n.hover.onHover, [t.native, i.active], i), "mouseup" !== t.type && "click" !== t.type || n.onClick && n.onClick.call(i, t.native, i.active), i.lastActive.length && i.updateHoverStyle(i.lastActive, a.mode, !1), i.active.length && a.mode && i.updateHoverStyle(i.active, a.mode, !0), e = !ut.arrayEquals(i.active, i.lastActive), i.lastActive = i.active, e } }), ni.instances = {}; var ai = ni; ni.Controller = ni, ni.types = {}, ut.configMerge = ei, ut.scaleMerge = ti; function oi() { throw new Error("This method is not implemented: either no adapter can be found or an incomplete integration was provided.") } function ri(t) { this.options = t || {} } ut.extend(ri.prototype, { formats: oi, parse: oi, format: oi, add: oi, diff: oi, startOf: oi, endOf: oi, _create: function (t) { return t } }), ri.override = function (t) { ut.extend(ri.prototype, t) }; var si = { _date: ri }, li = { formatters: { values: function (t) { return ut.isArray(t) ? t : "" + t }, linear: function (t, e, i) { var n = i.length > 3 ? i[2] - i[1] : i[1] - i[0]; Math.abs(n) > 1 && t !== Math.floor(t) && (n = t - Math.floor(t)); var a = ut.log10(Math.abs(n)), o = ""; if (0 !== t) if (Math.max(Math.abs(i[0]), Math.abs(i[i.length - 1])) < 1e-4) { var r = ut.log10(Math.abs(t)); o = t.toExponential(Math.floor(r) - Math.floor(a)) } else { var s = -1 * Math.floor(a); s = Math.max(Math.min(s, 20), 0), o = t.toFixed(s) } else o = "0"; return o }, logarithmic: function (t, e, i) { var n = t / Math.pow(10, Math.floor(ut.log10(t))); return 0 === t ? "0" : 1 === n || 2 === n || 5 === n || 0 === e || e === i.length - 1 ? t.toExponential() : "" } } }, di = ut.valueOrDefault, ui = ut.valueAtIndexOrDefault; function hi(t) { var e, i, n = []; for (e = 0, i = t.length; e < i; ++e)n.push(t[e].label); return n } function ci(t, e, i) { return ut.isArray(e) ? ut.longestText(t, i, e) : t.measureText(e).width } st._set("scale", { display: !0, position: "left", offset: !1, gridLines: { display: !0, color: "rgba(0, 0, 0, 0.1)", lineWidth: 1, drawBorder: !0, drawOnChartArea: !0, drawTicks: !0, tickMarkLength: 10, zeroLineWidth: 1, zeroLineColor: "rgba(0,0,0,0.25)", zeroLineBorderDash: [], zeroLineBorderDashOffset: 0, offsetGridLines: !1, borderDash: [], borderDashOffset: 0 }, scaleLabel: { display: !1, labelString: "", padding: { top: 4, bottom: 4 } }, ticks: { beginAtZero: !1, minRotation: 0, maxRotation: 50, mirror: !1, padding: 0, reverse: !1, display: !0, autoSkip: !0, autoSkipPadding: 0, labelOffset: 0, callback: li.formatters.values, minor: {}, major: {} } }); var fi = pt.extend({ getPadding: function () { return { left: this.paddingLeft || 0, top: this.paddingTop || 0, right: this.paddingRight || 0, bottom: this.paddingBottom || 0 } }, getTicks: function () { return this._ticks }, mergeTicksOptions: function () { var t = this.options.ticks; for (var e in !1 === t.minor && (t.minor = { display: !1 }), !1 === t.major && (t.major = { display: !1 }), t) "major" !== e && "minor" !== e && (void 0 === t.minor[e] && (t.minor[e] = t[e]), void 0 === t.major[e] && (t.major[e] = t[e])) }, beforeUpdate: function () { ut.callback(this.options.beforeUpdate, [this]) }, update: function (t, e, i) { var n, a, o, r, s, l, d = this; for (d.beforeUpdate(), d.maxWidth = t, d.maxHeight = e, d.margins = ut.extend({ left: 0, right: 0, top: 0, bottom: 0 }, i), d._maxLabelLines = 0, d.longestLabelWidth = 0, d.longestTextCache = d.longestTextCache || {}, d.beforeSetDimensions(), d.setDimensions(), d.afterSetDimensions(), d.beforeDataLimits(), d.determineDataLimits(), d.afterDataLimits(), d.beforeBuildTicks(), s = d.buildTicks() || [], s = d.afterBuildTicks(s) || s, d.beforeTickToLabelConversion(), o = d.convertTicksToLabels(s) || d.ticks, d.afterTickToLabelConversion(), d.ticks = o, n = 0, a = o.length; n < a; ++n)r = o[n], (l = s[n]) ? l.label = r : s.push(l = { label: r, major: !1 }); return d._ticks = s, d.beforeCalculateTickRotation(), d.calculateTickRotation(), d.afterCalculateTickRotation(), d.beforeFit(), d.fit(), d.afterFit(), d.afterUpdate(), d.minSize }, afterUpdate: function () { ut.callback(this.options.afterUpdate, [this]) }, beforeSetDimensions: function () { ut.callback(this.options.beforeSetDimensions, [this]) }, setDimensions: function () { var t = this; t.isHorizontal() ? (t.width = t.maxWidth, t.left = 0, t.right = t.width) : (t.height = t.maxHeight, t.top = 0, t.bottom = t.height), t.paddingLeft = 0, t.paddingTop = 0, t.paddingRight = 0, t.paddingBottom = 0 }, afterSetDimensions: function () { ut.callback(this.options.afterSetDimensions, [this]) }, beforeDataLimits: function () { ut.callback(this.options.beforeDataLimits, [this]) }, determineDataLimits: ut.noop, afterDataLimits: function () { ut.callback(this.options.afterDataLimits, [this]) }, beforeBuildTicks: function () { ut.callback(this.options.beforeBuildTicks, [this]) }, buildTicks: ut.noop, afterBuildTicks: function (t) { var e = this; return ut.isArray(t) && t.length ? ut.callback(e.options.afterBuildTicks, [e, t]) : (e.ticks = ut.callback(e.options.afterBuildTicks, [e, e.ticks]) || e.ticks, t) }, beforeTickToLabelConversion: function () { ut.callback(this.options.beforeTickToLabelConversion, [this]) }, convertTicksToLabels: function () { var t = this.options.ticks; this.ticks = this.ticks.map(t.userCallback || t.callback, this) }, afterTickToLabelConversion: function () { ut.callback(this.options.afterTickToLabelConversion, [this]) }, beforeCalculateTickRotation: function () { ut.callback(this.options.beforeCalculateTickRotation, [this]) }, calculateTickRotation: function () { var t = this, e = t.ctx, i = t.options.ticks, n = hi(t._ticks), a = ut.options._parseFont(i); e.font = a.string; var o = i.minRotation || 0; if (n.length && t.options.display && t.isHorizontal()) for (var r, s = ut.longestText(e, a.string, n, t.longestTextCache), l = s, d = t.getPixelForTick(1) - t.getPixelForTick(0) - 6; l > d && o < i.maxRotation;) { var u = ut.toRadians(o); if (r = Math.cos(u), Math.sin(u) * s > t.maxHeight) { o--; break } o++, l = r * s } t.labelRotation = o }, afterCalculateTickRotation: function () { ut.callback(this.options.afterCalculateTickRotation, [this]) }, beforeFit: function () { ut.callback(this.options.beforeFit, [this]) }, fit: function () { var t = this, e = t.minSize = { width: 0, height: 0 }, i = hi(t._ticks), n = t.options, a = n.ticks, o = n.scaleLabel, r = n.gridLines, s = t._isVisible(), l = n.position, d = t.isHorizontal(), u = ut.options._parseFont, h = u(a), c = n.gridLines.tickMarkLength; if (e.width = d ? t.isFullWidth() ? t.maxWidth - t.margins.left - t.margins.right : t.maxWidth : s && r.drawTicks ? c : 0, e.height = d ? s && r.drawTicks ? c : 0 : t.maxHeight, o.display && s) { var f = u(o), g = ut.options.toPadding(o.padding), p = f.lineHeight + g.height; d ? e.height += p : e.width += p } if (a.display && s) { var m = ut.longestText(t.ctx, h.string, i, t.longestTextCache), v = ut.numberOfLabelLines(i), b = .5 * h.size, x = t.options.ticks.padding; if (t._maxLabelLines = v, t.longestLabelWidth = m, d) { var y = ut.toRadians(t.labelRotation), k = Math.cos(y), w = Math.sin(y) * m + h.lineHeight * v + b; e.height = Math.min(t.maxHeight, e.height + w + x), t.ctx.font = h.string; var M, _, C = ci(t.ctx, i[0], h.string), S = ci(t.ctx, i[i.length - 1], h.string), P = t.getPixelForTick(0) - t.left, I = t.right - t.getPixelForTick(i.length - 1); 0 !== t.labelRotation ? (M = "bottom" === l ? k * C : k * b, _ = "bottom" === l ? k * b : k * S) : (M = C / 2, _ = S / 2), t.paddingLeft = Math.max(M - P, 0) + 3, t.paddingRight = Math.max(_ - I, 0) + 3 } else a.mirror ? m = 0 : m += x + b, e.width = Math.min(t.maxWidth, e.width + m), t.paddingTop = h.size / 2, t.paddingBottom = h.size / 2 } t.handleMargins(), t.width = e.width, t.height = e.height }, handleMargins: function () { var t = this; t.margins && (t.paddingLeft = Math.max(t.paddingLeft - t.margins.left, 0), t.paddingTop = Math.max(t.paddingTop - t.margins.top, 0), t.paddingRight = Math.max(t.paddingRight - t.margins.right, 0), t.paddingBottom = Math.max(t.paddingBottom - t.margins.bottom, 0)) }, afterFit: function () { ut.callback(this.options.afterFit, [this]) }, isHorizontal: function () { return "top" === this.options.position || "bottom" === this.options.position }, isFullWidth: function () { return this.options.fullWidth }, getRightValue: function (t) { if (ut.isNullOrUndef(t)) return NaN; if (("number" == typeof t || t instanceof Number) && !isFinite(t)) return NaN; if (t) if (this.isHorizontal()) { if (void 0 !== t.x) return this.getRightValue(t.x) } else if (void 0 !== t.y) return this.getRightValue(t.y); return t }, getLabelForIndex: ut.noop, getPixelForValue: ut.noop, getValueForPixel: ut.noop, getPixelForTick: function (t) { var e = this, i = e.options.offset; if (e.isHorizontal()) { var n = (e.width - (e.paddingLeft + e.paddingRight)) / Math.max(e._ticks.length - (i ? 0 : 1), 1), a = n * t + e.paddingLeft; i && (a += n / 2); var o = e.left + a; return o += e.isFullWidth() ? e.margins.left : 0 } var r = e.height - (e.paddingTop + e.paddingBottom); return e.top + t * (r / (e._ticks.length - 1)) }, getPixelForDecimal: function (t) { var e = this; if (e.isHorizontal()) { var i = (e.width - (e.paddingLeft + e.paddingRight)) * t + e.paddingLeft, n = e.left + i; return n += e.isFullWidth() ? e.margins.left : 0 } return e.top + t * e.height }, getBasePixel: function () { return this.getPixelForValue(this.getBaseValue()) }, getBaseValue: function () { var t = this.min, e = this.max; return this.beginAtZero ? 0 : t < 0 && e < 0 ? e : t > 0 && e > 0 ? t : 0 }, _autoSkip: function (t) { var e, i, n = this, a = n.isHorizontal(), o = n.options.ticks.minor, r = t.length, s = !1, l = o.maxTicksLimit, d = n._tickSize() * (r - 1), u = a ? n.width - (n.paddingLeft + n.paddingRight) : n.height - (n.paddingTop + n.PaddingBottom), h = []; for (d > u && (s = 1 + Math.floor(d / u)), r > l && (s = Math.max(s, 1 + Math.floor(r / l))), e = 0; e < r; e++)i = t[e], s > 1 && e % s > 0 && delete i.label, h.push(i); return h }, _tickSize: function () { var t = this, e = t.isHorizontal(), i = t.options.ticks.minor, n = ut.toRadians(t.labelRotation), a = Math.abs(Math.cos(n)), o = Math.abs(Math.sin(n)), r = i.autoSkipPadding || 0, s = t.longestLabelWidth + r || 0, l = ut.options._parseFont(i), d = t._maxLabelLines * l.lineHeight + r || 0; return e ? d * a > s * o ? s / a : d / o : d * o < s * a ? d / a : s / o }, _isVisible: function () { var t, e, i, n = this.chart, a = this.options.display; if ("auto" !== a) return !!a; for (t = 0, e = n.data.datasets.length; t < e; ++t)if (n.isDatasetVisible(t) && ((i = n.getDatasetMeta(t)).xAxisID === this.id || i.yAxisID === this.id)) return !0; return !1 }, draw: function (t) { var e = this, i = e.options; if (e._isVisible()) { var n, a, o, r = e.chart, s = e.ctx, l = st.global.defaultFontColor, d = i.ticks.minor, u = i.ticks.major || d, h = i.gridLines, c = i.scaleLabel, f = i.position, g = 0 !== e.labelRotation, p = d.mirror, m = e.isHorizontal(), v = ut.options._parseFont, b = d.display && d.autoSkip ? e._autoSkip(e.getTicks()) : e.getTicks(), x = di(d.fontColor, l), y = v(d), k = y.lineHeight, w = di(u.fontColor, l), M = v(u), _ = d.padding, C = d.labelOffset, S = h.drawTicks ? h.tickMarkLength : 0, P = di(c.fontColor, l), I = v(c), A = ut.options.toPadding(c.padding), D = ut.toRadians(e.labelRotation), T = [], F = h.drawBorder ? ui(h.lineWidth, 0, 0) : 0, L = ut._alignPixel; "top" === f ? (n = L(r, e.bottom, F), a = e.bottom - S, o = n - F / 2) : "bottom" === f ? (n = L(r, e.top, F), a = n + F / 2, o = e.top + S) : "left" === f ? (n = L(r, e.right, F), a = e.right - S, o = n - F / 2) : (n = L(r, e.left, F), a = n + F / 2, o = e.left + S); if (ut.each(b, function (n, s) { if (!ut.isNullOrUndef(n.label)) { var l, d, u, c, v, b, x, y, w, M, P, I, A, R, O, z, B = n.label; s === e.zeroLineIndex && i.offset === h.offsetGridLines ? (l = h.zeroLineWidth, d = h.zeroLineColor, u = h.zeroLineBorderDash || [], c = h.zeroLineBorderDashOffset || 0) : (l = ui(h.lineWidth, s), d = ui(h.color, s), u = h.borderDash || [], c = h.borderDashOffset || 0); var N = ut.isArray(B) ? B.length : 1, W = function (t, e, i) { var n = t.getPixelForTick(e); return i && (1 === t.getTicks().length ? n -= t.isHorizontal() ? Math.max(n - t.left, t.right - n) : Math.max(n - t.top, t.bottom - n) : n -= 0 === e ? (t.getPixelForTick(1) - n) / 2 : (n - t.getPixelForTick(e - 1)) / 2), n }(e, s, h.offsetGridLines); if (m) { var V = S + _; W < e.left - 1e-7 && (d = "rgba(0,0,0,0)"), v = x = w = P = L(r, W, l), b = a, y = o, A = e.getPixelForTick(s) + C, "top" === f ? (M = L(r, t.top, F) + F / 2, I = t.bottom, O = ((g ? 1 : .5) - N) * k, z = g ? "left" : "center", R = e.bottom - V) : (M = t.top, I = L(r, t.bottom, F) - F / 2, O = (g ? 0 : .5) * k, z = g ? "right" : "center", R = e.top + V) } else { var E = (p ? 0 : S) + _; W < e.top - 1e-7 && (d = "rgba(0,0,0,0)"), v = a, x = o, b = y = M = I = L(r, W, l), R = e.getPixelForTick(s) + C, O = (1 - N) * k / 2, "left" === f ? (w = L(r, t.left, F) + F / 2, P = t.right, z = p ? "left" : "right", A = e.right - E) : (w = t.left, P = L(r, t.right, F) - F / 2, z = p ? "right" : "left", A = e.left + E) } T.push({ tx1: v, ty1: b, tx2: x, ty2: y, x1: w, y1: M, x2: P, y2: I, labelX: A, labelY: R, glWidth: l, glColor: d, glBorderDash: u, glBorderDashOffset: c, rotation: -1 * D, label: B, major: n.major, textOffset: O, textAlign: z }) } }), ut.each(T, function (t) { var e = t.glWidth, i = t.glColor; if (h.display && e && i && (s.save(), s.lineWidth = e, s.strokeStyle = i, s.setLineDash && (s.setLineDash(t.glBorderDash), s.lineDashOffset = t.glBorderDashOffset), s.beginPath(), h.drawTicks && (s.moveTo(t.tx1, t.ty1), s.lineTo(t.tx2, t.ty2)), h.drawOnChartArea && (s.moveTo(t.x1, t.y1), s.lineTo(t.x2, t.y2)), s.stroke(), s.restore()), d.display) { s.save(), s.translate(t.labelX, t.labelY), s.rotate(t.rotation), s.font = t.major ? M.string : y.string, s.fillStyle = t.major ? w : x, s.textBaseline = "middle", s.textAlign = t.textAlign; var n = t.label, a = t.textOffset; if (ut.isArray(n)) for (var o = 0; o < n.length; ++o)s.fillText("" + n[o], 0, a), a += k; else s.fillText(n, 0, a); s.restore() } }), c.display) { var R, O, z = 0, B = I.lineHeight / 2; if (m) R = e.left + (e.right - e.left) / 2, O = "bottom" === f ? e.bottom - B - A.bottom : e.top + B + A.top; else { var N = "left" === f; R = N ? e.left + B + A.top : e.right - B - A.top, O = e.top + (e.bottom - e.top) / 2, z = N ? -.5 * Math.PI : .5 * Math.PI } s.save(), s.translate(R, O), s.rotate(z), s.textAlign = "center", s.textBaseline = "middle", s.fillStyle = P, s.font = I.string, s.fillText(c.labelString, 0, 0), s.restore() } if (F) { var W, V, E, H, j = F, q = ui(h.lineWidth, b.length - 1, 0); m ? (W = L(r, e.left, j) - j / 2, V = L(r, e.right, q) + q / 2, E = H = n) : (E = L(r, e.top, j) - j / 2, H = L(r, e.bottom, q) + q / 2, W = V = n), s.lineWidth = F, s.strokeStyle = ui(h.color, 0), s.beginPath(), s.moveTo(W, E), s.lineTo(V, H), s.stroke() } } } }), gi = fi.extend({ getLabels: function () { var t = this.chart.data; return this.options.labels || (this.isHorizontal() ? t.xLabels : t.yLabels) || t.labels }, determineDataLimits: function () { var t, e = this, i = e.getLabels(); e.minIndex = 0, e.maxIndex = i.length - 1, void 0 !== e.options.ticks.min && (t = i.indexOf(e.options.ticks.min), e.minIndex = -1 !== t ? t : e.minIndex), void 0 !== e.options.ticks.max && (t = i.indexOf(e.options.ticks.max), e.maxIndex = -1 !== t ? t : e.maxIndex), e.min = i[e.minIndex], e.max = i[e.maxIndex] }, buildTicks: function () { var t = this, e = t.getLabels(); t.ticks = 0 === t.minIndex && t.maxIndex === e.length - 1 ? e : e.slice(t.minIndex, t.maxIndex + 1) }, getLabelForIndex: function (t, e) { var i = this, n = i.chart; return n.getDatasetMeta(e).controller._getValueScaleId() === i.id ? i.getRightValue(n.data.datasets[e].data[t]) : i.ticks[t - i.minIndex] }, getPixelForValue: function (t, e) { var i, n = this, a = n.options.offset, o = Math.max(n.maxIndex + 1 - n.minIndex - (a ? 0 : 1), 1); if (null != t && (i = n.isHorizontal() ? t.x : t.y), void 0 !== i || void 0 !== t && isNaN(e)) { t = i || t; var r = n.getLabels().indexOf(t); e = -1 !== r ? r : e } if (n.isHorizontal()) { var s = n.width / o, l = s * (e - n.minIndex); return a && (l += s / 2), n.left + l } var d = n.height / o, u = d * (e - n.minIndex); return a && (u += d / 2), n.top + u }, getPixelForTick: function (t) { return this.getPixelForValue(this.ticks[t], t + this.minIndex, null) }, getValueForPixel: function (t) { var e = this, i = e.options.offset, n = Math.max(e._ticks.length - (i ? 0 : 1), 1), a = e.isHorizontal(), o = (a ? e.width : e.height) / n; return t -= a ? e.left : e.top, i && (t -= o / 2), (t <= 0 ? 0 : Math.round(t / o)) + e.minIndex }, getBasePixel: function () { return this.bottom } }), pi = { position: "bottom" }; gi._defaults = pi; var mi = ut.noop, vi = ut.isNullOrUndef; var bi = fi.extend({ getRightValue: function (t) { return "string" == typeof t ? +t : fi.prototype.getRightValue.call(this, t) }, handleTickRangeOptions: function () { var t = this, e = t.options.ticks; if (e.beginAtZero) { var i = ut.sign(t.min), n = ut.sign(t.max); i < 0 && n < 0 ? t.max = 0 : i > 0 && n > 0 && (t.min = 0) } var a = void 0 !== e.min || void 0 !== e.suggestedMin, o = void 0 !== e.max || void 0 !== e.suggestedMax; void 0 !== e.min ? t.min = e.min : void 0 !== e.suggestedMin && (null === t.min ? t.min = e.suggestedMin : t.min = Math.min(t.min, e.suggestedMin)), void 0 !== e.max ? t.max = e.max : void 0 !== e.suggestedMax && (null === t.max ? t.max = e.suggestedMax : t.max = Math.max(t.max, e.suggestedMax)), a !== o && t.min >= t.max && (a ? t.max = t.min + 1 : t.min = t.max - 1), t.min === t.max && (t.max++, e.beginAtZero || t.min--) }, getTickLimit: function () { var t, e = this.options.ticks, i = e.stepSize, n = e.maxTicksLimit; return i ? t = Math.ceil(this.max / i) - Math.floor(this.min / i) + 1 : (t = this._computeTickLimit(), n = n || 11), n && (t = Math.min(n, t)), t }, _computeTickLimit: function () { return Number.POSITIVE_INFINITY }, handleDirectionalChanges: mi, buildTicks: function () { var t = this, e = t.options.ticks, i = t.getTickLimit(), n = { maxTicks: i = Math.max(2, i), min: e.min, max: e.max, precision: e.precision, stepSize: ut.valueOrDefault(e.fixedStepSize, e.stepSize) }, a = t.ticks = function (t, e) { var i, n, a, o, r = [], s = t.stepSize, l = s || 1, d = t.maxTicks - 1, u = t.min, h = t.max, c = t.precision, f = e.min, g = e.max, p = ut.niceNum((g - f) / d / l) * l; if (p < 1e-14 && vi(u) && vi(h)) return [f, g]; (o = Math.ceil(g / p) - Math.floor(f / p)) > d && (p = ut.niceNum(o * p / d / l) * l), s || vi(c) ? i = Math.pow(10, ut._decimalPlaces(p)) : (i = Math.pow(10, c), p = Math.ceil(p * i) / i), n = Math.floor(f / p) * p, a = Math.ceil(g / p) * p, s && (!vi(u) && ut.almostWhole(u / p, p / 1e3) && (n = u), !vi(h) && ut.almostWhole(h / p, p / 1e3) && (a = h)), o = (a - n) / p, o = ut.almostEquals(o, Math.round(o), p / 1e3) ? Math.round(o) : Math.ceil(o), n = Math.round(n * i) / i, a = Math.round(a * i) / i, r.push(vi(u) ? n : u); for (var m = 1; m < o; ++m)r.push(Math.round((n + m * p) * i) / i); return r.push(vi(h) ? a : h), r }(n, t); t.handleDirectionalChanges(), t.max = ut.max(a), t.min = ut.min(a), e.reverse ? (a.reverse(), t.start = t.max, t.end = t.min) : (t.start = t.min, t.end = t.max) }, convertTicksToLabels: function () { var t = this; t.ticksAsNumbers = t.ticks.slice(), t.zeroLineIndex = t.ticks.indexOf(0), fi.prototype.convertTicksToLabels.call(t) } }), xi = { position: "left", ticks: { callback: li.formatters.linear } }, yi = bi.extend({ determineDataLimits: function () { var t = this, e = t.options, i = t.chart, n = i.data.datasets, a = t.isHorizontal(); function o(e) { return a ? e.xAxisID === t.id : e.yAxisID === t.id } t.min = null, t.max = null; var r = e.stacked; if (void 0 === r && ut.each(n, function (t, e) { if (!r) { var n = i.getDatasetMeta(e); i.isDatasetVisible(e) && o(n) && void 0 !== n.stack && (r = !0) } }), e.stacked || r) { var s = {}; ut.each(n, function (n, a) { var r = i.getDatasetMeta(a), l = [r.type, void 0 === e.stacked && void 0 === r.stack ? a : "", r.stack].join("."); void 0 === s[l] && (s[l] = { positiveValues: [], negativeValues: [] }); var d = s[l].positiveValues, u = s[l].negativeValues; i.isDatasetVisible(a) && o(r) && ut.each(n.data, function (i, n) { var a = +t.getRightValue(i); isNaN(a) || r.data[n].hidden || (d[n] = d[n] || 0, u[n] = u[n] || 0, e.relativePoints ? d[n] = 100 : a < 0 ? u[n] += a : d[n] += a) }) }), ut.each(s, function (e) { var i = e.positiveValues.concat(e.negativeValues), n = ut.min(i), a = ut.max(i); t.min = null === t.min ? n : Math.min(t.min, n), t.max = null === t.max ? a : Math.max(t.max, a) }) } else ut.each(n, function (e, n) { var a = i.getDatasetMeta(n); i.isDatasetVisible(n) && o(a) && ut.each(e.data, function (e, i) { var n = +t.getRightValue(e); isNaN(n) || a.data[i].hidden || (null === t.min ? t.min = n : n < t.min && (t.min = n), null === t.max ? t.max = n : n > t.max && (t.max = n)) }) }); t.min = isFinite(t.min) && !isNaN(t.min) ? t.min : 0, t.max = isFinite(t.max) && !isNaN(t.max) ? t.max : 1, this.handleTickRangeOptions() }, _computeTickLimit: function () { var t; return this.isHorizontal() ? Math.ceil(this.width / 40) : (t = ut.options._parseFont(this.options.ticks), Math.ceil(this.height / t.lineHeight)) }, handleDirectionalChanges: function () { this.isHorizontal() || this.ticks.reverse() }, getLabelForIndex: function (t, e) { return +this.getRightValue(this.chart.data.datasets[e].data[t]) }, getPixelForValue: function (t) { var e = this, i = e.start, n = +e.getRightValue(t), a = e.end - i; return e.isHorizontal() ? e.left + e.width / a * (n - i) : e.bottom - e.height / a * (n - i) }, getValueForPixel: function (t) { var e = this, i = e.isHorizontal(), n = i ? e.width : e.height, a = (i ? t - e.left : e.bottom - t) / n; return e.start + (e.end - e.start) * a }, getPixelForTick: function (t) { return this.getPixelForValue(this.ticksAsNumbers[t]) } }), ki = xi; yi._defaults = ki; var wi = ut.valueOrDefault; var Mi = { position: "left", ticks: { callback: li.formatters.logarithmic } }; function _i(t, e) { return ut.isFinite(t) && t >= 0 ? t : e } var Ci = fi.extend({ determineDataLimits: function () { var t = this, e = t.options, i = t.chart, n = i.data.datasets, a = t.isHorizontal(); function o(e) { return a ? e.xAxisID === t.id : e.yAxisID === t.id } t.min = null, t.max = null, t.minNotZero = null; var r = e.stacked; if (void 0 === r && ut.each(n, function (t, e) { if (!r) { var n = i.getDatasetMeta(e); i.isDatasetVisible(e) && o(n) && void 0 !== n.stack && (r = !0) } }), e.stacked || r) { var s = {}; ut.each(n, function (n, a) { var r = i.getDatasetMeta(a), l = [r.type, void 0 === e.stacked && void 0 === r.stack ? a : "", r.stack].join("."); i.isDatasetVisible(a) && o(r) && (void 0 === s[l] && (s[l] = []), ut.each(n.data, function (e, i) { var n = s[l], a = +t.getRightValue(e); isNaN(a) || r.data[i].hidden || a < 0 || (n[i] = n[i] || 0, n[i] += a) })) }), ut.each(s, function (e) { if (e.length > 0) { var i = ut.min(e), n = ut.max(e); t.min = null === t.min ? i : Math.min(t.min, i), t.max = null === t.max ? n : Math.max(t.max, n) } }) } else ut.each(n, function (e, n) { var a = i.getDatasetMeta(n); i.isDatasetVisible(n) && o(a) && ut.each(e.data, function (e, i) { var n = +t.getRightValue(e); isNaN(n) || a.data[i].hidden || n < 0 || (null === t.min ? t.min = n : n < t.min && (t.min = n), null === t.max ? t.max = n : n > t.max && (t.max = n), 0 !== n && (null === t.minNotZero || n < t.minNotZero) && (t.minNotZero = n)) }) }); this.handleTickRangeOptions() }, handleTickRangeOptions: function () { var t = this, e = t.options.ticks; t.min = _i(e.min, t.min), t.max = _i(e.max, t.max), t.min === t.max && (0 !== t.min && null !== t.min ? (t.min = Math.pow(10, Math.floor(ut.log10(t.min)) - 1), t.max = Math.pow(10, Math.floor(ut.log10(t.max)) + 1)) : (t.min = 1, t.max = 10)), null === t.min && (t.min = Math.pow(10, Math.floor(ut.log10(t.max)) - 1)), null === t.max && (t.max = 0 !== t.min ? Math.pow(10, Math.floor(ut.log10(t.min)) + 1) : 10), null === t.minNotZero && (t.min > 0 ? t.minNotZero = t.min : t.max < 1 ? t.minNotZero = Math.pow(10, Math.floor(ut.log10(t.max))) : t.minNotZero = 1) }, buildTicks: function () { var t = this, e = t.options.ticks, i = !t.isHorizontal(), n = { min: _i(e.min), max: _i(e.max) }, a = t.ticks = function (t, e) { var i, n, a = [], o = wi(t.min, Math.pow(10, Math.floor(ut.log10(e.min)))), r = Math.floor(ut.log10(e.max)), s = Math.ceil(e.max / Math.pow(10, r)); 0 === o ? (i = Math.floor(ut.log10(e.minNotZero)), n = Math.floor(e.minNotZero / Math.pow(10, i)), a.push(o), o = n * Math.pow(10, i)) : (i = Math.floor(ut.log10(o)), n = Math.floor(o / Math.pow(10, i))); var l = i < 0 ? Math.pow(10, Math.abs(i)) : 1; do { a.push(o), 10 == ++n && (n = 1, l = ++i >= 0 ? 1 : l), o = Math.round(n * Math.pow(10, i) * l) / l } while (i < r || i === r && n < s); var d = wi(t.max, o); return a.push(d), a }(n, t); t.max = ut.max(a), t.min = ut.min(a), e.reverse ? (i = !i, t.start = t.max, t.end = t.min) : (t.start = t.min, t.end = t.max), i && a.reverse() }, convertTicksToLabels: function () { this.tickValues = this.ticks.slice(), fi.prototype.convertTicksToLabels.call(this) }, getLabelForIndex: function (t, e) { return +this.getRightValue(this.chart.data.datasets[e].data[t]) }, getPixelForTick: function (t) { return this.getPixelForValue(this.tickValues[t]) }, _getFirstTickValue: function (t) { var e = Math.floor(ut.log10(t)); return Math.floor(t / Math.pow(10, e)) * Math.pow(10, e) }, getPixelForValue: function (t) { var e, i, n, a, o, r = this, s = r.options.ticks, l = s.reverse, d = ut.log10, u = r._getFirstTickValue(r.minNotZero), h = 0; return t = +r.getRightValue(t), l ? (n = r.end, a = r.start, o = -1) : (n = r.start, a = r.end, o = 1), r.isHorizontal() ? (e = r.width, i = l ? r.right : r.left) : (e = r.height, o *= -1, i = l ? r.top : r.bottom), t !== n && (0 === n && (e -= h = wi(s.fontSize, st.global.defaultFontSize), n = u), 0 !== t && (h += e / (d(a) - d(n)) * (d(t) - d(n))), i += o * h), i }, getValueForPixel: function (t) { var e, i, n, a, o = this, r = o.options.ticks, s = r.reverse, l = ut.log10, d = o._getFirstTickValue(o.minNotZero); if (s ? (i = o.end, n = o.start) : (i = o.start, n = o.end), o.isHorizontal() ? (e = o.width, a = s ? o.right - t : t - o.left) : (e = o.height, a = s ? t - o.top : o.bottom - t), a !== i) { if (0 === i) { var u = wi(r.fontSize, st.global.defaultFontSize); a -= u, e -= u, i = d } a *= l(n) - l(i), a /= e, a = Math.pow(10, l(i) + a) } return a } }), Si = Mi; Ci._defaults = Si; var Pi = ut.valueOrDefault, Ii = ut.valueAtIndexOrDefault, Ai = ut.options.resolve, Di = { display: !0, animate: !0, position: "chartArea", angleLines: { display: !0, color: "rgba(0, 0, 0, 0.1)", lineWidth: 1, borderDash: [], borderDashOffset: 0 }, gridLines: { circular: !1 }, ticks: { showLabelBackdrop: !0, backdropColor: "rgba(255,255,255,0.75)", backdropPaddingY: 2, backdropPaddingX: 2, callback: li.formatters.linear }, pointLabels: { display: !0, fontSize: 10, callback: function (t) { return t } } }; function Ti(t) { var e = t.options; return e.angleLines.display || e.pointLabels.display ? t.chart.data.labels.length : 0 } function Fi(t) { var e = t.ticks; return e.display && t.display ? Pi(e.fontSize, st.global.defaultFontSize) + 2 * e.backdropPaddingY : 0 } function Li(t, e, i, n, a) { return t === n || t === a ? { start: e - i / 2, end: e + i / 2 } : t < n || t > a ? { start: e - i, end: e } : { start: e, end: e + i } } function Ri(t) { return 0 === t || 180 === t ? "center" : t < 180 ? "left" : "right" } function Oi(t, e, i, n) { var a, o, r = i.y + n / 2; if (ut.isArray(e)) for (a = 0, o = e.length; a < o; ++a)t.fillText(e[a], i.x, r), r += n; else t.fillText(e, i.x, r) } function zi(t, e, i) { 90 === t || 270 === t ? i.y -= e.h / 2 : (t > 270 || t < 90) && (i.y -= e.h) } function Bi(t) { return ut.isNumber(t) ? t : 0 } var Ni = bi.extend({ setDimensions: function () { var t = this; t.width = t.maxWidth, t.height = t.maxHeight, t.paddingTop = Fi(t.options) / 2, t.xCenter = Math.floor(t.width / 2), t.yCenter = Math.floor((t.height - t.paddingTop) / 2), t.drawingArea = Math.min(t.height - t.paddingTop, t.width) / 2 }, determineDataLimits: function () { var t = this, e = t.chart, i = Number.POSITIVE_INFINITY, n = Number.NEGATIVE_INFINITY; ut.each(e.data.datasets, function (a, o) { if (e.isDatasetVisible(o)) { var r = e.getDatasetMeta(o); ut.each(a.data, function (e, a) { var o = +t.getRightValue(e); isNaN(o) || r.data[a].hidden || (i = Math.min(o, i), n = Math.max(o, n)) }) } }), t.min = i === Number.POSITIVE_INFINITY ? 0 : i, t.max = n === Number.NEGATIVE_INFINITY ? 0 : n, t.handleTickRangeOptions() }, _computeTickLimit: function () { return Math.ceil(this.drawingArea / Fi(this.options)) }, convertTicksToLabels: function () { var t = this; bi.prototype.convertTicksToLabels.call(t), t.pointLabels = t.chart.data.labels.map(t.options.pointLabels.callback, t) }, getLabelForIndex: function (t, e) { return +this.getRightValue(this.chart.data.datasets[e].data[t]) }, fit: function () { var t = this.options; t.display && t.pointLabels.display ? function (t) { var e, i, n, a = ut.options._parseFont(t.options.pointLabels), o = { l: 0, r: t.width, t: 0, b: t.height - t.paddingTop }, r = {}; t.ctx.font = a.string, t._pointLabelSizes = []; var s, l, d, u = Ti(t); for (e = 0; e < u; e++) { n = t.getPointPosition(e, t.drawingArea + 5), s = t.ctx, l = a.lineHeight, d = t.pointLabels[e] || "", i = ut.isArray(d) ? { w: ut.longestText(s, s.font, d), h: d.length * l } : { w: s.measureText(d).width, h: l }, t._pointLabelSizes[e] = i; var h = t.getIndexAngle(e), c = ut.toDegrees(h) % 360, f = Li(c, n.x, i.w, 0, 180), g = Li(c, n.y, i.h, 90, 270); f.start < o.l && (o.l = f.start, r.l = h), f.end > o.r && (o.r = f.end, r.r = h), g.start < o.t && (o.t = g.start, r.t = h), g.end > o.b && (o.b = g.end, r.b = h) } t.setReductions(t.drawingArea, o, r) }(this) : this.setCenterPoint(0, 0, 0, 0) }, setReductions: function (t, e, i) { var n = this, a = e.l / Math.sin(i.l), o = Math.max(e.r - n.width, 0) / Math.sin(i.r), r = -e.t / Math.cos(i.t), s = -Math.max(e.b - (n.height - n.paddingTop), 0) / Math.cos(i.b); a = Bi(a), o = Bi(o), r = Bi(r), s = Bi(s), n.drawingArea = Math.min(Math.floor(t - (a + o) / 2), Math.floor(t - (r + s) / 2)), n.setCenterPoint(a, o, r, s) }, setCenterPoint: function (t, e, i, n) { var a = this, o = a.width - e - a.drawingArea, r = t + a.drawingArea, s = i + a.drawingArea, l = a.height - a.paddingTop - n - a.drawingArea; a.xCenter = Math.floor((r + o) / 2 + a.left), a.yCenter = Math.floor((s + l) / 2 + a.top + a.paddingTop) }, getIndexAngle: function (t) { return t * (2 * Math.PI / Ti(this)) + (this.chart.options && this.chart.options.startAngle ? this.chart.options.startAngle : 0) * Math.PI * 2 / 360 }, getDistanceFromCenterForValue: function (t) { var e = this; if (null === t) return 0; var i = e.drawingArea / (e.max - e.min); return e.options.ticks.reverse ? (e.max - t) * i : (t - e.min) * i }, getPointPosition: function (t, e) { var i = this.getIndexAngle(t) - Math.PI / 2; return { x: Math.cos(i) * e + this.xCenter, y: Math.sin(i) * e + this.yCenter } }, getPointPositionForValue: function (t, e) { return this.getPointPosition(t, this.getDistanceFromCenterForValue(e)) }, getBasePosition: function () { var t = this.min, e = this.max; return this.getPointPositionForValue(0, this.beginAtZero ? 0 : t < 0 && e < 0 ? e : t > 0 && e > 0 ? t : 0) }, draw: function () { var t = this, e = t.options, i = e.gridLines, n = e.ticks; if (e.display) { var a = t.ctx, o = this.getIndexAngle(0), r = ut.options._parseFont(n); (e.angleLines.display || e.pointLabels.display) && function (t) { var e = t.ctx, i = t.options, n = i.angleLines, a = i.gridLines, o = i.pointLabels, r = Pi(n.lineWidth, a.lineWidth), s = Pi(n.color, a.color), l = Fi(i); e.save(), e.lineWidth = r, e.strokeStyle = s, e.setLineDash && (e.setLineDash(Ai([n.borderDash, a.borderDash, []])), e.lineDashOffset = Ai([n.borderDashOffset, a.borderDashOffset, 0])); var d = t.getDistanceFromCenterForValue(i.ticks.reverse ? t.min : t.max), u = ut.options._parseFont(o); e.font = u.string, e.textBaseline = "middle"; for (var h = Ti(t) - 1; h >= 0; h--) { if (n.display && r && s) { var c = t.getPointPosition(h, d); e.beginPath(), e.moveTo(t.xCenter, t.yCenter), e.lineTo(c.x, c.y), e.stroke() } if (o.display) { var f = 0 === h ? l / 2 : 0, g = t.getPointPosition(h, d + f + 5), p = Ii(o.fontColor, h, st.global.defaultFontColor); e.fillStyle = p; var m = t.getIndexAngle(h), v = ut.toDegrees(m); e.textAlign = Ri(v), zi(v, t._pointLabelSizes[h], g), Oi(e, t.pointLabels[h] || "", g, u.lineHeight) } } e.restore() }(t), ut.each(t.ticks, function (e, s) { if (s > 0 || n.reverse) { var l = t.getDistanceFromCenterForValue(t.ticksAsNumbers[s]); if (i.display && 0 !== s && function (t, e, i, n) { var a, o = t.ctx, r = e.circular, s = Ti(t), l = Ii(e.color, n - 1), d = Ii(e.lineWidth, n - 1); if ((r || s) && l && d) { if (o.save(), o.strokeStyle = l, o.lineWidth = d, o.setLineDash && (o.setLineDash(e.borderDash || []), o.lineDashOffset = e.borderDashOffset || 0), o.beginPath(), r) o.arc(t.xCenter, t.yCenter, i, 0, 2 * Math.PI); else { a = t.getPointPosition(0, i), o.moveTo(a.x, a.y); for (var u = 1; u < s; u++)a = t.getPointPosition(u, i), o.lineTo(a.x, a.y) } o.closePath(), o.stroke(), o.restore() } }(t, i, l, s), n.display) { var d = Pi(n.fontColor, st.global.defaultFontColor); if (a.font = r.string, a.save(), a.translate(t.xCenter, t.yCenter), a.rotate(o), n.showLabelBackdrop) { var u = a.measureText(e).width; a.fillStyle = n.backdropColor, a.fillRect(-u / 2 - n.backdropPaddingX, -l - r.size / 2 - n.backdropPaddingY, u + 2 * n.backdropPaddingX, r.size + 2 * n.backdropPaddingY) } a.textAlign = "center", a.textBaseline = "middle", a.fillStyle = d, a.fillText(e, 0, -l), a.restore() } } }) } } }), Wi = Di; Ni._defaults = Wi; var Vi = ut.valueOrDefault, Ei = Number.MIN_SAFE_INTEGER || -9007199254740991, Hi = Number.MAX_SAFE_INTEGER || 9007199254740991, ji = { millisecond: { common: !0, size: 1, steps: [1, 2, 5, 10, 20, 50, 100, 250, 500] }, second: { common: !0, size: 1e3, steps: [1, 2, 5, 10, 15, 30] }, minute: { common: !0, size: 6e4, steps: [1, 2, 5, 10, 15, 30] }, hour: { common: !0, size: 36e5, steps: [1, 2, 3, 6, 12] }, day: { common: !0, size: 864e5, steps: [1, 2, 5] }, week: { common: !1, size: 6048e5, steps: [1, 2, 3, 4] }, month: { common: !0, size: 2628e6, steps: [1, 2, 3] }, quarter: { common: !1, size: 7884e6, steps: [1, 2, 3, 4] }, year: { common: !0, size: 3154e7 } }, qi = Object.keys(ji); function Yi(t, e) { return t - e } function Ui(t) { var e, i, n, a = {}, o = []; for (e = 0, i = t.length; e < i; ++e)a[n = t[e]] || (a[n] = !0, o.push(n)); return o } function Xi(t, e, i, n) { var a = function (t, e, i) { for (var n, a, o, r = 0, s = t.length - 1; r >= 0 && r <= s;) { if (a = t[(n = r + s >> 1) - 1] || null, o = t[n], !a) return { lo: null, hi: o }; if (o[e] < i) r = n + 1; else { if (!(a[e] > i)) return { lo: a, hi: o }; s = n - 1 } } return { lo: o, hi: null } }(t, e, i), o = a.lo ? a.hi ? a.lo : t[t.length - 2] : t[0], r = a.lo ? a.hi ? a.hi : t[t.length - 1] : t[1], s = r[e] - o[e], l = s ? (i - o[e]) / s : 0, d = (r[n] - o[n]) * l; return o[n] + d } function Ki(t, e) { var i = t._adapter, n = t.options.time, a = n.parser, o = a || n.format, r = e; return "function" == typeof a && (r = a(r)), ut.isFinite(r) || (r = "string" == typeof o ? i.parse(r, o) : i.parse(r)), null !== r ? +r : (a || "function" != typeof o || (r = o(e), ut.isFinite(r) || (r = i.parse(r))), r) } function Gi(t, e) { if (ut.isNullOrUndef(e)) return null; var i = t.options.time, n = Ki(t, t.getRightValue(e)); return null === n ? n : (i.round && (n = +t._adapter.startOf(n, i.round)), n) } function Zi(t) { for (var e = qi.indexOf(t) + 1, i = qi.length; e < i; ++e)if (ji[qi[e]].common) return qi[e] } function $i(t, e, i, n) { var a, o = t._adapter, r = t.options, s = r.time, l = s.unit || function (t, e, i, n) { var a, o, r, s = qi.length; for (a = qi.indexOf(t); a < s - 1; ++a)if (r = (o = ji[qi[a]]).steps ? o.steps[o.steps.length - 1] : Hi, o.common && Math.ceil((i - e) / (r * o.size)) <= n) return qi[a]; return qi[s - 1] }(s.minUnit, e, i, n), d = Zi(l), u = Vi(s.stepSize, s.unitStepSize), h = "week" === l && s.isoWeekday, c = r.ticks.major.enabled, f = ji[l], g = e, p = i, m = []; for (u || (u = function (t, e, i, n) { var a, o, r, s = e - t, l = ji[i], d = l.size, u = l.steps; if (!u) return Math.ceil(s / (n * d)); for (a = 0, o = u.length; a < o && (r = u[a], !(Math.ceil(s / (d * r)) <= n)); ++a); return r }(e, i, l, n)), h && (g = +o.startOf(g, "isoWeek", h), p = +o.startOf(p, "isoWeek", h)), g = +o.startOf(g, h ? "day" : l), (p = +o.startOf(p, h ? "day" : l)) < i && (p = +o.add(p, 1, l)), a = g, c && d && !h && !s.round && (a = +o.startOf(a, d), a = +o.add(a, ~~((g - a) / (f.size * u)) * u, l)); a < p; a = +o.add(a, u, l))m.push(+a); return m.push(+a), m } var Ji = fi.extend({ initialize: function () { this.mergeTicksOptions(), fi.prototype.initialize.call(this) }, update: function () { var t = this.options, e = t.time || (t.time = {}), i = this._adapter = new si._date(t.adapters.date); return e.format && console.warn("options.time.format is deprecated and replaced by options.time.parser."), ut.mergeIf(e.displayFormats, i.formats()), fi.prototype.update.apply(this, arguments) }, getRightValue: function (t) { return t && void 0 !== t.t && (t = t.t), fi.prototype.getRightValue.call(this, t) }, determineDataLimits: function () { var t, e, i, n, a, o, r = this, s = r.chart, l = r._adapter, d = r.options.time, u = d.unit || "day", h = Hi, c = Ei, f = [], g = [], p = [], m = s.data.labels || []; for (t = 0, i = m.length; t < i; ++t)p.push(Gi(r, m[t])); for (t = 0, i = (s.data.datasets || []).length; t < i; ++t)if (s.isDatasetVisible(t)) if (a = s.data.datasets[t].data, ut.isObject(a[0])) for (g[t] = [], e = 0, n = a.length; e < n; ++e)o = Gi(r, a[e]), f.push(o), g[t][e] = o; else { for (e = 0, n = p.length; e < n; ++e)f.push(p[e]); g[t] = p.slice(0) } else g[t] = []; p.length && (p = Ui(p).sort(Yi), h = Math.min(h, p[0]), c = Math.max(c, p[p.length - 1])), f.length && (f = Ui(f).sort(Yi), h = Math.min(h, f[0]), c = Math.max(c, f[f.length - 1])), h = Gi(r, d.min) || h, c = Gi(r, d.max) || c, h = h === Hi ? +l.startOf(Date.now(), u) : h, c = c === Ei ? +l.endOf(Date.now(), u) + 1 : c, r.min = Math.min(h, c), r.max = Math.max(h + 1, c), r._horizontal = r.isHorizontal(), r._table = [], r._timestamps = { data: f, datasets: g, labels: p } }, buildTicks: function () { var t, e, i, n = this, a = n.min, o = n.max, r = n.options, s = r.time, l = [], d = []; switch (r.ticks.source) { case "data": l = n._timestamps.data; break; case "labels": l = n._timestamps.labels; break; case "auto": default: l = $i(n, a, o, n.getLabelCapacity(a)) }for ("ticks" === r.bounds && l.length && (a = l[0], o = l[l.length - 1]), a = Gi(n, s.min) || a, o = Gi(n, s.max) || o, t = 0, e = l.length; t < e; ++t)(i = l[t]) >= a && i <= o && d.push(i); return n.min = a, n.max = o, n._unit = s.unit || function (t, e, i, n, a) { var o, r; for (o = qi.length - 1; o >= qi.indexOf(i); o--)if (r = qi[o], ji[r].common && t._adapter.diff(a, n, r) >= e.length) return r; return qi[i ? qi.indexOf(i) : 0] }(n, d, s.minUnit, n.min, n.max), n._majorUnit = Zi(n._unit), n._table = function (t, e, i, n) { if ("linear" === n || !t.length) return [{ time: e, pos: 0 }, { time: i, pos: 1 }]; var a, o, r, s, l, d = [], u = [e]; for (a = 0, o = t.length; a < o; ++a)(s = t[a]) > e && s < i && u.push(s); for (u.push(i), a = 0, o = u.length; a < o; ++a)l = u[a + 1], r = u[a - 1], s = u[a], void 0 !== r && void 0 !== l && Math.round((l + r) / 2) === s || d.push({ time: s, pos: a / (o - 1) }); return d }(n._timestamps.data, a, o, r.distribution), n._offsets = function (t, e, i, n, a) { var o, r, s = 0, l = 0; return a.offset && e.length && (a.time.min || (o = Xi(t, "time", e[0], "pos"), s = 1 === e.length ? 1 - o : (Xi(t, "time", e[1], "pos") - o) / 2), a.time.max || (r = Xi(t, "time", e[e.length - 1], "pos"), l = 1 === e.length ? r : (r - Xi(t, "time", e[e.length - 2], "pos")) / 2)), { start: s, end: l } }(n._table, d, 0, 0, r), r.ticks.reverse && d.reverse(), function (t, e, i) { var n, a, o, r, s = []; for (n = 0, a = e.length; n < a; ++n)o = e[n], r = !!i && o === +t._adapter.startOf(o, i), s.push({ value: o, major: r }); return s }(n, d, n._majorUnit) }, getLabelForIndex: function (t, e) { var i = this, n = i._adapter, a = i.chart.data, o = i.options.time, r = a.labels && t < a.labels.length ? a.labels[t] : "", s = a.datasets[e].data[t]; return ut.isObject(s) && (r = i.getRightValue(s)), o.tooltipFormat ? n.format(Ki(i, r), o.tooltipFormat) : "string" == typeof r ? r : n.format(Ki(i, r), o.displayFormats.datetime) }, tickFormatFunction: function (t, e, i, n) { var a = this._adapter, o = this.options, r = o.time.displayFormats, s = r[this._unit], l = this._majorUnit, d = r[l], u = +a.startOf(t, l), h = o.ticks.major, c = h.enabled && l && d && t === u, f = a.format(t, n || (c ? d : s)), g = c ? h : o.ticks.minor, p = Vi(g.callback, g.userCallback); return p ? p(f, e, i) : f }, convertTicksToLabels: function (t) { var e, i, n = []; for (e = 0, i = t.length; e < i; ++e)n.push(this.tickFormatFunction(t[e].value, e, t)); return n }, getPixelForOffset: function (t) { var e = this, i = e.options.ticks.reverse, n = e._horizontal ? e.width : e.height, a = e._horizontal ? i ? e.right : e.left : i ? e.bottom : e.top, o = Xi(e._table, "time", t, "pos"), r = n * (e._offsets.start + o) / (e._offsets.start + 1 + e._offsets.end); return i ? a - r : a + r }, getPixelForValue: function (t, e, i) { var n = null; if (void 0 !== e && void 0 !== i && (n = this._timestamps.datasets[i][e]), null === n && (n = Gi(this, t)), null !== n) return this.getPixelForOffset(n) }, getPixelForTick: function (t) { var e = this.getTicks(); return t >= 0 && t < e.length ? this.getPixelForOffset(e[t].value) : null }, getValueForPixel: function (t) { var e = this, i = e._horizontal ? e.width : e.height, n = e._horizontal ? e.left : e.top, a = (i ? (t - n) / i : 0) * (e._offsets.start + 1 + e._offsets.start) - e._offsets.end, o = Xi(e._table, "pos", a, "time"); return e._adapter._create(o) }, getLabelWidth: function (t) { var e = this.options.ticks, i = this.ctx.measureText(t).width, n = ut.toRadians(e.maxRotation), a = Math.cos(n), o = Math.sin(n); return i * a + Vi(e.fontSize, st.global.defaultFontSize) * o }, getLabelCapacity: function (t) { var e = this, i = e.options.time.displayFormats.millisecond, n = e.tickFormatFunction(t, 0, [], i), a = e.getLabelWidth(n), o = e.isHorizontal() ? e.width : e.height, r = Math.floor(o / a); return r > 0 ? r : 1 } }), Qi = { position: "bottom", distribution: "linear", bounds: "data", adapters: {}, time: { parser: !1, format: !1, unit: !1, round: !1, displayFormat: !1, isoWeekday: !1, minUnit: "millisecond", displayFormats: {} }, ticks: { autoSkip: !1, source: "auto", major: { enabled: !1 } } }; Ji._defaults = Qi; var tn = { category: gi, linear: yi, logarithmic: Ci, radialLinear: Ni, time: Ji }, en = { datetime: "MMM D, YYYY, h:mm:ss a", millisecond: "h:mm:ss.SSS a", second: "h:mm:ss a", minute: "h:mm a", hour: "hA", day: "MMM D", week: "ll", month: "MMM YYYY", quarter: "[Q]Q - YYYY", year: "YYYY" }; si._date.override("function" == typeof t ? { _id: "moment", formats: function () { return en }, parse: function (e, i) { return "string" == typeof e && "string" == typeof i ? e = t(e, i) : e instanceof t || (e = t(e)), e.isValid() ? e.valueOf() : null }, format: function (e, i) { return t(e).format(i) }, add: function (e, i, n) { return t(e).add(i, n).valueOf() }, diff: function (e, i, n) { return t.duration(t(e).diff(t(i))).as(n) }, startOf: function (e, i, n) { return e = t(e), "isoWeek" === i ? e.isoWeekday(n).valueOf() : e.startOf(i).valueOf() }, endOf: function (e, i) { return t(e).endOf(i).valueOf() }, _create: function (e) { return t(e) } } : {}), st._set("global", { plugins: { filler: { propagate: !0 } } }); var nn = { dataset: function (t) { var e = t.fill, i = t.chart, n = i.getDatasetMeta(e), a = n && i.isDatasetVisible(e) && n.dataset._children || [], o = a.length || 0; return o ? function (t, e) { return e < o && a[e]._view || null } : null }, boundary: function (t) { var e = t.boundary, i = e ? e.x : null, n = e ? e.y : null; return function (t) { return { x: null === i ? t.x : i, y: null === n ? t.y : n } } } }; function an(t, e, i) { var n, a = t._model || {}, o = a.fill; if (void 0 === o && (o = !!a.backgroundColor), !1 === o || null === o) return !1; if (!0 === o) return "origin"; if (n = parseFloat(o, 10), isFinite(n) && Math.floor(n) === n) return "-" !== o[0] && "+" !== o[0] || (n = e + n), !(n === e || n < 0 || n >= i) && n; switch (o) { case "bottom": return "start"; case "top": return "end"; case "zero": return "origin"; case "origin": case "start": case "end": return o; default: return !1 } } function on(t) { var e, i = t.el._model || {}, n = t.el._scale || {}, a = t.fill, o = null; if (isFinite(a)) return null; if ("start" === a ? o = void 0 === i.scaleBottom ? n.bottom : i.scaleBottom : "end" === a ? o = void 0 === i.scaleTop ? n.top : i.scaleTop : void 0 !== i.scaleZero ? o = i.scaleZero : n.getBasePosition ? o = n.getBasePosition() : n.getBasePixel && (o = n.getBasePixel()), null != o) { if (void 0 !== o.x && void 0 !== o.y) return o; if (ut.isFinite(o)) return { x: (e = n.isHorizontal()) ? o : null, y: e ? null : o } } return null } function rn(t, e, i) { var n, a = t[e].fill, o = [e]; if (!i) return a; for (; !1 !== a && -1 === o.indexOf(a);) { if (!isFinite(a)) return a; if (!(n = t[a])) return !1; if (n.visible) return a; o.push(a), a = n.fill } return !1 } function sn(t) { var e = t.fill, i = "dataset"; return !1 === e ? null : (isFinite(e) || (i = "boundary"), nn[i](t)) } function ln(t) { return t && !t.skip } function dn(t, e, i, n, a) { var o; if (n && a) { for (t.moveTo(e[0].x, e[0].y), o = 1; o < n; ++o)ut.canvas.lineTo(t, e[o - 1], e[o]); for (t.lineTo(i[a - 1].x, i[a - 1].y), o = a - 1; o > 0; --o)ut.canvas.lineTo(t, i[o], i[o - 1], !0) } } var un = { id: "filler", afterDatasetsUpdate: function (t, e) { var i, n, a, o, r = (t.data.datasets || []).length, s = e.propagate, l = []; for (n = 0; n < r; ++n)o = null, (a = (i = t.getDatasetMeta(n)).dataset) && a._model && a instanceof Wt.Line && (o = { visible: t.isDatasetVisible(n), fill: an(a, n, r), chart: t, el: a }), i.$filler = o, l.push(o); for (n = 0; n < r; ++n)(o = l[n]) && (o.fill = rn(l, n, s), o.boundary = on(o), o.mapper = sn(o)) }, beforeDatasetDraw: function (t, e) { var i = e.meta.$filler; if (i) { var n = t.ctx, a = i.el, o = a._view, r = a._children || [], s = i.mapper, l = o.backgroundColor || st.global.defaultColor; s && l && r.length && (ut.canvas.clipArea(n, t.chartArea), function (t, e, i, n, a, o) { var r, s, l, d, u, h, c, f = e.length, g = n.spanGaps, p = [], m = [], v = 0, b = 0; for (t.beginPath(), r = 0, s = f + !!o; r < s; ++r)u = i(d = e[l = r % f]._view, l, n), h = ln(d), c = ln(u), h && c ? (v = p.push(d), b = m.push(u)) : v && b && (g ? (h && p.push(d), c && m.push(u)) : (dn(t, p, m, v, b), v = b = 0, p = [], m = [])); dn(t, p, m, v, b), t.closePath(), t.fillStyle = a, t.fill() }(n, r, s, o, l, a._loop), ut.canvas.unclipArea(n)) } } }, hn = ut.noop, cn = ut.valueOrDefault; function fn(t, e) { return t.usePointStyle && t.boxWidth > e ? e : t.boxWidth } st._set("global", { legend: { display: !0, position: "top", fullWidth: !0, reverse: !1, weight: 1e3, onClick: function (t, e) { var i = e.datasetIndex, n = this.chart, a = n.getDatasetMeta(i); a.hidden = null === a.hidden ? !n.data.datasets[i].hidden : null, n.update() }, onHover: null, onLeave: null, labels: { boxWidth: 40, padding: 10, generateLabels: function (t) { var e = t.data; return ut.isArray(e.datasets) ? e.datasets.map(function (e, i) { return { text: e.label, fillStyle: ut.isArray(e.backgroundColor) ? e.backgroundColor[0] : e.backgroundColor, hidden: !t.isDatasetVisible(i), lineCap: e.borderCapStyle, lineDash: e.borderDash, lineDashOffset: e.borderDashOffset, lineJoin: e.borderJoinStyle, lineWidth: e.borderWidth, strokeStyle: e.borderColor, pointStyle: e.pointStyle, datasetIndex: i } }, this) : [] } } }, legendCallback: function (t) { var e = []; e.push(''); for (var i = 0; i < t.data.datasets.length; i++)e.push(' '), t.data.datasets[i].label && e.push(t.data.datasets[i].label), e.push(" "); return e.push(" "), e.join("") } }); var gn = pt.extend({ initialize: function (t) { ut.extend(this, t), this.legendHitBoxes = [], this._hoveredItem = null, this.doughnutMode = !1 }, beforeUpdate: hn, update: function (t, e, i) { var n = this; return n.beforeUpdate(), n.maxWidth = t, n.maxHeight = e, n.margins = i, n.beforeSetDimensions(), n.setDimensions(), n.afterSetDimensions(), n.beforeBuildLabels(), n.buildLabels(), n.afterBuildLabels(), n.beforeFit(), n.fit(), n.afterFit(), n.afterUpdate(), n.minSize }, afterUpdate: hn, beforeSetDimensions: hn, setDimensions: function () { var t = this; t.isHorizontal() ? (t.width = t.maxWidth, t.left = 0, t.right = t.width) : (t.height = t.maxHeight, t.top = 0, t.bottom = t.height), t.paddingLeft = 0, t.paddingTop = 0, t.paddingRight = 0, t.paddingBottom = 0, t.minSize = { width: 0, height: 0 } }, afterSetDimensions: hn, beforeBuildLabels: hn, buildLabels: function () { var t = this, e = t.options.labels || {}, i = ut.callback(e.generateLabels, [t.chart], t) || []; e.filter && (i = i.filter(function (i) { return e.filter(i, t.chart.data) })), t.options.reverse && i.reverse(), t.legendItems = i }, afterBuildLabels: hn, beforeFit: hn, fit: function () { var t = this, e = t.options, i = e.labels, n = e.display, a = t.ctx, o = ut.options._parseFont(i), r = o.size, s = t.legendHitBoxes = [], l = t.minSize, d = t.isHorizontal(); if (d ? (l.width = t.maxWidth, l.height = n ? 10 : 0) : (l.width = n ? 10 : 0, l.height = t.maxHeight), n) if (a.font = o.string, d) { var u = t.lineWidths = [0], h = 0; a.textAlign = "left", a.textBaseline = "top", ut.each(t.legendItems, function (t, e) { var n = fn(i, r) + r / 2 + a.measureText(t.text).width; (0 === e || u[u.length - 1] + n + i.padding > l.width) && (h += r + i.padding, u[u.length - (e > 0 ? 0 : 1)] = i.padding), s[e] = { left: 0, top: 0, width: n, height: r }, u[u.length - 1] += n + i.padding }), l.height += h } else { var c = i.padding, f = t.columnWidths = [], g = i.padding, p = 0, m = 0, v = r + c; ut.each(t.legendItems, function (t, e) { var n = fn(i, r) + r / 2 + a.measureText(t.text).width; e > 0 && m + v > l.height - c && (g += p + i.padding, f.push(p), p = 0, m = 0), p = Math.max(p, n), m += v, s[e] = { left: 0, top: 0, width: n, height: r } }), g += p, f.push(p), l.width += g } t.width = l.width, t.height = l.height }, afterFit: hn, isHorizontal: function () { return "top" === this.options.position || "bottom" === this.options.position }, draw: function () { var t = this, e = t.options, i = e.labels, n = st.global, a = n.defaultColor, o = n.elements.line, r = t.width, s = t.lineWidths; if (e.display) { var l, d = t.ctx, u = cn(i.fontColor, n.defaultFontColor), h = ut.options._parseFont(i), c = h.size; d.textAlign = "left", d.textBaseline = "middle", d.lineWidth = .5, d.strokeStyle = u, d.fillStyle = u, d.font = h.string; var f = fn(i, c), g = t.legendHitBoxes, p = t.isHorizontal(); l = p ? { x: t.left + (r - s[0]) / 2 + i.padding, y: t.top + i.padding, line: 0 } : { x: t.left + i.padding, y: t.top + i.padding, line: 0 }; var m = c + i.padding; ut.each(t.legendItems, function (n, u) { var h = d.measureText(n.text).width, v = f + c / 2 + h, b = l.x, x = l.y; p ? u > 0 && b + v + i.padding > t.left + t.minSize.width && (x = l.y += m, l.line++, b = l.x = t.left + (r - s[l.line]) / 2 + i.padding) : u > 0 && x + m > t.top + t.minSize.height && (b = l.x = b + t.columnWidths[l.line] + i.padding, x = l.y = t.top + i.padding, l.line++), function (t, i, n) { if (!(isNaN(f) || f <= 0)) { d.save(); var r = cn(n.lineWidth, o.borderWidth); if (d.fillStyle = cn(n.fillStyle, a), d.lineCap = cn(n.lineCap, o.borderCapStyle), d.lineDashOffset = cn(n.lineDashOffset, o.borderDashOffset), d.lineJoin = cn(n.lineJoin, o.borderJoinStyle), d.lineWidth = r, d.strokeStyle = cn(n.strokeStyle, a), d.setLineDash && d.setLineDash(cn(n.lineDash, o.borderDash)), e.labels && e.labels.usePointStyle) { var s = f * Math.SQRT2 / 2, l = t + f / 2, u = i + c / 2; ut.canvas.drawPoint(d, n.pointStyle, s, l, u) } else 0 !== r && d.strokeRect(t, i, f, c), d.fillRect(t, i, f, c); d.restore() } }(b, x, n), g[u].left = b, g[u].top = x, function (t, e, i, n) { var a = c / 2, o = f + a + t, r = e + a; d.fillText(i.text, o, r), i.hidden && (d.beginPath(), d.lineWidth = 2, d.moveTo(o, r), d.lineTo(o + n, r), d.stroke()) }(b, x, n, h), p ? l.x += v + i.padding : l.y += m }) } }, _getLegendItemAt: function (t, e) { var i, n, a, o = this; if (t >= o.left && t <= o.right && e >= o.top && e <= o.bottom) for (a = o.legendHitBoxes, i = 0; i < a.length; ++i)if (t >= (n = a[i]).left && t <= n.left + n.width && e >= n.top && e <= n.top + n.height) return o.legendItems[i]; return null }, handleEvent: function (t) { var e, i = this, n = i.options, a = "mouseup" === t.type ? "click" : t.type; if ("mousemove" === a) { if (!n.onHover && !n.onLeave) return } else { if ("click" !== a) return; if (!n.onClick) return } e = i._getLegendItemAt(t.x, t.y), "click" === a ? e && n.onClick && n.onClick.call(i, t.native, e) : (n.onLeave && e !== i._hoveredItem && (i._hoveredItem && n.onLeave.call(i, t.native, i._hoveredItem), i._hoveredItem = e), n.onHover && e && n.onHover.call(i, t.native, e)) } }); function pn(t, e) { var i = new gn({ ctx: t.ctx, options: e, chart: t }); ke.configure(t, i, e), ke.addBox(t, i), t.legend = i } var mn = { id: "legend", _element: gn, beforeInit: function (t) { var e = t.options.legend; e && pn(t, e) }, beforeUpdate: function (t) { var e = t.options.legend, i = t.legend; e ? (ut.mergeIf(e, st.global.legend), i ? (ke.configure(t, i, e), i.options = e) : pn(t, e)) : i && (ke.removeBox(t, i), delete t.legend) }, afterEvent: function (t, e) { var i = t.legend; i && i.handleEvent(e) } }, vn = ut.noop; st._set("global", { title: { display: !1, fontStyle: "bold", fullWidth: !0, padding: 10, position: "top", text: "", weight: 2e3 } }); var bn = pt.extend({ initialize: function (t) { ut.extend(this, t), this.legendHitBoxes = [] }, beforeUpdate: vn, update: function (t, e, i) { var n = this; return n.beforeUpdate(), n.maxWidth = t, n.maxHeight = e, n.margins = i, n.beforeSetDimensions(), n.setDimensions(), n.afterSetDimensions(), n.beforeBuildLabels(), n.buildLabels(), n.afterBuildLabels(), n.beforeFit(), n.fit(), n.afterFit(), n.afterUpdate(), n.minSize }, afterUpdate: vn, beforeSetDimensions: vn, setDimensions: function () { var t = this; t.isHorizontal() ? (t.width = t.maxWidth, t.left = 0, t.right = t.width) : (t.height = t.maxHeight, t.top = 0, t.bottom = t.height), t.paddingLeft = 0, t.paddingTop = 0, t.paddingRight = 0, t.paddingBottom = 0, t.minSize = { width: 0, height: 0 } }, afterSetDimensions: vn, beforeBuildLabels: vn, buildLabels: vn, afterBuildLabels: vn, beforeFit: vn, fit: function () { var t = this, e = t.options, i = e.display, n = t.minSize, a = ut.isArray(e.text) ? e.text.length : 1, o = ut.options._parseFont(e), r = i ? a * o.lineHeight + 2 * e.padding : 0; t.isHorizontal() ? (n.width = t.maxWidth, n.height = r) : (n.width = r, n.height = t.maxHeight), t.width = n.width, t.height = n.height }, afterFit: vn, isHorizontal: function () { var t = this.options.position; return "top" === t || "bottom" === t }, draw: function () { var t = this, e = t.ctx, i = t.options; if (i.display) { var n, a, o, r = ut.options._parseFont(i), s = r.lineHeight, l = s / 2 + i.padding, d = 0, u = t.top, h = t.left, c = t.bottom, f = t.right; e.fillStyle = ut.valueOrDefault(i.fontColor, st.global.defaultFontColor), e.font = r.string, t.isHorizontal() ? (a = h + (f - h) / 2, o = u + l, n = f - h) : (a = "left" === i.position ? h + l : f - l, o = u + (c - u) / 2, n = c - u, d = Math.PI * ("left" === i.position ? -.5 : .5)), e.save(), e.translate(a, o), e.rotate(d), e.textAlign = "center", e.textBaseline = "middle"; var g = i.text; if (ut.isArray(g)) for (var p = 0, m = 0; m < g.length; ++m)e.fillText(g[m], 0, p, n), p += s; else e.fillText(g, 0, 0, n); e.restore() } } }); function xn(t, e) { var i = new bn({ ctx: t.ctx, options: e, chart: t }); ke.configure(t, i, e), ke.addBox(t, i), t.titleBlock = i } var yn = {}, kn = un, wn = mn, Mn = { id: "title", _element: bn, beforeInit: function (t) { var e = t.options.title; e && xn(t, e) }, beforeUpdate: function (t) { var e = t.options.title, i = t.titleBlock; e ? (ut.mergeIf(e, st.global.title), i ? (ke.configure(t, i, e), i.options = e) : xn(t, e)) : i && (ke.removeBox(t, i), delete t.titleBlock) } }; for (var _n in yn.filler = kn, yn.legend = wn, yn.title = Mn, ai.helpers = ut, function () { function t(t, e, i) { var n; return "string" == typeof t ? (n = parseInt(t, 10), -1 !== t.indexOf("%") && (n = n / 100 * e.parentNode[i])) : n = t, n } function e(t) { return null != t && "none" !== t } function i(i, n, a) { var o = document.defaultView, r = ut._getParentNode(i), s = o.getComputedStyle(i)[n], l = o.getComputedStyle(r)[n], d = e(s), u = e(l), h = Number.POSITIVE_INFINITY; return d || u ? Math.min(d ? t(s, i, a) : h, u ? t(l, r, a) : h) : "none" } ut.where = function (t, e) { if (ut.isArray(t) && Array.prototype.filter) return t.filter(e); var i = []; return ut.each(t, function (t) { e(t) && i.push(t) }), i }, ut.findIndex = Array.prototype.findIndex ? function (t, e, i) { return t.findIndex(e, i) } : function (t, e, i) { i = void 0 === i ? t : i; for (var n = 0, a = t.length; n < a; ++n)if (e.call(i, t[n], n, t)) return n; return -1 }, ut.findNextWhere = function (t, e, i) { ut.isNullOrUndef(i) && (i = -1); for (var n = i + 1; n < t.length; n++) { var a = t[n]; if (e(a)) return a } }, ut.findPreviousWhere = function (t, e, i) { ut.isNullOrUndef(i) && (i = t.length); for (var n = i - 1; n >= 0; n--) { var a = t[n]; if (e(a)) return a } }, ut.isNumber = function (t) { return !isNaN(parseFloat(t)) && isFinite(t) }, ut.almostEquals = function (t, e, i) { return Math.abs(t - e) < i }, ut.almostWhole = function (t, e) { var i = Math.round(t); return i - e < t && i + e > t }, ut.max = function (t) { return t.reduce(function (t, e) { return isNaN(e) ? t : Math.max(t, e) }, Number.NEGATIVE_INFINITY) }, ut.min = function (t) { return t.reduce(function (t, e) { return isNaN(e) ? t : Math.min(t, e) }, Number.POSITIVE_INFINITY) }, ut.sign = Math.sign ? function (t) { return Math.sign(t) } : function (t) { return 0 == (t = +t) || isNaN(t) ? t : t > 0 ? 1 : -1 }, ut.log10 = Math.log10 ? function (t) { return Math.log10(t) } : function (t) { var e = Math.log(t) * Math.LOG10E, i = Math.round(e); return t === Math.pow(10, i) ? i : e }, ut.toRadians = function (t) { return t * (Math.PI / 180) }, ut.toDegrees = function (t) { return t * (180 / Math.PI) }, ut._decimalPlaces = function (t) { if (ut.isFinite(t)) { for (var e = 1, i = 0; Math.round(t * e) / e !== t;)e *= 10, i++; return i } }, ut.getAngleFromPoint = function (t, e) { var i = e.x - t.x, n = e.y - t.y, a = Math.sqrt(i * i + n * n), o = Math.atan2(n, i); return o < -.5 * Math.PI && (o += 2 * Math.PI), { angle: o, distance: a } }, ut.distanceBetweenPoints = function (t, e) { return Math.sqrt(Math.pow(e.x - t.x, 2) + Math.pow(e.y - t.y, 2)) }, ut.aliasPixel = function (t) { return t % 2 == 0 ? 0 : .5 }, ut._alignPixel = function (t, e, i) { var n = t.currentDevicePixelRatio, a = i / 2; return Math.round((e - a) * n) / n + a }, ut.splineCurve = function (t, e, i, n) { var a = t.skip ? e : t, o = e, r = i.skip ? e : i, s = Math.sqrt(Math.pow(o.x - a.x, 2) + Math.pow(o.y - a.y, 2)), l = Math.sqrt(Math.pow(r.x - o.x, 2) + Math.pow(r.y - o.y, 2)), d = s / (s + l), u = l / (s + l), h = n * (d = isNaN(d) ? 0 : d), c = n * (u = isNaN(u) ? 0 : u); return { previous: { x: o.x - h * (r.x - a.x), y: o.y - h * (r.y - a.y) }, next: { x: o.x + c * (r.x - a.x), y: o.y + c * (r.y - a.y) } } }, ut.EPSILON = Number.EPSILON || 1e-14, ut.splineCurveMonotone = function (t) { var e, i, n, a, o, r, s, l, d, u = (t || []).map(function (t) { return { model: t._model, deltaK: 0, mK: 0 } }), h = u.length; for (e = 0; e < h; ++e)if (!(n = u[e]).model.skip) { if (i = e > 0 ? u[e - 1] : null, (a = e < h - 1 ? u[e + 1] : null) && !a.model.skip) { var c = a.model.x - n.model.x; n.deltaK = 0 !== c ? (a.model.y - n.model.y) / c : 0 } !i || i.model.skip ? n.mK = n.deltaK : !a || a.model.skip ? n.mK = i.deltaK : this.sign(i.deltaK) !== this.sign(n.deltaK) ? n.mK = 0 : n.mK = (i.deltaK + n.deltaK) / 2 } for (e = 0; e < h - 1; ++e)n = u[e], a = u[e + 1], n.model.skip || a.model.skip || (ut.almostEquals(n.deltaK, 0, this.EPSILON) ? n.mK = a.mK = 0 : (o = n.mK / n.deltaK, r = a.mK / n.deltaK, (l = Math.pow(o, 2) + Math.pow(r, 2)) <= 9 || (s = 3 / Math.sqrt(l), n.mK = o * s * n.deltaK, a.mK = r * s * n.deltaK))); for (e = 0; e < h; ++e)(n = u[e]).model.skip || (i = e > 0 ? u[e - 1] : null, a = e < h - 1 ? u[e + 1] : null, i && !i.model.skip && (d = (n.model.x - i.model.x) / 3, n.model.controlPointPreviousX = n.model.x - d, n.model.controlPointPreviousY = n.model.y - d * n.mK), a && !a.model.skip && (d = (a.model.x - n.model.x) / 3, n.model.controlPointNextX = n.model.x + d, n.model.controlPointNextY = n.model.y + d * n.mK)) }, ut.nextItem = function (t, e, i) { return i ? e >= t.length - 1 ? t[0] : t[e + 1] : e >= t.length - 1 ? t[t.length - 1] : t[e + 1] }, ut.previousItem = function (t, e, i) { return i ? e <= 0 ? t[t.length - 1] : t[e - 1] : e <= 0 ? t[0] : t[e - 1] }, ut.niceNum = function (t, e) { var i = Math.floor(ut.log10(t)), n = t / Math.pow(10, i); return (e ? n < 1.5 ? 1 : n < 3 ? 2 : n < 7 ? 5 : 10 : n <= 1 ? 1 : n <= 2 ? 2 : n <= 5 ? 5 : 10) * Math.pow(10, i) }, ut.requestAnimFrame = "undefined" == typeof window ? function (t) { t() } : window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function (t) { return window.setTimeout(t, 1e3 / 60) }, ut.getRelativePosition = function (t, e) { var i, n, a = t.originalEvent || t, o = t.target || t.srcElement, r = o.getBoundingClientRect(), s = a.touches; s && s.length > 0 ? (i = s[0].clientX, n = s[0].clientY) : (i = a.clientX, n = a.clientY); var l = parseFloat(ut.getStyle(o, "padding-left")), d = parseFloat(ut.getStyle(o, "padding-top")), u = parseFloat(ut.getStyle(o, "padding-right")), h = parseFloat(ut.getStyle(o, "padding-bottom")), c = r.right - r.left - l - u, f = r.bottom - r.top - d - h; return { x: i = Math.round((i - r.left - l) / c * o.width / e.currentDevicePixelRatio), y: n = Math.round((n - r.top - d) / f * o.height / e.currentDevicePixelRatio) } }, ut.getConstraintWidth = function (t) { return i(t, "max-width", "clientWidth") }, ut.getConstraintHeight = function (t) { return i(t, "max-height", "clientHeight") }, ut._calculatePadding = function (t, e, i) { return (e = ut.getStyle(t, e)).indexOf("%") > -1 ? i * parseInt(e, 10) / 100 : parseInt(e, 10) }, ut._getParentNode = function (t) { var e = t.parentNode; return e && "[object ShadowRoot]" === e.toString() && (e = e.host), e }, ut.getMaximumWidth = function (t) { var e = ut._getParentNode(t); if (!e) return t.clientWidth; var i = e.clientWidth, n = i - ut._calculatePadding(e, "padding-left", i) - ut._calculatePadding(e, "padding-right", i), a = ut.getConstraintWidth(t); return isNaN(a) ? n : Math.min(n, a) }, ut.getMaximumHeight = function (t) { var e = ut._getParentNode(t); if (!e) return t.clientHeight; var i = e.clientHeight, n = i - ut._calculatePadding(e, "padding-top", i) - ut._calculatePadding(e, "padding-bottom", i), a = ut.getConstraintHeight(t); return isNaN(a) ? n : Math.min(n, a) }, ut.getStyle = function (t, e) { return t.currentStyle ? t.currentStyle[e] : document.defaultView.getComputedStyle(t, null).getPropertyValue(e) }, ut.retinaScale = function (t, e) { var i = t.currentDevicePixelRatio = e || "undefined" != typeof window && window.devicePixelRatio || 1; if (1 !== i) { var n = t.canvas, a = t.height, o = t.width; n.height = a * i, n.width = o * i, t.ctx.scale(i, i), n.style.height || n.style.width || (n.style.height = a + "px", n.style.width = o + "px") } }, ut.fontString = function (t, e, i) { return e + " " + t + "px " + i }, ut.longestText = function (t, e, i, n) { var a = (n = n || {}).data = n.data || {}, o = n.garbageCollect = n.garbageCollect || []; n.font !== e && (a = n.data = {}, o = n.garbageCollect = [], n.font = e), t.font = e; var r = 0; ut.each(i, function (e) { null != e && !0 !== ut.isArray(e) ? r = ut.measureText(t, a, o, r, e) : ut.isArray(e) && ut.each(e, function (e) { null == e || ut.isArray(e) || (r = ut.measureText(t, a, o, r, e)) }) }); var s = o.length / 2; if (s > i.length) { for (var l = 0; l < s; l++)delete a[o[l]]; o.splice(0, s) } return r }, ut.measureText = function (t, e, i, n, a) { var o = e[a]; return o || (o = e[a] = t.measureText(a).width, i.push(a)), o > n && (n = o), n }, ut.numberOfLabelLines = function (t) { var e = 1; return ut.each(t, function (t) { ut.isArray(t) && t.length > e && (e = t.length) }), e }, ut.color = X ? function (t) { return t instanceof CanvasGradient && (t = st.global.defaultColor), X(t) } : function (t) { return console.error("Color.js not found!"), t }, ut.getHoverColor = function (t) { return t instanceof CanvasPattern || t instanceof CanvasGradient ? t : ut.color(t).saturate(.5).darken(.1).rgbString() } }(), ai._adapters = si, ai.Animation = vt, ai.animationService = bt, ai.controllers = ue, ai.DatasetController = Mt, ai.defaults = st, ai.Element = pt, ai.elements = Wt, ai.Interaction = ve, ai.layouts = ke, ai.platform = Ve, ai.plugins = Ee, ai.Scale = fi, ai.scaleService = He, ai.Ticks = li, ai.Tooltip = Je, ai.helpers.each(tn, function (t, e) { ai.scaleService.registerScaleType(e, t, t._defaults) }), yn) yn.hasOwnProperty(_n) && ai.plugins.register(yn[_n]); ai.platform.initialize(); var Cn = ai; return "undefined" != typeof window && (window.Chart = ai), ai.Chart = ai, ai.Legend = yn.legend._element, ai.Title = yn.title._element, ai.pluginService = ai.plugins, ai.PluginBase = ai.Element.extend({}), ai.canvasHelpers = ai.helpers.canvas, ai.layoutService = ai.layouts, ai.LinearScaleBase = bi, ai.helpers.each(["Bar", "Bubble", "Doughnut", "Line", "PolarArea", "Radar", "Scatter"], function (t) { ai[t] = function (e, i) { return new ai(e, ai.helpers.merge(i || {}, { type: t.charAt(0).toLowerCase() + t.slice(1) })) } }), Cn });