if ("undefined" == typeof jQuery)throw Error("Bootstrap's JavaScript requires jQuery"); +function (t) { "use strict" var e = t.fn.jquery.split(" ")[0].split(".") if (e[0] < 2 && e[1] < 9 || 1 == e[0] && 9 == e[1] && e[2] < 1 || e[0] > 2)throw Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 3") }(jQuery), +function (t) { "use strict" function e(e) { return this.each(function () { var i = t(this), s = i.data("bs.alert") s || i.data("bs.alert", s = new n(this)), "string" == typeof e && s[e].call(i) }) } var i = '[data-dismiss="alert"]', n = function (e) { t(e).on("click", i, this.close) } n.VERSION = "3.3.6", n.TRANSITION_DURATION = 150, n.prototype.close = function (e) { function i() { o.detach().trigger("closed.bs.alert").remove() } var s = t(this), a = s.attr("data-target") a || (a = s.attr("href"), a = a && a.replace(/.*(?=#[^\s]*$)/, "")) var o = t(a) e && e.preventDefault(), o.length || (o = s.closest(".alert")), o.trigger(e = t.Event("close.bs.alert")), e.isDefaultPrevented() || (o.removeClass("in"), t.support.transition && o.hasClass("fade") ? o.one("bsTransitionEnd", i).emulateTransitionEnd(n.TRANSITION_DURATION) : i()) } var s = t.fn.alert t.fn.alert = e, t.fn.alert.Constructor = n, t.fn.alert.noConflict = function () { return t.fn.alert = s, this }, t(document).on("click.bs.alert.data-api", i, n.prototype.close) }(jQuery), +function (t) { "use strict" function e(e) { return this.each(function () { var n = t(this), s = n.data("bs.button"), a = "object" == typeof e && e s || n.data("bs.button", s = new i(this, a)), "toggle" == e ? s.toggle() : e && s.setState(e) }) } var i = function (e, n) { this.$element = t(e), this.options = t.extend({}, i.DEFAULTS, n), this.isLoading = !1 } i.VERSION = "3.3.6", i.DEFAULTS = {loadingText: "loading..."}, i.prototype.setState = function (e) { var i = "disabled", n = this.$element, s = n.is("input") ? "val" : "html", a = n.data() e += "Text", null == a.resetText && n.data("resetText", n[s]()), setTimeout(t.proxy(function () { n[s](null == a[e] ? this.options[e] : a[e]), "loadingText" == e ? (this.isLoading = !0, n.addClass(i).attr(i, i)) : this.isLoading && (this.isLoading = !1, n.removeClass(i).removeAttr(i)) }, this), 0) }, i.prototype.toggle = function () { var t = !0, e = this.$element.closest('[data-toggle="buttons"]') if (e.length) { var i = this.$element.find("input") "radio" == i.prop("type") ? (i.prop("checked") && (t = !1), e.find(".active").removeClass("active"), this.$element.addClass("active")) : "checkbox" == i.prop("type") && (i.prop("checked") !== this.$element.hasClass("active") && (t = !1), this.$element.toggleClass("active")), i.prop("checked", this.$element.hasClass("active")), t && i.trigger("change") } else this.$element.attr("aria-pressed", !this.$element.hasClass("active")), this.$element.toggleClass("active") } var n = t.fn.button t.fn.button = e, t.fn.button.Constructor = i, t.fn.button.noConflict = function () { return t.fn.button = n, this }, t(document).on("click.bs.button.data-api", '[data-toggle^="button"]', function (i) { var n = t(i.target) n.hasClass("btn") || (n = n.closest(".btn")), e.call(n, "toggle"), t(i.target).is('input[type="radio"]') || t(i.target).is('input[type="checkbox"]') || i.preventDefault() }).on("focus.bs.button.data-api blur.bs.button.data-api", '[data-toggle^="button"]', function (e) { t(e.target).closest(".btn").toggleClass("focus", /^focus(in)?$/.test(e.type)) }) }(jQuery), +function (t) { "use strict" function e(e) { return this.each(function () { var n = t(this), s = n.data("bs.carousel"), a = t.extend({}, i.DEFAULTS, n.data(), "object" == typeof e && e), o = "string" == typeof e ? e : a.slide s || n.data("bs.carousel", s = new i(this, a)), "number" == typeof e ? s.to(e) : o ? s[o]() : a.interval && s.pause().cycle() }) } var i = function (e, i) { this.$element = t(e), this.$indicators = this.$element.find(".carousel-indicators"), this.options = i, this.paused = null, this.sliding = null, this.interval = null, this.$active = null, this.$items = null, this.options.keyboard && this.$element.on("keydown.bs.carousel", t.proxy(this.keydown, this)), "hover" == this.options.pause && !("ontouchstart" in document.documentElement) && this.$element.on("mouseenter.bs.carousel", t.proxy(this.pause, this)).on("mouseleave.bs.carousel", t.proxy(this.cycle, this)) } i.VERSION = "3.3.6", i.TRANSITION_DURATION = 600, i.DEFAULTS = { interval: 5e3, pause: "hover", wrap: !0, keyboard: !0 }, i.prototype.keydown = function (t) { if (!/input|textarea/i.test(t.target.tagName)) { switch (t.which) { case 37: this.prev() break case 39: this.next() break default: return } t.preventDefault() } }, i.prototype.cycle = function (e) { return e || (this.paused = !1), this.interval && clearInterval(this.interval), this.options.interval && !this.paused && (this.interval = setInterval(t.proxy(this.next, this), this.options.interval)), this }, i.prototype.getItemIndex = function (t) { return this.$items = t.parent().children(".item"), this.$items.index(t || this.$active) }, i.prototype.getItemForDirection = function (t, e) { var i = this.getItemIndex(e), n = "prev" == t && 0 === i || "next" == t && i == this.$items.length - 1 if (n && !this.options.wrap)return e var s = "prev" == t ? -1 : 1, a = (i + s) % this.$items.length return this.$items.eq(a) }, i.prototype.to = function (t) { var e = this, i = this.getItemIndex(this.$active = this.$element.find(".item.active")) return t > this.$items.length - 1 || 0 > t ? void 0 : this.sliding ? this.$element.one("slid.bs.carousel", function () { e.to(t) }) : i == t ? this.pause().cycle() : this.slide(t > i ? "next" : "prev", this.$items.eq(t)) }, i.prototype.pause = function (e) { return e || (this.paused = !0), this.$element.find(".next, .prev").length && t.support.transition && (this.$element.trigger(t.support.transition.end), this.cycle(!0)), this.interval = clearInterval(this.interval), this }, i.prototype.next = function () { return this.sliding ? void 0 : this.slide("next") }, i.prototype.prev = function () { return this.sliding ? void 0 : this.slide("prev") }, i.prototype.slide = function (e, n) { var s = this.$element.find(".item.active"), a = n || this.getItemForDirection(e, s), o = this.interval, r = "next" == e ? "left" : "right", l = this if (a.hasClass("active"))return this.sliding = !1 var d = a[0], h = t.Event("slide.bs.carousel", {relatedTarget: d, direction: r}) if (this.$element.trigger(h), !h.isDefaultPrevented()) { if (this.sliding = !0, o && this.pause(), this.$indicators.length) { this.$indicators.find(".active").removeClass("active") var c = t(this.$indicators.children()[this.getItemIndex(a)]) c && c.addClass("active") } var p = t.Event("slid.bs.carousel", {relatedTarget: d, direction: r}) return t.support.transition && this.$element.hasClass("slide") ? (a.addClass(e), a[0].offsetWidth, s.addClass(r), a.addClass(r), s.one("bsTransitionEnd", function () { a.removeClass([e, r].join(" ")).addClass("active"), s.removeClass(["active", r].join(" ")), l.sliding = !1, setTimeout(function () { l.$element.trigger(p) }, 0) }).emulateTransitionEnd(i.TRANSITION_DURATION)) : (s.removeClass("active"), a.addClass("active"), this.sliding = !1, this.$element.trigger(p)), o && this.cycle(), this } } var n = t.fn.carousel t.fn.carousel = e, t.fn.carousel.Constructor = i, t.fn.carousel.noConflict = function () { return t.fn.carousel = n, this } var s = function (i) { var n, s = t(this), a = t(s.attr("data-target") || (n = s.attr("href")) && n.replace(/.*(?=#[^\s]+$)/, "")) if (a.hasClass("carousel")) { var o = t.extend({}, a.data(), s.data()), r = s.attr("data-slide-to") r && (o.interval = !1), e.call(a, o), r && a.data("bs.carousel").to(r), i.preventDefault() } } t(document).on("click.bs.carousel.data-api", "[data-slide]", s).on("click.bs.carousel.data-api", "[data-slide-to]", s), t(window).on("load", function () { t('[data-ride="carousel"]').each(function () { var i = t(this) e.call(i, i.data()) }) }) }(jQuery), +function (t) { "use strict" function e(e) { var i = e.attr("data-target") i || (i = e.attr("href"), i = i && /#[A-Za-z]/.test(i) && i.replace(/.*(?=#[^\s]*$)/, "")) var n = i && t(i) return n && n.length ? n : e.parent() } function i(i) { i && 3 === i.which || (t(s).remove(), t(a).each(function () { var n = t(this), s = e(n), a = {relatedTarget: this} s.hasClass("open") && (i && "click" == i.type && /input|textarea/i.test(i.target.tagName) && t.contains(s[0], i.target) || (s.trigger(i = t.Event("hide.bs.dropdown", a)), i.isDefaultPrevented() || (n.attr("aria-expanded", "false"), s.removeClass("open").trigger(t.Event("hidden.bs.dropdown", a))))) })) } function n(e) { return this.each(function () { var i = t(this), n = i.data("bs.dropdown") n || i.data("bs.dropdown", n = new o(this)), "string" == typeof e && n[e].call(i) }) } var s = ".dropdown-backdrop", a = '[data-toggle="dropdown"]', o = function (e) { t(e).on("click.bs.dropdown", this.toggle) } o.VERSION = "3.3.6", o.prototype.toggle = function (n) { var s = t(this) if (!s.is(".disabled, :disabled")) { var a = e(s), o = a.hasClass("open") if (i(), !o) { "ontouchstart" in document.documentElement && !a.closest(".navbar-nav").length && t(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(t(this)).on("click", i) var r = {relatedTarget: this} if (a.trigger(n = t.Event("show.bs.dropdown", r)), n.isDefaultPrevented())return s.trigger("focus").attr("aria-expanded", "true"), a.toggleClass("open").trigger(t.Event("shown.bs.dropdown", r)) } return !1 } }, o.prototype.keydown = function (i) { if (/(38|40|27|32)/.test(i.which) && !/input|textarea/i.test(i.target.tagName)) { var n = t(this) if (i.preventDefault(), i.stopPropagation(), !n.is(".disabled, :disabled")) { var s = e(n), o = s.hasClass("open") if (!o && 27 != i.which || o && 27 == i.which)return 27 == i.which && s.find(a).trigger("focus"), n.trigger("click") var r = " li:not(.disabled):visible a", l = s.find(".dropdown-menu" + r) if (l.length) { var d = l.index(i.target) 38 == i.which && d > 0 && d--, 40 == i.which && d < l.length - 1 && d++, ~d || (d = 0), l.eq(d).trigger("focus") } } } } var r = t.fn.dropdown t.fn.dropdown = n, t.fn.dropdown.Constructor = o, t.fn.dropdown.noConflict = function () { return t.fn.dropdown = r, this }, t(document).on("click.bs.dropdown.data-api", i).on("click.bs.dropdown.data-api", ".dropdown form", function (t) { t.stopPropagation() }).on("click.bs.dropdown.data-api", a, o.prototype.toggle).on("keydown.bs.dropdown.data-api", a, o.prototype.keydown).on("keydown.bs.dropdown.data-api", ".dropdown-menu", o.prototype.keydown) }(jQuery), +function (t) { "use strict" function e(e) { return this.each(function () { var n = t(this), s = n.data("bs.affix"), a = "object" == typeof e && e s || n.data("bs.affix", s = new i(this, a)), "string" == typeof e && s[e]() }) } var i = function (e, n) { this.options = t.extend({}, i.DEFAULTS, n), this.$target = t(this.options.target).on("scroll.bs.affix.data-api", t.proxy(this.checkPosition, this)).on("click.bs.affix.data-api", t.proxy(this.checkPositionWithEventLoop, this)), this.$element = t(e), this.affixed = null, this.unpin = null, this.pinnedOffset = null, this.checkPosition() } i.VERSION = "3.3.6", i.RESET = "affix affix-top affix-bottom", i.DEFAULTS = { offset: 0, target: window }, i.prototype.getState = function (t, e, i, n) { var s = this.$target.scrollTop(), a = this.$element.offset(), o = this.$target.height() if (null != i && "top" == this.affixed)return i > s ? "top" : !1 if ("bottom" == this.affixed)return null != i ? s + this.unpin <= a.top ? !1 : "bottom" : t - n >= s + o ? !1 : "bottom" var r = null == this.affixed, l = r ? s : a.top, d = r ? o : e return null != i && i >= s ? "top" : null != n && l + d >= t - n ? "bottom" : !1 }, i.prototype.getPinnedOffset = function () { if (this.pinnedOffset)return this.pinnedOffset this.$element.removeClass(i.RESET).addClass("affix") var t = this.$target.scrollTop(), e = this.$element.offset() return this.pinnedOffset = e.top - t }, i.prototype.checkPositionWithEventLoop = function () { setTimeout(t.proxy(this.checkPosition, this), 1) }, i.prototype.checkPosition = function () { if (this.$element.is(":visible")) { var e = this.$element.height(), n = this.options.offset, s = n.top, a = n.bottom, o = Math.max(t(document).height(), t(document.body).height()) "object" != typeof n && (a = s = n), "function" == typeof s && (s = n.top(this.$element)), "function" == typeof a && (a = n.bottom(this.$element)) var r = this.getState(o, e, s, a) if (this.affixed != r) { null != this.unpin && this.$element.css("top", "") var l = "affix" + (r ? "-" + r : ""), d = t.Event(l + ".bs.affix") if (this.$element.trigger(d), d.isDefaultPrevented())return this.affixed = r, this.unpin = "bottom" == r ? this.getPinnedOffset() : null, this.$element.removeClass(i.RESET).addClass(l).trigger(l.replace("affix", "affixed") + ".bs.affix") } "bottom" == r && this.$element.offset({top: o - e - a}) } } var n = t.fn.affix t.fn.affix = e, t.fn.affix.Constructor = i, t.fn.affix.noConflict = function () { return t.fn.affix = n, this }, t(window).on("load", function () { t('[data-spy="affix"]').each(function () { var i = t(this), n = i.data() n.offset = n.offset || {}, null != n.offsetBottom && (n.offset.bottom = n.offsetBottom), null != n.offsetTop && (n.offset.top = n.offsetTop), e.call(i, n) }) }) }(jQuery), +function (t) { "use strict" function e(e) { var i, n = e.attr("data-target") || (i = e.attr("href")) && i.replace(/.*(?=#[^\s]+$)/, "") return t(n) } function i(e) { return this.each(function () { var i = t(this), s = i.data("bs.collapse"), a = t.extend({}, n.DEFAULTS, i.data(), "object" == typeof e && e) !s && a.toggle && /show|hide/.test(e) && (a.toggle = !1), s || i.data("bs.collapse", s = new n(this, a)), "string" == typeof e && s[e]() }) } var n = function (e, i) { this.$element = t(e), this.options = t.extend({}, n.DEFAULTS, i), this.$trigger = t('[data-toggle="collapse"][href="#' + e.id + '"],[data-toggle="collapse"][data-target="#' + e.id + '"]'), this.transitioning = null, this.options.parent ? this.$parent = this.getParent() : this.addAriaAndCollapsedClass(this.$element, this.$trigger), this.options.toggle && this.toggle() } n.VERSION = "3.3.6", n.TRANSITION_DURATION = 350, n.DEFAULTS = {toggle: !0}, n.prototype.dimension = function () { var t = this.$element.hasClass("width") return t ? "width" : "height" }, n.prototype.show = function () { if (!this.transitioning && !this.$element.hasClass("in")) { var e, s = this.$parent && this.$parent.children(".panel").children(".in, .collapsing") if (!(s && s.length && (e = s.data("bs.collapse"), e && e.transitioning))) { var a = t.Event("show.bs.collapse") if (this.$element.trigger(a), !a.isDefaultPrevented()) { s && s.length && (i.call(s, "hide"), e || s.data("bs.collapse", null)) var o = this.dimension() this.$element.removeClass("collapse").addClass("collapsing")[o](0).attr("aria-expanded", !0), this.$trigger.removeClass("collapsed").attr("aria-expanded", !0), this.transitioning = 1 var r = function () { this.$element.removeClass("collapsing").addClass("collapse in")[o](""), this.transitioning = 0, this.$element.trigger("shown.bs.collapse") } if (!t.support.transition)return r.call(this) var l = t.camelCase(["scroll", o].join("-")) this.$element.one("bsTransitionEnd", t.proxy(r, this)).emulateTransitionEnd(n.TRANSITION_DURATION)[o](this.$element[0][l]) } } } }, n.prototype.hide = function () { if (!this.transitioning && this.$element.hasClass("in")) { var e = t.Event("hide.bs.collapse") if (this.$element.trigger(e), !e.isDefaultPrevented()) { var i = this.dimension() this.$element[i](this.$element[i]())[0].offsetHeight, this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded", !1), this.$trigger.addClass("collapsed").attr("aria-expanded", !1), this.transitioning = 1 var s = function () { this.transitioning = 0, this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse") } return t.support.transition ? void this.$element[i](0).one("bsTransitionEnd", t.proxy(s, this)).emulateTransitionEnd(n.TRANSITION_DURATION) : s.call(this) } } }, n.prototype.toggle = function () { this[this.$element.hasClass("in") ? "hide" : "show"]() }, n.prototype.getParent = function () { return t(this.options.parent).find('[data-toggle="collapse"][data-parent="' + this.options.parent + '"]').each(t.proxy(function (i, n) { var s = t(n) this.addAriaAndCollapsedClass(e(s), s) }, this)).end() }, n.prototype.addAriaAndCollapsedClass = function (t, e) { var i = t.hasClass("in") t.attr("aria-expanded", i), e.toggleClass("collapsed", !i).attr("aria-expanded", i) } var s = t.fn.collapse t.fn.collapse = i, t.fn.collapse.Constructor = n, t.fn.collapse.noConflict = function () { return t.fn.collapse = s, this }, t(document).on("click.bs.collapse.data-api", '[data-toggle="collapse"]', function (n) { var s = t(this) s.attr("data-target") || n.preventDefault() var a = e(s), o = a.data("bs.collapse"), r = o ? "toggle" : s.data() i.call(a, r) }) }(jQuery), +function (t) { "use strict" function e() { var t = document.createElement("bootstrap"), e = { WebkitTransition: "webkitTransitionEnd", MozTransition: "transitionend", OTransition: "oTransitionEnd otransitionend", transition: "transitionend" } for (var i in e)if (void 0 !== t.style[i])return {end: e[i]} return !1 } t.fn.emulateTransitionEnd = function (e) { var i = !1, n = this t(this).one("bsTransitionEnd", function () { i = !0 }) var s = function () { i || t(n).trigger(t.support.transition.end) } return setTimeout(s, e), this }, t(function () { t.support.transition = e(), t.support.transition && (t.event.special.bsTransitionEnd = { bindType: t.support.transition.end, delegateType: t.support.transition.end, handle: function (e) { return t(e.target).is(this) ? e.handleObj.handler.apply(this, arguments) : void 0 } }) }) }(jQuery) + function ($) { 'use strict'; // TOOLTIP PUBLIC CLASS DEFINITION // =============================== var Tooltip = function (element, options) { this.type = null this.options = null this.enabled = null this.timeout = null this.hoverState = null this.$element = null this.inState = null this.init('tooltip', element, options) } Tooltip.VERSION = '3.3.7' Tooltip.TRANSITION_DURATION = 150 Tooltip.DEFAULTS = { animation: true, placement: 'top', selector: false, template: '', trigger: 'hover focus', title: '', delay: 0, html: false, container: false, viewport: { selector: 'body', padding: 0 } } Tooltip.prototype.init = function (type, element, options) { this.enabled = true this.type = type this.$element = $(element) this.options = this.getOptions(options) this.$viewport = this.options.viewport && $($.isFunction(this.options.viewport) ? this.options.viewport.call(this, this.$element) : (this.options.viewport.selector || this.options.viewport)) this.inState = {click: false, hover: false, focus: false} if (this.$element[0] instanceof document.constructor && !this.options.selector) { throw new Error('`selector` option must be specified when initializing ' + this.type + ' on the window.document object!') } var triggers = this.options.trigger.split(' ') for (var i = triggers.length; i--;) { var trigger = triggers[i] if (trigger == 'click') { this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this)) } else if (trigger != 'manual') { var eventIn = trigger == 'hover' ? 'mouseenter' : 'focusin' var eventOut = trigger == 'hover' ? 'mouseleave' : 'focusout' this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this)) this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this)) } } this.options.selector ? (this._options = $.extend({}, this.options, {trigger: 'manual', selector: ''})) : this.fixTitle() } Tooltip.prototype.getDefaults = function () { return Tooltip.DEFAULTS } Tooltip.prototype.getOptions = function (options) { options = $.extend({}, this.getDefaults(), this.$element.data(), options) if (options.delay && typeof options.delay == 'number') { options.delay = { show: options.delay, hide: options.delay } } return options } Tooltip.prototype.getDelegateOptions = function () { var options = {} var defaults = this.getDefaults() this._options && $.each(this._options, function (key, value) { if (defaults[key] != value) options[key] = value }) return options } Tooltip.prototype.enter = function (obj) { var self = obj instanceof this.constructor ? obj : $(obj.currentTarget).data('bs.' + this.type) if (!self) { self = new this.constructor(obj.currentTarget, this.getDelegateOptions()) $(obj.currentTarget).data('bs.' + this.type, self) } if (obj instanceof $.Event) { self.inState[obj.type == 'focusin' ? 'focus' : 'hover'] = true } if (self.tip().hasClass('in') || self.hoverState == 'in') { self.hoverState = 'in' return } clearTimeout(self.timeout) self.hoverState = 'in' if (!self.options.delay || !self.options.delay.show) return self.show() self.timeout = setTimeout(function () { if (self.hoverState == 'in') self.show() }, self.options.delay.show) } Tooltip.prototype.isInStateTrue = function () { for (var key in this.inState) { if (this.inState[key]) return true } return false } Tooltip.prototype.leave = function (obj) { var self = obj instanceof this.constructor ? obj : $(obj.currentTarget).data('bs.' + this.type) if (!self) { self = new this.constructor(obj.currentTarget, this.getDelegateOptions()) $(obj.currentTarget).data('bs.' + this.type, self) } if (obj instanceof $.Event) { self.inState[obj.type == 'focusout' ? 'focus' : 'hover'] = false } if (self.isInStateTrue()) return clearTimeout(self.timeout) self.hoverState = 'out' if (!self.options.delay || !self.options.delay.hide) return self.hide() self.timeout = setTimeout(function () { if (self.hoverState == 'out') self.hide() }, self.options.delay.hide) } Tooltip.prototype.show = function () { var e = $.Event('show.bs.' + this.type) if (this.hasContent() && this.enabled) { this.$element.trigger(e) var inDom = $.contains(this.$element[0].ownerDocument.documentElement, this.$element[0]) if (e.isDefaultPrevented() || !inDom) return var that = this var $tip = this.tip() var tipId = this.getUID(this.type) this.setContent() $tip.attr('id', tipId) this.$element.attr('aria-describedby', tipId) if (this.options.animation) $tip.addClass('fade') var placement = typeof this.options.placement == 'function' ? this.options.placement.call(this, $tip[0], this.$element[0]) : this.options.placement var autoToken = /\s?auto?\s?/i var autoPlace = autoToken.test(placement) if (autoPlace) placement = placement.replace(autoToken, '') || 'top' $tip .detach() .css({top: 0, left: 0, display: 'block'}) .addClass(placement) .data('bs.' + this.type, this) this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element) this.$element.trigger('inserted.bs.' + this.type) var pos = this.getPosition() var actualWidth = $tip[0].offsetWidth var actualHeight = $tip[0].offsetHeight if (autoPlace) { var orgPlacement = placement var viewportDim = this.getPosition(this.$viewport) placement = placement == 'bottom' && pos.bottom + actualHeight > viewportDim.bottom ? 'top' : placement == 'top' && pos.top - actualHeight < viewportDim.top ? 'bottom' : placement == 'right' && pos.right + actualWidth > viewportDim.width ? 'left' : placement == 'left' && pos.left - actualWidth < viewportDim.left ? 'right' : placement $tip .removeClass(orgPlacement) .addClass(placement) } var calculatedOffset = this.getCalculatedOffset(placement, pos, actualWidth, actualHeight) this.applyPlacement(calculatedOffset, placement) var complete = function () { var prevHoverState = that.hoverState that.$element.trigger('shown.bs.' + that.type) that.hoverState = null if (prevHoverState == 'out') that.leave(that) } $.support.transition && this.$tip.hasClass('fade') ? $tip .one('bsTransitionEnd', complete) .emulateTransitionEnd(Tooltip.TRANSITION_DURATION) : complete() } } Tooltip.prototype.applyPlacement = function (offset, placement) { var $tip = this.tip() var width = $tip[0].offsetWidth var height = $tip[0].offsetHeight // manually read margins because getBoundingClientRect includes difference var marginTop = parseInt($tip.css('margin-top'), 10) var marginLeft = parseInt($tip.css('margin-left'), 10) // we must check for NaN for ie 8/9 if (isNaN(marginTop)) marginTop = 0 if (isNaN(marginLeft)) marginLeft = 0 offset.top += marginTop offset.left += marginLeft // $.fn.offset doesn't round pixel values // so we use setOffset directly with our own function B-0 $.offset.setOffset($tip[0], $.extend({ using: function (props) { $tip.css({ top: Math.round(props.top), left: Math.round(props.left) }) } }, offset), 0) $tip.addClass('in') // check to see if placing tip in new offset caused the tip to resize itself var actualWidth = $tip[0].offsetWidth var actualHeight = $tip[0].offsetHeight if (placement == 'top' && actualHeight != height) { offset.top = offset.top + height - actualHeight } var delta = this.getViewportAdjustedDelta(placement, offset, actualWidth, actualHeight) if (delta.left) offset.left += delta.left else offset.top += delta.top var isVertical = /top|bottom/.test(placement) var arrowDelta = isVertical ? delta.left * 2 - width + actualWidth : delta.top * 2 - height + actualHeight var arrowOffsetPosition = isVertical ? 'offsetWidth' : 'offsetHeight' $tip.offset(offset); this.replaceArrow(arrowDelta, $tip[0][arrowOffsetPosition], isVertical) }; Tooltip.prototype.replaceArrow = function (delta, dimension, isVertical) { this.arrow() .css(isVertical ? 'left' : 'top', 50 * (1 - delta / dimension) + '%') .css(isVertical ? 'top' : 'left', '') }; Tooltip.prototype.setContent = function () { var $tip = this.tip(); var title = this.getTitle(); $tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title); $tip.removeClass('fade in top bottom left right') }; Tooltip.prototype.hide = function (callback) { var that = this; var $tip = $(this.$tip); var e = $.Event('hide.bs.' + this.type); function complete() { if (that.hoverState != 'in') $tip.detach(); if (that.$element) { // TODO: Check whether guarding this code with this `if` is really necessary. that.$element .removeAttr('aria-describedby') .trigger('hidden.bs.' + that.type) } callback && callback() } this.$element.trigger(e); if (e.isDefaultPrevented()) return; $tip.removeClass('in'); $.support.transition && $tip.hasClass('fade') ? $tip .one('bsTransitionEnd', complete) .emulateTransitionEnd(Tooltip.TRANSITION_DURATION) : complete(); this.hoverState = null; return this }; Tooltip.prototype.fixTitle = function () { var $e = this.$element; if ($e.attr('title') || typeof $e.attr('data-original-title') != 'string') { $e.attr('data-original-title', $e.attr('title') || '').attr('title', '') } }; Tooltip.prototype.hasContent = function () { return this.getTitle() }; Tooltip.prototype.getPosition = function ($element) { $element = $element || this.$element; var el = $element[0]; var isBody = el.tagName == 'BODY'; var elRect = el.getBoundingClientRect(); if (elRect.width == null) { // width and height are missing in IE8, so compute them manually; see https://github.com/twbs/bootstrap/issues/14093 elRect = $.extend({}, elRect, {width: elRect.right - elRect.left, height: elRect.bottom - elRect.top}) } var isSvg = window.SVGElement && el instanceof window.SVGElement; // Avoid using $.offset() on SVGs since it gives incorrect results in jQuery 3. // See https://github.com/twbs/bootstrap/issues/20280 var elOffset = isBody ? {top: 0, left: 0} : (isSvg ? null : $element.offset()); var scroll = {scroll: isBody ? document.documentElement.scrollTop || document.body.scrollTop : $element.scrollTop()} var outerDims = isBody ? {width: $(window).width(), height: $(window).height()} : null; return $.extend({}, elRect, scroll, outerDims, elOffset) }; Tooltip.prototype.getCalculatedOffset = function (placement, pos, actualWidth, actualHeight) { return placement == 'bottom' ? {top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2} : placement == 'top' ? {top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2} : placement == 'left' ? {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth} : /* placement == 'right' */ { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width } }; Tooltip.prototype.getViewportAdjustedDelta = function (placement, pos, actualWidth, actualHeight) { var delta = {top: 0, left: 0}; if (!this.$viewport) return delta; var viewportPadding = this.options.viewport && this.options.viewport.padding || 0; var viewportDimensions = this.getPosition(this.$viewport); if (/right|left/.test(placement)) { var topEdgeOffset = pos.top - viewportPadding - viewportDimensions.scroll; var bottomEdgeOffset = pos.top + viewportPadding - viewportDimensions.scroll + actualHeight; if (topEdgeOffset < viewportDimensions.top) { // top overflow delta.top = viewportDimensions.top - topEdgeOffset } else if (bottomEdgeOffset > viewportDimensions.top + viewportDimensions.height) { // bottom overflow delta.top = viewportDimensions.top + viewportDimensions.height - bottomEdgeOffset } } else { var leftEdgeOffset = pos.left - viewportPadding; var rightEdgeOffset = pos.left + viewportPadding + actualWidth; if (leftEdgeOffset < viewportDimensions.left) { // left overflow delta.left = viewportDimensions.left - leftEdgeOffset } else if (rightEdgeOffset > viewportDimensions.right) { // right overflow delta.left = viewportDimensions.left + viewportDimensions.width - rightEdgeOffset } } return delta }; Tooltip.prototype.getTitle = function () { var title; var $e = this.$element; var o = this.options; title = $e.attr('data-original-title') || (typeof o.title == 'function' ? o.title.call($e[0]) : o.title); return title }; Tooltip.prototype.getUID = function (prefix) { do prefix += ~~(Math.random() * 1000000) while (document.getElementById(prefix)) return prefix }; Tooltip.prototype.tip = function () { if (!this.$tip) { this.$tip = $(this.options.template) if (this.$tip.length != 1) { throw new Error(this.type + ' `template` option must consist of exactly 1 top-level element!') } } return this.$tip }; Tooltip.prototype.arrow = function () { return (this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow')) }; Tooltip.prototype.enable = function () { this.enabled = true }; Tooltip.prototype.disable = function () { this.enabled = false }; Tooltip.prototype.toggleEnabled = function () { this.enabled = !this.enabled }; Tooltip.prototype.toggle = function (e) { var self = this; if (e) { self = $(e.currentTarget).data('bs.' + this.type); if (!self) { self = new this.constructor(e.currentTarget, this.getDelegateOptions()); $(e.currentTarget).data('bs.' + this.type, self) } } if (e) { self.inState.click = !self.inState.click; if (self.isInStateTrue()) self.enter(self); else self.leave(self) } else { self.tip().hasClass('in') ? self.leave(self) : self.enter(self) } }; Tooltip.prototype.destroy = function () { var that = this; clearTimeout(this.timeout); this.hide(function () { that.$element.off('.' + that.type).removeData('bs.' + that.type); if (that.$tip) { that.$tip.detach() } that.$tip = null; that.$arrow = null; that.$viewport = null; that.$element = null }) }; // TOOLTIP PLUGIN DEFINITION // ========================= function Plugin(option) { return this.each(function () { var $this = $(this); var data = $this.data('bs.tooltip'); var options = typeof option == 'object' && option; if (!data && /destroy|hide/.test(option)) return; if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options))); if (typeof option == 'string') data[option]() }) } var old = $.fn.tooltip; $.fn.tooltip = Plugin; $.fn.tooltip.Constructor = Tooltip; // TOOLTIP NO CONFLICT // =================== $.fn.tooltip.noConflict = function () { $.fn.tooltip = old; return this } }(jQuery); /* ======================================================================== * Bootstrap: modal.js v3.3.7 * http://getbootstrap.com/javascript/#modals * ======================================================================== * Copyright 2011-2016 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * ======================================================================== */ +function ($) { 'use strict'; // MODAL CLASS DEFINITION // ====================== var Modal = function (element, options) { this.options = options; this.$body = $(document.body); this.$element = $(element); this.$dialog = this.$element.find('.modal-dialog'); this.$backdrop = null; this.isShown = null; this.originalBodyPad = null; this.scrollbarWidth = 0; this.ignoreBackdropClick = false; if (this.options.remote) { this.$element .find('.modal-content') .load(this.options.remote, $.proxy(function () { this.$element.trigger('loaded.bs.modal') }, this)) } }; Modal.VERSION = '3.3.7'; Modal.TRANSITION_DURATION = 300; Modal.BACKDROP_TRANSITION_DURATION = 150; Modal.DEFAULTS = { backdrop: true, keyboard: true, show: true }; Modal.prototype.toggle = function (_relatedTarget) { return this.isShown ? this.hide() : this.show(_relatedTarget) }; Modal.prototype.show = function (_relatedTarget) { var that = this; var e = $.Event('show.bs.modal', {relatedTarget: _relatedTarget}); this.$element.trigger(e); if (this.isShown || e.isDefaultPrevented()) return; this.isShown = true; this.checkScrollbar(); this.setScrollbar(); this.$body.addClass('modal-open'); this.escape(); this.resize(); this.$element.on('click.dismiss.bs.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this)); this.$dialog.on('mousedown.dismiss.bs.modal', function () { that.$element.one('mouseup.dismiss.bs.modal', function (e) { if ($(e.target).is(that.$element)) that.ignoreBackdropClick = true }) }); this.backdrop(function () { var transition = $.support.transition && that.$element.hasClass('fade'); if (!that.$element.parent().length) { that.$element.appendTo(that.$body) ;// don't move modals dom position } that.$element .show() .scrollTop(0); that.adjustDialog(); if (transition) { that.$element[0].offsetWidth // force reflow } that.$element.addClass('in'); that.enforceFocus(); var e = $.Event('shown.bs.modal', {relatedTarget: _relatedTarget}); transition ? that.$dialog // wait for modal to slide in .one('bsTransitionEnd', function () { that.$element.trigger('focus').trigger(e) }) .emulateTransitionEnd(Modal.TRANSITION_DURATION) : that.$element.trigger('focus').trigger(e) }) }; Modal.prototype.hide = function (e) { if (e) e.preventDefault(); e = $.Event('hide.bs.modal'); this.$element.trigger(e); if (!this.isShown || e.isDefaultPrevented()) return; this.isShown = false; this.escape(); this.resize(); $(document).off('focusin.bs.modal'); this.$element .removeClass('in') .off('click.dismiss.bs.modal') .off('mouseup.dismiss.bs.modal'); this.$dialog.off('mousedown.dismiss.bs.modal'); $.support.transition && this.$element.hasClass('fade') ? this.$element .one('bsTransitionEnd', $.proxy(this.hideModal, this)) .emulateTransitionEnd(Modal.TRANSITION_DURATION) : this.hideModal() }; Modal.prototype.enforceFocus = function () { $(document) .off('focusin.bs.modal') // guard against infinite focus loop .on('focusin.bs.modal', $.proxy(function (e) { if (document !== e.target && this.$element[0] !== e.target && !this.$element.has(e.target).length) { this.$element.trigger('focus') } }, this)) }; Modal.prototype.escape = function () { if (this.isShown && this.options.keyboard) { this.$element.on('keydown.dismiss.bs.modal', $.proxy(function (e) { e.which == 27 && this.hide() }, this)) } else if (!this.isShown) { this.$element.off('keydown.dismiss.bs.modal') } }; Modal.prototype.resize = function () { if (this.isShown) { $(window).on('resize.bs.modal', $.proxy(this.handleUpdate, this)) } else { $(window).off('resize.bs.modal') } }; Modal.prototype.hideModal = function () { var that = this; this.$element.hide(); this.backdrop(function () { that.$body.removeClass('modal-open'); that.resetAdjustments(); that.resetScrollbar(); that.$element.trigger('hidden.bs.modal') }) }; Modal.prototype.removeBackdrop = function () { this.$backdrop && this.$backdrop.remove(); this.$backdrop = null }; Modal.prototype.backdrop = function (callback) { var that = this; var animate = this.$element.hasClass('fade') ? 'fade' : ''; if (this.isShown && this.options.backdrop) { var doAnimate = $.support.transition && animate; this.$backdrop = $(document.createElement('div')) .addClass('modal-backdrop ' + animate) .appendTo(this.$body) this.$element.on('click.dismiss.bs.modal', $.proxy(function (e) { if (this.ignoreBackdropClick) { this.ignoreBackdropClick = false; return } if (e.target !== e.currentTarget) return; this.options.backdrop == 'static' ? this.$element[0].focus() : this.hide() }, this)); if (doAnimate) this.$backdrop[0].offsetWidth ;// force reflow this.$backdrop.addClass('in'); if (!callback) return; doAnimate ? this.$backdrop .one('bsTransitionEnd', callback) .emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) : callback() } else if (!this.isShown && this.$backdrop) { this.$backdrop.removeClass('in'); var callbackRemove = function () { that.removeBackdrop(); callback && callback() }; $.support.transition && this.$element.hasClass('fade') ? this.$backdrop .one('bsTransitionEnd', callbackRemove) .emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) : callbackRemove() } else if (callback) { callback() } }; // these following methods are used to handle overflowing modals Modal.prototype.handleUpdate = function () { this.adjustDialog() }; Modal.prototype.adjustDialog = function () { var modalIsOverflowing = this.$element[0].scrollHeight > document.documentElement.clientHeight; this.$element.css({ paddingLeft: !this.bodyIsOverflowing && modalIsOverflowing ? this.scrollbarWidth : '', paddingRight: this.bodyIsOverflowing && !modalIsOverflowing ? this.scrollbarWidth : '' }) }; Modal.prototype.resetAdjustments = function () { this.$element.css({ paddingLeft: '', paddingRight: '' }) }; Modal.prototype.checkScrollbar = function () { var fullWindowWidth = window.innerWidth; if (!fullWindowWidth) { // workaround for missing window.innerWidth in IE8 var documentElementRect = document.documentElement.getBoundingClientRect(); fullWindowWidth = documentElementRect.right - Math.abs(documentElementRect.left) } this.bodyIsOverflowing = document.body.clientWidth < fullWindowWidth; this.scrollbarWidth = this.measureScrollbar() }; Modal.prototype.setScrollbar = function () { var bodyPad = parseInt((this.$body.css('padding-right') || 0), 10); this.originalBodyPad = document.body.style.paddingRight || ''; if (this.bodyIsOverflowing) this.$body.css('padding-right', bodyPad + this.scrollbarWidth) }; Modal.prototype.resetScrollbar = function () { this.$body.css('padding-right', this.originalBodyPad) }; Modal.prototype.measureScrollbar = function () { // thx walsh var scrollDiv = document.createElement('div'); scrollDiv.className = 'modal-scrollbar-measure'; this.$body.append(scrollDiv); var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth; this.$body[0].removeChild(scrollDiv); return scrollbarWidth }; // MODAL PLUGIN DEFINITION // ======================= function Plugin(option, _relatedTarget) { return this.each(function () { var $this = $(this); var data = $this.data('bs.modal'); var options = $.extend({}, Modal.DEFAULTS, $this.data(), typeof option == 'object' && option); if (!data) $this.data('bs.modal', (data = new Modal(this, options))); if (typeof option == 'string') data[option](_relatedTarget); else if (options.show) data.show(_relatedTarget) }) } var old = $.fn.modal; $.fn.modal = Plugin; $.fn.modal.Constructor = Modal; // MODAL NO CONFLICT // ================= $.fn.modal.noConflict = function () { $.fn.modal = old; return this }; // MODAL DATA-API // ============== $(document).on('click.bs.modal.data-api', '[data-toggle="modal"]', function (e) { var $this = $(this); var href = $this.attr('href'); var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) ;// strip for ie7 var option = $target.data('bs.modal') ? 'toggle' : $.extend({remote: !/#/.test(href) && href}, $target.data(), $this.data()) if ($this.is('a')) e.preventDefault(); $target.one('show.bs.modal', function (showEvent) { if (showEvent.isDefaultPrevented()) return ;// only register focus restorer if modal will actually get shown $target.one('hidden.bs.modal', function () { $this.is(':visible') && $this.trigger('focus') }) }); Plugin.call($target, option, this) }); }(jQuery);