From d1fbe200f46002431cdeebf965c4b789ef7ed267 Mon Sep 17 00:00:00 2001 From: fat Date: Wed, 6 May 2015 13:34:14 -0700 Subject: remove closureness from plugins --- dist/js/bootstrap.js | 5527 +++++++++++++++------------------------------- dist/js/bootstrap.min.js | 74 +- dist/js/npm.js | 7 +- 3 files changed, 1735 insertions(+), 3873 deletions(-) (limited to 'dist/js') diff --git a/dist/js/bootstrap.js b/dist/js/bootstrap.js index b22c41b9a..a6827d652 100644 --- a/dist/js/bootstrap.js +++ b/dist/js/bootstrap.js @@ -15,4417 +15,2348 @@ if (typeof jQuery === 'undefined') { } }(jQuery); -/** ======================================================================= - * Bootstrap: util.js v4.0.0 - * http://getbootstrap.com/javascript/#alerts - * ======================================================================== - * Copyright 2011-2015 Twitter, Inc. - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - * ======================================================================== - * @fileoverview - Bootstrap's private util helper. Adds private util - * helpers for things like accesibility and transitions. These methods are - * shared across all bootstrap plugins. - * ======================================================================== - */ - -'use strict'; - - -/** - * @type {Object} - */ -var Bootstrap = {} - - -/** - * @const - * @type {string} - */ -Bootstrap.TRANSITION_END = 'bsTransitionEnd' - - -/** - * @const - * @type {Object} - */ -Bootstrap.TransitionEndEvent = { - 'WebkitTransition' : 'webkitTransitionEnd', - 'MozTransition' : 'transitionend', - 'OTransition' : 'oTransitionEnd otransitionend', - 'transition' : 'transitionend' -} - - -/** - * @param {Function} childConstructor - * @param {Function} parentConstructor - */ -Bootstrap.inherits = function(childConstructor, parentConstructor) { - /** @constructor */ - function tempConstructor() {} - tempConstructor.prototype = parentConstructor.prototype - childConstructor.prototype = new tempConstructor() - /** @override */ - childConstructor.prototype.constructor = childConstructor -} - - -/** - * @param {Element} element - * @return {string|null} - */ -Bootstrap.getSelectorFromElement = function (element) { - var selector = element.getAttribute('data-target') - - if (!selector) { - selector = element.getAttribute('href') || '' - selector = /^#[a-z]/i.test(selector) ? selector : null - } - - return selector -} - - -/** - * @param {string} prefix - * @return {string} - */ -Bootstrap.getUID = function (prefix) { - do prefix += ~~(Math.random() * 1000000) - while (document.getElementById(prefix)) - return prefix -} - - -/** - * @return {Object} - */ -Bootstrap.getSpecialTransitionEndEvent = function () { - return { - bindType: Bootstrap.transition.end, - delegateType: Bootstrap.transition.end, - handle: /** @param {jQuery.Event} event */ (function (event) { - if ($(event.target).is(this)) { - return event.handleObj.handler.apply(this, arguments) - } - }) - } -} - - -/** - * @param {Element} element - */ -Bootstrap.reflow = function (element) { - new Function('bs',"return bs")(element.offsetHeight) -} - - -/** - * @return {Object|boolean} - */ -Bootstrap.transitionEndTest = function () { - if (window['QUnit']) { - return false - } - - var el = document.createElement('bootstrap') - for (var name in Bootstrap.TransitionEndEvent) { - if (el.style[name] !== undefined) { - return { end: Bootstrap.TransitionEndEvent[name] } - } - } - return false -} - - -/** - * @param {number} duration - * @this {Element} - * @return {Object} - */ -Bootstrap.transitionEndEmulator = function (duration) { - var called = false - - $(this).one(Bootstrap.TRANSITION_END, function () { - called = true - }) - - var callback = function () { - if (!called) { - $(this).trigger(Bootstrap.transition.end) - } - }.bind(this) - - setTimeout(callback, duration) - - return this -} - - -/** - * ------------------------------------------------------------------------ - * jQuery Interface - * ------------------------------------------------------------------------ - */ - -$.fn.emulateTransitionEnd = Bootstrap.transitionEndEmulator - -$(function () { - Bootstrap.transition = Bootstrap.transitionEndTest() - - if (!Bootstrap.transition) { - return - } - - $.event.special[Bootstrap.TRANSITION_END] = Bootstrap.getSpecialTransitionEndEvent() -}) - -/** ======================================================================= - * Bootstrap: alert.js v4.0.0 - * http://getbootstrap.com/javascript/#alerts - * ======================================================================== - * Copyright 2011-2015 Twitter, Inc. - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - * ======================================================================== - * @fileoverview - Bootstrap's generic alert component. Add dismiss - * functionality to all alert messages with this plugin. - * - * Public Methods & Properties: - * - * + $.alert - * + $.alert.noConflict - * + $.alert.Constructor - * + $.alert.Constructor.VERSION - * + $.alert.Constructor.prototype.close - * - * ======================================================================== - */ - -'use strict'; - - -/** - * Our Alert class. - * @param {Element=} opt_element - * @constructor - */ -var Alert = function (opt_element) { - if (opt_element) { - $(opt_element).on('click', Alert._DISMISS_SELECTOR, Alert._handleDismiss(this)) - } -} - - -/** - * @const - * @type {string} - */ -Alert['VERSION'] = '4.0.0' - - -/** - * @const - * @type {string} - * @private - */ -Alert._NAME = 'alert' - - -/** - * @const - * @type {string} - * @private - */ -Alert._DATA_KEY = 'bs.alert' - - -/** - * @const - * @type {string} - * @private - */ -Alert._DISMISS_SELECTOR = '[data-dismiss="alert"]' - - -/** - * @const - * @type {number} - * @private - */ -Alert._TRANSITION_DURATION = 150 - - -/** - * @const - * @type {Function} - * @private - */ -Alert._JQUERY_NO_CONFLICT = $.fn[Alert._NAME] - - -/** - * @const - * @enum {string} - * @private - */ -Alert._Event = { - CLOSE : 'close.bs.alert', - CLOSED : 'closed.bs.alert' -} - - -/** - * @const - * @enum {string} - * @private - */ -Alert._ClassName = { - ALERT : 'alert', - FADE : 'fade', - IN : 'in' -} - - -/** - * Provides the jQuery Interface for the alert component. - * @param {string=} opt_config - * @this {jQuery} - * @return {jQuery} - * @private - */ -Alert._jQueryInterface = function (opt_config) { - return this.each(function () { - var $this = $(this) - var data = $this.data(Alert._DATA_KEY) - - if (!data) { - data = new Alert(this) - $this.data(Alert._DATA_KEY, data) - } - - if (opt_config === 'close') { - data[opt_config](this) - } - }) -} - - -/** - * Close the alert component - * @param {Alert} alertInstance - * @return {Function} - * @private - */ -Alert._handleDismiss = function (alertInstance) { - return function (event) { - if (event) { - event.preventDefault() - } - - alertInstance['close'](this) - } -} - - -/** - * Close the alert component - * @param {Element} element - */ -Alert.prototype['close'] = function (element) { - var rootElement = this._getRootElement(element) - var customEvent = this._triggerCloseEvent(rootElement) - - if (customEvent.isDefaultPrevented()) return - - this._removeElement(rootElement) -} - - -/** - * Tries to get the alert's root element - * @return {Element} - * @private - */ -Alert.prototype._getRootElement = function (element) { - var parent = false - var selector = Bootstrap.getSelectorFromElement(element) - - if (selector) { - parent = $(selector)[0] - } - - if (!parent) { - parent = $(element).closest('.' + Alert._ClassName.ALERT)[0] - } - - return parent -} - - -/** - * Trigger close event on element - * @return {$.Event} - * @private - */ -Alert.prototype._triggerCloseEvent = function (element) { - var closeEvent = $.Event(Alert._Event.CLOSE) - $(element).trigger(closeEvent) - return closeEvent -} - - -/** - * Trigger closed event and remove element from dom - * @private - */ -Alert.prototype._removeElement = function (element) { - $(element).removeClass(Alert._ClassName.IN) - - if (!Bootstrap.transition || !$(element).hasClass(Alert._ClassName.FADE)) { - this._destroyElement(element) - return - } - - $(element) - .one(Bootstrap.TRANSITION_END, this._destroyElement.bind(this, element)) - .emulateTransitionEnd(Alert._TRANSITION_DURATION) -} - - -/** - * clean up any lingering jquery data and kill element - * @private - */ -Alert.prototype._destroyElement = function (element) { - $(element) - .detach() - .trigger(Alert._Event.CLOSED) - .remove() -} - - -/** - * ------------------------------------------------------------------------ - * jQuery Interface + noConflict implementaiton - * ------------------------------------------------------------------------ - */ - -/** - * @const - * @type {Function} - */ -$.fn[Alert._NAME] = Alert._jQueryInterface - - -/** - * @const - * @type {Function} - */ -$.fn[Alert._NAME]['Constructor'] = Alert - - -/** - * @return {Function} - */ -$.fn[Alert._NAME]['noConflict'] = function () { - $.fn[Alert._NAME] = Alert._JQUERY_NO_CONFLICT - return Alert._jQueryInterface -} - - -/** - * ------------------------------------------------------------------------ - * Data Api implementation - * ------------------------------------------------------------------------ - */ - -$(document).on('click.bs.alert.data-api', Alert._DISMISS_SELECTOR, Alert._handleDismiss(new Alert)) - -/** ======================================================================= - * Bootstrap: button.js v4.0.0 - * http://getbootstrap.com/javascript/#buttons - * ======================================================================== - * Copyright 2011-2015 Twitter, Inc. - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - * ======================================================================== - * @fileoverview - Bootstrap's generic button component. - * - * Note (@fat): Deprecated "setState" – imo, better solutions for managing a - * buttons state should exist outside this plugin. - * - * Public Methods & Properties: - * - * + $.button - * + $.button.noConflict - * + $.button.Constructor - * + $.button.Constructor.VERSION - * + $.button.Constructor.prototype.toggle - * - * ======================================================================== - */ - -'use strict'; - - -/** - * Our Button class. - * @param {Element!} element - * @constructor - */ -var Button = function (element) { - - /** @private {Element} */ - this._element = element - -} - - -/** - * @const - * @type {string} - */ -Button['VERSION'] = '4.0.0' - - -/** - * @const - * @type {string} - * @private - */ -Button._NAME = 'button' - - -/** - * @const - * @type {string} - * @private - */ -Button._DATA_KEY = 'bs.button' - - -/** - * @const - * @type {Function} - * @private - */ -Button._JQUERY_NO_CONFLICT = $.fn[Button._NAME] - - -/** - * @const - * @enum {string} - * @private - */ -Button._ClassName = { - ACTIVE : 'active', - BUTTON : 'btn', - FOCUS : 'focus' -} - - -/** - * @const - * @enum {string} - * @private - */ -Button._Selector = { - DATA_TOGGLE_CARROT : '[data-toggle^="button"]', - DATA_TOGGLE : '[data-toggle="buttons"]', - INPUT : 'input', - ACTIVE : '.active', - BUTTON : '.btn' -} - - -/** - * Provides the jQuery Interface for the Button component. - * @param {string=} opt_config - * @this {jQuery} - * @return {jQuery} - * @private - */ -Button._jQueryInterface = function (opt_config) { - return this.each(function () { - var data = $(this).data(Button._DATA_KEY) - - if (!data) { - data = new Button(this) - $(this).data(Button._DATA_KEY, data) - } - - if (opt_config === 'toggle') { - data[opt_config]() - } - }) -} - - -/** - * Toggle's the button active state - */ -Button.prototype['toggle'] = function () { - var triggerChangeEvent = true - var rootElement = $(this._element).closest(Button._Selector.DATA_TOGGLE)[0] - - if (rootElement) { - var input = $(this._element).find(Button._Selector.INPUT)[0] - if (input) { - if (input.type == 'radio') { - if (input.checked && $(this._element).hasClass(Button._ClassName.ACTIVE)) { - triggerChangeEvent = false - } else { - var activeElement = $(rootElement).find(Button._Selector.ACTIVE)[0] - if (activeElement) { - $(activeElement).removeClass(Button._ClassName.ACTIVE) - } - } - } - - if (triggerChangeEvent) { - input.checked = !$(this._element).hasClass(Button._ClassName.ACTIVE) - $(this._element).trigger('change') - } - } - } else { - this._element.setAttribute('aria-pressed', !$(this._element).hasClass(Button._ClassName.ACTIVE)) - } - - if (triggerChangeEvent) { - $(this._element).toggleClass(Button._ClassName.ACTIVE) - } -} - - -/** - * ------------------------------------------------------------------------ - * jQuery Interface + noConflict implementaiton - * ------------------------------------------------------------------------ - */ - -/** - * @const - * @type {Function} - */ -$.fn[Button._NAME] = Button._jQueryInterface - - -/** - * @const - * @type {Function} - */ -$.fn[Button._NAME]['Constructor'] = Button - - -/** - * @const - * @type {Function} - */ -$.fn[Button._NAME]['noConflict'] = function () { - $.fn[Button._NAME] = Button._JQUERY_NO_CONFLICT - return this -} - - -/** - * ------------------------------------------------------------------------ - * Data Api implementation - * ------------------------------------------------------------------------ - */ - -$(document) - .on('click.bs.button.data-api', Button._Selector.DATA_TOGGLE_CARROT, function (event) { - event.preventDefault() - - var button = event.target - - if (!$(button).hasClass(Button._ClassName.BUTTON)) { - button = $(button).closest(Button._Selector.BUTTON) - } - - Button._jQueryInterface.call($(button), 'toggle') - }) - .on('focus.bs.button.data-api blur.bs.button.data-api', Button._Selector.DATA_TOGGLE_CARROT, function (event) { - var button = $(event.target).closest(Button._Selector.BUTTON)[0] - $(button).toggleClass(Button._ClassName.FOCUS, /^focus(in)?$/.test(event.type)) - }) - -/** ======================================================================= - * Bootstrap: carousel.js v4.0.0 - * http://getbootstrap.com/javascript/#carousel - * ======================================================================== - * Copyright 2011-2015 Twitter, Inc. - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - * ======================================================================== - * @fileoverview - Bootstrap's carousel. A slideshow component for cycling - * through elements, like a carousel. Nested carousels are not supported. - * - * Public Methods & Properties: - * - * + $.carousel - * + $.carousel.noConflict - * + $.carousel.Constructor - * + $.carousel.Constructor.VERSION - * + $.carousel.Constructor.Defaults - * + $.carousel.Constructor.Defaults.interval - * + $.carousel.Constructor.Defaults.pause - * + $.carousel.Constructor.Defaults.wrap - * + $.carousel.Constructor.Defaults.keyboard - * + $.carousel.Constructor.Defaults.slide - * + $.carousel.Constructor.prototype.next - * + $.carousel.Constructor.prototype.prev - * + $.carousel.Constructor.prototype.pause - * + $.carousel.Constructor.prototype.cycle - * - * ======================================================================== - */ - -'use strict'; - - -/** - * Our carousel class. - * @param {Element!} element - * @param {Object=} opt_config - * @constructor - */ -var Carousel = function (element, opt_config) { - - /** @private {Element} */ - this._element = $(element)[0] - - /** @private {Element} */ - this._indicatorsElement = $(this._element).find(Carousel._Selector.INDICATORS)[0] - - /** @private {?Object} */ - this._config = opt_config || null - - /** @private {boolean} */ - this._isPaused = false - - /** @private {boolean} */ - this._isSliding = false - - /** @private {?number} */ - this._interval = null - - /** @private {?Element} */ - this._activeElement = null - - /** @private {?Array} */ - this._items = null - - this._addEventListeners() - -} - - -/** - * @const - * @type {string} - */ -Carousel['VERSION'] = '4.0.0' - - -/** - * @const - * @type {Object} - */ -Carousel['Defaults'] = { - 'interval' : 5000, - 'pause' : 'hover', - 'wrap' : true, - 'keyboard' : true, - 'slide' : false -} - - -/** - * @const - * @type {string} - * @private - */ -Carousel._NAME = 'carousel' - - -/** - * @const - * @type {string} - * @private - */ -Carousel._DATA_KEY = 'bs.carousel' - - -/** - * @const - * @type {number} - * @private - */ -Carousel._TRANSITION_DURATION = 600 - - -/** - * @const - * @enum {string} - * @private - */ -Carousel._Direction = { - NEXT : 'next', - PREVIOUS : 'prev' -} - - -/** - * @const - * @enum {string} - * @private - */ -Carousel._Event = { - SLIDE : 'slide.bs.carousel', - SLID : 'slid.bs.carousel' -} - - -/** - * @const - * @enum {string} - * @private - */ -Carousel._ClassName = { - CAROUSEL : 'carousel', - ACTIVE : 'active', - SLIDE : 'slide', - RIGHT : 'right', - LEFT : 'left', - ITEM : 'carousel-item' -} - - -/** - * @const - * @enum {string} - * @private - */ -Carousel._Selector = { - ACTIVE : '.active', - ACTIVE_ITEM : '.active.carousel-item', - ITEM : '.carousel-item', - NEXT_PREV : '.next, .prev', - INDICATORS : '.carousel-indicators' -} - - -/** - * @const - * @type {Function} - * @private - */ -Carousel._JQUERY_NO_CONFLICT = $.fn[Carousel._NAME] - - -/** - * @param {Object=} opt_config - * @this {jQuery} - * @return {jQuery} - * @private - */ -Carousel._jQueryInterface = function (opt_config) { - return this.each(function () { - var data = $(this).data(Carousel._DATA_KEY) - var config = $.extend({}, Carousel['Defaults'], $(this).data(), typeof opt_config == 'object' && opt_config) - var action = typeof opt_config == 'string' ? opt_config : config.slide - - if (!data) { - data = new Carousel(this, config) - $(this).data(Carousel._DATA_KEY, data) - } - - if (typeof opt_config == 'number') { - data.to(opt_config) - - } else if (action) { - data[action]() - - } else if (config.interval) { - data['pause']() - data['cycle']() - } - }) -} - - -/** - * Click handler for data api - * @param {Event} event - * @this {Element} - * @private - */ -Carousel._dataApiClickHandler = function (event) { - var selector = Bootstrap.getSelectorFromElement(this) - - if (!selector) { - return - } - - var target = $(selector)[0] - - if (!target || !$(target).hasClass(Carousel._ClassName.CAROUSEL)) { - return - } - - var config = $.extend({}, $(target).data(), $(this).data()) - - var slideIndex = this.getAttribute('data-slide-to') - if (slideIndex) { - config.interval = false - } - - Carousel._jQueryInterface.call($(target), config) - - if (slideIndex) { - $(target).data(Carousel._DATA_KEY).to(slideIndex) - } - - event.preventDefault() -} - - -/** - * Advance the carousel to the next slide - */ -Carousel.prototype['next'] = function () { - if (!this._isSliding) { - this._slide(Carousel._Direction.NEXT) - } -} - - -/** - * Return the carousel to the previous slide - */ -Carousel.prototype['prev'] = function () { - if (!this._isSliding) { - this._slide(Carousel._Direction.PREVIOUS) - } -} - - -/** - * Pause the carousel cycle - * @param {Event=} opt_event - */ -Carousel.prototype['pause'] = function (opt_event) { - if (!opt_event) { - this._isPaused = true - } - - if ($(this._element).find(Carousel._Selector.NEXT_PREV)[0] && Bootstrap.transition) { - $(this._element).trigger(Bootstrap.transition.end) - this['cycle'](true) - } - - clearInterval(this._interval) - this._interval = null -} - - -/** - * Cycle to the next carousel item - * @param {Event|boolean=} opt_event - */ -Carousel.prototype['cycle'] = function (opt_event) { - if (!opt_event) { - this._isPaused = false - } - - if (this._interval) { - clearInterval(this._interval) - this._interval = null - } - - if (this._config['interval'] && !this._isPaused) { - this._interval = setInterval(this['next'].bind(this), this._config['interval']) - } -} - - -/** - * @return {Object} - */ -Carousel.prototype['getConfig'] = function () { - return this._config -} - - -/** - * Move active carousel item to specified index - * @param {number} index - */ -Carousel.prototype.to = function (index) { - this._activeElement = $(this._element).find(Carousel._Selector.ACTIVE_ITEM)[0] - - var activeIndex = this._getItemIndex(this._activeElement) - - if (index > (this._items.length - 1) || index < 0) { - return - } - - if (this._isSliding) { - $(this._element).one(Carousel._Event.SLID, function () { this.to(index) }.bind(this)) - return - } - - if (activeIndex == index) { - this['pause']() - this['cycle']() - return - } - - var direction = index > activeIndex ? - Carousel._Direction.NEXT : - Carousel._Direction.PREVIOUS - - this._slide(direction, this._items[index]) -} - - -/** - * Add event listeners to root element - * @private - */ -Carousel.prototype._addEventListeners = function () { - if (this._config['keyboard']) { - $(this._element).on('keydown.bs.carousel', this._keydown.bind(this)) - } - - if (this._config['pause'] == 'hover' && !('ontouchstart' in document.documentElement)) { - $(this._element) - .on('mouseenter.bs.carousel', this['pause'].bind(this)) - .on('mouseleave.bs.carousel', this['cycle'].bind(this)) - } -} - - -/** - * Keydown handler - * @param {Event} event - * @private - */ -Carousel.prototype._keydown = function (event) { - event.preventDefault() - - if (/input|textarea/i.test(event.target.tagName)) return - - switch (event.which) { - case 37: this['prev'](); break - case 39: this['next'](); break - default: return - } -} - - -/** - * Get item index - * @param {Element} element - * @return {number} - * @private - */ -Carousel.prototype._getItemIndex = function (element) { - this._items = $.makeArray($(element).parent().find(Carousel._Selector.ITEM)) - - return this._items.indexOf(element) -} - - -/** - * Get next displayed item based on direction - * @param {Carousel._Direction} direction - * @param {Element} activeElement - * @return {Element} - * @private - */ -Carousel.prototype._getItemByDirection = function (direction, activeElement) { - var activeIndex = this._getItemIndex(activeElement) - var isGoingToWrap = (direction === Carousel._Direction.PREVIOUS && activeIndex === 0) || - (direction === Carousel._Direction.NEXT && activeIndex == (this._items.length - 1)) - - if (isGoingToWrap && !this._config['wrap']) { - return activeElement - } - - var delta = direction == Carousel._Direction.PREVIOUS ? -1 : 1 - var itemIndex = (activeIndex + delta) % this._items.length - - return itemIndex === -1 ? this._items[this._items.length - 1] : this._items[itemIndex] -} - - -/** - * Trigger slide event on element - * @param {Element} relatedTarget - * @param {Carousel._ClassName} directionalClassname - * @return {$.Event} - * @private - */ -Carousel.prototype._triggerSlideEvent = function (relatedTarget, directionalClassname) { - var slideEvent = $.Event(Carousel._Event.SLIDE, { - relatedTarget: relatedTarget, - direction: directionalClassname - }) - - $(this._element).trigger(slideEvent) - - return slideEvent -} - - -/** - * Set the active indicator if available - * @param {Element} element - * @private - */ -Carousel.prototype._setActiveIndicatorElement = function (element) { - if (this._indicatorsElement) { - $(this._indicatorsElement) - .find(Carousel._Selector.ACTIVE) - .removeClass(Carousel._ClassName.ACTIVE) - - var nextIndicator = this._indicatorsElement.children[this._getItemIndex(element)] - if (nextIndicator) { - $(nextIndicator).addClass(Carousel._ClassName.ACTIVE) - } - } -} - - -/** - * Slide the carousel element in a direction - * @param {Carousel._Direction} direction - * @param {Element=} opt_nextElement - */ -Carousel.prototype._slide = function (direction, opt_nextElement) { - var activeElement = $(this._element).find(Carousel._Selector.ACTIVE_ITEM)[0] - var nextElement = opt_nextElement || activeElement && this._getItemByDirection(direction, activeElement) - - var isCycling = !!this._interval - - var directionalClassName = direction == Carousel._Direction.NEXT ? - Carousel._ClassName.LEFT : - Carousel._ClassName.RIGHT - - if (nextElement && $(nextElement).hasClass(Carousel._ClassName.ACTIVE)) { - this._isSliding = false - return - } - - var slideEvent = this._triggerSlideEvent(nextElement, directionalClassName) - if (slideEvent.isDefaultPrevented()) { - return - } - - if (!activeElement || !nextElement) { - // some weirdness is happening, so we bail (maybe throw exception here alerting user that they're dom is off - return - } - - this._isSliding = true - - if (isCycling) { - this['pause']() - } - - this._setActiveIndicatorElement(nextElement) - - var slidEvent = $.Event(Carousel._Event.SLID, { relatedTarget: nextElement, direction: directionalClassName }) - - if (Bootstrap.transition && $(this._element).hasClass(Carousel._ClassName.SLIDE)) { - $(nextElement).addClass(direction) - - Bootstrap.reflow(nextElement) - - $(activeElement).addClass(directionalClassName) - $(nextElement).addClass(directionalClassName) - - $(activeElement) - .one(Bootstrap.TRANSITION_END, function () { - $(nextElement) - .removeClass(directionalClassName) - .removeClass(direction) - - $(nextElement).addClass(Carousel._ClassName.ACTIVE) - - $(activeElement) - .removeClass(Carousel._ClassName.ACTIVE) - .removeClass(direction) - .removeClass(directionalClassName) - - this._isSliding = false - - setTimeout(function () { - $(this._element).trigger(slidEvent) - }.bind(this), 0) - }.bind(this)) - .emulateTransitionEnd(Carousel._TRANSITION_DURATION) - - } else { - $(activeElement).removeClass(Carousel._ClassName.ACTIVE) - $(nextElement).addClass(Carousel._ClassName.ACTIVE) - - this._isSliding = false - $(this._element).trigger(slidEvent) - } - - if (isCycling) { - this['cycle']() - } -} - - -/** - * ------------------------------------------------------------------------ - * jQuery Interface + noConflict implementaiton - * ------------------------------------------------------------------------ - */ - -/** - * @const - * @type {Function} - */ -$.fn[Carousel._NAME] = Carousel._jQueryInterface - - -/** - * @const - * @type {Function} - */ -$.fn[Carousel._NAME]['Constructor'] = Carousel - - -/** - * @const - * @type {Function} - */ -$.fn[Carousel._NAME]['noConflict'] = function () { - $.fn[Carousel._NAME] = Carousel._JQUERY_NO_CONFLICT - return this -} - - -/** - * ------------------------------------------------------------------------ - * Data Api implementation - * ------------------------------------------------------------------------ - */ - -$(document) - .on('click.bs.carousel.data-api', '[data-slide], [data-slide-to]', Carousel._dataApiClickHandler) - -$(window).on('load', function () { - $('[data-ride="carousel"]').each(function () { - var $carousel = $(this) - Carousel._jQueryInterface.call($carousel, /** @type {Object} */ ($carousel.data())) - }) -}) - -/** ======================================================================= - * Bootstrap: collapse.js v4.0.0 - * http://getbootstrap.com/javascript/#collapse - * ======================================================================== - * Copyright 2011-2015 Twitter, Inc. - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - * ======================================================================== - * @fileoverview - Bootstrap's collapse plugin. Flexible support for - * collapsible components like accordions and navigation. - * - * Public Methods & Properties: - * - * + $.carousel - * + $.carousel.noConflict - * + $.carousel.Constructor - * + $.carousel.Constructor.VERSION - * + $.carousel.Constructor.Defaults - * + $.carousel.Constructor.Defaults.toggle - * + $.carousel.Constructor.Defaults.trigger - * + $.carousel.Constructor.Defaults.parent - * + $.carousel.Constructor.prototype.toggle - * + $.carousel.Constructor.prototype.show - * + $.carousel.Constructor.prototype.hide - * - * ======================================================================== - */ - -'use strict'; - - -/** - * Our collapse class. - * @param {Element!} element - * @param {Object=} opt_config - * @constructor - */ -var Collapse = function (element, opt_config) { - - /** @private {Element} */ - this._element = element - - /** @private {Object} */ - this._config = $.extend({}, Collapse['Defaults'], opt_config) - - /** @private {Element} */ - this._trigger = typeof this._config['trigger'] == 'string' ? - $(this._config['trigger'])[0] : this._config['trigger'] - - /** @private {boolean} */ - this._isTransitioning = false - - /** @private {?Element} */ - this._parent = this._config['parent'] ? this._getParent() : null - - if (!this._config['parent']) { - this._addAriaAndCollapsedClass(this._element, this._trigger) - } - - if (this._config['toggle']) { - this['toggle']() - } - -} - - -/** - * @const - * @type {string} - */ -Collapse['VERSION'] = '4.0.0' - - -/** - * @const - * @type {Object} - */ -Collapse['Defaults'] = { - 'toggle' : true, - 'trigger' : '[data-toggle="collapse"]', - 'parent' : null -} - - -/** - * @const - * @type {string} - * @private - */ -Collapse._NAME = 'collapse' - - -/** - * @const - * @type {string} - * @private - */ -Collapse._DATA_KEY = 'bs.collapse' - - -/** - * @const - * @type {number} - * @private - */ -Collapse._TRANSITION_DURATION = 600 - - -/** - * @const - * @type {Function} - * @private - */ -Collapse._JQUERY_NO_CONFLICT = $.fn[Collapse._NAME] - - -/** - * @const - * @enum {string} - * @private - */ -Collapse._Event = { - SHOW : 'show.bs.collapse', - SHOWN : 'shown.bs.collapse', - HIDE : 'hide.bs.collapse', - HIDDEN : 'hidden.bs.collapse' -} - - -/** - * @const - * @enum {string} - * @private - */ -Collapse._ClassName = { - IN : 'in', - COLLAPSE : 'collapse', - COLLAPSING : 'collapsing', - COLLAPSED : 'collapsed' -} - - -/** - * @const - * @enum {string} - * @private - */ -Collapse._Dimension = { - WIDTH : 'width', - HEIGHT : 'height' -} - - -/** - * @const - * @enum {string} - * @private - */ -Collapse._Selector = { - ACTIVES : '.panel > .in, .panel > .collapsing' -} - - -/** - * Provides the jQuery Interface for the alert component. - * @param {Object|string=} opt_config - * @this {jQuery} - * @return {jQuery} - * @private - */ -Collapse._jQueryInterface = function (opt_config) { - return this.each(function () { - var $this = $(this) - var data = $this.data(Collapse._DATA_KEY) - var config = $.extend({}, Collapse['Defaults'], $this.data(), typeof opt_config == 'object' && opt_config) - - if (!data && config['toggle'] && opt_config == 'show') { - config['toggle'] = false - } - - if (!data) { - data = new Collapse(this, config) - $this.data(Collapse._DATA_KEY, data) - } - - if (typeof opt_config == 'string') { - data[opt_config]() - } - }) -} - - -/** - * Function for getting target element from element - * @return {Element} - * @private - */ -Collapse._getTargetFromElement = function (element) { - var selector = Bootstrap.getSelectorFromElement(element) - - return selector ? $(selector)[0] : null -} - - -/** - * Toggles the collapse element based on the presence of the 'in' class - */ -Collapse.prototype['toggle'] = function () { - if ($(this._element).hasClass(Collapse._ClassName.IN)) { - this['hide']() - } else { - this['show']() - } -} - - -/** - * Show's the collapsing element - */ -Collapse.prototype['show'] = function () { - if (this._isTransitioning || $(this._element).hasClass(Collapse._ClassName.IN)) { - return - } - - var activesData, actives - - if (this._parent) { - actives = $.makeArray($(Collapse._Selector.ACTIVES)) - if (!actives.length) { - actives = null - } - } - - if (actives) { - activesData = $(actives).data(Collapse._DATA_KEY) - if (activesData && activesData._isTransitioning) { - return - } - } - - var startEvent = $.Event(Collapse._Event.SHOW) - $(this._element).trigger(startEvent) - if (startEvent.isDefaultPrevented()) { - return - } - - if (actives) { - Collapse._jQueryInterface.call($(actives), 'hide') - if (!activesData) { - $(actives).data(Collapse._DATA_KEY, null) - } - } - - var dimension = this._getDimension() - - $(this._element) - .removeClass(Collapse._ClassName.COLLAPSE) - .addClass(Collapse._ClassName.COLLAPSING) - - this._element.style[dimension] = 0 - this._element.setAttribute('aria-expanded', true) - - if (this._trigger) { - $(this._trigger).removeClass(Collapse._ClassName.COLLAPSED) - this._trigger.setAttribute('aria-expanded', true) - } - - this['setTransitioning'](true) - - var complete = function () { - $(this._element) - .removeClass(Collapse._ClassName.COLLAPSING) - .addClass(Collapse._ClassName.COLLAPSE) - .addClass(Collapse._ClassName.IN) - - this._element.style[dimension] = '' - - this['setTransitioning'](false) - - $(this._element).trigger(Collapse._Event.SHOWN) - }.bind(this) - - if (!Bootstrap.transition) { - complete() - return - } - - var scrollSize = 'scroll' + (dimension[0].toUpperCase() + dimension.slice(1)) - - $(this._element) - .one(Bootstrap.TRANSITION_END, complete) - .emulateTransitionEnd(Collapse._TRANSITION_DURATION) - - this._element.style[dimension] = this._element[scrollSize] + 'px' -} - - -/** - * Hides's the collapsing element - */ -Collapse.prototype['hide'] = function () { - if (this._isTransitioning || !$(this._element).hasClass(Collapse._ClassName.IN)) { - return - } - - var startEvent = $.Event(Collapse._Event.HIDE) - $(this._element).trigger(startEvent) - if (startEvent.isDefaultPrevented()) return - - var dimension = this._getDimension() - var offsetDimension = dimension === Collapse._Dimension.WIDTH ? - 'offsetWidth' : 'offsetHeight' - - this._element.style[dimension] = this._element[offsetDimension] + 'px' - - Bootstrap.reflow(this._element) - - $(this._element) - .addClass(Collapse._ClassName.COLLAPSING) - .removeClass(Collapse._ClassName.COLLAPSE) - .removeClass(Collapse._ClassName.IN) +/* ======================================================================== + * Bootstrap: transition.js v3.3.4 + * http://getbootstrap.com/javascript/#transitions + * ======================================================================== + * Copyright 2011-2015 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * ======================================================================== */ - this._element.setAttribute('aria-expanded', false) - if (this._trigger) { - $(this._trigger).addClass(Collapse._ClassName.COLLAPSED) - this._trigger.setAttribute('aria-expanded', false) - } ++function ($) { + 'use strict'; - this['setTransitioning'](true) + // CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/) + // ============================================================ - var complete = function () { - this['setTransitioning'](false) - $(this._element) - .removeClass(Collapse._ClassName.COLLAPSING) - .addClass(Collapse._ClassName.COLLAPSE) - .trigger(Collapse._Event.HIDDEN) + function transitionEnd() { + var el = document.createElement('bootstrap') - }.bind(this) + var transEndEventNames = { + WebkitTransition : 'webkitTransitionEnd', + MozTransition : 'transitionend', + OTransition : 'oTransitionEnd otransitionend', + transition : 'transitionend' + } - this._element.style[dimension] = 0 + for (var name in transEndEventNames) { + if (el.style[name] !== undefined) { + return { end: transEndEventNames[name] } + } + } - if (!Bootstrap.transition) { - return complete() + return false // explicit for ie8 ( ._.) } - $(this._element) - .one(Bootstrap.TRANSITION_END, complete) - .emulateTransitionEnd(Collapse._TRANSITION_DURATION) -} - - - -/** - * @param {boolean} isTransitioning - */ -Collapse.prototype['setTransitioning'] = function (isTransitioning) { - this._isTransitioning = isTransitioning -} - - -/** - * Returns the collapsing dimension - * @return {string} - * @private - */ -Collapse.prototype._getDimension = function () { - var hasWidth = $(this._element).hasClass(Collapse._Dimension.WIDTH) - return hasWidth ? Collapse._Dimension.WIDTH : Collapse._Dimension.HEIGHT -} - - -/** - * Returns the parent element - * @return {Element} - * @private - */ -Collapse.prototype._getParent = function () { - var selector = '[data-toggle="collapse"][data-parent="' + this._config['parent'] + '"]' - var parent = $(this._config['parent'])[0] - var elements = /** @type {Array.} */ ($.makeArray($(parent).find(selector))) - - for (var i = 0; i < elements.length; i++) { - this._addAriaAndCollapsedClass(Collapse._getTargetFromElement(elements[i]), elements[i]) + // http://blog.alexmaccaw.com/css-transitions + $.fn.emulateTransitionEnd = function (duration) { + var called = false + var $el = this + $(this).one('bsTransitionEnd', function () { called = true }) + var callback = function () { if (!called) $($el).trigger($.support.transition.end) } + setTimeout(callback, duration) + return this } - return parent -} + $(function () { + $.support.transition = transitionEnd() + if (!$.support.transition) return -/** - * Returns the parent element - * @param {Element} element - * @param {Element} trigger - * @private - */ -Collapse.prototype._addAriaAndCollapsedClass = function (element, trigger) { - if (element) { - var isOpen = $(element).hasClass(Collapse._ClassName.IN) - element.setAttribute('aria-expanded', isOpen) - - if (trigger) { - trigger.setAttribute('aria-expanded', isOpen) - $(trigger).toggleClass(Collapse._ClassName.COLLAPSED, !isOpen) + $.event.special.bsTransitionEnd = { + bindType: $.support.transition.end, + delegateType: $.support.transition.end, + handle: function (e) { + if ($(e.target).is(this)) return e.handleObj.handler.apply(this, arguments) + } } - } -} - - - -/** - * ------------------------------------------------------------------------ - * jQuery Interface + noConflict implementaiton - * ------------------------------------------------------------------------ - */ - -/** - * @const - * @type {Function} - */ -$.fn[Collapse._NAME] = Collapse._jQueryInterface - - -/** - * @const - * @type {Function} - */ -$.fn[Collapse._NAME]['Constructor'] = Collapse - - -/** - * @const - * @type {Function} - */ -$.fn[Collapse._NAME]['noConflict'] = function () { - $.fn[Collapse._NAME] = Collapse._JQUERY_NO_CONFLICT - return this -} - - -/** - * ------------------------------------------------------------------------ - * Data Api implementation - * ------------------------------------------------------------------------ - */ - -$(document).on('click.bs.collapse.data-api', '[data-toggle="collapse"]', function (event) { - event.preventDefault() - - var target = Collapse._getTargetFromElement(this) - - var data = $(target).data(Collapse._DATA_KEY) - var config = data ? 'toggle' : $.extend({}, $(this).data(), { trigger: this }) + }) - Collapse._jQueryInterface.call($(target), config) -}) +}(jQuery); -/** ======================================================================= - * Bootstrap: dropdown.js v4.0.0 - * http://getbootstrap.com/javascript/#dropdown +/* ======================================================================== + * Bootstrap: alert.js v3.3.4 + * http://getbootstrap.com/javascript/#alerts * ======================================================================== * Copyright 2011-2015 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - * ======================================================================== - * @fileoverview - Add dropdown menus to nearly anything with this simple - * plugin, including the navbar, tabs, and pills. - * - * Public Methods & Properties: - * - * + $.dropdown - * + $.dropdown.noConflict - * + $.dropdown.Constructor - * + $.dropdown.Constructor.VERSION - * + $.dropdown.Constructor.prototype.toggle - * - * ======================================================================== - */ - -'use strict'; - - -/** - * Our dropdown class. - * @param {Element!} element - * @constructor - */ -var Dropdown = function (element) { - $(element).on('click.bs.dropdown', this['toggle']) -} - - -/** - * @const - * @type {string} - */ -Dropdown['VERSION'] = '4.0.0' + * ======================================================================== */ -/** - * @const - * @type {string} - * @private - */ -Dropdown._NAME = 'dropdown' ++function ($) { + 'use strict'; + // ALERT CLASS DEFINITION + // ====================== -/** - * @const - * @type {string} - * @private - */ -Dropdown._DATA_KEY = 'bs.dropdown' + var dismiss = '[data-dismiss="alert"]' + var Alert = function (el) { + $(el).on('click', dismiss, this.close) + } + Alert.VERSION = '3.3.4' -/** - * @const - * @type {Function} - * @private - */ -Dropdown._JQUERY_NO_CONFLICT = $.fn[Dropdown._NAME] + Alert.TRANSITION_DURATION = 150 + Alert.prototype.close = function (e) { + var $this = $(this) + var selector = $this.attr('data-target') -/** - * @const - * @enum {string} - * @private - */ -Dropdown._Event = { - HIDE : 'hide.bs.dropdown', - HIDDEN : 'hidden.bs.dropdown', - SHOW : 'show.bs.dropdown', - SHOWN : 'shown.bs.dropdown' -} + if (!selector) { + selector = $this.attr('href') + selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7 + } + var $parent = $(selector) -/** - * @const - * @enum {string} - * @private - */ -Dropdown._ClassName = { - BACKDROP : 'dropdown-backdrop', - DISABLED : 'disabled', - OPEN : 'open' -} + if (e) e.preventDefault() + if (!$parent.length) { + $parent = $this.closest('.alert') + } -/** - * @const - * @enum {string} - * @private - */ -Dropdown._Selector = { - BACKDROP : '.dropdown-backdrop', - DATA_TOGGLE : '[data-toggle="dropdown"]', - FORM_CHILD : '.dropdown form', - ROLE_MENU : '[role="menu"]', - ROLE_LISTBOX : '[role="listbox"]', - NAVBAR_NAV : '.navbar-nav', - VISIBLE_ITEMS : '[role="menu"] li:not(.divider) a, [role="listbox"] li:not(.divider) a' -} + $parent.trigger(e = $.Event('close.bs.alert')) + if (e.isDefaultPrevented()) return -/** - * Provides the jQuery Interface for the alert component. - * @param {string=} opt_config - * @this {jQuery} - * @return {jQuery} - * @private - */ -Dropdown._jQueryInterface = function (opt_config) { - return this.each(function () { - var data = $(this).data(Dropdown._DATA_KEY) + $parent.removeClass('in') - if (!data) { - $(this).data(Dropdown._DATA_KEY, (data = new Dropdown(this))) + function removeElement() { + // detach from parent, fire event then clean up data + $parent.detach().trigger('closed.bs.alert').remove() } - if (typeof opt_config === 'string') { - data[opt_config].call(this) - } - }) -} + $.support.transition && $parent.hasClass('fade') ? + $parent + .one('bsTransitionEnd', removeElement) + .emulateTransitionEnd(Alert.TRANSITION_DURATION) : + removeElement() + } -/** - * @param {Event=} opt_event - * @private - */ -Dropdown._clearMenus = function (opt_event) { - if (opt_event && opt_event.which == 3) { - return - } + // ALERT PLUGIN DEFINITION + // ======================= - var backdrop = $(Dropdown._Selector.BACKDROP)[0] - if (backdrop) { - backdrop.parentNode.removeChild(backdrop) - } + function Plugin(option) { + return this.each(function () { + var $this = $(this) + var data = $this.data('bs.alert') - var toggles = /** @type {Array.} */ ($.makeArray($(Dropdown._Selector.DATA_TOGGLE))) + if (!data) $this.data('bs.alert', (data = new Alert(this))) + if (typeof option == 'string') data[option].call($this) + }) + } - for (var i = 0; i < toggles.length; i++) { - var parent = Dropdown._getParentFromElement(toggles[i]) - var relatedTarget = { 'relatedTarget': toggles[i] } + var old = $.fn.alert - if (!$(parent).hasClass(Dropdown._ClassName.OPEN)) { - continue - } + $.fn.alert = Plugin + $.fn.alert.Constructor = Alert - var hideEvent = $.Event(Dropdown._Event.HIDE, relatedTarget) - $(parent).trigger(hideEvent) - if (hideEvent.isDefaultPrevented()) { - continue - } - toggles[i].setAttribute('aria-expanded', 'false') + // ALERT NO CONFLICT + // ================= - $(parent) - .removeClass(Dropdown._ClassName.OPEN) - .trigger(Dropdown._Event.HIDDEN, relatedTarget) + $.fn.alert.noConflict = function () { + $.fn.alert = old + return this } -} -/** - * @param {Element} element - * @return {Element} - * @private - */ -Dropdown._getParentFromElement = function (element) { - var selector = Bootstrap.getSelectorFromElement(element) - - if (selector) { - var parent = $(selector)[0] - } + // ALERT DATA-API + // ============== - return /** @type {Element} */ (parent || element.parentNode) -} + $(document).on('click.bs.alert.data-api', dismiss, Alert.prototype.close) +}(jQuery); -/** - * @param {Event} event - * @this {Element} - * @private - */ -Dropdown._dataApiKeydownHandler = function (event) { - if (!/(38|40|27|32)/.test(event.which) || /input|textarea/i.test(event.target.tagName)) { - return - } +/* ======================================================================== + * Bootstrap: button.js v3.3.4 + * http://getbootstrap.com/javascript/#buttons + * ======================================================================== + * Copyright 2011-2015 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * ======================================================================== */ - event.preventDefault() - event.stopPropagation() - if (this.disabled || $(this).hasClass(Dropdown._ClassName.DISABLED)) { - return - } ++function ($) { + 'use strict'; - var parent = Dropdown._getParentFromElement(this) - var isActive = $(parent).hasClass(Dropdown._ClassName.OPEN) + // BUTTON PUBLIC CLASS DEFINITION + // ============================== - if ((!isActive && event.which != 27) || (isActive && event.which == 27)) { - if (event.which == 27) { - var toggle = $(parent).find(Dropdown._Selector.DATA_TOGGLE)[0] - $(toggle).trigger('focus') - } - $(this).trigger('click') - return + var Button = function (element, options) { + this.$element = $(element) + this.options = $.extend({}, Button.DEFAULTS, options) + this.isLoading = false } - var items = $.makeArray($(Dropdown._Selector.VISIBLE_ITEMS)) + Button.VERSION = '3.3.4' - items = items.filter(function (item) { - return item.offsetWidth || item.offsetHeight - }) - - if (!items.length) { - return + Button.DEFAULTS = { + loadingText: 'loading...' } - var index = items.indexOf(event.target) + Button.prototype.setState = function (state) { + var d = 'disabled' + var $el = this.$element + var val = $el.is('input') ? 'val' : 'html' + var data = $el.data() - if (event.which == 38 && index > 0) index-- // up - if (event.which == 40 && index < items.length - 1) index++ // down - if (!~index) index = 0 + state += 'Text' - items[index].focus() -} + if (data.resetText == null) $el.data('resetText', $el[val]()) + // push to event loop to allow forms to submit + setTimeout($.proxy(function () { + $el[val](data[state] == null ? this.options[state] : data[state]) -/** - * Toggles the dropdown - * @this {Element} - * @return {boolean|undefined} - */ -Dropdown.prototype['toggle'] = function () { - if (this.disabled || $(this).hasClass(Dropdown._ClassName.DISABLED)) { - return + if (state == 'loadingText') { + this.isLoading = true + $el.addClass(d).attr(d, d) + } else if (this.isLoading) { + this.isLoading = false + $el.removeClass(d).removeAttr(d) + } + }, this), 0) + } + + Button.prototype.toggle = function () { + var changed = true + var $parent = this.$element.closest('[data-toggle="buttons"]') + + if ($parent.length) { + var $input = this.$element.find('input') + if ($input.prop('type') == 'radio') { + if ($input.prop('checked')) changed = false + $parent.find('.active').removeClass('active') + this.$element.addClass('active') + } else if ($input.prop('type') == 'checkbox') { + if (($input.prop('checked')) !== this.$element.hasClass('active')) changed = false + this.$element.toggleClass('active') + } + $input.prop('checked', this.$element.hasClass('active')) + if (changed) $input.trigger('change') + } else { + this.$element.attr('aria-pressed', !this.$element.hasClass('active')) + this.$element.toggleClass('active') + } } - var parent = Dropdown._getParentFromElement(this) - var isActive = $(parent).hasClass(Dropdown._ClassName.OPEN) - Dropdown._clearMenus() + // BUTTON PLUGIN DEFINITION + // ======================== - if (isActive) { - return false - } - - if ('ontouchstart' in document.documentElement && !$(parent).closest(Dropdown._Selector.NAVBAR_NAV).length) { - // if mobile we use a backdrop because click events don't delegate - var dropdown = document.createElement('div') - dropdown.className = Dropdown._ClassName.BACKDROP - this.parentNode.insertBefore(this, dropdown) - $(dropdown).on('click', Dropdown._clearMenus) - } + function Plugin(option) { + return this.each(function () { + var $this = $(this) + var data = $this.data('bs.button') + var options = typeof option == 'object' && option - var relatedTarget = { 'relatedTarget': this } - var showEvent = $.Event(Dropdown._Event.SHOW, relatedTarget) + if (!data) $this.data('bs.button', (data = new Button(this, options))) - $(parent).trigger(showEvent) - - if (showEvent.isDefaultPrevented()) { - return + if (option == 'toggle') data.toggle() + else if (option) data.setState(option) + }) } - this.focus() - this.setAttribute('aria-expanded', 'true') - - $(parent).toggleClass(Dropdown._ClassName.OPEN) - - $(parent).trigger(Dropdown._Event.SHOWN, relatedTarget) + var old = $.fn.button - return false -} - - -/** - * ------------------------------------------------------------------------ - * jQuery Interface + noConflict implementaiton - * ------------------------------------------------------------------------ - */ + $.fn.button = Plugin + $.fn.button.Constructor = Button -/** - * @const - * @type {Function} - */ -$.fn[Dropdown._NAME] = Dropdown._jQueryInterface + // BUTTON NO CONFLICT + // ================== -/** - * @const - * @type {Function} - */ -$.fn[Dropdown._NAME]['Constructor'] = Dropdown + $.fn.button.noConflict = function () { + $.fn.button = old + return this + } -/** - * @const - * @type {Function} - */ -$.fn[Dropdown._NAME]['noConflict'] = function () { - $.fn[Dropdown._NAME] = Dropdown._JQUERY_NO_CONFLICT - return this -} + // BUTTON DATA-API + // =============== + $(document) + .on('click.bs.button.data-api', '[data-toggle^="button"]', function (e) { + var $btn = $(e.target) + if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn') + Plugin.call($btn, 'toggle') + if (!($(e.target).is('input[type="radio"]') || $(e.target).is('input[type="checkbox"]'))) e.preventDefault() + }) + .on('focus.bs.button.data-api blur.bs.button.data-api', '[data-toggle^="button"]', function (e) { + $(e.target).closest('.btn').toggleClass('focus', /^focus(in)?$/.test(e.type)) + }) -/** - * ------------------------------------------------------------------------ - * Data Api implementation - * ------------------------------------------------------------------------ - */ +}(jQuery); -$(document) - .on('click.bs.dropdown.data-api', Dropdown._clearMenus) - .on('click.bs.dropdown.data-api', Dropdown._Selector.FORM_CHILD, function (e) { e.stopPropagation() }) - .on('click.bs.dropdown.data-api', Dropdown._Selector.DATA_TOGGLE, Dropdown.prototype['toggle']) - .on('keydown.bs.dropdown.data-api', Dropdown._Selector.DATA_TOGGLE, Dropdown._dataApiKeydownHandler) - .on('keydown.bs.dropdown.data-api', Dropdown._Selector.ROLE_MENU, Dropdown._dataApiKeydownHandler) - .on('keydown.bs.dropdown.data-api', Dropdown._Selector.ROLE_LISTBOX, Dropdown._dataApiKeydownHandler) - -/** ======================================================================= - * Bootstrap: modal.js v4.0.0 - * http://getbootstrap.com/javascript/#modal +/* ======================================================================== + * Bootstrap: carousel.js v3.3.4 + * http://getbootstrap.com/javascript/#carousel * ======================================================================== * Copyright 2011-2015 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - * ======================================================================== - * @fileoverview - Bootstrap's modal plugin. Modals are streamlined, but - * flexible, dialog prompts with the minimum required functionality and - * smart defaults. - * - * Public Methods & Properties: - * - * + $.modal - * + $.modal.noConflict - * + $.modal.Constructor - * + $.modal.Constructor.VERSION - * + $.modal.Constructor.Defaults - * + $.modal.Constructor.Defaults.backdrop - * + $.modal.Constructor.Defaults.keyboard - * + $.modal.Constructor.Defaults.show - * + $.modal.Constructor.prototype.toggle - * + $.modal.Constructor.prototype.show - * + $.modal.Constructor.prototype.hide - * - * ======================================================================== - */ - -'use strict'; - - -/** - * Our modal class. - * @param {Element} element - * @param {Object} config - * @constructor - */ -var Modal = function (element, config) { - - /** @private {Object} */ - this._config = config - - /** @private {Element} */ - this._element = element - - /** @private {Element} */ - this._backdrop = null - - /** @private {boolean} */ - this._isShown = false - - /** @private {boolean} */ - this._isBodyOverflowing = false - - /** @private {number} */ - this._scrollbarWidth = 0 - -} - - -/** - * @const - * @type {string} - */ -Modal['VERSION'] = '4.0.0' - - -/** - * @const - * @type {Object} - */ -Modal['Defaults'] = { - 'backdrop' : true, - 'keyboard' : true, - 'show' : true -} - - -/** - * @const - * @type {string} - * @private - */ -Modal._NAME = 'modal' + * ======================================================================== */ -/** - * @const - * @type {string} - * @private - */ -Modal._DATA_KEY = 'bs.modal' - - -/** - * @const - * @type {number} - * @private - */ -Modal._TRANSITION_DURATION = 300 - - -/** - * @const - * @type {number} - * @private - */ -Modal._BACKDROP_TRANSITION_DURATION = 150 - - -/** - * @const - * @type {Function} - * @private - */ -Modal._JQUERY_NO_CONFLICT = $.fn[Modal._NAME] - ++function ($) { + 'use strict'; -/** - * @const - * @enum {string} - * @private - */ -Modal._Event = { - HIDE : 'hide.bs.modal', - HIDDEN : 'hidden.bs.modal', - SHOW : 'show.bs.modal', - SHOWN : 'shown.bs.modal' -} + // CAROUSEL CLASS DEFINITION + // ========================= + var Carousel = function (element, options) { + this.$element = $(element) + this.$indicators = this.$element.find('.carousel-indicators') + this.options = options + this.paused = null + this.sliding = null + this.interval = null + this.$active = null + this.$items = null -/** - * @const - * @enum {string} - * @private - */ -Modal._ClassName = { - BACKDROP : 'modal-backdrop', - OPEN : 'modal-open', - FADE : 'fade', - IN : 'in' -} + this.options.keyboard && this.$element.on('keydown.bs.carousel', $.proxy(this.keydown, this)) + this.options.pause == 'hover' && !('ontouchstart' in document.documentElement) && this.$element + .on('mouseenter.bs.carousel', $.proxy(this.pause, this)) + .on('mouseleave.bs.carousel', $.proxy(this.cycle, this)) + } -/** - * @const - * @enum {string} - * @private - */ -Modal._Selector = { - DIALOG : '.modal-dialog', - DATA_TOGGLE : '[data-toggle="modal"]', - DATA_DISMISS : '[data-dismiss="modal"]', - SCROLLBAR_MEASURER : 'modal-scrollbar-measure' -} + Carousel.VERSION = '3.3.4' + Carousel.TRANSITION_DURATION = 600 + Carousel.DEFAULTS = { + interval: 5000, + pause: 'hover', + wrap: true, + keyboard: true + } -/** - * Provides the jQuery Interface for the alert component. - * @param {Object|string=} opt_config - * @param {Element=} opt_relatedTarget - * @this {jQuery} - * @return {jQuery} - * @private - */ -Modal._jQueryInterface = function Plugin(opt_config, opt_relatedTarget) { - return this.each(function () { - var data = $(this).data(Modal._DATA_KEY) - var config = $.extend({}, Modal['Defaults'], $(this).data(), typeof opt_config == 'object' && opt_config) - - if (!data) { - data = new Modal(this, config) - $(this).data(Modal._DATA_KEY, data) + Carousel.prototype.keydown = function (e) { + if (/input|textarea/i.test(e.target.tagName)) return + switch (e.which) { + case 37: this.prev(); break + case 39: this.next(); break + default: return } - if (typeof opt_config == 'string') { - data[opt_config](opt_relatedTarget) - - } else if (config['show']) { - data['show'](opt_relatedTarget) - } - }) -} + e.preventDefault() + } + Carousel.prototype.cycle = function (e) { + e || (this.paused = false) -/** - * @param {Element} relatedTarget - */ -Modal.prototype['toggle'] = function (relatedTarget) { - return this._isShown ? this['hide']() : this['show'](relatedTarget) -} + this.interval && clearInterval(this.interval) + this.options.interval + && !this.paused + && (this.interval = setInterval($.proxy(this.next, this), this.options.interval)) -/** - * @param {Element} relatedTarget - */ -Modal.prototype['show'] = function (relatedTarget) { - var showEvent = $.Event(Modal._Event.SHOW, { relatedTarget: relatedTarget }) + return this + } - $(this._element).trigger(showEvent) + Carousel.prototype.getItemIndex = function (item) { + this.$items = item.parent().children('.item') + return this.$items.index(item || this.$active) + } - if (this._isShown || showEvent.isDefaultPrevented()) { - return + Carousel.prototype.getItemForDirection = function (direction, active) { + var activeIndex = this.getItemIndex(active) + var willWrap = (direction == 'prev' && activeIndex === 0) + || (direction == 'next' && activeIndex == (this.$items.length - 1)) + if (willWrap && !this.options.wrap) return active + var delta = direction == 'prev' ? -1 : 1 + var itemIndex = (activeIndex + delta) % this.$items.length + return this.$items.eq(itemIndex) } - this._isShown = true + Carousel.prototype.to = function (pos) { + var that = this + var activeIndex = this.getItemIndex(this.$active = this.$element.find('.item.active')) - this._checkScrollbar() - this._setScrollbar() + if (pos > (this.$items.length - 1) || pos < 0) return - $(document.body).addClass(Modal._ClassName.OPEN) + if (this.sliding) return this.$element.one('slid.bs.carousel', function () { that.to(pos) }) // yes, "slid" + if (activeIndex == pos) return this.pause().cycle() - this._escape() - this._resize() + return this.slide(pos > activeIndex ? 'next' : 'prev', this.$items.eq(pos)) + } - $(this._element).on('click.dismiss.bs.modal', Modal._Selector.DATA_DISMISS, this['hide'].bind(this)) + Carousel.prototype.pause = function (e) { + e || (this.paused = true) - this._showBackdrop(this._showElement.bind(this, relatedTarget)) -} + if (this.$element.find('.next, .prev').length && $.support.transition) { + this.$element.trigger($.support.transition.end) + this.cycle(true) + } + this.interval = clearInterval(this.interval) -/** - * @param {Event} event - */ -Modal.prototype['hide'] = function (event) { - if (event) { - event.preventDefault() + return this } - var hideEvent = $.Event(Modal._Event.HIDE) - - $(this._element).trigger(hideEvent) - - if (!this._isShown || hideEvent.isDefaultPrevented()) { - return + Carousel.prototype.next = function () { + if (this.sliding) return + return this.slide('next') } - this._isShown = false + Carousel.prototype.prev = function () { + if (this.sliding) return + return this.slide('prev') + } - this._escape() - this._resize() + Carousel.prototype.slide = function (type, next) { + var $active = this.$element.find('.item.active') + var $next = next || this.getItemForDirection(type, $active) + var isCycling = this.interval + var direction = type == 'next' ? 'left' : 'right' + var that = this - $(document).off('focusin.bs.modal') + if ($next.hasClass('active')) return (this.sliding = false) - $(this._element).removeClass(Modal._ClassName.IN) - this._element.setAttribute('aria-hidden', true) + var relatedTarget = $next[0] + var slideEvent = $.Event('slide.bs.carousel', { + relatedTarget: relatedTarget, + direction: direction + }) + this.$element.trigger(slideEvent) + if (slideEvent.isDefaultPrevented()) return + + this.sliding = true + + isCycling && this.pause() + + if (this.$indicators.length) { + this.$indicators.find('.active').removeClass('active') + var $nextIndicator = $(this.$indicators.children()[this.getItemIndex($next)]) + $nextIndicator && $nextIndicator.addClass('active') + } + + var slidEvent = $.Event('slid.bs.carousel', { relatedTarget: relatedTarget, direction: direction }) // yes, "slid" + if ($.support.transition && this.$element.hasClass('slide')) { + $next.addClass(type) + $next[0].offsetWidth // force reflow + $active.addClass(direction) + $next.addClass(direction) + $active + .one('bsTransitionEnd', function () { + $next.removeClass([type, direction].join(' ')).addClass('active') + $active.removeClass(['active', direction].join(' ')) + that.sliding = false + setTimeout(function () { + that.$element.trigger(slidEvent) + }, 0) + }) + .emulateTransitionEnd(Carousel.TRANSITION_DURATION) + } else { + $active.removeClass('active') + $next.addClass('active') + this.sliding = false + this.$element.trigger(slidEvent) + } - $(this._element).off('click.dismiss.bs.modal') + isCycling && this.cycle() - if (Bootstrap.transition && $(this._element).hasClass(Modal._ClassName.FADE)) { - $(this._element) - .one(Bootstrap.TRANSITION_END, this._hideModal.bind(this)) - .emulateTransitionEnd(Modal._TRANSITION_DURATION) - } else { - this._hideModal() + return this } -} - - -/** - * @param {Element} relatedTarget - * @private - */ -Modal.prototype._showElement = function (relatedTarget) { - var transition = Bootstrap.transition && $(this._element).hasClass(Modal._ClassName.FADE) - if (!this._element.parentNode || this._element.parentNode.nodeType != Node.ELEMENT_NODE) { - document.body.appendChild(this._element) // don't move modals dom position - } - this._element.style.display = 'block' - this._element.scrollTop = 0 + // CAROUSEL PLUGIN DEFINITION + // ========================== - if (this._config['backdrop']) { - this._adjustBackdrop() - } + function Plugin(option) { + return this.each(function () { + var $this = $(this) + var data = $this.data('bs.carousel') + var options = $.extend({}, Carousel.DEFAULTS, $this.data(), typeof option == 'object' && option) + var action = typeof option == 'string' ? option : options.slide - if (transition) { - Bootstrap.reflow(this._element) + if (!data) $this.data('bs.carousel', (data = new Carousel(this, options))) + if (typeof option == 'number') data.to(option) + else if (action) data[action]() + else if (options.interval) data.pause().cycle() + }) } - $(this._element).addClass(Modal._ClassName.IN) - this._element.setAttribute('aria-hidden', false) + var old = $.fn.carousel - this._enforceFocus() + $.fn.carousel = Plugin + $.fn.carousel.Constructor = Carousel - var shownEvent = $.Event(Modal._Event.SHOWN, { relatedTarget: relatedTarget }) - var transitionComplete = function () { - this._element.focus() - $(this._element).trigger(shownEvent) - }.bind(this) + // CAROUSEL NO CONFLICT + // ==================== - if (transition) { - var dialog = $(this._element).find(Modal._Selector.DIALOG)[0] - $(dialog) - .one(Bootstrap.TRANSITION_END, transitionComplete) - .emulateTransitionEnd(Modal._TRANSITION_DURATION) - } else { - transitionComplete() + $.fn.carousel.noConflict = function () { + $.fn.carousel = old + return this } -} - -/** - * @private - */ -Modal.prototype._enforceFocus = function () { - $(document) - .off('focusin.bs.modal') // guard against infinite focus loop - .on('focusin.bs.modal', function (e) { - if (this._element !== e.target && !$(this._element).has(e.target).length) { - this._element.focus() - } - }.bind(this)) -} - + // CAROUSEL DATA-API + // ================= -/** - * @private - */ -Modal.prototype._escape = function () { - if (this._isShown && this._config['keyboard']) { - $(this._element).on('keydown.dismiss.bs.modal', function (event) { - if (event.which === 27) { - this['hide']() - } - }.bind(this)) + var clickHandler = function (e) { + var href + var $this = $(this) + var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) // strip for ie7 + if (!$target.hasClass('carousel')) return + var options = $.extend({}, $target.data(), $this.data()) + var slideIndex = $this.attr('data-slide-to') + if (slideIndex) options.interval = false - } else if (!this._isShown) { - $(this._element).off('keydown.dismiss.bs.modal') - } -} + Plugin.call($target, options) + if (slideIndex) { + $target.data('bs.carousel').to(slideIndex) + } -/** - * @private - */ -Modal.prototype._resize = function () { - if (this._isShown) { - $(window).on('resize.bs.modal', this._handleUpdate.bind(this)) - } else { - $(window).off('resize.bs.modal') + e.preventDefault() } -} + $(document) + .on('click.bs.carousel.data-api', '[data-slide]', clickHandler) + .on('click.bs.carousel.data-api', '[data-slide-to]', clickHandler) -/** - * @private - */ -Modal.prototype._hideModal = function () { - this._element.style.display = 'none' - this._showBackdrop(function () { - $(document.body).removeClass(Modal._ClassName.OPEN) - this._resetAdjustments() - this._resetScrollbar() - $(this._element).trigger(Modal._Event.HIDDEN) - }.bind(this)) -} + $(window).on('load', function () { + $('[data-ride="carousel"]').each(function () { + var $carousel = $(this) + Plugin.call($carousel, $carousel.data()) + }) + }) +}(jQuery); -/** - * @private - */ -Modal.prototype._removeBackdrop = function () { - if (this._backdrop) { - this._backdrop.parentNode.removeChild(this._backdrop) - this._backdrop = null - } -} +/* ======================================================================== + * Bootstrap: collapse.js v3.3.4 + * http://getbootstrap.com/javascript/#collapse + * ======================================================================== + * Copyright 2011-2015 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * ======================================================================== */ -/** - * @param {Function} callback - * @private - */ -Modal.prototype._showBackdrop = function (callback) { - var animate = $(this._element).hasClass(Modal._ClassName.FADE) ? Modal._ClassName.FADE : '' ++function ($) { + 'use strict'; - if (this._isShown && this._config['backdrop']) { - var doAnimate = Bootstrap.transition && animate + // COLLAPSE PUBLIC CLASS DEFINITION + // ================================ - this._backdrop = document.createElement('div') - this._backdrop.className = Modal._ClassName.BACKDROP + var Collapse = function (element, options) { + this.$element = $(element) + this.options = $.extend({}, Collapse.DEFAULTS, options) + this.$trigger = $('[data-toggle="collapse"][href="#' + element.id + '"],' + + '[data-toggle="collapse"][data-target="#' + element.id + '"]') + this.transitioning = null - if (animate) { - $(this._backdrop).addClass(animate) + if (this.options.parent) { + this.$parent = this.getParent() + } else { + this.addAriaAndCollapsedClass(this.$element, this.$trigger) } - $(this._element).prepend(this._backdrop) - - $(this._backdrop).on('click.dismiss.bs.modal', function (event) { - if (event.target !== event.currentTarget) return - this._config['backdrop'] === 'static' - ? this._element.focus() - : this['hide']() - }.bind(this)) - - if (doAnimate) { - Bootstrap.reflow(this._backdrop) - } + if (this.options.toggle) this.toggle() + } - $(this._backdrop).addClass(Modal._ClassName.IN) + Collapse.VERSION = '3.3.4' - if (!callback) { - return - } + Collapse.TRANSITION_DURATION = 350 - if (!doAnimate) { - callback() - return - } + Collapse.DEFAULTS = { + toggle: true + } - $(this._backdrop) - .one(Bootstrap.TRANSITION_END, callback) - .emulateTransitionEnd(Modal._BACKDROP_TRANSITION_DURATION) + Collapse.prototype.dimension = function () { + var hasWidth = this.$element.hasClass('width') + return hasWidth ? 'width' : 'height' + } - } else if (!this._isShown && this._backdrop) { - $(this._backdrop).removeClass(Modal._ClassName.IN) + Collapse.prototype.show = function () { + if (this.transitioning || this.$element.hasClass('in')) return - var callbackRemove = function () { - this._removeBackdrop() - if (callback) { - callback() - } - }.bind(this) + var activesData + var actives = this.$parent && this.$parent.children('.panel').children('.in, .collapsing') - if (Bootstrap.transition && $(this._element).hasClass(Modal._ClassName.FADE)) { - $(this._backdrop) - .one(Bootstrap.TRANSITION_END, callbackRemove) - .emulateTransitionEnd(Modal._BACKDROP_TRANSITION_DURATION) - } else { - callbackRemove() + if (actives && actives.length) { + activesData = actives.data('bs.collapse') + if (activesData && activesData.transitioning) return } - } else if (callback) { - callback() - } -} + var startEvent = $.Event('show.bs.collapse') + this.$element.trigger(startEvent) + if (startEvent.isDefaultPrevented()) return + + if (actives && actives.length) { + Plugin.call(actives, 'hide') + activesData || actives.data('bs.collapse', null) + } + var dimension = this.dimension() -/** - * ------------------------------------------------------------------------ - * the following methods are used to handle overflowing modals - * todo (fat): these should probably be refactored into a - * ------------------------------------------------------------------------ - */ + this.$element + .removeClass('collapse') + .addClass('collapsing')[dimension](0) + .attr('aria-expanded', true) + this.$trigger + .removeClass('collapsed') + .attr('aria-expanded', true) -/** - * @private - */ -Modal.prototype._handleUpdate = function () { - if (this._config['backdrop']) this._adjustBackdrop() - this._adjustDialog() -} + this.transitioning = 1 -/** - * @private - */ -Modal.prototype._adjustBackdrop = function () { - this._backdrop.style.height = 0 // todo (fat): no clue why we do this - this._backdrop.style.height = this._element.scrollHeight + 'px' -} + var complete = function () { + this.$element + .removeClass('collapsing') + .addClass('collapse in')[dimension]('') + this.transitioning = 0 + this.$element + .trigger('shown.bs.collapse') + } + if (!$.support.transition) return complete.call(this) -/** - * @private - */ -Modal.prototype._adjustDialog = function () { - var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight + var scrollSize = $.camelCase(['scroll', dimension].join('-')) - if (!this._isBodyOverflowing && isModalOverflowing) { - this._element.style.paddingLeft = this._scrollbarWidth + 'px' + this.$element + .one('bsTransitionEnd', $.proxy(complete, this)) + .emulateTransitionEnd(Collapse.TRANSITION_DURATION)[dimension](this.$element[0][scrollSize]) } - if (this._isBodyOverflowing && !isModalOverflowing) { - this._element.style.paddingRight = this._scrollbarWidth + 'px' - } -} + Collapse.prototype.hide = function () { + if (this.transitioning || !this.$element.hasClass('in')) return + var startEvent = $.Event('hide.bs.collapse') + this.$element.trigger(startEvent) + if (startEvent.isDefaultPrevented()) return -/** - * @private - */ -Modal.prototype._resetAdjustments = function () { - this._element.style.paddingLeft = '' - this._element.style.paddingRight = '' -} + var dimension = this.dimension() + this.$element[dimension](this.$element[dimension]())[0].offsetHeight -/** - * @private - */ -Modal.prototype._checkScrollbar = function () { - this._isBodyOverflowing = document.body.scrollHeight > document.documentElement.clientHeight - this._scrollbarWidth = this._getScrollbarWidth() -} + this.$element + .addClass('collapsing') + .removeClass('collapse in') + .attr('aria-expanded', false) + this.$trigger + .addClass('collapsed') + .attr('aria-expanded', false) -/** - * @private - */ -Modal.prototype._setScrollbar = function () { - var bodyPadding = parseInt(($(document.body).css('padding-right') || 0), 10) + this.transitioning = 1 - if (this._isBodyOverflowing) { - document.body.style.paddingRight = bodyPadding + this._scrollbarWidth + 'px' + var complete = function () { + this.transitioning = 0 + this.$element + .removeClass('collapsing') + .addClass('collapse') + .trigger('hidden.bs.collapse') + } + + if (!$.support.transition) return complete.call(this) + + this.$element + [dimension](0) + .one('bsTransitionEnd', $.proxy(complete, this)) + .emulateTransitionEnd(Collapse.TRANSITION_DURATION) } -} + Collapse.prototype.toggle = function () { + this[this.$element.hasClass('in') ? 'hide' : 'show']() + } -/** - * @private - */ -Modal.prototype._resetScrollbar = function () { - document.body.style.paddingRight = '' -} + Collapse.prototype.getParent = function () { + return $(this.options.parent) + .find('[data-toggle="collapse"][data-parent="' + this.options.parent + '"]') + .each($.proxy(function (i, element) { + var $element = $(element) + this.addAriaAndCollapsedClass(getTargetFromTrigger($element), $element) + }, this)) + .end() + } + Collapse.prototype.addAriaAndCollapsedClass = function ($element, $trigger) { + var isOpen = $element.hasClass('in') -/** - * @private - */ -Modal.prototype._getScrollbarWidth = function () { // thx walsh - var scrollDiv = document.createElement('div') - scrollDiv.className = Modal._Selector.SCROLLBAR_MEASURER - document.body.appendChild(scrollDiv) - var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth - document.body.removeChild(scrollDiv) - return scrollbarWidth -} + $element.attr('aria-expanded', isOpen) + $trigger + .toggleClass('collapsed', !isOpen) + .attr('aria-expanded', isOpen) + } + function getTargetFromTrigger($trigger) { + var href + var target = $trigger.attr('data-target') + || (href = $trigger.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') // strip for ie7 -/** - * ------------------------------------------------------------------------ - * jQuery Interface + noConflict implementaiton - * ------------------------------------------------------------------------ - */ + return $(target) + } -/** - * @const - * @type {Function} - */ -$.fn[Modal._NAME] = Modal._jQueryInterface + // COLLAPSE PLUGIN DEFINITION + // ========================== -/** - * @const - * @type {Function} - */ -$.fn[Modal._NAME]['Constructor'] = Modal + function Plugin(option) { + return this.each(function () { + var $this = $(this) + var data = $this.data('bs.collapse') + var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option) + if (!data && options.toggle && /show|hide/.test(option)) options.toggle = false + if (!data) $this.data('bs.collapse', (data = new Collapse(this, options))) + if (typeof option == 'string') data[option]() + }) + } -/** - * @const - * @type {Function} - */ -$.fn[Modal._NAME]['noConflict'] = function () { - $.fn[Modal._NAME] = Modal._JQUERY_NO_CONFLICT - return this -} + var old = $.fn.collapse + $.fn.collapse = Plugin + $.fn.collapse.Constructor = Collapse -/** - * ------------------------------------------------------------------------ - * Data Api implementation - * ------------------------------------------------------------------------ - */ -$(document).on('click.bs.modal.data-api', Modal._Selector.DATA_TOGGLE, function (event) { - var selector = Bootstrap.getSelectorFromElement(this) + // COLLAPSE NO CONFLICT + // ==================== - if (selector) { - var target = $(selector)[0] + $.fn.collapse.noConflict = function () { + $.fn.collapse = old + return this } - var config = $(target).data(Modal._DATA_KEY) ? 'toggle' : $.extend({}, $(target).data(), $(this).data()) - if (this.tagName == 'A') { - event.preventDefault() - } + // COLLAPSE DATA-API + // ================= - var $target = $(target).one(Modal._Event.SHOW, function (showEvent) { - if (showEvent.isDefaultPrevented()) { - return // only register focus restorer if modal will actually get shown - } + $(document).on('click.bs.collapse.data-api', '[data-toggle="collapse"]', function (e) { + var $this = $(this) - $target.one(Modal._Event.HIDDEN, function () { - if ($(this).is(':visible')) { - this.focus() - } - }.bind(this)) - }.bind(this)) + if (!$this.attr('data-target')) e.preventDefault() - Modal._jQueryInterface.call($(target), config, this) -}) + var $target = getTargetFromTrigger($this) + var data = $target.data('bs.collapse') + var option = data ? 'toggle' : $this.data() -/** ======================================================================= - * Bootstrap: scrollspy.js v4.0.0 - * http://getbootstrap.com/javascript/#scrollspy + Plugin.call($target, option) + }) + +}(jQuery); + +/* ======================================================================== + * Bootstrap: dropdown.js v3.3.4 + * http://getbootstrap.com/javascript/#dropdowns * ======================================================================== * Copyright 2011-2015 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - * ======================================================================== - * @fileoverview - Bootstrap's scrollspy plugin. - * - * Public Methods & Properties: - * - * + $.scrollspy - * + $.scrollspy.noConflict - * + $.scrollspy.Constructor - * + $.scrollspy.Constructor.VERSION - * + $.scrollspy.Constructor.Defaults - * + $.scrollspy.Constructor.Defaults.offset - * + $.scrollspy.Constructor.prototype.refresh - * - * ======================================================================== - */ + * ======================================================================== */ -'use strict'; ++function ($) { + 'use strict'; -/** - * Our scrollspy class. - * @param {Element!} element - * @param {Object=} opt_config - * @constructor - */ -function ScrollSpy(element, opt_config) { + // DROPDOWN CLASS DEFINITION + // ========================= - /** @private {Element|Window} */ - this._scrollElement = element.tagName == 'BODY' ? window : element + var backdrop = '.dropdown-backdrop' + var toggle = '[data-toggle="dropdown"]' + var Dropdown = function (element) { + $(element).on('click.bs.dropdown', this.toggle) + } - /** @private {Object} */ - this._config = $.extend({}, ScrollSpy['Defaults'], opt_config) + Dropdown.VERSION = '3.3.4' - /** @private {string} */ - this._selector = (this._config.target || '') + ' .nav li > a' + function getParent($this) { + var selector = $this.attr('data-target') - /** @private {Array} */ - this._offsets = [] + if (!selector) { + selector = $this.attr('href') + selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7 + } - /** @private {Array} */ - this._targets = [] + var $parent = selector && $(selector) - /** @private {Element} */ - this._activeTarget = null + return $parent && $parent.length ? $parent : $this.parent() + } - /** @private {number} */ - this._scrollHeight = 0 + function clearMenus(e) { + if (e && e.which === 3) return + $(backdrop).remove() + $(toggle).each(function () { + var $this = $(this) + var $parent = getParent($this) + var relatedTarget = { relatedTarget: this } - $(this._scrollElement).on('scroll.bs.scrollspy', this._process.bind(this)) + if (!$parent.hasClass('open')) return - this['refresh']() + if (e && e.type == 'click' && /input|textarea/i.test(e.target.tagName) && $.contains($parent[0], e.target)) return - this._process() -} + $parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget)) + if (e.isDefaultPrevented()) return -/** - * @const - * @type {string} - */ -ScrollSpy['VERSION'] = '4.0.0' + $this.attr('aria-expanded', 'false') + $parent.removeClass('open').trigger('hidden.bs.dropdown', relatedTarget) + }) + } + Dropdown.prototype.toggle = function (e) { + var $this = $(this) -/** - * @const - * @type {Object} - */ -ScrollSpy['Defaults'] = { - 'offset': 10 -} + if ($this.is('.disabled, :disabled')) return + var $parent = getParent($this) + var isActive = $parent.hasClass('open') -/** - * @const - * @type {string} - * @private - */ -ScrollSpy._NAME = 'scrollspy' + clearMenus() + if (!isActive) { + if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) { + // if mobile we use a backdrop because click events don't delegate + $(document.createElement('div')) + .addClass('dropdown-backdrop') + .insertAfter($(this)) + .on('click', clearMenus) + } -/** - * @const - * @type {string} - * @private - */ -ScrollSpy._DATA_KEY = 'bs.scrollspy' + var relatedTarget = { relatedTarget: this } + $parent.trigger(e = $.Event('show.bs.dropdown', relatedTarget)) + if (e.isDefaultPrevented()) return -/** - * @const - * @type {Function} - * @private - */ -ScrollSpy._JQUERY_NO_CONFLICT = $.fn[ScrollSpy._NAME] + $this + .trigger('focus') + .attr('aria-expanded', 'true') + $parent + .toggleClass('open') + .trigger('shown.bs.dropdown', relatedTarget) + } -/** - * @const - * @enum {string} - * @private - */ -ScrollSpy._Event = { - ACTIVATE: 'activate.bs.scrollspy' -} + return false + } + Dropdown.prototype.keydown = function (e) { + if (!/(38|40|27|32)/.test(e.which) || /input|textarea/i.test(e.target.tagName)) return -/** - * @const - * @enum {string} - * @private - */ -ScrollSpy._ClassName = { - DROPDOWN_MENU : 'dropdown-menu', - ACTIVE : 'active' -} + var $this = $(this) + e.preventDefault() + e.stopPropagation() -/** - * @const - * @enum {string} - * @private - */ -ScrollSpy._Selector = { - DATA_SPY : '[data-spy="scroll"]', - ACTIVE : '.active', - LI_DROPDOWN : 'li.dropdown', - LI : 'li' -} + if ($this.is('.disabled, :disabled')) return + var $parent = getParent($this) + var isActive = $parent.hasClass('open') -/** - * @param {Object=} opt_config - * @this {jQuery} - * @return {jQuery} - * @private - */ -ScrollSpy._jQueryInterface = function (opt_config) { - return this.each(function () { - var data = $(this).data(ScrollSpy._DATA_KEY) - var config = typeof opt_config === 'object' && opt_config || null - - if (!data) { - data = new ScrollSpy(this, config) - $(this).data(ScrollSpy._DATA_KEY, data) + if (!isActive && e.which != 27 || isActive && e.which == 27) { + if (e.which == 27) $parent.find(toggle).trigger('focus') + return $this.trigger('click') } - if (typeof opt_config === 'string') { - data[opt_config]() - } - }) -} + var desc = ' li:not(.disabled):visible a' + var $items = $parent.find('[role="menu"]' + desc + ', [role="listbox"]' + desc) + if (!$items.length) return -/** - * Refresh the scrollspy target cache - */ -ScrollSpy.prototype['refresh'] = function () { - var offsetMethod = 'offset' - var offsetBase = 0 + var index = $items.index(e.target) - if (this._scrollElement !== this._scrollElement.window) { - offsetMethod = 'position' - offsetBase = this._getScrollTop() + if (e.which == 38 && index > 0) index-- // up + if (e.which == 40 && index < $items.length - 1) index++ // down + if (!~index) index = 0 + + $items.eq(index).trigger('focus') } - this._offsets = [] - this._targets = [] - this._scrollHeight = this._getScrollHeight() + // DROPDOWN PLUGIN DEFINITION + // ========================== - var targets = /** @type {Array.} */ ($.makeArray($(this._selector))) + function Plugin(option) { + return this.each(function () { + var $this = $(this) + var data = $this.data('bs.dropdown') - targets - .map(function (element, index) { - var target - var targetSelector = Bootstrap.getSelectorFromElement(element) + if (!data) $this.data('bs.dropdown', (data = new Dropdown(this))) + if (typeof option == 'string') data[option].call($this) + }) + } - if (targetSelector) { - target = $(targetSelector)[0] - } + var old = $.fn.dropdown - if (target && (target.offsetWidth || target.offsetHeight)) { - // todo (fat): remove sketch reliance on jQuery position/offset - return [$(target)[offsetMethod]().top + offsetBase, targetSelector] - } - }) - .filter(function (item) { return item }) - .sort(function (a, b) { return a[0] - b[0] }) - .forEach(function (item, index) { - this._offsets.push(item[0]) - this._targets.push(item[1]) - }.bind(this)) -} + $.fn.dropdown = Plugin + $.fn.dropdown.Constructor = Dropdown -/** - * @private - */ -ScrollSpy.prototype._getScrollTop = function () { - return this._scrollElement === window ? - this._scrollElement.scrollY : this._scrollElement.scrollTop -} + // DROPDOWN NO CONFLICT + // ==================== + $.fn.dropdown.noConflict = function () { + $.fn.dropdown = old + return this + } -/** - * @private - */ -ScrollSpy.prototype._getScrollHeight = function () { - return this._scrollElement.scrollHeight - || Math.max(document.body.scrollHeight, document.documentElement.scrollHeight) -} + // APPLY TO STANDARD DROPDOWN ELEMENTS + // =================================== -/** - * @private - */ -ScrollSpy.prototype._process = function () { - var scrollTop = this._getScrollTop() + this._config.offset - var scrollHeight = this._getScrollHeight() - var maxScroll = this._config.offset + scrollHeight - this._scrollElement.offsetHeight + $(document) + .on('click.bs.dropdown.data-api', clearMenus) + .on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() }) + .on('click.bs.dropdown.data-api', toggle, Dropdown.prototype.toggle) + .on('keydown.bs.dropdown.data-api', toggle, Dropdown.prototype.keydown) + .on('keydown.bs.dropdown.data-api', '.dropdown-menu', Dropdown.prototype.keydown) - if (this._scrollHeight != scrollHeight) { - this['refresh']() - } +}(jQuery); - if (scrollTop >= maxScroll) { - var target = this._targets[this._targets.length - 1] +/* ======================================================================== + * Bootstrap: modal.js v3.3.4 + * http://getbootstrap.com/javascript/#modals + * ======================================================================== + * Copyright 2011-2015 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._activeTarget != target) { - this._activate(target) + if (this.options.remote) { + this.$element + .find('.modal-content') + .load(this.options.remote, $.proxy(function () { + this.$element.trigger('loaded.bs.modal') + }, this)) } } - if (this._activeTarget && scrollTop < this._offsets[0]) { - this._activeTarget = null - this._clear() - return - } + Modal.VERSION = '3.3.4' - for (var i = this._offsets.length; i--;) { - var isActiveTarget = this._activeTarget != this._targets[i] - && scrollTop >= this._offsets[i] - && (!this._offsets[i + 1] || scrollTop < this._offsets[i + 1]) + Modal.TRANSITION_DURATION = 300 + Modal.BACKDROP_TRANSITION_DURATION = 150 - if (isActiveTarget) { - this._activate(this._targets[i]) - } + Modal.DEFAULTS = { + backdrop: true, + keyboard: true, + show: true } -} + Modal.prototype.toggle = function (_relatedTarget) { + return this.isShown ? this.hide() : this.show(_relatedTarget) + } -/** - * @param {Element} target - * @private - */ -ScrollSpy.prototype._activate = function (target) { - this._activeTarget = target + Modal.prototype.show = function (_relatedTarget) { + var that = this + var e = $.Event('show.bs.modal', { relatedTarget: _relatedTarget }) - this._clear() + this.$element.trigger(e) - var selector = this._selector - + '[data-target="' + target + '"],' - + this._selector + '[href="' + target + '"]' + if (this.isShown || e.isDefaultPrevented()) return - // todo (fat): this seems horribly wrong… getting all raw li elements up the tree ,_, - var parentListItems = $(selector).parents(ScrollSpy._Selector.LI) + this.isShown = true - for (var i = parentListItems.length; i--;) { - $(parentListItems[i]).addClass(ScrollSpy._ClassName.ACTIVE) + this.checkScrollbar() + this.setScrollbar() + this.$body.addClass('modal-open') - var itemParent = parentListItems[i].parentNode + this.escape() + this.resize() - if (itemParent && $(itemParent).hasClass(ScrollSpy._ClassName.DROPDOWN_MENU)) { - var closestDropdown = $(itemParent).closest(ScrollSpy._Selector.LI_DROPDOWN)[0] - $(closestDropdown).addClass(ScrollSpy._ClassName.ACTIVE) - } - } + this.$element.on('click.dismiss.bs.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this)) - $(this._scrollElement).trigger(ScrollSpy._Event.ACTIVATE, { - relatedTarget: target - }) -} + 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') -/** - * @private - */ -ScrollSpy.prototype._clear = function () { - var activeParents = $(this._selector).parentsUntil(this._config.target, ScrollSpy._Selector.ACTIVE) + if (!that.$element.parent().length) { + that.$element.appendTo(that.$body) // don't move modals dom position + } - for (var i = activeParents.length; i--;) { - $(activeParents[i]).removeClass(ScrollSpy._ClassName.ACTIVE) - } -} + that.$element + .show() + .scrollTop(0) + that.adjustDialog() -/** - * ------------------------------------------------------------------------ - * jQuery Interface + noConflict implementaiton - * ------------------------------------------------------------------------ - */ + if (transition) { + that.$element[0].offsetWidth // force reflow + } -/** - * @const - * @type {Function} - */ -$.fn[ScrollSpy._NAME] = ScrollSpy._jQueryInterface + that.$element.addClass('in') + that.enforceFocus() -/** - * @const - * @type {Function} - */ -$.fn[ScrollSpy._NAME]['Constructor'] = ScrollSpy + 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) + }) + } -/** - * @const - * @type {Function} - */ -$.fn[ScrollSpy._NAME]['noConflict'] = function () { - $.fn[ScrollSpy._NAME] = ScrollSpy._JQUERY_NO_CONFLICT - return this -} + Modal.prototype.hide = function (e) { + if (e) e.preventDefault() + e = $.Event('hide.bs.modal') -/** - * ------------------------------------------------------------------------ - * Data Api implementation - * ------------------------------------------------------------------------ - */ + this.$element.trigger(e) -$(window).on('load.bs.scrollspy.data-api', function () { - var scrollSpys = /** @type {Array.} */ ($.makeArray($(ScrollSpy._Selector.DATA_SPY))) + if (!this.isShown || e.isDefaultPrevented()) return - for (var i = scrollSpys.length; i--;) { - var $spy = $(scrollSpys[i]) - ScrollSpy._jQueryInterface.call($spy, /** @type {Object|null} */ ($spy.data())) - } -}) + this.isShown = false -/** ======================================================================= - * Bootstrap: tooltip.js v4.0.0 - * http://getbootstrap.com/javascript/#tooltip - * ======================================================================== - * Copyright 2011-2015 Twitter, Inc. - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - * ======================================================================== - * @fileoverview - Bootstrap's tooltip plugin. - * (Inspired by jQuery.tipsy by Jason Frame) - * - * Public Methods & Properties: - * - * + $.tooltip - * + $.tooltip.noConflict - * + $.tooltip.Constructor - * + $.tooltip.Constructor.VERSION - * + $.tooltip.Constructor.Defaults - * + $.tooltip.Constructor.Defaults.container - * + $.tooltip.Constructor.Defaults.animation - * + $.tooltip.Constructor.Defaults.placement - * + $.tooltip.Constructor.Defaults.selector - * + $.tooltip.Constructor.Defaults.template - * + $.tooltip.Constructor.Defaults.trigger - * + $.tooltip.Constructor.Defaults.title - * + $.tooltip.Constructor.Defaults.delay - * + $.tooltip.Constructor.Defaults.html - * + $.tooltip.Constructor.Defaults.viewport - * + $.tooltip.Constructor.Defaults.viewport.selector - * + $.tooltip.Constructor.Defaults.viewport.padding - * + $.tooltip.Constructor.prototype.enable - * + $.tooltip.Constructor.prototype.disable - * + $.tooltip.Constructor.prototype.destroy - * + $.tooltip.Constructor.prototype.toggleEnabled - * + $.tooltip.Constructor.prototype.toggle - * + $.tooltip.Constructor.prototype.show - * + $.tooltip.Constructor.prototype.hide - * - * ======================================================================== - */ + this.escape() + this.resize() -'use strict'; + $(document).off('focusin.bs.modal') + this.$element + .removeClass('in') + .off('click.dismiss.bs.modal') + .off('mouseup.dismiss.bs.modal') -/** - * Our tooltip class. - * @param {Element!} element - * @param {Object=} opt_config - * @constructor - */ -var Tooltip = function (element, opt_config) { + this.$dialog.off('mousedown.dismiss.bs.modal') - /** @private {boolean} */ - this._isEnabled = true + $.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 (this.$element[0] !== e.target && !this.$element.has(e.target).length) { + this.$element.trigger('focus') + } + }, this)) + } - /** @private {number} */ - this._timeout = 0 + 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') + } + } - /** @private {string} */ - this._hoverState = '' + 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') + }) + } - /** @protected {Element} */ - this.element = element + Modal.prototype.removeBackdrop = function () { + this.$backdrop && this.$backdrop.remove() + this.$backdrop = null + } - /** @protected {Object} */ - this.config = this._getConfig(opt_config) + Modal.prototype.backdrop = function (callback) { + var that = this + var animate = this.$element.hasClass('fade') ? 'fade' : '' - /** @protected {Element} */ - this.tip = null + if (this.isShown && this.options.backdrop) { + var doAnimate = $.support.transition && animate - /** @protected {Element} */ - this.arrow = null + this.$backdrop = $(document.createElement('div')) + .addClass('modal-backdrop ' + animate) + .appendTo(this.$body) - if (this.config['viewport']) { + 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)) - /** @private {Element} */ - this._viewport = $(this.config['viewport']['selector'] || this.config['viewport'])[0] + if (doAnimate) this.$backdrop[0].offsetWidth // force reflow - } + this.$backdrop.addClass('in') - this._setListeners() -} + if (!callback) return + doAnimate ? + this.$backdrop + .one('bsTransitionEnd', callback) + .emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) : + callback() -/** - * @const - * @type {string} - */ -Tooltip['VERSION'] = '4.0.0' + } 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() -/** - * @const - * @type {Object} - */ -Tooltip['Defaults'] = { - 'container' : false, - 'animation' : true, - 'placement' : 'top', - 'selector' : false, - 'template' : '', - 'trigger' : 'hover focus', - 'title' : '', - 'delay' : 0, - 'html' : false, - 'viewport': { - 'selector': 'body', - 'padding' : 0 + } else if (callback) { + callback() + } } -} + // these following methods are used to handle overflowing modals -/** - * @const - * @enum {string} - * @protected - */ -Tooltip.Direction = { - TOP: 'top', - LEFT: 'left', - RIGHT: 'right', - BOTTOM: 'bottom' -} + Modal.prototype.handleUpdate = function () { + this.adjustDialog() + } + Modal.prototype.adjustDialog = function () { + var modalIsOverflowing = this.$element[0].scrollHeight > document.documentElement.clientHeight -/** - * @const - * @type {string} - * @private - */ -Tooltip._NAME = 'tooltip' + this.$element.css({ + paddingLeft: !this.bodyIsOverflowing && modalIsOverflowing ? this.scrollbarWidth : '', + paddingRight: this.bodyIsOverflowing && !modalIsOverflowing ? this.scrollbarWidth : '' + }) + } + Modal.prototype.resetAdjustments = function () { + this.$element.css({ + paddingLeft: '', + paddingRight: '' + }) + } -/** - * @const - * @type {string} - * @private - */ -Tooltip._DATA_KEY = 'bs.tooltip' + 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) + } -/** - * @const - * @type {number} - * @private - */ -Tooltip._TRANSITION_DURATION = 150 + 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 + } -/** - * @const - * @enum {string} - * @private - */ -Tooltip._HoverState = { - IN: 'in', - OUT: 'out' -} + // MODAL PLUGIN DEFINITION + // ======================= -/** - * @const - * @enum {string} - * @private - */ -Tooltip._Event = { - HIDE : 'hide.bs.tooltip', - HIDDEN : 'hidden.bs.tooltip', - SHOW : 'show.bs.tooltip', - SHOWN : 'shown.bs.tooltip' -} + 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) + }) + } -/** - * @const - * @enum {string} - * @private - */ -Tooltip._ClassName = { - FADE : 'fade', - IN : 'in' -} + var old = $.fn.modal + $.fn.modal = Plugin + $.fn.modal.Constructor = Modal -/** - * @const - * @enum {string} - * @private - */ -Tooltip._Selector = { - TOOLTIP : '.tooltip', - TOOLTIP_INNER : '.tooltip-inner', - TOOLTIP_ARROW : '.tooltip-arrow' -} + // MODAL NO CONFLICT + // ================= -/** - * @const - * @type {Function} - * @private - */ -Tooltip._JQUERY_NO_CONFLICT = $.fn[Tooltip._NAME] + $.fn.modal.noConflict = function () { + $.fn.modal = old + return this + } -/** - * @param {Object=} opt_config - * @this {jQuery} - * @return {jQuery} - * @private - */ -Tooltip._jQueryInterface = function (opt_config) { - return this.each(function () { - var data = $(this).data(Tooltip._DATA_KEY) - var config = typeof opt_config == 'object' ? opt_config : null + // MODAL DATA-API + // ============== - if (!data && opt_config == 'destroy') { - return - } + $(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 (!data) { - data = new Tooltip(this, config) - $(this).data(Tooltip._DATA_KEY, data) - } + if ($this.is('a')) e.preventDefault() - if (typeof opt_config === 'string') { - data[opt_config]() - } + $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); -/** - * Enable tooltip - */ -Tooltip.prototype['enable'] = function () { - this._isEnabled = true -} +/* ======================================================================== + * Bootstrap: tooltip.js v3.3.4 + * http://getbootstrap.com/javascript/#tooltip + * Inspired by the original jQuery.tipsy by Jason Frame + * ======================================================================== + * Copyright 2011-2015 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * ======================================================================== */ -/** - * Disable tooltip - */ -Tooltip.prototype['disable'] = function () { - this._isEnabled = false -} ++function ($) { + 'use strict'; + // TOOLTIP PUBLIC CLASS DEFINITION + // =============================== -/** - * Toggle the tooltip enable state - */ -Tooltip.prototype['toggleEnabled'] = function () { - this._isEnabled = !this._isEnabled -} + 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 -/** - * Toggle the tooltips display - * @param {Event} opt_event - */ -Tooltip.prototype['toggle'] = function (opt_event) { - var context = this - var dataKey = this.getDataKey() + this.init('tooltip', element, options) + } - if (opt_event) { - context = $(opt_event.currentTarget).data(dataKey) + Tooltip.VERSION = '3.3.4' - if (!context) { - context = new this.constructor(opt_event.currentTarget, this._getDelegateConfig()) - $(opt_event.currentTarget).data(dataKey, context) + 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 } } - $(context.getTipElement()).hasClass(Tooltip._ClassName.IN) ? - context._leave(null, context) : - context._enter(null, context) -} + 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!') + } -/** - * Remove tooltip functionality - */ -Tooltip.prototype['destroy'] = function () { - clearTimeout(this._timeout) - this['hide'](function () { - $(this.element) - .off(Tooltip._Selector.TOOLTIP) - .removeData(this.getDataKey()) - }.bind(this)) -} + var triggers = this.options.trigger.split(' ') + for (var i = triggers.length; i--;) { + var trigger = triggers[i] -/** - * Show the tooltip - * todo (fat): ~fuck~ this is a big function - refactor out all of positioning logic - * and replace with external lib - */ -Tooltip.prototype['show'] = function () { - var showEvent = $.Event(this.getEventObject().SHOW) + 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)) + } + } - if (this.isWithContent() && this._isEnabled) { - $(this.element).trigger(showEvent) + this.options.selector ? + (this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) : + this.fixTitle() + } - var isInTheDom = $.contains(this.element.ownerDocument.documentElement, this.element) + Tooltip.prototype.getDefaults = function () { + return Tooltip.DEFAULTS + } - if (showEvent.isDefaultPrevented() || !isInTheDom) { - return + 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 + } } - var tip = this.getTipElement() - var tipId = Bootstrap.getUID(this.getName()) + return options + } - tip.setAttribute('id', tipId) - this.element.setAttribute('aria-describedby', tipId) + Tooltip.prototype.getDelegateOptions = function () { + var options = {} + var defaults = this.getDefaults() - this.setContent() + this._options && $.each(this._options, function (key, value) { + if (defaults[key] != value) options[key] = value + }) - if (this.config['animation']) { - $(tip).addClass(Tooltip._ClassName.FADE) - } + return options + } - var placement = typeof this.config['placement'] == 'function' ? - this.config['placement'].call(this, tip, this.element) : - this.config['placement'] + Tooltip.prototype.enter = function (obj) { + var self = obj instanceof this.constructor ? + obj : $(obj.currentTarget).data('bs.' + this.type) - var autoToken = /\s?auto?\s?/i - var isWithAutoPlacement = autoToken.test(placement) + if (!self) { + self = new this.constructor(obj.currentTarget, this.getDelegateOptions()) + $(obj.currentTarget).data('bs.' + this.type, self) + } - if (isWithAutoPlacement) { - placement = placement.replace(autoToken, '') || Tooltip.Direction.TOP + if (obj instanceof $.Event) { + self.inState[obj.type == 'focusin' ? 'focus' : 'hover'] = true } - if (tip.parentNode && tip.parentNode.nodeType == Node.ELEMENT_NODE) { - tip.parentNode.removeChild(tip) + if (self.tip().hasClass('in') || self.hoverState == 'in') { + self.hoverState = 'in' + return } - tip.style.top = 0 - tip.style.left = 0 - tip.style.display = 'block' + clearTimeout(self.timeout) - $(tip).addClass(Tooltip._NAME + '-' + placement) + self.hoverState = 'in' - $(tip).data(this.getDataKey(), this) + if (!self.options.delay || !self.options.delay.show) return self.show() - if (this.config['container']) { - $(this.config['container'])[0].appendChild(tip) - } else { - this.element.parentNode.insertBefore(tip, this.element.nextSibling) + 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 } - var position = this._getPosition() - var actualWidth = tip.offsetWidth - var actualHeight = tip.offsetHeight + return false + } - var calculatedPlacement = this._getCalculatedAutoPlacement(isWithAutoPlacement, placement, position, actualWidth, actualHeight) - var calculatedOffset = this._getCalculatedOffset(calculatedPlacement, position, actualWidth, actualHeight) + Tooltip.prototype.leave = function (obj) { + var self = obj instanceof this.constructor ? + obj : $(obj.currentTarget).data('bs.' + this.type) - this._applyCalculatedPlacement(calculatedOffset, calculatedPlacement) + if (!self) { + self = new this.constructor(obj.currentTarget, this.getDelegateOptions()) + $(obj.currentTarget).data('bs.' + this.type, self) + } - var complete = function () { - var prevHoverState = this.hoverState - $(this.element).trigger(this.getEventObject().SHOWN) - this.hoverState = null + if (obj instanceof $.Event) { + self.inState[obj.type == 'focusout' ? 'focus' : 'hover'] = false + } - if (prevHoverState == 'out') this._leave(null, this) - }.bind(this) + if (self.isInStateTrue()) return - Bootstrap.transition && $(this._tip).hasClass(Tooltip._ClassName.FADE) ? - $(this._tip) - .one(Bootstrap.TRANSITION_END, complete) - .emulateTransitionEnd(Tooltip._TRANSITION_DURATION) : - complete() - } -} + clearTimeout(self.timeout) + self.hoverState = 'out' -/** - * Hide the tooltip breh - */ -Tooltip.prototype['hide'] = function (callback) { - var tip = this.getTipElement() - var hideEvent = $.Event(this.getEventObject().HIDE) + if (!self.options.delay || !self.options.delay.hide) return self.hide() - var complete = function () { - if (this._hoverState != Tooltip._HoverState.IN) { - tip.parentNode.removeChild(tip) - } + self.timeout = setTimeout(function () { + if (self.hoverState == 'out') self.hide() + }, self.options.delay.hide) + } - this.element.removeAttribute('aria-describedby') - $(this.element).trigger(this.getEventObject().HIDDEN) + Tooltip.prototype.show = function () { + var e = $.Event('show.bs.' + this.type) - if (callback) { - callback() - } - }.bind(this) + if (this.hasContent() && this.enabled) { + this.$element.trigger(e) - $(this.element).trigger(hideEvent) + var inDom = $.contains(this.$element[0].ownerDocument.documentElement, this.$element[0]) + if (e.isDefaultPrevented() || !inDom) return + var that = this - if (hideEvent.isDefaultPrevented()) return + var $tip = this.tip() - $(tip).removeClass(Tooltip._ClassName.IN) + var tipId = this.getUID(this.type) - if (Bootstrap.transition && $(this._tip).hasClass(Tooltip._ClassName.FADE)) { - $(tip) - .one(Bootstrap.TRANSITION_END, complete) - .emulateTransitionEnd(Tooltip._TRANSITION_DURATION) - } else { - complete() - } + this.setContent() + $tip.attr('id', tipId) + this.$element.attr('aria-describedby', tipId) - this._hoverState = '' -} + 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 -/** - * @return {string} - */ -Tooltip.prototype['getHoverState'] = function (callback) { - return this._hoverState -} + 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) -/** - * @return {string} - * @protected - */ -Tooltip.prototype.getName = function () { - return Tooltip._NAME -} + 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 -/** - * @return {string} - * @protected - */ -Tooltip.prototype.getDataKey = function () { - return Tooltip._DATA_KEY -} + 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 -/** - * @return {Object} - * @protected - */ -Tooltip.prototype.getEventObject = function () { - return Tooltip._Event -} + $tip + .removeClass(orgPlacement) + .addClass(placement) + } + + var calculatedOffset = this.getCalculatedOffset(placement, pos, actualWidth, actualHeight) + this.applyPlacement(calculatedOffset, placement) -/** - * @return {string} - * @protected - */ -Tooltip.prototype.getTitle = function () { - var title = this.element.getAttribute('data-original-title') + var complete = function () { + var prevHoverState = that.hoverState + that.$element.trigger('shown.bs.' + that.type) + that.hoverState = null + + if (prevHoverState == 'out') that.leave(that) + } - if (!title) { - title = typeof this.config['title'] === 'function' ? - this.config['title'].call(this.element) : - this.config['title'] + $.support.transition && this.$tip.hasClass('fade') ? + $tip + .one('bsTransitionEnd', complete) + .emulateTransitionEnd(Tooltip.TRANSITION_DURATION) : + complete() + } } - return /** @type {string} */ (title) -} + 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) -/** - * @return {Element} - * @protected - */ -Tooltip.prototype.getTipElement = function () { - return (this._tip = this._tip || $(this.config['template'])[0]) -} + // 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 -/** - * @return {Element} - * @protected - */ -Tooltip.prototype.getArrowElement = function () { - return (this.arrow = this.arrow || $(this.getTipElement()).find(Tooltip._Selector.TOOLTIP_ARROW)[0]) -} + // $.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') -/** - * @return {boolean} - * @protected - */ -Tooltip.prototype.isWithContent = function () { - return !!this.getTitle() -} + // 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 + } -/** - * @protected - */ -Tooltip.prototype.setContent = function () { - var tip = this.getTipElement() - var title = this.getTitle() + var delta = this.getViewportAdjustedDelta(placement, offset, actualWidth, actualHeight) - $(tip).find(Tooltip._Selector.TOOLTIP_INNER)[0][this.config['html'] ? 'innerHTML' : 'innerText'] = title + if (delta.left) offset.left += delta.left + else offset.top += delta.top - $(tip) - .removeClass(Tooltip._ClassName.FADE) - .removeClass(Tooltip._ClassName.IN) + var isVertical = /top|bottom/.test(placement) + var arrowDelta = isVertical ? delta.left * 2 - width + actualWidth : delta.top * 2 - height + actualHeight + var arrowOffsetPosition = isVertical ? 'offsetWidth' : 'offsetHeight' - for (var direction in Tooltip.Direction) { - $(tip).removeClass(Tooltip._NAME + '-' + direction) + $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', '') + } -/** - * @private - */ -Tooltip.prototype._setListeners = function () { - var triggers = this.config['trigger'].split(' ') + Tooltip.prototype.setContent = function () { + var $tip = this.tip() + var title = this.getTitle() - triggers.forEach(function (trigger) { - if (trigger == 'click') { - $(this.element).on('click.bs.tooltip', this.config['selector'], this['toggle'].bind(this)) + $tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title) + $tip.removeClass('fade in top bottom left right') + } - } else if (trigger != 'manual') { - var eventIn = trigger == 'hover' ? 'mouseenter' : 'focusin' - var eventOut = trigger == 'hover' ? 'mouseleave' : 'focusout' + Tooltip.prototype.hide = function (callback) { + var that = this + var $tip = $(this.$tip) + var e = $.Event('hide.bs.' + this.type) - $(this.element) - .on(eventIn + '.bs.tooltip', this.config['selector'], this._enter.bind(this)) - .on(eventOut + '.bs.tooltip', this.config['selector'], this._leave.bind(this)) + function complete() { + if (that.hoverState != 'in') $tip.detach() + that.$element + .removeAttr('aria-describedby') + .trigger('hidden.bs.' + that.type) + callback && callback() } - }.bind(this)) - if (this.config['selector']) { - this.config = $.extend({}, this.config, { 'trigger': 'manual', 'selector': '' }) - } else { - this._fixTitle() - } -} + this.$element.trigger(e) + if (e.isDefaultPrevented()) return -/** - * @param {Object=} opt_config - * @return {Object} - * @private - */ -Tooltip.prototype._getConfig = function (opt_config) { - var config = $.extend({}, this.constructor['Defaults'], $(this.element).data(), opt_config) + $tip.removeClass('in') - if (config['delay'] && typeof config['delay'] == 'number') { - config['delay'] = { - 'show': config['delay'], - 'hide': config['delay'] - } - } + $.support.transition && $tip.hasClass('fade') ? + $tip + .one('bsTransitionEnd', complete) + .emulateTransitionEnd(Tooltip.TRANSITION_DURATION) : + complete() - return config -} + this.hoverState = null + return this + } -/** - * @return {Object} - * @private - */ -Tooltip.prototype._getDelegateConfig = function () { - var config = {} - var defaults = this.constructor['Defaults'] - - if (this.config) { - for (var key in this.config) { - var value = this.config[key] - if (defaults[key] != value) config[key] = value + 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', '') } } - return config -} + 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' -/** - * @param {boolean} isWithAutoPlacement - * @param {string} placement - * @param {Object} position - * @param {number} actualWidth - * @param {number} actualHeight - * @return {string} - * @private - */ -Tooltip.prototype._getCalculatedAutoPlacement = function (isWithAutoPlacement, placement, position, actualWidth, actualHeight) { - if (isWithAutoPlacement) { - var originalPlacement = placement - var container = this.config['container'] ? $(this.config['container'])[0] : this.element.parentNode - var containerDim = this._getPosition(/** @type {Element} */ (container)) - - placement = placement == Tooltip.Direction.BOTTOM && position.bottom + actualHeight > containerDim.bottom ? Tooltip.Direction.TOP : - placement == Tooltip.Direction.TOP && position.top - actualHeight < containerDim.top ? Tooltip.Direction.BOTTOM : - placement == Tooltip.Direction.RIGHT && position.right + actualWidth > containerDim.width ? Tooltip.Direction.LEFT : - placement == Tooltip.Direction.LEFT && position.left - actualWidth < containerDim.left ? Tooltip.Direction.RIGHT : - placement - - $(this._tip) - .removeClass(Tooltip._NAME + '-' + originalPlacement) - .addClass(Tooltip._NAME + '-' + placement) + 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 elOffset = isBody ? { top: 0, left: 0 } : $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) } - return placement -} + 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 } + } -/** - * @param {string} placement - * @param {Object} position - * @param {number} actualWidth - * @param {number} actualHeight - * @return {{left: number, top: number}} - * @private - */ -Tooltip.prototype._getCalculatedOffset = function (placement, position, actualWidth, actualHeight) { - return placement == Tooltip.Direction.BOTTOM ? { top: position.top + position.height, left: position.left + position.width / 2 - actualWidth / 2 } : - placement == Tooltip.Direction.TOP ? { top: position.top - actualHeight, left: position.left + position.width / 2 - actualWidth / 2 } : - placement == Tooltip.Direction.LEFT ? { top: position.top + position.height / 2 - actualHeight / 2, left: position.left - actualWidth } : - /* placement == Tooltip.Direction.RIGHT */ { top: position.top + position.height / 2 - actualHeight / 2, left: position.left + position.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) -/** - * @param {string} placement - * @param {Object} position - * @param {number} actualWidth - * @param {number} actualHeight - * @return {Object} - * @private - */ -Tooltip.prototype._getViewportAdjustedDelta = function (placement, position, actualWidth, actualHeight) { - var delta = { top: 0, left: 0 } + 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 + } + } - if (!this._viewport) { return delta } - var viewportPadding = this.config['viewport'] && this.config['viewport']['padding'] || 0 - var viewportDimensions = this._getPosition(this._viewport) - - if (placement === Tooltip.Direction.RIGHT || placement === Tooltip.Direction.LEFT) { - var topEdgeOffset = position.top - viewportPadding - viewportDimensions.scroll - var bottomEdgeOffset = position.top + viewportPadding - viewportDimensions.scroll + actualHeight + Tooltip.prototype.getTitle = function () { + var title + var $e = this.$element + var o = this.options - 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 - } + title = $e.attr('data-original-title') + || (typeof o.title == 'function' ? o.title.call($e[0]) : o.title) - } else { - var leftEdgeOffset = position.left - viewportPadding - var rightEdgeOffset = position.left + viewportPadding + actualWidth + return title + } - if (leftEdgeOffset < viewportDimensions.left) { // left overflow - delta.left = viewportDimensions.left - leftEdgeOffset + Tooltip.prototype.getUID = function (prefix) { + do prefix += ~~(Math.random() * 1000000) + while (document.getElementById(prefix)) + return prefix + } - } else if (rightEdgeOffset > viewportDimensions.width) { // right overflow - delta.left = viewportDimensions.left + viewportDimensions.width - rightEdgeOffset + 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 } - return delta -} - - -/** - * @param {Element=} opt_element - * @return {Object} - * @private - */ -Tooltip.prototype._getPosition = function (opt_element) { - var element = opt_element || this.element - var isBody = element.tagName == 'BODY' - var rect = element.getBoundingClientRect() - var offset = isBody ? { top: 0, left: 0 } : $(element).offset() - var scroll = { scroll: isBody ? document.documentElement.scrollTop || document.body.scrollTop : this.element.scrollTop } - var outerDims = isBody ? { width: window.innerWidth, height: window.innerHeight } : null - - return $.extend({}, rect, scroll, outerDims, offset) -} + Tooltip.prototype.arrow = function () { + return (this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow')) + } + Tooltip.prototype.enable = function () { + this.enabled = true + } -/** - * @param {{left: number, top: number}} offset - * @param {string} placement - * @private - */ -Tooltip.prototype._applyCalculatedPlacement = function (offset, placement) { - var tip = this.getTipElement() - var width = tip.offsetWidth - var height = tip.offsetHeight - - // manually read margins because getBoundingClientRect includes difference - var marginTop = parseInt(tip.style.marginTop, 10) - var marginLeft = parseInt(tip.style.marginLeft, 10) - - // we must check for NaN for ie 8/9 - if (isNaN(marginTop)) { - marginTop = 0 + Tooltip.prototype.disable = function () { + this.enabled = false } - if (isNaN(marginLeft)) { - marginLeft = 0 + + Tooltip.prototype.toggleEnabled = function () { + this.enabled = !this.enabled } - offset.top = offset.top + marginTop - offset.left = offset.left + marginLeft + 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) + } + } - // $.fn.offset doesn't round pixel values - // so we use setOffset directly with our own function B-0 - $.offset.setOffset(tip, $.extend({ - using: function (props) { - tip.style.top = Math.round(props.top) + 'px' - tip.style.left = Math.round(props.left) + 'px' + 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) } - }, offset), 0) + } - $(tip).addClass(Tooltip._ClassName.IN) + 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 + }) + } - // check to see if placing tip in new offset caused the tip to resize itself - var actualWidth = tip.offsetWidth - var actualHeight = tip.offsetHeight - if (placement == Tooltip.Direction.TOP && actualHeight != height) { - offset.top = offset.top + height - actualHeight - } + // TOOLTIP PLUGIN DEFINITION + // ========================= - var delta = this._getViewportAdjustedDelta(placement, offset, actualWidth, actualHeight) + function Plugin(option) { + return this.each(function () { + var $this = $(this) + var data = $this.data('bs.tooltip') + var options = typeof option == 'object' && option - if (delta.left) { - offset.left += delta.left - } else { - offset.top += delta.top + 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 isVertical = placement === Tooltip.Direction.TOP || placement === Tooltip.Direction.BOTTOM - var arrowDelta = isVertical ? delta.left * 2 - width + actualWidth : delta.top * 2 - height + actualHeight - var arrowOffsetPosition = isVertical ? 'offsetWidth' : 'offsetHeight' + var old = $.fn.tooltip - $(tip).offset(offset) + $.fn.tooltip = Plugin + $.fn.tooltip.Constructor = Tooltip - this._replaceArrow(arrowDelta, tip[arrowOffsetPosition], isVertical) -} + // TOOLTIP NO CONFLICT + // =================== -/** - * @param {number} delta - * @param {number} dimension - * @param {boolean} isHorizontal - * @private - */ -Tooltip.prototype._replaceArrow = function (delta, dimension, isHorizontal) { - var arrow = this.getArrowElement() + $.fn.tooltip.noConflict = function () { + $.fn.tooltip = old + return this + } + +}(jQuery); + +/* ======================================================================== + * Bootstrap: popover.js v3.3.4 + * http://getbootstrap.com/javascript/#popovers + * ======================================================================== + * Copyright 2011-2015 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * ======================================================================== */ - arrow.style[isHorizontal ? 'left' : 'top'] = 50 * (1 - delta / dimension) + '%' - arrow.style[isHorizontal ? 'top' : 'left'] = '' -} ++function ($) { + 'use strict'; + // POPOVER PUBLIC CLASS DEFINITION + // =============================== -/** - * @private - */ -Tooltip.prototype._fixTitle = function () { - if (this.element.getAttribute('title') || typeof this.element.getAttribute('data-original-title') != 'string') { - this.element.setAttribute('data-original-title', this.element.getAttribute('title') || '') - this.element.setAttribute('title', '') + var Popover = function (element, options) { + this.init('popover', element, options) } -} + if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js') -/** - * @param {Event=} opt_event - * @param {Object=} opt_context - * @private - */ -Tooltip.prototype._enter = function (opt_event, opt_context) { - var dataKey = this.getDataKey() - var context = opt_context || $(opt_event.currentTarget).data(dataKey) + Popover.VERSION = '3.3.4' - if (context && context._tip && context._tip.offsetWidth) { - context._hoverState = Tooltip._HoverState.IN - return - } + Popover.DEFAULTS = $.extend({}, $.fn.tooltip.Constructor.DEFAULTS, { + placement: 'right', + trigger: 'click', + content: '', + template: '' + }) - if (!context) { - context = new this.constructor(opt_event.currentTarget, this._getDelegateConfig()) - $(opt_event.currentTarget).data(dataKey, context) - } - clearTimeout(context._timeout) + // NOTE: POPOVER EXTENDS tooltip.js + // ================================ + + Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype) - context._hoverState = Tooltip._HoverState.IN + Popover.prototype.constructor = Popover - if (!context.config['delay'] || !context.config['delay']['show']) { - context['show']() - return + Popover.prototype.getDefaults = function () { + return Popover.DEFAULTS } - context._timeout = setTimeout(function () { - if (context._hoverState == Tooltip._HoverState.IN) { - context['show']() - } - }, context.config['delay']['show']) -} + Popover.prototype.setContent = function () { + var $tip = this.tip() + var title = this.getTitle() + var content = this.getContent() + $tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title) + $tip.find('.popover-content').children().detach().end()[ // we use append for html objects to maintain js events + this.options.html ? (typeof content == 'string' ? 'html' : 'append') : 'text' + ](content) -/** - * @param {Event=} opt_event - * @param {Object=} opt_context - * @private - */ -Tooltip.prototype._leave = function (opt_event, opt_context) { - var dataKey = this.getDataKey() - var context = opt_context || $(opt_event.currentTarget).data(dataKey) + $tip.removeClass('fade top bottom left right in') - if (!context) { - context = new this.constructor(opt_event.currentTarget, this._getDelegateConfig()) - $(opt_event.currentTarget).data(dataKey, context) + // IE8 doesn't accept hiding via the `:empty` pseudo selector, we have to do + // this manually by checking the contents. + if (!$tip.find('.popover-title').html()) $tip.find('.popover-title').hide() } - clearTimeout(context._timeout) + Popover.prototype.hasContent = function () { + return this.getTitle() || this.getContent() + } - context._hoverState = Tooltip._HoverState.OUT + Popover.prototype.getContent = function () { + var $e = this.$element + var o = this.options - if (!context.config['delay'] || !context.config['delay']['hide']) { - context['hide']() - return + return $e.attr('data-content') + || (typeof o.content == 'function' ? + o.content.call($e[0]) : + o.content) } - context._timeout = setTimeout(function () { - if (context._hoverState == Tooltip._HoverState.OUT) { - context['hide']() - } - }, context.config['delay']['hide']) -} + Popover.prototype.arrow = function () { + return (this.$arrow = this.$arrow || this.tip().find('.arrow')) + } + // POPOVER PLUGIN DEFINITION + // ========================= -/** - * ------------------------------------------------------------------------ - * jQuery Interface + noConflict implementaiton - * ------------------------------------------------------------------------ - */ + function Plugin(option) { + return this.each(function () { + var $this = $(this) + var data = $this.data('bs.popover') + var options = typeof option == 'object' && option -/** - * @const - * @type {Function} - */ -$.fn[Tooltip._NAME] = Tooltip._jQueryInterface + if (!data && /destroy|hide/.test(option)) return + if (!data) $this.data('bs.popover', (data = new Popover(this, options))) + if (typeof option == 'string') data[option]() + }) + } + var old = $.fn.popover -/** - * @const - * @type {Function} - */ -$.fn[Tooltip._NAME]['Constructor'] = Tooltip + $.fn.popover = Plugin + $.fn.popover.Constructor = Popover -/** - * @const - * @type {Function} - */ -$.fn[Tooltip._NAME]['noConflict'] = function () { - $.fn[Tooltip._NAME] = Tooltip._JQUERY_NO_CONFLICT - return this -} + // POPOVER NO CONFLICT + // =================== -/** ======================================================================= - * Bootstrap: popover.js v4.0.0 - * http://getbootstrap.com/javascript/#popovers + $.fn.popover.noConflict = function () { + $.fn.popover = old + return this + } + +}(jQuery); + +/* ======================================================================== + * Bootstrap: scrollspy.js v3.3.4 + * http://getbootstrap.com/javascript/#scrollspy * ======================================================================== * Copyright 2011-2015 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - * ======================================================================== - * @fileoverview - Bootstrap's popover plugin - extends tooltip. - * - * Public Methods & Properties: - * - * + $.popover - * + $.popover.noConflict - * + $.popover.Constructor - * + $.popover.Constructor.VERSION - * + $.popover.Constructor.Defaults - * + $.popover.Constructor.Defaults.container - * + $.popover.Constructor.Defaults.animation - * + $.popover.Constructor.Defaults.placement - * + $.popover.Constructor.Defaults.selector - * + $.popover.Constructor.Defaults.template - * + $.popover.Constructor.Defaults.trigger - * + $.popover.Constructor.Defaults.title - * + $.popover.Constructor.Defaults.content - * + $.popover.Constructor.Defaults.delay - * + $.popover.Constructor.Defaults.html - * + $.popover.Constructor.Defaults.viewport - * + $.popover.Constructor.Defaults.viewport.selector - * + $.popover.Constructor.Defaults.viewport.padding - * + $.popover.Constructor.prototype.enable - * + $.popover.Constructor.prototype.disable - * + $.popover.Constructor.prototype.destroy - * + $.popover.Constructor.prototype.toggleEnabled - * + $.popover.Constructor.prototype.toggle - * + $.popover.Constructor.prototype.show - * + $.popover.Constructor.prototype.hide - * - * ======================================================================== - */ - + * ======================================================================== */ -'use strict'; ++function ($) { + 'use strict'; -if (!Tooltip) throw new Error('Popover requires tooltip.js') + // SCROLLSPY CLASS DEFINITION + // ========================== + function ScrollSpy(element, options) { + this.$body = $(document.body) + this.$scrollElement = $(element).is(document.body) ? $(window) : $(element) + this.options = $.extend({}, ScrollSpy.DEFAULTS, options) + this.selector = (this.options.target || '') + ' .nav li > a' + this.offsets = [] + this.targets = [] + this.activeTarget = null + this.scrollHeight = 0 -/** - * Our tooltip class. - * @param {Element!} element - * @param {Object=} opt_config - * @constructor - * @extends {Tooltip} - */ -var Popover = function (element, opt_config) { - Tooltip.apply(this, arguments) -} -Bootstrap.inherits(Popover, Tooltip) + this.$scrollElement.on('scroll.bs.scrollspy', $.proxy(this.process, this)) + this.refresh() + this.process() + } + ScrollSpy.VERSION = '3.3.4' -/** - * @const - * @type {string} - */ -Popover['VERSION'] = '4.0.0' + ScrollSpy.DEFAULTS = { + offset: 10 + } + ScrollSpy.prototype.getScrollHeight = function () { + return this.$scrollElement[0].scrollHeight || Math.max(this.$body[0].scrollHeight, document.documentElement.scrollHeight) + } -/** - * @const - * @type {Object} - */ -Popover['Defaults'] = $.extend({}, $.fn['tooltip']['Constructor']['Defaults'], { - 'placement': 'right', - 'trigger': 'click', - 'content': '', - 'template': '' -}) - - -/** - * @const - * @type {string} - * @private - */ -Popover._NAME = 'popover' + ScrollSpy.prototype.refresh = function () { + var that = this + var offsetMethod = 'offset' + var offsetBase = 0 + this.offsets = [] + this.targets = [] + this.scrollHeight = this.getScrollHeight() -/** - * @const - * @type {string} - * @private - */ -Popover._DATA_KEY = 'bs.popover' + if (!$.isWindow(this.$scrollElement[0])) { + offsetMethod = 'position' + offsetBase = this.$scrollElement.scrollTop() + } + this.$body + .find(this.selector) + .map(function () { + var $el = $(this) + var href = $el.data('target') || $el.attr('href') + var $href = /^#./.test(href) && $(href) -/** - * @const - * @enum {string} - * @private - */ -Popover._Event = { - HIDE : 'hide.bs.popover', - HIDDEN : 'hidden.bs.popover', - SHOW : 'show.bs.popover', - SHOWN : 'shown.bs.popover' -} + return ($href + && $href.length + && $href.is(':visible') + && [[$href[offsetMethod]().top + offsetBase, href]]) || null + }) + .sort(function (a, b) { return a[0] - b[0] }) + .each(function () { + that.offsets.push(this[0]) + that.targets.push(this[1]) + }) + } + ScrollSpy.prototype.process = function () { + var scrollTop = this.$scrollElement.scrollTop() + this.options.offset + var scrollHeight = this.getScrollHeight() + var maxScroll = this.options.offset + scrollHeight - this.$scrollElement.height() + var offsets = this.offsets + var targets = this.targets + var activeTarget = this.activeTarget + var i -/** - * @const - * @enum {string} - * @private - */ -Popover._ClassName = { - FADE : 'fade', - IN : 'in' -} + if (this.scrollHeight != scrollHeight) { + this.refresh() + } + if (scrollTop >= maxScroll) { + return activeTarget != (i = targets[targets.length - 1]) && this.activate(i) + } -/** - * @const - * @enum {string} - * @private - */ -Popover._Selector = { - TITLE : '.popover-title', - CONTENT : '.popover-content', - ARROW : '.popover-arrow' -} + if (activeTarget && scrollTop < offsets[0]) { + this.activeTarget = null + return this.clear() + } + for (i = offsets.length; i--;) { + activeTarget != targets[i] + && scrollTop >= offsets[i] + && (offsets[i + 1] === undefined || scrollTop < offsets[i + 1]) + && this.activate(targets[i]) + } + } -/** - * @const - * @type {Function} - * @private - */ -Popover._JQUERY_NO_CONFLICT = $.fn[Popover._NAME] + ScrollSpy.prototype.activate = function (target) { + this.activeTarget = target + this.clear() -/** - * @param {Object|string=} opt_config - * @this {jQuery} - * @return {jQuery} - * @private - */ -Popover._jQueryInterface = function (opt_config) { - return this.each(function () { - var data = $(this).data(Popover._DATA_KEY) - var config = typeof opt_config === 'object' ? opt_config : null + var selector = this.selector + + '[data-target="' + target + '"],' + + this.selector + '[href="' + target + '"]' - if (!data && opt_config === 'destroy') { - return - } + var active = $(selector) + .parents('li') + .addClass('active') - if (!data) { - data = new Popover(this, config) - $(this).data(Popover._DATA_KEY, data) + if (active.parent('.dropdown-menu').length) { + active = active + .closest('li.dropdown') + .addClass('active') } - if (typeof opt_config === 'string') { - data[opt_config]() - } - }) -} + active.trigger('activate.bs.scrollspy') + } + ScrollSpy.prototype.clear = function () { + $(this.selector) + .parentsUntil(this.options.target, '.active') + .removeClass('active') + } -/** - * @return {string} - * @protected - */ -Popover.prototype.getName = function () { - return Popover._NAME -} + // SCROLLSPY PLUGIN DEFINITION + // =========================== -/** - * @override - */ -Popover.prototype.getDataKey = function () { - return Popover._DATA_KEY -} + function Plugin(option) { + return this.each(function () { + var $this = $(this) + var data = $this.data('bs.scrollspy') + var options = typeof option == 'object' && option + if (!data) $this.data('bs.scrollspy', (data = new ScrollSpy(this, options))) + if (typeof option == 'string') data[option]() + }) + } -/** - * @override - */ -Popover.prototype.getEventObject = function () { - return Popover._Event -} + var old = $.fn.scrollspy + $.fn.scrollspy = Plugin + $.fn.scrollspy.Constructor = ScrollSpy -/** - * @override - */ -Popover.prototype.getArrowElement = function () { - return (this.arrow = this.arrow || $(this.getTipElement()).find(Popover._Selector.ARROW)[0]) -} + // SCROLLSPY NO CONFLICT + // ===================== -/** - * @override - */ -Popover.prototype.setContent = function () { - var tip = this.getTipElement() - var title = this.getTitle() - var content = this._getContent() - var titleElement = $(tip).find(Popover._Selector.TITLE)[0] - - if (titleElement) { - titleElement[this.config['html'] ? 'innerHTML' : 'innerText'] = title + $.fn.scrollspy.noConflict = function () { + $.fn.scrollspy = old + return this } - // we use append for html objects to maintain js events - $(tip).find(Popover._Selector.CONTENT).children().detach().end()[ - this.config['html'] ? (typeof content == 'string' ? 'html' : 'append') : 'text' - ](content) - $(tip) - .removeClass(Popover._ClassName.FADE) - .removeClass(Popover._ClassName.IN) + // SCROLLSPY DATA-API + // ================== - for (var direction in Tooltip.Direction) { - $(tip).removeClass(Popover._NAME + '-' + Tooltip.Direction[direction]) - } -} + $(window).on('load.bs.scrollspy.data-api', function () { + $('[data-spy="scroll"]').each(function () { + var $spy = $(this) + Plugin.call($spy, $spy.data()) + }) + }) +}(jQuery); -/** - * @override - */ -Popover.prototype.isWithContent = function () { - return this.getTitle() || this._getContent() -} +/* ======================================================================== + * Bootstrap: tab.js v3.3.4 + * http://getbootstrap.com/javascript/#tabs + * ======================================================================== + * Copyright 2011-2015 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * ======================================================================== */ -/** - * @override - */ -Popover.prototype.getTipElement = function () { - return (this.tip = this.tip || $(this.config['template'])[0]) -} ++function ($) { + 'use strict'; + // TAB CLASS DEFINITION + // ==================== -/** - * @private - */ -Popover.prototype._getContent = function () { - return this.element.getAttribute('data-content') - || (typeof this.config['content'] == 'function' ? - this.config['content'].call(this.element) : - this.config['content']) -} + var Tab = function (element) { + // jscs:disable requireDollarBeforejQueryAssignment + this.element = $(element) + // jscs:enable requireDollarBeforejQueryAssignment + } + Tab.VERSION = '3.3.4' + Tab.TRANSITION_DURATION = 150 -/** - * ------------------------------------------------------------------------ - * jQuery Interface + noConflict implementaiton - * ------------------------------------------------------------------------ - */ + Tab.prototype.show = function () { + var $this = this.element + var $ul = $this.closest('ul:not(.dropdown-menu)') + var selector = $this.data('target') -/** - * @const - * @type {Function} - */ -$.fn[Popover._NAME] = Popover._jQueryInterface + if (!selector) { + selector = $this.attr('href') + selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7 + } + if ($this.parent('li').hasClass('active')) return -/** - * @const - * @type {Function} - */ -$.fn[Popover._NAME]['Constructor'] = Popover + var $previous = $ul.find('.active:last a') + var hideEvent = $.Event('hide.bs.tab', { + relatedTarget: $this[0] + }) + var showEvent = $.Event('show.bs.tab', { + relatedTarget: $previous[0] + }) + $previous.trigger(hideEvent) + $this.trigger(showEvent) -/** - * @const - * @type {Function} - */ -$.fn[Popover._NAME]['noConflict'] = function () { - $.fn[Popover._NAME] = Popover._JQUERY_NO_CONFLICT - return this -} + if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) return -/** ======================================================================= - * Bootstrap: tab.js v4.0.0 - * http://getbootstrap.com/javascript/#tabs - * ======================================================================== - * Copyright 2011-2015 Twitter, Inc. - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - * ======================================================================== - * @fileoverview - Bootstrap's tab plugin. Tab O_O - * - * Public Methods & Properties: - * - * + $.tab - * + $.tab.noConflict - * + $.tab.Constructor - * + $.tab.Constructor.VERSION - * + $.tab.Constructor.prototype.show - * - * ======================================================================== - */ + var $target = $(selector) + this.activate($this.closest('li'), $ul) + this.activate($target, $target.parent(), function () { + $previous.trigger({ + type: 'hidden.bs.tab', + relatedTarget: $this[0] + }) + $this.trigger({ + type: 'shown.bs.tab', + relatedTarget: $previous[0] + }) + }) + } -'use strict'; + Tab.prototype.activate = function (element, container, callback) { + var $active = container.find('> .active') + var transition = callback + && $.support.transition + && ($active.length && $active.hasClass('fade') || !!container.find('> .fade').length) + + function next() { + $active + .removeClass('active') + .find('> .dropdown-menu > .active') + .removeClass('active') + .end() + .find('[data-toggle="tab"]') + .attr('aria-expanded', false) + + element + .addClass('active') + .find('[data-toggle="tab"]') + .attr('aria-expanded', true) + + if (transition) { + element[0].offsetWidth // reflow for transition + element.addClass('in') + } else { + element.removeClass('fade') + } -/** - * Our Tab class. - * @param {Element!} element - * @constructor - */ -var Tab = function (element) { + if (element.parent('.dropdown-menu').length) { + element + .closest('li.dropdown') + .addClass('active') + .end() + .find('[data-toggle="tab"]') + .attr('aria-expanded', true) + } - /** @type {Element} */ - this._element = element + callback && callback() + } -} + $active.length && transition ? + $active + .one('bsTransitionEnd', next) + .emulateTransitionEnd(Tab.TRANSITION_DURATION) : + next() + $active.removeClass('in') + } -/** - * @const - * @type {string} - */ -Tab['VERSION'] = '4.0.0' + // TAB PLUGIN DEFINITION + // ===================== -/** - * @const - * @type {string} - * @private - */ -Tab._NAME = 'tab' + function Plugin(option) { + return this.each(function () { + var $this = $(this) + var data = $this.data('bs.tab') + if (!data) $this.data('bs.tab', (data = new Tab(this))) + if (typeof option == 'string') data[option]() + }) + } -/** - * @const - * @type {string} - * @private - */ -Tab._DATA_KEY = 'bs.tab' + var old = $.fn.tab + $.fn.tab = Plugin + $.fn.tab.Constructor = Tab -/** - * @const - * @type {number} - * @private - */ -Tab._TRANSITION_DURATION = 150 + // TAB NO CONFLICT + // =============== -/** - * @const - * @enum {string} - * @private - */ -Tab._Event = { - HIDE : 'hide.bs.tab', - HIDDEN : 'hidden.bs.tab', - SHOW : 'show.bs.tab', - SHOWN : 'shown.bs.tab' -} + $.fn.tab.noConflict = function () { + $.fn.tab = old + return this + } -/** - * @const - * @enum {string} - * @private - */ -Tab._ClassName = { - DROPDOWN_MENU : 'dropdown-menu', - ACTIVE : 'active', - FADE : 'fade', - IN : 'in' -} + // TAB DATA-API + // ============ + var clickHandler = function (e) { + e.preventDefault() + Plugin.call($(this), 'show') + } -/** - * @const - * @enum {string} - * @private - */ -Tab._Selector = { - A : 'a', - LI : 'li', - LI_DROPDOWN : 'li.dropdown', - UL : 'ul:not(.dropdown-menu)', - FADE_CHILD : ':scope > .fade', - ACTIVE : '.active', - ACTIVE_CHILD : ':scope > .active', - DATA_TOGGLE : '[data-toggle="tab"], [data-toggle="pill"]', - DROPDOWN_ACTIVE_CHILD : ':scope > .dropdown-menu > .active' -} + $(document) + .on('click.bs.tab.data-api', '[data-toggle="tab"]', clickHandler) + .on('click.bs.tab.data-api', '[data-toggle="pill"]', clickHandler) +}(jQuery); -/** - * @param {Object|string=} opt_config - * @this {jQuery} - * @return {jQuery} - * @private - */ -Tab._jQueryInterface = function (opt_config) { - return this.each(function () { - var $this = $(this) - var data = $this.data(Tab._DATA_KEY) +/* ======================================================================== + * Bootstrap: affix.js v3.3.4 + * http://getbootstrap.com/javascript/#affix + * ======================================================================== + * Copyright 2011-2015 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * ======================================================================== */ - if (!data) { - data = data = new Tab(this) - $this.data(Tab._DATA_KEY, data) - } - if (typeof opt_config === 'string') { - data[opt_config]() - } - }) -} ++function ($) { + 'use strict'; + // AFFIX CLASS DEFINITION + // ====================== -/** - * Show the tab - */ -Tab.prototype['show'] = function () { - if ( this._element.parentNode - && this._element.parentNode.nodeType == Node.ELEMENT_NODE - && $(this._element).parent().hasClass(Tab._ClassName.ACTIVE)) { - return - } + var Affix = function (element, options) { + this.options = $.extend({}, Affix.DEFAULTS, options) - var ulElement = $(this._element).closest(Tab._Selector.UL)[0] - var selector = Bootstrap.getSelectorFromElement(this._element) + this.$target = $(this.options.target) + .on('scroll.bs.affix.data-api', $.proxy(this.checkPosition, this)) + .on('click.bs.affix.data-api', $.proxy(this.checkPositionWithEventLoop, this)) - if (ulElement) { - var previous = /** @type {Array.} */ ($.makeArray($(ulElement).find(Tab._Selector.ACTIVE))) - previous = previous[previous.length - 1] + this.$element = $(element) + this.affixed = null + this.unpin = null + this.pinnedOffset = null - if (previous) { - previous = $(previous).find('a')[0] - } + this.checkPosition() } - var hideEvent = $.Event(Tab._Event.HIDE, { - relatedTarget: this._element - }) + Affix.VERSION = '3.3.4' - var showEvent = $.Event(Tab._Event.SHOW, { - relatedTarget: previous - }) + Affix.RESET = 'affix affix-top affix-bottom' - if (previous) { - $(previous).trigger(hideEvent) + Affix.DEFAULTS = { + offset: 0, + target: window } - $(this._element).trigger(showEvent) - - if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) return - - if (selector) { - var target = $(selector)[0] - } + Affix.prototype.getState = function (scrollHeight, height, offsetTop, offsetBottom) { + var scrollTop = this.$target.scrollTop() + var position = this.$element.offset() + var targetHeight = this.$target.height() - this._activate($(this._element).closest(Tab._Selector.LI)[0], ulElement) + if (offsetTop != null && this.affixed == 'top') return scrollTop < offsetTop ? 'top' : false - var complete = function () { - var hiddenEvent = $.Event(Tab._Event.HIDDEN, { - relatedTarget: this._element - }) + if (this.affixed == 'bottom') { + if (offsetTop != null) return (scrollTop + this.unpin <= position.top) ? false : 'bottom' + return (scrollTop + targetHeight <= scrollHeight - offsetBottom) ? false : 'bottom' + } - var shownEvent = $.Event(Tab._Event.SHOWN, { - relatedTarget: previous - }) + var initializing = this.affixed == null + var colliderTop = initializing ? scrollTop : position.top + var colliderHeight = initializing ? targetHeight : height - $(previous).trigger(hiddenEvent) - $(this._element).trigger(shownEvent) - }.bind(this) + if (offsetTop != null && scrollTop <= offsetTop) return 'top' + if (offsetBottom != null && (colliderTop + colliderHeight >= scrollHeight - offsetBottom)) return 'bottom' - if (target) { - this._activate(target, /** @type {Element} */ (target.parentNode), complete) - } else { - complete() + return false } -} - -/** - * @param {Element} element - * @param {Element} container - * @param {Function=} opt_callback - * @private - */ -Tab.prototype._activate = function (element, container, opt_callback) { - var active = $(container).find(Tab._Selector.ACTIVE_CHILD)[0] - var isTransitioning = opt_callback - && Bootstrap.transition - && ((active && $(active).hasClass(Tab._ClassName.FADE)) - || !!$(container).find(Tab._Selector.FADE_CHILD)[0]) - - var complete = this._transitionComplete.bind(this, element, active, isTransitioning, opt_callback) - - if (active && isTransitioning) { - $(active) - .one(Bootstrap.TRANSITION_END, complete) - .emulateTransitionEnd(Tab._TRANSITION_DURATION) - - } else { - complete() + Affix.prototype.getPinnedOffset = function () { + if (this.pinnedOffset) return this.pinnedOffset + this.$element.removeClass(Affix.RESET).addClass('affix') + var scrollTop = this.$target.scrollTop() + var position = this.$element.offset() + return (this.pinnedOffset = position.top - scrollTop) } - if (active) { - $(active).removeClass(Tab._ClassName.IN) + Affix.prototype.checkPositionWithEventLoop = function () { + setTimeout($.proxy(this.checkPosition, this), 1) } -} + Affix.prototype.checkPosition = function () { + if (!this.$element.is(':visible')) return -/** - * @param {Element} element - * @param {Element} active - * @param {boolean} isTransitioning - * @param {Function=} opt_callback - * @private - */ -Tab.prototype._transitionComplete = function (element, active, isTransitioning, opt_callback) { - if (active) { - $(active).removeClass(Tab._ClassName.ACTIVE) + var height = this.$element.height() + var offset = this.options.offset + var offsetTop = offset.top + var offsetBottom = offset.bottom + var scrollHeight = Math.max($(document).height(), $(document.body).height()) - var dropdownChild = $(active).find(Tab._Selector.DROPDOWN_ACTIVE_CHILD)[0] - if (dropdownChild) { - $(dropdownChild).removeClass(Tab._ClassName.ACTIVE) - } + if (typeof offset != 'object') offsetBottom = offsetTop = offset + if (typeof offsetTop == 'function') offsetTop = offset.top(this.$element) + if (typeof offsetBottom == 'function') offsetBottom = offset.bottom(this.$element) - var activeToggle = $(active).find(Tab._Selector.DATA_TOGGLE)[0] - if (activeToggle) { - activeToggle.setAttribute('aria-expanded', false) - } - } + var affix = this.getState(scrollHeight, height, offsetTop, offsetBottom) - $(element).addClass(Tab._ClassName.ACTIVE) + if (this.affixed != affix) { + if (this.unpin != null) this.$element.css('top', '') - var elementToggle = $(element).find(Tab._Selector.DATA_TOGGLE)[0] - if (elementToggle) { - elementToggle.setAttribute('aria-expanded', true) - } + var affixType = 'affix' + (affix ? '-' + affix : '') + var e = $.Event(affixType + '.bs.affix') - if (isTransitioning) { - Bootstrap.reflow(element) - $(element).addClass(Tab._ClassName.IN) - } else { - $(element).removeClass(Tab._ClassName.FADE) - } + this.$element.trigger(e) + + if (e.isDefaultPrevented()) return - if (element.parentNode && $(element.parentNode).hasClass(Tab._ClassName.DROPDOWN_MENU)) { - var dropdownElement = $(element).closest(Tab._Selector.LI_DROPDOWN)[0] - if (dropdownElement) { - $(dropdownElement).addClass(Tab._ClassName.ACTIVE) + this.affixed = affix + this.unpin = affix == 'bottom' ? this.getPinnedOffset() : null + + this.$element + .removeClass(Affix.RESET) + .addClass(affixType) + .trigger(affixType.replace('affix', 'affixed') + '.bs.affix') } - elementToggle = $(element).find(Tab._Selector.DATA_TOGGLE)[0] - if (elementToggle) { - elementToggle.setAttribute('aria-expanded', true) + if (affix == 'bottom') { + this.$element.offset({ + top: scrollHeight - height - offsetBottom + }) } } - if (opt_callback) { - opt_callback() + + // AFFIX PLUGIN DEFINITION + // ======================= + + function Plugin(option) { + return this.each(function () { + var $this = $(this) + var data = $this.data('bs.affix') + var options = typeof option == 'object' && option + + if (!data) $this.data('bs.affix', (data = new Affix(this, options))) + if (typeof option == 'string') data[option]() + }) } -} + var old = $.fn.affix -/** - * ------------------------------------------------------------------------ - * jQuery Interface + noConflict implementaiton - * ------------------------------------------------------------------------ - */ + $.fn.affix = Plugin + $.fn.affix.Constructor = Affix -/** - * @const - * @type {Function} - */ -$.fn[Tab._NAME] = Tab._jQueryInterface + // AFFIX NO CONFLICT + // ================= -/** - * @const - * @type {Function} - */ -$.fn[Tab._NAME]['Constructor'] = Tab + $.fn.affix.noConflict = function () { + $.fn.affix = old + return this + } -/** - * @const - * @type {Function} - */ -$.fn[Tab._NAME]['noConflict'] = function () { - $.fn[Tab._NAME] = Tab._JQUERY_NO_CONFLICT - return this -} + // AFFIX DATA-API + // ============== + $(window).on('load', function () { + $('[data-spy="affix"]').each(function () { + var $spy = $(this) + var data = $spy.data() + data.offset = data.offset || {} -// TAB DATA-API -// ============ + if (data.offsetBottom != null) data.offset.bottom = data.offsetBottom + if (data.offsetTop != null) data.offset.top = data.offsetTop -var clickHandler = function (e) { - e.preventDefault() - Tab._jQueryInterface.call($(this), 'show') -} + Plugin.call($spy, data) + }) + }) -$(document) - .on('click.bs.tab.data-api', Tab._Selector.DATA_TOGGLE, clickHandler) +}(jQuery); diff --git a/dist/js/bootstrap.min.js b/dist/js/bootstrap.min.js index 089780400..766575923 100644 --- a/dist/js/bootstrap.min.js +++ b/dist/js/bootstrap.min.js @@ -3,75 +3,5 @@ * Copyright 2011-2015 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) */ -if (typeof jQuery === 'undefined') { - throw new Error('Bootstrap\'s JavaScript requires jQuery') -} -+function ($) { - var version = $.fn.jquery.split(' ')[0].split('.') - if ((version[0] < 2 && version[1] < 9) || (version[0] == 1 && version[1] == 9 && version[2] < 1)) { - throw new Error('Bootstrap\'s JavaScript requires jQuery version 1.9.1 or higher') - } -}(jQuery); - -(function($){var h,k,l={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};function m(a){var b=a.getAttribute("data-target");b||(b=a.getAttribute("href")||"",b=/^#[a-z]/i.test(b)?b:null);return b}function aa(a){do a+=~~(1E6*Math.random());while(document.getElementById(a));return a}function ba(){return{ha:k.end,ia:k.end,handle:function(a){if($(a.target).is(this))return a.handleObj.handler.apply(this,arguments)}}} -function n(a){(new Function("bs","return bs"))(a.offsetHeight)}function ca(){if(window.QUnit)return!1;var a=document.createElement("bootstrap"),b;for(b in l)if(void 0!==a.style[b])return{end:l[b]};return!1}$.fn.f=function(a){var b=!1;$(this).one("bsTransitionEnd",function(){b=!0});var c=function(){b||$(this).trigger(k.end)}.bind(this);setTimeout(c,a)};$(function(){(k=ca())&&($.event.special.bsTransitionEnd=ba())});function p(a){if(a)$(a).on("click",'[data-dismiss="alert"]',q(this))}p.VERSION="4.0.0";var da=$.fn.alert;function s(a){return this.each(function(){var b=$(this),c=b.data("bs.alert");c||(c=new p(this),b.data("bs.alert",c));if("close"===a)c[a](this)})}function q(a){return function(b){b&&b.preventDefault();a.close(this)}} -p.prototype.close=function(a){var b=!1,c=m(a);c&&(b=$(c)[0]);b||(b=$(a).closest(".alert")[0]);a=b;b=$.Event("close.bs.alert");$(a).trigger(b);b.isDefaultPrevented()||($(a).removeClass("in"),k&&$(a).hasClass("fade")?$(a).one("bsTransitionEnd",this.N.bind(this,a)).f(150):this.N(a))};p.prototype.N=function(a){$(a).detach().trigger("closed.bs.alert").remove()};$.fn.alert=s;$.fn.alert.Constructor=p;$.fn.alert.noConflict=function(){$.fn.alert=da;return s}; -$(document).on("click.bs.alert.data-api",'[data-dismiss="alert"]',q(new p));function t(a){this.a=a}t.VERSION="4.0.0";var ea=$.fn.button;function u(a){return this.each(function(){var b=$(this).data("bs.button");b||(b=new t(this),$(this).data("bs.button",b));if("toggle"===a)b[a]()})} -t.prototype.toggle=function(){var a=!0,b=$(this.a).closest('[data-toggle="buttons"]')[0];if(b){var c=$(this.a).find("input")[0];c&&("radio"==c.type&&(c.checked&&$(this.a).hasClass("active")?a=!1:(b=$(b).find(".active")[0])&&$(b).removeClass("active")),a&&(c.checked=!$(this.a).hasClass("active"),$(this.a).trigger("change")))}else this.a.setAttribute("aria-pressed",!$(this.a).hasClass("active"));a&&$(this.a).toggleClass("active")};$.fn.button=u;$.fn.button.Constructor=t; -$.fn.button.noConflict=function(){$.fn.button=ea;return this};$(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(a){a.preventDefault();a=a.target;$(a).hasClass("btn")||(a=$(a).closest(".btn"));u.call($(a),"toggle")}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(a){var b=$(a.target).closest(".btn")[0];$(b).toggleClass("focus",/^focus(in)?$/.test(a.type))});function v(a,b){this.a=$(a)[0];this.F=$(this.a).find(fa)[0];this.c=b||null;this.l=this.G=!1;this.h=this.M=this.k=null;if(this.c.keyboard)$(this.a).on("keydown.bs.carousel",this.Y.bind(this));if("hover"==this.c.pause&&!("ontouchstart"in document.documentElement))$(this.a).on("mouseenter.bs.carousel",this.pause.bind(this)).on("mouseleave.bs.carousel",this.cycle.bind(this))}v.VERSION="4.0.0";v.Defaults={interval:5E3,pause:"hover",wrap:!0,keyboard:!0,slide:!1};var fa=".carousel-indicators",ga=$.fn.carousel; -function w(a){return this.each(function(){var b=$(this).data("bs.carousel"),c=$.extend({},v.Defaults,$(this).data(),"object"==typeof a&&a),d="string"==typeof a?a:c.ja;b||(b=new v(this,c),$(this).data("bs.carousel",b));if("number"==typeof a)x(b,a);else if(d)b[d]();else c.interval&&(b.pause(),b.cycle())})}v.prototype.next=function(){this.l||z(this,"next")};v.prototype.prev=function(){this.l||z(this,"prev")}; -v.prototype.pause=function(a){a||(this.G=!0);$(this.a).find(".next, .prev")[0]&&k&&($(this.a).trigger(k.end),this.cycle(!0));clearInterval(this.k);this.k=null};v.prototype.cycle=function(a){a||(this.G=!1);this.k&&(clearInterval(this.k),this.k=null);this.c.interval&&!this.G&&(this.k=setInterval(this.next.bind(this),this.c.interval))};v.prototype.getConfig=function(){return this.c}; -function x(a,b){a.M=$(a.a).find(".active.carousel-item")[0];var c=A(a,a.M);if(!(b>a.h.length-1||0>b))if(a.l)$(a.a).one("slid.bs.carousel",function(){x(this,b)}.bind(a));else c==b?(a.pause(),a.cycle()):z(a,b>c?"next":"prev",a.h[b])}v.prototype.Y=function(a){a.preventDefault();if(!/input|textarea/i.test(a.target.tagName))switch(a.which){case 37:this.prev();break;case 39:this.next()}};function A(a,b){a.h=$.makeArray($(b).parent().find(".carousel-item"));return a.h.indexOf(b)} -function ha(a,b,c){var d=A(a,c);if(("prev"===b&&0===d||"next"===b&&d==a.h.length-1)&&!a.c.wrap)return c;b=(d+("prev"==b?-1:1))%a.h.length;return-1===b?a.h[a.h.length-1]:a.h[b]}function ia(a,b,c){b=$.Event("slide.bs.carousel",{relatedTarget:b,direction:c});$(a.a).trigger(b);return b}function ja(a,b){if(a.F){$(a.F).find(".active").removeClass("active");var c=a.F.children[A(a,b)];c&&$(c).addClass("active")}} -function z(a,b,c){var d=$(a.a).find(".active.carousel-item")[0],e=c||d&&ha(a,b,d);c=!!a.k;var f="next"==b?"left":"right";if(e&&$(e).hasClass("active"))a.l=!1;else if(!ia(a,e,f).isDefaultPrevented()&&d&&e){a.l=!0;c&&a.pause();ja(a,e);var g=$.Event("slid.bs.carousel",{relatedTarget:e,direction:f});k&&$(a.a).hasClass("slide")?($(e).addClass(b),n(e),$(d).addClass(f),$(e).addClass(f),$(d).one("bsTransitionEnd",function(){$(e).removeClass(f).removeClass(b);$(e).addClass("active");$(d).removeClass("active").removeClass(b).removeClass(f); -this.l=!1;setTimeout(function(){$(this.a).trigger(g)}.bind(this),0)}.bind(a)).f(600)):($(d).removeClass("active"),$(e).addClass("active"),a.l=!1,$(a.a).trigger(g));c&&a.cycle()}}$.fn.carousel=w;$.fn.carousel.Constructor=v;$.fn.carousel.noConflict=function(){$.fn.carousel=ga;return this}; -$(document).on("click.bs.carousel.data-api","[data-slide], [data-slide-to]",function(a){var b=m(this);if(b&&(b=$(b)[0])&&$(b).hasClass("carousel")){var c=$.extend({},$(b).data(),$(this).data()),d=this.getAttribute("data-slide-to");d&&(c.interval=!1);w.call($(b),c);d&&x($(b).data("bs.carousel"),d);a.preventDefault()}});$(window).on("load",function(){$('[data-ride="carousel"]').each(function(){var a=$(this);w.call(a,a.data())})});function B(a,b){this.a=a;this.c=$.extend({},B.Defaults,b);this.o="string"==typeof this.c.trigger?$(this.c.trigger)[0]:this.c.trigger;this.A=!1;var c;if(this.c.parent){var d='[data-toggle="collapse"][data-parent="'+this.c.parent+'"]';c=$(this.c.parent)[0];for(var d=$.makeArray($(c).find(d)),e=0;e .in, .panel > .collapsing")),b.length||(b=null));if(b&&(a=$(b).data("bs.collapse"))&&a.A)return;var c=$.Event("show.bs.collapse");$(this.a).trigger(c);if(!c.isDefaultPrevented()){b&&(E.call($(b),"hide"),a||$(b).data("bs.collapse",null));var d=F(this);$(this.a).removeClass("collapse").addClass("collapsing");this.a.style[d]=0;this.a.setAttribute("aria-expanded",!0);this.o&&($(this.o).removeClass("collapsed"), -this.o.setAttribute("aria-expanded",!0));this.setTransitioning(!0);a=function(){$(this.a).removeClass("collapsing").addClass("collapse").addClass("in");this.a.style[d]="";this.setTransitioning(!1);$(this.a).trigger("shown.bs.collapse")}.bind(this);k?(b="scroll"+(d[0].toUpperCase()+d.slice(1)),$(this.a).one("bsTransitionEnd",a).f(600),this.a.style[d]=this.a[b]+"px"):a()}}}; -B.prototype.hide=function(){if(!this.A&&$(this.a).hasClass("in")){var a=$.Event("hide.bs.collapse");$(this.a).trigger(a);if(!a.isDefaultPrevented()){a=F(this);this.a.style[a]=this.a["width"===a?"offsetWidth":"offsetHeight"]+"px";n(this.a);$(this.a).addClass("collapsing").removeClass("collapse").removeClass("in");this.a.setAttribute("aria-expanded",!1);this.o&&($(this.o).addClass("collapsed"),this.o.setAttribute("aria-expanded",!1));this.setTransitioning(!0);var b=function(){this.setTransitioning(!1); -$(this.a).removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")}.bind(this);this.a.style[a]=0;if(!k)return b();$(this.a).one("bsTransitionEnd",b).f(600)}}};B.prototype.setTransitioning=function(a){this.A=a};function F(a){return $(a.a).hasClass("width")?"width":"height"}function C(a,b){if(a){var c=$(a).hasClass("in");a.setAttribute("aria-expanded",c);b&&(b.setAttribute("aria-expanded",c),$(b).toggleClass("collapsed",!c))}}$.fn.collapse=E;$.fn.collapse.Constructor=B; -$.fn.collapse.noConflict=function(){$.fn.collapse=ka;return this};$(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(a){a.preventDefault();a=D(this);var b=$(a).data("bs.collapse")?"toggle":$.extend({},$(this).data(),{trigger:this});E.call($(a),b)});function G(a){$(a).on("click.bs.dropdown",this.toggle)}G.VERSION="4.0.0";var la=$.fn.dropdown; -function H(a){if(!a||3!=a.which){(a=$(".dropdown-backdrop")[0])&&a.parentNode.removeChild(a);a=$.makeArray($('[data-toggle="dropdown"]'));for(var b=0;bdocument.documentElement.clientHeight;b=document.createElement("div");b.className="modal-scrollbar-measure";document.body.appendChild(b);var c=b.offsetWidth-b.clientWidth;document.body.removeChild(b);this.B=c;b=parseInt($(document.body).css("padding-right")||0,10);this.w&&(document.body.style.paddingRight=b+this.B+"px"); -$(document.body).addClass("modal-open");M(this);N(this);$(this.a).on("click.dismiss.bs.modal",'[data-dismiss="modal"]',this.hide.bind(this));O(this,this.$.bind(this,a))}}; -K.prototype.hide=function(a){a&&a.preventDefault();a=$.Event("hide.bs.modal");$(this.a).trigger(a);this.g&&!a.isDefaultPrevented()&&(this.g=!1,M(this),N(this),$(document).off("focusin.bs.modal"),$(this.a).removeClass("in"),this.a.setAttribute("aria-hidden",!0),$(this.a).off("click.dismiss.bs.modal"),k&&$(this.a).hasClass("fade")?$(this.a).one("bsTransitionEnd",this.P.bind(this)).f(300):this.P())}; -K.prototype.$=function(a){var b=k&&$(this.a).hasClass("fade");this.a.parentNode&&this.a.parentNode.nodeType==Node.ELEMENT_NODE||document.body.appendChild(this.a);this.a.style.display="block";this.a.scrollTop=0;this.c.backdrop&&P(this);b&&n(this.a);$(this.a).addClass("in");this.a.setAttribute("aria-hidden",!1);na(this);var c=$.Event("shown.bs.modal",{relatedTarget:a});a=function(){this.a.focus();$(this.a).trigger(c)}.bind(this);b?(b=$(this.a).find(".modal-dialog")[0],$(b).one("bsTransitionEnd",a).f(300)): -a()};function na(a){$(document).off("focusin.bs.modal").on("focusin.bs.modal",function(a){this.a===a.target||$(this.a).has(a.target).length||this.a.focus()}.bind(a))}function M(a){if(a.g&&a.c.keyboard)$(a.a).on("keydown.dismiss.bs.modal",function(a){27===a.which&&this.hide()}.bind(a));else a.g||$(a.a).off("keydown.dismiss.bs.modal")}function N(a){if(a.g)$(window).on("resize.bs.modal",a.X.bind(a));else $(window).off("resize.bs.modal")} -K.prototype.P=function(){this.a.style.display="none";O(this,function(){$(document.body).removeClass("modal-open");this.a.style.paddingLeft="";this.a.style.paddingRight="";document.body.style.paddingRight="";$(this.a).trigger("hidden.bs.modal")}.bind(this))}; -function O(a,b){var c=$(a.a).hasClass("fade")?"fade":"";if(a.g&&a.c.backdrop){var d=k&&c;a.d=document.createElement("div");a.d.className="modal-backdrop";c&&$(a.d).addClass(c);$(a.a).prepend(a.d);$(a.d).on("click.dismiss.bs.modal",function(a){a.target===a.currentTarget&&("static"===this.c.backdrop?this.a.focus():this.hide())}.bind(a));d&&n(a.d);$(a.d).addClass("in");b&&(d?$(a.d).one("bsTransitionEnd",b).f(150):b())}else!a.g&&a.d?($(a.d).removeClass("in"),c=function(){this.d&&(this.d.parentNode.removeChild(this.d), -this.d=null);b&&b()}.bind(a),k&&$(a.a).hasClass("fade")?$(a.d).one("bsTransitionEnd",c).f(150):c()):b&&b()}K.prototype.X=function(){this.c.backdrop&&P(this);var a=this.a.scrollHeight>document.documentElement.clientHeight;!this.w&&a&&(this.a.style.paddingLeft=this.B+"px");this.w&&!a&&(this.a.style.paddingRight=this.B+"px")};function P(a){a.d.style.height=0;a.d.style.height=a.a.scrollHeight+"px"}$.fn.modal=L;$.fn.modal.Constructor=K;$.fn.modal.noConflict=function(){$.fn.modal=ma;return this}; -$(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(a){var b=m(this);if(b)var c=$(b)[0];b=$(c).data("bs.modal")?"toggle":$.extend({},$(c).data(),$(this).data());"A"==this.tagName&&a.preventDefault();var d=$(c).one("show.bs.modal",function(a){if(!a.isDefaultPrevented())d.one("hidden.bs.modal",function(){$(this).is(":visible")&&this.focus()}.bind(this))}.bind(this));L.call($(c),b,this)});function Q(a,b){this.e="BODY"==a.tagName?window:a;this.c=$.extend({},Q.Defaults,b);this.C=(this.c.target||"")+" .nav li > a";this.m=[];this.p=[];this.s=null;this.R=0;$(this.e).on("scroll.bs.scrollspy",this.Q.bind(this));this.refresh();this.Q()}Q.VERSION="4.0.0";Q.Defaults={offset:10};var oa=$.fn.scrollspy;function R(a){return this.each(function(){var b=$(this).data("bs.scrollspy"),c="object"===typeof a&&a||null;b||(b=new Q(this,c),$(this).data("bs.scrollspy",b));if("string"===typeof a)b[a]()})} -Q.prototype.refresh=function(){var a="offset",b=0;this.e!==this.e.window&&(a="position",b=this.e===window?this.e.scrollY:this.e.scrollTop);this.m=[];this.p=[];this.R=this.e.scrollHeight||Math.max(document.body.scrollHeight,document.documentElement.scrollHeight);$.makeArray($(this.C)).map(function(c){var d;(c=m(c))&&(d=$(c)[0]);if(d&&(d.offsetWidth||d.offsetHeight))return[$(d)[a]().top+b,c]}).filter(function(a){return a}).sort(function(a,b){return a[0]-b[0]}).forEach(function(a){this.m.push(a[0]); -this.p.push(a[1])}.bind(this))};Q.prototype.Q=function(){var a=(this.e===window?this.e.scrollY:this.e.scrollTop)+this.c.offset,b=this.e.scrollHeight||Math.max(document.body.scrollHeight,document.documentElement.scrollHeight),c=this.c.offset+b-this.e.offsetHeight;this.R!=b&&this.refresh();a>=c&&(b=this.p[this.p.length-1],this.s!=b&&this.r(b));if(this.s&&a=this.m[b]&&(!this.m[b+1]||a
',trigger:"hover focus",title:"",delay:0,html:!1,viewport:{selector:"body",padding:0}};var U={fa:"top",da:"left",ea:"right",ca:"bottom"},qa={J:"hide.bs.tooltip",I:"hidden.bs.tooltip",K:"show.bs.tooltip",L:"shown.bs.tooltip"},ra=$.fn.tooltip;T.prototype.enable=function(){this.t=!0}; -T.prototype.disable=function(){this.t=!1};T.prototype.toggleEnabled=function(){this.t=!this.t};T.prototype.toggle=function(a){var b=this,c=this.q();a&&(b=$(a.currentTarget).data(c),b||(b=new this.constructor(a.currentTarget,V(this)),$(a.currentTarget).data(c,b)));$(b.i()).hasClass("in")?b.H(null,b):b.O(null,b)};T.prototype.destroy=function(){clearTimeout(this.u);this.hide(function(){$(this.element).off(".tooltip").removeData(this.q())}.bind(this))}; -T.prototype.show=function(){var a=$.Event(this.v().K);if(this.U()&&this.t){$(this.element).trigger(a);var b=$.contains(this.element.ownerDocument.documentElement,this.element);if(!a.isDefaultPrevented()&&b){a=this.i();b=aa(this.getName());a.setAttribute("id",b);this.element.setAttribute("aria-describedby",b);this.V();this.b.animation&&$(a).addClass("fade");var b="function"==typeof this.b.placement?this.b.placement.call(this,a,this.element):this.b.placement,c=/\s?auto?\s?/i,d=c.test(b);d&&(b=b.replace(c, -"")||"top");a.parentNode&&a.parentNode.nodeType==Node.ELEMENT_NODE&&a.parentNode.removeChild(a);a.style.top=0;a.style.left=0;a.style.display="block";$(a).addClass("tooltip-"+b);$(a).data(this.q(),this);this.b.container?$(this.b.container)[0].appendChild(a):this.element.parentNode.insertBefore(a,this.element.nextSibling);var c=W(this),e=a.offsetWidth,a=a.offsetHeight,b=sa(this,d,b,c,e,a);ta(this,"bottom"==b?{top:c.top+c.height,left:c.left+c.width/2-e/2}:"top"==b?{top:c.top-a,left:c.left+c.width/2- -e/2}:"left"==b?{top:c.top+c.height/2-a/2,left:c.left-e}:{top:c.top+c.height/2-a/2,left:c.left+c.width},b);a=function(){var a=this.ba;$(this.element).trigger(this.v().L);this.ba=null;"out"==a&&this.H(null,this)}.bind(this);k&&$(this.n).hasClass("fade")?$(this.n).one("bsTransitionEnd",a).f(150):a()}}}; -T.prototype.hide=function(a){var b=this.i(),c=$.Event(this.v().J),d=function(){"in"!=this.j&&b.parentNode.removeChild(b);this.element.removeAttribute("aria-describedby");$(this.element).trigger(this.v().I);a&&a()}.bind(this);$(this.element).trigger(c);c.isDefaultPrevented()||($(b).removeClass("in"),k&&$(this.n).hasClass("fade")?$(b).one("bsTransitionEnd",d).f(150):d(),this.j="")};T.prototype.getHoverState=function(){return this.j};h=T.prototype;h.getName=function(){return"tooltip"};h.q=function(){return"bs.tooltip"}; -h.v=function(){return qa};function X(a){var b=a.element.getAttribute("data-original-title");b||(b="function"===typeof a.b.title?a.b.title.call(a.element):a.b.title);return b}h.i=function(){return this.n=this.n||$(this.b.template)[0]};h.T=function(){return this.D=this.D||$(this.i()).find(".tooltip-arrow")[0]};h.U=function(){return!!X(this)}; -h.V=function(){var a=this.i(),b=X(this);$(a).find(".tooltip-inner")[0][this.b.html?"innerHTML":"innerText"]=b;$(a).removeClass("fade").removeClass("in");for(var c in U)$(a).removeClass("tooltip-"+c)}; -function pa(a){a.b.trigger.split(" ").forEach(function(a){if("click"==a)$(this.element).on("click.bs.tooltip",this.b.selector,this.toggle.bind(this));else if("manual"!=a){var c="hover"==a?"mouseenter":"focusin";a="hover"==a?"mouseleave":"focusout";$(this.element).on(c+".bs.tooltip",this.b.selector,this.O.bind(this)).on(a+".bs.tooltip",this.b.selector,this.H.bind(this))}}.bind(a));a.b.selector?a.b=$.extend({},a.b,{trigger:"manual",selector:""}):ua(a)} -function V(a){var b={},c=a.constructor.Defaults;if(a.b)for(var d in a.b){var e=a.b[d];c[d]!=e&&(b[d]=e)}return b}function sa(a,b,c,d,e,f){if(b){b=c;var g=a.b.container?$(a.b.container)[0]:a.element.parentNode,g=W(a,g);c="bottom"==c&&d.bottom+f>g.bottom?"top":"top"==c&&d.top-fg.width?"left":"left"==c&&d.left-ea.top+a.height&&(f.top=a.top+a.height-c)):(e=c.left-g,c=c.left+g+d,ea.width&&(f.left=a.left+a.width-c));return f} -function W(a,b){var c=b||a.element,d="BODY"==c.tagName,e=c.getBoundingClientRect(),c=d?{top:0,left:0}:$(c).offset();return $.extend({},e,{scroll:d?document.documentElement.scrollTop||document.body.scrollTop:a.element.scrollTop},d?{width:window.innerWidth,height:window.innerHeight}:null,c)} -function ta(a,b,c){var d=a.i(),e=d.offsetWidth,f=d.offsetHeight,g=parseInt(d.style.marginTop,10),r=parseInt(d.style.marginLeft,10);isNaN(g)&&(g=0);isNaN(r)&&(r=0);b.top+=g;b.left+=r;$.offset.setOffset(d,$.extend({ka:function(a){d.style.top=Math.round(a.top)+"px";d.style.left=Math.round(a.left)+"px"}},b),0);$(d).addClass("in");g=d.offsetWidth;r=d.offsetHeight;"top"==c&&r!=f&&(b.top=b.top+f-r);var y=va(a,c,b,g,r);y.left?b.left+=y.left:b.top+=y.top;e=(c="top"===c||"bottom"===c)?2*y.left-e+g:2*y.top- -f+r;f=c?"offsetWidth":"offsetHeight";$(d).offset(b);wa(a,e,d[f],c)}function wa(a,b,c,d){a=a.T();a.style[d?"left":"top"]=50*(1-b/c)+"%";a.style[d?"top":"left"]=""}function ua(a){if(a.element.getAttribute("title")||"string"!=typeof a.element.getAttribute("data-original-title"))a.element.setAttribute("data-original-title",a.element.getAttribute("title")||""),a.element.setAttribute("title","")} -h.O=function(a,b){var c=this.q(),d=b||$(a.currentTarget).data(c);d&&d.n&&d.n.offsetWidth?d.j="in":(d||(d=new this.constructor(a.currentTarget,V(this)),$(a.currentTarget).data(c,d)),clearTimeout(d.u),d.j="in",d.b.delay&&d.b.delay.show?d.u=setTimeout(function(){"in"==d.j&&d.show()},d.b.delay.show):d.show())}; -h.H=function(a,b){var c=this.q(),d=b||$(a.currentTarget).data(c);d||(d=new this.constructor(a.currentTarget,V(this)),$(a.currentTarget).data(c,d));clearTimeout(d.u);d.j="out";d.b.delay&&d.b.delay.hide?d.u=setTimeout(function(){"out"==d.j&&d.hide()},d.b.delay.hide):d.hide()};$.fn.tooltip=function(a){return this.each(function(){var b=$(this).data("bs.tooltip"),c="object"==typeof a?a:null;if(b||"destroy"!=a)if(b||(b=new T(this,c),$(this).data("bs.tooltip",b)),"string"===typeof a)b[a]()})}; -$.fn.tooltip.Constructor=T;$.fn.tooltip.noConflict=function(){$.fn.tooltip=ra;return this};if(!T)throw Error("Popover requires tooltip.js");function Y(a,b){T.apply(this,arguments)}(function(){function a(){}a.prototype=T.prototype;Y.prototype=new a;Y.prototype.constructor=Y})();Y.VERSION="4.0.0";Y.Defaults=$.extend({},$.fn.tooltip.Constructor.Defaults,{placement:"right",trigger:"click",content:"",template:''}); -var xa={J:"hide.bs.popover",I:"hidden.bs.popover",K:"show.bs.popover",L:"shown.bs.popover"},ya=$.fn.popover;h=Y.prototype;h.getName=function(){return"popover"};h.q=function(){return"bs.popover"};h.v=function(){return xa};h.T=function(){return this.D=this.D||$(this.i()).find(".popover-arrow")[0]}; -h.V=function(){var a=this.i(),b=X(this),c=za(this),d=$(a).find(".popover-title")[0];d&&(d[this.b.html?"innerHTML":"innerText"]=b);$(a).find(".popover-content").children().detach().end()[this.b.html?"string"==typeof c?"html":"append":"text"](c);$(a).removeClass("fade").removeClass("in");for(var e in U)$(a).removeClass("popover-"+U[e])};h.U=function(){return X(this)||za(this)};h.i=function(){return this.W=this.W||$(this.b.template)[0]}; -function za(a){return a.element.getAttribute("data-content")||("function"==typeof a.b.content?a.b.content.call(a.element):a.b.content)}$.fn.popover=function(a){return this.each(function(){var b=$(this).data("bs.popover"),c="object"===typeof a?a:null;if(b||"destroy"!==a)if(b||(b=new Y(this,c),$(this).data("bs.popover",b)),"string"===typeof a)b[a]()})};$.fn.popover.Constructor=Y;$.fn.popover.noConflict=function(){$.fn.popover=ya;return this};function Z(a){this.a=a}Z.VERSION="4.0.0";function Aa(a){return this.each(function(){var b=$(this),c=b.data("bs.tab");c||(c=c=new Z(this),b.data("bs.tab",c));if("string"===typeof a)c[a]()})} -Z.prototype.show=function(){if(!this.a.parentNode||this.a.parentNode.nodeType!=Node.ELEMENT_NODE||!$(this.a).parent().hasClass("active")){var a=$(this.a).closest("ul:not(.dropdown-menu)")[0],b=m(this.a);if(a){var c=$.makeArray($(a).find(".active"));(c=c[c.length-1])&&(c=$(c).find("a")[0])}var d=$.Event("hide.bs.tab",{relatedTarget:this.a}),e=$.Event("show.bs.tab",{relatedTarget:c});c&&$(c).trigger(d);$(this.a).trigger(e);if(!e.isDefaultPrevented()&&!d.isDefaultPrevented()){if(b)var f=$(b)[0];this.r($(this.a).closest("li")[0], -a);a=function(){var a=$.Event("hidden.bs.tab",{relatedTarget:this.a}),b=$.Event("shown.bs.tab",{relatedTarget:c});$(c).trigger(a);$(this.a).trigger(b)}.bind(this);f?this.r(f,f.parentNode,a):a()}}};Z.prototype.r=function(a,b,c){var d=$(b).find(":scope > .active")[0];b=c&&k&&(d&&$(d).hasClass("fade")||!!$(b).find(":scope > .fade")[0]);a=this.aa.bind(this,a,d,b,c);d&&b?$(d).one("bsTransitionEnd",a).f(150):a();d&&$(d).removeClass("in")}; -Z.prototype.aa=function(a,b,c,d){if(b){$(b).removeClass("active");var e=$(b).find(":scope > .dropdown-menu > .active")[0];e&&$(e).removeClass("active");(b=$(b).find('[data-toggle="tab"], [data-toggle="pill"]')[0])&&b.setAttribute("aria-expanded",!1)}$(a).addClass("active");(b=$(a).find('[data-toggle="tab"], [data-toggle="pill"]')[0])&&b.setAttribute("aria-expanded",!0);c?(n(a),$(a).addClass("in")):$(a).removeClass("fade");a.parentNode&&$(a.parentNode).hasClass("dropdown-menu")&&((c=$(a).closest("li.dropdown")[0])&& -$(c).addClass("active"),(b=$(a).find('[data-toggle="tab"], [data-toggle="pill"]')[0])&&b.setAttribute("aria-expanded",!0));d&&d()};$.fn.tab=Aa;$.fn.tab.Constructor=Z;$.fn.tab.noConflict=function(){$.fn.tab=Z.ga;return this};$(document).on("click.bs.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(a){a.preventDefault();Aa.call($(this),"show")});})(jQuery); +if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){var b=a.fn.jquery.split(" ")[0].split(".");if(b[0]<2&&b[1]<9||1==b[0]&&9==b[1]&&b[2]<1)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher")}(jQuery),+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one("bsTransitionEnd",function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b(),a.support.transition&&(a.event.special.bsTransitionEnd={bindType:a.support.transition.end,delegateType:a.support.transition.end,handle:function(b){return a(b.target).is(this)?b.handleObj.handler.apply(this,arguments):void 0}})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var c=a(this),e=c.data("bs.alert");e||c.data("bs.alert",e=new d(this)),"string"==typeof b&&e[b].call(c)})}var c='[data-dismiss="alert"]',d=function(b){a(b).on("click",c,this.close)};d.VERSION="3.3.4",d.TRANSITION_DURATION=150,d.prototype.close=function(b){function c(){g.detach().trigger("closed.bs.alert").remove()}var e=a(this),f=e.attr("data-target");f||(f=e.attr("href"),f=f&&f.replace(/.*(?=#[^\s]*$)/,""));var g=a(f);b&&b.preventDefault(),g.length||(g=e.closest(".alert")),g.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(g.removeClass("in"),a.support.transition&&g.hasClass("fade")?g.one("bsTransitionEnd",c).emulateTransitionEnd(d.TRANSITION_DURATION):c())};var e=a.fn.alert;a.fn.alert=b,a.fn.alert.Constructor=d,a.fn.alert.noConflict=function(){return a.fn.alert=e,this},a(document).on("click.bs.alert.data-api",c,d.prototype.close)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof b&&b;e||d.data("bs.button",e=new c(this,f)),"toggle"==b?e.toggle():b&&e.setState(b)})}var c=function(b,d){this.$element=a(b),this.options=a.extend({},c.DEFAULTS,d),this.isLoading=!1};c.VERSION="3.3.4",c.DEFAULTS={loadingText:"loading..."},c.prototype.setState=function(b){var c="disabled",d=this.$element,e=d.is("input")?"val":"html",f=d.data();b+="Text",null==f.resetText&&d.data("resetText",d[e]()),setTimeout(a.proxy(function(){d[e](null==f[b]?this.options[b]:f[b]),"loadingText"==b?(this.isLoading=!0,d.addClass(c).attr(c,c)):this.isLoading&&(this.isLoading=!1,d.removeClass(c).removeAttr(c))},this),0)},c.prototype.toggle=function(){var a=!0,b=this.$element.closest('[data-toggle="buttons"]');if(b.length){var c=this.$element.find("input");"radio"==c.prop("type")?(c.prop("checked")&&(a=!1),b.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==c.prop("type")&&(c.prop("checked")!==this.$element.hasClass("active")&&(a=!1),this.$element.toggleClass("active")),c.prop("checked",this.$element.hasClass("active")),a&&c.trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active")};var d=a.fn.button;a.fn.button=b,a.fn.button.Constructor=c,a.fn.button.noConflict=function(){return a.fn.button=d,this},a(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(c){var d=a(c.target);d.hasClass("btn")||(d=d.closest(".btn")),b.call(d,"toggle"),a(c.target).is('input[type="radio"]')||a(c.target).is('input[type="checkbox"]')||c.preventDefault()}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(b){a(b.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(b.type))})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},c.DEFAULTS,d.data(),"object"==typeof b&&b),g="string"==typeof b?b:f.slide;e||d.data("bs.carousel",e=new c(this,f)),"number"==typeof b?e.to(b):g?e[g]():f.interval&&e.pause().cycle()})}var c=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",a.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",a.proxy(this.pause,this)).on("mouseleave.bs.carousel",a.proxy(this.cycle,this))};c.VERSION="3.3.4",c.TRANSITION_DURATION=600,c.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},c.prototype.keydown=function(a){if(!/input|textarea/i.test(a.target.tagName)){switch(a.which){case 37:this.prev();break;case 39:this.next();break;default:return}a.preventDefault()}},c.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},c.prototype.getItemIndex=function(a){return this.$items=a.parent().children(".item"),this.$items.index(a||this.$active)},c.prototype.getItemForDirection=function(a,b){var c=this.getItemIndex(b),d="prev"==a&&0===c||"next"==a&&c==this.$items.length-1;if(d&&!this.options.wrap)return b;var e="prev"==a?-1:1,f=(c+e)%this.$items.length;return this.$items.eq(f)},c.prototype.to=function(a){var b=this,c=this.getItemIndex(this.$active=this.$element.find(".item.active"));return a>this.$items.length-1||0>a?void 0:this.sliding?this.$element.one("slid.bs.carousel",function(){b.to(a)}):c==a?this.pause().cycle():this.slide(a>c?"next":"prev",this.$items.eq(a))},c.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},c.prototype.next=function(){return this.sliding?void 0:this.slide("next")},c.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},c.prototype.slide=function(b,d){var e=this.$element.find(".item.active"),f=d||this.getItemForDirection(b,e),g=this.interval,h="next"==b?"left":"right",i=this;if(f.hasClass("active"))return this.sliding=!1;var j=f[0],k=a.Event("slide.bs.carousel",{relatedTarget:j,direction:h});if(this.$element.trigger(k),!k.isDefaultPrevented()){if(this.sliding=!0,g&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var l=a(this.$indicators.children()[this.getItemIndex(f)]);l&&l.addClass("active")}var m=a.Event("slid.bs.carousel",{relatedTarget:j,direction:h});return a.support.transition&&this.$element.hasClass("slide")?(f.addClass(b),f[0].offsetWidth,e.addClass(h),f.addClass(h),e.one("bsTransitionEnd",function(){f.removeClass([b,h].join(" ")).addClass("active"),e.removeClass(["active",h].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger(m)},0)}).emulateTransitionEnd(c.TRANSITION_DURATION)):(e.removeClass("active"),f.addClass("active"),this.sliding=!1,this.$element.trigger(m)),g&&this.cycle(),this}};var d=a.fn.carousel;a.fn.carousel=b,a.fn.carousel.Constructor=c,a.fn.carousel.noConflict=function(){return a.fn.carousel=d,this};var e=function(c){var d,e=a(this),f=a(e.attr("data-target")||(d=e.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""));if(f.hasClass("carousel")){var g=a.extend({},f.data(),e.data()),h=e.attr("data-slide-to");h&&(g.interval=!1),b.call(f,g),h&&f.data("bs.carousel").to(h),c.preventDefault()}};a(document).on("click.bs.carousel.data-api","[data-slide]",e).on("click.bs.carousel.data-api","[data-slide-to]",e),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var c=a(this);b.call(c,c.data())})})}(jQuery),+function(a){"use strict";function b(b){var c,d=b.attr("data-target")||(c=b.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"");return a(d)}function c(b){return this.each(function(){var c=a(this),e=c.data("bs.collapse"),f=a.extend({},d.DEFAULTS,c.data(),"object"==typeof b&&b);!e&&f.toggle&&/show|hide/.test(b)&&(f.toggle=!1),e||c.data("bs.collapse",e=new d(this,f)),"string"==typeof b&&e[b]()})}var d=function(b,c){this.$element=a(b),this.options=a.extend({},d.DEFAULTS,c),this.$trigger=a('[data-toggle="collapse"][href="#'+b.id+'"],[data-toggle="collapse"][data-target="#'+b.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};d.VERSION="3.3.4",d.TRANSITION_DURATION=350,d.DEFAULTS={toggle:!0},d.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},d.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b,e=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(e&&e.length&&(b=e.data("bs.collapse"),b&&b.transitioning))){var f=a.Event("show.bs.collapse");if(this.$element.trigger(f),!f.isDefaultPrevented()){e&&e.length&&(c.call(e,"hide"),b||e.data("bs.collapse",null));var g=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[g](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var h=function(){this.$element.removeClass("collapsing").addClass("collapse in")[g](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return h.call(this);var i=a.camelCase(["scroll",g].join("-"));this.$element.one("bsTransitionEnd",a.proxy(h,this)).emulateTransitionEnd(d.TRANSITION_DURATION)[g](this.$element[0][i])}}}},d.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[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 e=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};return a.support.transition?void this.$element[c](0).one("bsTransitionEnd",a.proxy(e,this)).emulateTransitionEnd(d.TRANSITION_DURATION):e.call(this)}}},d.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},d.prototype.getParent=function(){return a(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(a.proxy(function(c,d){var e=a(d);this.addAriaAndCollapsedClass(b(e),e)},this)).end()},d.prototype.addAriaAndCollapsedClass=function(a,b){var c=a.hasClass("in");a.attr("aria-expanded",c),b.toggleClass("collapsed",!c).attr("aria-expanded",c)};var e=a.fn.collapse;a.fn.collapse=c,a.fn.collapse.Constructor=d,a.fn.collapse.noConflict=function(){return a.fn.collapse=e,this},a(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(d){var e=a(this);e.attr("data-target")||d.preventDefault();var f=b(e),g=f.data("bs.collapse"),h=g?"toggle":e.data();c.call(f,h)})}(jQuery),+function(a){"use strict";function b(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#[A-Za-z]/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}function c(c){c&&3===c.which||(a(e).remove(),a(f).each(function(){var d=a(this),e=b(d),f={relatedTarget:this};e.hasClass("open")&&(c&&"click"==c.type&&/input|textarea/i.test(c.target.tagName)&&a.contains(e[0],c.target)||(e.trigger(c=a.Event("hide.bs.dropdown",f)),c.isDefaultPrevented()||(d.attr("aria-expanded","false"),e.removeClass("open").trigger("hidden.bs.dropdown",f))))}))}function d(b){return this.each(function(){var c=a(this),d=c.data("bs.dropdown");d||c.data("bs.dropdown",d=new g(this)),"string"==typeof b&&d[b].call(c)})}var e=".dropdown-backdrop",f='[data-toggle="dropdown"]',g=function(b){a(b).on("click.bs.dropdown",this.toggle)};g.VERSION="3.3.4",g.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=b(e),g=f.hasClass("open");if(c(),!g){"ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(a(this)).on("click",c);var h={relatedTarget:this};if(f.trigger(d=a.Event("show.bs.dropdown",h)),d.isDefaultPrevented())return;e.trigger("focus").attr("aria-expanded","true"),f.toggleClass("open").trigger("shown.bs.dropdown",h)}return!1}},g.prototype.keydown=function(c){if(/(38|40|27|32)/.test(c.which)&&!/input|textarea/i.test(c.target.tagName)){var d=a(this);if(c.preventDefault(),c.stopPropagation(),!d.is(".disabled, :disabled")){var e=b(d),g=e.hasClass("open");if(!g&&27!=c.which||g&&27==c.which)return 27==c.which&&e.find(f).trigger("focus"),d.trigger("click");var h=" li:not(.disabled):visible a",i=e.find('[role="menu"]'+h+', [role="listbox"]'+h);if(i.length){var j=i.index(c.target);38==c.which&&j>0&&j--,40==c.which&&jdocument.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&a?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!a?this.scrollbarWidth:""})},c.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},c.prototype.checkScrollbar=function(){var a=window.innerWidth;if(!a){var b=document.documentElement.getBoundingClientRect();a=b.right-Math.abs(b.left)}this.bodyIsOverflowing=document.body.clientWidth
',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},c.prototype.init=function(b,c,d){if(this.enabled=!0,this.type=b,this.$element=a(c),this.options=this.getOptions(d),this.$viewport=this.options.viewport&&a(a.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},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!");for(var e=this.options.trigger.split(" "),f=e.length;f--;){var g=e[f];if("click"==g)this.$element.on("click."+this.type,this.options.selector,a.proxy(this.toggle,this));else if("manual"!=g){var h="hover"==g?"mouseenter":"focusin",i="hover"==g?"mouseleave":"focusout";this.$element.on(h+"."+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(i+"."+this.type,this.options.selector,a.proxy(this.leave,this))}}this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.getOptions=function(b){return b=a.extend({},this.getDefaults(),this.$element.data(),b),b.delay&&"number"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),b},c.prototype.getDelegateOptions=function(){var b={},c=this.getDefaults();return this._options&&a.each(this._options,function(a,d){c[a]!=d&&(b[a]=d)}),b},c.prototype.enter=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusin"==b.type?"focus":"hover"]=!0),c.tip().hasClass("in")||"in"==c.hoverState?void(c.hoverState="in"):(clearTimeout(c.timeout),c.hoverState="in",c.options.delay&&c.options.delay.show?void(c.timeout=setTimeout(function(){"in"==c.hoverState&&c.show()},c.options.delay.show)):c.show())},c.prototype.isInStateTrue=function(){for(var a in this.inState)if(this.inState[a])return!0;return!1},c.prototype.leave=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusout"==b.type?"focus":"hover"]=!1),c.isInStateTrue()?void 0:(clearTimeout(c.timeout),c.hoverState="out",c.options.delay&&c.options.delay.hide?void(c.timeout=setTimeout(function(){"out"==c.hoverState&&c.hide()},c.options.delay.hide)):c.hide())},c.prototype.show=function(){var b=a.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(b);var d=a.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(b.isDefaultPrevented()||!d)return;var e=this,f=this.tip(),g=this.getUID(this.type);this.setContent(),f.attr("id",g),this.$element.attr("aria-describedby",g),this.options.animation&&f.addClass("fade");var h="function"==typeof this.options.placement?this.options.placement.call(this,f[0],this.$element[0]):this.options.placement,i=/\s?auto?\s?/i,j=i.test(h);j&&(h=h.replace(i,"")||"top"),f.detach().css({top:0,left:0,display:"block"}).addClass(h).data("bs."+this.type,this),this.options.container?f.appendTo(this.options.container):f.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var k=this.getPosition(),l=f[0].offsetWidth,m=f[0].offsetHeight;if(j){var n=h,o=this.getPosition(this.$viewport);h="bottom"==h&&k.bottom+m>o.bottom?"top":"top"==h&&k.top-mo.width?"left":"left"==h&&k.left-lg.top+g.height&&(e.top=g.top+g.height-i)}else{var j=b.left-f,k=b.left+f+c;jg.right&&(e.left=g.left+g.width-k)}return e},c.prototype.getTitle=function(){var a,b=this.$element,c=this.options;return a=b.attr("data-original-title")||("function"==typeof c.title?c.title.call(b[0]):c.title)},c.prototype.getUID=function(a){do a+=~~(1e6*Math.random());while(document.getElementById(a));return a},c.prototype.tip=function(){if(!this.$tip&&(this.$tip=a(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},c.prototype.enable=function(){this.enabled=!0},c.prototype.disable=function(){this.enabled=!1},c.prototype.toggleEnabled=function(){this.enabled=!this.enabled},c.prototype.toggle=function(b){var c=this;b&&(c=a(b.currentTarget).data("bs."+this.type),c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c))),b?(c.inState.click=!c.inState.click,c.isInStateTrue()?c.enter(c):c.leave(c)):c.tip().hasClass("in")?c.leave(c):c.enter(c)},c.prototype.destroy=function(){var a=this;clearTimeout(this.timeout),this.hide(function(){a.$element.off("."+a.type).removeData("bs."+a.type),a.$tip&&a.$tip.detach(),a.$tip=null,a.$arrow=null,a.$viewport=null})};var d=a.fn.tooltip;a.fn.tooltip=b,a.fn.tooltip.Constructor=c,a.fn.tooltip.noConflict=function(){return a.fn.tooltip=d,this}}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof b&&b;(e||!/destroy|hide/.test(b))&&(e||d.data("bs.popover",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.init("popover",a,b)};if(!a.fn.tooltip)throw new Error("Popover requires tooltip.js");c.VERSION="3.3.4",c.DEFAULTS=a.extend({},a.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:''}),c.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),c.prototype.constructor=c,c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content").children().detach().end()[this.options.html?"string"==typeof c?"html":"append":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},c.prototype.hasContent=function(){return this.getTitle()||this.getContent()},c.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var d=a.fn.popover;a.fn.popover=b,a.fn.popover.Constructor=c,a.fn.popover.noConflict=function(){return a.fn.popover=d,this}}(jQuery),+function(a){"use strict";function b(c,d){this.$body=a(document.body),this.$scrollElement=a(a(c).is(document.body)?window:c),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",a.proxy(this.process,this)),this.refresh(),this.process()}function c(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})}b.VERSION="3.3.4",b.DEFAULTS={offset:10},b.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},b.prototype.refresh=function(){var b=this,c="offset",d=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),a.isWindow(this.$scrollElement[0])||(c="position",d=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map(function(){var b=a(this),e=b.data("target")||b.attr("href"),f=/^#./.test(e)&&a(e);return f&&f.length&&f.is(":visible")&&[[f[c]().top+d,e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){b.offsets.push(this[0]),b.targets.push(this[1])})},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.getScrollHeight(),d=this.options.offset+c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(this.scrollHeight!=c&&this.refresh(),b>=d)return g!=(a=f[f.length-1])&&this.activate(a);if(g&&b=e[a]&&(void 0===e[a+1]||b .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),b.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),h?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu").length&&b.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),e&&e()}var g=d.find("> .active"),h=e&&a.support.transition&&(g.length&&g.hasClass("fade")||!!d.find("> .fade").length);g.length&&h?g.one("bsTransitionEnd",f).emulateTransitionEnd(c.TRANSITION_DURATION):f(),g.removeClass("in")};var d=a.fn.tab;a.fn.tab=b,a.fn.tab.Constructor=c,a.fn.tab.noConflict=function(){return a.fn.tab=d,this};var e=function(c){c.preventDefault(),b.call(a(this),"show")};a(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',e).on("click.bs.tab.data-api",'[data-toggle="pill"]',e)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof b&&b;e||d.data("bs.affix",e=new c(this,f)),"string"==typeof b&&e[b]()})}var c=function(b,d){this.options=a.extend({},c.DEFAULTS,d),this.$target=a(this.options.target).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(b),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};c.VERSION="3.3.4",c.RESET="affix affix-top affix-bottom",c.DEFAULTS={offset:0,target:window},c.prototype.getState=function(a,b,c,d){var e=this.$target.scrollTop(),f=this.$element.offset(),g=this.$target.height();if(null!=c&&"top"==this.affixed)return c>e?"top":!1;if("bottom"==this.affixed)return null!=c?e+this.unpin<=f.top?!1:"bottom":a-d>=e+g?!1:"bottom";var h=null==this.affixed,i=h?e:f.top,j=h?g:b;return null!=c&&c>=e?"top":null!=d&&i+j>=a-d?"bottom":!1},c.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(c.RESET).addClass("affix");var a=this.$target.scrollTop(),b=this.$element.offset();return this.pinnedOffset=b.top-a},c.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},c.prototype.checkPosition=function(){if(this.$element.is(":visible")){var b=this.$element.height(),d=this.options.offset,e=d.top,f=d.bottom,g=Math.max(a(document).height(),a(document.body).height());"object"!=typeof d&&(f=e=d),"function"==typeof e&&(e=d.top(this.$element)),"function"==typeof f&&(f=d.bottom(this.$element));var h=this.getState(g,b,e,f);if(this.affixed!=h){null!=this.unpin&&this.$element.css("top","");var i="affix"+(h?"-"+h:""),j=a.Event(i+".bs.affix");if(this.$element.trigger(j),j.isDefaultPrevented())return;this.affixed=h,this.unpin="bottom"==h?this.getPinnedOffset():null,this.$element.removeClass(c.RESET).addClass(i).trigger(i.replace("affix","affixed")+".bs.affix")}"bottom"==h&&this.$element.offset({top:g-b-f})}};var d=a.fn.affix;a.fn.affix=b,a.fn.affix.Constructor=c,a.fn.affix.noConflict=function(){return a.fn.affix=d,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var c=a(this),d=c.data();d.offset=d.offset||{},null!=d.offsetBottom&&(d.offset.bottom=d.offsetBottom),null!=d.offsetTop&&(d.offset.top=d.offsetTop),b.call(c,d)})})}(jQuery); \ No newline at end of file diff --git a/dist/js/npm.js b/dist/js/npm.js index f9e8027f1..bf6aa8060 100644 --- a/dist/js/npm.js +++ b/dist/js/npm.js @@ -1,12 +1,13 @@ // This file is autogenerated via the `commonjs` Grunt task. You can require() this file in a CommonJS environment. -require('../../js/util.js') +require('../../js/transition.js') require('../../js/alert.js') require('../../js/button.js') require('../../js/carousel.js') require('../../js/collapse.js') require('../../js/dropdown.js') require('../../js/modal.js') -require('../../js/scrollspy.js') require('../../js/tooltip.js') require('../../js/popover.js') -require('../../js/tab.js') \ No newline at end of file +require('../../js/scrollspy.js') +require('../../js/tab.js') +require('../../js/affix.js') \ No newline at end of file -- cgit v1.2.3 From ca9c850ebbfc880dc5021b451ffc9fa12184ff87 Mon Sep 17 00:00:00 2001 From: fat Date: Sun, 10 May 2015 19:45:38 -0700 Subject: add getters for Version and Default where applicable add modal my gawd --- dist/js/npm.js | 1 - 1 file changed, 1 deletion(-) (limited to 'dist/js') diff --git a/dist/js/npm.js b/dist/js/npm.js index bf6aa8060..9060ae2df 100644 --- a/dist/js/npm.js +++ b/dist/js/npm.js @@ -10,4 +10,3 @@ require('../../js/tooltip.js') require('../../js/popover.js') require('../../js/scrollspy.js') require('../../js/tab.js') -require('../../js/affix.js') \ No newline at end of file -- cgit v1.2.3 From ab1578465aee4a776412b48f16bfefca79381919 Mon Sep 17 00:00:00 2001 From: fat Date: Tue, 12 May 2015 16:52:54 -0700 Subject: grunt test-js, grunt dist-js now working --- dist/js/bootstrap.js | 4631 +++++++++++++++++++++++++++------------------- dist/js/bootstrap.min.js | 4 +- dist/js/npm.js | 22 +- 3 files changed, 2771 insertions(+), 1886 deletions(-) (limited to 'dist/js') diff --git a/dist/js/bootstrap.js b/dist/js/bootstrap.js index a6827d652..271a18d25 100644 --- a/dist/js/bootstrap.js +++ b/dist/js/bootstrap.js @@ -15,2348 +15,3233 @@ if (typeof jQuery === 'undefined') { } }(jQuery); -/* ======================================================================== - * Bootstrap: transition.js v3.3.4 - * http://getbootstrap.com/javascript/#transitions - * ======================================================================== - * Copyright 2011-2015 Twitter, Inc. - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - * ======================================================================== */ - +function ($) { - 'use strict'; - // CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/) - // ============================================================ +'use strict'; - function transitionEnd() { - var el = document.createElement('bootstrap') +var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); - var transEndEventNames = { - WebkitTransition : 'webkitTransitionEnd', - MozTransition : 'transitionend', - OTransition : 'oTransitionEnd otransitionend', - transition : 'transitionend' - } +function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; } - for (var name in transEndEventNames) { - if (el.style[name] !== undefined) { - return { end: transEndEventNames[name] } - } - } +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } - return false // explicit for ie8 ( ._.) - } +/** + * -------------------------------------------------------------------------- + * Bootstrap (v4.0.0): util.js + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * -------------------------------------------------------------------------- + */ - // http://blog.alexmaccaw.com/css-transitions - $.fn.emulateTransitionEnd = function (duration) { - var called = false - var $el = this - $(this).one('bsTransitionEnd', function () { called = true }) - var callback = function () { if (!called) $($el).trigger($.support.transition.end) } - setTimeout(callback, duration) - return this +var Util = (function ($) { + + /** + * ------------------------------------------------------------------------ + * Private TransitionEnd Helpers + * ------------------------------------------------------------------------ + */ + + var transition = false; + + var TransitionEndEvent = { + WebkitTransition: 'webkitTransitionEnd', + MozTransition: 'transitionend', + OTransition: 'oTransitionEnd otransitionend', + transition: 'transitionend' + }; + + function getSpecialTransitionEndEvent() { + return { + bindType: transition.end, + delegateType: transition.end, + handle: function handle(event) { + if ($(event.target).is(this)) { + return event.handleObj.handler.apply(this, arguments); + } + } + }; } - $(function () { - $.support.transition = transitionEnd() + function transitionEndTest() { + if (window.QUnit) { + return false; + } - if (!$.support.transition) return + var el = document.createElement('bootstrap'); - $.event.special.bsTransitionEnd = { - bindType: $.support.transition.end, - delegateType: $.support.transition.end, - handle: function (e) { - if ($(e.target).is(this)) return e.handleObj.handler.apply(this, arguments) + for (var name in TransitionEndEvent) { + if (el.style[name] !== undefined) { + return { end: TransitionEndEvent[name] }; } } - }) -}(jQuery); + return false; + } -/* ======================================================================== - * Bootstrap: alert.js v3.3.4 - * http://getbootstrap.com/javascript/#alerts - * ======================================================================== - * Copyright 2011-2015 Twitter, Inc. - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - * ======================================================================== */ + function transitionEndEmulator(duration) { + var _this = this; + var called = false; -+function ($) { - 'use strict'; + $(this).one(Util.TRANSITION_END, function () { + called = true; + }); - // ALERT CLASS DEFINITION - // ====================== + setTimeout(function () { + if (!called) { + Util.triggerTransitionEnd(_this); + } + }, duration); - var dismiss = '[data-dismiss="alert"]' - var Alert = function (el) { - $(el).on('click', dismiss, this.close) + return this; } - Alert.VERSION = '3.3.4' + function setTransitionEndSupport() { + transition = transitionEndTest(); - Alert.TRANSITION_DURATION = 150 + $.fn.emulateTransitionEnd = transitionEndEmulator; - Alert.prototype.close = function (e) { - var $this = $(this) - var selector = $this.attr('data-target') - - if (!selector) { - selector = $this.attr('href') - selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7 + if (Util.supportsTransitionEnd()) { + $.event.special[Util.TRANSITION_END] = getSpecialTransitionEndEvent(); } + } - var $parent = $(selector) + /** + * -------------------------------------------------------------------------- + * Public Util Api + * -------------------------------------------------------------------------- + */ - if (e) e.preventDefault() + var Util = { - if (!$parent.length) { - $parent = $this.closest('.alert') - } + TRANSITION_END: 'bsTransitionEnd', - $parent.trigger(e = $.Event('close.bs.alert')) + getUID: function getUID(prefix) { + do prefix += ~ ~(Math.random() * 1000000); while (document.getElementById(prefix)); + return prefix; + }, - if (e.isDefaultPrevented()) return + getSelectorFromElement: function getSelectorFromElement(element) { + var selector = element.getAttribute('data-target'); - $parent.removeClass('in') + if (!selector) { + selector = element.getAttribute('href') || ''; + selector = /^#[a-z]/i.test(selector) ? selector : null; + } - function removeElement() { - // detach from parent, fire event then clean up data - $parent.detach().trigger('closed.bs.alert').remove() - } + return selector; + }, - $.support.transition && $parent.hasClass('fade') ? - $parent - .one('bsTransitionEnd', removeElement) - .emulateTransitionEnd(Alert.TRANSITION_DURATION) : - removeElement() - } + reflow: function reflow(element) { + new Function('bs', 'return bs')(element.offsetHeight); + }, + triggerTransitionEnd: function triggerTransitionEnd(element) { + $(element).trigger(transition.end); + }, - // ALERT PLUGIN DEFINITION - // ======================= + supportsTransitionEnd: function supportsTransitionEnd() { + return !!transition; + } - function Plugin(option) { - return this.each(function () { - var $this = $(this) - var data = $this.data('bs.alert') + }; - if (!data) $this.data('bs.alert', (data = new Alert(this))) - if (typeof option == 'string') data[option].call($this) - }) - } + setTransitionEndSupport(); - var old = $.fn.alert + return Util; +})(jQuery); - $.fn.alert = Plugin - $.fn.alert.Constructor = Alert +/** + * -------------------------------------------------------------------------- + * Bootstrap (v4.0.0): alert.js + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * -------------------------------------------------------------------------- + */ +var Alert = (function ($) { + + /** + * ------------------------------------------------------------------------ + * Constants + * ------------------------------------------------------------------------ + */ + + var NAME = 'alert'; + var VERSION = '4.0.0'; + var DATA_KEY = 'bs.alert'; + var JQUERY_NO_CONFLICT = $.fn[NAME]; + var TRANSITION_DURATION = 150; + + var Selector = { + DISMISS: '[data-dismiss="alert"]' + }; + + var Event = { + CLOSE: 'close.bs.alert', + CLOSED: 'closed.bs.alert', + CLICK: 'click.bs.alert.data-api' + }; + + var ClassName = { + ALERT: 'alert', + FADE: 'fade', + IN: 'in' + }; + + /** + * ------------------------------------------------------------------------ + * Class Definition + * ------------------------------------------------------------------------ + */ + + var Alert = (function () { + function Alert(element) { + _classCallCheck(this, Alert); + + this._element = element; + } - // ALERT NO CONFLICT - // ================= + _createClass(Alert, [{ + key: 'close', - $.fn.alert.noConflict = function () { - $.fn.alert = old - return this - } + // public + value: function close(element) { + element = element || this._element; - // ALERT DATA-API - // ============== + var rootElement = this._getRootElement(element); + var customEvent = this._triggerCloseEvent(rootElement); - $(document).on('click.bs.alert.data-api', dismiss, Alert.prototype.close) + if (customEvent.isDefaultPrevented()) { + return; + } -}(jQuery); + this._removeElement(rootElement); + } + }, { + key: '_getRootElement', -/* ======================================================================== - * Bootstrap: button.js v3.3.4 - * http://getbootstrap.com/javascript/#buttons - * ======================================================================== - * Copyright 2011-2015 Twitter, Inc. - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - * ======================================================================== */ + // private + value: function _getRootElement(element) { + var parent = false; + var selector = Util.getSelectorFromElement(element); -+function ($) { - 'use strict'; + if (selector) { + parent = $(selector)[0]; + } - // BUTTON PUBLIC CLASS DEFINITION - // ============================== + if (!parent) { + parent = $(element).closest('.' + ClassName.ALERT)[0]; + } - var Button = function (element, options) { - this.$element = $(element) - this.options = $.extend({}, Button.DEFAULTS, options) - this.isLoading = false - } + return parent; + } + }, { + key: '_triggerCloseEvent', + value: function _triggerCloseEvent(element) { + var closeEvent = $.Event(Event.CLOSE); + $(element).trigger(closeEvent); + return closeEvent; + } + }, { + key: '_removeElement', + value: function _removeElement(element) { + $(element).removeClass(ClassName.IN); + + if (!Util.supportsTransitionEnd() || !$(element).hasClass(ClassName.FADE)) { + this._destroyElement(element); + return; + } - Button.VERSION = '3.3.4' + $(element).one(Util.TRANSITION_END, this._destroyElement.bind(this, element)).emulateTransitionEnd(TRANSITION_DURATION); + } + }, { + key: '_destroyElement', + value: function _destroyElement(element) { + $(element).detach().trigger(Event.CLOSED).remove(); + } + }], [{ + key: 'VERSION', - Button.DEFAULTS = { - loadingText: 'loading...' - } + // getters - Button.prototype.setState = function (state) { - var d = 'disabled' - var $el = this.$element - var val = $el.is('input') ? 'val' : 'html' - var data = $el.data() + get: function () { + return VERSION; + } + }, { + key: '_jQueryInterface', - state += 'Text' + // static - if (data.resetText == null) $el.data('resetText', $el[val]()) + value: function _jQueryInterface(config) { + return this.each(function () { + var $element = $(this); + var data = $element.data(DATA_KEY); - // push to event loop to allow forms to submit - setTimeout($.proxy(function () { - $el[val](data[state] == null ? this.options[state] : data[state]) + if (!data) { + data = new Alert(this); + $element.data(DATA_KEY, data); + } - if (state == 'loadingText') { - this.isLoading = true - $el.addClass(d).attr(d, d) - } else if (this.isLoading) { - this.isLoading = false - $el.removeClass(d).removeAttr(d) + if (config === 'close') { + data[config](this); + } + }); } - }, this), 0) - } + }, { + key: '_handleDismiss', + value: function _handleDismiss(alertInstance) { + return function (event) { + if (event) { + event.preventDefault(); + } + + alertInstance.close(this); + }; + } + }]); + + return Alert; + })(); + + /** + * ------------------------------------------------------------------------ + * Data Api implementation + * ------------------------------------------------------------------------ + */ + + $(document).on(Event.CLICK, Selector.DISMISS, Alert._handleDismiss(new Alert())); + + /** + * ------------------------------------------------------------------------ + * jQuery + * ------------------------------------------------------------------------ + */ + + $.fn[NAME] = Alert._jQueryInterface; + $.fn[NAME].Constructor = Alert; + $.fn[NAME].noConflict = function () { + $.fn[NAME] = JQUERY_NO_CONFLICT; + return Alert._jQueryInterface; + }; + + return Alert; +})(jQuery); + +/** + * -------------------------------------------------------------------------- + * Bootstrap (v4.0.0): button.js + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * -------------------------------------------------------------------------- + */ - Button.prototype.toggle = function () { - var changed = true - var $parent = this.$element.closest('[data-toggle="buttons"]') - - if ($parent.length) { - var $input = this.$element.find('input') - if ($input.prop('type') == 'radio') { - if ($input.prop('checked')) changed = false - $parent.find('.active').removeClass('active') - this.$element.addClass('active') - } else if ($input.prop('type') == 'checkbox') { - if (($input.prop('checked')) !== this.$element.hasClass('active')) changed = false - this.$element.toggleClass('active') - } - $input.prop('checked', this.$element.hasClass('active')) - if (changed) $input.trigger('change') - } else { - this.$element.attr('aria-pressed', !this.$element.hasClass('active')) - this.$element.toggleClass('active') +var Button = (function ($) { + + /** + * ------------------------------------------------------------------------ + * Constants + * ------------------------------------------------------------------------ + */ + + var NAME = 'button'; + var VERSION = '4.0.0'; + var DATA_KEY = 'bs.button'; + var JQUERY_NO_CONFLICT = $.fn[NAME]; + var TRANSITION_DURATION = 150; + + var ClassName = { + ACTIVE: 'active', + BUTTON: 'btn', + FOCUS: 'focus' + }; + + var Selector = { + DATA_TOGGLE_CARROT: '[data-toggle^="button"]', + DATA_TOGGLE: '[data-toggle="buttons"]', + INPUT: 'input', + ACTIVE: '.active', + BUTTON: '.btn' + }; + + var Event = { + CLICK: 'click.bs.button.data-api', + FOCUS_BLUR: 'focus.bs.button.data-api blur.bs.button.data-api' + }; + + /** + * ------------------------------------------------------------------------ + * Class Definition + * ------------------------------------------------------------------------ + */ + + var Button = (function () { + function Button(element) { + _classCallCheck(this, Button); + + this._element = element; } - } - - // BUTTON PLUGIN DEFINITION - // ======================== + _createClass(Button, [{ + key: 'toggle', + + // public + + value: function toggle() { + var triggerChangeEvent = true; + var rootElement = $(this._element).closest(Selector.DATA_TOGGLE)[0]; + + if (rootElement) { + var input = $(this._element).find(Selector.INPUT)[0]; + + if (input) { + if (input.type === 'radio') { + if (input.checked && $(this._element).hasClass(ClassName.ACTIVE)) { + triggerChangeEvent = false; + } else { + var activeElement = $(rootElement).find(Selector.ACTIVE)[0]; + + if (activeElement) { + $(activeElement).removeClass(ClassName.ACTIVE); + } + } + } + + if (triggerChangeEvent) { + input.checked = !$(this._element).hasClass(ClassName.ACTIVE); + $(this._element).trigger('change'); + } + } + } else { + this._element.setAttribute('aria-pressed', !$(this._element).hasClass(ClassName.ACTIVE)); + } - function Plugin(option) { - return this.each(function () { - var $this = $(this) - var data = $this.data('bs.button') - var options = typeof option == 'object' && option + if (triggerChangeEvent) { + $(this._element).toggleClass(ClassName.ACTIVE); + } + } + }], [{ + key: 'VERSION', - if (!data) $this.data('bs.button', (data = new Button(this, options))) + // getters - if (option == 'toggle') data.toggle() - else if (option) data.setState(option) - }) - } + get: function () { + return VERSION; + } + }, { + key: '_jQueryInterface', - var old = $.fn.button + // static - $.fn.button = Plugin - $.fn.button.Constructor = Button + value: function _jQueryInterface(config) { + return this.each(function () { + var data = $(this).data(DATA_KEY); + if (!data) { + data = new Button(this); + $(this).data(DATA_KEY, data); + } - // BUTTON NO CONFLICT - // ================== + if (config === 'toggle') { + data[config](); + } + }); + } + }]); - $.fn.button.noConflict = function () { - $.fn.button = old - return this - } + return Button; + })(); + /** + * ------------------------------------------------------------------------ + * Data Api implementation + * ------------------------------------------------------------------------ + */ - // BUTTON DATA-API - // =============== + $(document).on(Event.CLICK, Selector.DATA_TOGGLE_CARROT, function (event) { + event.preventDefault(); - $(document) - .on('click.bs.button.data-api', '[data-toggle^="button"]', function (e) { - var $btn = $(e.target) - if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn') - Plugin.call($btn, 'toggle') - if (!($(e.target).is('input[type="radio"]') || $(e.target).is('input[type="checkbox"]'))) e.preventDefault() - }) - .on('focus.bs.button.data-api blur.bs.button.data-api', '[data-toggle^="button"]', function (e) { - $(e.target).closest('.btn').toggleClass('focus', /^focus(in)?$/.test(e.type)) - }) + var button = event.target; -}(jQuery); + if (!$(button).hasClass(ClassName.BUTTON)) { + button = $(button).closest(Selector.BUTTON); + } -/* ======================================================================== - * Bootstrap: carousel.js v3.3.4 - * http://getbootstrap.com/javascript/#carousel - * ======================================================================== - * Copyright 2011-2015 Twitter, Inc. + Button._jQueryInterface.call($(button), 'toggle'); + }).on(Event.FOCUS_BLUR, Selector.DATA_TOGGLE_CARROT, function (event) { + var button = $(event.target).closest(Selector.BUTTON)[0]; + $(button).toggleClass(ClassName.FOCUS, /^focus(in)?$/.test(event.type)); + }); + + /** + * ------------------------------------------------------------------------ + * jQuery + * ------------------------------------------------------------------------ + */ + + $.fn[NAME] = Button._jQueryInterface; + $.fn[NAME].Constructor = Button; + $.fn[NAME].noConflict = function () { + $.fn[NAME] = JQUERY_NO_CONFLICT; + return Button._jQueryInterface; + }; + + return Button; +})(jQuery); + +/** + * -------------------------------------------------------------------------- + * Bootstrap (v4.0.0): carousel.js * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - * ======================================================================== */ - + * -------------------------------------------------------------------------- + */ -+function ($) { - 'use strict'; - - // CAROUSEL CLASS DEFINITION - // ========================= - - var Carousel = function (element, options) { - this.$element = $(element) - this.$indicators = this.$element.find('.carousel-indicators') - this.options = options - this.paused = null - this.sliding = null - this.interval = null - this.$active = null - this.$items = null - - this.options.keyboard && this.$element.on('keydown.bs.carousel', $.proxy(this.keydown, this)) - - this.options.pause == 'hover' && !('ontouchstart' in document.documentElement) && this.$element - .on('mouseenter.bs.carousel', $.proxy(this.pause, this)) - .on('mouseleave.bs.carousel', $.proxy(this.cycle, this)) - } +var Carousel = (function ($) { - Carousel.VERSION = '3.3.4' + /** + * ------------------------------------------------------------------------ + * Constants + * ------------------------------------------------------------------------ + */ - Carousel.TRANSITION_DURATION = 600 + var NAME = 'carousel'; + var VERSION = '4.0.0'; + var DATA_KEY = 'bs.carousel'; + var JQUERY_NO_CONFLICT = $.fn[NAME]; + var TRANSITION_DURATION = 600; - Carousel.DEFAULTS = { + var Default = { interval: 5000, + keyboard: true, + slide: false, pause: 'hover', - wrap: true, - keyboard: true - } - - Carousel.prototype.keydown = function (e) { - if (/input|textarea/i.test(e.target.tagName)) return - switch (e.which) { - case 37: this.prev(); break - case 39: this.next(); break - default: return + wrap: true + }; + + var Direction = { + NEXT: 'next', + PREVIOUS: 'prev' + }; + + var Event = { + SLIDE: 'slide.bs.carousel', + SLID: 'slid.bs.carousel', + CLICK: 'click.bs.carousel.data-api', + LOAD: 'load' + }; + + var ClassName = { + CAROUSEL: 'carousel', + ACTIVE: 'active', + SLIDE: 'slide', + RIGHT: 'right', + LEFT: 'left', + ITEM: 'carousel-item' + }; + + var Selector = { + ACTIVE: '.active', + ACTIVE_ITEM: '.active.carousel-item', + ITEM: '.carousel-item', + NEXT_PREV: '.next, .prev', + INDICATORS: '.carousel-indicators', + DATA_SLIDE: '[data-slide], [data-slide-to]', + DATA_RIDE: '[data-ride="carousel"]' + }; + + /** + * ------------------------------------------------------------------------ + * Class Definition + * ------------------------------------------------------------------------ + */ + + var Carousel = (function () { + function Carousel(element, config) { + _classCallCheck(this, Carousel); + + this._items = null; + this._interval = null; + this._activeElement = null; + + this._isPaused = false; + this._isSliding = false; + + this._config = config; + this._element = $(element)[0]; + this._indicatorsElement = $(this._element).find(Selector.INDICATORS)[0]; + + this._addEventListeners(); } - e.preventDefault() - } + _createClass(Carousel, [{ + key: 'next', - Carousel.prototype.cycle = function (e) { - e || (this.paused = false) + // public - this.interval && clearInterval(this.interval) + value: function next() { + if (!this._isSliding) { + this._slide(Direction.NEXT); + } + } + }, { + key: 'prev', + value: function prev() { + if (!this._isSliding) { + this._slide(Direction.PREVIOUS); + } + } + }, { + key: 'pause', + value: function pause(event) { + if (!event) { + this._isPaused = true; + } - this.options.interval - && !this.paused - && (this.interval = setInterval($.proxy(this.next, this), this.options.interval)) + if ($(this._element).find(Selector.NEXT_PREV)[0] && Util.supportsTransitionEnd()) { + Util.triggerTransitionEnd(this._element); + this.cycle(true); + } - return this - } + clearInterval(this._interval); + this._interval = null; + } + }, { + key: 'cycle', + value: function cycle(event) { + if (!event) { + this._isPaused = false; + } - Carousel.prototype.getItemIndex = function (item) { - this.$items = item.parent().children('.item') - return this.$items.index(item || this.$active) - } + if (this._interval) { + clearInterval(this._interval); + this._interval = null; + } - Carousel.prototype.getItemForDirection = function (direction, active) { - var activeIndex = this.getItemIndex(active) - var willWrap = (direction == 'prev' && activeIndex === 0) - || (direction == 'next' && activeIndex == (this.$items.length - 1)) - if (willWrap && !this.options.wrap) return active - var delta = direction == 'prev' ? -1 : 1 - var itemIndex = (activeIndex + delta) % this.$items.length - return this.$items.eq(itemIndex) - } + if (this._config.interval && !this._isPaused) { + this._interval = setInterval(this.next.bind(this), this._config.interval); + } + } + }, { + key: 'to', + value: function to(index) { + var _this2 = this; - Carousel.prototype.to = function (pos) { - var that = this - var activeIndex = this.getItemIndex(this.$active = this.$element.find('.item.active')) + this._activeElement = $(this._element).find(Selector.ACTIVE_ITEM)[0]; - if (pos > (this.$items.length - 1) || pos < 0) return + var activeIndex = this._getItemIndex(this._activeElement); - if (this.sliding) return this.$element.one('slid.bs.carousel', function () { that.to(pos) }) // yes, "slid" - if (activeIndex == pos) return this.pause().cycle() + if (index > this._items.length - 1 || index < 0) { + return; + } - return this.slide(pos > activeIndex ? 'next' : 'prev', this.$items.eq(pos)) - } + if (this._isSliding) { + $(this._element).one(Event.SLID, function () { + return _this2.to(index); + }); + return; + } - Carousel.prototype.pause = function (e) { - e || (this.paused = true) + if (activeIndex == index) { + this.pause(); + this.cycle(); + return; + } - if (this.$element.find('.next, .prev').length && $.support.transition) { - this.$element.trigger($.support.transition.end) - this.cycle(true) - } + var direction = index > activeIndex ? Direction.NEXT : Direction.PREVIOUS; - this.interval = clearInterval(this.interval) + this._slide(direction, this._items[index]); + } + }, { + key: '_addEventListeners', - return this - } + // private - Carousel.prototype.next = function () { - if (this.sliding) return - return this.slide('next') - } + value: function _addEventListeners() { + if (this._config.keyboard) { + $(this._element).on('keydown.bs.carousel', this._keydown.bind(this)); + } - Carousel.prototype.prev = function () { - if (this.sliding) return - return this.slide('prev') - } + if (this._config.pause == 'hover' && !('ontouchstart' in document.documentElement)) { + $(this._element).on('mouseenter.bs.carousel', this.pause.bind(this)).on('mouseleave.bs.carousel', this.cycle.bind(this)); + } + } + }, { + key: '_keydown', + value: function _keydown(event) { + event.preventDefault(); + + if (/input|textarea/i.test(event.target.tagName)) return; + + switch (event.which) { + case 37: + this.prev();break; + case 39: + this.next();break; + default: + return; + } + } + }, { + key: '_getItemIndex', + value: function _getItemIndex(element) { + this._items = $.makeArray($(element).parent().find(Selector.ITEM)); + return this._items.indexOf(element); + } + }, { + key: '_getItemByDirection', + value: function _getItemByDirection(direction, activeElement) { + var isNextDirection = direction === Direction.NEXT; + var isPrevDirection = direction === Direction.PREVIOUS; + var activeIndex = this._getItemIndex(activeElement); + var lastItemIndex = this._items.length - 1; + var isGoingToWrap = isPrevDirection && activeIndex === 0 || isNextDirection && activeIndex == lastItemIndex; + + if (isGoingToWrap && !this._config.wrap) { + return activeElement; + } - Carousel.prototype.slide = function (type, next) { - var $active = this.$element.find('.item.active') - var $next = next || this.getItemForDirection(type, $active) - var isCycling = this.interval - var direction = type == 'next' ? 'left' : 'right' - var that = this + var delta = direction == Direction.PREVIOUS ? -1 : 1; + var itemIndex = (activeIndex + delta) % this._items.length; - if ($next.hasClass('active')) return (this.sliding = false) + return itemIndex === -1 ? this._items[this._items.length - 1] : this._items[itemIndex]; + } + }, { + key: '_triggerSlideEvent', + value: function _triggerSlideEvent(relatedTarget, directionalClassname) { + var slideEvent = $.Event(Event.SLIDE, { + relatedTarget: relatedTarget, + direction: directionalClassname + }); - var relatedTarget = $next[0] - var slideEvent = $.Event('slide.bs.carousel', { - relatedTarget: relatedTarget, - direction: direction - }) - this.$element.trigger(slideEvent) - if (slideEvent.isDefaultPrevented()) return + $(this._element).trigger(slideEvent); - this.sliding = true + return slideEvent; + } + }, { + key: '_setActiveIndicatorElement', + value: function _setActiveIndicatorElement(element) { + if (this._indicatorsElement) { + $(this._indicatorsElement).find(Selector.ACTIVE).removeClass(ClassName.ACTIVE); - isCycling && this.pause() + var nextIndicator = this._indicatorsElement.children[this._getItemIndex(element)]; - if (this.$indicators.length) { - this.$indicators.find('.active').removeClass('active') - var $nextIndicator = $(this.$indicators.children()[this.getItemIndex($next)]) - $nextIndicator && $nextIndicator.addClass('active') - } + if (nextIndicator) { + $(nextIndicator).addClass(ClassName.ACTIVE); + } + } + } + }, { + key: '_slide', + value: function _slide(direction, element) { + var _this3 = this; - var slidEvent = $.Event('slid.bs.carousel', { relatedTarget: relatedTarget, direction: direction }) // yes, "slid" - if ($.support.transition && this.$element.hasClass('slide')) { - $next.addClass(type) - $next[0].offsetWidth // force reflow - $active.addClass(direction) - $next.addClass(direction) - $active - .one('bsTransitionEnd', function () { - $next.removeClass([type, direction].join(' ')).addClass('active') - $active.removeClass(['active', direction].join(' ')) - that.sliding = false - setTimeout(function () { - that.$element.trigger(slidEvent) - }, 0) - }) - .emulateTransitionEnd(Carousel.TRANSITION_DURATION) - } else { - $active.removeClass('active') - $next.addClass('active') - this.sliding = false - this.$element.trigger(slidEvent) - } + var activeElement = $(this._element).find(Selector.ACTIVE_ITEM)[0]; + var nextElement = element || activeElement && this._getItemByDirection(direction, activeElement); - isCycling && this.cycle() + var isCycling = !!this._interval; - return this - } + var directionalClassName = direction == Direction.NEXT ? ClassName.LEFT : ClassName.RIGHT; + if (nextElement && $(nextElement).hasClass(ClassName.ACTIVE)) { + this._isSliding = false; + return; + } - // CAROUSEL PLUGIN DEFINITION - // ========================== + var slideEvent = this._triggerSlideEvent(nextElement, directionalClassName); + if (slideEvent.isDefaultPrevented()) { + return; + } - function Plugin(option) { - return this.each(function () { - var $this = $(this) - var data = $this.data('bs.carousel') - var options = $.extend({}, Carousel.DEFAULTS, $this.data(), typeof option == 'object' && option) - var action = typeof option == 'string' ? option : options.slide + if (!activeElement || !nextElement) { + // some weirdness is happening, so we bail + return; + } - if (!data) $this.data('bs.carousel', (data = new Carousel(this, options))) - if (typeof option == 'number') data.to(option) - else if (action) data[action]() - else if (options.interval) data.pause().cycle() - }) - } + this._isSliding = true; - var old = $.fn.carousel + if (isCycling) { + this.pause(); + } - $.fn.carousel = Plugin - $.fn.carousel.Constructor = Carousel + this._setActiveIndicatorElement(nextElement); + var slidEvent = $.Event(Event.SLID, { + relatedTarget: nextElement, + direction: directionalClassName + }); - // CAROUSEL NO CONFLICT - // ==================== + if (Util.supportsTransitionEnd() && $(this._element).hasClass(ClassName.SLIDE)) { - $.fn.carousel.noConflict = function () { - $.fn.carousel = old - return this - } + $(nextElement).addClass(direction); + Util.reflow(nextElement); - // CAROUSEL DATA-API - // ================= + $(activeElement).addClass(directionalClassName); + $(nextElement).addClass(directionalClassName); - var clickHandler = function (e) { - var href - var $this = $(this) - var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) // strip for ie7 - if (!$target.hasClass('carousel')) return - var options = $.extend({}, $target.data(), $this.data()) - var slideIndex = $this.attr('data-slide-to') - if (slideIndex) options.interval = false + $(activeElement).one(Util.TRANSITION_END, function () { + $(nextElement).removeClass(directionalClassName).removeClass(direction); - Plugin.call($target, options) + $(nextElement).addClass(ClassName.ACTIVE); - if (slideIndex) { - $target.data('bs.carousel').to(slideIndex) - } + $(activeElement).removeClass(ClassName.ACTIVE).removeClass(direction).removeClass(directionalClassName); - e.preventDefault() - } + _this3._isSliding = false; - $(document) - .on('click.bs.carousel.data-api', '[data-slide]', clickHandler) - .on('click.bs.carousel.data-api', '[data-slide-to]', clickHandler) + setTimeout(function () { + return $(_this3._element).trigger(slidEvent); + }, 0); + }).emulateTransitionEnd(TRANSITION_DURATION); + } else { + $(activeElement).removeClass(ClassName.ACTIVE); + $(nextElement).addClass(ClassName.ACTIVE); - $(window).on('load', function () { - $('[data-ride="carousel"]').each(function () { - var $carousel = $(this) - Plugin.call($carousel, $carousel.data()) - }) - }) + this._isSliding = false; + $(this._element).trigger(slidEvent); + } -}(jQuery); + if (isCycling) { + this.cycle(); + } + } + }], [{ + key: 'VERSION', -/* ======================================================================== - * Bootstrap: collapse.js v3.3.4 - * http://getbootstrap.com/javascript/#collapse - * ======================================================================== - * Copyright 2011-2015 Twitter, Inc. - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - * ======================================================================== */ + // getters + get: function () { + return VERSION; + } + }, { + key: 'Default', + get: function () { + return Default; + } + }, { + key: '_jQueryInterface', + + // static + + value: function _jQueryInterface(config) { + return this.each(function () { + var data = $(this).data(DATA_KEY); + var _config = $.extend({}, Default, $(this).data()); + + if (typeof config === 'object') { + $.extend(_config, config); + } + + var action = typeof config === 'string' ? config : _config.slide; + + if (!data) { + data = new Carousel(this, _config); + $(this).data(DATA_KEY, data); + } + + if (typeof config == 'number') { + data.to(config); + } else if (action) { + data[action](); + } else if (_config.interval) { + data.pause(); + data.cycle(); + } + }); + } + }, { + key: '_dataApiClickHandler', + value: function _dataApiClickHandler(event) { + var selector = Util.getSelectorFromElement(this); -+function ($) { - 'use strict'; - - // COLLAPSE PUBLIC CLASS DEFINITION - // ================================ - - var Collapse = function (element, options) { - this.$element = $(element) - this.options = $.extend({}, Collapse.DEFAULTS, options) - this.$trigger = $('[data-toggle="collapse"][href="#' + element.id + '"],' + - '[data-toggle="collapse"][data-target="#' + element.id + '"]') - this.transitioning = null - - if (this.options.parent) { - this.$parent = this.getParent() - } else { - this.addAriaAndCollapsedClass(this.$element, this.$trigger) - } + if (!selector) { + return; + } - if (this.options.toggle) this.toggle() - } + var target = $(selector)[0]; - Collapse.VERSION = '3.3.4' + if (!target || !$(target).hasClass(ClassName.CAROUSEL)) { + return; + } - Collapse.TRANSITION_DURATION = 350 + var config = $.extend({}, $(target).data(), $(this).data()); - Collapse.DEFAULTS = { - toggle: true - } + var slideIndex = this.getAttribute('data-slide-to'); + if (slideIndex) { + config.interval = false; + } - Collapse.prototype.dimension = function () { - var hasWidth = this.$element.hasClass('width') - return hasWidth ? 'width' : 'height' - } + Carousel._jQueryInterface.call($(target), config); + + if (slideIndex) { + $(target).data(DATA_KEY).to(slideIndex); + } - Collapse.prototype.show = function () { - if (this.transitioning || this.$element.hasClass('in')) return + event.preventDefault(); + } + }]); + + return Carousel; + })(); + + /** + * ------------------------------------------------------------------------ + * Data Api implementation + * ------------------------------------------------------------------------ + */ + + $(document).on(Event.CLICK, Selector.DATA_SLIDE, Carousel._dataApiClickHandler); + + $(window).on(Event.LOAD, function () { + $(Selector.DATA_RIDE).each(function () { + var $carousel = $(this); + Carousel._jQueryInterface.call($carousel, $carousel.data()); + }); + }); + + /** + * ------------------------------------------------------------------------ + * jQuery + * ------------------------------------------------------------------------ + */ + + $.fn[NAME] = Carousel._jQueryInterface; + $.fn[NAME].Constructor = Carousel; + $.fn[NAME].noConflict = function () { + $.fn[NAME] = JQUERY_NO_CONFLICT; + return Carousel._jQueryInterface; + }; + + return Carousel; +})(jQuery); + +/** + * -------------------------------------------------------------------------- + * Bootstrap (v4.0.0): collapse.js + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * -------------------------------------------------------------------------- + */ - var activesData - var actives = this.$parent && this.$parent.children('.panel').children('.in, .collapsing') +var Collapse = (function ($) { + + /** + * ------------------------------------------------------------------------ + * Constants + * ------------------------------------------------------------------------ + */ + + var NAME = 'collapse'; + var VERSION = '4.0.0'; + var DATA_KEY = 'bs.collapse'; + var JQUERY_NO_CONFLICT = $.fn[NAME]; + var TRANSITION_DURATION = 600; + + var Default = { + toggle: true, + parent: null + }; + + var Event = { + SHOW: 'show.bs.collapse', + SHOWN: 'shown.bs.collapse', + HIDE: 'hide.bs.collapse', + HIDDEN: 'hidden.bs.collapse', + CLICK: 'click.bs.collapse.data-api' + }; + + var ClassName = { + IN: 'in', + COLLAPSE: 'collapse', + COLLAPSING: 'collapsing', + COLLAPSED: 'collapsed' + }; + + var Dimension = { + WIDTH: 'width', + HEIGHT: 'height' + }; + + var Selector = { + ACTIVES: '.panel > .in, .panel > .collapsing', + DATA_TOGGLE: '[data-toggle="collapse"]' + }; + + /** + * ------------------------------------------------------------------------ + * Class Definition + * ------------------------------------------------------------------------ + */ + + var Collapse = (function () { + function Collapse(element, config) { + _classCallCheck(this, Collapse); + + this._isTransitioning = false; + this._element = element; + this._config = $.extend({}, Default, config); + this._triggerArray = $.makeArray($('[data-toggle="collapse"][href="#' + element.id + '"],' + ('[data-toggle="collapse"][data-target="#' + element.id + '"]'))); + + this._parent = this._config.parent ? this._getParent() : null; + + if (!this._config.parent) { + this._addAriaAndCollapsedClass(this._element, this._triggerArray); + } - if (actives && actives.length) { - activesData = actives.data('bs.collapse') - if (activesData && activesData.transitioning) return + if (this._config.toggle) { + this.toggle(); + } } - var startEvent = $.Event('show.bs.collapse') - this.$element.trigger(startEvent) - if (startEvent.isDefaultPrevented()) return + _createClass(Collapse, [{ + key: 'toggle', - if (actives && actives.length) { - Plugin.call(actives, 'hide') - activesData || actives.data('bs.collapse', null) - } + // public - var dimension = this.dimension() + value: function toggle() { + if ($(this._element).hasClass(ClassName.IN)) { + this.hide(); + } else { + this.show(); + } + } + }, { + key: 'show', + value: function show() { + var _this4 = this; - this.$element - .removeClass('collapse') - .addClass('collapsing')[dimension](0) - .attr('aria-expanded', true) + if (this._isTransitioning || $(this._element).hasClass(ClassName.IN)) { + return; + } - this.$trigger - .removeClass('collapsed') - .attr('aria-expanded', true) + var activesData = undefined; + var actives = undefined; - this.transitioning = 1 + if (this._parent) { + actives = $.makeArray($(Selector.ACTIVES)); + if (!actives.length) { + actives = null; + } + } - var complete = function () { - this.$element - .removeClass('collapsing') - .addClass('collapse in')[dimension]('') - this.transitioning = 0 - this.$element - .trigger('shown.bs.collapse') - } + if (actives) { + activesData = $(actives).data(DATA_KEY); + if (activesData && activesData._isTransitioning) { + return; + } + } - if (!$.support.transition) return complete.call(this) + var startEvent = $.Event(Event.SHOW); + $(this._element).trigger(startEvent); + if (startEvent.isDefaultPrevented()) { + return; + } - var scrollSize = $.camelCase(['scroll', dimension].join('-')) + if (actives) { + Collapse._jQueryInterface.call($(actives), 'hide'); + if (!activesData) { + $(actives).data(DATA_KEY, null); + } + } - this.$element - .one('bsTransitionEnd', $.proxy(complete, this)) - .emulateTransitionEnd(Collapse.TRANSITION_DURATION)[dimension](this.$element[0][scrollSize]) - } + var dimension = this._getDimension(); - Collapse.prototype.hide = function () { - if (this.transitioning || !this.$element.hasClass('in')) return + $(this._element).removeClass(ClassName.COLLAPSE).addClass(ClassName.COLLAPSING); - var startEvent = $.Event('hide.bs.collapse') - this.$element.trigger(startEvent) - if (startEvent.isDefaultPrevented()) return + this._element.style[dimension] = 0; + this._element.setAttribute('aria-expanded', true); - var dimension = this.dimension() + if (this._triggerArray.length) { + $(this._triggerArray).removeClass(ClassName.COLLAPSED).attr('aria-expanded', true); + } - this.$element[dimension](this.$element[dimension]())[0].offsetHeight + this.setTransitioning(true); - this.$element - .addClass('collapsing') - .removeClass('collapse in') - .attr('aria-expanded', false) + var complete = function complete() { + $(_this4._element).removeClass(ClassName.COLLAPSING).addClass(ClassName.COLLAPSE).addClass(ClassName.IN); - this.$trigger - .addClass('collapsed') - .attr('aria-expanded', false) + _this4._element.style[dimension] = ''; - this.transitioning = 1 + _this4.setTransitioning(false); - var complete = function () { - this.transitioning = 0 - this.$element - .removeClass('collapsing') - .addClass('collapse') - .trigger('hidden.bs.collapse') - } + $(_this4._element).trigger(Event.SHOWN); + }; - if (!$.support.transition) return complete.call(this) + if (!Util.supportsTransitionEnd()) { + complete(); + return; + } - this.$element - [dimension](0) - .one('bsTransitionEnd', $.proxy(complete, this)) - .emulateTransitionEnd(Collapse.TRANSITION_DURATION) - } + var scrollSize = 'scroll' + (dimension[0].toUpperCase() + dimension.slice(1)); - Collapse.prototype.toggle = function () { - this[this.$element.hasClass('in') ? 'hide' : 'show']() - } + $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(TRANSITION_DURATION); - Collapse.prototype.getParent = function () { - return $(this.options.parent) - .find('[data-toggle="collapse"][data-parent="' + this.options.parent + '"]') - .each($.proxy(function (i, element) { - var $element = $(element) - this.addAriaAndCollapsedClass(getTargetFromTrigger($element), $element) - }, this)) - .end() - } + this._element.style[dimension] = this._element[scrollSize] + 'px'; + } + }, { + key: 'hide', + value: function hide() { + var _this5 = this; - Collapse.prototype.addAriaAndCollapsedClass = function ($element, $trigger) { - var isOpen = $element.hasClass('in') + if (this._isTransitioning || !$(this._element).hasClass(ClassName.IN)) { + return; + } - $element.attr('aria-expanded', isOpen) - $trigger - .toggleClass('collapsed', !isOpen) - .attr('aria-expanded', isOpen) - } + var startEvent = $.Event(Event.HIDE); + $(this._element).trigger(startEvent); + if (startEvent.isDefaultPrevented()) { + return; + } - function getTargetFromTrigger($trigger) { - var href - var target = $trigger.attr('data-target') - || (href = $trigger.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') // strip for ie7 + var dimension = this._getDimension(); + var offsetDimension = dimension === Dimension.WIDTH ? 'offsetWidth' : 'offsetHeight'; - return $(target) - } + this._element.style[dimension] = this._element[offsetDimension] + 'px'; + Util.reflow(this._element); - // COLLAPSE PLUGIN DEFINITION - // ========================== + $(this._element).addClass(ClassName.COLLAPSING).removeClass(ClassName.COLLAPSE).removeClass(ClassName.IN); - function Plugin(option) { - return this.each(function () { - var $this = $(this) - var data = $this.data('bs.collapse') - var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option) + this._element.setAttribute('aria-expanded', false); - if (!data && options.toggle && /show|hide/.test(option)) options.toggle = false - if (!data) $this.data('bs.collapse', (data = new Collapse(this, options))) - if (typeof option == 'string') data[option]() - }) - } + if (this._triggerArray.length) { + $(this._triggerArray).addClass(ClassName.COLLAPSED).attr('aria-expanded', false); + } - var old = $.fn.collapse + this.setTransitioning(true); - $.fn.collapse = Plugin - $.fn.collapse.Constructor = Collapse + var complete = function complete() { + _this5.setTransitioning(false); + $(_this5._element).removeClass(ClassName.COLLAPSING).addClass(ClassName.COLLAPSE).trigger(Event.HIDDEN); + }; + this._element.style[dimension] = 0; - // COLLAPSE NO CONFLICT - // ==================== + if (!Util.supportsTransitionEnd()) { + return complete(); + } - $.fn.collapse.noConflict = function () { - $.fn.collapse = old - return this - } + $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(TRANSITION_DURATION); + } + }, { + key: 'setTransitioning', + value: function setTransitioning(isTransitioning) { + this._isTransitioning = isTransitioning; + } + }, { + key: '_getDimension', + // private - // COLLAPSE DATA-API - // ================= + value: function _getDimension() { + var hasWidth = $(this._element).hasClass(Dimension.WIDTH); + return hasWidth ? Dimension.WIDTH : Dimension.HEIGHT; + } + }, { + key: '_getParent', + value: function _getParent() { + var _this6 = this; - $(document).on('click.bs.collapse.data-api', '[data-toggle="collapse"]', function (e) { - var $this = $(this) + var parent = $(this._config.parent)[0]; + var selector = '[data-toggle="collapse"][data-parent="' + this._config.parent + '"]'; - if (!$this.attr('data-target')) e.preventDefault() + $(parent).find(selector).each(function (i, element) { + _this6._addAriaAndCollapsedClass(Collapse._getTargetFromElement(element), [element]); + }); - var $target = getTargetFromTrigger($this) - var data = $target.data('bs.collapse') - var option = data ? 'toggle' : $this.data() + return parent; + } + }, { + key: '_addAriaAndCollapsedClass', + value: function _addAriaAndCollapsedClass(element, triggerArray) { + if (element) { + var isOpen = $(element).hasClass(ClassName.IN); + element.setAttribute('aria-expanded', isOpen); + + if (triggerArray.length) { + $(triggerArray).toggleClass(ClassName.COLLAPSED, !isOpen).attr('aria-expanded', isOpen); + } + } + } + }], [{ + key: 'VERSION', - Plugin.call($target, option) - }) + // getters -}(jQuery); + get: function () { + return VERSION; + } + }, { + key: 'Default', + get: function () { + return Default; + } + }, { + key: '_getTargetFromElement', -/* ======================================================================== - * Bootstrap: dropdown.js v3.3.4 - * http://getbootstrap.com/javascript/#dropdowns - * ======================================================================== - * Copyright 2011-2015 Twitter, Inc. - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - * ======================================================================== */ + // static + value: function _getTargetFromElement(element) { + var selector = Util.getSelectorFromElement(element); + return selector ? $(selector)[0] : null; + } + }, { + key: '_jQueryInterface', + value: function _jQueryInterface(config) { + return this.each(function () { + var $this = $(this); + var data = $this.data(DATA_KEY); + var _config = $.extend({}, Default, $this.data(), typeof config === 'object' && config); + + if (!data && _config.toggle && /show|hide/.test(config)) { + _config.toggle = false; + } + + if (!data) { + data = new Collapse(this, _config); + $this.data(DATA_KEY, data); + } + + if (typeof config === 'string') { + data[config](); + } + }); + } + }]); -+function ($) { - 'use strict'; + return Collapse; + })(); - // DROPDOWN CLASS DEFINITION - // ========================= + /** + * ------------------------------------------------------------------------ + * Data Api implementation + * ------------------------------------------------------------------------ + */ - var backdrop = '.dropdown-backdrop' - var toggle = '[data-toggle="dropdown"]' - var Dropdown = function (element) { - $(element).on('click.bs.dropdown', this.toggle) - } + $(document).on(Event.CLICK, Selector.DATA_TOGGLE, function (event) { + event.preventDefault(); - Dropdown.VERSION = '3.3.4' + var target = Collapse._getTargetFromElement(this); - function getParent($this) { - var selector = $this.attr('data-target') + var data = $(target).data(DATA_KEY); + var config = data ? 'toggle' : $(this).data(); - if (!selector) { - selector = $this.attr('href') - selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7 - } + Collapse._jQueryInterface.call($(target), config); + }); - var $parent = selector && $(selector) + /** + * ------------------------------------------------------------------------ + * jQuery + * ------------------------------------------------------------------------ + */ - return $parent && $parent.length ? $parent : $this.parent() - } + $.fn[NAME] = Collapse._jQueryInterface; + $.fn[NAME].Constructor = Collapse; + $.fn[NAME].noConflict = function () { + $.fn[NAME] = JQUERY_NO_CONFLICT; + return Collapse._jQueryInterface; + }; + + return Collapse; +})(jQuery); - function clearMenus(e) { - if (e && e.which === 3) return - $(backdrop).remove() - $(toggle).each(function () { - var $this = $(this) - var $parent = getParent($this) - var relatedTarget = { relatedTarget: this } +/** + * -------------------------------------------------------------------------- + * Bootstrap (v4.0.0): dropdown.js + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * -------------------------------------------------------------------------- + */ - if (!$parent.hasClass('open')) return +var Dropdown = (function ($) { + + /** + * ------------------------------------------------------------------------ + * Constants + * ------------------------------------------------------------------------ + */ + + var NAME = 'dropdown'; + var VERSION = '4.0.0'; + var DATA_KEY = 'bs.dropdown'; + var JQUERY_NO_CONFLICT = $.fn[NAME]; + + var Event = { + HIDE: 'hide.bs.dropdown', + HIDDEN: 'hidden.bs.dropdown', + SHOW: 'show.bs.dropdown', + SHOWN: 'shown.bs.dropdown', + CLICK: 'click.bs.dropdown', + KEYDOWN: 'keydown.bs.dropdown.data-api', + CLICK_DATA: 'click.bs.dropdown.data-api' + }; + + var ClassName = { + BACKDROP: 'dropdown-backdrop', + DISABLED: 'disabled', + OPEN: 'open' + }; + + var Selector = { + BACKDROP: '.dropdown-backdrop', + DATA_TOGGLE: '[data-toggle="dropdown"]', + FORM_CHILD: '.dropdown form', + ROLE_MENU: '[role="menu"]', + ROLE_LISTBOX: '[role="listbox"]', + NAVBAR_NAV: '.navbar-nav', + VISIBLE_ITEMS: '[role="menu"] li:not(.disabled) a, ' + '[role="listbox"] li:not(.disabled) a' + }; + + /** + * ------------------------------------------------------------------------ + * Class Definition + * ------------------------------------------------------------------------ + */ + + var Dropdown = (function () { + function Dropdown(element) { + _classCallCheck(this, Dropdown); + + $(element).on(Event.CLICK, this.toggle); + } - if (e && e.type == 'click' && /input|textarea/i.test(e.target.tagName) && $.contains($parent[0], e.target)) return + _createClass(Dropdown, [{ + key: 'toggle', - $parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget)) + // public - if (e.isDefaultPrevented()) return + value: function toggle() { + if (this.disabled || $(this).hasClass(ClassName.DISABLED)) { + return; + } - $this.attr('aria-expanded', 'false') - $parent.removeClass('open').trigger('hidden.bs.dropdown', relatedTarget) - }) - } + var parent = Dropdown._getParentFromElement(this); + var isActive = $(parent).hasClass(ClassName.OPEN); - Dropdown.prototype.toggle = function (e) { - var $this = $(this) + Dropdown._clearMenus(); - if ($this.is('.disabled, :disabled')) return + if (isActive) { + return false; + } - var $parent = getParent($this) - var isActive = $parent.hasClass('open') + if ('ontouchstart' in document.documentElement && !$(parent).closest(Selector.NAVBAR_NAV).length) { - clearMenus() + // if mobile we use a backdrop because click events don't delegate + var dropdown = document.createElement('div'); + dropdown.className = ClassName.BACKDROP; + $(dropdown).insertBefore(this); + $(dropdown).on('click', Dropdown._clearMenus); + } - if (!isActive) { - if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) { - // if mobile we use a backdrop because click events don't delegate - $(document.createElement('div')) - .addClass('dropdown-backdrop') - .insertAfter($(this)) - .on('click', clearMenus) - } + var relatedTarget = { relatedTarget: this }; + var showEvent = $.Event(Event.SHOW, relatedTarget); - var relatedTarget = { relatedTarget: this } - $parent.trigger(e = $.Event('show.bs.dropdown', relatedTarget)) + $(parent).trigger(showEvent); - if (e.isDefaultPrevented()) return + if (showEvent.isDefaultPrevented()) { + return; + } - $this - .trigger('focus') - .attr('aria-expanded', 'true') + this.focus(); + this.setAttribute('aria-expanded', 'true'); - $parent - .toggleClass('open') - .trigger('shown.bs.dropdown', relatedTarget) - } + $(parent).toggleClass(ClassName.OPEN); + $(parent).trigger(Event.SHOWN, relatedTarget); - return false - } + return false; + } + }], [{ + key: 'VERSION', - Dropdown.prototype.keydown = function (e) { - if (!/(38|40|27|32)/.test(e.which) || /input|textarea/i.test(e.target.tagName)) return + // getters - var $this = $(this) + get: function () { + return VERSION; + } + }, { + key: '_jQueryInterface', - e.preventDefault() - e.stopPropagation() + // static - if ($this.is('.disabled, :disabled')) return + value: function _jQueryInterface(config) { + return this.each(function () { + var data = $(this).data(DATA_KEY); - var $parent = getParent($this) - var isActive = $parent.hasClass('open') + if (!data) { + $(this).data(DATA_KEY, data = new Dropdown(this)); + } - if (!isActive && e.which != 27 || isActive && e.which == 27) { - if (e.which == 27) $parent.find(toggle).trigger('focus') - return $this.trigger('click') - } + if (typeof config === 'string') { + data[config].call(this); + } + }); + } + }, { + key: '_clearMenus', + value: function _clearMenus(event) { + if (event && event.which === 3) { + return; + } - var desc = ' li:not(.disabled):visible a' - var $items = $parent.find('[role="menu"]' + desc + ', [role="listbox"]' + desc) + var backdrop = $(Selector.BACKDROP)[0]; + if (backdrop) { + backdrop.parentNode.removeChild(backdrop); + } - if (!$items.length) return + var toggles = $.makeArray($(Selector.DATA_TOGGLE)); - var index = $items.index(e.target) + for (var i = 0; i < toggles.length; i++) { + var _parent = Dropdown._getParentFromElement(toggles[i]); + var relatedTarget = { relatedTarget: toggles[i] }; - if (e.which == 38 && index > 0) index-- // up - if (e.which == 40 && index < $items.length - 1) index++ // down - if (!~index) index = 0 + if (!$(_parent).hasClass(ClassName.OPEN)) { + continue; + } - $items.eq(index).trigger('focus') - } + if (event && event.type === 'click' && /input|textarea/i.test(event.target.tagName) && $.contains(_parent, event.target)) { + continue; + } + var hideEvent = $.Event(Event.HIDE, relatedTarget); + $(_parent).trigger(hideEvent); + if (hideEvent.isDefaultPrevented()) { + continue; + } - // DROPDOWN PLUGIN DEFINITION - // ========================== + toggles[i].setAttribute('aria-expanded', 'false'); - function Plugin(option) { - return this.each(function () { - var $this = $(this) - var data = $this.data('bs.dropdown') + $(_parent).removeClass(ClassName.OPEN).trigger(Event.HIDDEN, relatedTarget); + } + } + }, { + key: '_getParentFromElement', + value: function _getParentFromElement(element) { + var parent = undefined; + var selector = Util.getSelectorFromElement(element); + + if (selector) { + parent = $(selector)[0]; + } - if (!data) $this.data('bs.dropdown', (data = new Dropdown(this))) - if (typeof option == 'string') data[option].call($this) - }) - } + return parent || element.parentNode; + } + }, { + key: '_dataApiKeydownHandler', + value: function _dataApiKeydownHandler(event) { + if (!/(38|40|27|32)/.test(event.which) || /input|textarea/i.test(event.target.tagName)) { + return; + } - var old = $.fn.dropdown + event.preventDefault(); + event.stopPropagation(); - $.fn.dropdown = Plugin - $.fn.dropdown.Constructor = Dropdown + if (this.disabled || $(this).hasClass(ClassName.DISABLED)) { + return; + } + var parent = Dropdown._getParentFromElement(this); + var isActive = $(parent).hasClass(ClassName.OPEN); - // DROPDOWN NO CONFLICT - // ==================== + if (!isActive && event.which !== 27 || isActive && event.which === 27) { - $.fn.dropdown.noConflict = function () { - $.fn.dropdown = old - return this - } + if (event.which === 27) { + var toggle = $(parent).find(Selector.DATA_TOGGLE)[0]; + $(toggle).trigger('focus'); + } + $(this).trigger('click'); + return; + } - // APPLY TO STANDARD DROPDOWN ELEMENTS - // =================================== + var items = $.makeArray($(Selector.VISIBLE_ITEMS)); - $(document) - .on('click.bs.dropdown.data-api', clearMenus) - .on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() }) - .on('click.bs.dropdown.data-api', toggle, Dropdown.prototype.toggle) - .on('keydown.bs.dropdown.data-api', toggle, Dropdown.prototype.keydown) - .on('keydown.bs.dropdown.data-api', '.dropdown-menu', Dropdown.prototype.keydown) + items = items.filter(function (item) { + return item.offsetWidth || item.offsetHeight; + }); -}(jQuery); + if (!items.length) { + return; + } -/* ======================================================================== - * Bootstrap: modal.js v3.3.4 - * http://getbootstrap.com/javascript/#modals - * ======================================================================== - * Copyright 2011-2015 Twitter, Inc. - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - * ======================================================================== */ + var index = items.indexOf(event.target); + if (event.which === 38 && index > 0) index--; // up + if (event.which === 40 && index < items.length - 1) index++; // down + if (! ~index) index = 0; -+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)) - } - } + items[index].focus(); + } + }]); + + return Dropdown; + })(); + + /** + * ------------------------------------------------------------------------ + * Data Api implementation + * ------------------------------------------------------------------------ + */ + + $(document).on(Event.KEYDOWN, Selector.DATA_TOGGLE, Dropdown._dataApiKeydownHandler).on(Event.KEYDOWN, Selector.ROLE_MENU, Dropdown._dataApiKeydownHandler).on(Event.KEYDOWN, Selector.ROLE_LISTBOX, Dropdown._dataApiKeydownHandler).on(Event.CLICK_DATA, Dropdown._clearMenus).on(Event.CLICK_DATA, Selector.DATA_TOGGLE, Dropdown.prototype.toggle).on(Event.CLICK_DATA, Selector.FORM_CHILD, function (e) { + e.stopPropagation(); + }); + + /** + * ------------------------------------------------------------------------ + * jQuery + * ------------------------------------------------------------------------ + */ + + $.fn[NAME] = Dropdown._jQueryInterface; + $.fn[NAME].Constructor = Dropdown; + $.fn[NAME].noConflict = function () { + $.fn[NAME] = JQUERY_NO_CONFLICT; + return Dropdown._jQueryInterface; + }; + + return Dropdown; +})(jQuery); + +/** + * -------------------------------------------------------------------------- + * Bootstrap (v4.0.0): modal.js + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * -------------------------------------------------------------------------- + */ + +var Modal = (function ($) { - Modal.VERSION = '3.3.4' + /** + * ------------------------------------------------------------------------ + * Constants + * ------------------------------------------------------------------------ + */ - Modal.TRANSITION_DURATION = 300 - Modal.BACKDROP_TRANSITION_DURATION = 150 + var NAME = 'modal'; + var VERSION = '4.0.0'; + var DATA_KEY = 'bs.modal'; + var JQUERY_NO_CONFLICT = $.fn[NAME]; + var TRANSITION_DURATION = 300; + var BACKDROP_TRANSITION_DURATION = 150; - Modal.DEFAULTS = { + var Default = { backdrop: true, keyboard: true, show: true - } - - Modal.prototype.toggle = function (_relatedTarget) { - return this.isShown ? this.hide() : this.show(_relatedTarget) - } + }; + + var Event = { + HIDE: 'hide.bs.modal', + HIDDEN: 'hidden.bs.modal', + SHOW: 'show.bs.modal', + SHOWN: 'shown.bs.modal', + DISMISS: 'click.dismiss.bs.modal', + KEYDOWN: 'keydown.dismiss.bs.modal', + FOCUSIN: 'focusin.bs.modal', + RESIZE: 'resize.bs.modal', + CLICK: 'click.bs.modal.data-api', + MOUSEDOWN: 'mousedown.dismiss.bs.modal', + MOUSEUP: 'mouseup.dismiss.bs.modal' + }; + + var ClassName = { + BACKDROP: 'modal-backdrop', + OPEN: 'modal-open', + FADE: 'fade', + IN: 'in' + }; + + var Selector = { + DIALOG: '.modal-dialog', + DATA_TOGGLE: '[data-toggle="modal"]', + DATA_DISMISS: '[data-dismiss="modal"]', + SCROLLBAR_MEASURER: 'modal-scrollbar-measure' + }; + + /** + * ------------------------------------------------------------------------ + * Class Definition + * ------------------------------------------------------------------------ + */ + + var Modal = (function () { + function Modal(element, config) { + _classCallCheck(this, Modal); + + this._config = config; + this._element = element; + this._dialog = $(element).find(Selector.DIALOG)[0]; + this._backdrop = null; + this._isShown = false; + this._isBodyOverflowing = false; + this._ignoreBackdropClick = false; + this._originalBodyPadding = 0; + this._scrollbarWidth = 0; + } - Modal.prototype.show = function (_relatedTarget) { - var that = this - var e = $.Event('show.bs.modal', { relatedTarget: _relatedTarget }) + _createClass(Modal, [{ + key: 'toggle', - this.$element.trigger(e) + // public - if (this.isShown || e.isDefaultPrevented()) return + value: function toggle(relatedTarget) { + return this._isShown ? this.hide() : this.show(relatedTarget); + } + }, { + key: 'show', + value: function show(relatedTarget) { + var _this7 = this; - this.isShown = true + var showEvent = $.Event(Event.SHOW, { + relatedTarget: relatedTarget + }); - this.checkScrollbar() - this.setScrollbar() - this.$body.addClass('modal-open') + $(this._element).trigger(showEvent); - this.escape() - this.resize() + if (this._isShown || showEvent.isDefaultPrevented()) { + return; + } - this.$element.on('click.dismiss.bs.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this)) + this._isShown = true; - 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._checkScrollbar(); + this._setScrollbar(); - this.backdrop(function () { - var transition = $.support.transition && that.$element.hasClass('fade') + $(document.body).addClass(ClassName.OPEN); - if (!that.$element.parent().length) { - that.$element.appendTo(that.$body) // don't move modals dom position - } + this._setEscapeEvent(); + this._setResizeEvent(); - that.$element - .show() - .scrollTop(0) + $(this._element).on(Event.DISMISS, Selector.DATA_DISMISS, this.hide.bind(this)); - that.adjustDialog() + $(this._dialog).on(Event.MOUSEDOWN, function () { + $(_this7._element).one(Event.MOUSEUP, function (event) { + if ($(event.target).is(_this7._element)) { + that._ignoreBackdropClick = true; + } + }); + }); - if (transition) { - that.$element[0].offsetWidth // force reflow + this._showBackdrop(this._showElement.bind(this, relatedTarget)); } + }, { + key: 'hide', + value: function hide(event) { + if (event) { + event.preventDefault(); + } - that.$element.addClass('in') - - that.enforceFocus() + var hideEvent = $.Event(Event.HIDE); - var e = $.Event('shown.bs.modal', { relatedTarget: _relatedTarget }) + $(this._element).trigger(hideEvent); - 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) - }) - } + if (!this._isShown || hideEvent.isDefaultPrevented()) { + return; + } - Modal.prototype.hide = function (e) { - if (e) e.preventDefault() + this._isShown = false; - e = $.Event('hide.bs.modal') + this._setEscapeEvent(); + this._setResizeEvent(); - this.$element.trigger(e) + $(document).off(Event.FOCUSIN); - if (!this.isShown || e.isDefaultPrevented()) return + $(this._element).removeClass(ClassName.IN); - this.isShown = false + $(this._element).off(Event.DISMISS); + $(this._dialog).off(Event.MOUSEDOWN); - this.escape() - this.resize() + if (Util.supportsTransitionEnd() && $(this._element).hasClass(ClassName.FADE)) { - $(document).off('focusin.bs.modal') + $(this._element).one(Util.TRANSITION_END, this._hideModal.bind(this)).emulateTransitionEnd(TRANSITION_DURATION); + } else { + this._hideModal(); + } + } + }, { + key: '_showElement', - this.$element - .removeClass('in') - .off('click.dismiss.bs.modal') - .off('mouseup.dismiss.bs.modal') + // private - this.$dialog.off('mousedown.dismiss.bs.modal') + value: function _showElement(relatedTarget) { + var _this8 = this; - $.support.transition && this.$element.hasClass('fade') ? - this.$element - .one('bsTransitionEnd', $.proxy(this.hideModal, this)) - .emulateTransitionEnd(Modal.TRANSITION_DURATION) : - this.hideModal() - } + var transition = Util.supportsTransitionEnd() && $(this._element).hasClass(ClassName.FADE); - Modal.prototype.enforceFocus = function () { - $(document) - .off('focusin.bs.modal') // guard against infinite focus loop - .on('focusin.bs.modal', $.proxy(function (e) { - if (this.$element[0] !== e.target && !this.$element.has(e.target).length) { - this.$element.trigger('focus') + if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) { + // don't move modals dom position + document.body.appendChild(this._element); } - }, 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') - } - } + this._element.style.display = 'block'; + this._element.scrollTop = 0; - 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') - }) - } + if (transition) { + Util.reflow(this._element); + } - Modal.prototype.removeBackdrop = function () { - this.$backdrop && this.$backdrop.remove() - this.$backdrop = null - } + $(this._element).addClass(ClassName.IN); - Modal.prototype.backdrop = function (callback) { - var that = this - var animate = this.$element.hasClass('fade') ? 'fade' : '' + this._enforceFocus(); - if (this.isShown && this.options.backdrop) { - var doAnimate = $.support.transition && animate + var shownEvent = $.Event(Event.SHOWN, { + relatedTarget: relatedTarget + }); - this.$backdrop = $(document.createElement('div')) - .addClass('modal-backdrop ' + animate) - .appendTo(this.$body) + var transitionComplete = function transitionComplete() { + _this8._element.focus(); + $(_this8._element).trigger(shownEvent); + }; - this.$element.on('click.dismiss.bs.modal', $.proxy(function (e) { - if (this.ignoreBackdropClick) { - this.ignoreBackdropClick = false - return + if (transition) { + $(this._dialog).one(Util.TRANSITION_END, transitionComplete).emulateTransitionEnd(TRANSITION_DURATION); + } else { + transitionComplete(); + } + } + }, { + key: '_enforceFocus', + value: function _enforceFocus() { + var _this9 = this; + + $(document).off(Event.FOCUSIN) // guard against infinite focus loop + .on(Event.FOCUSIN, function (event) { + if (_this9._element !== event.target && !$(_this9._element).has(event.target).length) { + _this9._element.focus(); + } + }); + } + }, { + key: '_setEscapeEvent', + value: function _setEscapeEvent() { + var _this10 = this; + + if (this._isShown && this._config.keyboard) { + $(this._element).on(Event.KEYDOWN, function (event) { + if (event.which === 27) { + _this10.hide(); + } + }); + } else if (!this._isShown) { + $(this._element).off(Event.KEYDOWN); } - if (e.target !== e.currentTarget) return - this.options.backdrop == 'static' - ? this.$element[0].focus() - : this.hide() - }, this)) + } + }, { + key: '_setResizeEvent', + value: function _setResizeEvent() { + if (this._isShown) { + $(window).on(Event.RESIZE, this._handleUpdate.bind(this)); + } else { + $(window).off(Event.RESIZE); + } + } + }, { + key: '_hideModal', + value: function _hideModal() { + var _this11 = this; + + this._element.style.display = 'none'; + this._showBackdrop(function () { + $(document.body).removeClass(ClassName.OPEN); + _this11._resetAdjustments(); + _this11._resetScrollbar(); + $(_this11._element).trigger(Event.HIDDEN); + }); + } + }, { + key: '_removeBackdrop', + value: function _removeBackdrop() { + if (this._backdrop) { + $(this._backdrop).remove(); + this._backdrop = null; + } + } + }, { + key: '_showBackdrop', + value: function _showBackdrop(callback) { + var _this12 = this; + + var animate = $(this._element).hasClass(ClassName.FADE) ? ClassName.FADE : ''; + + if (this._isShown && this._config.backdrop) { + var doAnimate = Util.supportsTransitionEnd() && animate; + + this._backdrop = document.createElement('div'); + this._backdrop.className = ClassName.BACKDROP; + + if (animate) { + $(this._backdrop).addClass(animate); + } + + $(this._backdrop).appendTo(this.$body); + + $(this._element).on(Event.DISMISS, function (event) { + if (_this12._ignoreBackdropClick) { + _this12._ignoreBackdropClick = false; + return; + } + if (event.target !== event.currentTarget) { + return; + } + if (_this12._config.backdrop === 'static') { + _this12._element.focus(); + } else { + _this12.hide(); + } + }); + + if (doAnimate) { + Util.reflow(this._backdrop); + } + + $(this._backdrop).addClass(ClassName.IN); + + if (!callback) { + return; + } + + if (!doAnimate) { + callback(); + return; + } + + $(this._backdrop).one(Util.TRANSITION_END, callback).emulateTransitionEnd(BACKDROP_TRANSITION_DURATION); + } else if (!this._isShown && this._backdrop) { + $(this._backdrop).removeClass(ClassName.IN); + + var callbackRemove = function callbackRemove() { + _this12._removeBackdrop(); + if (callback) { + callback(); + } + }; + + if (Util.supportsTransitionEnd() && $(this._element).hasClass(ClassName.FADE)) { + $(this._backdrop).one(Util.TRANSITION_END, callbackRemove).emulateTransitionEnd(BACKDROP_TRANSITION_DURATION); + } else { + callbackRemove(); + } + } else if (callback) { + callback(); + } + } + }, { + key: '_handleUpdate', - if (doAnimate) this.$backdrop[0].offsetWidth // force reflow + // ---------------------------------------------------------------------- + // the following methods are used to handle overflowing modals + // todo (fat): these should probably be refactored out of modal.js + // ---------------------------------------------------------------------- - 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() + value: function _handleUpdate() { + this._adjustDialog(); } - $.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); - -/* ======================================================================== - * Bootstrap: tooltip.js v3.3.4 - * http://getbootstrap.com/javascript/#tooltip - * Inspired by the original jQuery.tipsy by Jason Frame - * ======================================================================== - * Copyright 2011-2015 Twitter, Inc. - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - * ======================================================================== */ - - -+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.4' - - 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] + }, { + key: '_adjustDialog', + value: function _adjustDialog() { + var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight; - 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' + if (!this._isBodyOverflowing && isModalOverflowing) { + this._element.style.paddingLeft = this._scrollbarWidth + 'px'; + } - 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)) + if (this._isBodyOverflowing && !isModalOverflowing) { + this._element.style.paddingRight = this._scrollbarWidth + 'px'; + } } - } + }, { + key: '_resetAdjustments', + value: function _resetAdjustments() { + this._element.style.paddingLeft = ''; + this._element.style.paddingRight = ''; + } + }, { + key: '_checkScrollbar', + value: function _checkScrollbar() { + 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._isBodyOverflowing = document.body.clientWidth < fullWindowWidth; + this._scrollbarWidth = this._getScrollbarWidth(); + } + }, { + key: '_setScrollbar', + value: function _setScrollbar() { + var bodyPadding = parseInt($(document.body).css('padding-right') || 0, 10); - this.options.selector ? - (this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) : - this.fixTitle() - } + this._originalBodyPadding = document.body.style.paddingRight || ''; - Tooltip.prototype.getDefaults = function () { - return Tooltip.DEFAULTS - } + if (this._isBodyOverflowing) { + document.body.style.paddingRight = bodyPadding + this._scrollbarWidth + 'px'; + } + } + }, { + key: '_resetScrollbar', + value: function _resetScrollbar() { + document.body.style.paddingRight = this._originalBodyPadding; + } + }, { + key: '_getScrollbarWidth', + value: function _getScrollbarWidth() { + // thx d.walsh + var scrollDiv = document.createElement('div'); + scrollDiv.className = Selector.SCROLLBAR_MEASURER; + document.body.appendChild(scrollDiv); + var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth; + document.body.removeChild(scrollDiv); + return scrollbarWidth; + } + }], [{ + key: 'VERSION', - Tooltip.prototype.getOptions = function (options) { - options = $.extend({}, this.getDefaults(), this.$element.data(), options) + // getters - if (options.delay && typeof options.delay == 'number') { - options.delay = { - show: options.delay, - hide: options.delay + get: function () { + return VERSION; } - } - - return options - } + }, { + key: 'Default', + get: function () { + return Default; + } + }, { + key: '_jQueryInterface', + + // static + + value: function _jQueryInterface(config, relatedTarget) { + return this.each(function () { + var data = $(this).data(DATA_KEY); + var _config = $.extend({}, Modal.Default, $(this).data(), typeof config === 'object' && config); + + if (!data) { + data = new Modal(this, _config); + $(this).data(DATA_KEY, data); + } + + if (typeof config === 'string') { + data[config](relatedTarget); + } else if (_config.show) { + data.show(relatedTarget); + } + }); + } + }]); - Tooltip.prototype.getDelegateOptions = function () { - var options = {} - var defaults = this.getDefaults() + return Modal; + })(); - this._options && $.each(this._options, function (key, value) { - if (defaults[key] != value) options[key] = value - }) + /** + * ------------------------------------------------------------------------ + * Data Api implementation + * ------------------------------------------------------------------------ + */ - return options - } + $(document).on(Event.CLICK, Selector.DATA_TOGGLE, function (event) { + var _this13 = this; - Tooltip.prototype.enter = function (obj) { - var self = obj instanceof this.constructor ? - obj : $(obj.currentTarget).data('bs.' + this.type) + var target = undefined; + var selector = Util.getSelectorFromElement(this); - if (!self) { - self = new this.constructor(obj.currentTarget, this.getDelegateOptions()) - $(obj.currentTarget).data('bs.' + this.type, self) + if (selector) { + target = $(selector)[0]; } - if (obj instanceof $.Event) { - self.inState[obj.type == 'focusin' ? 'focus' : 'hover'] = true - } + var config = $(target).data(DATA_KEY) ? 'toggle' : $.extend({}, $(target).data(), $(this).data()); - if (self.tip().hasClass('in') || self.hoverState == 'in') { - self.hoverState = 'in' - return + if (this.tagName === 'A') { + event.preventDefault(); } - 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) - } + var $target = $(target).one(Event.SHOW, function (showEvent) { + if (showEvent.isDefaultPrevented()) { + // only register focus restorer if modal will actually get shown + return; + } - Tooltip.prototype.isInStateTrue = function () { - for (var key in this.inState) { - if (this.inState[key]) return true - } + $target.one(Event.HIDDEN, function () { + if ($(_this13).is(':visible')) { + _this13.focus(); + } + }); + }); + + Modal._jQueryInterface.call($(target), config, this); + }); + + /** + * ------------------------------------------------------------------------ + * jQuery + * ------------------------------------------------------------------------ + */ + + $.fn[NAME] = Modal._jQueryInterface; + $.fn[NAME].Constructor = Modal; + $.fn[NAME].noConflict = function () { + $.fn[NAME] = JQUERY_NO_CONFLICT; + return Modal._jQueryInterface; + }; + + return Modal; +})(jQuery); + +/** + * -------------------------------------------------------------------------- + * Bootstrap (v4.0.0): scrollspy.js + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * -------------------------------------------------------------------------- + */ - return false - } +var ScrollSpy = (function ($) { - Tooltip.prototype.leave = function (obj) { - var self = obj instanceof this.constructor ? - obj : $(obj.currentTarget).data('bs.' + this.type) + /** + * ------------------------------------------------------------------------ + * Constants + * ------------------------------------------------------------------------ + */ - if (!self) { - self = new this.constructor(obj.currentTarget, this.getDelegateOptions()) - $(obj.currentTarget).data('bs.' + this.type, self) - } + var NAME = 'scrollspy'; + var VERSION = '4.0.0'; + var DATA_KEY = 'bs.scrollspy'; + var JQUERY_NO_CONFLICT = $.fn[NAME]; - if (obj instanceof $.Event) { - self.inState[obj.type == 'focusout' ? 'focus' : 'hover'] = false + var Default = { + offset: 10 + }; + + var Event = { + ACTIVATE: 'activate.bs.scrollspy', + SCROLL: 'scroll.bs.scrollspy', + LOAD: 'load.bs.scrollspy.data-api' + }; + + var ClassName = { + DROPDOWN_MENU: 'dropdown-menu', + ACTIVE: 'active' + }; + + var Selector = { + DATA_SPY: '[data-spy="scroll"]', + ACTIVE: '.active', + LI_DROPDOWN: 'li.dropdown', + LI: 'li' + }; + + /** + * ------------------------------------------------------------------------ + * Class Definition + * ------------------------------------------------------------------------ + */ + + var ScrollSpy = (function () { + function ScrollSpy(element, config) { + _classCallCheck(this, ScrollSpy); + + this._scrollElement = element.tagName === 'BODY' ? window : element; + this._config = $.extend({}, Default, config); + this._selector = '' + (this._config.target || '') + ' .nav li > a'; + this._offsets = []; + this._targets = []; + this._activeTarget = null; + this._scrollHeight = 0; + + $(this._scrollElement).on(Event.SCROLL, this._process.bind(this)); + + this.refresh(); + this._process(); } - 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) + _createClass(ScrollSpy, [{ + key: 'refresh', - this.setContent() - $tip.attr('id', tipId) - this.$element.attr('aria-describedby', tipId) + // public - if (this.options.animation) $tip.addClass('fade') + value: function refresh() { + var _this14 = this; - var placement = typeof this.options.placement == 'function' ? - this.options.placement.call(this, $tip[0], this.$element[0]) : - this.options.placement + var offsetMethod = 'offset'; + var offsetBase = 0; - 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 + if (this._scrollElement !== this._scrollElement.window) { + offsetMethod = 'position'; + offsetBase = this._getScrollTop(); + } - $tip - .removeClass(orgPlacement) - .addClass(placement) + this._offsets = []; + this._targets = []; + + this._scrollHeight = this._getScrollHeight(); + + var targets = $.makeArray($(this._selector)); + + targets.map(function (element) { + var target = undefined; + var targetSelector = Util.getSelectorFromElement(element); + + if (targetSelector) { + target = $(targetSelector)[0]; + } + + if (target && (target.offsetWidth || target.offsetHeight)) { + // todo (fat): remove sketch reliance on jQuery position/offset + return [$(target)[offsetMethod]().top + offsetBase, targetSelector]; + } + }).filter(function (item) { + return item; + }).sort(function (a, b) { + return a[0] - b[0]; + }).forEach(function (item) { + _this14._offsets.push(item[0]); + _this14._targets.push(item[1]); + }); } + }, { + key: '_getScrollTop', - var calculatedOffset = this.getCalculatedOffset(placement, pos, actualWidth, actualHeight) + // private - 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) + value: function _getScrollTop() { + return this._scrollElement === window ? this._scrollElement.scrollY : this._scrollElement.scrollTop; } - - $.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) - }) + }, { + key: '_getScrollHeight', + value: function _getScrollHeight() { + return this._scrollElement.scrollHeight || Math.max(document.body.scrollHeight, document.documentElement.scrollHeight); } - }, 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() - that.$element - .removeAttr('aria-describedby') - .trigger('hidden.bs.' + that.type) - callback && callback() - } - - this.$element.trigger(e) - - if (e.isDefaultPrevented()) return + }, { + key: '_process', + value: function _process() { + var scrollTop = this._getScrollTop() + this._config.offset; + var scrollHeight = this._getScrollHeight(); + var maxScroll = this._config.offset + scrollHeight - this._scrollElement.offsetHeight; + + if (this._scrollHeight !== scrollHeight) { + this.refresh(); + } - $tip.removeClass('in') + if (scrollTop >= maxScroll) { + var target = this._targets[this._targets.length - 1]; - $.support.transition && $tip.hasClass('fade') ? - $tip - .one('bsTransitionEnd', complete) - .emulateTransitionEnd(Tooltip.TRANSITION_DURATION) : - complete() + if (this._activeTarget !== target) { + this._activate(target); + } + } - this.hoverState = null + if (this._activeTarget && scrollTop < this._offsets[0]) { + this._activeTarget = null; + this._clear(); + return; + } - return this - } + for (var i = this._offsets.length; i--;) { + var isActiveTarget = this._activeTarget !== this._targets[i] && scrollTop >= this._offsets[i] && (this._offsets[i + 1] === undefined || scrollTop < this._offsets[i + 1]); - 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', '') - } - } + if (isActiveTarget) { + this._activate(this._targets[i]); + } + } + } + }, { + key: '_activate', + value: function _activate(target) { + this._activeTarget = target; - Tooltip.prototype.hasContent = function () { - return this.getTitle() - } + this._clear(); - Tooltip.prototype.getPosition = function ($element) { - $element = $element || this.$element + var selector = '' + this._selector + '[data-target="' + target + '"],' + ('' + this._selector + '[href="' + target + '"]'); - var el = $element[0] - var isBody = el.tagName == 'BODY' + // todo (fat): getting all the raw li's up the tree is not great. + var parentListItems = $(selector).parents(Selector.LI); - 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 elOffset = isBody ? { top: 0, left: 0 } : $element.offset() - var scroll = { scroll: isBody ? document.documentElement.scrollTop || document.body.scrollTop : $element.scrollTop() } - var outerDims = isBody ? { width: $(window).width(), height: $(window).height() } : null + for (var i = parentListItems.length; i--;) { + $(parentListItems[i]).addClass(ClassName.ACTIVE); - return $.extend({}, elRect, scroll, outerDims, elOffset) - } + var itemParent = parentListItems[i].parentNode; - 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 } + if (itemParent && $(itemParent).hasClass(ClassName.DROPDOWN_MENU)) { + var closestDropdown = $(itemParent).closest(Selector.LI_DROPDOWN)[0]; + $(closestDropdown).addClass(ClassName.ACTIVE); + } + } - } + $(this._scrollElement).trigger(Event.ACTIVATE, { + relatedTarget: target + }); + } + }, { + key: '_clear', + value: function _clear() { + var activeParents = $(this._selector).parentsUntil(this._config.target, Selector.ACTIVE); - 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 + for (var i = activeParents.length; i--;) { + $(activeParents[i]).removeClass(ClassName.ACTIVE); + } } - } + }], [{ + key: 'VERSION', - return delta - } + // getters - Tooltip.prototype.getTitle = function () { - var title - var $e = this.$element - var o = this.options + get: function () { + return VERSION; + } + }, { + key: 'Default', + get: function () { + return Default; + } + }, { + key: '_jQueryInterface', - title = $e.attr('data-original-title') - || (typeof o.title == 'function' ? o.title.call($e[0]) : o.title) + // static - return title - } + value: function _jQueryInterface(config) { + return this.each(function () { + var data = $(this).data(DATA_KEY); + var _config = typeof config === 'object' && config || null; - Tooltip.prototype.getUID = function (prefix) { - do prefix += ~~(Math.random() * 1000000) - while (document.getElementById(prefix)) - return prefix - } + if (!data) { + data = new ScrollSpy(this, _config); + $(this).data(DATA_KEY, data); + } - 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!') + if (typeof config === 'string') { + data[config](); + } + }); } - } - return this.$tip - } + }]); - Tooltip.prototype.arrow = function () { - return (this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow')) - } + return ScrollSpy; + })(); - Tooltip.prototype.enable = function () { - this.enabled = true - } + /** + * ------------------------------------------------------------------------ + * Data Api implementation + * ------------------------------------------------------------------------ + */ - Tooltip.prototype.disable = function () { - this.enabled = false - } + $(window).on(Event.LOAD, function () { + var scrollSpys = $.makeArray($(Selector.DATA_SPY)); - 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) - } + for (var i = scrollSpys.length; i--;) { + var $spy = $(scrollSpys[i]); + ScrollSpy._jQueryInterface.call($spy, $spy.data()); } + }); + + /** + * ------------------------------------------------------------------------ + * jQuery + * ------------------------------------------------------------------------ + */ + + $.fn[NAME] = ScrollSpy._jQueryInterface; + $.fn[NAME].Constructor = ScrollSpy; + $.fn[NAME].noConflict = function () { + $.fn[NAME] = JQUERY_NO_CONFLICT; + return ScrollSpy._jQueryInterface; + }; + + return ScrollSpy; +})(jQuery); + +/** + * -------------------------------------------------------------------------- + * Bootstrap (v4.0.0): tab.js + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * -------------------------------------------------------------------------- + */ - 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) +var Tab = (function ($) { + + /** + * ------------------------------------------------------------------------ + * Constants + * ------------------------------------------------------------------------ + */ + + var NAME = 'tab'; + var VERSION = '4.0.0'; + var DATA_KEY = 'bs.tab'; + var JQUERY_NO_CONFLICT = $.fn[NAME]; + var TRANSITION_DURATION = 150; + + var Event = { + HIDE: 'hide.bs.tab', + HIDDEN: 'hidden.bs.tab', + SHOW: 'show.bs.tab', + SHOWN: 'shown.bs.tab', + CLICK: 'click.bs.tab.data-api' + }; + + var ClassName = { + DROPDOWN_MENU: 'dropdown-menu', + ACTIVE: 'active', + FADE: 'fade', + IN: 'in' + }; + + var Selector = { + A: 'a', + LI: 'li', + LI_DROPDOWN: 'li.dropdown', + UL: 'ul:not(.dropdown-menu)', + FADE_CHILD: '> .fade', + ACTIVE: '.active', + ACTIVE_CHILD: '> .active', + DATA_TOGGLE: '[data-toggle="tab"], [data-toggle="pill"]', + DROPDOWN_ACTIVE_CHILD: '> .dropdown-menu > .active' + }; + + /** + * ------------------------------------------------------------------------ + * Class Definition + * ------------------------------------------------------------------------ + */ + + var Tab = (function () { + function Tab(element) { + _classCallCheck(this, Tab); + + this._element = element; } - } - 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 - }) - } - - - // 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]() - }) - } + _createClass(Tab, [{ + key: 'show', - var old = $.fn.tooltip + // public - $.fn.tooltip = Plugin - $.fn.tooltip.Constructor = Tooltip + value: function show() { + var _this15 = this; + if (this._element.parentNode && this._element.parentNode.nodeType == Node.ELEMENT_NODE && $(this._element).parent().hasClass(ClassName.ACTIVE)) { + return; + } - // TOOLTIP NO CONFLICT - // =================== - - $.fn.tooltip.noConflict = function () { - $.fn.tooltip = old - return this - } - -}(jQuery); - -/* ======================================================================== - * Bootstrap: popover.js v3.3.4 - * http://getbootstrap.com/javascript/#popovers - * ======================================================================== - * Copyright 2011-2015 Twitter, Inc. - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - * ======================================================================== */ + var target = undefined; + var previous = undefined; + var ulElement = $(this._element).closest(Selector.UL)[0]; + var selector = Util.getSelectorFromElement(this._element); + if (ulElement) { + previous = $.makeArray($(ulElement).find(Selector.ACTIVE)); + previous = previous[previous.length - 1]; -+function ($) { - 'use strict'; + if (previous) { + previous = $(previous).find(Selector.A)[0]; + } + } - // POPOVER PUBLIC CLASS DEFINITION - // =============================== + var hideEvent = $.Event(Event.HIDE, { + relatedTarget: this._element + }); - var Popover = function (element, options) { - this.init('popover', element, options) - } + var showEvent = $.Event(Event.SHOW, { + relatedTarget: previous + }); - if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js') + if (previous) { + $(previous).trigger(hideEvent); + } - Popover.VERSION = '3.3.4' + $(this._element).trigger(showEvent); - Popover.DEFAULTS = $.extend({}, $.fn.tooltip.Constructor.DEFAULTS, { - placement: 'right', - trigger: 'click', - content: '', - template: '' - }) + if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) { + return; + } + if (selector) { + target = $(selector)[0]; + } - // NOTE: POPOVER EXTENDS tooltip.js - // ================================ + this._activate($(this._element).closest(Selector.LI)[0], ulElement); - Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype) + var complete = function complete() { + var hiddenEvent = $.Event(Event.HIDDEN, { + relatedTarget: _this15._element + }); - Popover.prototype.constructor = Popover + var shownEvent = $.Event(Event.SHOWN, { + relatedTarget: previous + }); - Popover.prototype.getDefaults = function () { - return Popover.DEFAULTS - } + $(previous).trigger(hiddenEvent); + $(_this15._element).trigger(shownEvent); + }; - Popover.prototype.setContent = function () { - var $tip = this.tip() - var title = this.getTitle() - var content = this.getContent() + if (target) { + this._activate(target, target.parentNode, complete); + } else { + complete(); + } + } + }, { + key: '_activate', - $tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title) - $tip.find('.popover-content').children().detach().end()[ // we use append for html objects to maintain js events - this.options.html ? (typeof content == 'string' ? 'html' : 'append') : 'text' - ](content) + // private - $tip.removeClass('fade top bottom left right in') + value: function _activate(element, container, callback) { + var active = $(container).find(Selector.ACTIVE_CHILD)[0]; + var isTransitioning = callback && Util.supportsTransitionEnd() && (active && $(active).hasClass(ClassName.FADE) || !!$(container).find(Selector.FADE_CHILD)[0]); - // IE8 doesn't accept hiding via the `:empty` pseudo selector, we have to do - // this manually by checking the contents. - if (!$tip.find('.popover-title').html()) $tip.find('.popover-title').hide() - } + var complete = this._transitionComplete.bind(this, element, active, isTransitioning, callback); - Popover.prototype.hasContent = function () { - return this.getTitle() || this.getContent() - } + if (active && isTransitioning) { + $(active).one(Util.TRANSITION_END, complete).emulateTransitionEnd(TRANSITION_DURATION); + } else { + complete(); + } - Popover.prototype.getContent = function () { - var $e = this.$element - var o = this.options + if (active) { + $(active).removeClass(ClassName.IN); + } + } + }, { + key: '_transitionComplete', + value: function _transitionComplete(element, active, isTransitioning, callback) { + if (active) { + $(active).removeClass(ClassName.ACTIVE); + + var dropdownChild = $(active).find(Selector.DROPDOWN_ACTIVE_CHILD)[0]; + if (dropdownChild) { + $(dropdownChild).removeClass(ClassName.ACTIVE); + } + + var activeToggle = $(active).find(Selector.DATA_TOGGLE)[0]; + if (activeToggle) { + activeToggle.setAttribute('aria-expanded', false); + } + } - return $e.attr('data-content') - || (typeof o.content == 'function' ? - o.content.call($e[0]) : - o.content) - } + $(element).addClass(ClassName.ACTIVE); - Popover.prototype.arrow = function () { - return (this.$arrow = this.$arrow || this.tip().find('.arrow')) - } + var elementToggle = $(element).find(Selector.DATA_TOGGLE)[0]; + if (elementToggle) { + elementToggle.setAttribute('aria-expanded', true); + } + if (isTransitioning) { + Util.reflow(element); + $(element).addClass(ClassName.IN); + } else { + $(element).removeClass(ClassName.FADE); + } - // POPOVER PLUGIN DEFINITION - // ========================= + if (element.parentNode && $(element.parentNode).hasClass(ClassName.DROPDOWN_MENU)) { - function Plugin(option) { - return this.each(function () { - var $this = $(this) - var data = $this.data('bs.popover') - var options = typeof option == 'object' && option + var dropdownElement = $(element).closest(Selector.LI_DROPDOWN)[0]; + if (dropdownElement) { + $(dropdownElement).addClass(ClassName.ACTIVE); + } - if (!data && /destroy|hide/.test(option)) return - if (!data) $this.data('bs.popover', (data = new Popover(this, options))) - if (typeof option == 'string') data[option]() - }) - } + elementToggle = $(element).find(Selector.DATA_TOGGLE)[0]; + if (elementToggle) { + elementToggle.setAttribute('aria-expanded', true); + } + } - var old = $.fn.popover + if (callback) { + callback(); + } + } + }], [{ + key: 'VERSION', - $.fn.popover = Plugin - $.fn.popover.Constructor = Popover + // getters + get: function () { + return VERSION; + } + }, { + key: 'Default', + get: function () { + return Default; + } + }, { + key: '_jQueryInterface', - // POPOVER NO CONFLICT - // =================== + // static - $.fn.popover.noConflict = function () { - $.fn.popover = old - return this - } + value: function _jQueryInterface(config) { + return this.each(function () { + var $this = $(this); + var data = $this.data(DATA_KEY); -}(jQuery); + if (!data) { + data = data = new Tab(this); + $this.data(DATA_KEY, data); + } -/* ======================================================================== - * Bootstrap: scrollspy.js v3.3.4 - * http://getbootstrap.com/javascript/#scrollspy - * ======================================================================== - * Copyright 2011-2015 Twitter, Inc. + if (typeof config === 'string') { + data[config](); + } + }); + } + }]); + + return Tab; + })(); + + /** + * ------------------------------------------------------------------------ + * Data Api implementation + * ------------------------------------------------------------------------ + */ + + $(document).on(Event.CLICK, Selector.DATA_TOGGLE, function (event) { + event.preventDefault(); + Tab._jQueryInterface.call($(this), 'show'); + }); + + /** + * ------------------------------------------------------------------------ + * jQuery + * ------------------------------------------------------------------------ + */ + + $.fn[NAME] = Tab._jQueryInterface; + $.fn[NAME].Constructor = Tab; + $.fn[NAME].noConflict = function () { + $.fn[NAME] = JQUERY_NO_CONFLICT; + return Tab._jQueryInterface; + }; + + return Tab; +})(jQuery); + +/** + * -------------------------------------------------------------------------- + * Bootstrap (v4.0.0): tooltip.js * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - * ======================================================================== */ - - -+function ($) { - 'use strict'; - - // SCROLLSPY CLASS DEFINITION - // ========================== - - function ScrollSpy(element, options) { - this.$body = $(document.body) - this.$scrollElement = $(element).is(document.body) ? $(window) : $(element) - this.options = $.extend({}, ScrollSpy.DEFAULTS, options) - this.selector = (this.options.target || '') + ' .nav li > a' - this.offsets = [] - this.targets = [] - this.activeTarget = null - this.scrollHeight = 0 - - this.$scrollElement.on('scroll.bs.scrollspy', $.proxy(this.process, this)) - this.refresh() - this.process() - } - - ScrollSpy.VERSION = '3.3.4' - - ScrollSpy.DEFAULTS = { - offset: 10 - } - - ScrollSpy.prototype.getScrollHeight = function () { - return this.$scrollElement[0].scrollHeight || Math.max(this.$body[0].scrollHeight, document.documentElement.scrollHeight) - } - - ScrollSpy.prototype.refresh = function () { - var that = this - var offsetMethod = 'offset' - var offsetBase = 0 - - this.offsets = [] - this.targets = [] - this.scrollHeight = this.getScrollHeight() - - if (!$.isWindow(this.$scrollElement[0])) { - offsetMethod = 'position' - offsetBase = this.$scrollElement.scrollTop() - } - - this.$body - .find(this.selector) - .map(function () { - var $el = $(this) - var href = $el.data('target') || $el.attr('href') - var $href = /^#./.test(href) && $(href) - - return ($href - && $href.length - && $href.is(':visible') - && [[$href[offsetMethod]().top + offsetBase, href]]) || null - }) - .sort(function (a, b) { return a[0] - b[0] }) - .each(function () { - that.offsets.push(this[0]) - that.targets.push(this[1]) - }) - } - - ScrollSpy.prototype.process = function () { - var scrollTop = this.$scrollElement.scrollTop() + this.options.offset - var scrollHeight = this.getScrollHeight() - var maxScroll = this.options.offset + scrollHeight - this.$scrollElement.height() - var offsets = this.offsets - var targets = this.targets - var activeTarget = this.activeTarget - var i - - if (this.scrollHeight != scrollHeight) { - this.refresh() - } - - if (scrollTop >= maxScroll) { - return activeTarget != (i = targets[targets.length - 1]) && this.activate(i) - } - - if (activeTarget && scrollTop < offsets[0]) { - this.activeTarget = null - return this.clear() - } - - for (i = offsets.length; i--;) { - activeTarget != targets[i] - && scrollTop >= offsets[i] - && (offsets[i + 1] === undefined || scrollTop < offsets[i + 1]) - && this.activate(targets[i]) - } - } - - ScrollSpy.prototype.activate = function (target) { - this.activeTarget = target + * -------------------------------------------------------------------------- + */ - this.clear() +var Tooltip = (function ($) { - var selector = this.selector + - '[data-target="' + target + '"],' + - this.selector + '[href="' + target + '"]' + /** + * ------------------------------------------------------------------------ + * Constants + * ------------------------------------------------------------------------ + */ - var active = $(selector) - .parents('li') - .addClass('active') + var NAME = 'tooltip'; + var VERSION = '4.0.0'; + var DATA_KEY = 'bs.tooltip'; + var JQUERY_NO_CONFLICT = $.fn[NAME]; + var TRANSITION_DURATION = 150; + var CLASS_PREFIX = 'bs-tether'; - if (active.parent('.dropdown-menu').length) { - active = active - .closest('li.dropdown') - .addClass('active') + var Default = { + animation: true, + template: '', + trigger: 'hover focus', + title: '', + delay: 0, + html: false, + selector: false, + placement: 'top', + offset: '0 0', + constraints: null + }; + + var AttachmentMap = { + TOP: 'bottom center', + RIGHT: 'middle left', + BOTTOM: 'top center', + LEFT: 'middle right' + }; + + var HoverState = { + IN: 'in', + OUT: 'out' + }; + + var Event = { + HIDE: 'hide.bs.tooltip', + HIDDEN: 'hidden.bs.tooltip', + SHOW: 'show.bs.tooltip', + SHOWN: 'shown.bs.tooltip', + INSERTED: 'inserted.bs.tooltip', + CLICK: 'click.bs.tooltip', + FOCUSIN: 'focusin.bs.tooltip', + FOCUSOUT: 'focusout.bs.tooltip', + MOUSEENTER: 'mouseenter.bs.tooltip', + MOUSELEAVE: 'mouseleave.bs.tooltip' + }; + + var ClassName = { + FADE: 'fade', + IN: 'in' + }; + + var Selector = { + TOOLTIP: '.tooltip', + TOOLTIP_INNER: '.tooltip-inner' + }; + + var TetherClass = { + element: false, + enabled: false + }; + + var Trigger = { + HOVER: 'hover', + FOCUS: 'focus', + CLICK: 'click', + MANUAL: 'manual' + }; + + /** + * ------------------------------------------------------------------------ + * Class Definition + * ------------------------------------------------------------------------ + */ + + var Tooltip = (function () { + function Tooltip(element, config) { + _classCallCheck(this, Tooltip); + + // private + this._isEnabled = true; + this._timeout = 0; + this._hoverState = ''; + this._activeTrigger = {}; + this._tether = null; + + // protected + this.element = element; + this.config = this._getConfig(config); + this.tip = null; + + this._setListeners(); } - active.trigger('activate.bs.scrollspy') - } - - ScrollSpy.prototype.clear = function () { - $(this.selector) - .parentsUntil(this.options.target, '.active') - .removeClass('active') - } + _createClass(Tooltip, [{ + key: 'enable', + // public - // SCROLLSPY PLUGIN DEFINITION - // =========================== - - function Plugin(option) { - return this.each(function () { - var $this = $(this) - var data = $this.data('bs.scrollspy') - var options = typeof option == 'object' && option - - if (!data) $this.data('bs.scrollspy', (data = new ScrollSpy(this, options))) - if (typeof option == 'string') data[option]() - }) - } + value: function enable() { + this._isEnabled = true; + } + }, { + key: 'disable', + value: function disable() { + this._isEnabled = false; + } + }, { + key: 'toggleEnabled', + value: function toggleEnabled() { + this._isEnabled = !this._isEnabled; + } + }, { + key: 'toggle', + value: function toggle(event) { + var context = this; + var dataKey = this.constructor.DATA_KEY; + + if (event) { + context = $(event.currentTarget).data(dataKey); + + if (!context) { + context = new this.constructor(event.currentTarget, this._getDelegateConfig()); + $(event.currentTarget).data(dataKey, context); + } + + context._activeTrigger.click = !context._activeTrigger.click; + + if (context._isWithActiveTrigger()) { + context._enter(null, context); + } else { + context._leave(null, context); + } + } else { + $(context.getTipElement()).hasClass(ClassName.IN) ? context._leave(null, context) : context._enter(null, context); + } + } + }, { + key: 'destroy', + value: function destroy() { + var _this16 = this; - var old = $.fn.scrollspy + clearTimeout(this._timeout); + this.hide(function () { + $(_this16.element).off('.' + _this16.constructor.NAME).removeData(_this16.constructor.DATA_KEY); - $.fn.scrollspy = Plugin - $.fn.scrollspy.Constructor = ScrollSpy + if (_this16.tip) { + $(_this16.tip).detach(); + } + _this16.tip = null; + }); + } + }, { + key: 'show', + value: function show() { + var _this17 = this; - // SCROLLSPY NO CONFLICT - // ===================== + var showEvent = $.Event(this.constructor.Event.SHOW); - $.fn.scrollspy.noConflict = function () { - $.fn.scrollspy = old - return this - } + if (this.isWithContent() && this._isEnabled) { + $(this.element).trigger(showEvent); + var isInTheDom = $.contains(this.element.ownerDocument.documentElement, this.element); - // SCROLLSPY DATA-API - // ================== + if (showEvent.isDefaultPrevented() || !isInTheDom) { + return; + } - $(window).on('load.bs.scrollspy.data-api', function () { - $('[data-spy="scroll"]').each(function () { - var $spy = $(this) - Plugin.call($spy, $spy.data()) - }) - }) + var tip = this.getTipElement(); + var tipId = Util.getUID(this.constructor.NAME); -}(jQuery); + tip.setAttribute('id', tipId); + this.element.setAttribute('aria-describedby', tipId); -/* ======================================================================== - * Bootstrap: tab.js v3.3.4 - * http://getbootstrap.com/javascript/#tabs - * ======================================================================== - * Copyright 2011-2015 Twitter, Inc. - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - * ======================================================================== */ + this.setContent(); + if (this.config.animation) { + $(tip).addClass(ClassName.FADE); + } -+function ($) { - 'use strict'; + var placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this.element) : this.config.placement; - // TAB CLASS DEFINITION - // ==================== + var attachment = this._getAttachment(placement); - var Tab = function (element) { - // jscs:disable requireDollarBeforejQueryAssignment - this.element = $(element) - // jscs:enable requireDollarBeforejQueryAssignment - } + $(tip).data(this.constructor.DATA_KEY, this).appendTo(document.body); - Tab.VERSION = '3.3.4' + $(this.element).trigger(this.constructor.Event.INSERTED); - Tab.TRANSITION_DURATION = 150 + this._tether = new Tether({ + element: tip, + target: this.element, + attachment: attachment, + classes: TetherClass, + classPrefix: CLASS_PREFIX, + offset: this.config.offset, + constraints: this.config.constraints + }); - Tab.prototype.show = function () { - var $this = this.element - var $ul = $this.closest('ul:not(.dropdown-menu)') - var selector = $this.data('target') + Util.reflow(tip); + this._tether.position(); - if (!selector) { - selector = $this.attr('href') - selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7 - } + $(tip).addClass(ClassName.IN); - if ($this.parent('li').hasClass('active')) return - - var $previous = $ul.find('.active:last a') - var hideEvent = $.Event('hide.bs.tab', { - relatedTarget: $this[0] - }) - var showEvent = $.Event('show.bs.tab', { - relatedTarget: $previous[0] - }) - - $previous.trigger(hideEvent) - $this.trigger(showEvent) - - if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) return - - var $target = $(selector) - - this.activate($this.closest('li'), $ul) - this.activate($target, $target.parent(), function () { - $previous.trigger({ - type: 'hidden.bs.tab', - relatedTarget: $this[0] - }) - $this.trigger({ - type: 'shown.bs.tab', - relatedTarget: $previous[0] - }) - }) - } + var complete = function complete() { + var prevHoverState = _this17._hoverState; + _this17._hoverState = null; - Tab.prototype.activate = function (element, container, callback) { - var $active = container.find('> .active') - var transition = callback - && $.support.transition - && ($active.length && $active.hasClass('fade') || !!container.find('> .fade').length) - - function next() { - $active - .removeClass('active') - .find('> .dropdown-menu > .active') - .removeClass('active') - .end() - .find('[data-toggle="tab"]') - .attr('aria-expanded', false) - - element - .addClass('active') - .find('[data-toggle="tab"]') - .attr('aria-expanded', true) - - if (transition) { - element[0].offsetWidth // reflow for transition - element.addClass('in') - } else { - element.removeClass('fade') - } - - if (element.parent('.dropdown-menu').length) { - element - .closest('li.dropdown') - .addClass('active') - .end() - .find('[data-toggle="tab"]') - .attr('aria-expanded', true) - } - - callback && callback() - } + $(_this17.element).trigger(_this17.constructor.Event.SHOWN); - $active.length && transition ? - $active - .one('bsTransitionEnd', next) - .emulateTransitionEnd(Tab.TRANSITION_DURATION) : - next() + if (prevHoverState === HoverState.OUT) { + _this17._leave(null, _this17); + } + }; - $active.removeClass('in') - } + Util.supportsTransitionEnd() && $(this.tip).hasClass(ClassName.FADE) ? $(this.tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(Tooltip._TRANSITION_DURATION) : complete(); + } + } + }, { + key: 'hide', + value: function hide(callback) { + var _this18 = this; + + var tip = this.getTipElement(); + var hideEvent = $.Event(this.constructor.Event.HIDE); + var complete = function complete() { + if (_this18._hoverState !== HoverState.IN && tip.parentNode) { + tip.parentNode.removeChild(tip); + } + + _this18.element.removeAttribute('aria-describedby'); + $(_this18.element).trigger(_this18.constructor.Event.HIDDEN); + _this18.cleanupTether(); + + if (callback) { + callback(); + } + }; + + $(this.element).trigger(hideEvent); + + if (hideEvent.isDefaultPrevented()) { + return; + } + $(tip).removeClass(ClassName.IN); - // TAB PLUGIN DEFINITION - // ===================== + if (Util.supportsTransitionEnd() && $(this.tip).hasClass(ClassName.FADE)) { - function Plugin(option) { - return this.each(function () { - var $this = $(this) - var data = $this.data('bs.tab') + $(tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(TRANSITION_DURATION); + } else { + complete(); + } - if (!data) $this.data('bs.tab', (data = new Tab(this))) - if (typeof option == 'string') data[option]() - }) - } + this._hoverState = ''; + } + }, { + key: 'isWithContent', - var old = $.fn.tab + // protected - $.fn.tab = Plugin - $.fn.tab.Constructor = Tab + value: function isWithContent() { + return !!this.getTitle(); + } + }, { + key: 'getTipElement', + value: function getTipElement() { + return this.tip = this.tip || $(this.config.template)[0]; + } + }, { + key: 'setContent', + value: function setContent() { + var tip = this.getTipElement(); + var title = this.getTitle(); + var method = this.config.html ? 'innerHTML' : 'innerText'; + $(tip).find(Selector.TOOLTIP_INNER)[0][method] = title; - // TAB NO CONFLICT - // =============== + $(tip).removeClass(ClassName.FADE).removeClass(ClassName.IN); - $.fn.tab.noConflict = function () { - $.fn.tab = old - return this - } + this.cleanupTether(); + } + }, { + key: 'getTitle', + value: function getTitle() { + var title = this.element.getAttribute('data-original-title'); + if (!title) { + title = typeof this.config.title === 'function' ? this.config.title.call(this.element) : this.config.title; + } - // TAB DATA-API - // ============ + return title; + } + }, { + key: 'cleanupTether', + value: function cleanupTether() { + if (this._tether) { + this._tether.destroy(); + + // clean up after tether's junk classes + // remove after they fix issue + // (https://github.com/HubSpot/tether/issues/36) + $(this.element).removeClass(this._removeTetherClasses); + $(this.tip).removeClass(this._removeTetherClasses); + } + } + }, { + key: '_getAttachment', - var clickHandler = function (e) { - e.preventDefault() - Plugin.call($(this), 'show') - } + // private - $(document) - .on('click.bs.tab.data-api', '[data-toggle="tab"]', clickHandler) - .on('click.bs.tab.data-api', '[data-toggle="pill"]', clickHandler) + value: function _getAttachment(placement) { + return AttachmentMap[placement.toUpperCase()]; + } + }, { + key: '_setListeners', + value: function _setListeners() { + var _this19 = this; + + var triggers = this.config.trigger.split(' '); + + triggers.forEach(function (trigger) { + if (trigger === 'click') { + $(_this19.element).on(_this19.constructor.Event.CLICK, _this19.config.selector, _this19.toggle.bind(_this19)); + } else if (trigger !== Trigger.MANUAL) { + var eventIn = trigger == Trigger.HOVER ? _this19.constructor.Event.MOUSEENTER : _this19.constructor.Event.FOCUSIN; + var eventOut = trigger == Trigger.HOVER ? _this19.constructor.Event.MOUSELEAVE : _this19.constructor.Event.FOCUSOUT; + + $(_this19.element).on(eventIn, _this19.config.selector, _this19._enter.bind(_this19)).on(eventOut, _this19.config.selector, _this19._leave.bind(_this19)); + } + }); + + if (this.config.selector) { + this.config = $.extend({}, this.config, { + trigger: 'manual', + selector: '' + }); + } else { + this._fixTitle(); + } + } + }, { + key: '_removeTetherClasses', + value: function _removeTetherClasses(i, css) { + return ((css.baseVal || css).match(new RegExp('(^|\\s)' + CLASS_PREFIX + '-\\S+', 'g')) || []).join(' '); + } + }, { + key: '_fixTitle', + value: function _fixTitle() { + var titleType = typeof this.element.getAttribute('data-original-title'); + if (this.element.getAttribute('title') || titleType !== 'string') { + this.element.setAttribute('data-original-title', this.element.getAttribute('title') || ''); + this.element.setAttribute('title', ''); + } + } + }, { + key: '_enter', + value: function _enter(event, context) { + var dataKey = this.constructor.DATA_KEY; -}(jQuery); + context = context || $(event.currentTarget).data(dataKey); -/* ======================================================================== - * Bootstrap: affix.js v3.3.4 - * http://getbootstrap.com/javascript/#affix - * ======================================================================== - * Copyright 2011-2015 Twitter, Inc. - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - * ======================================================================== */ + if (!context) { + context = new this.constructor(event.currentTarget, this._getDelegateConfig()); + $(event.currentTarget).data(dataKey, context); + } + if (event) { + context._activeTrigger[event.type == 'focusin' ? Trigger.FOCUS : Trigger.HOVER] = true; + } -+function ($) { - 'use strict'; + if ($(context.getTipElement()).hasClass(ClassName.IN) || context._hoverState === HoverState.IN) { + context._hoverState = HoverState.IN; + return; + } - // AFFIX CLASS DEFINITION - // ====================== + clearTimeout(context._timeout); - var Affix = function (element, options) { - this.options = $.extend({}, Affix.DEFAULTS, options) + context._hoverState = HoverState.IN; - this.$target = $(this.options.target) - .on('scroll.bs.affix.data-api', $.proxy(this.checkPosition, this)) - .on('click.bs.affix.data-api', $.proxy(this.checkPositionWithEventLoop, this)) + if (!context.config.delay || !context.config.delay.show) { + context.show(); + return; + } - this.$element = $(element) - this.affixed = null - this.unpin = null - this.pinnedOffset = null + context._timeout = setTimeout(function () { + if (context._hoverState === HoverState.IN) { + context.show(); + } + }, context.config.delay.show); + } + }, { + key: '_leave', + value: function _leave(event, context) { + var dataKey = this.constructor.DATA_KEY; - this.checkPosition() - } + context = context || $(event.currentTarget).data(dataKey); - Affix.VERSION = '3.3.4' + if (!context) { + context = new this.constructor(event.currentTarget, this._getDelegateConfig()); + $(event.currentTarget).data(dataKey, context); + } - Affix.RESET = 'affix affix-top affix-bottom' + if (event) { + context._activeTrigger[event.type == 'focusout' ? Trigger.FOCUS : Trigger.HOVER] = false; + } - Affix.DEFAULTS = { - offset: 0, - target: window - } + if (context._isWithActiveTrigger()) { + return; + } - Affix.prototype.getState = function (scrollHeight, height, offsetTop, offsetBottom) { - var scrollTop = this.$target.scrollTop() - var position = this.$element.offset() - var targetHeight = this.$target.height() + clearTimeout(context._timeout); - if (offsetTop != null && this.affixed == 'top') return scrollTop < offsetTop ? 'top' : false + context._hoverState = HoverState.OUT; - if (this.affixed == 'bottom') { - if (offsetTop != null) return (scrollTop + this.unpin <= position.top) ? false : 'bottom' - return (scrollTop + targetHeight <= scrollHeight - offsetBottom) ? false : 'bottom' - } + if (!context.config.delay || !context.config.delay.hide) { + context.hide(); + return; + } - var initializing = this.affixed == null - var colliderTop = initializing ? scrollTop : position.top - var colliderHeight = initializing ? targetHeight : height + context._timeout = setTimeout(function () { + if (context._hoverState === HoverState.OUT) { + context.hide(); + } + }, context.config.delay.hide); + } + }, { + key: '_isWithActiveTrigger', + value: function _isWithActiveTrigger() { + for (var trigger in this._activeTrigger) { + if (this._activeTrigger[trigger]) { + return true; + } + } - if (offsetTop != null && scrollTop <= offsetTop) return 'top' - if (offsetBottom != null && (colliderTop + colliderHeight >= scrollHeight - offsetBottom)) return 'bottom' + return false; + } + }, { + key: '_getConfig', + value: function _getConfig(config) { + config = $.extend({}, this.constructor.Default, $(this.element).data(), config); + + if (config.delay && typeof config.delay === 'number') { + config.delay = { + show: config.delay, + hide: config.delay + }; + } - return false - } + return config; + } + }, { + key: '_getDelegateConfig', + value: function _getDelegateConfig() { + var config = {}; + + if (this.config) { + for (var key in this.config) { + var value = this.config[key]; + if (this.constructor.Default[key] !== value) { + config[key] = value; + } + } + } - Affix.prototype.getPinnedOffset = function () { - if (this.pinnedOffset) return this.pinnedOffset - this.$element.removeClass(Affix.RESET).addClass('affix') - var scrollTop = this.$target.scrollTop() - var position = this.$element.offset() - return (this.pinnedOffset = position.top - scrollTop) - } + return config; + } + }], [{ + key: 'VERSION', - Affix.prototype.checkPositionWithEventLoop = function () { - setTimeout($.proxy(this.checkPosition, this), 1) - } + // getters - Affix.prototype.checkPosition = function () { - if (!this.$element.is(':visible')) return + get: function () { + return VERSION; + } + }, { + key: 'Default', + get: function () { + return Default; + } + }, { + key: 'NAME', + get: function () { + return NAME; + } + }, { + key: 'DATA_KEY', + get: function () { + return DATA_KEY; + } + }, { + key: 'Event', + get: function () { + return Event; + } + }, { + key: '_jQueryInterface', - var height = this.$element.height() - var offset = this.options.offset - var offsetTop = offset.top - var offsetBottom = offset.bottom - var scrollHeight = Math.max($(document).height(), $(document.body).height()) + // static - if (typeof offset != 'object') offsetBottom = offsetTop = offset - if (typeof offsetTop == 'function') offsetTop = offset.top(this.$element) - if (typeof offsetBottom == 'function') offsetBottom = offset.bottom(this.$element) + value: function _jQueryInterface(config) { + return this.each(function () { + var data = $(this).data(DATA_KEY); + var _config = typeof config === 'object' ? config : null; - var affix = this.getState(scrollHeight, height, offsetTop, offsetBottom) + if (!data && /destroy|hide/.test(config)) { + return; + } - if (this.affixed != affix) { - if (this.unpin != null) this.$element.css('top', '') + if (!data) { + data = new Tooltip(this, _config); + $(this).data(DATA_KEY, data); + } - var affixType = 'affix' + (affix ? '-' + affix : '') - var e = $.Event(affixType + '.bs.affix') + if (typeof config === 'string') { + data[config](); + } + }); + } + }]); + + return Tooltip; + })(); + + /** + * ------------------------------------------------------------------------ + * jQuery + * ------------------------------------------------------------------------ + */ + + $.fn[NAME] = Tooltip._jQueryInterface; + $.fn[NAME].Constructor = Tooltip; + $.fn[NAME].noConflict = function () { + $.fn[NAME] = JQUERY_NO_CONFLICT; + return Tooltip._jQueryInterface; + }; + + return Tooltip; +})(jQuery); + +/** + * -------------------------------------------------------------------------- + * Bootstrap (v4.0.0): popover.js + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * -------------------------------------------------------------------------- + */ - this.$element.trigger(e) +var Popover = (function ($) { - if (e.isDefaultPrevented()) return + /** + * ------------------------------------------------------------------------ + * Constants + * ------------------------------------------------------------------------ + */ - this.affixed = affix - this.unpin = affix == 'bottom' ? this.getPinnedOffset() : null + var NAME = 'popover'; + var VERSION = '4.0.0'; + var DATA_KEY = 'bs.popover'; + var JQUERY_NO_CONFLICT = $.fn[NAME]; - this.$element - .removeClass(Affix.RESET) - .addClass(affixType) - .trigger(affixType.replace('affix', 'affixed') + '.bs.affix') + var Default = $.extend({}, Tooltip.Default, { + placement: 'right', + trigger: 'click', + content: '', + template: '' + }); + + var ClassName = { + FADE: 'fade', + IN: 'in' + }; + + var Selector = { + TITLE: '.popover-title', + CONTENT: '.popover-content', + ARROW: '.popover-arrow' + }; + + var Event = { + HIDE: 'hide.bs.popover', + HIDDEN: 'hidden.bs.popover', + SHOW: 'show.bs.popover', + SHOWN: 'shown.bs.popover', + INSERTED: 'inserted.bs.popover', + CLICK: 'click.bs.popover', + FOCUSIN: 'focusin.bs.popover', + FOCUSOUT: 'focusout.bs.popover', + MOUSEENTER: 'mouseenter.bs.popover', + MOUSELEAVE: 'mouseleave.bs.popover' + }; + + /** + * ------------------------------------------------------------------------ + * Class Definition + * ------------------------------------------------------------------------ + */ + + var Popover = (function (_Tooltip) { + function Popover() { + _classCallCheck(this, Popover); + + if (_Tooltip != null) { + _Tooltip.apply(this, arguments); + } } - if (affix == 'bottom') { - this.$element.offset({ - top: scrollHeight - height - offsetBottom - }) - } - } + _inherits(Popover, _Tooltip); + _createClass(Popover, [{ + key: 'isWithContent', - // AFFIX PLUGIN DEFINITION - // ======================= + // overrides - function Plugin(option) { - return this.each(function () { - var $this = $(this) - var data = $this.data('bs.affix') - var options = typeof option == 'object' && option + value: function isWithContent() { + return this.getTitle() || this._getContent(); + } + }, { + key: 'getTipElement', + value: function getTipElement() { + return this.tip = this.tip || $(this.config.template)[0]; + } + }, { + key: 'setContent', + value: function setContent() { + var tip = this.getTipElement(); + var title = this.getTitle(); + var content = this._getContent(); + var titleElement = $(tip).find(Selector.TITLE)[0]; + + if (titleElement) { + titleElement[this.config.html ? 'innerHTML' : 'innerText'] = title; + } - if (!data) $this.data('bs.affix', (data = new Affix(this, options))) - if (typeof option == 'string') data[option]() - }) - } + // we use append for html objects to maintain js events + $(tip).find(Selector.CONTENT).children().detach().end()[this.config.html ? typeof content === 'string' ? 'html' : 'append' : 'text'](content); - var old = $.fn.affix + $(tip).removeClass(ClassName.FADE).removeClass(ClassName.IN); - $.fn.affix = Plugin - $.fn.affix.Constructor = Affix + this.cleanupTether(); + } + }, { + key: '_getContent', + // private - // AFFIX NO CONFLICT - // ================= + value: function _getContent() { + return this.element.getAttribute('data-content') || (typeof this.config.content == 'function' ? this.config.content.call(this.element) : this.config.content); + } + }], [{ + key: 'VERSION', - $.fn.affix.noConflict = function () { - $.fn.affix = old - return this - } + // getters + get: function () { + return VERSION; + } + }, { + key: 'Default', + get: function () { + return Default; + } + }, { + key: 'NAME', + get: function () { + return NAME; + } + }, { + key: 'DATA_KEY', + get: function () { + return DATA_KEY; + } + }, { + key: 'Event', + get: function () { + return Event; + } + }, { + key: '_jQueryInterface', - // AFFIX DATA-API - // ============== + // static - $(window).on('load', function () { - $('[data-spy="affix"]').each(function () { - var $spy = $(this) - var data = $spy.data() + value: function _jQueryInterface(config) { + return this.each(function () { + var data = $(this).data(DATA_KEY); + var _config = typeof config === 'object' ? config : null; - data.offset = data.offset || {} + if (!data && /destroy|hide/.test(config)) { + return; + } - if (data.offsetBottom != null) data.offset.bottom = data.offsetBottom - if (data.offsetTop != null) data.offset.top = data.offsetTop + if (!data) { + data = new Popover(this, _config); + $(this).data(DATA_KEY, data); + } - Plugin.call($spy, data) - }) - }) + if (typeof config === 'string') { + data[config](); + } + }); + } + }]); + + return Popover; + })(Tooltip); + + /** + * ------------------------------------------------------------------------ + * jQuery + * ------------------------------------------------------------------------ + */ + + $.fn[NAME] = Popover._jQueryInterface; + $.fn[NAME].Constructor = Popover; + $.fn[NAME].noConflict = function () { + $.fn[NAME] = JQUERY_NO_CONFLICT; + return Popover._jQueryInterface; + }; + + return Popover; +})(jQuery); }(jQuery); diff --git a/dist/js/bootstrap.min.js b/dist/js/bootstrap.min.js index 766575923..25d445560 100644 --- a/dist/js/bootstrap.min.js +++ b/dist/js/bootstrap.min.js @@ -3,5 +3,5 @@ * Copyright 2011-2015 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) */ -if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){var b=a.fn.jquery.split(" ")[0].split(".");if(b[0]<2&&b[1]<9||1==b[0]&&9==b[1]&&b[2]<1)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher")}(jQuery),+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one("bsTransitionEnd",function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b(),a.support.transition&&(a.event.special.bsTransitionEnd={bindType:a.support.transition.end,delegateType:a.support.transition.end,handle:function(b){return a(b.target).is(this)?b.handleObj.handler.apply(this,arguments):void 0}})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var c=a(this),e=c.data("bs.alert");e||c.data("bs.alert",e=new d(this)),"string"==typeof b&&e[b].call(c)})}var c='[data-dismiss="alert"]',d=function(b){a(b).on("click",c,this.close)};d.VERSION="3.3.4",d.TRANSITION_DURATION=150,d.prototype.close=function(b){function c(){g.detach().trigger("closed.bs.alert").remove()}var e=a(this),f=e.attr("data-target");f||(f=e.attr("href"),f=f&&f.replace(/.*(?=#[^\s]*$)/,""));var g=a(f);b&&b.preventDefault(),g.length||(g=e.closest(".alert")),g.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(g.removeClass("in"),a.support.transition&&g.hasClass("fade")?g.one("bsTransitionEnd",c).emulateTransitionEnd(d.TRANSITION_DURATION):c())};var e=a.fn.alert;a.fn.alert=b,a.fn.alert.Constructor=d,a.fn.alert.noConflict=function(){return a.fn.alert=e,this},a(document).on("click.bs.alert.data-api",c,d.prototype.close)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof b&&b;e||d.data("bs.button",e=new c(this,f)),"toggle"==b?e.toggle():b&&e.setState(b)})}var c=function(b,d){this.$element=a(b),this.options=a.extend({},c.DEFAULTS,d),this.isLoading=!1};c.VERSION="3.3.4",c.DEFAULTS={loadingText:"loading..."},c.prototype.setState=function(b){var c="disabled",d=this.$element,e=d.is("input")?"val":"html",f=d.data();b+="Text",null==f.resetText&&d.data("resetText",d[e]()),setTimeout(a.proxy(function(){d[e](null==f[b]?this.options[b]:f[b]),"loadingText"==b?(this.isLoading=!0,d.addClass(c).attr(c,c)):this.isLoading&&(this.isLoading=!1,d.removeClass(c).removeAttr(c))},this),0)},c.prototype.toggle=function(){var a=!0,b=this.$element.closest('[data-toggle="buttons"]');if(b.length){var c=this.$element.find("input");"radio"==c.prop("type")?(c.prop("checked")&&(a=!1),b.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==c.prop("type")&&(c.prop("checked")!==this.$element.hasClass("active")&&(a=!1),this.$element.toggleClass("active")),c.prop("checked",this.$element.hasClass("active")),a&&c.trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active")};var d=a.fn.button;a.fn.button=b,a.fn.button.Constructor=c,a.fn.button.noConflict=function(){return a.fn.button=d,this},a(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(c){var d=a(c.target);d.hasClass("btn")||(d=d.closest(".btn")),b.call(d,"toggle"),a(c.target).is('input[type="radio"]')||a(c.target).is('input[type="checkbox"]')||c.preventDefault()}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(b){a(b.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(b.type))})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},c.DEFAULTS,d.data(),"object"==typeof b&&b),g="string"==typeof b?b:f.slide;e||d.data("bs.carousel",e=new c(this,f)),"number"==typeof b?e.to(b):g?e[g]():f.interval&&e.pause().cycle()})}var c=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",a.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",a.proxy(this.pause,this)).on("mouseleave.bs.carousel",a.proxy(this.cycle,this))};c.VERSION="3.3.4",c.TRANSITION_DURATION=600,c.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},c.prototype.keydown=function(a){if(!/input|textarea/i.test(a.target.tagName)){switch(a.which){case 37:this.prev();break;case 39:this.next();break;default:return}a.preventDefault()}},c.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},c.prototype.getItemIndex=function(a){return this.$items=a.parent().children(".item"),this.$items.index(a||this.$active)},c.prototype.getItemForDirection=function(a,b){var c=this.getItemIndex(b),d="prev"==a&&0===c||"next"==a&&c==this.$items.length-1;if(d&&!this.options.wrap)return b;var e="prev"==a?-1:1,f=(c+e)%this.$items.length;return this.$items.eq(f)},c.prototype.to=function(a){var b=this,c=this.getItemIndex(this.$active=this.$element.find(".item.active"));return a>this.$items.length-1||0>a?void 0:this.sliding?this.$element.one("slid.bs.carousel",function(){b.to(a)}):c==a?this.pause().cycle():this.slide(a>c?"next":"prev",this.$items.eq(a))},c.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},c.prototype.next=function(){return this.sliding?void 0:this.slide("next")},c.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},c.prototype.slide=function(b,d){var e=this.$element.find(".item.active"),f=d||this.getItemForDirection(b,e),g=this.interval,h="next"==b?"left":"right",i=this;if(f.hasClass("active"))return this.sliding=!1;var j=f[0],k=a.Event("slide.bs.carousel",{relatedTarget:j,direction:h});if(this.$element.trigger(k),!k.isDefaultPrevented()){if(this.sliding=!0,g&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var l=a(this.$indicators.children()[this.getItemIndex(f)]);l&&l.addClass("active")}var m=a.Event("slid.bs.carousel",{relatedTarget:j,direction:h});return a.support.transition&&this.$element.hasClass("slide")?(f.addClass(b),f[0].offsetWidth,e.addClass(h),f.addClass(h),e.one("bsTransitionEnd",function(){f.removeClass([b,h].join(" ")).addClass("active"),e.removeClass(["active",h].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger(m)},0)}).emulateTransitionEnd(c.TRANSITION_DURATION)):(e.removeClass("active"),f.addClass("active"),this.sliding=!1,this.$element.trigger(m)),g&&this.cycle(),this}};var d=a.fn.carousel;a.fn.carousel=b,a.fn.carousel.Constructor=c,a.fn.carousel.noConflict=function(){return a.fn.carousel=d,this};var e=function(c){var d,e=a(this),f=a(e.attr("data-target")||(d=e.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""));if(f.hasClass("carousel")){var g=a.extend({},f.data(),e.data()),h=e.attr("data-slide-to");h&&(g.interval=!1),b.call(f,g),h&&f.data("bs.carousel").to(h),c.preventDefault()}};a(document).on("click.bs.carousel.data-api","[data-slide]",e).on("click.bs.carousel.data-api","[data-slide-to]",e),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var c=a(this);b.call(c,c.data())})})}(jQuery),+function(a){"use strict";function b(b){var c,d=b.attr("data-target")||(c=b.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"");return a(d)}function c(b){return this.each(function(){var c=a(this),e=c.data("bs.collapse"),f=a.extend({},d.DEFAULTS,c.data(),"object"==typeof b&&b);!e&&f.toggle&&/show|hide/.test(b)&&(f.toggle=!1),e||c.data("bs.collapse",e=new d(this,f)),"string"==typeof b&&e[b]()})}var d=function(b,c){this.$element=a(b),this.options=a.extend({},d.DEFAULTS,c),this.$trigger=a('[data-toggle="collapse"][href="#'+b.id+'"],[data-toggle="collapse"][data-target="#'+b.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};d.VERSION="3.3.4",d.TRANSITION_DURATION=350,d.DEFAULTS={toggle:!0},d.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},d.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b,e=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(e&&e.length&&(b=e.data("bs.collapse"),b&&b.transitioning))){var f=a.Event("show.bs.collapse");if(this.$element.trigger(f),!f.isDefaultPrevented()){e&&e.length&&(c.call(e,"hide"),b||e.data("bs.collapse",null));var g=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[g](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var h=function(){this.$element.removeClass("collapsing").addClass("collapse in")[g](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return h.call(this);var i=a.camelCase(["scroll",g].join("-"));this.$element.one("bsTransitionEnd",a.proxy(h,this)).emulateTransitionEnd(d.TRANSITION_DURATION)[g](this.$element[0][i])}}}},d.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[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 e=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};return a.support.transition?void this.$element[c](0).one("bsTransitionEnd",a.proxy(e,this)).emulateTransitionEnd(d.TRANSITION_DURATION):e.call(this)}}},d.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},d.prototype.getParent=function(){return a(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(a.proxy(function(c,d){var e=a(d);this.addAriaAndCollapsedClass(b(e),e)},this)).end()},d.prototype.addAriaAndCollapsedClass=function(a,b){var c=a.hasClass("in");a.attr("aria-expanded",c),b.toggleClass("collapsed",!c).attr("aria-expanded",c)};var e=a.fn.collapse;a.fn.collapse=c,a.fn.collapse.Constructor=d,a.fn.collapse.noConflict=function(){return a.fn.collapse=e,this},a(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(d){var e=a(this);e.attr("data-target")||d.preventDefault();var f=b(e),g=f.data("bs.collapse"),h=g?"toggle":e.data();c.call(f,h)})}(jQuery),+function(a){"use strict";function b(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#[A-Za-z]/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}function c(c){c&&3===c.which||(a(e).remove(),a(f).each(function(){var d=a(this),e=b(d),f={relatedTarget:this};e.hasClass("open")&&(c&&"click"==c.type&&/input|textarea/i.test(c.target.tagName)&&a.contains(e[0],c.target)||(e.trigger(c=a.Event("hide.bs.dropdown",f)),c.isDefaultPrevented()||(d.attr("aria-expanded","false"),e.removeClass("open").trigger("hidden.bs.dropdown",f))))}))}function d(b){return this.each(function(){var c=a(this),d=c.data("bs.dropdown");d||c.data("bs.dropdown",d=new g(this)),"string"==typeof b&&d[b].call(c)})}var e=".dropdown-backdrop",f='[data-toggle="dropdown"]',g=function(b){a(b).on("click.bs.dropdown",this.toggle)};g.VERSION="3.3.4",g.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=b(e),g=f.hasClass("open");if(c(),!g){"ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(a(this)).on("click",c);var h={relatedTarget:this};if(f.trigger(d=a.Event("show.bs.dropdown",h)),d.isDefaultPrevented())return;e.trigger("focus").attr("aria-expanded","true"),f.toggleClass("open").trigger("shown.bs.dropdown",h)}return!1}},g.prototype.keydown=function(c){if(/(38|40|27|32)/.test(c.which)&&!/input|textarea/i.test(c.target.tagName)){var d=a(this);if(c.preventDefault(),c.stopPropagation(),!d.is(".disabled, :disabled")){var e=b(d),g=e.hasClass("open");if(!g&&27!=c.which||g&&27==c.which)return 27==c.which&&e.find(f).trigger("focus"),d.trigger("click");var h=" li:not(.disabled):visible a",i=e.find('[role="menu"]'+h+', [role="listbox"]'+h);if(i.length){var j=i.index(c.target);38==c.which&&j>0&&j--,40==c.which&&jdocument.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&a?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!a?this.scrollbarWidth:""})},c.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},c.prototype.checkScrollbar=function(){var a=window.innerWidth;if(!a){var b=document.documentElement.getBoundingClientRect();a=b.right-Math.abs(b.left)}this.bodyIsOverflowing=document.body.clientWidth
',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},c.prototype.init=function(b,c,d){if(this.enabled=!0,this.type=b,this.$element=a(c),this.options=this.getOptions(d),this.$viewport=this.options.viewport&&a(a.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},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!");for(var e=this.options.trigger.split(" "),f=e.length;f--;){var g=e[f];if("click"==g)this.$element.on("click."+this.type,this.options.selector,a.proxy(this.toggle,this));else if("manual"!=g){var h="hover"==g?"mouseenter":"focusin",i="hover"==g?"mouseleave":"focusout";this.$element.on(h+"."+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(i+"."+this.type,this.options.selector,a.proxy(this.leave,this))}}this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.getOptions=function(b){return b=a.extend({},this.getDefaults(),this.$element.data(),b),b.delay&&"number"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),b},c.prototype.getDelegateOptions=function(){var b={},c=this.getDefaults();return this._options&&a.each(this._options,function(a,d){c[a]!=d&&(b[a]=d)}),b},c.prototype.enter=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusin"==b.type?"focus":"hover"]=!0),c.tip().hasClass("in")||"in"==c.hoverState?void(c.hoverState="in"):(clearTimeout(c.timeout),c.hoverState="in",c.options.delay&&c.options.delay.show?void(c.timeout=setTimeout(function(){"in"==c.hoverState&&c.show()},c.options.delay.show)):c.show())},c.prototype.isInStateTrue=function(){for(var a in this.inState)if(this.inState[a])return!0;return!1},c.prototype.leave=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusout"==b.type?"focus":"hover"]=!1),c.isInStateTrue()?void 0:(clearTimeout(c.timeout),c.hoverState="out",c.options.delay&&c.options.delay.hide?void(c.timeout=setTimeout(function(){"out"==c.hoverState&&c.hide()},c.options.delay.hide)):c.hide())},c.prototype.show=function(){var b=a.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(b);var d=a.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(b.isDefaultPrevented()||!d)return;var e=this,f=this.tip(),g=this.getUID(this.type);this.setContent(),f.attr("id",g),this.$element.attr("aria-describedby",g),this.options.animation&&f.addClass("fade");var h="function"==typeof this.options.placement?this.options.placement.call(this,f[0],this.$element[0]):this.options.placement,i=/\s?auto?\s?/i,j=i.test(h);j&&(h=h.replace(i,"")||"top"),f.detach().css({top:0,left:0,display:"block"}).addClass(h).data("bs."+this.type,this),this.options.container?f.appendTo(this.options.container):f.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var k=this.getPosition(),l=f[0].offsetWidth,m=f[0].offsetHeight;if(j){var n=h,o=this.getPosition(this.$viewport);h="bottom"==h&&k.bottom+m>o.bottom?"top":"top"==h&&k.top-mo.width?"left":"left"==h&&k.left-lg.top+g.height&&(e.top=g.top+g.height-i)}else{var j=b.left-f,k=b.left+f+c;jg.right&&(e.left=g.left+g.width-k)}return e},c.prototype.getTitle=function(){var a,b=this.$element,c=this.options;return a=b.attr("data-original-title")||("function"==typeof c.title?c.title.call(b[0]):c.title)},c.prototype.getUID=function(a){do a+=~~(1e6*Math.random());while(document.getElementById(a));return a},c.prototype.tip=function(){if(!this.$tip&&(this.$tip=a(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},c.prototype.enable=function(){this.enabled=!0},c.prototype.disable=function(){this.enabled=!1},c.prototype.toggleEnabled=function(){this.enabled=!this.enabled},c.prototype.toggle=function(b){var c=this;b&&(c=a(b.currentTarget).data("bs."+this.type),c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c))),b?(c.inState.click=!c.inState.click,c.isInStateTrue()?c.enter(c):c.leave(c)):c.tip().hasClass("in")?c.leave(c):c.enter(c)},c.prototype.destroy=function(){var a=this;clearTimeout(this.timeout),this.hide(function(){a.$element.off("."+a.type).removeData("bs."+a.type),a.$tip&&a.$tip.detach(),a.$tip=null,a.$arrow=null,a.$viewport=null})};var d=a.fn.tooltip;a.fn.tooltip=b,a.fn.tooltip.Constructor=c,a.fn.tooltip.noConflict=function(){return a.fn.tooltip=d,this}}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof b&&b;(e||!/destroy|hide/.test(b))&&(e||d.data("bs.popover",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.init("popover",a,b)};if(!a.fn.tooltip)throw new Error("Popover requires tooltip.js");c.VERSION="3.3.4",c.DEFAULTS=a.extend({},a.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:''}),c.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),c.prototype.constructor=c,c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content").children().detach().end()[this.options.html?"string"==typeof c?"html":"append":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},c.prototype.hasContent=function(){return this.getTitle()||this.getContent()},c.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var d=a.fn.popover;a.fn.popover=b,a.fn.popover.Constructor=c,a.fn.popover.noConflict=function(){return a.fn.popover=d,this}}(jQuery),+function(a){"use strict";function b(c,d){this.$body=a(document.body),this.$scrollElement=a(a(c).is(document.body)?window:c),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",a.proxy(this.process,this)),this.refresh(),this.process()}function c(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})}b.VERSION="3.3.4",b.DEFAULTS={offset:10},b.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},b.prototype.refresh=function(){var b=this,c="offset",d=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),a.isWindow(this.$scrollElement[0])||(c="position",d=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map(function(){var b=a(this),e=b.data("target")||b.attr("href"),f=/^#./.test(e)&&a(e);return f&&f.length&&f.is(":visible")&&[[f[c]().top+d,e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){b.offsets.push(this[0]),b.targets.push(this[1])})},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.getScrollHeight(),d=this.options.offset+c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(this.scrollHeight!=c&&this.refresh(),b>=d)return g!=(a=f[f.length-1])&&this.activate(a);if(g&&b=e[a]&&(void 0===e[a+1]||b .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),b.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),h?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu").length&&b.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),e&&e()}var g=d.find("> .active"),h=e&&a.support.transition&&(g.length&&g.hasClass("fade")||!!d.find("> .fade").length);g.length&&h?g.one("bsTransitionEnd",f).emulateTransitionEnd(c.TRANSITION_DURATION):f(),g.removeClass("in")};var d=a.fn.tab;a.fn.tab=b,a.fn.tab.Constructor=c,a.fn.tab.noConflict=function(){return a.fn.tab=d,this};var e=function(c){c.preventDefault(),b.call(a(this),"show")};a(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',e).on("click.bs.tab.data-api",'[data-toggle="pill"]',e)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof b&&b;e||d.data("bs.affix",e=new c(this,f)),"string"==typeof b&&e[b]()})}var c=function(b,d){this.options=a.extend({},c.DEFAULTS,d),this.$target=a(this.options.target).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(b),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};c.VERSION="3.3.4",c.RESET="affix affix-top affix-bottom",c.DEFAULTS={offset:0,target:window},c.prototype.getState=function(a,b,c,d){var e=this.$target.scrollTop(),f=this.$element.offset(),g=this.$target.height();if(null!=c&&"top"==this.affixed)return c>e?"top":!1;if("bottom"==this.affixed)return null!=c?e+this.unpin<=f.top?!1:"bottom":a-d>=e+g?!1:"bottom";var h=null==this.affixed,i=h?e:f.top,j=h?g:b;return null!=c&&c>=e?"top":null!=d&&i+j>=a-d?"bottom":!1},c.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(c.RESET).addClass("affix");var a=this.$target.scrollTop(),b=this.$element.offset();return this.pinnedOffset=b.top-a},c.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},c.prototype.checkPosition=function(){if(this.$element.is(":visible")){var b=this.$element.height(),d=this.options.offset,e=d.top,f=d.bottom,g=Math.max(a(document).height(),a(document.body).height());"object"!=typeof d&&(f=e=d),"function"==typeof e&&(e=d.top(this.$element)),"function"==typeof f&&(f=d.bottom(this.$element));var h=this.getState(g,b,e,f);if(this.affixed!=h){null!=this.unpin&&this.$element.css("top","");var i="affix"+(h?"-"+h:""),j=a.Event(i+".bs.affix");if(this.$element.trigger(j),j.isDefaultPrevented())return;this.affixed=h,this.unpin="bottom"==h?this.getPinnedOffset():null,this.$element.removeClass(c.RESET).addClass(i).trigger(i.replace("affix","affixed")+".bs.affix")}"bottom"==h&&this.$element.offset({top:g-b-f})}};var d=a.fn.affix;a.fn.affix=b,a.fn.affix.Constructor=c,a.fn.affix.noConflict=function(){return a.fn.affix=d,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var c=a(this),d=c.data();d.offset=d.offset||{},null!=d.offsetBottom&&(d.offset.bottom=d.offsetBottom),null!=d.offsetTop&&(d.offset.top=d.offsetTop),b.call(c,d)})})}(jQuery); \ No newline at end of file +if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){var b=a.fn.jquery.split(" ")[0].split(".");if(b[0]<2&&b[1]<9||1==b[0]&&9==b[1]&&b[2]<1)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher")}(jQuery),+function(){"use strict";function a(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(a.__proto__=b)}function b(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}{var c=function(){function a(a,b){for(var c=0;cthis._items.length-1||0>b)){if(this._isSliding)return void a(this._element).one(l.SLID,function(){return c.to(b)});if(d==b)return this.pause(),void this.cycle();var e=b>d?k.NEXT:k.PREVIOUS;this._slide(e,this._items[b])}}},{key:"_addEventListeners",value:function(){this._config.keyboard&&a(this._element).on("keydown.bs.carousel",this._keydown.bind(this)),"hover"!=this._config.pause||"ontouchstart"in document.documentElement||a(this._element).on("mouseenter.bs.carousel",this.pause.bind(this)).on("mouseleave.bs.carousel",this.cycle.bind(this))}},{key:"_keydown",value:function(a){if(a.preventDefault(),!/input|textarea/i.test(a.target.tagName))switch(a.which){case 37:this.prev();break;case 39:this.next();break;default:return}}},{key:"_getItemIndex",value:function(b){return this._items=a.makeArray(a(b).parent().find(n.ITEM)),this._items.indexOf(b)}},{key:"_getItemByDirection",value:function(a,b){var c=a===k.NEXT,d=a===k.PREVIOUS,e=this._getItemIndex(b),f=this._items.length-1,g=d&&0===e||c&&e==f;if(g&&!this._config.wrap)return b;var h=a==k.PREVIOUS?-1:1,i=(e+h)%this._items.length;return-1===i?this._items[this._items.length-1]:this._items[i]}},{key:"_triggerSlideEvent",value:function(b,c){var d=a.Event(l.SLIDE,{relatedTarget:b,direction:c});return a(this._element).trigger(d),d}},{key:"_setActiveIndicatorElement",value:function(b){if(this._indicatorsElement){a(this._indicatorsElement).find(n.ACTIVE).removeClass(m.ACTIVE);var c=this._indicatorsElement.children[this._getItemIndex(b)];c&&a(c).addClass(m.ACTIVE)}}},{key:"_slide",value:function(b,c){var e=this,f=a(this._element).find(n.ACTIVE_ITEM)[0],g=c||f&&this._getItemByDirection(b,f),h=!!this._interval,j=b==k.NEXT?m.LEFT:m.RIGHT;if(g&&a(g).hasClass(m.ACTIVE))return void(this._isSliding=!1);var o=this._triggerSlideEvent(g,j);if(!o.isDefaultPrevented()&&f&&g){this._isSliding=!0,h&&this.pause(),this._setActiveIndicatorElement(g);var p=a.Event(l.SLID,{relatedTarget:g,direction:j});d.supportsTransitionEnd()&&a(this._element).hasClass(m.SLIDE)?(a(g).addClass(b),d.reflow(g),a(f).addClass(j),a(g).addClass(j),a(f).one(d.TRANSITION_END,function(){a(g).removeClass(j).removeClass(b),a(g).addClass(m.ACTIVE),a(f).removeClass(m.ACTIVE).removeClass(b).removeClass(j),e._isSliding=!1,setTimeout(function(){return a(e._element).trigger(p)},0)}).emulateTransitionEnd(i)):(a(f).removeClass(m.ACTIVE),a(g).addClass(m.ACTIVE),this._isSliding=!1,a(this._element).trigger(p)),h&&this.cycle()}}}],[{key:"VERSION",get:function(){return f}},{key:"Default",get:function(){return j}},{key:"_jQueryInterface",value:function(b){return this.each(function(){var c=a(this).data(g),d=a.extend({},j,a(this).data());"object"==typeof b&&a.extend(d,b);var f="string"==typeof b?b:d.slide;c||(c=new e(this,d),a(this).data(g,c)),"number"==typeof b?c.to(b):f?c[f]():d.interval&&(c.pause(),c.cycle())})}},{key:"_dataApiClickHandler",value:function(b){var c=d.getSelectorFromElement(this);if(c){var f=a(c)[0];if(f&&a(f).hasClass(m.CAROUSEL)){var h=a.extend({},a(f).data(),a(this).data()),i=this.getAttribute("data-slide-to");i&&(h.interval=!1),e._jQueryInterface.call(a(f),h),i&&a(f).data(g).to(i),b.preventDefault()}}}}]),e}();return a(document).on(l.CLICK,n.DATA_SLIDE,o._dataApiClickHandler),a(window).on(l.LOAD,function(){a(n.DATA_RIDE).each(function(){var b=a(this);o._jQueryInterface.call(b,b.data())})}),a.fn[e]=o._jQueryInterface,a.fn[e].Constructor=o,a.fn[e].noConflict=function(){return a.fn[e]=h,o._jQueryInterface},o}(jQuery),function(a){var e="collapse",f="4.0.0",g="bs.collapse",h=a.fn[e],i=600,j={toggle:!0,parent:null},k={SHOW:"show.bs.collapse",SHOWN:"shown.bs.collapse",HIDE:"hide.bs.collapse",HIDDEN:"hidden.bs.collapse",CLICK:"click.bs.collapse.data-api"},l={IN:"in",COLLAPSE:"collapse",COLLAPSING:"collapsing",COLLAPSED:"collapsed"},m={WIDTH:"width",HEIGHT:"height"},n={ACTIVES:".panel > .in, .panel > .collapsing",DATA_TOGGLE:'[data-toggle="collapse"]'},o=function(){function e(c,d){b(this,e),this._isTransitioning=!1,this._element=c,this._config=a.extend({},j,d),this._triggerArray=a.makeArray(a('[data-toggle="collapse"][href="#'+c.id+'"],'+('[data-toggle="collapse"][data-target="#'+c.id+'"]'))),this._parent=this._config.parent?this._getParent():null,this._config.parent||this._addAriaAndCollapsedClass(this._element,this._triggerArray),this._config.toggle&&this.toggle()}return c(e,[{key:"toggle",value:function(){a(this._element).hasClass(l.IN)?this.hide():this.show()}},{key:"show",value:function(){var b=this;if(!this._isTransitioning&&!a(this._element).hasClass(l.IN)){var c=void 0,f=void 0;if(this._parent&&(f=a.makeArray(a(n.ACTIVES)),f.length||(f=null)),!(f&&(c=a(f).data(g),c&&c._isTransitioning))){var h=a.Event(k.SHOW);if(a(this._element).trigger(h),!h.isDefaultPrevented()){f&&(e._jQueryInterface.call(a(f),"hide"),c||a(f).data(g,null));var j=this._getDimension();a(this._element).removeClass(l.COLLAPSE).addClass(l.COLLAPSING),this._element.style[j]=0,this._element.setAttribute("aria-expanded",!0),this._triggerArray.length&&a(this._triggerArray).removeClass(l.COLLAPSED).attr("aria-expanded",!0),this.setTransitioning(!0);var m=function(){a(b._element).removeClass(l.COLLAPSING).addClass(l.COLLAPSE).addClass(l.IN),b._element.style[j]="",b.setTransitioning(!1),a(b._element).trigger(k.SHOWN)};if(!d.supportsTransitionEnd())return void m();var o="scroll"+(j[0].toUpperCase()+j.slice(1));a(this._element).one(d.TRANSITION_END,m).emulateTransitionEnd(i),this._element.style[j]=this._element[o]+"px"}}}}},{key:"hide",value:function(){var b=this;if(!this._isTransitioning&&a(this._element).hasClass(l.IN)){var c=a.Event(k.HIDE);if(a(this._element).trigger(c),!c.isDefaultPrevented()){var e=this._getDimension(),f=e===m.WIDTH?"offsetWidth":"offsetHeight";this._element.style[e]=this._element[f]+"px",d.reflow(this._element),a(this._element).addClass(l.COLLAPSING).removeClass(l.COLLAPSE).removeClass(l.IN),this._element.setAttribute("aria-expanded",!1),this._triggerArray.length&&a(this._triggerArray).addClass(l.COLLAPSED).attr("aria-expanded",!1),this.setTransitioning(!0);var g=function(){b.setTransitioning(!1),a(b._element).removeClass(l.COLLAPSING).addClass(l.COLLAPSE).trigger(k.HIDDEN)};return this._element.style[e]=0,d.supportsTransitionEnd()?void a(this._element).one(d.TRANSITION_END,g).emulateTransitionEnd(i):g()}}}},{key:"setTransitioning",value:function(a){this._isTransitioning=a}},{key:"_getDimension",value:function(){var b=a(this._element).hasClass(m.WIDTH);return b?m.WIDTH:m.HEIGHT}},{key:"_getParent",value:function(){var b=this,c=a(this._config.parent)[0],d='[data-toggle="collapse"][data-parent="'+this._config.parent+'"]';return a(c).find(d).each(function(a,c){b._addAriaAndCollapsedClass(e._getTargetFromElement(c),[c])}),c}},{key:"_addAriaAndCollapsedClass",value:function(b,c){if(b){var d=a(b).hasClass(l.IN);b.setAttribute("aria-expanded",d),c.length&&a(c).toggleClass(l.COLLAPSED,!d).attr("aria-expanded",d)}}}],[{key:"VERSION",get:function(){return f}},{key:"Default",get:function(){return j}},{key:"_getTargetFromElement",value:function(b){var c=d.getSelectorFromElement(b);return c?a(c)[0]:null}},{key:"_jQueryInterface",value:function(b){return this.each(function(){var c=a(this),d=c.data(g),f=a.extend({},j,c.data(),"object"==typeof b&&b);!d&&f.toggle&&/show|hide/.test(b)&&(f.toggle=!1),d||(d=new e(this,f),c.data(g,d)),"string"==typeof b&&d[b]()})}}]),e}();return a(document).on(k.CLICK,n.DATA_TOGGLE,function(b){b.preventDefault();var c=o._getTargetFromElement(this),d=a(c).data(g),e=d?"toggle":a(this).data();o._jQueryInterface.call(a(c),e)}),a.fn[e]=o._jQueryInterface,a.fn[e].Constructor=o,a.fn[e].noConflict=function(){return a.fn[e]=h,o._jQueryInterface},o}(jQuery),function(a){var e="dropdown",f="4.0.0",g="bs.dropdown",h=a.fn[e],i={HIDE:"hide.bs.dropdown",HIDDEN:"hidden.bs.dropdown",SHOW:"show.bs.dropdown",SHOWN:"shown.bs.dropdown",CLICK:"click.bs.dropdown",KEYDOWN:"keydown.bs.dropdown.data-api",CLICK_DATA:"click.bs.dropdown.data-api"},j={BACKDROP:"dropdown-backdrop",DISABLED:"disabled",OPEN:"open"},k={BACKDROP:".dropdown-backdrop",DATA_TOGGLE:'[data-toggle="dropdown"]',FORM_CHILD:".dropdown form",ROLE_MENU:'[role="menu"]',ROLE_LISTBOX:'[role="listbox"]',NAVBAR_NAV:".navbar-nav",VISIBLE_ITEMS:'[role="menu"] li:not(.disabled) a, [role="listbox"] li:not(.disabled) a'},l=function(){function e(c){b(this,e),a(c).on(i.CLICK,this.toggle)}return c(e,[{key:"toggle",value:function(){if(!this.disabled&&!a(this).hasClass(j.DISABLED)){var b=e._getParentFromElement(this),c=a(b).hasClass(j.OPEN);if(e._clearMenus(),c)return!1;if("ontouchstart"in document.documentElement&&!a(b).closest(k.NAVBAR_NAV).length){var d=document.createElement("div");d.className=j.BACKDROP,a(d).insertBefore(this),a(d).on("click",e._clearMenus)}var f={relatedTarget:this},g=a.Event(i.SHOW,f);if(a(b).trigger(g),!g.isDefaultPrevented())return this.focus(),this.setAttribute("aria-expanded","true"),a(b).toggleClass(j.OPEN),a(b).trigger(i.SHOWN,f),!1}}}],[{key:"VERSION",get:function(){return f}},{key:"_jQueryInterface",value:function(b){return this.each(function(){var c=a(this).data(g);c||a(this).data(g,c=new e(this)),"string"==typeof b&&c[b].call(this)})}},{key:"_clearMenus",value:function(b){if(!b||3!==b.which){var c=a(k.BACKDROP)[0];c&&c.parentNode.removeChild(c);for(var d=a.makeArray(a(k.DATA_TOGGLE)),f=0;f0&&h--,40===b.which&&hdocument.documentElement.clientHeight;!this._isBodyOverflowing&&a&&(this._element.style.paddingLeft=this._scrollbarWidth+"px"),this._isBodyOverflowing&&!a&&(this._element.style.paddingRight=this._scrollbarWidth+"px")}},{key:"_resetAdjustments",value:function(){this._element.style.paddingLeft="",this._element.style.paddingRight=""}},{key:"_checkScrollbar",value:function(){var a=window.innerWidth;if(!a){var b=document.documentElement.getBoundingClientRect();a=b.right-Math.abs(b.left)}this._isBodyOverflowing=document.body.clientWidth a",this._offsets=[],this._targets=[],this._activeTarget=null,this._scrollHeight=0,a(this._scrollElement).on(j.SCROLL,this._process.bind(this)),this.refresh(),this._process()}return c(e,[{key:"refresh",value:function(){var b=this,c="offset",e=0;this._scrollElement!==this._scrollElement.window&&(c="position",e=this._getScrollTop()),this._offsets=[],this._targets=[],this._scrollHeight=this._getScrollHeight();var f=a.makeArray(a(this._selector));f.map(function(b){var f=void 0,g=d.getSelectorFromElement(b);return g&&(f=a(g)[0]),f&&(f.offsetWidth||f.offsetHeight)?[a(f)[c]().top+e,g]:void 0}).filter(function(a){return a}).sort(function(a,b){return a[0]-b[0]}).forEach(function(a){b._offsets.push(a[0]),b._targets.push(a[1])})}},{key:"_getScrollTop",value:function(){return this._scrollElement===window?this._scrollElement.scrollY:this._scrollElement.scrollTop}},{key:"_getScrollHeight",value:function(){return this._scrollElement.scrollHeight||Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)}},{key:"_process",value:function(){var a=this._getScrollTop()+this._config.offset,b=this._getScrollHeight(),c=this._config.offset+b-this._scrollElement.offsetHeight;if(this._scrollHeight!==b&&this.refresh(),a>=c){var d=this._targets[this._targets.length-1];this._activeTarget!==d&&this._activate(d)}if(this._activeTarget&&a=this._offsets[e]&&(void 0===this._offsets[e+1]||a .fade",ACTIVE:".active",ACTIVE_CHILD:"> .active",DATA_TOGGLE:'[data-toggle="tab"], [data-toggle="pill"]',DROPDOWN_ACTIVE_CHILD:"> .dropdown-menu > .active"},m=function(){function e(a){b(this,e),this._element=a}return c(e,[{key:"show",value:function(){var b=this;if(!this._element.parentNode||this._element.parentNode.nodeType!=Node.ELEMENT_NODE||!a(this._element).parent().hasClass(k.ACTIVE)){var c=void 0,e=void 0,f=a(this._element).closest(l.UL)[0],g=d.getSelectorFromElement(this._element);f&&(e=a.makeArray(a(f).find(l.ACTIVE)),e=e[e.length-1],e&&(e=a(e).find(l.A)[0]));var h=a.Event(j.HIDE,{relatedTarget:this._element}),i=a.Event(j.SHOW,{relatedTarget:e});if(e&&a(e).trigger(h),a(this._element).trigger(i),!i.isDefaultPrevented()&&!h.isDefaultPrevented()){g&&(c=a(g)[0]),this._activate(a(this._element).closest(l.LI)[0],f);var m=function(){var c=a.Event(j.HIDDEN,{relatedTarget:b._element}),d=a.Event(j.SHOWN,{relatedTarget:e});a(e).trigger(c),a(b._element).trigger(d)};c?this._activate(c,c.parentNode,m):m()}}}},{key:"_activate",value:function(b,c,e){var f=a(c).find(l.ACTIVE_CHILD)[0],g=e&&d.supportsTransitionEnd()&&(f&&a(f).hasClass(k.FADE)||!!a(c).find(l.FADE_CHILD)[0]),h=this._transitionComplete.bind(this,b,f,g,e);f&&g?a(f).one(d.TRANSITION_END,h).emulateTransitionEnd(i):h(),f&&a(f).removeClass(k.IN)}},{key:"_transitionComplete",value:function(b,c,e,f){if(c){a(c).removeClass(k.ACTIVE);var g=a(c).find(l.DROPDOWN_ACTIVE_CHILD)[0];g&&a(g).removeClass(k.ACTIVE);var h=a(c).find(l.DATA_TOGGLE)[0];h&&h.setAttribute("aria-expanded",!1)}a(b).addClass(k.ACTIVE);var i=a(b).find(l.DATA_TOGGLE)[0];if(i&&i.setAttribute("aria-expanded",!0),e?(d.reflow(b),a(b).addClass(k.IN)):a(b).removeClass(k.FADE),b.parentNode&&a(b.parentNode).hasClass(k.DROPDOWN_MENU)){var j=a(b).closest(l.LI_DROPDOWN)[0];j&&a(j).addClass(k.ACTIVE),i=a(b).find(l.DATA_TOGGLE)[0],i&&i.setAttribute("aria-expanded",!0)}f&&f()}}],[{key:"VERSION",get:function(){return f}},{key:"Default",get:function(){return Default}},{key:"_jQueryInterface",value:function(b){return this.each(function(){var c=a(this),d=c.data(g);d||(d=d=new e(this),c.data(g,d)),"string"==typeof b&&d[b]()})}}]),e}();return a(document).on(j.CLICK,l.DATA_TOGGLE,function(b){b.preventDefault(),m._jQueryInterface.call(a(this),"show")}),a.fn[e]=m._jQueryInterface,a.fn[e].Constructor=m,a.fn[e].noConflict=function(){return a.fn[e]=h,m._jQueryInterface},m}(jQuery),function(a){var e="tooltip",f="4.0.0",g="bs.tooltip",h=a.fn[e],i=150,j="bs-tether",k={animation:!0,template:'',trigger:"hover focus",title:"",delay:0,html:!1,selector:!1,placement:"top",offset:"0 0",constraints:null},l={TOP:"bottom center",RIGHT:"middle left",BOTTOM:"top center",LEFT:"middle right"},m={IN:"in",OUT:"out"},n={HIDE:"hide.bs.tooltip",HIDDEN:"hidden.bs.tooltip",SHOW:"show.bs.tooltip",SHOWN:"shown.bs.tooltip",INSERTED:"inserted.bs.tooltip",CLICK:"click.bs.tooltip",FOCUSIN:"focusin.bs.tooltip",FOCUSOUT:"focusout.bs.tooltip",MOUSEENTER:"mouseenter.bs.tooltip",MOUSELEAVE:"mouseleave.bs.tooltip"},o={FADE:"fade",IN:"in"},p={TOOLTIP:".tooltip",TOOLTIP_INNER:".tooltip-inner"},q={element:!1,enabled:!1},r={HOVER:"hover",FOCUS:"focus",CLICK:"click",MANUAL:"manual"},s=function(){function h(a,c){b(this,h),this._isEnabled=!0,this._timeout=0,this._hoverState="",this._activeTrigger={},this._tether=null,this.element=a,this.config=this._getConfig(c),this.tip=null,this._setListeners()}return c(h,[{key:"enable",value:function(){this._isEnabled=!0}},{key:"disable",value:function(){this._isEnabled=!1}},{key:"toggleEnabled",value:function(){this._isEnabled=!this._isEnabled}},{key:"toggle",value:function(b){var c=this,d=this.constructor.DATA_KEY;b?(c=a(b.currentTarget).data(d),c||(c=new this.constructor(b.currentTarget,this._getDelegateConfig()),a(b.currentTarget).data(d,c)),c._activeTrigger.click=!c._activeTrigger.click,c._isWithActiveTrigger()?c._enter(null,c):c._leave(null,c)):a(c.getTipElement()).hasClass(o.IN)?c._leave(null,c):c._enter(null,c)}},{key:"destroy",value:function(){var b=this;clearTimeout(this._timeout),this.hide(function(){a(b.element).off("."+b.constructor.NAME).removeData(b.constructor.DATA_KEY),b.tip&&a(b.tip).detach(), +b.tip=null})}},{key:"show",value:function(){var b=this,c=a.Event(this.constructor.Event.SHOW);if(this.isWithContent()&&this._isEnabled){a(this.element).trigger(c);var e=a.contains(this.element.ownerDocument.documentElement,this.element);if(c.isDefaultPrevented()||!e)return;var f=this.getTipElement(),g=d.getUID(this.constructor.NAME);f.setAttribute("id",g),this.element.setAttribute("aria-describedby",g),this.setContent(),this.config.animation&&a(f).addClass(o.FADE);var i="function"==typeof this.config.placement?this.config.placement.call(this,f,this.element):this.config.placement,k=this._getAttachment(i);a(f).data(this.constructor.DATA_KEY,this).appendTo(document.body),a(this.element).trigger(this.constructor.Event.INSERTED),this._tether=new Tether({element:f,target:this.element,attachment:k,classes:q,classPrefix:j,offset:this.config.offset,constraints:this.config.constraints}),d.reflow(f),this._tether.position(),a(f).addClass(o.IN);var l=function(){var c=b._hoverState;b._hoverState=null,a(b.element).trigger(b.constructor.Event.SHOWN),c===m.OUT&&b._leave(null,b)};d.supportsTransitionEnd()&&a(this.tip).hasClass(o.FADE)?a(this.tip).one(d.TRANSITION_END,l).emulateTransitionEnd(h._TRANSITION_DURATION):l()}}},{key:"hide",value:function(b){var c=this,e=this.getTipElement(),f=a.Event(this.constructor.Event.HIDE),g=function(){c._hoverState!==m.IN&&e.parentNode&&e.parentNode.removeChild(e),c.element.removeAttribute("aria-describedby"),a(c.element).trigger(c.constructor.Event.HIDDEN),c.cleanupTether(),b&&b()};a(this.element).trigger(f),f.isDefaultPrevented()||(a(e).removeClass(o.IN),d.supportsTransitionEnd()&&a(this.tip).hasClass(o.FADE)?a(e).one(d.TRANSITION_END,g).emulateTransitionEnd(i):g(),this._hoverState="")}},{key:"isWithContent",value:function(){return!!this.getTitle()}},{key:"getTipElement",value:function(){return this.tip=this.tip||a(this.config.template)[0]}},{key:"setContent",value:function(){var b=this.getTipElement(),c=this.getTitle(),d=this.config.html?"innerHTML":"innerText";a(b).find(p.TOOLTIP_INNER)[0][d]=c,a(b).removeClass(o.FADE).removeClass(o.IN),this.cleanupTether()}},{key:"getTitle",value:function(){var a=this.element.getAttribute("data-original-title");return a||(a="function"==typeof this.config.title?this.config.title.call(this.element):this.config.title),a}},{key:"cleanupTether",value:function(){this._tether&&(this._tether.destroy(),a(this.element).removeClass(this._removeTetherClasses),a(this.tip).removeClass(this._removeTetherClasses))}},{key:"_getAttachment",value:function(a){return l[a.toUpperCase()]}},{key:"_setListeners",value:function(){var b=this,c=this.config.trigger.split(" ");c.forEach(function(c){if("click"===c)a(b.element).on(b.constructor.Event.CLICK,b.config.selector,b.toggle.bind(b));else if(c!==r.MANUAL){var d=c==r.HOVER?b.constructor.Event.MOUSEENTER:b.constructor.Event.FOCUSIN,e=c==r.HOVER?b.constructor.Event.MOUSELEAVE:b.constructor.Event.FOCUSOUT;a(b.element).on(d,b.config.selector,b._enter.bind(b)).on(e,b.config.selector,b._leave.bind(b))}}),this.config.selector?this.config=a.extend({},this.config,{trigger:"manual",selector:""}):this._fixTitle()}},{key:"_removeTetherClasses",value:function(a,b){return((b.baseVal||b).match(new RegExp("(^|\\s)"+j+"-\\S+","g"))||[]).join(" ")}},{key:"_fixTitle",value:function(){var a=typeof this.element.getAttribute("data-original-title");(this.element.getAttribute("title")||"string"!==a)&&(this.element.setAttribute("data-original-title",this.element.getAttribute("title")||""),this.element.setAttribute("title",""))}},{key:"_enter",value:function(b,c){var d=this.constructor.DATA_KEY;return c=c||a(b.currentTarget).data(d),c||(c=new this.constructor(b.currentTarget,this._getDelegateConfig()),a(b.currentTarget).data(d,c)),b&&(c._activeTrigger["focusin"==b.type?r.FOCUS:r.HOVER]=!0),a(c.getTipElement()).hasClass(o.IN)||c._hoverState===m.IN?void(c._hoverState=m.IN):(clearTimeout(c._timeout),c._hoverState=m.IN,c.config.delay&&c.config.delay.show?void(c._timeout=setTimeout(function(){c._hoverState===m.IN&&c.show()},c.config.delay.show)):void c.show())}},{key:"_leave",value:function(b,c){var d=this.constructor.DATA_KEY;return c=c||a(b.currentTarget).data(d),c||(c=new this.constructor(b.currentTarget,this._getDelegateConfig()),a(b.currentTarget).data(d,c)),b&&(c._activeTrigger["focusout"==b.type?r.FOCUS:r.HOVER]=!1),c._isWithActiveTrigger()?void 0:(clearTimeout(c._timeout),c._hoverState=m.OUT,c.config.delay&&c.config.delay.hide?void(c._timeout=setTimeout(function(){c._hoverState===m.OUT&&c.hide()},c.config.delay.hide)):void c.hide())}},{key:"_isWithActiveTrigger",value:function(){for(var a in this._activeTrigger)if(this._activeTrigger[a])return!0;return!1}},{key:"_getConfig",value:function(b){return b=a.extend({},this.constructor.Default,a(this.element).data(),b),b.delay&&"number"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),b}},{key:"_getDelegateConfig",value:function(){var a={};if(this.config)for(var b in this.config){var c=this.config[b];this.constructor.Default[b]!==c&&(a[b]=c)}return a}}],[{key:"VERSION",get:function(){return f}},{key:"Default",get:function(){return k}},{key:"NAME",get:function(){return e}},{key:"DATA_KEY",get:function(){return g}},{key:"Event",get:function(){return n}},{key:"_jQueryInterface",value:function(b){return this.each(function(){var c=a(this).data(g),d="object"==typeof b?b:null;(c||!/destroy|hide/.test(b))&&(c||(c=new h(this,d),a(this).data(g,c)),"string"==typeof b&&c[b]())})}}]),h}();return a.fn[e]=s._jQueryInterface,a.fn[e].Constructor=s,a.fn[e].noConflict=function(){return a.fn[e]=h,s._jQueryInterface},s}(jQuery));!function(d){var f="popover",g="4.0.0",h="bs.popover",i=d.fn[f],j=d.extend({},e.Default,{placement:"right",trigger:"click",content:"",template:''}),k={FADE:"fade",IN:"in"},l={TITLE:".popover-title",CONTENT:".popover-content",ARROW:".popover-arrow"},m={HIDE:"hide.bs.popover",HIDDEN:"hidden.bs.popover",SHOW:"show.bs.popover",SHOWN:"shown.bs.popover",INSERTED:"inserted.bs.popover",CLICK:"click.bs.popover",FOCUSIN:"focusin.bs.popover",FOCUSOUT:"focusout.bs.popover",MOUSEENTER:"mouseenter.bs.popover",MOUSELEAVE:"mouseleave.bs.popover"},n=function(e){function i(){b(this,i),null!=e&&e.apply(this,arguments)}return a(i,e),c(i,[{key:"isWithContent",value:function(){return this.getTitle()||this._getContent()}},{key:"getTipElement",value:function(){return this.tip=this.tip||d(this.config.template)[0]}},{key:"setContent",value:function(){var a=this.getTipElement(),b=this.getTitle(),c=this._getContent(),e=d(a).find(l.TITLE)[0];e&&(e[this.config.html?"innerHTML":"innerText"]=b),d(a).find(l.CONTENT).children().detach().end()[this.config.html?"string"==typeof c?"html":"append":"text"](c),d(a).removeClass(k.FADE).removeClass(k.IN),this.cleanupTether()}},{key:"_getContent",value:function(){return this.element.getAttribute("data-content")||("function"==typeof this.config.content?this.config.content.call(this.element):this.config.content)}}],[{key:"VERSION",get:function(){return g}},{key:"Default",get:function(){return j}},{key:"NAME",get:function(){return f}},{key:"DATA_KEY",get:function(){return h}},{key:"Event",get:function(){return m}},{key:"_jQueryInterface",value:function(a){return this.each(function(){var b=d(this).data(h),c="object"==typeof a?a:null;(b||!/destroy|hide/.test(a))&&(b||(b=new i(this,c),d(this).data(h,b)),"string"==typeof a&&b[a]())})}}]),i}(e);return d.fn[f]=n._jQueryInterface,d.fn[f].Constructor=n,d.fn[f].noConflict=function(){return d.fn[f]=i,n._jQueryInterface},n}(jQuery)}}(jQuery); \ No newline at end of file diff --git a/dist/js/npm.js b/dist/js/npm.js index 9060ae2df..d1224ffb4 100644 --- a/dist/js/npm.js +++ b/dist/js/npm.js @@ -1,12 +1,12 @@ // This file is autogenerated via the `commonjs` Grunt task. You can require() this file in a CommonJS environment. -require('../../js/transition.js') -require('../../js/alert.js') -require('../../js/button.js') -require('../../js/carousel.js') -require('../../js/collapse.js') -require('../../js/dropdown.js') -require('../../js/modal.js') -require('../../js/tooltip.js') -require('../../js/popover.js') -require('../../js/scrollspy.js') -require('../../js/tab.js') +require('../../js/src/util.js') +require('../../js/src/alert.js') +require('../../js/src/button.js') +require('../../js/src/carousel.js') +require('../../js/src/collapse.js') +require('../../js/src/dropdown.js') +require('../../js/src/modal.js') +require('../../js/src/scrollspy.js') +require('../../js/src/tab.js') +require('../../js/src/tooltip.js') +require('../../js/src/popover.js') \ No newline at end of file -- cgit v1.2.3 From dafdd180cd54a2e238fe715d8aeb83c07f385a18 Mon Sep 17 00:00:00 2001 From: fat Date: Wed, 13 May 2015 10:13:34 -0700 Subject: add umd module support in dist --- dist/js/bootstrap.js | 22 +- dist/js/bootstrap.min.js | 4 +- dist/js/npm.js | 22 +- dist/js/umd/alert.js | 203 +++++++++++++++++ dist/js/umd/button.js | 181 +++++++++++++++ dist/js/umd/carousel.js | 450 ++++++++++++++++++++++++++++++++++++ dist/js/umd/collapse.js | 354 +++++++++++++++++++++++++++++ dist/js/umd/dropdown.js | 281 +++++++++++++++++++++++ dist/js/umd/modal.js | 511 +++++++++++++++++++++++++++++++++++++++++ dist/js/umd/popover.js | 208 +++++++++++++++++ dist/js/umd/scrollspy.js | 286 +++++++++++++++++++++++ dist/js/umd/tab.js | 289 ++++++++++++++++++++++++ dist/js/umd/tooltip.js | 578 +++++++++++++++++++++++++++++++++++++++++++++++ dist/js/umd/util.js | 142 ++++++++++++ 14 files changed, 3507 insertions(+), 24 deletions(-) create mode 100644 dist/js/umd/alert.js create mode 100644 dist/js/umd/button.js create mode 100644 dist/js/umd/carousel.js create mode 100644 dist/js/umd/collapse.js create mode 100644 dist/js/umd/dropdown.js create mode 100644 dist/js/umd/modal.js create mode 100644 dist/js/umd/popover.js create mode 100644 dist/js/umd/scrollspy.js create mode 100644 dist/js/umd/tab.js create mode 100644 dist/js/umd/tooltip.js create mode 100644 dist/js/umd/util.js (limited to 'dist/js') diff --git a/dist/js/bootstrap.js b/dist/js/bootstrap.js index 271a18d25..4b7decaf1 100644 --- a/dist/js/bootstrap.js +++ b/dist/js/bootstrap.js @@ -618,7 +618,7 @@ var Carousel = (function ($) { } if (this._config.interval && !this._isPaused) { - this._interval = setInterval(this.next.bind(this), this._config.interval); + this._interval = setInterval($.proxy(this.next, this), this._config.interval); } } }, { @@ -658,11 +658,11 @@ var Carousel = (function ($) { value: function _addEventListeners() { if (this._config.keyboard) { - $(this._element).on('keydown.bs.carousel', this._keydown.bind(this)); + $(this._element).on('keydown.bs.carousel', $.proxy(this._keydown, this)); } if (this._config.pause == 'hover' && !('ontouchstart' in document.documentElement)) { - $(this._element).on('mouseenter.bs.carousel', this.pause.bind(this)).on('mouseleave.bs.carousel', this.cycle.bind(this)); + $(this._element).on('mouseenter.bs.carousel', $.proxy(this.pause, this)).on('mouseleave.bs.carousel', $.proxy(this.cycle, this)); } } }, { @@ -1609,7 +1609,7 @@ var Modal = (function ($) { this._setEscapeEvent(); this._setResizeEvent(); - $(this._element).on(Event.DISMISS, Selector.DATA_DISMISS, this.hide.bind(this)); + $(this._element).on(Event.DISMISS, Selector.DATA_DISMISS, $.proxy(this.hide, this)); $(this._dialog).on(Event.MOUSEDOWN, function () { $(_this7._element).one(Event.MOUSEUP, function (event) { @@ -1619,7 +1619,7 @@ var Modal = (function ($) { }); }); - this._showBackdrop(this._showElement.bind(this, relatedTarget)); + this._showBackdrop($.proxy(this._showElement, this, relatedTarget)); } }, { key: 'hide', @@ -1650,7 +1650,7 @@ var Modal = (function ($) { if (Util.supportsTransitionEnd() && $(this._element).hasClass(ClassName.FADE)) { - $(this._element).one(Util.TRANSITION_END, this._hideModal.bind(this)).emulateTransitionEnd(TRANSITION_DURATION); + $(this._element).one(Util.TRANSITION_END, $.proxy(this._hideModal, this)).emulateTransitionEnd(TRANSITION_DURATION); } else { this._hideModal(); } @@ -1727,7 +1727,7 @@ var Modal = (function ($) { key: '_setResizeEvent', value: function _setResizeEvent() { if (this._isShown) { - $(window).on(Event.RESIZE, this._handleUpdate.bind(this)); + $(window).on(Event.RESIZE, $.proxy(this._handleUpdate, this)); } else { $(window).off(Event.RESIZE); } @@ -2045,7 +2045,7 @@ var ScrollSpy = (function ($) { this._activeTarget = null; this._scrollHeight = 0; - $(this._scrollElement).on(Event.SCROLL, this._process.bind(this)); + $(this._scrollElement).on(Event.SCROLL, $.proxy(this._process, this)); this.refresh(); this._process(); @@ -2385,7 +2385,7 @@ var Tab = (function ($) { var active = $(container).find(Selector.ACTIVE_CHILD)[0]; var isTransitioning = callback && Util.supportsTransitionEnd() && (active && $(active).hasClass(ClassName.FADE) || !!$(container).find(Selector.FADE_CHILD)[0]); - var complete = this._transitionComplete.bind(this, element, active, isTransitioning, callback); + var complete = $.proxy(this._transitionComplete, this, element, active, isTransitioning, callback); if (active && isTransitioning) { $(active).one(Util.TRANSITION_END, complete).emulateTransitionEnd(TRANSITION_DURATION); @@ -2846,12 +2846,12 @@ var Tooltip = (function ($) { triggers.forEach(function (trigger) { if (trigger === 'click') { - $(_this19.element).on(_this19.constructor.Event.CLICK, _this19.config.selector, _this19.toggle.bind(_this19)); + $(_this19.element).on(_this19.constructor.Event.CLICK, _this19.config.selector, $.proxy(_this19.toggle, _this19)); } else if (trigger !== Trigger.MANUAL) { var eventIn = trigger == Trigger.HOVER ? _this19.constructor.Event.MOUSEENTER : _this19.constructor.Event.FOCUSIN; var eventOut = trigger == Trigger.HOVER ? _this19.constructor.Event.MOUSELEAVE : _this19.constructor.Event.FOCUSOUT; - $(_this19.element).on(eventIn, _this19.config.selector, _this19._enter.bind(_this19)).on(eventOut, _this19.config.selector, _this19._leave.bind(_this19)); + $(_this19.element).on(eventIn, _this19.config.selector, $.proxy(_this19._enter, _this19)).on(eventOut, _this19.config.selector, $.proxy(_this19._leave, _this19)); } }); diff --git a/dist/js/bootstrap.min.js b/dist/js/bootstrap.min.js index 25d445560..6e54840af 100644 --- a/dist/js/bootstrap.min.js +++ b/dist/js/bootstrap.min.js @@ -3,5 +3,5 @@ * Copyright 2011-2015 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) */ -if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){var b=a.fn.jquery.split(" ")[0].split(".");if(b[0]<2&&b[1]<9||1==b[0]&&9==b[1]&&b[2]<1)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher")}(jQuery),+function(){"use strict";function a(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(a.__proto__=b)}function b(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}{var c=function(){function a(a,b){for(var c=0;cthis._items.length-1||0>b)){if(this._isSliding)return void a(this._element).one(l.SLID,function(){return c.to(b)});if(d==b)return this.pause(),void this.cycle();var e=b>d?k.NEXT:k.PREVIOUS;this._slide(e,this._items[b])}}},{key:"_addEventListeners",value:function(){this._config.keyboard&&a(this._element).on("keydown.bs.carousel",this._keydown.bind(this)),"hover"!=this._config.pause||"ontouchstart"in document.documentElement||a(this._element).on("mouseenter.bs.carousel",this.pause.bind(this)).on("mouseleave.bs.carousel",this.cycle.bind(this))}},{key:"_keydown",value:function(a){if(a.preventDefault(),!/input|textarea/i.test(a.target.tagName))switch(a.which){case 37:this.prev();break;case 39:this.next();break;default:return}}},{key:"_getItemIndex",value:function(b){return this._items=a.makeArray(a(b).parent().find(n.ITEM)),this._items.indexOf(b)}},{key:"_getItemByDirection",value:function(a,b){var c=a===k.NEXT,d=a===k.PREVIOUS,e=this._getItemIndex(b),f=this._items.length-1,g=d&&0===e||c&&e==f;if(g&&!this._config.wrap)return b;var h=a==k.PREVIOUS?-1:1,i=(e+h)%this._items.length;return-1===i?this._items[this._items.length-1]:this._items[i]}},{key:"_triggerSlideEvent",value:function(b,c){var d=a.Event(l.SLIDE,{relatedTarget:b,direction:c});return a(this._element).trigger(d),d}},{key:"_setActiveIndicatorElement",value:function(b){if(this._indicatorsElement){a(this._indicatorsElement).find(n.ACTIVE).removeClass(m.ACTIVE);var c=this._indicatorsElement.children[this._getItemIndex(b)];c&&a(c).addClass(m.ACTIVE)}}},{key:"_slide",value:function(b,c){var e=this,f=a(this._element).find(n.ACTIVE_ITEM)[0],g=c||f&&this._getItemByDirection(b,f),h=!!this._interval,j=b==k.NEXT?m.LEFT:m.RIGHT;if(g&&a(g).hasClass(m.ACTIVE))return void(this._isSliding=!1);var o=this._triggerSlideEvent(g,j);if(!o.isDefaultPrevented()&&f&&g){this._isSliding=!0,h&&this.pause(),this._setActiveIndicatorElement(g);var p=a.Event(l.SLID,{relatedTarget:g,direction:j});d.supportsTransitionEnd()&&a(this._element).hasClass(m.SLIDE)?(a(g).addClass(b),d.reflow(g),a(f).addClass(j),a(g).addClass(j),a(f).one(d.TRANSITION_END,function(){a(g).removeClass(j).removeClass(b),a(g).addClass(m.ACTIVE),a(f).removeClass(m.ACTIVE).removeClass(b).removeClass(j),e._isSliding=!1,setTimeout(function(){return a(e._element).trigger(p)},0)}).emulateTransitionEnd(i)):(a(f).removeClass(m.ACTIVE),a(g).addClass(m.ACTIVE),this._isSliding=!1,a(this._element).trigger(p)),h&&this.cycle()}}}],[{key:"VERSION",get:function(){return f}},{key:"Default",get:function(){return j}},{key:"_jQueryInterface",value:function(b){return this.each(function(){var c=a(this).data(g),d=a.extend({},j,a(this).data());"object"==typeof b&&a.extend(d,b);var f="string"==typeof b?b:d.slide;c||(c=new e(this,d),a(this).data(g,c)),"number"==typeof b?c.to(b):f?c[f]():d.interval&&(c.pause(),c.cycle())})}},{key:"_dataApiClickHandler",value:function(b){var c=d.getSelectorFromElement(this);if(c){var f=a(c)[0];if(f&&a(f).hasClass(m.CAROUSEL)){var h=a.extend({},a(f).data(),a(this).data()),i=this.getAttribute("data-slide-to");i&&(h.interval=!1),e._jQueryInterface.call(a(f),h),i&&a(f).data(g).to(i),b.preventDefault()}}}}]),e}();return a(document).on(l.CLICK,n.DATA_SLIDE,o._dataApiClickHandler),a(window).on(l.LOAD,function(){a(n.DATA_RIDE).each(function(){var b=a(this);o._jQueryInterface.call(b,b.data())})}),a.fn[e]=o._jQueryInterface,a.fn[e].Constructor=o,a.fn[e].noConflict=function(){return a.fn[e]=h,o._jQueryInterface},o}(jQuery),function(a){var e="collapse",f="4.0.0",g="bs.collapse",h=a.fn[e],i=600,j={toggle:!0,parent:null},k={SHOW:"show.bs.collapse",SHOWN:"shown.bs.collapse",HIDE:"hide.bs.collapse",HIDDEN:"hidden.bs.collapse",CLICK:"click.bs.collapse.data-api"},l={IN:"in",COLLAPSE:"collapse",COLLAPSING:"collapsing",COLLAPSED:"collapsed"},m={WIDTH:"width",HEIGHT:"height"},n={ACTIVES:".panel > .in, .panel > .collapsing",DATA_TOGGLE:'[data-toggle="collapse"]'},o=function(){function e(c,d){b(this,e),this._isTransitioning=!1,this._element=c,this._config=a.extend({},j,d),this._triggerArray=a.makeArray(a('[data-toggle="collapse"][href="#'+c.id+'"],'+('[data-toggle="collapse"][data-target="#'+c.id+'"]'))),this._parent=this._config.parent?this._getParent():null,this._config.parent||this._addAriaAndCollapsedClass(this._element,this._triggerArray),this._config.toggle&&this.toggle()}return c(e,[{key:"toggle",value:function(){a(this._element).hasClass(l.IN)?this.hide():this.show()}},{key:"show",value:function(){var b=this;if(!this._isTransitioning&&!a(this._element).hasClass(l.IN)){var c=void 0,f=void 0;if(this._parent&&(f=a.makeArray(a(n.ACTIVES)),f.length||(f=null)),!(f&&(c=a(f).data(g),c&&c._isTransitioning))){var h=a.Event(k.SHOW);if(a(this._element).trigger(h),!h.isDefaultPrevented()){f&&(e._jQueryInterface.call(a(f),"hide"),c||a(f).data(g,null));var j=this._getDimension();a(this._element).removeClass(l.COLLAPSE).addClass(l.COLLAPSING),this._element.style[j]=0,this._element.setAttribute("aria-expanded",!0),this._triggerArray.length&&a(this._triggerArray).removeClass(l.COLLAPSED).attr("aria-expanded",!0),this.setTransitioning(!0);var m=function(){a(b._element).removeClass(l.COLLAPSING).addClass(l.COLLAPSE).addClass(l.IN),b._element.style[j]="",b.setTransitioning(!1),a(b._element).trigger(k.SHOWN)};if(!d.supportsTransitionEnd())return void m();var o="scroll"+(j[0].toUpperCase()+j.slice(1));a(this._element).one(d.TRANSITION_END,m).emulateTransitionEnd(i),this._element.style[j]=this._element[o]+"px"}}}}},{key:"hide",value:function(){var b=this;if(!this._isTransitioning&&a(this._element).hasClass(l.IN)){var c=a.Event(k.HIDE);if(a(this._element).trigger(c),!c.isDefaultPrevented()){var e=this._getDimension(),f=e===m.WIDTH?"offsetWidth":"offsetHeight";this._element.style[e]=this._element[f]+"px",d.reflow(this._element),a(this._element).addClass(l.COLLAPSING).removeClass(l.COLLAPSE).removeClass(l.IN),this._element.setAttribute("aria-expanded",!1),this._triggerArray.length&&a(this._triggerArray).addClass(l.COLLAPSED).attr("aria-expanded",!1),this.setTransitioning(!0);var g=function(){b.setTransitioning(!1),a(b._element).removeClass(l.COLLAPSING).addClass(l.COLLAPSE).trigger(k.HIDDEN)};return this._element.style[e]=0,d.supportsTransitionEnd()?void a(this._element).one(d.TRANSITION_END,g).emulateTransitionEnd(i):g()}}}},{key:"setTransitioning",value:function(a){this._isTransitioning=a}},{key:"_getDimension",value:function(){var b=a(this._element).hasClass(m.WIDTH);return b?m.WIDTH:m.HEIGHT}},{key:"_getParent",value:function(){var b=this,c=a(this._config.parent)[0],d='[data-toggle="collapse"][data-parent="'+this._config.parent+'"]';return a(c).find(d).each(function(a,c){b._addAriaAndCollapsedClass(e._getTargetFromElement(c),[c])}),c}},{key:"_addAriaAndCollapsedClass",value:function(b,c){if(b){var d=a(b).hasClass(l.IN);b.setAttribute("aria-expanded",d),c.length&&a(c).toggleClass(l.COLLAPSED,!d).attr("aria-expanded",d)}}}],[{key:"VERSION",get:function(){return f}},{key:"Default",get:function(){return j}},{key:"_getTargetFromElement",value:function(b){var c=d.getSelectorFromElement(b);return c?a(c)[0]:null}},{key:"_jQueryInterface",value:function(b){return this.each(function(){var c=a(this),d=c.data(g),f=a.extend({},j,c.data(),"object"==typeof b&&b);!d&&f.toggle&&/show|hide/.test(b)&&(f.toggle=!1),d||(d=new e(this,f),c.data(g,d)),"string"==typeof b&&d[b]()})}}]),e}();return a(document).on(k.CLICK,n.DATA_TOGGLE,function(b){b.preventDefault();var c=o._getTargetFromElement(this),d=a(c).data(g),e=d?"toggle":a(this).data();o._jQueryInterface.call(a(c),e)}),a.fn[e]=o._jQueryInterface,a.fn[e].Constructor=o,a.fn[e].noConflict=function(){return a.fn[e]=h,o._jQueryInterface},o}(jQuery),function(a){var e="dropdown",f="4.0.0",g="bs.dropdown",h=a.fn[e],i={HIDE:"hide.bs.dropdown",HIDDEN:"hidden.bs.dropdown",SHOW:"show.bs.dropdown",SHOWN:"shown.bs.dropdown",CLICK:"click.bs.dropdown",KEYDOWN:"keydown.bs.dropdown.data-api",CLICK_DATA:"click.bs.dropdown.data-api"},j={BACKDROP:"dropdown-backdrop",DISABLED:"disabled",OPEN:"open"},k={BACKDROP:".dropdown-backdrop",DATA_TOGGLE:'[data-toggle="dropdown"]',FORM_CHILD:".dropdown form",ROLE_MENU:'[role="menu"]',ROLE_LISTBOX:'[role="listbox"]',NAVBAR_NAV:".navbar-nav",VISIBLE_ITEMS:'[role="menu"] li:not(.disabled) a, [role="listbox"] li:not(.disabled) a'},l=function(){function e(c){b(this,e),a(c).on(i.CLICK,this.toggle)}return c(e,[{key:"toggle",value:function(){if(!this.disabled&&!a(this).hasClass(j.DISABLED)){var b=e._getParentFromElement(this),c=a(b).hasClass(j.OPEN);if(e._clearMenus(),c)return!1;if("ontouchstart"in document.documentElement&&!a(b).closest(k.NAVBAR_NAV).length){var d=document.createElement("div");d.className=j.BACKDROP,a(d).insertBefore(this),a(d).on("click",e._clearMenus)}var f={relatedTarget:this},g=a.Event(i.SHOW,f);if(a(b).trigger(g),!g.isDefaultPrevented())return this.focus(),this.setAttribute("aria-expanded","true"),a(b).toggleClass(j.OPEN),a(b).trigger(i.SHOWN,f),!1}}}],[{key:"VERSION",get:function(){return f}},{key:"_jQueryInterface",value:function(b){return this.each(function(){var c=a(this).data(g);c||a(this).data(g,c=new e(this)),"string"==typeof b&&c[b].call(this)})}},{key:"_clearMenus",value:function(b){if(!b||3!==b.which){var c=a(k.BACKDROP)[0];c&&c.parentNode.removeChild(c);for(var d=a.makeArray(a(k.DATA_TOGGLE)),f=0;f0&&h--,40===b.which&&hdocument.documentElement.clientHeight;!this._isBodyOverflowing&&a&&(this._element.style.paddingLeft=this._scrollbarWidth+"px"),this._isBodyOverflowing&&!a&&(this._element.style.paddingRight=this._scrollbarWidth+"px")}},{key:"_resetAdjustments",value:function(){this._element.style.paddingLeft="",this._element.style.paddingRight=""}},{key:"_checkScrollbar",value:function(){var a=window.innerWidth;if(!a){var b=document.documentElement.getBoundingClientRect();a=b.right-Math.abs(b.left)}this._isBodyOverflowing=document.body.clientWidth a",this._offsets=[],this._targets=[],this._activeTarget=null,this._scrollHeight=0,a(this._scrollElement).on(j.SCROLL,this._process.bind(this)),this.refresh(),this._process()}return c(e,[{key:"refresh",value:function(){var b=this,c="offset",e=0;this._scrollElement!==this._scrollElement.window&&(c="position",e=this._getScrollTop()),this._offsets=[],this._targets=[],this._scrollHeight=this._getScrollHeight();var f=a.makeArray(a(this._selector));f.map(function(b){var f=void 0,g=d.getSelectorFromElement(b);return g&&(f=a(g)[0]),f&&(f.offsetWidth||f.offsetHeight)?[a(f)[c]().top+e,g]:void 0}).filter(function(a){return a}).sort(function(a,b){return a[0]-b[0]}).forEach(function(a){b._offsets.push(a[0]),b._targets.push(a[1])})}},{key:"_getScrollTop",value:function(){return this._scrollElement===window?this._scrollElement.scrollY:this._scrollElement.scrollTop}},{key:"_getScrollHeight",value:function(){return this._scrollElement.scrollHeight||Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)}},{key:"_process",value:function(){var a=this._getScrollTop()+this._config.offset,b=this._getScrollHeight(),c=this._config.offset+b-this._scrollElement.offsetHeight;if(this._scrollHeight!==b&&this.refresh(),a>=c){var d=this._targets[this._targets.length-1];this._activeTarget!==d&&this._activate(d)}if(this._activeTarget&&a=this._offsets[e]&&(void 0===this._offsets[e+1]||a .fade",ACTIVE:".active",ACTIVE_CHILD:"> .active",DATA_TOGGLE:'[data-toggle="tab"], [data-toggle="pill"]',DROPDOWN_ACTIVE_CHILD:"> .dropdown-menu > .active"},m=function(){function e(a){b(this,e),this._element=a}return c(e,[{key:"show",value:function(){var b=this;if(!this._element.parentNode||this._element.parentNode.nodeType!=Node.ELEMENT_NODE||!a(this._element).parent().hasClass(k.ACTIVE)){var c=void 0,e=void 0,f=a(this._element).closest(l.UL)[0],g=d.getSelectorFromElement(this._element);f&&(e=a.makeArray(a(f).find(l.ACTIVE)),e=e[e.length-1],e&&(e=a(e).find(l.A)[0]));var h=a.Event(j.HIDE,{relatedTarget:this._element}),i=a.Event(j.SHOW,{relatedTarget:e});if(e&&a(e).trigger(h),a(this._element).trigger(i),!i.isDefaultPrevented()&&!h.isDefaultPrevented()){g&&(c=a(g)[0]),this._activate(a(this._element).closest(l.LI)[0],f);var m=function(){var c=a.Event(j.HIDDEN,{relatedTarget:b._element}),d=a.Event(j.SHOWN,{relatedTarget:e});a(e).trigger(c),a(b._element).trigger(d)};c?this._activate(c,c.parentNode,m):m()}}}},{key:"_activate",value:function(b,c,e){var f=a(c).find(l.ACTIVE_CHILD)[0],g=e&&d.supportsTransitionEnd()&&(f&&a(f).hasClass(k.FADE)||!!a(c).find(l.FADE_CHILD)[0]),h=this._transitionComplete.bind(this,b,f,g,e);f&&g?a(f).one(d.TRANSITION_END,h).emulateTransitionEnd(i):h(),f&&a(f).removeClass(k.IN)}},{key:"_transitionComplete",value:function(b,c,e,f){if(c){a(c).removeClass(k.ACTIVE);var g=a(c).find(l.DROPDOWN_ACTIVE_CHILD)[0];g&&a(g).removeClass(k.ACTIVE);var h=a(c).find(l.DATA_TOGGLE)[0];h&&h.setAttribute("aria-expanded",!1)}a(b).addClass(k.ACTIVE);var i=a(b).find(l.DATA_TOGGLE)[0];if(i&&i.setAttribute("aria-expanded",!0),e?(d.reflow(b),a(b).addClass(k.IN)):a(b).removeClass(k.FADE),b.parentNode&&a(b.parentNode).hasClass(k.DROPDOWN_MENU)){var j=a(b).closest(l.LI_DROPDOWN)[0];j&&a(j).addClass(k.ACTIVE),i=a(b).find(l.DATA_TOGGLE)[0],i&&i.setAttribute("aria-expanded",!0)}f&&f()}}],[{key:"VERSION",get:function(){return f}},{key:"Default",get:function(){return Default}},{key:"_jQueryInterface",value:function(b){return this.each(function(){var c=a(this),d=c.data(g);d||(d=d=new e(this),c.data(g,d)),"string"==typeof b&&d[b]()})}}]),e}();return a(document).on(j.CLICK,l.DATA_TOGGLE,function(b){b.preventDefault(),m._jQueryInterface.call(a(this),"show")}),a.fn[e]=m._jQueryInterface,a.fn[e].Constructor=m,a.fn[e].noConflict=function(){return a.fn[e]=h,m._jQueryInterface},m}(jQuery),function(a){var e="tooltip",f="4.0.0",g="bs.tooltip",h=a.fn[e],i=150,j="bs-tether",k={animation:!0,template:'',trigger:"hover focus",title:"",delay:0,html:!1,selector:!1,placement:"top",offset:"0 0",constraints:null},l={TOP:"bottom center",RIGHT:"middle left",BOTTOM:"top center",LEFT:"middle right"},m={IN:"in",OUT:"out"},n={HIDE:"hide.bs.tooltip",HIDDEN:"hidden.bs.tooltip",SHOW:"show.bs.tooltip",SHOWN:"shown.bs.tooltip",INSERTED:"inserted.bs.tooltip",CLICK:"click.bs.tooltip",FOCUSIN:"focusin.bs.tooltip",FOCUSOUT:"focusout.bs.tooltip",MOUSEENTER:"mouseenter.bs.tooltip",MOUSELEAVE:"mouseleave.bs.tooltip"},o={FADE:"fade",IN:"in"},p={TOOLTIP:".tooltip",TOOLTIP_INNER:".tooltip-inner"},q={element:!1,enabled:!1},r={HOVER:"hover",FOCUS:"focus",CLICK:"click",MANUAL:"manual"},s=function(){function h(a,c){b(this,h),this._isEnabled=!0,this._timeout=0,this._hoverState="",this._activeTrigger={},this._tether=null,this.element=a,this.config=this._getConfig(c),this.tip=null,this._setListeners()}return c(h,[{key:"enable",value:function(){this._isEnabled=!0}},{key:"disable",value:function(){this._isEnabled=!1}},{key:"toggleEnabled",value:function(){this._isEnabled=!this._isEnabled}},{key:"toggle",value:function(b){var c=this,d=this.constructor.DATA_KEY;b?(c=a(b.currentTarget).data(d),c||(c=new this.constructor(b.currentTarget,this._getDelegateConfig()),a(b.currentTarget).data(d,c)),c._activeTrigger.click=!c._activeTrigger.click,c._isWithActiveTrigger()?c._enter(null,c):c._leave(null,c)):a(c.getTipElement()).hasClass(o.IN)?c._leave(null,c):c._enter(null,c)}},{key:"destroy",value:function(){var b=this;clearTimeout(this._timeout),this.hide(function(){a(b.element).off("."+b.constructor.NAME).removeData(b.constructor.DATA_KEY),b.tip&&a(b.tip).detach(), -b.tip=null})}},{key:"show",value:function(){var b=this,c=a.Event(this.constructor.Event.SHOW);if(this.isWithContent()&&this._isEnabled){a(this.element).trigger(c);var e=a.contains(this.element.ownerDocument.documentElement,this.element);if(c.isDefaultPrevented()||!e)return;var f=this.getTipElement(),g=d.getUID(this.constructor.NAME);f.setAttribute("id",g),this.element.setAttribute("aria-describedby",g),this.setContent(),this.config.animation&&a(f).addClass(o.FADE);var i="function"==typeof this.config.placement?this.config.placement.call(this,f,this.element):this.config.placement,k=this._getAttachment(i);a(f).data(this.constructor.DATA_KEY,this).appendTo(document.body),a(this.element).trigger(this.constructor.Event.INSERTED),this._tether=new Tether({element:f,target:this.element,attachment:k,classes:q,classPrefix:j,offset:this.config.offset,constraints:this.config.constraints}),d.reflow(f),this._tether.position(),a(f).addClass(o.IN);var l=function(){var c=b._hoverState;b._hoverState=null,a(b.element).trigger(b.constructor.Event.SHOWN),c===m.OUT&&b._leave(null,b)};d.supportsTransitionEnd()&&a(this.tip).hasClass(o.FADE)?a(this.tip).one(d.TRANSITION_END,l).emulateTransitionEnd(h._TRANSITION_DURATION):l()}}},{key:"hide",value:function(b){var c=this,e=this.getTipElement(),f=a.Event(this.constructor.Event.HIDE),g=function(){c._hoverState!==m.IN&&e.parentNode&&e.parentNode.removeChild(e),c.element.removeAttribute("aria-describedby"),a(c.element).trigger(c.constructor.Event.HIDDEN),c.cleanupTether(),b&&b()};a(this.element).trigger(f),f.isDefaultPrevented()||(a(e).removeClass(o.IN),d.supportsTransitionEnd()&&a(this.tip).hasClass(o.FADE)?a(e).one(d.TRANSITION_END,g).emulateTransitionEnd(i):g(),this._hoverState="")}},{key:"isWithContent",value:function(){return!!this.getTitle()}},{key:"getTipElement",value:function(){return this.tip=this.tip||a(this.config.template)[0]}},{key:"setContent",value:function(){var b=this.getTipElement(),c=this.getTitle(),d=this.config.html?"innerHTML":"innerText";a(b).find(p.TOOLTIP_INNER)[0][d]=c,a(b).removeClass(o.FADE).removeClass(o.IN),this.cleanupTether()}},{key:"getTitle",value:function(){var a=this.element.getAttribute("data-original-title");return a||(a="function"==typeof this.config.title?this.config.title.call(this.element):this.config.title),a}},{key:"cleanupTether",value:function(){this._tether&&(this._tether.destroy(),a(this.element).removeClass(this._removeTetherClasses),a(this.tip).removeClass(this._removeTetherClasses))}},{key:"_getAttachment",value:function(a){return l[a.toUpperCase()]}},{key:"_setListeners",value:function(){var b=this,c=this.config.trigger.split(" ");c.forEach(function(c){if("click"===c)a(b.element).on(b.constructor.Event.CLICK,b.config.selector,b.toggle.bind(b));else if(c!==r.MANUAL){var d=c==r.HOVER?b.constructor.Event.MOUSEENTER:b.constructor.Event.FOCUSIN,e=c==r.HOVER?b.constructor.Event.MOUSELEAVE:b.constructor.Event.FOCUSOUT;a(b.element).on(d,b.config.selector,b._enter.bind(b)).on(e,b.config.selector,b._leave.bind(b))}}),this.config.selector?this.config=a.extend({},this.config,{trigger:"manual",selector:""}):this._fixTitle()}},{key:"_removeTetherClasses",value:function(a,b){return((b.baseVal||b).match(new RegExp("(^|\\s)"+j+"-\\S+","g"))||[]).join(" ")}},{key:"_fixTitle",value:function(){var a=typeof this.element.getAttribute("data-original-title");(this.element.getAttribute("title")||"string"!==a)&&(this.element.setAttribute("data-original-title",this.element.getAttribute("title")||""),this.element.setAttribute("title",""))}},{key:"_enter",value:function(b,c){var d=this.constructor.DATA_KEY;return c=c||a(b.currentTarget).data(d),c||(c=new this.constructor(b.currentTarget,this._getDelegateConfig()),a(b.currentTarget).data(d,c)),b&&(c._activeTrigger["focusin"==b.type?r.FOCUS:r.HOVER]=!0),a(c.getTipElement()).hasClass(o.IN)||c._hoverState===m.IN?void(c._hoverState=m.IN):(clearTimeout(c._timeout),c._hoverState=m.IN,c.config.delay&&c.config.delay.show?void(c._timeout=setTimeout(function(){c._hoverState===m.IN&&c.show()},c.config.delay.show)):void c.show())}},{key:"_leave",value:function(b,c){var d=this.constructor.DATA_KEY;return c=c||a(b.currentTarget).data(d),c||(c=new this.constructor(b.currentTarget,this._getDelegateConfig()),a(b.currentTarget).data(d,c)),b&&(c._activeTrigger["focusout"==b.type?r.FOCUS:r.HOVER]=!1),c._isWithActiveTrigger()?void 0:(clearTimeout(c._timeout),c._hoverState=m.OUT,c.config.delay&&c.config.delay.hide?void(c._timeout=setTimeout(function(){c._hoverState===m.OUT&&c.hide()},c.config.delay.hide)):void c.hide())}},{key:"_isWithActiveTrigger",value:function(){for(var a in this._activeTrigger)if(this._activeTrigger[a])return!0;return!1}},{key:"_getConfig",value:function(b){return b=a.extend({},this.constructor.Default,a(this.element).data(),b),b.delay&&"number"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),b}},{key:"_getDelegateConfig",value:function(){var a={};if(this.config)for(var b in this.config){var c=this.config[b];this.constructor.Default[b]!==c&&(a[b]=c)}return a}}],[{key:"VERSION",get:function(){return f}},{key:"Default",get:function(){return k}},{key:"NAME",get:function(){return e}},{key:"DATA_KEY",get:function(){return g}},{key:"Event",get:function(){return n}},{key:"_jQueryInterface",value:function(b){return this.each(function(){var c=a(this).data(g),d="object"==typeof b?b:null;(c||!/destroy|hide/.test(b))&&(c||(c=new h(this,d),a(this).data(g,c)),"string"==typeof b&&c[b]())})}}]),h}();return a.fn[e]=s._jQueryInterface,a.fn[e].Constructor=s,a.fn[e].noConflict=function(){return a.fn[e]=h,s._jQueryInterface},s}(jQuery));!function(d){var f="popover",g="4.0.0",h="bs.popover",i=d.fn[f],j=d.extend({},e.Default,{placement:"right",trigger:"click",content:"",template:''}),k={FADE:"fade",IN:"in"},l={TITLE:".popover-title",CONTENT:".popover-content",ARROW:".popover-arrow"},m={HIDE:"hide.bs.popover",HIDDEN:"hidden.bs.popover",SHOW:"show.bs.popover",SHOWN:"shown.bs.popover",INSERTED:"inserted.bs.popover",CLICK:"click.bs.popover",FOCUSIN:"focusin.bs.popover",FOCUSOUT:"focusout.bs.popover",MOUSEENTER:"mouseenter.bs.popover",MOUSELEAVE:"mouseleave.bs.popover"},n=function(e){function i(){b(this,i),null!=e&&e.apply(this,arguments)}return a(i,e),c(i,[{key:"isWithContent",value:function(){return this.getTitle()||this._getContent()}},{key:"getTipElement",value:function(){return this.tip=this.tip||d(this.config.template)[0]}},{key:"setContent",value:function(){var a=this.getTipElement(),b=this.getTitle(),c=this._getContent(),e=d(a).find(l.TITLE)[0];e&&(e[this.config.html?"innerHTML":"innerText"]=b),d(a).find(l.CONTENT).children().detach().end()[this.config.html?"string"==typeof c?"html":"append":"text"](c),d(a).removeClass(k.FADE).removeClass(k.IN),this.cleanupTether()}},{key:"_getContent",value:function(){return this.element.getAttribute("data-content")||("function"==typeof this.config.content?this.config.content.call(this.element):this.config.content)}}],[{key:"VERSION",get:function(){return g}},{key:"Default",get:function(){return j}},{key:"NAME",get:function(){return f}},{key:"DATA_KEY",get:function(){return h}},{key:"Event",get:function(){return m}},{key:"_jQueryInterface",value:function(a){return this.each(function(){var b=d(this).data(h),c="object"==typeof a?a:null;(b||!/destroy|hide/.test(a))&&(b||(b=new i(this,c),d(this).data(h,b)),"string"==typeof a&&b[a]())})}}]),i}(e);return d.fn[f]=n._jQueryInterface,d.fn[f].Constructor=n,d.fn[f].noConflict=function(){return d.fn[f]=i,n._jQueryInterface},n}(jQuery)}}(jQuery); \ No newline at end of file +if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){var b=a.fn.jquery.split(" ")[0].split(".");if(b[0]<2&&b[1]<9||1==b[0]&&9==b[1]&&b[2]<1)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher")}(jQuery),+function(){"use strict";function a(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(a.__proto__=b)}function b(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}{var c=function(){function a(a,b){for(var c=0;cthis._items.length-1||0>b)){if(this._isSliding)return void a(this._element).one(l.SLID,function(){return c.to(b)});if(d==b)return this.pause(),void this.cycle();var e=b>d?k.NEXT:k.PREVIOUS;this._slide(e,this._items[b])}}},{key:"_addEventListeners",value:function(){this._config.keyboard&&a(this._element).on("keydown.bs.carousel",a.proxy(this._keydown,this)),"hover"!=this._config.pause||"ontouchstart"in document.documentElement||a(this._element).on("mouseenter.bs.carousel",a.proxy(this.pause,this)).on("mouseleave.bs.carousel",a.proxy(this.cycle,this))}},{key:"_keydown",value:function(a){if(a.preventDefault(),!/input|textarea/i.test(a.target.tagName))switch(a.which){case 37:this.prev();break;case 39:this.next();break;default:return}}},{key:"_getItemIndex",value:function(b){return this._items=a.makeArray(a(b).parent().find(n.ITEM)),this._items.indexOf(b)}},{key:"_getItemByDirection",value:function(a,b){var c=a===k.NEXT,d=a===k.PREVIOUS,e=this._getItemIndex(b),f=this._items.length-1,g=d&&0===e||c&&e==f;if(g&&!this._config.wrap)return b;var h=a==k.PREVIOUS?-1:1,i=(e+h)%this._items.length;return-1===i?this._items[this._items.length-1]:this._items[i]}},{key:"_triggerSlideEvent",value:function(b,c){var d=a.Event(l.SLIDE,{relatedTarget:b,direction:c});return a(this._element).trigger(d),d}},{key:"_setActiveIndicatorElement",value:function(b){if(this._indicatorsElement){a(this._indicatorsElement).find(n.ACTIVE).removeClass(m.ACTIVE);var c=this._indicatorsElement.children[this._getItemIndex(b)];c&&a(c).addClass(m.ACTIVE)}}},{key:"_slide",value:function(b,c){var e=this,f=a(this._element).find(n.ACTIVE_ITEM)[0],g=c||f&&this._getItemByDirection(b,f),h=!!this._interval,j=b==k.NEXT?m.LEFT:m.RIGHT;if(g&&a(g).hasClass(m.ACTIVE))return void(this._isSliding=!1);var o=this._triggerSlideEvent(g,j);if(!o.isDefaultPrevented()&&f&&g){this._isSliding=!0,h&&this.pause(),this._setActiveIndicatorElement(g);var p=a.Event(l.SLID,{relatedTarget:g,direction:j});d.supportsTransitionEnd()&&a(this._element).hasClass(m.SLIDE)?(a(g).addClass(b),d.reflow(g),a(f).addClass(j),a(g).addClass(j),a(f).one(d.TRANSITION_END,function(){a(g).removeClass(j).removeClass(b),a(g).addClass(m.ACTIVE),a(f).removeClass(m.ACTIVE).removeClass(b).removeClass(j),e._isSliding=!1,setTimeout(function(){return a(e._element).trigger(p)},0)}).emulateTransitionEnd(i)):(a(f).removeClass(m.ACTIVE),a(g).addClass(m.ACTIVE),this._isSliding=!1,a(this._element).trigger(p)),h&&this.cycle()}}}],[{key:"VERSION",get:function(){return f}},{key:"Default",get:function(){return j}},{key:"_jQueryInterface",value:function(b){return this.each(function(){var c=a(this).data(g),d=a.extend({},j,a(this).data());"object"==typeof b&&a.extend(d,b);var f="string"==typeof b?b:d.slide;c||(c=new e(this,d),a(this).data(g,c)),"number"==typeof b?c.to(b):f?c[f]():d.interval&&(c.pause(),c.cycle())})}},{key:"_dataApiClickHandler",value:function(b){var c=d.getSelectorFromElement(this);if(c){var f=a(c)[0];if(f&&a(f).hasClass(m.CAROUSEL)){var h=a.extend({},a(f).data(),a(this).data()),i=this.getAttribute("data-slide-to");i&&(h.interval=!1),e._jQueryInterface.call(a(f),h),i&&a(f).data(g).to(i),b.preventDefault()}}}}]),e}();return a(document).on(l.CLICK,n.DATA_SLIDE,o._dataApiClickHandler),a(window).on(l.LOAD,function(){a(n.DATA_RIDE).each(function(){var b=a(this);o._jQueryInterface.call(b,b.data())})}),a.fn[e]=o._jQueryInterface,a.fn[e].Constructor=o,a.fn[e].noConflict=function(){return a.fn[e]=h,o._jQueryInterface},o}(jQuery),function(a){var e="collapse",f="4.0.0",g="bs.collapse",h=a.fn[e],i=600,j={toggle:!0,parent:null},k={SHOW:"show.bs.collapse",SHOWN:"shown.bs.collapse",HIDE:"hide.bs.collapse",HIDDEN:"hidden.bs.collapse",CLICK:"click.bs.collapse.data-api"},l={IN:"in",COLLAPSE:"collapse",COLLAPSING:"collapsing",COLLAPSED:"collapsed"},m={WIDTH:"width",HEIGHT:"height"},n={ACTIVES:".panel > .in, .panel > .collapsing",DATA_TOGGLE:'[data-toggle="collapse"]'},o=function(){function e(c,d){b(this,e),this._isTransitioning=!1,this._element=c,this._config=a.extend({},j,d),this._triggerArray=a.makeArray(a('[data-toggle="collapse"][href="#'+c.id+'"],'+('[data-toggle="collapse"][data-target="#'+c.id+'"]'))),this._parent=this._config.parent?this._getParent():null,this._config.parent||this._addAriaAndCollapsedClass(this._element,this._triggerArray),this._config.toggle&&this.toggle()}return c(e,[{key:"toggle",value:function(){a(this._element).hasClass(l.IN)?this.hide():this.show()}},{key:"show",value:function(){var b=this;if(!this._isTransitioning&&!a(this._element).hasClass(l.IN)){var c=void 0,f=void 0;if(this._parent&&(f=a.makeArray(a(n.ACTIVES)),f.length||(f=null)),!(f&&(c=a(f).data(g),c&&c._isTransitioning))){var h=a.Event(k.SHOW);if(a(this._element).trigger(h),!h.isDefaultPrevented()){f&&(e._jQueryInterface.call(a(f),"hide"),c||a(f).data(g,null));var j=this._getDimension();a(this._element).removeClass(l.COLLAPSE).addClass(l.COLLAPSING),this._element.style[j]=0,this._element.setAttribute("aria-expanded",!0),this._triggerArray.length&&a(this._triggerArray).removeClass(l.COLLAPSED).attr("aria-expanded",!0),this.setTransitioning(!0);var m=function(){a(b._element).removeClass(l.COLLAPSING).addClass(l.COLLAPSE).addClass(l.IN),b._element.style[j]="",b.setTransitioning(!1),a(b._element).trigger(k.SHOWN)};if(!d.supportsTransitionEnd())return void m();var o="scroll"+(j[0].toUpperCase()+j.slice(1));a(this._element).one(d.TRANSITION_END,m).emulateTransitionEnd(i),this._element.style[j]=this._element[o]+"px"}}}}},{key:"hide",value:function(){var b=this;if(!this._isTransitioning&&a(this._element).hasClass(l.IN)){var c=a.Event(k.HIDE);if(a(this._element).trigger(c),!c.isDefaultPrevented()){var e=this._getDimension(),f=e===m.WIDTH?"offsetWidth":"offsetHeight";this._element.style[e]=this._element[f]+"px",d.reflow(this._element),a(this._element).addClass(l.COLLAPSING).removeClass(l.COLLAPSE).removeClass(l.IN),this._element.setAttribute("aria-expanded",!1),this._triggerArray.length&&a(this._triggerArray).addClass(l.COLLAPSED).attr("aria-expanded",!1),this.setTransitioning(!0);var g=function(){b.setTransitioning(!1),a(b._element).removeClass(l.COLLAPSING).addClass(l.COLLAPSE).trigger(k.HIDDEN)};return this._element.style[e]=0,d.supportsTransitionEnd()?void a(this._element).one(d.TRANSITION_END,g).emulateTransitionEnd(i):g()}}}},{key:"setTransitioning",value:function(a){this._isTransitioning=a}},{key:"_getDimension",value:function(){var b=a(this._element).hasClass(m.WIDTH);return b?m.WIDTH:m.HEIGHT}},{key:"_getParent",value:function(){var b=this,c=a(this._config.parent)[0],d='[data-toggle="collapse"][data-parent="'+this._config.parent+'"]';return a(c).find(d).each(function(a,c){b._addAriaAndCollapsedClass(e._getTargetFromElement(c),[c])}),c}},{key:"_addAriaAndCollapsedClass",value:function(b,c){if(b){var d=a(b).hasClass(l.IN);b.setAttribute("aria-expanded",d),c.length&&a(c).toggleClass(l.COLLAPSED,!d).attr("aria-expanded",d)}}}],[{key:"VERSION",get:function(){return f}},{key:"Default",get:function(){return j}},{key:"_getTargetFromElement",value:function(b){var c=d.getSelectorFromElement(b);return c?a(c)[0]:null}},{key:"_jQueryInterface",value:function(b){return this.each(function(){var c=a(this),d=c.data(g),f=a.extend({},j,c.data(),"object"==typeof b&&b);!d&&f.toggle&&/show|hide/.test(b)&&(f.toggle=!1),d||(d=new e(this,f),c.data(g,d)),"string"==typeof b&&d[b]()})}}]),e}();return a(document).on(k.CLICK,n.DATA_TOGGLE,function(b){b.preventDefault();var c=o._getTargetFromElement(this),d=a(c).data(g),e=d?"toggle":a(this).data();o._jQueryInterface.call(a(c),e)}),a.fn[e]=o._jQueryInterface,a.fn[e].Constructor=o,a.fn[e].noConflict=function(){return a.fn[e]=h,o._jQueryInterface},o}(jQuery),function(a){var e="dropdown",f="4.0.0",g="bs.dropdown",h=a.fn[e],i={HIDE:"hide.bs.dropdown",HIDDEN:"hidden.bs.dropdown",SHOW:"show.bs.dropdown",SHOWN:"shown.bs.dropdown",CLICK:"click.bs.dropdown",KEYDOWN:"keydown.bs.dropdown.data-api",CLICK_DATA:"click.bs.dropdown.data-api"},j={BACKDROP:"dropdown-backdrop",DISABLED:"disabled",OPEN:"open"},k={BACKDROP:".dropdown-backdrop",DATA_TOGGLE:'[data-toggle="dropdown"]',FORM_CHILD:".dropdown form",ROLE_MENU:'[role="menu"]',ROLE_LISTBOX:'[role="listbox"]',NAVBAR_NAV:".navbar-nav",VISIBLE_ITEMS:'[role="menu"] li:not(.disabled) a, [role="listbox"] li:not(.disabled) a'},l=function(){function e(c){b(this,e),a(c).on(i.CLICK,this.toggle)}return c(e,[{key:"toggle",value:function(){if(!this.disabled&&!a(this).hasClass(j.DISABLED)){var b=e._getParentFromElement(this),c=a(b).hasClass(j.OPEN);if(e._clearMenus(),c)return!1;if("ontouchstart"in document.documentElement&&!a(b).closest(k.NAVBAR_NAV).length){var d=document.createElement("div");d.className=j.BACKDROP,a(d).insertBefore(this),a(d).on("click",e._clearMenus)}var f={relatedTarget:this},g=a.Event(i.SHOW,f);if(a(b).trigger(g),!g.isDefaultPrevented())return this.focus(),this.setAttribute("aria-expanded","true"),a(b).toggleClass(j.OPEN),a(b).trigger(i.SHOWN,f),!1}}}],[{key:"VERSION",get:function(){return f}},{key:"_jQueryInterface",value:function(b){return this.each(function(){var c=a(this).data(g);c||a(this).data(g,c=new e(this)),"string"==typeof b&&c[b].call(this)})}},{key:"_clearMenus",value:function(b){if(!b||3!==b.which){var c=a(k.BACKDROP)[0];c&&c.parentNode.removeChild(c);for(var d=a.makeArray(a(k.DATA_TOGGLE)),f=0;f0&&h--,40===b.which&&hdocument.documentElement.clientHeight;!this._isBodyOverflowing&&a&&(this._element.style.paddingLeft=this._scrollbarWidth+"px"),this._isBodyOverflowing&&!a&&(this._element.style.paddingRight=this._scrollbarWidth+"px")}},{key:"_resetAdjustments",value:function(){this._element.style.paddingLeft="",this._element.style.paddingRight=""}},{key:"_checkScrollbar",value:function(){var a=window.innerWidth;if(!a){var b=document.documentElement.getBoundingClientRect();a=b.right-Math.abs(b.left)}this._isBodyOverflowing=document.body.clientWidth a",this._offsets=[],this._targets=[],this._activeTarget=null,this._scrollHeight=0,a(this._scrollElement).on(j.SCROLL,a.proxy(this._process,this)),this.refresh(),this._process()}return c(e,[{key:"refresh",value:function(){var b=this,c="offset",e=0;this._scrollElement!==this._scrollElement.window&&(c="position",e=this._getScrollTop()),this._offsets=[],this._targets=[],this._scrollHeight=this._getScrollHeight();var f=a.makeArray(a(this._selector));f.map(function(b){var f=void 0,g=d.getSelectorFromElement(b);return g&&(f=a(g)[0]),f&&(f.offsetWidth||f.offsetHeight)?[a(f)[c]().top+e,g]:void 0}).filter(function(a){return a}).sort(function(a,b){return a[0]-b[0]}).forEach(function(a){b._offsets.push(a[0]),b._targets.push(a[1])})}},{key:"_getScrollTop",value:function(){return this._scrollElement===window?this._scrollElement.scrollY:this._scrollElement.scrollTop}},{key:"_getScrollHeight",value:function(){return this._scrollElement.scrollHeight||Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)}},{key:"_process",value:function(){var a=this._getScrollTop()+this._config.offset,b=this._getScrollHeight(),c=this._config.offset+b-this._scrollElement.offsetHeight;if(this._scrollHeight!==b&&this.refresh(),a>=c){var d=this._targets[this._targets.length-1];this._activeTarget!==d&&this._activate(d)}if(this._activeTarget&&a=this._offsets[e]&&(void 0===this._offsets[e+1]||a .fade",ACTIVE:".active",ACTIVE_CHILD:"> .active",DATA_TOGGLE:'[data-toggle="tab"], [data-toggle="pill"]',DROPDOWN_ACTIVE_CHILD:"> .dropdown-menu > .active"},m=function(){function e(a){b(this,e),this._element=a}return c(e,[{key:"show",value:function(){var b=this;if(!this._element.parentNode||this._element.parentNode.nodeType!=Node.ELEMENT_NODE||!a(this._element).parent().hasClass(k.ACTIVE)){var c=void 0,e=void 0,f=a(this._element).closest(l.UL)[0],g=d.getSelectorFromElement(this._element);f&&(e=a.makeArray(a(f).find(l.ACTIVE)),e=e[e.length-1],e&&(e=a(e).find(l.A)[0]));var h=a.Event(j.HIDE,{relatedTarget:this._element}),i=a.Event(j.SHOW,{relatedTarget:e});if(e&&a(e).trigger(h),a(this._element).trigger(i),!i.isDefaultPrevented()&&!h.isDefaultPrevented()){g&&(c=a(g)[0]),this._activate(a(this._element).closest(l.LI)[0],f);var m=function(){var c=a.Event(j.HIDDEN,{relatedTarget:b._element}),d=a.Event(j.SHOWN,{relatedTarget:e});a(e).trigger(c),a(b._element).trigger(d)};c?this._activate(c,c.parentNode,m):m()}}}},{key:"_activate",value:function(b,c,e){var f=a(c).find(l.ACTIVE_CHILD)[0],g=e&&d.supportsTransitionEnd()&&(f&&a(f).hasClass(k.FADE)||!!a(c).find(l.FADE_CHILD)[0]),h=a.proxy(this._transitionComplete,this,b,f,g,e);f&&g?a(f).one(d.TRANSITION_END,h).emulateTransitionEnd(i):h(),f&&a(f).removeClass(k.IN)}},{key:"_transitionComplete",value:function(b,c,e,f){if(c){a(c).removeClass(k.ACTIVE);var g=a(c).find(l.DROPDOWN_ACTIVE_CHILD)[0];g&&a(g).removeClass(k.ACTIVE);var h=a(c).find(l.DATA_TOGGLE)[0];h&&h.setAttribute("aria-expanded",!1)}a(b).addClass(k.ACTIVE);var i=a(b).find(l.DATA_TOGGLE)[0];if(i&&i.setAttribute("aria-expanded",!0),e?(d.reflow(b),a(b).addClass(k.IN)):a(b).removeClass(k.FADE),b.parentNode&&a(b.parentNode).hasClass(k.DROPDOWN_MENU)){var j=a(b).closest(l.LI_DROPDOWN)[0];j&&a(j).addClass(k.ACTIVE),i=a(b).find(l.DATA_TOGGLE)[0],i&&i.setAttribute("aria-expanded",!0)}f&&f()}}],[{key:"VERSION",get:function(){return f}},{key:"Default",get:function(){return Default}},{key:"_jQueryInterface",value:function(b){return this.each(function(){var c=a(this),d=c.data(g);d||(d=d=new e(this),c.data(g,d)),"string"==typeof b&&d[b]()})}}]),e}();return a(document).on(j.CLICK,l.DATA_TOGGLE,function(b){b.preventDefault(),m._jQueryInterface.call(a(this),"show")}),a.fn[e]=m._jQueryInterface,a.fn[e].Constructor=m,a.fn[e].noConflict=function(){return a.fn[e]=h,m._jQueryInterface},m}(jQuery),function(a){var e="tooltip",f="4.0.0",g="bs.tooltip",h=a.fn[e],i=150,j="bs-tether",k={animation:!0,template:'',trigger:"hover focus",title:"",delay:0,html:!1,selector:!1,placement:"top",offset:"0 0",constraints:null},l={TOP:"bottom center",RIGHT:"middle left",BOTTOM:"top center",LEFT:"middle right"},m={IN:"in",OUT:"out"},n={HIDE:"hide.bs.tooltip",HIDDEN:"hidden.bs.tooltip",SHOW:"show.bs.tooltip",SHOWN:"shown.bs.tooltip",INSERTED:"inserted.bs.tooltip",CLICK:"click.bs.tooltip",FOCUSIN:"focusin.bs.tooltip",FOCUSOUT:"focusout.bs.tooltip",MOUSEENTER:"mouseenter.bs.tooltip",MOUSELEAVE:"mouseleave.bs.tooltip"},o={FADE:"fade",IN:"in"},p={TOOLTIP:".tooltip",TOOLTIP_INNER:".tooltip-inner"},q={element:!1,enabled:!1},r={HOVER:"hover",FOCUS:"focus",CLICK:"click",MANUAL:"manual"},s=function(){function h(a,c){b(this,h),this._isEnabled=!0,this._timeout=0,this._hoverState="",this._activeTrigger={},this._tether=null,this.element=a,this.config=this._getConfig(c),this.tip=null,this._setListeners()}return c(h,[{key:"enable",value:function(){this._isEnabled=!0}},{key:"disable",value:function(){this._isEnabled=!1}},{key:"toggleEnabled",value:function(){this._isEnabled=!this._isEnabled}},{key:"toggle",value:function(b){var c=this,d=this.constructor.DATA_KEY;b?(c=a(b.currentTarget).data(d),c||(c=new this.constructor(b.currentTarget,this._getDelegateConfig()),a(b.currentTarget).data(d,c)),c._activeTrigger.click=!c._activeTrigger.click,c._isWithActiveTrigger()?c._enter(null,c):c._leave(null,c)):a(c.getTipElement()).hasClass(o.IN)?c._leave(null,c):c._enter(null,c)}},{key:"destroy",value:function(){var b=this;clearTimeout(this._timeout),this.hide(function(){a(b.element).off("."+b.constructor.NAME).removeData(b.constructor.DATA_KEY), +b.tip&&a(b.tip).detach(),b.tip=null})}},{key:"show",value:function(){var b=this,c=a.Event(this.constructor.Event.SHOW);if(this.isWithContent()&&this._isEnabled){a(this.element).trigger(c);var e=a.contains(this.element.ownerDocument.documentElement,this.element);if(c.isDefaultPrevented()||!e)return;var f=this.getTipElement(),g=d.getUID(this.constructor.NAME);f.setAttribute("id",g),this.element.setAttribute("aria-describedby",g),this.setContent(),this.config.animation&&a(f).addClass(o.FADE);var i="function"==typeof this.config.placement?this.config.placement.call(this,f,this.element):this.config.placement,k=this._getAttachment(i);a(f).data(this.constructor.DATA_KEY,this).appendTo(document.body),a(this.element).trigger(this.constructor.Event.INSERTED),this._tether=new Tether({element:f,target:this.element,attachment:k,classes:q,classPrefix:j,offset:this.config.offset,constraints:this.config.constraints}),d.reflow(f),this._tether.position(),a(f).addClass(o.IN);var l=function(){var c=b._hoverState;b._hoverState=null,a(b.element).trigger(b.constructor.Event.SHOWN),c===m.OUT&&b._leave(null,b)};d.supportsTransitionEnd()&&a(this.tip).hasClass(o.FADE)?a(this.tip).one(d.TRANSITION_END,l).emulateTransitionEnd(h._TRANSITION_DURATION):l()}}},{key:"hide",value:function(b){var c=this,e=this.getTipElement(),f=a.Event(this.constructor.Event.HIDE),g=function(){c._hoverState!==m.IN&&e.parentNode&&e.parentNode.removeChild(e),c.element.removeAttribute("aria-describedby"),a(c.element).trigger(c.constructor.Event.HIDDEN),c.cleanupTether(),b&&b()};a(this.element).trigger(f),f.isDefaultPrevented()||(a(e).removeClass(o.IN),d.supportsTransitionEnd()&&a(this.tip).hasClass(o.FADE)?a(e).one(d.TRANSITION_END,g).emulateTransitionEnd(i):g(),this._hoverState="")}},{key:"isWithContent",value:function(){return!!this.getTitle()}},{key:"getTipElement",value:function(){return this.tip=this.tip||a(this.config.template)[0]}},{key:"setContent",value:function(){var b=this.getTipElement(),c=this.getTitle(),d=this.config.html?"innerHTML":"innerText";a(b).find(p.TOOLTIP_INNER)[0][d]=c,a(b).removeClass(o.FADE).removeClass(o.IN),this.cleanupTether()}},{key:"getTitle",value:function(){var a=this.element.getAttribute("data-original-title");return a||(a="function"==typeof this.config.title?this.config.title.call(this.element):this.config.title),a}},{key:"cleanupTether",value:function(){this._tether&&(this._tether.destroy(),a(this.element).removeClass(this._removeTetherClasses),a(this.tip).removeClass(this._removeTetherClasses))}},{key:"_getAttachment",value:function(a){return l[a.toUpperCase()]}},{key:"_setListeners",value:function(){var b=this,c=this.config.trigger.split(" ");c.forEach(function(c){if("click"===c)a(b.element).on(b.constructor.Event.CLICK,b.config.selector,a.proxy(b.toggle,b));else if(c!==r.MANUAL){var d=c==r.HOVER?b.constructor.Event.MOUSEENTER:b.constructor.Event.FOCUSIN,e=c==r.HOVER?b.constructor.Event.MOUSELEAVE:b.constructor.Event.FOCUSOUT;a(b.element).on(d,b.config.selector,a.proxy(b._enter,b)).on(e,b.config.selector,a.proxy(b._leave,b))}}),this.config.selector?this.config=a.extend({},this.config,{trigger:"manual",selector:""}):this._fixTitle()}},{key:"_removeTetherClasses",value:function(a,b){return((b.baseVal||b).match(new RegExp("(^|\\s)"+j+"-\\S+","g"))||[]).join(" ")}},{key:"_fixTitle",value:function(){var a=typeof this.element.getAttribute("data-original-title");(this.element.getAttribute("title")||"string"!==a)&&(this.element.setAttribute("data-original-title",this.element.getAttribute("title")||""),this.element.setAttribute("title",""))}},{key:"_enter",value:function(b,c){var d=this.constructor.DATA_KEY;return c=c||a(b.currentTarget).data(d),c||(c=new this.constructor(b.currentTarget,this._getDelegateConfig()),a(b.currentTarget).data(d,c)),b&&(c._activeTrigger["focusin"==b.type?r.FOCUS:r.HOVER]=!0),a(c.getTipElement()).hasClass(o.IN)||c._hoverState===m.IN?void(c._hoverState=m.IN):(clearTimeout(c._timeout),c._hoverState=m.IN,c.config.delay&&c.config.delay.show?void(c._timeout=setTimeout(function(){c._hoverState===m.IN&&c.show()},c.config.delay.show)):void c.show())}},{key:"_leave",value:function(b,c){var d=this.constructor.DATA_KEY;return c=c||a(b.currentTarget).data(d),c||(c=new this.constructor(b.currentTarget,this._getDelegateConfig()),a(b.currentTarget).data(d,c)),b&&(c._activeTrigger["focusout"==b.type?r.FOCUS:r.HOVER]=!1),c._isWithActiveTrigger()?void 0:(clearTimeout(c._timeout),c._hoverState=m.OUT,c.config.delay&&c.config.delay.hide?void(c._timeout=setTimeout(function(){c._hoverState===m.OUT&&c.hide()},c.config.delay.hide)):void c.hide())}},{key:"_isWithActiveTrigger",value:function(){for(var a in this._activeTrigger)if(this._activeTrigger[a])return!0;return!1}},{key:"_getConfig",value:function(b){return b=a.extend({},this.constructor.Default,a(this.element).data(),b),b.delay&&"number"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),b}},{key:"_getDelegateConfig",value:function(){var a={};if(this.config)for(var b in this.config){var c=this.config[b];this.constructor.Default[b]!==c&&(a[b]=c)}return a}}],[{key:"VERSION",get:function(){return f}},{key:"Default",get:function(){return k}},{key:"NAME",get:function(){return e}},{key:"DATA_KEY",get:function(){return g}},{key:"Event",get:function(){return n}},{key:"_jQueryInterface",value:function(b){return this.each(function(){var c=a(this).data(g),d="object"==typeof b?b:null;(c||!/destroy|hide/.test(b))&&(c||(c=new h(this,d),a(this).data(g,c)),"string"==typeof b&&c[b]())})}}]),h}();return a.fn[e]=s._jQueryInterface,a.fn[e].Constructor=s,a.fn[e].noConflict=function(){return a.fn[e]=h,s._jQueryInterface},s}(jQuery));!function(d){var f="popover",g="4.0.0",h="bs.popover",i=d.fn[f],j=d.extend({},e.Default,{placement:"right",trigger:"click",content:"",template:''}),k={FADE:"fade",IN:"in"},l={TITLE:".popover-title",CONTENT:".popover-content",ARROW:".popover-arrow"},m={HIDE:"hide.bs.popover",HIDDEN:"hidden.bs.popover",SHOW:"show.bs.popover",SHOWN:"shown.bs.popover",INSERTED:"inserted.bs.popover",CLICK:"click.bs.popover",FOCUSIN:"focusin.bs.popover",FOCUSOUT:"focusout.bs.popover",MOUSEENTER:"mouseenter.bs.popover",MOUSELEAVE:"mouseleave.bs.popover"},n=function(e){function i(){b(this,i),null!=e&&e.apply(this,arguments)}return a(i,e),c(i,[{key:"isWithContent",value:function(){return this.getTitle()||this._getContent()}},{key:"getTipElement",value:function(){return this.tip=this.tip||d(this.config.template)[0]}},{key:"setContent",value:function(){var a=this.getTipElement(),b=this.getTitle(),c=this._getContent(),e=d(a).find(l.TITLE)[0];e&&(e[this.config.html?"innerHTML":"innerText"]=b),d(a).find(l.CONTENT).children().detach().end()[this.config.html?"string"==typeof c?"html":"append":"text"](c),d(a).removeClass(k.FADE).removeClass(k.IN),this.cleanupTether()}},{key:"_getContent",value:function(){return this.element.getAttribute("data-content")||("function"==typeof this.config.content?this.config.content.call(this.element):this.config.content)}}],[{key:"VERSION",get:function(){return g}},{key:"Default",get:function(){return j}},{key:"NAME",get:function(){return f}},{key:"DATA_KEY",get:function(){return h}},{key:"Event",get:function(){return m}},{key:"_jQueryInterface",value:function(a){return this.each(function(){var b=d(this).data(h),c="object"==typeof a?a:null;(b||!/destroy|hide/.test(a))&&(b||(b=new i(this,c),d(this).data(h,b)),"string"==typeof a&&b[a]())})}}]),i}(e);return d.fn[f]=n._jQueryInterface,d.fn[f].Constructor=n,d.fn[f].noConflict=function(){return d.fn[f]=i,n._jQueryInterface},n}(jQuery)}}(jQuery); \ No newline at end of file diff --git a/dist/js/npm.js b/dist/js/npm.js index d1224ffb4..d0564681c 100644 --- a/dist/js/npm.js +++ b/dist/js/npm.js @@ -1,12 +1,12 @@ // This file is autogenerated via the `commonjs` Grunt task. You can require() this file in a CommonJS environment. -require('../../js/src/util.js') -require('../../js/src/alert.js') -require('../../js/src/button.js') -require('../../js/src/carousel.js') -require('../../js/src/collapse.js') -require('../../js/src/dropdown.js') -require('../../js/src/modal.js') -require('../../js/src/scrollspy.js') -require('../../js/src/tab.js') -require('../../js/src/tooltip.js') -require('../../js/src/popover.js') \ No newline at end of file +require('./umd/util.js') +require('./umd/alert.js') +require('./umd/button.js') +require('./umd/carousel.js') +require('./umd/collapse.js') +require('./umd/dropdown.js') +require('./umd/modal.js') +require('./umd/scrollspy.js') +require('./umd/tab.js') +require('./umd/tooltip.js') +require('./umd/popover.js') \ No newline at end of file diff --git a/dist/js/umd/alert.js b/dist/js/umd/alert.js new file mode 100644 index 000000000..1d01fb7a3 --- /dev/null +++ b/dist/js/umd/alert.js @@ -0,0 +1,203 @@ +(function (global, factory) { + if (typeof define === 'function' && define.amd) { + define(['exports', 'module', './util'], factory); + } else if (typeof exports !== 'undefined' && typeof module !== 'undefined') { + factory(exports, module, require('./util')); + } else { + var mod = { + exports: {} + }; + factory(mod.exports, mod, global.Util); + global.alert = mod.exports; + } +})(this, function (exports, module, _util) { + 'use strict'; + + var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); + + function _interopRequire(obj) { return obj && obj.__esModule ? obj['default'] : obj; } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } + + var _Util = _interopRequire(_util); + + /** + * -------------------------------------------------------------------------- + * Bootstrap (v4.0.0): alert.js + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * -------------------------------------------------------------------------- + */ + + var Alert = (function ($) { + + /** + * ------------------------------------------------------------------------ + * Constants + * ------------------------------------------------------------------------ + */ + + var NAME = 'alert'; + var VERSION = '4.0.0'; + var DATA_KEY = 'bs.alert'; + var JQUERY_NO_CONFLICT = $.fn[NAME]; + var TRANSITION_DURATION = 150; + + var Selector = { + DISMISS: '[data-dismiss="alert"]' + }; + + var Event = { + CLOSE: 'close.bs.alert', + CLOSED: 'closed.bs.alert', + CLICK: 'click.bs.alert.data-api' + }; + + var ClassName = { + ALERT: 'alert', + FADE: 'fade', + IN: 'in' + }; + + /** + * ------------------------------------------------------------------------ + * Class Definition + * ------------------------------------------------------------------------ + */ + + var Alert = (function () { + function Alert(element) { + _classCallCheck(this, Alert); + + this._element = element; + } + + _createClass(Alert, [{ + key: 'close', + + // public + + value: function close(element) { + element = element || this._element; + + var rootElement = this._getRootElement(element); + var customEvent = this._triggerCloseEvent(rootElement); + + if (customEvent.isDefaultPrevented()) { + return; + } + + this._removeElement(rootElement); + } + }, { + key: '_getRootElement', + + // private + + value: function _getRootElement(element) { + var parent = false; + var selector = _Util.getSelectorFromElement(element); + + if (selector) { + parent = $(selector)[0]; + } + + if (!parent) { + parent = $(element).closest('.' + ClassName.ALERT)[0]; + } + + return parent; + } + }, { + key: '_triggerCloseEvent', + value: function _triggerCloseEvent(element) { + var closeEvent = $.Event(Event.CLOSE); + $(element).trigger(closeEvent); + return closeEvent; + } + }, { + key: '_removeElement', + value: function _removeElement(element) { + $(element).removeClass(ClassName.IN); + + if (!_Util.supportsTransitionEnd() || !$(element).hasClass(ClassName.FADE)) { + this._destroyElement(element); + return; + } + + $(element).one(_Util.TRANSITION_END, this._destroyElement.bind(this, element)).emulateTransitionEnd(TRANSITION_DURATION); + } + }, { + key: '_destroyElement', + value: function _destroyElement(element) { + $(element).detach().trigger(Event.CLOSED).remove(); + } + }], [{ + key: 'VERSION', + + // getters + + get: function () { + return VERSION; + } + }, { + key: '_jQueryInterface', + + // static + + value: function _jQueryInterface(config) { + return this.each(function () { + var $element = $(this); + var data = $element.data(DATA_KEY); + + if (!data) { + data = new Alert(this); + $element.data(DATA_KEY, data); + } + + if (config === 'close') { + data[config](this); + } + }); + } + }, { + key: '_handleDismiss', + value: function _handleDismiss(alertInstance) { + return function (event) { + if (event) { + event.preventDefault(); + } + + alertInstance.close(this); + }; + } + }]); + + return Alert; + })(); + + /** + * ------------------------------------------------------------------------ + * Data Api implementation + * ------------------------------------------------------------------------ + */ + + $(document).on(Event.CLICK, Selector.DISMISS, Alert._handleDismiss(new Alert())); + + /** + * ------------------------------------------------------------------------ + * jQuery + * ------------------------------------------------------------------------ + */ + + $.fn[NAME] = Alert._jQueryInterface; + $.fn[NAME].Constructor = Alert; + $.fn[NAME].noConflict = function () { + $.fn[NAME] = JQUERY_NO_CONFLICT; + return Alert._jQueryInterface; + }; + + return Alert; + })(jQuery); + + module.exports = Alert; +}); \ No newline at end of file diff --git a/dist/js/umd/button.js b/dist/js/umd/button.js new file mode 100644 index 000000000..7449af2c9 --- /dev/null +++ b/dist/js/umd/button.js @@ -0,0 +1,181 @@ +(function (global, factory) { + if (typeof define === 'function' && define.amd) { + define(['exports', 'module'], factory); + } else if (typeof exports !== 'undefined' && typeof module !== 'undefined') { + factory(exports, module); + } else { + var mod = { + exports: {} + }; + factory(mod.exports, mod); + global.button = mod.exports; + } +})(this, function (exports, module) { + 'use strict'; + + var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } + + /** + * -------------------------------------------------------------------------- + * Bootstrap (v4.0.0): button.js + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * -------------------------------------------------------------------------- + */ + + var Button = (function ($) { + + /** + * ------------------------------------------------------------------------ + * Constants + * ------------------------------------------------------------------------ + */ + + var NAME = 'button'; + var VERSION = '4.0.0'; + var DATA_KEY = 'bs.button'; + var JQUERY_NO_CONFLICT = $.fn[NAME]; + var TRANSITION_DURATION = 150; + + var ClassName = { + ACTIVE: 'active', + BUTTON: 'btn', + FOCUS: 'focus' + }; + + var Selector = { + DATA_TOGGLE_CARROT: '[data-toggle^="button"]', + DATA_TOGGLE: '[data-toggle="buttons"]', + INPUT: 'input', + ACTIVE: '.active', + BUTTON: '.btn' + }; + + var Event = { + CLICK: 'click.bs.button.data-api', + FOCUS_BLUR: 'focus.bs.button.data-api blur.bs.button.data-api' + }; + + /** + * ------------------------------------------------------------------------ + * Class Definition + * ------------------------------------------------------------------------ + */ + + var Button = (function () { + function Button(element) { + _classCallCheck(this, Button); + + this._element = element; + } + + _createClass(Button, [{ + key: 'toggle', + + // public + + value: function toggle() { + var triggerChangeEvent = true; + var rootElement = $(this._element).closest(Selector.DATA_TOGGLE)[0]; + + if (rootElement) { + var input = $(this._element).find(Selector.INPUT)[0]; + + if (input) { + if (input.type === 'radio') { + if (input.checked && $(this._element).hasClass(ClassName.ACTIVE)) { + triggerChangeEvent = false; + } else { + var activeElement = $(rootElement).find(Selector.ACTIVE)[0]; + + if (activeElement) { + $(activeElement).removeClass(ClassName.ACTIVE); + } + } + } + + if (triggerChangeEvent) { + input.checked = !$(this._element).hasClass(ClassName.ACTIVE); + $(this._element).trigger('change'); + } + } + } else { + this._element.setAttribute('aria-pressed', !$(this._element).hasClass(ClassName.ACTIVE)); + } + + if (triggerChangeEvent) { + $(this._element).toggleClass(ClassName.ACTIVE); + } + } + }], [{ + key: 'VERSION', + + // getters + + get: function () { + return VERSION; + } + }, { + key: '_jQueryInterface', + + // static + + value: function _jQueryInterface(config) { + return this.each(function () { + var data = $(this).data(DATA_KEY); + + if (!data) { + data = new Button(this); + $(this).data(DATA_KEY, data); + } + + if (config === 'toggle') { + data[config](); + } + }); + } + }]); + + return Button; + })(); + + /** + * ------------------------------------------------------------------------ + * Data Api implementation + * ------------------------------------------------------------------------ + */ + + $(document).on(Event.CLICK, Selector.DATA_TOGGLE_CARROT, function (event) { + event.preventDefault(); + + var button = event.target; + + if (!$(button).hasClass(ClassName.BUTTON)) { + button = $(button).closest(Selector.BUTTON); + } + + Button._jQueryInterface.call($(button), 'toggle'); + }).on(Event.FOCUS_BLUR, Selector.DATA_TOGGLE_CARROT, function (event) { + var button = $(event.target).closest(Selector.BUTTON)[0]; + $(button).toggleClass(ClassName.FOCUS, /^focus(in)?$/.test(event.type)); + }); + + /** + * ------------------------------------------------------------------------ + * jQuery + * ------------------------------------------------------------------------ + */ + + $.fn[NAME] = Button._jQueryInterface; + $.fn[NAME].Constructor = Button; + $.fn[NAME].noConflict = function () { + $.fn[NAME] = JQUERY_NO_CONFLICT; + return Button._jQueryInterface; + }; + + return Button; + })(jQuery); + + module.exports = Button; +}); \ No newline at end of file diff --git a/dist/js/umd/carousel.js b/dist/js/umd/carousel.js new file mode 100644 index 000000000..0e5b34142 --- /dev/null +++ b/dist/js/umd/carousel.js @@ -0,0 +1,450 @@ +(function (global, factory) { + if (typeof define === 'function' && define.amd) { + define(['exports', 'module', './util'], factory); + } else if (typeof exports !== 'undefined' && typeof module !== 'undefined') { + factory(exports, module, require('./util')); + } else { + var mod = { + exports: {} + }; + factory(mod.exports, mod, global.Util); + global.carousel = mod.exports; + } +})(this, function (exports, module, _util) { + 'use strict'; + + var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); + + function _interopRequire(obj) { return obj && obj.__esModule ? obj['default'] : obj; } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } + + var _Util = _interopRequire(_util); + + /** + * -------------------------------------------------------------------------- + * Bootstrap (v4.0.0): carousel.js + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * -------------------------------------------------------------------------- + */ + + var Carousel = (function ($) { + + /** + * ------------------------------------------------------------------------ + * Constants + * ------------------------------------------------------------------------ + */ + + var NAME = 'carousel'; + var VERSION = '4.0.0'; + var DATA_KEY = 'bs.carousel'; + var JQUERY_NO_CONFLICT = $.fn[NAME]; + var TRANSITION_DURATION = 600; + + var Default = { + interval: 5000, + keyboard: true, + slide: false, + pause: 'hover', + wrap: true + }; + + var Direction = { + NEXT: 'next', + PREVIOUS: 'prev' + }; + + var Event = { + SLIDE: 'slide.bs.carousel', + SLID: 'slid.bs.carousel', + CLICK: 'click.bs.carousel.data-api', + LOAD: 'load' + }; + + var ClassName = { + CAROUSEL: 'carousel', + ACTIVE: 'active', + SLIDE: 'slide', + RIGHT: 'right', + LEFT: 'left', + ITEM: 'carousel-item' + }; + + var Selector = { + ACTIVE: '.active', + ACTIVE_ITEM: '.active.carousel-item', + ITEM: '.carousel-item', + NEXT_PREV: '.next, .prev', + INDICATORS: '.carousel-indicators', + DATA_SLIDE: '[data-slide], [data-slide-to]', + DATA_RIDE: '[data-ride="carousel"]' + }; + + /** + * ------------------------------------------------------------------------ + * Class Definition + * ------------------------------------------------------------------------ + */ + + var Carousel = (function () { + function Carousel(element, config) { + _classCallCheck(this, Carousel); + + this._items = null; + this._interval = null; + this._activeElement = null; + + this._isPaused = false; + this._isSliding = false; + + this._config = config; + this._element = $(element)[0]; + this._indicatorsElement = $(this._element).find(Selector.INDICATORS)[0]; + + this._addEventListeners(); + } + + _createClass(Carousel, [{ + key: 'next', + + // public + + value: function next() { + if (!this._isSliding) { + this._slide(Direction.NEXT); + } + } + }, { + key: 'prev', + value: function prev() { + if (!this._isSliding) { + this._slide(Direction.PREVIOUS); + } + } + }, { + key: 'pause', + value: function pause(event) { + if (!event) { + this._isPaused = true; + } + + if ($(this._element).find(Selector.NEXT_PREV)[0] && _Util.supportsTransitionEnd()) { + _Util.triggerTransitionEnd(this._element); + this.cycle(true); + } + + clearInterval(this._interval); + this._interval = null; + } + }, { + key: 'cycle', + value: function cycle(event) { + if (!event) { + this._isPaused = false; + } + + if (this._interval) { + clearInterval(this._interval); + this._interval = null; + } + + if (this._config.interval && !this._isPaused) { + this._interval = setInterval($.proxy(this.next, this), this._config.interval); + } + } + }, { + key: 'to', + value: function to(index) { + var _this = this; + + this._activeElement = $(this._element).find(Selector.ACTIVE_ITEM)[0]; + + var activeIndex = this._getItemIndex(this._activeElement); + + if (index > this._items.length - 1 || index < 0) { + return; + } + + if (this._isSliding) { + $(this._element).one(Event.SLID, function () { + return _this.to(index); + }); + return; + } + + if (activeIndex == index) { + this.pause(); + this.cycle(); + return; + } + + var direction = index > activeIndex ? Direction.NEXT : Direction.PREVIOUS; + + this._slide(direction, this._items[index]); + } + }, { + key: '_addEventListeners', + + // private + + value: function _addEventListeners() { + if (this._config.keyboard) { + $(this._element).on('keydown.bs.carousel', $.proxy(this._keydown, this)); + } + + if (this._config.pause == 'hover' && !('ontouchstart' in document.documentElement)) { + $(this._element).on('mouseenter.bs.carousel', $.proxy(this.pause, this)).on('mouseleave.bs.carousel', $.proxy(this.cycle, this)); + } + } + }, { + key: '_keydown', + value: function _keydown(event) { + event.preventDefault(); + + if (/input|textarea/i.test(event.target.tagName)) return; + + switch (event.which) { + case 37: + this.prev();break; + case 39: + this.next();break; + default: + return; + } + } + }, { + key: '_getItemIndex', + value: function _getItemIndex(element) { + this._items = $.makeArray($(element).parent().find(Selector.ITEM)); + return this._items.indexOf(element); + } + }, { + key: '_getItemByDirection', + value: function _getItemByDirection(direction, activeElement) { + var isNextDirection = direction === Direction.NEXT; + var isPrevDirection = direction === Direction.PREVIOUS; + var activeIndex = this._getItemIndex(activeElement); + var lastItemIndex = this._items.length - 1; + var isGoingToWrap = isPrevDirection && activeIndex === 0 || isNextDirection && activeIndex == lastItemIndex; + + if (isGoingToWrap && !this._config.wrap) { + return activeElement; + } + + var delta = direction == Direction.PREVIOUS ? -1 : 1; + var itemIndex = (activeIndex + delta) % this._items.length; + + return itemIndex === -1 ? this._items[this._items.length - 1] : this._items[itemIndex]; + } + }, { + key: '_triggerSlideEvent', + value: function _triggerSlideEvent(relatedTarget, directionalClassname) { + var slideEvent = $.Event(Event.SLIDE, { + relatedTarget: relatedTarget, + direction: directionalClassname + }); + + $(this._element).trigger(slideEvent); + + return slideEvent; + } + }, { + key: '_setActiveIndicatorElement', + value: function _setActiveIndicatorElement(element) { + if (this._indicatorsElement) { + $(this._indicatorsElement).find(Selector.ACTIVE).removeClass(ClassName.ACTIVE); + + var nextIndicator = this._indicatorsElement.children[this._getItemIndex(element)]; + + if (nextIndicator) { + $(nextIndicator).addClass(ClassName.ACTIVE); + } + } + } + }, { + key: '_slide', + value: function _slide(direction, element) { + var _this2 = this; + + var activeElement = $(this._element).find(Selector.ACTIVE_ITEM)[0]; + var nextElement = element || activeElement && this._getItemByDirection(direction, activeElement); + + var isCycling = !!this._interval; + + var directionalClassName = direction == Direction.NEXT ? ClassName.LEFT : ClassName.RIGHT; + + if (nextElement && $(nextElement).hasClass(ClassName.ACTIVE)) { + this._isSliding = false; + return; + } + + var slideEvent = this._triggerSlideEvent(nextElement, directionalClassName); + if (slideEvent.isDefaultPrevented()) { + return; + } + + if (!activeElement || !nextElement) { + // some weirdness is happening, so we bail + return; + } + + this._isSliding = true; + + if (isCycling) { + this.pause(); + } + + this._setActiveIndicatorElement(nextElement); + + var slidEvent = $.Event(Event.SLID, { + relatedTarget: nextElement, + direction: directionalClassName + }); + + if (_Util.supportsTransitionEnd() && $(this._element).hasClass(ClassName.SLIDE)) { + + $(nextElement).addClass(direction); + + _Util.reflow(nextElement); + + $(activeElement).addClass(directionalClassName); + $(nextElement).addClass(directionalClassName); + + $(activeElement).one(_Util.TRANSITION_END, function () { + $(nextElement).removeClass(directionalClassName).removeClass(direction); + + $(nextElement).addClass(ClassName.ACTIVE); + + $(activeElement).removeClass(ClassName.ACTIVE).removeClass(direction).removeClass(directionalClassName); + + _this2._isSliding = false; + + setTimeout(function () { + return $(_this2._element).trigger(slidEvent); + }, 0); + }).emulateTransitionEnd(TRANSITION_DURATION); + } else { + $(activeElement).removeClass(ClassName.ACTIVE); + $(nextElement).addClass(ClassName.ACTIVE); + + this._isSliding = false; + $(this._element).trigger(slidEvent); + } + + if (isCycling) { + this.cycle(); + } + } + }], [{ + key: 'VERSION', + + // getters + + get: function () { + return VERSION; + } + }, { + key: 'Default', + get: function () { + return Default; + } + }, { + key: '_jQueryInterface', + + // static + + value: function _jQueryInterface(config) { + return this.each(function () { + var data = $(this).data(DATA_KEY); + var _config = $.extend({}, Default, $(this).data()); + + if (typeof config === 'object') { + $.extend(_config, config); + } + + var action = typeof config === 'string' ? config : _config.slide; + + if (!data) { + data = new Carousel(this, _config); + $(this).data(DATA_KEY, data); + } + + if (typeof config == 'number') { + data.to(config); + } else if (action) { + data[action](); + } else if (_config.interval) { + data.pause(); + data.cycle(); + } + }); + } + }, { + key: '_dataApiClickHandler', + value: function _dataApiClickHandler(event) { + var selector = _Util.getSelectorFromElement(this); + + if (!selector) { + return; + } + + var target = $(selector)[0]; + + if (!target || !$(target).hasClass(ClassName.CAROUSEL)) { + return; + } + + var config = $.extend({}, $(target).data(), $(this).data()); + + var slideIndex = this.getAttribute('data-slide-to'); + if (slideIndex) { + config.interval = false; + } + + Carousel._jQueryInterface.call($(target), config); + + if (slideIndex) { + $(target).data(DATA_KEY).to(slideIndex); + } + + event.preventDefault(); + } + }]); + + return Carousel; + })(); + + /** + * ------------------------------------------------------------------------ + * Data Api implementation + * ------------------------------------------------------------------------ + */ + + $(document).on(Event.CLICK, Selector.DATA_SLIDE, Carousel._dataApiClickHandler); + + $(window).on(Event.LOAD, function () { + $(Selector.DATA_RIDE).each(function () { + var $carousel = $(this); + Carousel._jQueryInterface.call($carousel, $carousel.data()); + }); + }); + + /** + * ------------------------------------------------------------------------ + * jQuery + * ------------------------------------------------------------------------ + */ + + $.fn[NAME] = Carousel._jQueryInterface; + $.fn[NAME].Constructor = Carousel; + $.fn[NAME].noConflict = function () { + $.fn[NAME] = JQUERY_NO_CONFLICT; + return Carousel._jQueryInterface; + }; + + return Carousel; + })(jQuery); + + module.exports = Carousel; +}); \ No newline at end of file diff --git a/dist/js/umd/collapse.js b/dist/js/umd/collapse.js new file mode 100644 index 000000000..5a931a9b4 --- /dev/null +++ b/dist/js/umd/collapse.js @@ -0,0 +1,354 @@ +(function (global, factory) { + if (typeof define === 'function' && define.amd) { + define(['exports', 'module', './util'], factory); + } else if (typeof exports !== 'undefined' && typeof module !== 'undefined') { + factory(exports, module, require('./util')); + } else { + var mod = { + exports: {} + }; + factory(mod.exports, mod, global.Util); + global.collapse = mod.exports; + } +})(this, function (exports, module, _util) { + 'use strict'; + + var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); + + function _interopRequire(obj) { return obj && obj.__esModule ? obj['default'] : obj; } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } + + var _Util = _interopRequire(_util); + + /** + * -------------------------------------------------------------------------- + * Bootstrap (v4.0.0): collapse.js + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * -------------------------------------------------------------------------- + */ + + var Collapse = (function ($) { + + /** + * ------------------------------------------------------------------------ + * Constants + * ------------------------------------------------------------------------ + */ + + var NAME = 'collapse'; + var VERSION = '4.0.0'; + var DATA_KEY = 'bs.collapse'; + var JQUERY_NO_CONFLICT = $.fn[NAME]; + var TRANSITION_DURATION = 600; + + var Default = { + toggle: true, + parent: null + }; + + var Event = { + SHOW: 'show.bs.collapse', + SHOWN: 'shown.bs.collapse', + HIDE: 'hide.bs.collapse', + HIDDEN: 'hidden.bs.collapse', + CLICK: 'click.bs.collapse.data-api' + }; + + var ClassName = { + IN: 'in', + COLLAPSE: 'collapse', + COLLAPSING: 'collapsing', + COLLAPSED: 'collapsed' + }; + + var Dimension = { + WIDTH: 'width', + HEIGHT: 'height' + }; + + var Selector = { + ACTIVES: '.panel > .in, .panel > .collapsing', + DATA_TOGGLE: '[data-toggle="collapse"]' + }; + + /** + * ------------------------------------------------------------------------ + * Class Definition + * ------------------------------------------------------------------------ + */ + + var Collapse = (function () { + function Collapse(element, config) { + _classCallCheck(this, Collapse); + + this._isTransitioning = false; + this._element = element; + this._config = $.extend({}, Default, config); + this._triggerArray = $.makeArray($('[data-toggle="collapse"][href="#' + element.id + '"],' + ('[data-toggle="collapse"][data-target="#' + element.id + '"]'))); + + this._parent = this._config.parent ? this._getParent() : null; + + if (!this._config.parent) { + this._addAriaAndCollapsedClass(this._element, this._triggerArray); + } + + if (this._config.toggle) { + this.toggle(); + } + } + + _createClass(Collapse, [{ + key: 'toggle', + + // public + + value: function toggle() { + if ($(this._element).hasClass(ClassName.IN)) { + this.hide(); + } else { + this.show(); + } + } + }, { + key: 'show', + value: function show() { + var _this = this; + + if (this._isTransitioning || $(this._element).hasClass(ClassName.IN)) { + return; + } + + var activesData = undefined; + var actives = undefined; + + if (this._parent) { + actives = $.makeArray($(Selector.ACTIVES)); + if (!actives.length) { + actives = null; + } + } + + if (actives) { + activesData = $(actives).data(DATA_KEY); + if (activesData && activesData._isTransitioning) { + return; + } + } + + var startEvent = $.Event(Event.SHOW); + $(this._element).trigger(startEvent); + if (startEvent.isDefaultPrevented()) { + return; + } + + if (actives) { + Collapse._jQueryInterface.call($(actives), 'hide'); + if (!activesData) { + $(actives).data(DATA_KEY, null); + } + } + + var dimension = this._getDimension(); + + $(this._element).removeClass(ClassName.COLLAPSE).addClass(ClassName.COLLAPSING); + + this._element.style[dimension] = 0; + this._element.setAttribute('aria-expanded', true); + + if (this._triggerArray.length) { + $(this._triggerArray).removeClass(ClassName.COLLAPSED).attr('aria-expanded', true); + } + + this.setTransitioning(true); + + var complete = function complete() { + $(_this._element).removeClass(ClassName.COLLAPSING).addClass(ClassName.COLLAPSE).addClass(ClassName.IN); + + _this._element.style[dimension] = ''; + + _this.setTransitioning(false); + + $(_this._element).trigger(Event.SHOWN); + }; + + if (!_Util.supportsTransitionEnd()) { + complete(); + return; + } + + var scrollSize = 'scroll' + (dimension[0].toUpperCase() + dimension.slice(1)); + + $(this._element).one(_Util.TRANSITION_END, complete).emulateTransitionEnd(TRANSITION_DURATION); + + this._element.style[dimension] = this._element[scrollSize] + 'px'; + } + }, { + key: 'hide', + value: function hide() { + var _this2 = this; + + if (this._isTransitioning || !$(this._element).hasClass(ClassName.IN)) { + return; + } + + var startEvent = $.Event(Event.HIDE); + $(this._element).trigger(startEvent); + if (startEvent.isDefaultPrevented()) { + return; + } + + var dimension = this._getDimension(); + var offsetDimension = dimension === Dimension.WIDTH ? 'offsetWidth' : 'offsetHeight'; + + this._element.style[dimension] = this._element[offsetDimension] + 'px'; + + _Util.reflow(this._element); + + $(this._element).addClass(ClassName.COLLAPSING).removeClass(ClassName.COLLAPSE).removeClass(ClassName.IN); + + this._element.setAttribute('aria-expanded', false); + + if (this._triggerArray.length) { + $(this._triggerArray).addClass(ClassName.COLLAPSED).attr('aria-expanded', false); + } + + this.setTransitioning(true); + + var complete = function complete() { + _this2.setTransitioning(false); + $(_this2._element).removeClass(ClassName.COLLAPSING).addClass(ClassName.COLLAPSE).trigger(Event.HIDDEN); + }; + + this._element.style[dimension] = 0; + + if (!_Util.supportsTransitionEnd()) { + return complete(); + } + + $(this._element).one(_Util.TRANSITION_END, complete).emulateTransitionEnd(TRANSITION_DURATION); + } + }, { + key: 'setTransitioning', + value: function setTransitioning(isTransitioning) { + this._isTransitioning = isTransitioning; + } + }, { + key: '_getDimension', + + // private + + value: function _getDimension() { + var hasWidth = $(this._element).hasClass(Dimension.WIDTH); + return hasWidth ? Dimension.WIDTH : Dimension.HEIGHT; + } + }, { + key: '_getParent', + value: function _getParent() { + var _this3 = this; + + var parent = $(this._config.parent)[0]; + var selector = '[data-toggle="collapse"][data-parent="' + this._config.parent + '"]'; + + $(parent).find(selector).each(function (i, element) { + _this3._addAriaAndCollapsedClass(Collapse._getTargetFromElement(element), [element]); + }); + + return parent; + } + }, { + key: '_addAriaAndCollapsedClass', + value: function _addAriaAndCollapsedClass(element, triggerArray) { + if (element) { + var isOpen = $(element).hasClass(ClassName.IN); + element.setAttribute('aria-expanded', isOpen); + + if (triggerArray.length) { + $(triggerArray).toggleClass(ClassName.COLLAPSED, !isOpen).attr('aria-expanded', isOpen); + } + } + } + }], [{ + key: 'VERSION', + + // getters + + get: function () { + return VERSION; + } + }, { + key: 'Default', + get: function () { + return Default; + } + }, { + key: '_getTargetFromElement', + + // static + + value: function _getTargetFromElement(element) { + var selector = _Util.getSelectorFromElement(element); + return selector ? $(selector)[0] : null; + } + }, { + key: '_jQueryInterface', + value: function _jQueryInterface(config) { + return this.each(function () { + var $this = $(this); + var data = $this.data(DATA_KEY); + var _config = $.extend({}, Default, $this.data(), typeof config === 'object' && config); + + if (!data && _config.toggle && /show|hide/.test(config)) { + _config.toggle = false; + } + + if (!data) { + data = new Collapse(this, _config); + $this.data(DATA_KEY, data); + } + + if (typeof config === 'string') { + data[config](); + } + }); + } + }]); + + return Collapse; + })(); + + /** + * ------------------------------------------------------------------------ + * Data Api implementation + * ------------------------------------------------------------------------ + */ + + $(document).on(Event.CLICK, Selector.DATA_TOGGLE, function (event) { + event.preventDefault(); + + var target = Collapse._getTargetFromElement(this); + + var data = $(target).data(DATA_KEY); + var config = data ? 'toggle' : $(this).data(); + + Collapse._jQueryInterface.call($(target), config); + }); + + /** + * ------------------------------------------------------------------------ + * jQuery + * ------------------------------------------------------------------------ + */ + + $.fn[NAME] = Collapse._jQueryInterface; + $.fn[NAME].Constructor = Collapse; + $.fn[NAME].noConflict = function () { + $.fn[NAME] = JQUERY_NO_CONFLICT; + return Collapse._jQueryInterface; + }; + + return Collapse; + })(jQuery); + + module.exports = Collapse; +}); \ No newline at end of file diff --git a/dist/js/umd/dropdown.js b/dist/js/umd/dropdown.js new file mode 100644 index 000000000..05cbe99a9 --- /dev/null +++ b/dist/js/umd/dropdown.js @@ -0,0 +1,281 @@ +(function (global, factory) { + if (typeof define === 'function' && define.amd) { + define(['exports', 'module', './util'], factory); + } else if (typeof exports !== 'undefined' && typeof module !== 'undefined') { + factory(exports, module, require('./util')); + } else { + var mod = { + exports: {} + }; + factory(mod.exports, mod, global.Util); + global.dropdown = mod.exports; + } +})(this, function (exports, module, _util) { + 'use strict'; + + var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); + + function _interopRequire(obj) { return obj && obj.__esModule ? obj['default'] : obj; } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } + + var _Util = _interopRequire(_util); + + /** + * -------------------------------------------------------------------------- + * Bootstrap (v4.0.0): dropdown.js + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * -------------------------------------------------------------------------- + */ + + var Dropdown = (function ($) { + + /** + * ------------------------------------------------------------------------ + * Constants + * ------------------------------------------------------------------------ + */ + + var NAME = 'dropdown'; + var VERSION = '4.0.0'; + var DATA_KEY = 'bs.dropdown'; + var JQUERY_NO_CONFLICT = $.fn[NAME]; + + var Event = { + HIDE: 'hide.bs.dropdown', + HIDDEN: 'hidden.bs.dropdown', + SHOW: 'show.bs.dropdown', + SHOWN: 'shown.bs.dropdown', + CLICK: 'click.bs.dropdown', + KEYDOWN: 'keydown.bs.dropdown.data-api', + CLICK_DATA: 'click.bs.dropdown.data-api' + }; + + var ClassName = { + BACKDROP: 'dropdown-backdrop', + DISABLED: 'disabled', + OPEN: 'open' + }; + + var Selector = { + BACKDROP: '.dropdown-backdrop', + DATA_TOGGLE: '[data-toggle="dropdown"]', + FORM_CHILD: '.dropdown form', + ROLE_MENU: '[role="menu"]', + ROLE_LISTBOX: '[role="listbox"]', + NAVBAR_NAV: '.navbar-nav', + VISIBLE_ITEMS: '[role="menu"] li:not(.disabled) a, ' + '[role="listbox"] li:not(.disabled) a' + }; + + /** + * ------------------------------------------------------------------------ + * Class Definition + * ------------------------------------------------------------------------ + */ + + var Dropdown = (function () { + function Dropdown(element) { + _classCallCheck(this, Dropdown); + + $(element).on(Event.CLICK, this.toggle); + } + + _createClass(Dropdown, [{ + key: 'toggle', + + // public + + value: function toggle() { + if (this.disabled || $(this).hasClass(ClassName.DISABLED)) { + return; + } + + var parent = Dropdown._getParentFromElement(this); + var isActive = $(parent).hasClass(ClassName.OPEN); + + Dropdown._clearMenus(); + + if (isActive) { + return false; + } + + if ('ontouchstart' in document.documentElement && !$(parent).closest(Selector.NAVBAR_NAV).length) { + + // if mobile we use a backdrop because click events don't delegate + var dropdown = document.createElement('div'); + dropdown.className = ClassName.BACKDROP; + $(dropdown).insertBefore(this); + $(dropdown).on('click', Dropdown._clearMenus); + } + + var relatedTarget = { relatedTarget: this }; + var showEvent = $.Event(Event.SHOW, relatedTarget); + + $(parent).trigger(showEvent); + + if (showEvent.isDefaultPrevented()) { + return; + } + + this.focus(); + this.setAttribute('aria-expanded', 'true'); + + $(parent).toggleClass(ClassName.OPEN); + $(parent).trigger(Event.SHOWN, relatedTarget); + + return false; + } + }], [{ + key: 'VERSION', + + // getters + + get: function () { + return VERSION; + } + }, { + key: '_jQueryInterface', + + // static + + value: function _jQueryInterface(config) { + return this.each(function () { + var data = $(this).data(DATA_KEY); + + if (!data) { + $(this).data(DATA_KEY, data = new Dropdown(this)); + } + + if (typeof config === 'string') { + data[config].call(this); + } + }); + } + }, { + key: '_clearMenus', + value: function _clearMenus(event) { + if (event && event.which === 3) { + return; + } + + var backdrop = $(Selector.BACKDROP)[0]; + if (backdrop) { + backdrop.parentNode.removeChild(backdrop); + } + + var toggles = $.makeArray($(Selector.DATA_TOGGLE)); + + for (var i = 0; i < toggles.length; i++) { + var _parent = Dropdown._getParentFromElement(toggles[i]); + var relatedTarget = { relatedTarget: toggles[i] }; + + if (!$(_parent).hasClass(ClassName.OPEN)) { + continue; + } + + if (event && event.type === 'click' && /input|textarea/i.test(event.target.tagName) && $.contains(_parent, event.target)) { + continue; + } + + var hideEvent = $.Event(Event.HIDE, relatedTarget); + $(_parent).trigger(hideEvent); + if (hideEvent.isDefaultPrevented()) { + continue; + } + + toggles[i].setAttribute('aria-expanded', 'false'); + + $(_parent).removeClass(ClassName.OPEN).trigger(Event.HIDDEN, relatedTarget); + } + } + }, { + key: '_getParentFromElement', + value: function _getParentFromElement(element) { + var parent = undefined; + var selector = _Util.getSelectorFromElement(element); + + if (selector) { + parent = $(selector)[0]; + } + + return parent || element.parentNode; + } + }, { + key: '_dataApiKeydownHandler', + value: function _dataApiKeydownHandler(event) { + if (!/(38|40|27|32)/.test(event.which) || /input|textarea/i.test(event.target.tagName)) { + return; + } + + event.preventDefault(); + event.stopPropagation(); + + if (this.disabled || $(this).hasClass(ClassName.DISABLED)) { + return; + } + + var parent = Dropdown._getParentFromElement(this); + var isActive = $(parent).hasClass(ClassName.OPEN); + + if (!isActive && event.which !== 27 || isActive && event.which === 27) { + + if (event.which === 27) { + var toggle = $(parent).find(Selector.DATA_TOGGLE)[0]; + $(toggle).trigger('focus'); + } + + $(this).trigger('click'); + return; + } + + var items = $.makeArray($(Selector.VISIBLE_ITEMS)); + + items = items.filter(function (item) { + return item.offsetWidth || item.offsetHeight; + }); + + if (!items.length) { + return; + } + + var index = items.indexOf(event.target); + + if (event.which === 38 && index > 0) index--; // up + if (event.which === 40 && index < items.length - 1) index++; // down + if (! ~index) index = 0; + + items[index].focus(); + } + }]); + + return Dropdown; + })(); + + /** + * ------------------------------------------------------------------------ + * Data Api implementation + * ------------------------------------------------------------------------ + */ + + $(document).on(Event.KEYDOWN, Selector.DATA_TOGGLE, Dropdown._dataApiKeydownHandler).on(Event.KEYDOWN, Selector.ROLE_MENU, Dropdown._dataApiKeydownHandler).on(Event.KEYDOWN, Selector.ROLE_LISTBOX, Dropdown._dataApiKeydownHandler).on(Event.CLICK_DATA, Dropdown._clearMenus).on(Event.CLICK_DATA, Selector.DATA_TOGGLE, Dropdown.prototype.toggle).on(Event.CLICK_DATA, Selector.FORM_CHILD, function (e) { + e.stopPropagation(); + }); + + /** + * ------------------------------------------------------------------------ + * jQuery + * ------------------------------------------------------------------------ + */ + + $.fn[NAME] = Dropdown._jQueryInterface; + $.fn[NAME].Constructor = Dropdown; + $.fn[NAME].noConflict = function () { + $.fn[NAME] = JQUERY_NO_CONFLICT; + return Dropdown._jQueryInterface; + }; + + return Dropdown; + })(jQuery); + + module.exports = Dropdown; +}); \ No newline at end of file diff --git a/dist/js/umd/modal.js b/dist/js/umd/modal.js new file mode 100644 index 000000000..440985577 --- /dev/null +++ b/dist/js/umd/modal.js @@ -0,0 +1,511 @@ +(function (global, factory) { + if (typeof define === 'function' && define.amd) { + define(['exports', 'module', './util'], factory); + } else if (typeof exports !== 'undefined' && typeof module !== 'undefined') { + factory(exports, module, require('./util')); + } else { + var mod = { + exports: {} + }; + factory(mod.exports, mod, global.Util); + global.modal = mod.exports; + } +})(this, function (exports, module, _util) { + 'use strict'; + + var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); + + function _interopRequire(obj) { return obj && obj.__esModule ? obj['default'] : obj; } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } + + var _Util = _interopRequire(_util); + + /** + * -------------------------------------------------------------------------- + * Bootstrap (v4.0.0): modal.js + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * -------------------------------------------------------------------------- + */ + + var Modal = (function ($) { + + /** + * ------------------------------------------------------------------------ + * Constants + * ------------------------------------------------------------------------ + */ + + var NAME = 'modal'; + var VERSION = '4.0.0'; + var DATA_KEY = 'bs.modal'; + var JQUERY_NO_CONFLICT = $.fn[NAME]; + var TRANSITION_DURATION = 300; + var BACKDROP_TRANSITION_DURATION = 150; + + var Default = { + backdrop: true, + keyboard: true, + show: true + }; + + var Event = { + HIDE: 'hide.bs.modal', + HIDDEN: 'hidden.bs.modal', + SHOW: 'show.bs.modal', + SHOWN: 'shown.bs.modal', + DISMISS: 'click.dismiss.bs.modal', + KEYDOWN: 'keydown.dismiss.bs.modal', + FOCUSIN: 'focusin.bs.modal', + RESIZE: 'resize.bs.modal', + CLICK: 'click.bs.modal.data-api', + MOUSEDOWN: 'mousedown.dismiss.bs.modal', + MOUSEUP: 'mouseup.dismiss.bs.modal' + }; + + var ClassName = { + BACKDROP: 'modal-backdrop', + OPEN: 'modal-open', + FADE: 'fade', + IN: 'in' + }; + + var Selector = { + DIALOG: '.modal-dialog', + DATA_TOGGLE: '[data-toggle="modal"]', + DATA_DISMISS: '[data-dismiss="modal"]', + SCROLLBAR_MEASURER: 'modal-scrollbar-measure' + }; + + /** + * ------------------------------------------------------------------------ + * Class Definition + * ------------------------------------------------------------------------ + */ + + var Modal = (function () { + function Modal(element, config) { + _classCallCheck(this, Modal); + + this._config = config; + this._element = element; + this._dialog = $(element).find(Selector.DIALOG)[0]; + this._backdrop = null; + this._isShown = false; + this._isBodyOverflowing = false; + this._ignoreBackdropClick = false; + this._originalBodyPadding = 0; + this._scrollbarWidth = 0; + } + + _createClass(Modal, [{ + key: 'toggle', + + // public + + value: function toggle(relatedTarget) { + return this._isShown ? this.hide() : this.show(relatedTarget); + } + }, { + key: 'show', + value: function show(relatedTarget) { + var _this = this; + + var showEvent = $.Event(Event.SHOW, { + relatedTarget: relatedTarget + }); + + $(this._element).trigger(showEvent); + + if (this._isShown || showEvent.isDefaultPrevented()) { + return; + } + + this._isShown = true; + + this._checkScrollbar(); + this._setScrollbar(); + + $(document.body).addClass(ClassName.OPEN); + + this._setEscapeEvent(); + this._setResizeEvent(); + + $(this._element).on(Event.DISMISS, Selector.DATA_DISMISS, $.proxy(this.hide, this)); + + $(this._dialog).on(Event.MOUSEDOWN, function () { + $(_this._element).one(Event.MOUSEUP, function (event) { + if ($(event.target).is(_this._element)) { + that._ignoreBackdropClick = true; + } + }); + }); + + this._showBackdrop($.proxy(this._showElement, this, relatedTarget)); + } + }, { + key: 'hide', + value: function hide(event) { + if (event) { + event.preventDefault(); + } + + var hideEvent = $.Event(Event.HIDE); + + $(this._element).trigger(hideEvent); + + if (!this._isShown || hideEvent.isDefaultPrevented()) { + return; + } + + this._isShown = false; + + this._setEscapeEvent(); + this._setResizeEvent(); + + $(document).off(Event.FOCUSIN); + + $(this._element).removeClass(ClassName.IN); + + $(this._element).off(Event.DISMISS); + $(this._dialog).off(Event.MOUSEDOWN); + + if (_Util.supportsTransitionEnd() && $(this._element).hasClass(ClassName.FADE)) { + + $(this._element).one(_Util.TRANSITION_END, $.proxy(this._hideModal, this)).emulateTransitionEnd(TRANSITION_DURATION); + } else { + this._hideModal(); + } + } + }, { + key: '_showElement', + + // private + + value: function _showElement(relatedTarget) { + var _this2 = this; + + var transition = _Util.supportsTransitionEnd() && $(this._element).hasClass(ClassName.FADE); + + if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) { + // don't move modals dom position + document.body.appendChild(this._element); + } + + this._element.style.display = 'block'; + this._element.scrollTop = 0; + + if (transition) { + _Util.reflow(this._element); + } + + $(this._element).addClass(ClassName.IN); + + this._enforceFocus(); + + var shownEvent = $.Event(Event.SHOWN, { + relatedTarget: relatedTarget + }); + + var transitionComplete = function transitionComplete() { + _this2._element.focus(); + $(_this2._element).trigger(shownEvent); + }; + + if (transition) { + $(this._dialog).one(_Util.TRANSITION_END, transitionComplete).emulateTransitionEnd(TRANSITION_DURATION); + } else { + transitionComplete(); + } + } + }, { + key: '_enforceFocus', + value: function _enforceFocus() { + var _this3 = this; + + $(document).off(Event.FOCUSIN) // guard against infinite focus loop + .on(Event.FOCUSIN, function (event) { + if (_this3._element !== event.target && !$(_this3._element).has(event.target).length) { + _this3._element.focus(); + } + }); + } + }, { + key: '_setEscapeEvent', + value: function _setEscapeEvent() { + var _this4 = this; + + if (this._isShown && this._config.keyboard) { + $(this._element).on(Event.KEYDOWN, function (event) { + if (event.which === 27) { + _this4.hide(); + } + }); + } else if (!this._isShown) { + $(this._element).off(Event.KEYDOWN); + } + } + }, { + key: '_setResizeEvent', + value: function _setResizeEvent() { + if (this._isShown) { + $(window).on(Event.RESIZE, $.proxy(this._handleUpdate, this)); + } else { + $(window).off(Event.RESIZE); + } + } + }, { + key: '_hideModal', + value: function _hideModal() { + var _this5 = this; + + this._element.style.display = 'none'; + this._showBackdrop(function () { + $(document.body).removeClass(ClassName.OPEN); + _this5._resetAdjustments(); + _this5._resetScrollbar(); + $(_this5._element).trigger(Event.HIDDEN); + }); + } + }, { + key: '_removeBackdrop', + value: function _removeBackdrop() { + if (this._backdrop) { + $(this._backdrop).remove(); + this._backdrop = null; + } + } + }, { + key: '_showBackdrop', + value: function _showBackdrop(callback) { + var _this6 = this; + + var animate = $(this._element).hasClass(ClassName.FADE) ? ClassName.FADE : ''; + + if (this._isShown && this._config.backdrop) { + var doAnimate = _Util.supportsTransitionEnd() && animate; + + this._backdrop = document.createElement('div'); + this._backdrop.className = ClassName.BACKDROP; + + if (animate) { + $(this._backdrop).addClass(animate); + } + + $(this._backdrop).appendTo(this.$body); + + $(this._element).on(Event.DISMISS, function (event) { + if (_this6._ignoreBackdropClick) { + _this6._ignoreBackdropClick = false; + return; + } + if (event.target !== event.currentTarget) { + return; + } + if (_this6._config.backdrop === 'static') { + _this6._element.focus(); + } else { + _this6.hide(); + } + }); + + if (doAnimate) { + _Util.reflow(this._backdrop); + } + + $(this._backdrop).addClass(ClassName.IN); + + if (!callback) { + return; + } + + if (!doAnimate) { + callback(); + return; + } + + $(this._backdrop).one(_Util.TRANSITION_END, callback).emulateTransitionEnd(BACKDROP_TRANSITION_DURATION); + } else if (!this._isShown && this._backdrop) { + $(this._backdrop).removeClass(ClassName.IN); + + var callbackRemove = function callbackRemove() { + _this6._removeBackdrop(); + if (callback) { + callback(); + } + }; + + if (_Util.supportsTransitionEnd() && $(this._element).hasClass(ClassName.FADE)) { + $(this._backdrop).one(_Util.TRANSITION_END, callbackRemove).emulateTransitionEnd(BACKDROP_TRANSITION_DURATION); + } else { + callbackRemove(); + } + } else if (callback) { + callback(); + } + } + }, { + key: '_handleUpdate', + + // ---------------------------------------------------------------------- + // the following methods are used to handle overflowing modals + // todo (fat): these should probably be refactored out of modal.js + // ---------------------------------------------------------------------- + + value: function _handleUpdate() { + this._adjustDialog(); + } + }, { + key: '_adjustDialog', + value: function _adjustDialog() { + var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight; + + if (!this._isBodyOverflowing && isModalOverflowing) { + this._element.style.paddingLeft = this._scrollbarWidth + 'px'; + } + + if (this._isBodyOverflowing && !isModalOverflowing) { + this._element.style.paddingRight = this._scrollbarWidth + 'px'; + } + } + }, { + key: '_resetAdjustments', + value: function _resetAdjustments() { + this._element.style.paddingLeft = ''; + this._element.style.paddingRight = ''; + } + }, { + key: '_checkScrollbar', + value: function _checkScrollbar() { + 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._isBodyOverflowing = document.body.clientWidth < fullWindowWidth; + this._scrollbarWidth = this._getScrollbarWidth(); + } + }, { + key: '_setScrollbar', + value: function _setScrollbar() { + var bodyPadding = parseInt($(document.body).css('padding-right') || 0, 10); + + this._originalBodyPadding = document.body.style.paddingRight || ''; + + if (this._isBodyOverflowing) { + document.body.style.paddingRight = bodyPadding + this._scrollbarWidth + 'px'; + } + } + }, { + key: '_resetScrollbar', + value: function _resetScrollbar() { + document.body.style.paddingRight = this._originalBodyPadding; + } + }, { + key: '_getScrollbarWidth', + value: function _getScrollbarWidth() { + // thx d.walsh + var scrollDiv = document.createElement('div'); + scrollDiv.className = Selector.SCROLLBAR_MEASURER; + document.body.appendChild(scrollDiv); + var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth; + document.body.removeChild(scrollDiv); + return scrollbarWidth; + } + }], [{ + key: 'VERSION', + + // getters + + get: function () { + return VERSION; + } + }, { + key: 'Default', + get: function () { + return Default; + } + }, { + key: '_jQueryInterface', + + // static + + value: function _jQueryInterface(config, relatedTarget) { + return this.each(function () { + var data = $(this).data(DATA_KEY); + var _config = $.extend({}, Modal.Default, $(this).data(), typeof config === 'object' && config); + + if (!data) { + data = new Modal(this, _config); + $(this).data(DATA_KEY, data); + } + + if (typeof config === 'string') { + data[config](relatedTarget); + } else if (_config.show) { + data.show(relatedTarget); + } + }); + } + }]); + + return Modal; + })(); + + /** + * ------------------------------------------------------------------------ + * Data Api implementation + * ------------------------------------------------------------------------ + */ + + $(document).on(Event.CLICK, Selector.DATA_TOGGLE, function (event) { + var _this7 = this; + + var target = undefined; + var selector = _Util.getSelectorFromElement(this); + + if (selector) { + target = $(selector)[0]; + } + + var config = $(target).data(DATA_KEY) ? 'toggle' : $.extend({}, $(target).data(), $(this).data()); + + if (this.tagName === 'A') { + event.preventDefault(); + } + + var $target = $(target).one(Event.SHOW, function (showEvent) { + if (showEvent.isDefaultPrevented()) { + // only register focus restorer if modal will actually get shown + return; + } + + $target.one(Event.HIDDEN, function () { + if ($(_this7).is(':visible')) { + _this7.focus(); + } + }); + }); + + Modal._jQueryInterface.call($(target), config, this); + }); + + /** + * ------------------------------------------------------------------------ + * jQuery + * ------------------------------------------------------------------------ + */ + + $.fn[NAME] = Modal._jQueryInterface; + $.fn[NAME].Constructor = Modal; + $.fn[NAME].noConflict = function () { + $.fn[NAME] = JQUERY_NO_CONFLICT; + return Modal._jQueryInterface; + }; + + return Modal; + })(jQuery); + + module.exports = Modal; +}); \ No newline at end of file diff --git a/dist/js/umd/popover.js b/dist/js/umd/popover.js new file mode 100644 index 000000000..f13371b87 --- /dev/null +++ b/dist/js/umd/popover.js @@ -0,0 +1,208 @@ +(function (global, factory) { + if (typeof define === 'function' && define.amd) { + define(['exports', 'module', './tooltip'], factory); + } else if (typeof exports !== 'undefined' && typeof module !== 'undefined') { + factory(exports, module, require('./tooltip')); + } else { + var mod = { + exports: {} + }; + factory(mod.exports, mod, global.Tooltip); + global.popover = mod.exports; + } +})(this, function (exports, module, _tooltip) { + 'use strict'; + + var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); + + function _interopRequire(obj) { return obj && obj.__esModule ? obj['default'] : obj; } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } + + function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; } + + var _Tooltip2 = _interopRequire(_tooltip); + + /** + * -------------------------------------------------------------------------- + * Bootstrap (v4.0.0): popover.js + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * -------------------------------------------------------------------------- + */ + + var Popover = (function ($) { + + /** + * ------------------------------------------------------------------------ + * Constants + * ------------------------------------------------------------------------ + */ + + var NAME = 'popover'; + var VERSION = '4.0.0'; + var DATA_KEY = 'bs.popover'; + var JQUERY_NO_CONFLICT = $.fn[NAME]; + + var Default = $.extend({}, _Tooltip2.Default, { + placement: 'right', + trigger: 'click', + content: '', + template: '' + }); + + var ClassName = { + FADE: 'fade', + IN: 'in' + }; + + var Selector = { + TITLE: '.popover-title', + CONTENT: '.popover-content', + ARROW: '.popover-arrow' + }; + + var Event = { + HIDE: 'hide.bs.popover', + HIDDEN: 'hidden.bs.popover', + SHOW: 'show.bs.popover', + SHOWN: 'shown.bs.popover', + INSERTED: 'inserted.bs.popover', + CLICK: 'click.bs.popover', + FOCUSIN: 'focusin.bs.popover', + FOCUSOUT: 'focusout.bs.popover', + MOUSEENTER: 'mouseenter.bs.popover', + MOUSELEAVE: 'mouseleave.bs.popover' + }; + + /** + * ------------------------------------------------------------------------ + * Class Definition + * ------------------------------------------------------------------------ + */ + + var Popover = (function (_Tooltip) { + function Popover() { + _classCallCheck(this, Popover); + + if (_Tooltip != null) { + _Tooltip.apply(this, arguments); + } + } + + _inherits(Popover, _Tooltip); + + _createClass(Popover, [{ + key: 'isWithContent', + + // overrides + + value: function isWithContent() { + return this.getTitle() || this._getContent(); + } + }, { + key: 'getTipElement', + value: function getTipElement() { + return this.tip = this.tip || $(this.config.template)[0]; + } + }, { + key: 'setContent', + value: function setContent() { + var tip = this.getTipElement(); + var title = this.getTitle(); + var content = this._getContent(); + var titleElement = $(tip).find(Selector.TITLE)[0]; + + if (titleElement) { + titleElement[this.config.html ? 'innerHTML' : 'innerText'] = title; + } + + // we use append for html objects to maintain js events + $(tip).find(Selector.CONTENT).children().detach().end()[this.config.html ? typeof content === 'string' ? 'html' : 'append' : 'text'](content); + + $(tip).removeClass(ClassName.FADE).removeClass(ClassName.IN); + + this.cleanupTether(); + } + }, { + key: '_getContent', + + // private + + value: function _getContent() { + return this.element.getAttribute('data-content') || (typeof this.config.content == 'function' ? this.config.content.call(this.element) : this.config.content); + } + }], [{ + key: 'VERSION', + + // getters + + get: function () { + return VERSION; + } + }, { + key: 'Default', + get: function () { + return Default; + } + }, { + key: 'NAME', + get: function () { + return NAME; + } + }, { + key: 'DATA_KEY', + get: function () { + return DATA_KEY; + } + }, { + key: 'Event', + get: function () { + return Event; + } + }, { + key: '_jQueryInterface', + + // static + + value: function _jQueryInterface(config) { + return this.each(function () { + var data = $(this).data(DATA_KEY); + var _config = typeof config === 'object' ? config : null; + + if (!data && /destroy|hide/.test(config)) { + return; + } + + if (!data) { + data = new Popover(this, _config); + $(this).data(DATA_KEY, data); + } + + if (typeof config === 'string') { + data[config](); + } + }); + } + }]); + + return Popover; + })(_Tooltip2); + + /** + * ------------------------------------------------------------------------ + * jQuery + * ------------------------------------------------------------------------ + */ + + $.fn[NAME] = Popover._jQueryInterface; + $.fn[NAME].Constructor = Popover; + $.fn[NAME].noConflict = function () { + $.fn[NAME] = JQUERY_NO_CONFLICT; + return Popover._jQueryInterface; + }; + + return Popover; + })(jQuery); + + module.exports = Popover; +}); \ No newline at end of file diff --git a/dist/js/umd/scrollspy.js b/dist/js/umd/scrollspy.js new file mode 100644 index 000000000..63cbae574 --- /dev/null +++ b/dist/js/umd/scrollspy.js @@ -0,0 +1,286 @@ +(function (global, factory) { + if (typeof define === 'function' && define.amd) { + define(['exports', 'module', './util'], factory); + } else if (typeof exports !== 'undefined' && typeof module !== 'undefined') { + factory(exports, module, require('./util')); + } else { + var mod = { + exports: {} + }; + factory(mod.exports, mod, global.Util); + global.scrollspy = mod.exports; + } +})(this, function (exports, module, _util) { + 'use strict'; + + var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); + + function _interopRequire(obj) { return obj && obj.__esModule ? obj['default'] : obj; } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } + + var _Util = _interopRequire(_util); + + /** + * -------------------------------------------------------------------------- + * Bootstrap (v4.0.0): scrollspy.js + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * -------------------------------------------------------------------------- + */ + + var ScrollSpy = (function ($) { + + /** + * ------------------------------------------------------------------------ + * Constants + * ------------------------------------------------------------------------ + */ + + var NAME = 'scrollspy'; + var VERSION = '4.0.0'; + var DATA_KEY = 'bs.scrollspy'; + var JQUERY_NO_CONFLICT = $.fn[NAME]; + + var Default = { + offset: 10 + }; + + var Event = { + ACTIVATE: 'activate.bs.scrollspy', + SCROLL: 'scroll.bs.scrollspy', + LOAD: 'load.bs.scrollspy.data-api' + }; + + var ClassName = { + DROPDOWN_MENU: 'dropdown-menu', + ACTIVE: 'active' + }; + + var Selector = { + DATA_SPY: '[data-spy="scroll"]', + ACTIVE: '.active', + LI_DROPDOWN: 'li.dropdown', + LI: 'li' + }; + + /** + * ------------------------------------------------------------------------ + * Class Definition + * ------------------------------------------------------------------------ + */ + + var ScrollSpy = (function () { + function ScrollSpy(element, config) { + _classCallCheck(this, ScrollSpy); + + this._scrollElement = element.tagName === 'BODY' ? window : element; + this._config = $.extend({}, Default, config); + this._selector = '' + (this._config.target || '') + ' .nav li > a'; + this._offsets = []; + this._targets = []; + this._activeTarget = null; + this._scrollHeight = 0; + + $(this._scrollElement).on(Event.SCROLL, $.proxy(this._process, this)); + + this.refresh(); + this._process(); + } + + _createClass(ScrollSpy, [{ + key: 'refresh', + + // public + + value: function refresh() { + var _this = this; + + var offsetMethod = 'offset'; + var offsetBase = 0; + + if (this._scrollElement !== this._scrollElement.window) { + offsetMethod = 'position'; + offsetBase = this._getScrollTop(); + } + + this._offsets = []; + this._targets = []; + + this._scrollHeight = this._getScrollHeight(); + + var targets = $.makeArray($(this._selector)); + + targets.map(function (element) { + var target = undefined; + var targetSelector = _Util.getSelectorFromElement(element); + + if (targetSelector) { + target = $(targetSelector)[0]; + } + + if (target && (target.offsetWidth || target.offsetHeight)) { + // todo (fat): remove sketch reliance on jQuery position/offset + return [$(target)[offsetMethod]().top + offsetBase, targetSelector]; + } + }).filter(function (item) { + return item; + }).sort(function (a, b) { + return a[0] - b[0]; + }).forEach(function (item) { + _this._offsets.push(item[0]); + _this._targets.push(item[1]); + }); + } + }, { + key: '_getScrollTop', + + // private + + value: function _getScrollTop() { + return this._scrollElement === window ? this._scrollElement.scrollY : this._scrollElement.scrollTop; + } + }, { + key: '_getScrollHeight', + value: function _getScrollHeight() { + return this._scrollElement.scrollHeight || Math.max(document.body.scrollHeight, document.documentElement.scrollHeight); + } + }, { + key: '_process', + value: function _process() { + var scrollTop = this._getScrollTop() + this._config.offset; + var scrollHeight = this._getScrollHeight(); + var maxScroll = this._config.offset + scrollHeight - this._scrollElement.offsetHeight; + + if (this._scrollHeight !== scrollHeight) { + this.refresh(); + } + + if (scrollTop >= maxScroll) { + var target = this._targets[this._targets.length - 1]; + + if (this._activeTarget !== target) { + this._activate(target); + } + } + + if (this._activeTarget && scrollTop < this._offsets[0]) { + this._activeTarget = null; + this._clear(); + return; + } + + for (var i = this._offsets.length; i--;) { + var isActiveTarget = this._activeTarget !== this._targets[i] && scrollTop >= this._offsets[i] && (this._offsets[i + 1] === undefined || scrollTop < this._offsets[i + 1]); + + if (isActiveTarget) { + this._activate(this._targets[i]); + } + } + } + }, { + key: '_activate', + value: function _activate(target) { + this._activeTarget = target; + + this._clear(); + + var selector = '' + this._selector + '[data-target="' + target + '"],' + ('' + this._selector + '[href="' + target + '"]'); + + // todo (fat): getting all the raw li's up the tree is not great. + var parentListItems = $(selector).parents(Selector.LI); + + for (var i = parentListItems.length; i--;) { + $(parentListItems[i]).addClass(ClassName.ACTIVE); + + var itemParent = parentListItems[i].parentNode; + + if (itemParent && $(itemParent).hasClass(ClassName.DROPDOWN_MENU)) { + var closestDropdown = $(itemParent).closest(Selector.LI_DROPDOWN)[0]; + $(closestDropdown).addClass(ClassName.ACTIVE); + } + } + + $(this._scrollElement).trigger(Event.ACTIVATE, { + relatedTarget: target + }); + } + }, { + key: '_clear', + value: function _clear() { + var activeParents = $(this._selector).parentsUntil(this._config.target, Selector.ACTIVE); + + for (var i = activeParents.length; i--;) { + $(activeParents[i]).removeClass(ClassName.ACTIVE); + } + } + }], [{ + key: 'VERSION', + + // getters + + get: function () { + return VERSION; + } + }, { + key: 'Default', + get: function () { + return Default; + } + }, { + key: '_jQueryInterface', + + // static + + value: function _jQueryInterface(config) { + return this.each(function () { + var data = $(this).data(DATA_KEY); + var _config = typeof config === 'object' && config || null; + + if (!data) { + data = new ScrollSpy(this, _config); + $(this).data(DATA_KEY, data); + } + + if (typeof config === 'string') { + data[config](); + } + }); + } + }]); + + return ScrollSpy; + })(); + + /** + * ------------------------------------------------------------------------ + * Data Api implementation + * ------------------------------------------------------------------------ + */ + + $(window).on(Event.LOAD, function () { + var scrollSpys = $.makeArray($(Selector.DATA_SPY)); + + for (var i = scrollSpys.length; i--;) { + var $spy = $(scrollSpys[i]); + ScrollSpy._jQueryInterface.call($spy, $spy.data()); + } + }); + + /** + * ------------------------------------------------------------------------ + * jQuery + * ------------------------------------------------------------------------ + */ + + $.fn[NAME] = ScrollSpy._jQueryInterface; + $.fn[NAME].Constructor = ScrollSpy; + $.fn[NAME].noConflict = function () { + $.fn[NAME] = JQUERY_NO_CONFLICT; + return ScrollSpy._jQueryInterface; + }; + + return ScrollSpy; + })(jQuery); + + module.exports = ScrollSpy; +}); \ No newline at end of file diff --git a/dist/js/umd/tab.js b/dist/js/umd/tab.js new file mode 100644 index 000000000..fe51b131c --- /dev/null +++ b/dist/js/umd/tab.js @@ -0,0 +1,289 @@ +(function (global, factory) { + if (typeof define === 'function' && define.amd) { + define(['exports', 'module', './util'], factory); + } else if (typeof exports !== 'undefined' && typeof module !== 'undefined') { + factory(exports, module, require('./util')); + } else { + var mod = { + exports: {} + }; + factory(mod.exports, mod, global.Util); + global.tab = mod.exports; + } +})(this, function (exports, module, _util) { + 'use strict'; + + var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); + + function _interopRequire(obj) { return obj && obj.__esModule ? obj['default'] : obj; } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } + + var _Util = _interopRequire(_util); + + /** + * -------------------------------------------------------------------------- + * Bootstrap (v4.0.0): tab.js + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * -------------------------------------------------------------------------- + */ + + var Tab = (function ($) { + + /** + * ------------------------------------------------------------------------ + * Constants + * ------------------------------------------------------------------------ + */ + + var NAME = 'tab'; + var VERSION = '4.0.0'; + var DATA_KEY = 'bs.tab'; + var JQUERY_NO_CONFLICT = $.fn[NAME]; + var TRANSITION_DURATION = 150; + + var Event = { + HIDE: 'hide.bs.tab', + HIDDEN: 'hidden.bs.tab', + SHOW: 'show.bs.tab', + SHOWN: 'shown.bs.tab', + CLICK: 'click.bs.tab.data-api' + }; + + var ClassName = { + DROPDOWN_MENU: 'dropdown-menu', + ACTIVE: 'active', + FADE: 'fade', + IN: 'in' + }; + + var Selector = { + A: 'a', + LI: 'li', + LI_DROPDOWN: 'li.dropdown', + UL: 'ul:not(.dropdown-menu)', + FADE_CHILD: '> .fade', + ACTIVE: '.active', + ACTIVE_CHILD: '> .active', + DATA_TOGGLE: '[data-toggle="tab"], [data-toggle="pill"]', + DROPDOWN_ACTIVE_CHILD: '> .dropdown-menu > .active' + }; + + /** + * ------------------------------------------------------------------------ + * Class Definition + * ------------------------------------------------------------------------ + */ + + var Tab = (function () { + function Tab(element) { + _classCallCheck(this, Tab); + + this._element = element; + } + + _createClass(Tab, [{ + key: 'show', + + // public + + value: function show() { + var _this = this; + + if (this._element.parentNode && this._element.parentNode.nodeType == Node.ELEMENT_NODE && $(this._element).parent().hasClass(ClassName.ACTIVE)) { + return; + } + + var target = undefined; + var previous = undefined; + var ulElement = $(this._element).closest(Selector.UL)[0]; + var selector = _Util.getSelectorFromElement(this._element); + + if (ulElement) { + previous = $.makeArray($(ulElement).find(Selector.ACTIVE)); + previous = previous[previous.length - 1]; + + if (previous) { + previous = $(previous).find(Selector.A)[0]; + } + } + + var hideEvent = $.Event(Event.HIDE, { + relatedTarget: this._element + }); + + var showEvent = $.Event(Event.SHOW, { + relatedTarget: previous + }); + + if (previous) { + $(previous).trigger(hideEvent); + } + + $(this._element).trigger(showEvent); + + if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) { + return; + } + + if (selector) { + target = $(selector)[0]; + } + + this._activate($(this._element).closest(Selector.LI)[0], ulElement); + + var complete = function complete() { + var hiddenEvent = $.Event(Event.HIDDEN, { + relatedTarget: _this._element + }); + + var shownEvent = $.Event(Event.SHOWN, { + relatedTarget: previous + }); + + $(previous).trigger(hiddenEvent); + $(_this._element).trigger(shownEvent); + }; + + if (target) { + this._activate(target, target.parentNode, complete); + } else { + complete(); + } + } + }, { + key: '_activate', + + // private + + value: function _activate(element, container, callback) { + var active = $(container).find(Selector.ACTIVE_CHILD)[0]; + var isTransitioning = callback && _Util.supportsTransitionEnd() && (active && $(active).hasClass(ClassName.FADE) || !!$(container).find(Selector.FADE_CHILD)[0]); + + var complete = $.proxy(this._transitionComplete, this, element, active, isTransitioning, callback); + + if (active && isTransitioning) { + $(active).one(_Util.TRANSITION_END, complete).emulateTransitionEnd(TRANSITION_DURATION); + } else { + complete(); + } + + if (active) { + $(active).removeClass(ClassName.IN); + } + } + }, { + key: '_transitionComplete', + value: function _transitionComplete(element, active, isTransitioning, callback) { + if (active) { + $(active).removeClass(ClassName.ACTIVE); + + var dropdownChild = $(active).find(Selector.DROPDOWN_ACTIVE_CHILD)[0]; + if (dropdownChild) { + $(dropdownChild).removeClass(ClassName.ACTIVE); + } + + var activeToggle = $(active).find(Selector.DATA_TOGGLE)[0]; + if (activeToggle) { + activeToggle.setAttribute('aria-expanded', false); + } + } + + $(element).addClass(ClassName.ACTIVE); + + var elementToggle = $(element).find(Selector.DATA_TOGGLE)[0]; + if (elementToggle) { + elementToggle.setAttribute('aria-expanded', true); + } + + if (isTransitioning) { + _Util.reflow(element); + $(element).addClass(ClassName.IN); + } else { + $(element).removeClass(ClassName.FADE); + } + + if (element.parentNode && $(element.parentNode).hasClass(ClassName.DROPDOWN_MENU)) { + + var dropdownElement = $(element).closest(Selector.LI_DROPDOWN)[0]; + if (dropdownElement) { + $(dropdownElement).addClass(ClassName.ACTIVE); + } + + elementToggle = $(element).find(Selector.DATA_TOGGLE)[0]; + if (elementToggle) { + elementToggle.setAttribute('aria-expanded', true); + } + } + + if (callback) { + callback(); + } + } + }], [{ + key: 'VERSION', + + // getters + + get: function () { + return VERSION; + } + }, { + key: 'Default', + get: function () { + return Default; + } + }, { + key: '_jQueryInterface', + + // static + + value: function _jQueryInterface(config) { + return this.each(function () { + var $this = $(this); + var data = $this.data(DATA_KEY); + + if (!data) { + data = data = new Tab(this); + $this.data(DATA_KEY, data); + } + + if (typeof config === 'string') { + data[config](); + } + }); + } + }]); + + return Tab; + })(); + + /** + * ------------------------------------------------------------------------ + * Data Api implementation + * ------------------------------------------------------------------------ + */ + + $(document).on(Event.CLICK, Selector.DATA_TOGGLE, function (event) { + event.preventDefault(); + Tab._jQueryInterface.call($(this), 'show'); + }); + + /** + * ------------------------------------------------------------------------ + * jQuery + * ------------------------------------------------------------------------ + */ + + $.fn[NAME] = Tab._jQueryInterface; + $.fn[NAME].Constructor = Tab; + $.fn[NAME].noConflict = function () { + $.fn[NAME] = JQUERY_NO_CONFLICT; + return Tab._jQueryInterface; + }; + + return Tab; + })(jQuery); + + module.exports = Tab; +}); \ No newline at end of file diff --git a/dist/js/umd/tooltip.js b/dist/js/umd/tooltip.js new file mode 100644 index 000000000..9c57b0d8f --- /dev/null +++ b/dist/js/umd/tooltip.js @@ -0,0 +1,578 @@ +(function (global, factory) { + if (typeof define === 'function' && define.amd) { + define(['exports', 'module', './util'], factory); + } else if (typeof exports !== 'undefined' && typeof module !== 'undefined') { + factory(exports, module, require('./util')); + } else { + var mod = { + exports: {} + }; + factory(mod.exports, mod, global.Util); + global.tooltip = mod.exports; + } +})(this, function (exports, module, _util) { + 'use strict'; + + var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); + + function _interopRequire(obj) { return obj && obj.__esModule ? obj['default'] : obj; } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } + + var _Util = _interopRequire(_util); + + /** + * -------------------------------------------------------------------------- + * Bootstrap (v4.0.0): tooltip.js + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * -------------------------------------------------------------------------- + */ + + var Tooltip = (function ($) { + + /** + * ------------------------------------------------------------------------ + * Constants + * ------------------------------------------------------------------------ + */ + + var NAME = 'tooltip'; + var VERSION = '4.0.0'; + var DATA_KEY = 'bs.tooltip'; + var JQUERY_NO_CONFLICT = $.fn[NAME]; + var TRANSITION_DURATION = 150; + var CLASS_PREFIX = 'bs-tether'; + + var Default = { + animation: true, + template: '', + trigger: 'hover focus', + title: '', + delay: 0, + html: false, + selector: false, + placement: 'top', + offset: '0 0', + constraints: null + }; + + var AttachmentMap = { + TOP: 'bottom center', + RIGHT: 'middle left', + BOTTOM: 'top center', + LEFT: 'middle right' + }; + + var HoverState = { + IN: 'in', + OUT: 'out' + }; + + var Event = { + HIDE: 'hide.bs.tooltip', + HIDDEN: 'hidden.bs.tooltip', + SHOW: 'show.bs.tooltip', + SHOWN: 'shown.bs.tooltip', + INSERTED: 'inserted.bs.tooltip', + CLICK: 'click.bs.tooltip', + FOCUSIN: 'focusin.bs.tooltip', + FOCUSOUT: 'focusout.bs.tooltip', + MOUSEENTER: 'mouseenter.bs.tooltip', + MOUSELEAVE: 'mouseleave.bs.tooltip' + }; + + var ClassName = { + FADE: 'fade', + IN: 'in' + }; + + var Selector = { + TOOLTIP: '.tooltip', + TOOLTIP_INNER: '.tooltip-inner' + }; + + var TetherClass = { + element: false, + enabled: false + }; + + var Trigger = { + HOVER: 'hover', + FOCUS: 'focus', + CLICK: 'click', + MANUAL: 'manual' + }; + + /** + * ------------------------------------------------------------------------ + * Class Definition + * ------------------------------------------------------------------------ + */ + + var Tooltip = (function () { + function Tooltip(element, config) { + _classCallCheck(this, Tooltip); + + // private + this._isEnabled = true; + this._timeout = 0; + this._hoverState = ''; + this._activeTrigger = {}; + this._tether = null; + + // protected + this.element = element; + this.config = this._getConfig(config); + this.tip = null; + + this._setListeners(); + } + + _createClass(Tooltip, [{ + key: 'enable', + + // public + + value: function enable() { + this._isEnabled = true; + } + }, { + key: 'disable', + value: function disable() { + this._isEnabled = false; + } + }, { + key: 'toggleEnabled', + value: function toggleEnabled() { + this._isEnabled = !this._isEnabled; + } + }, { + key: 'toggle', + value: function toggle(event) { + var context = this; + var dataKey = this.constructor.DATA_KEY; + + if (event) { + context = $(event.currentTarget).data(dataKey); + + if (!context) { + context = new this.constructor(event.currentTarget, this._getDelegateConfig()); + $(event.currentTarget).data(dataKey, context); + } + + context._activeTrigger.click = !context._activeTrigger.click; + + if (context._isWithActiveTrigger()) { + context._enter(null, context); + } else { + context._leave(null, context); + } + } else { + $(context.getTipElement()).hasClass(ClassName.IN) ? context._leave(null, context) : context._enter(null, context); + } + } + }, { + key: 'destroy', + value: function destroy() { + var _this = this; + + clearTimeout(this._timeout); + this.hide(function () { + $(_this.element).off('.' + _this.constructor.NAME).removeData(_this.constructor.DATA_KEY); + + if (_this.tip) { + $(_this.tip).detach(); + } + + _this.tip = null; + }); + } + }, { + key: 'show', + value: function show() { + var _this2 = this; + + var showEvent = $.Event(this.constructor.Event.SHOW); + + if (this.isWithContent() && this._isEnabled) { + $(this.element).trigger(showEvent); + + var isInTheDom = $.contains(this.element.ownerDocument.documentElement, this.element); + + if (showEvent.isDefaultPrevented() || !isInTheDom) { + return; + } + + var tip = this.getTipElement(); + var tipId = _Util.getUID(this.constructor.NAME); + + tip.setAttribute('id', tipId); + this.element.setAttribute('aria-describedby', tipId); + + this.setContent(); + + if (this.config.animation) { + $(tip).addClass(ClassName.FADE); + } + + var placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this.element) : this.config.placement; + + var attachment = this._getAttachment(placement); + + $(tip).data(this.constructor.DATA_KEY, this).appendTo(document.body); + + $(this.element).trigger(this.constructor.Event.INSERTED); + + this._tether = new Tether({ + element: tip, + target: this.element, + attachment: attachment, + classes: TetherClass, + classPrefix: CLASS_PREFIX, + offset: this.config.offset, + constraints: this.config.constraints + }); + + _Util.reflow(tip); + this._tether.position(); + + $(tip).addClass(ClassName.IN); + + var complete = function complete() { + var prevHoverState = _this2._hoverState; + _this2._hoverState = null; + + $(_this2.element).trigger(_this2.constructor.Event.SHOWN); + + if (prevHoverState === HoverState.OUT) { + _this2._leave(null, _this2); + } + }; + + _Util.supportsTransitionEnd() && $(this.tip).hasClass(ClassName.FADE) ? $(this.tip).one(_Util.TRANSITION_END, complete).emulateTransitionEnd(Tooltip._TRANSITION_DURATION) : complete(); + } + } + }, { + key: 'hide', + value: function hide(callback) { + var _this3 = this; + + var tip = this.getTipElement(); + var hideEvent = $.Event(this.constructor.Event.HIDE); + var complete = function complete() { + if (_this3._hoverState !== HoverState.IN && tip.parentNode) { + tip.parentNode.removeChild(tip); + } + + _this3.element.removeAttribute('aria-describedby'); + $(_this3.element).trigger(_this3.constructor.Event.HIDDEN); + _this3.cleanupTether(); + + if (callback) { + callback(); + } + }; + + $(this.element).trigger(hideEvent); + + if (hideEvent.isDefaultPrevented()) { + return; + } + + $(tip).removeClass(ClassName.IN); + + if (_Util.supportsTransitionEnd() && $(this.tip).hasClass(ClassName.FADE)) { + + $(tip).one(_Util.TRANSITION_END, complete).emulateTransitionEnd(TRANSITION_DURATION); + } else { + complete(); + } + + this._hoverState = ''; + } + }, { + key: 'isWithContent', + + // protected + + value: function isWithContent() { + return !!this.getTitle(); + } + }, { + key: 'getTipElement', + value: function getTipElement() { + return this.tip = this.tip || $(this.config.template)[0]; + } + }, { + key: 'setContent', + value: function setContent() { + var tip = this.getTipElement(); + var title = this.getTitle(); + var method = this.config.html ? 'innerHTML' : 'innerText'; + + $(tip).find(Selector.TOOLTIP_INNER)[0][method] = title; + + $(tip).removeClass(ClassName.FADE).removeClass(ClassName.IN); + + this.cleanupTether(); + } + }, { + key: 'getTitle', + value: function getTitle() { + var title = this.element.getAttribute('data-original-title'); + + if (!title) { + title = typeof this.config.title === 'function' ? this.config.title.call(this.element) : this.config.title; + } + + return title; + } + }, { + key: 'cleanupTether', + value: function cleanupTether() { + if (this._tether) { + this._tether.destroy(); + + // clean up after tether's junk classes + // remove after they fix issue + // (https://github.com/HubSpot/tether/issues/36) + $(this.element).removeClass(this._removeTetherClasses); + $(this.tip).removeClass(this._removeTetherClasses); + } + } + }, { + key: '_getAttachment', + + // private + + value: function _getAttachment(placement) { + return AttachmentMap[placement.toUpperCase()]; + } + }, { + key: '_setListeners', + value: function _setListeners() { + var _this4 = this; + + var triggers = this.config.trigger.split(' '); + + triggers.forEach(function (trigger) { + if (trigger === 'click') { + $(_this4.element).on(_this4.constructor.Event.CLICK, _this4.config.selector, $.proxy(_this4.toggle, _this4)); + } else if (trigger !== Trigger.MANUAL) { + var eventIn = trigger == Trigger.HOVER ? _this4.constructor.Event.MOUSEENTER : _this4.constructor.Event.FOCUSIN; + var eventOut = trigger == Trigger.HOVER ? _this4.constructor.Event.MOUSELEAVE : _this4.constructor.Event.FOCUSOUT; + + $(_this4.element).on(eventIn, _this4.config.selector, $.proxy(_this4._enter, _this4)).on(eventOut, _this4.config.selector, $.proxy(_this4._leave, _this4)); + } + }); + + if (this.config.selector) { + this.config = $.extend({}, this.config, { + trigger: 'manual', + selector: '' + }); + } else { + this._fixTitle(); + } + } + }, { + key: '_removeTetherClasses', + value: function _removeTetherClasses(i, css) { + return ((css.baseVal || css).match(new RegExp('(^|\\s)' + CLASS_PREFIX + '-\\S+', 'g')) || []).join(' '); + } + }, { + key: '_fixTitle', + value: function _fixTitle() { + var titleType = typeof this.element.getAttribute('data-original-title'); + if (this.element.getAttribute('title') || titleType !== 'string') { + this.element.setAttribute('data-original-title', this.element.getAttribute('title') || ''); + this.element.setAttribute('title', ''); + } + } + }, { + key: '_enter', + value: function _enter(event, context) { + var dataKey = this.constructor.DATA_KEY; + + context = context || $(event.currentTarget).data(dataKey); + + if (!context) { + context = new this.constructor(event.currentTarget, this._getDelegateConfig()); + $(event.currentTarget).data(dataKey, context); + } + + if (event) { + context._activeTrigger[event.type == 'focusin' ? Trigger.FOCUS : Trigger.HOVER] = true; + } + + if ($(context.getTipElement()).hasClass(ClassName.IN) || context._hoverState === HoverState.IN) { + context._hoverState = HoverState.IN; + return; + } + + clearTimeout(context._timeout); + + context._hoverState = HoverState.IN; + + if (!context.config.delay || !context.config.delay.show) { + context.show(); + return; + } + + context._timeout = setTimeout(function () { + if (context._hoverState === HoverState.IN) { + context.show(); + } + }, context.config.delay.show); + } + }, { + key: '_leave', + value: function _leave(event, context) { + var dataKey = this.constructor.DATA_KEY; + + context = context || $(event.currentTarget).data(dataKey); + + if (!context) { + context = new this.constructor(event.currentTarget, this._getDelegateConfig()); + $(event.currentTarget).data(dataKey, context); + } + + if (event) { + context._activeTrigger[event.type == 'focusout' ? Trigger.FOCUS : Trigger.HOVER] = false; + } + + if (context._isWithActiveTrigger()) { + return; + } + + clearTimeout(context._timeout); + + context._hoverState = HoverState.OUT; + + if (!context.config.delay || !context.config.delay.hide) { + context.hide(); + return; + } + + context._timeout = setTimeout(function () { + if (context._hoverState === HoverState.OUT) { + context.hide(); + } + }, context.config.delay.hide); + } + }, { + key: '_isWithActiveTrigger', + value: function _isWithActiveTrigger() { + for (var trigger in this._activeTrigger) { + if (this._activeTrigger[trigger]) { + return true; + } + } + + return false; + } + }, { + key: '_getConfig', + value: function _getConfig(config) { + config = $.extend({}, this.constructor.Default, $(this.element).data(), config); + + if (config.delay && typeof config.delay === 'number') { + config.delay = { + show: config.delay, + hide: config.delay + }; + } + + return config; + } + }, { + key: '_getDelegateConfig', + value: function _getDelegateConfig() { + var config = {}; + + if (this.config) { + for (var key in this.config) { + var value = this.config[key]; + if (this.constructor.Default[key] !== value) { + config[key] = value; + } + } + } + + return config; + } + }], [{ + key: 'VERSION', + + // getters + + get: function () { + return VERSION; + } + }, { + key: 'Default', + get: function () { + return Default; + } + }, { + key: 'NAME', + get: function () { + return NAME; + } + }, { + key: 'DATA_KEY', + get: function () { + return DATA_KEY; + } + }, { + key: 'Event', + get: function () { + return Event; + } + }, { + key: '_jQueryInterface', + + // static + + value: function _jQueryInterface(config) { + return this.each(function () { + var data = $(this).data(DATA_KEY); + var _config = typeof config === 'object' ? config : null; + + if (!data && /destroy|hide/.test(config)) { + return; + } + + if (!data) { + data = new Tooltip(this, _config); + $(this).data(DATA_KEY, data); + } + + if (typeof config === 'string') { + data[config](); + } + }); + } + }]); + + return Tooltip; + })(); + + /** + * ------------------------------------------------------------------------ + * jQuery + * ------------------------------------------------------------------------ + */ + + $.fn[NAME] = Tooltip._jQueryInterface; + $.fn[NAME].Constructor = Tooltip; + $.fn[NAME].noConflict = function () { + $.fn[NAME] = JQUERY_NO_CONFLICT; + return Tooltip._jQueryInterface; + }; + + return Tooltip; + })(jQuery); + + module.exports = Tooltip; +}); \ No newline at end of file diff --git a/dist/js/umd/util.js b/dist/js/umd/util.js new file mode 100644 index 000000000..ac8d8d114 --- /dev/null +++ b/dist/js/umd/util.js @@ -0,0 +1,142 @@ +(function (global, factory) { + if (typeof define === 'function' && define.amd) { + define(['exports', 'module'], factory); + } else if (typeof exports !== 'undefined' && typeof module !== 'undefined') { + factory(exports, module); + } else { + var mod = { + exports: {} + }; + factory(mod.exports, mod); + global.util = mod.exports; + } +})(this, function (exports, module) { + /** + * -------------------------------------------------------------------------- + * Bootstrap (v4.0.0): util.js + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * -------------------------------------------------------------------------- + */ + + 'use strict'; + + var Util = (function ($) { + + /** + * ------------------------------------------------------------------------ + * Private TransitionEnd Helpers + * ------------------------------------------------------------------------ + */ + + var transition = false; + + var TransitionEndEvent = { + WebkitTransition: 'webkitTransitionEnd', + MozTransition: 'transitionend', + OTransition: 'oTransitionEnd otransitionend', + transition: 'transitionend' + }; + + function getSpecialTransitionEndEvent() { + return { + bindType: transition.end, + delegateType: transition.end, + handle: function handle(event) { + if ($(event.target).is(this)) { + return event.handleObj.handler.apply(this, arguments); + } + } + }; + } + + function transitionEndTest() { + if (window.QUnit) { + return false; + } + + var el = document.createElement('bootstrap'); + + for (var name in TransitionEndEvent) { + if (el.style[name] !== undefined) { + return { end: TransitionEndEvent[name] }; + } + } + + return false; + } + + function transitionEndEmulator(duration) { + var _this = this; + + var called = false; + + $(this).one(Util.TRANSITION_END, function () { + called = true; + }); + + setTimeout(function () { + if (!called) { + Util.triggerTransitionEnd(_this); + } + }, duration); + + return this; + } + + function setTransitionEndSupport() { + transition = transitionEndTest(); + + $.fn.emulateTransitionEnd = transitionEndEmulator; + + if (Util.supportsTransitionEnd()) { + $.event.special[Util.TRANSITION_END] = getSpecialTransitionEndEvent(); + } + } + + /** + * -------------------------------------------------------------------------- + * Public Util Api + * -------------------------------------------------------------------------- + */ + + var Util = { + + TRANSITION_END: 'bsTransitionEnd', + + getUID: function getUID(prefix) { + do prefix += ~ ~(Math.random() * 1000000); while (document.getElementById(prefix)); + return prefix; + }, + + getSelectorFromElement: function getSelectorFromElement(element) { + var selector = element.getAttribute('data-target'); + + if (!selector) { + selector = element.getAttribute('href') || ''; + selector = /^#[a-z]/i.test(selector) ? selector : null; + } + + return selector; + }, + + reflow: function reflow(element) { + new Function('bs', 'return bs')(element.offsetHeight); + }, + + triggerTransitionEnd: function triggerTransitionEnd(element) { + $(element).trigger(transition.end); + }, + + supportsTransitionEnd: function supportsTransitionEnd() { + return !!transition; + } + + }; + + setTransitionEndSupport(); + + return Util; + })(jQuery); + + module.exports = Util; +}); \ No newline at end of file -- cgit v1.2.3 From f8b2569ec8956a1f4d09fe6fc9865bd200ecde43 Mon Sep 17 00:00:00 2001 From: fat Date: Wed, 13 May 2015 12:48:34 -0700 Subject: implement global dispose method --- dist/js/bootstrap.js | 353 ++++++++++++++++++++++++++++++++--------------- dist/js/bootstrap.min.js | 4 +- dist/js/umd/alert.js | 16 ++- dist/js/umd/button.js | 16 ++- dist/js/umd/carousel.js | 36 +++-- dist/js/umd/collapse.js | 27 +++- dist/js/umd/dropdown.js | 37 +++-- dist/js/umd/modal.js | 62 ++++++--- dist/js/umd/popover.js | 26 ++-- dist/js/umd/scrollspy.js | 26 +++- dist/js/umd/tab.js | 20 ++- dist/js/umd/tooltip.js | 87 +++++++----- 12 files changed, 492 insertions(+), 218 deletions(-) (limited to 'dist/js') diff --git a/dist/js/bootstrap.js b/dist/js/bootstrap.js index 4b7decaf1..725f4f828 100644 --- a/dist/js/bootstrap.js +++ b/dist/js/bootstrap.js @@ -169,6 +169,8 @@ var Alert = (function ($) { var NAME = 'alert'; var VERSION = '4.0.0'; var DATA_KEY = 'bs.alert'; + var EVENT_KEY = '.' + DATA_KEY; + var DATA_API_KEY = '.data-api'; var JQUERY_NO_CONFLICT = $.fn[NAME]; var TRANSITION_DURATION = 150; @@ -177,9 +179,9 @@ var Alert = (function ($) { }; var Event = { - CLOSE: 'close.bs.alert', - CLOSED: 'closed.bs.alert', - CLICK: 'click.bs.alert.data-api' + CLOSE: 'close' + EVENT_KEY, + CLOSED: 'closed' + EVENT_KEY, + CLICK_DATA_API: 'click' + EVENT_KEY + '' + DATA_API_KEY }; var ClassName = { @@ -218,6 +220,12 @@ var Alert = (function ($) { this._removeElement(rootElement); } + }, { + key: 'dispose', + value: function dispose() { + $.removeData(this._element, DATA_KEY); + this._element = null; + } }, { key: '_getRootElement', @@ -311,7 +319,7 @@ var Alert = (function ($) { * ------------------------------------------------------------------------ */ - $(document).on(Event.CLICK, Selector.DISMISS, Alert._handleDismiss(new Alert())); + $(document).on(Event.CLICK_DATA_API, Selector.DISMISS, Alert._handleDismiss(new Alert())); /** * ------------------------------------------------------------------------ @@ -347,6 +355,8 @@ var Button = (function ($) { var NAME = 'button'; var VERSION = '4.0.0'; var DATA_KEY = 'bs.button'; + var EVENT_KEY = '.' + DATA_KEY; + var DATA_API_KEY = '.data-api'; var JQUERY_NO_CONFLICT = $.fn[NAME]; var TRANSITION_DURATION = 150; @@ -365,8 +375,8 @@ var Button = (function ($) { }; var Event = { - CLICK: 'click.bs.button.data-api', - FOCUS_BLUR: 'focus.bs.button.data-api blur.bs.button.data-api' + CLICK_DATA_API: 'click' + EVENT_KEY + '' + DATA_API_KEY, + FOCUS_BLUR_DATA_API: 'focus' + EVENT_KEY + '' + DATA_API_KEY + ' ' + ('blur' + EVENT_KEY + '' + DATA_API_KEY) }; /** @@ -420,6 +430,12 @@ var Button = (function ($) { $(this._element).toggleClass(ClassName.ACTIVE); } } + }, { + key: 'dispose', + value: function dispose() { + $.removeData(this._element, DATA_KEY); + this._element = null; + } }], [{ key: 'VERSION', @@ -458,7 +474,7 @@ var Button = (function ($) { * ------------------------------------------------------------------------ */ - $(document).on(Event.CLICK, Selector.DATA_TOGGLE_CARROT, function (event) { + $(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE_CARROT, function (event) { event.preventDefault(); var button = event.target; @@ -468,7 +484,7 @@ var Button = (function ($) { } Button._jQueryInterface.call($(button), 'toggle'); - }).on(Event.FOCUS_BLUR, Selector.DATA_TOGGLE_CARROT, function (event) { + }).on(Event.FOCUS_BLUR_DATA_API, Selector.DATA_TOGGLE_CARROT, function (event) { var button = $(event.target).closest(Selector.BUTTON)[0]; $(button).toggleClass(ClassName.FOCUS, /^focus(in)?$/.test(event.type)); }); @@ -507,6 +523,8 @@ var Carousel = (function ($) { var NAME = 'carousel'; var VERSION = '4.0.0'; var DATA_KEY = 'bs.carousel'; + var EVENT_KEY = '.' + DATA_KEY; + var DATA_API_KEY = '.data-api'; var JQUERY_NO_CONFLICT = $.fn[NAME]; var TRANSITION_DURATION = 600; @@ -524,10 +542,13 @@ var Carousel = (function ($) { }; var Event = { - SLIDE: 'slide.bs.carousel', - SLID: 'slid.bs.carousel', - CLICK: 'click.bs.carousel.data-api', - LOAD: 'load' + SLIDE: 'slide' + EVENT_KEY, + SLID: 'slid' + EVENT_KEY, + KEYDOWN: 'keydown' + EVENT_KEY, + MOUSEENTER: 'mouseenter' + EVENT_KEY, + MOUSELEAVE: 'mouseleave' + EVENT_KEY, + LOAD_DATA_API: 'load' + EVENT_KEY + '' + DATA_API_KEY, + CLICK_DATA_API: 'click' + EVENT_KEY + '' + DATA_API_KEY }; var ClassName = { @@ -651,6 +672,21 @@ var Carousel = (function ($) { this._slide(direction, this._items[index]); } + }, { + key: 'dispose', + value: function dispose() { + $(this._element).off(EVENT_KEY); + $.removeData(this._element, DATA_KEY); + + this._items = null; + this._config = null; + this._element = null; + this._interval = null; + this._isPaused = null; + this._isSliding = null; + this._activeElement = null; + this._indicatorsElement = null; + } }, { key: '_addEventListeners', @@ -658,11 +694,11 @@ var Carousel = (function ($) { value: function _addEventListeners() { if (this._config.keyboard) { - $(this._element).on('keydown.bs.carousel', $.proxy(this._keydown, this)); + $(this._element).on(Event.KEYDOWN, $.proxy(this._keydown, this)); } if (this._config.pause == 'hover' && !('ontouchstart' in document.documentElement)) { - $(this._element).on('mouseenter.bs.carousel', $.proxy(this.pause, this)).on('mouseleave.bs.carousel', $.proxy(this.cycle, this)); + $(this._element).on(Event.MOUSEENTER, $.proxy(this.pause, this)).on(Event.MOUSELEAVE, $.proxy(this.cycle, this)); } } }, { @@ -889,9 +925,9 @@ var Carousel = (function ($) { * ------------------------------------------------------------------------ */ - $(document).on(Event.CLICK, Selector.DATA_SLIDE, Carousel._dataApiClickHandler); + $(document).on(Event.CLICK_DATA_API, Selector.DATA_SLIDE, Carousel._dataApiClickHandler); - $(window).on(Event.LOAD, function () { + $(window).on(Event.LOAD_DATA_API, function () { $(Selector.DATA_RIDE).each(function () { var $carousel = $(this); Carousel._jQueryInterface.call($carousel, $carousel.data()); @@ -932,6 +968,8 @@ var Collapse = (function ($) { var NAME = 'collapse'; var VERSION = '4.0.0'; var DATA_KEY = 'bs.collapse'; + var EVENT_KEY = '.' + DATA_KEY; + var DATA_API_KEY = '.data-api'; var JQUERY_NO_CONFLICT = $.fn[NAME]; var TRANSITION_DURATION = 600; @@ -941,11 +979,11 @@ var Collapse = (function ($) { }; var Event = { - SHOW: 'show.bs.collapse', - SHOWN: 'shown.bs.collapse', - HIDE: 'hide.bs.collapse', - HIDDEN: 'hidden.bs.collapse', - CLICK: 'click.bs.collapse.data-api' + SHOW: 'show' + EVENT_KEY, + SHOWN: 'shown' + EVENT_KEY, + HIDE: 'hide' + EVENT_KEY, + HIDDEN: 'hidden' + EVENT_KEY, + CLICK_DATA_API: 'click' + EVENT_KEY + '' + DATA_API_KEY }; var ClassName = { @@ -1012,8 +1050,8 @@ var Collapse = (function ($) { return; } - var activesData = undefined; var actives = undefined; + var activesData = undefined; if (this._parent) { actives = $.makeArray($(Selector.ACTIVES)); @@ -1126,6 +1164,17 @@ var Collapse = (function ($) { value: function setTransitioning(isTransitioning) { this._isTransitioning = isTransitioning; } + }, { + key: 'dispose', + value: function dispose() { + $.removeData(this._element, DATA_KEY); + + this._config = null; + this._parent = null; + this._element = null; + this._triggerArray = null; + this._isTransitioning = null; + } }, { key: '_getDimension', @@ -1216,7 +1265,7 @@ var Collapse = (function ($) { * ------------------------------------------------------------------------ */ - $(document).on(Event.CLICK, Selector.DATA_TOGGLE, function (event) { + $(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) { event.preventDefault(); var target = Collapse._getTargetFromElement(this); @@ -1261,16 +1310,18 @@ var Dropdown = (function ($) { var NAME = 'dropdown'; var VERSION = '4.0.0'; var DATA_KEY = 'bs.dropdown'; + var EVENT_KEY = '.' + DATA_KEY; + var DATA_API_KEY = '.data-api'; var JQUERY_NO_CONFLICT = $.fn[NAME]; var Event = { - HIDE: 'hide.bs.dropdown', - HIDDEN: 'hidden.bs.dropdown', - SHOW: 'show.bs.dropdown', - SHOWN: 'shown.bs.dropdown', - CLICK: 'click.bs.dropdown', - KEYDOWN: 'keydown.bs.dropdown.data-api', - CLICK_DATA: 'click.bs.dropdown.data-api' + HIDE: 'hide' + EVENT_KEY, + HIDDEN: 'hidden' + EVENT_KEY, + SHOW: 'show' + EVENT_KEY, + SHOWN: 'shown' + EVENT_KEY, + CLICK: 'click' + EVENT_KEY, + CLICK_DATA_API: 'click' + EVENT_KEY + '' + DATA_API_KEY, + KEYDOWN_DATA_API: 'keydown' + EVENT_KEY + '' + DATA_API_KEY }; var ClassName = { @@ -1299,7 +1350,9 @@ var Dropdown = (function ($) { function Dropdown(element) { _classCallCheck(this, Dropdown); - $(element).on(Event.CLICK, this.toggle); + this._element = element; + + this._addEventListeners(); } _createClass(Dropdown, [{ @@ -1347,6 +1400,21 @@ var Dropdown = (function ($) { return false; } + }, { + key: 'dispose', + value: function dispose() { + $.removeData(this._element, DATA_KEY); + $(this._element).off(EVENT_KEY); + this._element = null; + } + }, { + key: '_addEventListeners', + + // private + + value: function _addEventListeners() { + $(this._element).on(Event.CLICK, this.toggle); + } }], [{ key: 'VERSION', @@ -1479,7 +1547,7 @@ var Dropdown = (function ($) { * ------------------------------------------------------------------------ */ - $(document).on(Event.KEYDOWN, Selector.DATA_TOGGLE, Dropdown._dataApiKeydownHandler).on(Event.KEYDOWN, Selector.ROLE_MENU, Dropdown._dataApiKeydownHandler).on(Event.KEYDOWN, Selector.ROLE_LISTBOX, Dropdown._dataApiKeydownHandler).on(Event.CLICK_DATA, Dropdown._clearMenus).on(Event.CLICK_DATA, Selector.DATA_TOGGLE, Dropdown.prototype.toggle).on(Event.CLICK_DATA, Selector.FORM_CHILD, function (e) { + $(document).on(Event.KEYDOWN_DATA_API, Selector.DATA_TOGGLE, Dropdown._dataApiKeydownHandler).on(Event.KEYDOWN_DATA_API, Selector.ROLE_MENU, Dropdown._dataApiKeydownHandler).on(Event.KEYDOWN_DATA_API, Selector.ROLE_LISTBOX, Dropdown._dataApiKeydownHandler).on(Event.CLICK_DATA_API, Dropdown._clearMenus).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, Dropdown.prototype.toggle).on(Event.CLICK_DATA_API, Selector.FORM_CHILD, function (e) { e.stopPropagation(); }); @@ -1517,6 +1585,8 @@ var Modal = (function ($) { var NAME = 'modal'; var VERSION = '4.0.0'; var DATA_KEY = 'bs.modal'; + var EVENT_KEY = '.' + DATA_KEY; + var DATA_API_KEY = '.data-api'; var JQUERY_NO_CONFLICT = $.fn[NAME]; var TRANSITION_DURATION = 300; var BACKDROP_TRANSITION_DURATION = 150; @@ -1528,17 +1598,17 @@ var Modal = (function ($) { }; var Event = { - HIDE: 'hide.bs.modal', - HIDDEN: 'hidden.bs.modal', - SHOW: 'show.bs.modal', - SHOWN: 'shown.bs.modal', - DISMISS: 'click.dismiss.bs.modal', - KEYDOWN: 'keydown.dismiss.bs.modal', - FOCUSIN: 'focusin.bs.modal', - RESIZE: 'resize.bs.modal', - CLICK: 'click.bs.modal.data-api', - MOUSEDOWN: 'mousedown.dismiss.bs.modal', - MOUSEUP: 'mouseup.dismiss.bs.modal' + HIDE: 'hide' + EVENT_KEY, + HIDDEN: 'hidden' + EVENT_KEY, + SHOW: 'show' + EVENT_KEY, + SHOWN: 'shown' + EVENT_KEY, + FOCUSIN: 'focusin' + EVENT_KEY, + RESIZE: 'resize' + EVENT_KEY, + CLICK_DISMISS: 'click.dismiss' + EVENT_KEY, + KEYDOWN_DISMISS: 'keydown.dismiss' + EVENT_KEY, + MOUSEUP_DISMISS: 'mouseup.dismiss' + EVENT_KEY, + MOUSEDOWN_DISMISS: 'mousedown.dismiss' + EVENT_KEY, + CLICK_DATA_API: 'click' + EVENT_KEY + '' + DATA_API_KEY }; var ClassName = { @@ -1609,10 +1679,10 @@ var Modal = (function ($) { this._setEscapeEvent(); this._setResizeEvent(); - $(this._element).on(Event.DISMISS, Selector.DATA_DISMISS, $.proxy(this.hide, this)); + $(this._element).on(Event.CLICK_DISMISS, Selector.DATA_DISMISS, $.proxy(this.hide, this)); - $(this._dialog).on(Event.MOUSEDOWN, function () { - $(_this7._element).one(Event.MOUSEUP, function (event) { + $(this._dialog).on(Event.MOUSEDOWN_DISMISS, function () { + $(_this7._element).one(Event.MOUSEUP_DISMISS, function (event) { if ($(event.target).is(_this7._element)) { that._ignoreBackdropClick = true; } @@ -1645,8 +1715,8 @@ var Modal = (function ($) { $(this._element).removeClass(ClassName.IN); - $(this._element).off(Event.DISMISS); - $(this._dialog).off(Event.MOUSEDOWN); + $(this._element).off(Event.CLICK_DISMISS); + $(this._dialog).off(Event.MOUSEDOWN_DISMISS); if (Util.supportsTransitionEnd() && $(this._element).hasClass(ClassName.FADE)) { @@ -1655,6 +1725,26 @@ var Modal = (function ($) { this._hideModal(); } } + }, { + key: 'dispose', + value: function dispose() { + $.removeData(this._element, DATA_KEY); + + $(window).off(EVENT_KEY); + $(document).off(EVENT_KEY); + $(this._element).off(EVENT_KEY); + $(this._backdrop).off(EVENT_KEY); + + this._config = null; + this._element = null; + this._dialog = null; + this._backdrop = null; + this._isShown = null; + this._isBodyOverflowing = null; + this._ignoreBackdropClick = null; + this._originalBodyPadding = null; + this._scrollbarWidth = null; + } }, { key: '_showElement', @@ -1714,13 +1804,13 @@ var Modal = (function ($) { var _this10 = this; if (this._isShown && this._config.keyboard) { - $(this._element).on(Event.KEYDOWN, function (event) { + $(this._element).on(Event.KEYDOWN_DISMISS, function (event) { if (event.which === 27) { _this10.hide(); } }); } else if (!this._isShown) { - $(this._element).off(Event.KEYDOWN); + $(this._element).off(Event.KEYDOWN_DISMISS); } } }, { @@ -1772,7 +1862,7 @@ var Modal = (function ($) { $(this._backdrop).appendTo(this.$body); - $(this._element).on(Event.DISMISS, function (event) { + $(this._element).on(Event.CLICK_DISMISS, function (event) { if (_this12._ignoreBackdropClick) { _this12._ignoreBackdropClick = false; return; @@ -1937,7 +2027,7 @@ var Modal = (function ($) { * ------------------------------------------------------------------------ */ - $(document).on(Event.CLICK, Selector.DATA_TOGGLE, function (event) { + $(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) { var _this13 = this; var target = undefined; @@ -2003,6 +2093,8 @@ var ScrollSpy = (function ($) { var NAME = 'scrollspy'; var VERSION = '4.0.0'; var DATA_KEY = 'bs.scrollspy'; + var EVENT_KEY = '.' + DATA_KEY; + var DATA_API_KEY = '.data-api'; var JQUERY_NO_CONFLICT = $.fn[NAME]; var Default = { @@ -2010,9 +2102,9 @@ var ScrollSpy = (function ($) { }; var Event = { - ACTIVATE: 'activate.bs.scrollspy', - SCROLL: 'scroll.bs.scrollspy', - LOAD: 'load.bs.scrollspy.data-api' + ACTIVATE: 'activate' + EVENT_KEY, + SCROLL: 'scroll' + EVENT_KEY, + LOAD_DATA_API: 'load' + EVENT_KEY + '' + DATA_API_KEY }; var ClassName = { @@ -2037,6 +2129,7 @@ var ScrollSpy = (function ($) { function ScrollSpy(element, config) { _classCallCheck(this, ScrollSpy); + this._element = element; this._scrollElement = element.tagName === 'BODY' ? window : element; this._config = $.extend({}, Default, config); this._selector = '' + (this._config.target || '') + ' .nav li > a'; @@ -2095,6 +2188,21 @@ var ScrollSpy = (function ($) { _this14._targets.push(item[1]); }); } + }, { + key: 'dispose', + value: function dispose() { + $.removeData(this._element, DATA_KEY); + $(this._scrollElement).off(EVENT_KEY); + + this._element = null; + this._scrollElement = null; + this._config = null; + this._selector = null; + this._offsets = null; + this._targets = null; + this._activeTarget = null; + this._scrollHeight = null; + } }, { key: '_getScrollTop', @@ -2221,7 +2329,7 @@ var ScrollSpy = (function ($) { * ------------------------------------------------------------------------ */ - $(window).on(Event.LOAD, function () { + $(window).on(Event.LOAD_DATA_API, function () { var scrollSpys = $.makeArray($(Selector.DATA_SPY)); for (var i = scrollSpys.length; i--;) { @@ -2264,15 +2372,17 @@ var Tab = (function ($) { var NAME = 'tab'; var VERSION = '4.0.0'; var DATA_KEY = 'bs.tab'; + var EVENT_KEY = '.' + DATA_KEY; + var DATA_API_KEY = '.data-api'; var JQUERY_NO_CONFLICT = $.fn[NAME]; var TRANSITION_DURATION = 150; var Event = { - HIDE: 'hide.bs.tab', - HIDDEN: 'hidden.bs.tab', - SHOW: 'show.bs.tab', - SHOWN: 'shown.bs.tab', - CLICK: 'click.bs.tab.data-api' + HIDE: 'hide' + EVENT_KEY, + HIDDEN: 'hidden' + EVENT_KEY, + SHOW: 'show' + EVENT_KEY, + SHOWN: 'shown' + EVENT_KEY, + CLICK_DATA_API: 'click' + EVENT_KEY + '' + DATA_API_KEY }; var ClassName = { @@ -2376,6 +2486,12 @@ var Tab = (function ($) { complete(); } } + }, { + key: 'dispose', + value: function dispose() { + $.removeClass(this._element, DATA_KEY); + this._element = null; + } }, { key: '_activate', @@ -2489,7 +2605,7 @@ var Tab = (function ($) { * ------------------------------------------------------------------------ */ - $(document).on(Event.CLICK, Selector.DATA_TOGGLE, function (event) { + $(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) { event.preventDefault(); Tab._jQueryInterface.call($(this), 'show'); }); @@ -2528,6 +2644,7 @@ var Tooltip = (function ($) { var NAME = 'tooltip'; var VERSION = '4.0.0'; var DATA_KEY = 'bs.tooltip'; + var EVENT_KEY = '.' + DATA_KEY; var JQUERY_NO_CONFLICT = $.fn[NAME]; var TRANSITION_DURATION = 150; var CLASS_PREFIX = 'bs-tether'; @@ -2558,16 +2675,16 @@ var Tooltip = (function ($) { }; var Event = { - HIDE: 'hide.bs.tooltip', - HIDDEN: 'hidden.bs.tooltip', - SHOW: 'show.bs.tooltip', - SHOWN: 'shown.bs.tooltip', - INSERTED: 'inserted.bs.tooltip', - CLICK: 'click.bs.tooltip', - FOCUSIN: 'focusin.bs.tooltip', - FOCUSOUT: 'focusout.bs.tooltip', - MOUSEENTER: 'mouseenter.bs.tooltip', - MOUSELEAVE: 'mouseleave.bs.tooltip' + HIDE: 'hide' + EVENT_KEY, + HIDDEN: 'hidden' + EVENT_KEY, + SHOW: 'show' + EVENT_KEY, + SHOWN: 'shown' + EVENT_KEY, + INSERTED: 'inserted' + EVENT_KEY, + CLICK: 'click' + EVENT_KEY, + FOCUSIN: 'focusin' + EVENT_KEY, + FOCUSOUT: 'focusout' + EVENT_KEY, + MOUSEENTER: 'mouseenter' + EVENT_KEY, + MOUSELEAVE: 'mouseleave' + EVENT_KEY }; var ClassName = { @@ -2661,25 +2778,34 @@ var Tooltip = (function ($) { } } }, { - key: 'destroy', - value: function destroy() { - var _this16 = this; - + key: 'dispose', + value: function dispose() { clearTimeout(this._timeout); - this.hide(function () { - $(_this16.element).off('.' + _this16.constructor.NAME).removeData(_this16.constructor.DATA_KEY); - if (_this16.tip) { - $(_this16.tip).detach(); - } + this.cleanupTether(); - _this16.tip = null; - }); + $.removeData(this.element, this.constructor.DATA_KEY); + + $(this.element).off(this.constructor.EVENT_KEY); + + if (this.tip) { + $(this.tip).remove(); + } + + this._isEnabled = null; + this._timeout = null; + this._hoverState = null; + this._activeTrigger = null; + this._tether = null; + + this.element = null; + this.config = null; + this.tip = null; } }, { key: 'show', value: function show() { - var _this17 = this; + var _this16 = this; var showEvent = $.Event(this.constructor.Event.SHOW); @@ -2728,13 +2854,13 @@ var Tooltip = (function ($) { $(tip).addClass(ClassName.IN); var complete = function complete() { - var prevHoverState = _this17._hoverState; - _this17._hoverState = null; + var prevHoverState = _this16._hoverState; + _this16._hoverState = null; - $(_this17.element).trigger(_this17.constructor.Event.SHOWN); + $(_this16.element).trigger(_this16.constructor.Event.SHOWN); if (prevHoverState === HoverState.OUT) { - _this17._leave(null, _this17); + _this16._leave(null, _this16); } }; @@ -2744,18 +2870,18 @@ var Tooltip = (function ($) { }, { key: 'hide', value: function hide(callback) { - var _this18 = this; + var _this17 = this; var tip = this.getTipElement(); var hideEvent = $.Event(this.constructor.Event.HIDE); var complete = function complete() { - if (_this18._hoverState !== HoverState.IN && tip.parentNode) { + if (_this17._hoverState !== HoverState.IN && tip.parentNode) { tip.parentNode.removeChild(tip); } - _this18.element.removeAttribute('aria-describedby'); - $(_this18.element).trigger(_this18.constructor.Event.HIDDEN); - _this18.cleanupTether(); + _this17.element.removeAttribute('aria-describedby'); + $(_this17.element).trigger(_this17.constructor.Event.HIDDEN); + _this17.cleanupTether(); if (callback) { callback(); @@ -2840,18 +2966,18 @@ var Tooltip = (function ($) { }, { key: '_setListeners', value: function _setListeners() { - var _this19 = this; + var _this18 = this; var triggers = this.config.trigger.split(' '); triggers.forEach(function (trigger) { if (trigger === 'click') { - $(_this19.element).on(_this19.constructor.Event.CLICK, _this19.config.selector, $.proxy(_this19.toggle, _this19)); + $(_this18.element).on(_this18.constructor.Event.CLICK, _this18.config.selector, $.proxy(_this18.toggle, _this18)); } else if (trigger !== Trigger.MANUAL) { - var eventIn = trigger == Trigger.HOVER ? _this19.constructor.Event.MOUSEENTER : _this19.constructor.Event.FOCUSIN; - var eventOut = trigger == Trigger.HOVER ? _this19.constructor.Event.MOUSELEAVE : _this19.constructor.Event.FOCUSOUT; + var eventIn = trigger == Trigger.HOVER ? _this18.constructor.Event.MOUSEENTER : _this18.constructor.Event.FOCUSIN; + var eventOut = trigger == Trigger.HOVER ? _this18.constructor.Event.MOUSELEAVE : _this18.constructor.Event.FOCUSOUT; - $(_this19.element).on(eventIn, _this19.config.selector, $.proxy(_this19._enter, _this19)).on(eventOut, _this19.config.selector, $.proxy(_this19._leave, _this19)); + $(_this18.element).on(eventIn, _this18.config.selector, $.proxy(_this18._enter, _this18)).on(eventOut, _this18.config.selector, $.proxy(_this18._leave, _this18)); } }); @@ -3018,6 +3144,11 @@ var Tooltip = (function ($) { get: function () { return Event; } + }, { + key: 'EVENT_KEY', + get: function () { + return EVENT_KEY; + } }, { key: '_jQueryInterface', @@ -3081,6 +3212,7 @@ var Popover = (function ($) { var NAME = 'popover'; var VERSION = '4.0.0'; var DATA_KEY = 'bs.popover'; + var EVENT_KEY = '.' + DATA_KEY; var JQUERY_NO_CONFLICT = $.fn[NAME]; var Default = $.extend({}, Tooltip.Default, { @@ -3102,16 +3234,16 @@ var Popover = (function ($) { }; var Event = { - HIDE: 'hide.bs.popover', - HIDDEN: 'hidden.bs.popover', - SHOW: 'show.bs.popover', - SHOWN: 'shown.bs.popover', - INSERTED: 'inserted.bs.popover', - CLICK: 'click.bs.popover', - FOCUSIN: 'focusin.bs.popover', - FOCUSOUT: 'focusout.bs.popover', - MOUSEENTER: 'mouseenter.bs.popover', - MOUSELEAVE: 'mouseleave.bs.popover' + HIDE: 'hide' + EVENT_KEY, + HIDDEN: 'hidden' + EVENT_KEY, + SHOW: 'show' + EVENT_KEY, + SHOWN: 'shown' + EVENT_KEY, + INSERTED: 'inserted' + EVENT_KEY, + CLICK: 'click' + EVENT_KEY, + FOCUSIN: 'focusin' + EVENT_KEY, + FOCUSOUT: 'focusout' + EVENT_KEY, + MOUSEENTER: 'mouseenter' + EVENT_KEY, + MOUSELEAVE: 'mouseleave' + EVENT_KEY }; /** @@ -3199,6 +3331,11 @@ var Popover = (function ($) { get: function () { return Event; } + }, { + key: 'EVENT_KEY', + get: function () { + return EVENT_KEY; + } }, { key: '_jQueryInterface', diff --git a/dist/js/bootstrap.min.js b/dist/js/bootstrap.min.js index 6e54840af..49b050aa5 100644 --- a/dist/js/bootstrap.min.js +++ b/dist/js/bootstrap.min.js @@ -3,5 +3,5 @@ * Copyright 2011-2015 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) */ -if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){var b=a.fn.jquery.split(" ")[0].split(".");if(b[0]<2&&b[1]<9||1==b[0]&&9==b[1]&&b[2]<1)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher")}(jQuery),+function(){"use strict";function a(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(a.__proto__=b)}function b(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}{var c=function(){function a(a,b){for(var c=0;cthis._items.length-1||0>b)){if(this._isSliding)return void a(this._element).one(l.SLID,function(){return c.to(b)});if(d==b)return this.pause(),void this.cycle();var e=b>d?k.NEXT:k.PREVIOUS;this._slide(e,this._items[b])}}},{key:"_addEventListeners",value:function(){this._config.keyboard&&a(this._element).on("keydown.bs.carousel",a.proxy(this._keydown,this)),"hover"!=this._config.pause||"ontouchstart"in document.documentElement||a(this._element).on("mouseenter.bs.carousel",a.proxy(this.pause,this)).on("mouseleave.bs.carousel",a.proxy(this.cycle,this))}},{key:"_keydown",value:function(a){if(a.preventDefault(),!/input|textarea/i.test(a.target.tagName))switch(a.which){case 37:this.prev();break;case 39:this.next();break;default:return}}},{key:"_getItemIndex",value:function(b){return this._items=a.makeArray(a(b).parent().find(n.ITEM)),this._items.indexOf(b)}},{key:"_getItemByDirection",value:function(a,b){var c=a===k.NEXT,d=a===k.PREVIOUS,e=this._getItemIndex(b),f=this._items.length-1,g=d&&0===e||c&&e==f;if(g&&!this._config.wrap)return b;var h=a==k.PREVIOUS?-1:1,i=(e+h)%this._items.length;return-1===i?this._items[this._items.length-1]:this._items[i]}},{key:"_triggerSlideEvent",value:function(b,c){var d=a.Event(l.SLIDE,{relatedTarget:b,direction:c});return a(this._element).trigger(d),d}},{key:"_setActiveIndicatorElement",value:function(b){if(this._indicatorsElement){a(this._indicatorsElement).find(n.ACTIVE).removeClass(m.ACTIVE);var c=this._indicatorsElement.children[this._getItemIndex(b)];c&&a(c).addClass(m.ACTIVE)}}},{key:"_slide",value:function(b,c){var e=this,f=a(this._element).find(n.ACTIVE_ITEM)[0],g=c||f&&this._getItemByDirection(b,f),h=!!this._interval,j=b==k.NEXT?m.LEFT:m.RIGHT;if(g&&a(g).hasClass(m.ACTIVE))return void(this._isSliding=!1);var o=this._triggerSlideEvent(g,j);if(!o.isDefaultPrevented()&&f&&g){this._isSliding=!0,h&&this.pause(),this._setActiveIndicatorElement(g);var p=a.Event(l.SLID,{relatedTarget:g,direction:j});d.supportsTransitionEnd()&&a(this._element).hasClass(m.SLIDE)?(a(g).addClass(b),d.reflow(g),a(f).addClass(j),a(g).addClass(j),a(f).one(d.TRANSITION_END,function(){a(g).removeClass(j).removeClass(b),a(g).addClass(m.ACTIVE),a(f).removeClass(m.ACTIVE).removeClass(b).removeClass(j),e._isSliding=!1,setTimeout(function(){return a(e._element).trigger(p)},0)}).emulateTransitionEnd(i)):(a(f).removeClass(m.ACTIVE),a(g).addClass(m.ACTIVE),this._isSliding=!1,a(this._element).trigger(p)),h&&this.cycle()}}}],[{key:"VERSION",get:function(){return f}},{key:"Default",get:function(){return j}},{key:"_jQueryInterface",value:function(b){return this.each(function(){var c=a(this).data(g),d=a.extend({},j,a(this).data());"object"==typeof b&&a.extend(d,b);var f="string"==typeof b?b:d.slide;c||(c=new e(this,d),a(this).data(g,c)),"number"==typeof b?c.to(b):f?c[f]():d.interval&&(c.pause(),c.cycle())})}},{key:"_dataApiClickHandler",value:function(b){var c=d.getSelectorFromElement(this);if(c){var f=a(c)[0];if(f&&a(f).hasClass(m.CAROUSEL)){var h=a.extend({},a(f).data(),a(this).data()),i=this.getAttribute("data-slide-to");i&&(h.interval=!1),e._jQueryInterface.call(a(f),h),i&&a(f).data(g).to(i),b.preventDefault()}}}}]),e}();return a(document).on(l.CLICK,n.DATA_SLIDE,o._dataApiClickHandler),a(window).on(l.LOAD,function(){a(n.DATA_RIDE).each(function(){var b=a(this);o._jQueryInterface.call(b,b.data())})}),a.fn[e]=o._jQueryInterface,a.fn[e].Constructor=o,a.fn[e].noConflict=function(){return a.fn[e]=h,o._jQueryInterface},o}(jQuery),function(a){var e="collapse",f="4.0.0",g="bs.collapse",h=a.fn[e],i=600,j={toggle:!0,parent:null},k={SHOW:"show.bs.collapse",SHOWN:"shown.bs.collapse",HIDE:"hide.bs.collapse",HIDDEN:"hidden.bs.collapse",CLICK:"click.bs.collapse.data-api"},l={IN:"in",COLLAPSE:"collapse",COLLAPSING:"collapsing",COLLAPSED:"collapsed"},m={WIDTH:"width",HEIGHT:"height"},n={ACTIVES:".panel > .in, .panel > .collapsing",DATA_TOGGLE:'[data-toggle="collapse"]'},o=function(){function e(c,d){b(this,e),this._isTransitioning=!1,this._element=c,this._config=a.extend({},j,d),this._triggerArray=a.makeArray(a('[data-toggle="collapse"][href="#'+c.id+'"],'+('[data-toggle="collapse"][data-target="#'+c.id+'"]'))),this._parent=this._config.parent?this._getParent():null,this._config.parent||this._addAriaAndCollapsedClass(this._element,this._triggerArray),this._config.toggle&&this.toggle()}return c(e,[{key:"toggle",value:function(){a(this._element).hasClass(l.IN)?this.hide():this.show()}},{key:"show",value:function(){var b=this;if(!this._isTransitioning&&!a(this._element).hasClass(l.IN)){var c=void 0,f=void 0;if(this._parent&&(f=a.makeArray(a(n.ACTIVES)),f.length||(f=null)),!(f&&(c=a(f).data(g),c&&c._isTransitioning))){var h=a.Event(k.SHOW);if(a(this._element).trigger(h),!h.isDefaultPrevented()){f&&(e._jQueryInterface.call(a(f),"hide"),c||a(f).data(g,null));var j=this._getDimension();a(this._element).removeClass(l.COLLAPSE).addClass(l.COLLAPSING),this._element.style[j]=0,this._element.setAttribute("aria-expanded",!0),this._triggerArray.length&&a(this._triggerArray).removeClass(l.COLLAPSED).attr("aria-expanded",!0),this.setTransitioning(!0);var m=function(){a(b._element).removeClass(l.COLLAPSING).addClass(l.COLLAPSE).addClass(l.IN),b._element.style[j]="",b.setTransitioning(!1),a(b._element).trigger(k.SHOWN)};if(!d.supportsTransitionEnd())return void m();var o="scroll"+(j[0].toUpperCase()+j.slice(1));a(this._element).one(d.TRANSITION_END,m).emulateTransitionEnd(i),this._element.style[j]=this._element[o]+"px"}}}}},{key:"hide",value:function(){var b=this;if(!this._isTransitioning&&a(this._element).hasClass(l.IN)){var c=a.Event(k.HIDE);if(a(this._element).trigger(c),!c.isDefaultPrevented()){var e=this._getDimension(),f=e===m.WIDTH?"offsetWidth":"offsetHeight";this._element.style[e]=this._element[f]+"px",d.reflow(this._element),a(this._element).addClass(l.COLLAPSING).removeClass(l.COLLAPSE).removeClass(l.IN),this._element.setAttribute("aria-expanded",!1),this._triggerArray.length&&a(this._triggerArray).addClass(l.COLLAPSED).attr("aria-expanded",!1),this.setTransitioning(!0);var g=function(){b.setTransitioning(!1),a(b._element).removeClass(l.COLLAPSING).addClass(l.COLLAPSE).trigger(k.HIDDEN)};return this._element.style[e]=0,d.supportsTransitionEnd()?void a(this._element).one(d.TRANSITION_END,g).emulateTransitionEnd(i):g()}}}},{key:"setTransitioning",value:function(a){this._isTransitioning=a}},{key:"_getDimension",value:function(){var b=a(this._element).hasClass(m.WIDTH);return b?m.WIDTH:m.HEIGHT}},{key:"_getParent",value:function(){var b=this,c=a(this._config.parent)[0],d='[data-toggle="collapse"][data-parent="'+this._config.parent+'"]';return a(c).find(d).each(function(a,c){b._addAriaAndCollapsedClass(e._getTargetFromElement(c),[c])}),c}},{key:"_addAriaAndCollapsedClass",value:function(b,c){if(b){var d=a(b).hasClass(l.IN);b.setAttribute("aria-expanded",d),c.length&&a(c).toggleClass(l.COLLAPSED,!d).attr("aria-expanded",d)}}}],[{key:"VERSION",get:function(){return f}},{key:"Default",get:function(){return j}},{key:"_getTargetFromElement",value:function(b){var c=d.getSelectorFromElement(b);return c?a(c)[0]:null}},{key:"_jQueryInterface",value:function(b){return this.each(function(){var c=a(this),d=c.data(g),f=a.extend({},j,c.data(),"object"==typeof b&&b);!d&&f.toggle&&/show|hide/.test(b)&&(f.toggle=!1),d||(d=new e(this,f),c.data(g,d)),"string"==typeof b&&d[b]()})}}]),e}();return a(document).on(k.CLICK,n.DATA_TOGGLE,function(b){b.preventDefault();var c=o._getTargetFromElement(this),d=a(c).data(g),e=d?"toggle":a(this).data();o._jQueryInterface.call(a(c),e)}),a.fn[e]=o._jQueryInterface,a.fn[e].Constructor=o,a.fn[e].noConflict=function(){return a.fn[e]=h,o._jQueryInterface},o}(jQuery),function(a){var e="dropdown",f="4.0.0",g="bs.dropdown",h=a.fn[e],i={HIDE:"hide.bs.dropdown",HIDDEN:"hidden.bs.dropdown",SHOW:"show.bs.dropdown",SHOWN:"shown.bs.dropdown",CLICK:"click.bs.dropdown",KEYDOWN:"keydown.bs.dropdown.data-api",CLICK_DATA:"click.bs.dropdown.data-api"},j={BACKDROP:"dropdown-backdrop",DISABLED:"disabled",OPEN:"open"},k={BACKDROP:".dropdown-backdrop",DATA_TOGGLE:'[data-toggle="dropdown"]',FORM_CHILD:".dropdown form",ROLE_MENU:'[role="menu"]',ROLE_LISTBOX:'[role="listbox"]',NAVBAR_NAV:".navbar-nav",VISIBLE_ITEMS:'[role="menu"] li:not(.disabled) a, [role="listbox"] li:not(.disabled) a'},l=function(){function e(c){b(this,e),a(c).on(i.CLICK,this.toggle)}return c(e,[{key:"toggle",value:function(){if(!this.disabled&&!a(this).hasClass(j.DISABLED)){var b=e._getParentFromElement(this),c=a(b).hasClass(j.OPEN);if(e._clearMenus(),c)return!1;if("ontouchstart"in document.documentElement&&!a(b).closest(k.NAVBAR_NAV).length){var d=document.createElement("div");d.className=j.BACKDROP,a(d).insertBefore(this),a(d).on("click",e._clearMenus)}var f={relatedTarget:this},g=a.Event(i.SHOW,f);if(a(b).trigger(g),!g.isDefaultPrevented())return this.focus(),this.setAttribute("aria-expanded","true"),a(b).toggleClass(j.OPEN),a(b).trigger(i.SHOWN,f),!1}}}],[{key:"VERSION",get:function(){return f}},{key:"_jQueryInterface",value:function(b){return this.each(function(){var c=a(this).data(g);c||a(this).data(g,c=new e(this)),"string"==typeof b&&c[b].call(this)})}},{key:"_clearMenus",value:function(b){if(!b||3!==b.which){var c=a(k.BACKDROP)[0];c&&c.parentNode.removeChild(c);for(var d=a.makeArray(a(k.DATA_TOGGLE)),f=0;f0&&h--,40===b.which&&hdocument.documentElement.clientHeight;!this._isBodyOverflowing&&a&&(this._element.style.paddingLeft=this._scrollbarWidth+"px"),this._isBodyOverflowing&&!a&&(this._element.style.paddingRight=this._scrollbarWidth+"px")}},{key:"_resetAdjustments",value:function(){this._element.style.paddingLeft="",this._element.style.paddingRight=""}},{key:"_checkScrollbar",value:function(){var a=window.innerWidth;if(!a){var b=document.documentElement.getBoundingClientRect();a=b.right-Math.abs(b.left)}this._isBodyOverflowing=document.body.clientWidth a",this._offsets=[],this._targets=[],this._activeTarget=null,this._scrollHeight=0,a(this._scrollElement).on(j.SCROLL,a.proxy(this._process,this)),this.refresh(),this._process()}return c(e,[{key:"refresh",value:function(){var b=this,c="offset",e=0;this._scrollElement!==this._scrollElement.window&&(c="position",e=this._getScrollTop()),this._offsets=[],this._targets=[],this._scrollHeight=this._getScrollHeight();var f=a.makeArray(a(this._selector));f.map(function(b){var f=void 0,g=d.getSelectorFromElement(b);return g&&(f=a(g)[0]),f&&(f.offsetWidth||f.offsetHeight)?[a(f)[c]().top+e,g]:void 0}).filter(function(a){return a}).sort(function(a,b){return a[0]-b[0]}).forEach(function(a){b._offsets.push(a[0]),b._targets.push(a[1])})}},{key:"_getScrollTop",value:function(){return this._scrollElement===window?this._scrollElement.scrollY:this._scrollElement.scrollTop}},{key:"_getScrollHeight",value:function(){return this._scrollElement.scrollHeight||Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)}},{key:"_process",value:function(){var a=this._getScrollTop()+this._config.offset,b=this._getScrollHeight(),c=this._config.offset+b-this._scrollElement.offsetHeight;if(this._scrollHeight!==b&&this.refresh(),a>=c){var d=this._targets[this._targets.length-1];this._activeTarget!==d&&this._activate(d)}if(this._activeTarget&&a=this._offsets[e]&&(void 0===this._offsets[e+1]||a .fade",ACTIVE:".active",ACTIVE_CHILD:"> .active",DATA_TOGGLE:'[data-toggle="tab"], [data-toggle="pill"]',DROPDOWN_ACTIVE_CHILD:"> .dropdown-menu > .active"},m=function(){function e(a){b(this,e),this._element=a}return c(e,[{key:"show",value:function(){var b=this;if(!this._element.parentNode||this._element.parentNode.nodeType!=Node.ELEMENT_NODE||!a(this._element).parent().hasClass(k.ACTIVE)){var c=void 0,e=void 0,f=a(this._element).closest(l.UL)[0],g=d.getSelectorFromElement(this._element);f&&(e=a.makeArray(a(f).find(l.ACTIVE)),e=e[e.length-1],e&&(e=a(e).find(l.A)[0]));var h=a.Event(j.HIDE,{relatedTarget:this._element}),i=a.Event(j.SHOW,{relatedTarget:e});if(e&&a(e).trigger(h),a(this._element).trigger(i),!i.isDefaultPrevented()&&!h.isDefaultPrevented()){g&&(c=a(g)[0]),this._activate(a(this._element).closest(l.LI)[0],f);var m=function(){var c=a.Event(j.HIDDEN,{relatedTarget:b._element}),d=a.Event(j.SHOWN,{relatedTarget:e});a(e).trigger(c),a(b._element).trigger(d)};c?this._activate(c,c.parentNode,m):m()}}}},{key:"_activate",value:function(b,c,e){var f=a(c).find(l.ACTIVE_CHILD)[0],g=e&&d.supportsTransitionEnd()&&(f&&a(f).hasClass(k.FADE)||!!a(c).find(l.FADE_CHILD)[0]),h=a.proxy(this._transitionComplete,this,b,f,g,e);f&&g?a(f).one(d.TRANSITION_END,h).emulateTransitionEnd(i):h(),f&&a(f).removeClass(k.IN)}},{key:"_transitionComplete",value:function(b,c,e,f){if(c){a(c).removeClass(k.ACTIVE);var g=a(c).find(l.DROPDOWN_ACTIVE_CHILD)[0];g&&a(g).removeClass(k.ACTIVE);var h=a(c).find(l.DATA_TOGGLE)[0];h&&h.setAttribute("aria-expanded",!1)}a(b).addClass(k.ACTIVE);var i=a(b).find(l.DATA_TOGGLE)[0];if(i&&i.setAttribute("aria-expanded",!0),e?(d.reflow(b),a(b).addClass(k.IN)):a(b).removeClass(k.FADE),b.parentNode&&a(b.parentNode).hasClass(k.DROPDOWN_MENU)){var j=a(b).closest(l.LI_DROPDOWN)[0];j&&a(j).addClass(k.ACTIVE),i=a(b).find(l.DATA_TOGGLE)[0],i&&i.setAttribute("aria-expanded",!0)}f&&f()}}],[{key:"VERSION",get:function(){return f}},{key:"Default",get:function(){return Default}},{key:"_jQueryInterface",value:function(b){return this.each(function(){var c=a(this),d=c.data(g);d||(d=d=new e(this),c.data(g,d)),"string"==typeof b&&d[b]()})}}]),e}();return a(document).on(j.CLICK,l.DATA_TOGGLE,function(b){b.preventDefault(),m._jQueryInterface.call(a(this),"show")}),a.fn[e]=m._jQueryInterface,a.fn[e].Constructor=m,a.fn[e].noConflict=function(){return a.fn[e]=h,m._jQueryInterface},m}(jQuery),function(a){var e="tooltip",f="4.0.0",g="bs.tooltip",h=a.fn[e],i=150,j="bs-tether",k={animation:!0,template:'',trigger:"hover focus",title:"",delay:0,html:!1,selector:!1,placement:"top",offset:"0 0",constraints:null},l={TOP:"bottom center",RIGHT:"middle left",BOTTOM:"top center",LEFT:"middle right"},m={IN:"in",OUT:"out"},n={HIDE:"hide.bs.tooltip",HIDDEN:"hidden.bs.tooltip",SHOW:"show.bs.tooltip",SHOWN:"shown.bs.tooltip",INSERTED:"inserted.bs.tooltip",CLICK:"click.bs.tooltip",FOCUSIN:"focusin.bs.tooltip",FOCUSOUT:"focusout.bs.tooltip",MOUSEENTER:"mouseenter.bs.tooltip",MOUSELEAVE:"mouseleave.bs.tooltip"},o={FADE:"fade",IN:"in"},p={TOOLTIP:".tooltip",TOOLTIP_INNER:".tooltip-inner"},q={element:!1,enabled:!1},r={HOVER:"hover",FOCUS:"focus",CLICK:"click",MANUAL:"manual"},s=function(){function h(a,c){b(this,h),this._isEnabled=!0,this._timeout=0,this._hoverState="",this._activeTrigger={},this._tether=null,this.element=a,this.config=this._getConfig(c),this.tip=null,this._setListeners()}return c(h,[{key:"enable",value:function(){this._isEnabled=!0}},{key:"disable",value:function(){this._isEnabled=!1}},{key:"toggleEnabled",value:function(){this._isEnabled=!this._isEnabled}},{key:"toggle",value:function(b){var c=this,d=this.constructor.DATA_KEY;b?(c=a(b.currentTarget).data(d),c||(c=new this.constructor(b.currentTarget,this._getDelegateConfig()),a(b.currentTarget).data(d,c)),c._activeTrigger.click=!c._activeTrigger.click,c._isWithActiveTrigger()?c._enter(null,c):c._leave(null,c)):a(c.getTipElement()).hasClass(o.IN)?c._leave(null,c):c._enter(null,c)}},{key:"destroy",value:function(){var b=this;clearTimeout(this._timeout),this.hide(function(){a(b.element).off("."+b.constructor.NAME).removeData(b.constructor.DATA_KEY), -b.tip&&a(b.tip).detach(),b.tip=null})}},{key:"show",value:function(){var b=this,c=a.Event(this.constructor.Event.SHOW);if(this.isWithContent()&&this._isEnabled){a(this.element).trigger(c);var e=a.contains(this.element.ownerDocument.documentElement,this.element);if(c.isDefaultPrevented()||!e)return;var f=this.getTipElement(),g=d.getUID(this.constructor.NAME);f.setAttribute("id",g),this.element.setAttribute("aria-describedby",g),this.setContent(),this.config.animation&&a(f).addClass(o.FADE);var i="function"==typeof this.config.placement?this.config.placement.call(this,f,this.element):this.config.placement,k=this._getAttachment(i);a(f).data(this.constructor.DATA_KEY,this).appendTo(document.body),a(this.element).trigger(this.constructor.Event.INSERTED),this._tether=new Tether({element:f,target:this.element,attachment:k,classes:q,classPrefix:j,offset:this.config.offset,constraints:this.config.constraints}),d.reflow(f),this._tether.position(),a(f).addClass(o.IN);var l=function(){var c=b._hoverState;b._hoverState=null,a(b.element).trigger(b.constructor.Event.SHOWN),c===m.OUT&&b._leave(null,b)};d.supportsTransitionEnd()&&a(this.tip).hasClass(o.FADE)?a(this.tip).one(d.TRANSITION_END,l).emulateTransitionEnd(h._TRANSITION_DURATION):l()}}},{key:"hide",value:function(b){var c=this,e=this.getTipElement(),f=a.Event(this.constructor.Event.HIDE),g=function(){c._hoverState!==m.IN&&e.parentNode&&e.parentNode.removeChild(e),c.element.removeAttribute("aria-describedby"),a(c.element).trigger(c.constructor.Event.HIDDEN),c.cleanupTether(),b&&b()};a(this.element).trigger(f),f.isDefaultPrevented()||(a(e).removeClass(o.IN),d.supportsTransitionEnd()&&a(this.tip).hasClass(o.FADE)?a(e).one(d.TRANSITION_END,g).emulateTransitionEnd(i):g(),this._hoverState="")}},{key:"isWithContent",value:function(){return!!this.getTitle()}},{key:"getTipElement",value:function(){return this.tip=this.tip||a(this.config.template)[0]}},{key:"setContent",value:function(){var b=this.getTipElement(),c=this.getTitle(),d=this.config.html?"innerHTML":"innerText";a(b).find(p.TOOLTIP_INNER)[0][d]=c,a(b).removeClass(o.FADE).removeClass(o.IN),this.cleanupTether()}},{key:"getTitle",value:function(){var a=this.element.getAttribute("data-original-title");return a||(a="function"==typeof this.config.title?this.config.title.call(this.element):this.config.title),a}},{key:"cleanupTether",value:function(){this._tether&&(this._tether.destroy(),a(this.element).removeClass(this._removeTetherClasses),a(this.tip).removeClass(this._removeTetherClasses))}},{key:"_getAttachment",value:function(a){return l[a.toUpperCase()]}},{key:"_setListeners",value:function(){var b=this,c=this.config.trigger.split(" ");c.forEach(function(c){if("click"===c)a(b.element).on(b.constructor.Event.CLICK,b.config.selector,a.proxy(b.toggle,b));else if(c!==r.MANUAL){var d=c==r.HOVER?b.constructor.Event.MOUSEENTER:b.constructor.Event.FOCUSIN,e=c==r.HOVER?b.constructor.Event.MOUSELEAVE:b.constructor.Event.FOCUSOUT;a(b.element).on(d,b.config.selector,a.proxy(b._enter,b)).on(e,b.config.selector,a.proxy(b._leave,b))}}),this.config.selector?this.config=a.extend({},this.config,{trigger:"manual",selector:""}):this._fixTitle()}},{key:"_removeTetherClasses",value:function(a,b){return((b.baseVal||b).match(new RegExp("(^|\\s)"+j+"-\\S+","g"))||[]).join(" ")}},{key:"_fixTitle",value:function(){var a=typeof this.element.getAttribute("data-original-title");(this.element.getAttribute("title")||"string"!==a)&&(this.element.setAttribute("data-original-title",this.element.getAttribute("title")||""),this.element.setAttribute("title",""))}},{key:"_enter",value:function(b,c){var d=this.constructor.DATA_KEY;return c=c||a(b.currentTarget).data(d),c||(c=new this.constructor(b.currentTarget,this._getDelegateConfig()),a(b.currentTarget).data(d,c)),b&&(c._activeTrigger["focusin"==b.type?r.FOCUS:r.HOVER]=!0),a(c.getTipElement()).hasClass(o.IN)||c._hoverState===m.IN?void(c._hoverState=m.IN):(clearTimeout(c._timeout),c._hoverState=m.IN,c.config.delay&&c.config.delay.show?void(c._timeout=setTimeout(function(){c._hoverState===m.IN&&c.show()},c.config.delay.show)):void c.show())}},{key:"_leave",value:function(b,c){var d=this.constructor.DATA_KEY;return c=c||a(b.currentTarget).data(d),c||(c=new this.constructor(b.currentTarget,this._getDelegateConfig()),a(b.currentTarget).data(d,c)),b&&(c._activeTrigger["focusout"==b.type?r.FOCUS:r.HOVER]=!1),c._isWithActiveTrigger()?void 0:(clearTimeout(c._timeout),c._hoverState=m.OUT,c.config.delay&&c.config.delay.hide?void(c._timeout=setTimeout(function(){c._hoverState===m.OUT&&c.hide()},c.config.delay.hide)):void c.hide())}},{key:"_isWithActiveTrigger",value:function(){for(var a in this._activeTrigger)if(this._activeTrigger[a])return!0;return!1}},{key:"_getConfig",value:function(b){return b=a.extend({},this.constructor.Default,a(this.element).data(),b),b.delay&&"number"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),b}},{key:"_getDelegateConfig",value:function(){var a={};if(this.config)for(var b in this.config){var c=this.config[b];this.constructor.Default[b]!==c&&(a[b]=c)}return a}}],[{key:"VERSION",get:function(){return f}},{key:"Default",get:function(){return k}},{key:"NAME",get:function(){return e}},{key:"DATA_KEY",get:function(){return g}},{key:"Event",get:function(){return n}},{key:"_jQueryInterface",value:function(b){return this.each(function(){var c=a(this).data(g),d="object"==typeof b?b:null;(c||!/destroy|hide/.test(b))&&(c||(c=new h(this,d),a(this).data(g,c)),"string"==typeof b&&c[b]())})}}]),h}();return a.fn[e]=s._jQueryInterface,a.fn[e].Constructor=s,a.fn[e].noConflict=function(){return a.fn[e]=h,s._jQueryInterface},s}(jQuery));!function(d){var f="popover",g="4.0.0",h="bs.popover",i=d.fn[f],j=d.extend({},e.Default,{placement:"right",trigger:"click",content:"",template:''}),k={FADE:"fade",IN:"in"},l={TITLE:".popover-title",CONTENT:".popover-content",ARROW:".popover-arrow"},m={HIDE:"hide.bs.popover",HIDDEN:"hidden.bs.popover",SHOW:"show.bs.popover",SHOWN:"shown.bs.popover",INSERTED:"inserted.bs.popover",CLICK:"click.bs.popover",FOCUSIN:"focusin.bs.popover",FOCUSOUT:"focusout.bs.popover",MOUSEENTER:"mouseenter.bs.popover",MOUSELEAVE:"mouseleave.bs.popover"},n=function(e){function i(){b(this,i),null!=e&&e.apply(this,arguments)}return a(i,e),c(i,[{key:"isWithContent",value:function(){return this.getTitle()||this._getContent()}},{key:"getTipElement",value:function(){return this.tip=this.tip||d(this.config.template)[0]}},{key:"setContent",value:function(){var a=this.getTipElement(),b=this.getTitle(),c=this._getContent(),e=d(a).find(l.TITLE)[0];e&&(e[this.config.html?"innerHTML":"innerText"]=b),d(a).find(l.CONTENT).children().detach().end()[this.config.html?"string"==typeof c?"html":"append":"text"](c),d(a).removeClass(k.FADE).removeClass(k.IN),this.cleanupTether()}},{key:"_getContent",value:function(){return this.element.getAttribute("data-content")||("function"==typeof this.config.content?this.config.content.call(this.element):this.config.content)}}],[{key:"VERSION",get:function(){return g}},{key:"Default",get:function(){return j}},{key:"NAME",get:function(){return f}},{key:"DATA_KEY",get:function(){return h}},{key:"Event",get:function(){return m}},{key:"_jQueryInterface",value:function(a){return this.each(function(){var b=d(this).data(h),c="object"==typeof a?a:null;(b||!/destroy|hide/.test(a))&&(b||(b=new i(this,c),d(this).data(h,b)),"string"==typeof a&&b[a]())})}}]),i}(e);return d.fn[f]=n._jQueryInterface,d.fn[f].Constructor=n,d.fn[f].noConflict=function(){return d.fn[f]=i,n._jQueryInterface},n}(jQuery)}}(jQuery); \ No newline at end of file +if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){var b=a.fn.jquery.split(" ")[0].split(".");if(b[0]<2&&b[1]<9||1==b[0]&&9==b[1]&&b[2]<1)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher")}(jQuery),+function(){"use strict";function a(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(a.__proto__=b)}function b(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}{var c=function(){function a(a,b){for(var c=0;cthis._items.length-1||0>b)){if(this._isSliding)return void a(this._element).one(n.SLID,function(){return c.to(b)});if(d==b)return this.pause(),void this.cycle();var e=b>d?m.NEXT:m.PREVIOUS;this._slide(e,this._items[b])}}},{key:"dispose",value:function(){a(this._element).off(h),a.removeData(this._element,g),this._items=null,this._config=null,this._element=null,this._interval=null,this._isPaused=null,this._isSliding=null,this._activeElement=null,this._indicatorsElement=null}},{key:"_addEventListeners",value:function(){this._config.keyboard&&a(this._element).on(n.KEYDOWN,a.proxy(this._keydown,this)),"hover"!=this._config.pause||"ontouchstart"in document.documentElement||a(this._element).on(n.MOUSEENTER,a.proxy(this.pause,this)).on(n.MOUSELEAVE,a.proxy(this.cycle,this))}},{key:"_keydown",value:function(a){if(a.preventDefault(),!/input|textarea/i.test(a.target.tagName))switch(a.which){case 37:this.prev();break;case 39:this.next();break;default:return}}},{key:"_getItemIndex",value:function(b){return this._items=a.makeArray(a(b).parent().find(p.ITEM)),this._items.indexOf(b)}},{key:"_getItemByDirection",value:function(a,b){var c=a===m.NEXT,d=a===m.PREVIOUS,e=this._getItemIndex(b),f=this._items.length-1,g=d&&0===e||c&&e==f;if(g&&!this._config.wrap)return b;var h=a==m.PREVIOUS?-1:1,i=(e+h)%this._items.length;return-1===i?this._items[this._items.length-1]:this._items[i]}},{key:"_triggerSlideEvent",value:function(b,c){var d=a.Event(n.SLIDE,{relatedTarget:b,direction:c});return a(this._element).trigger(d),d}},{key:"_setActiveIndicatorElement",value:function(b){if(this._indicatorsElement){a(this._indicatorsElement).find(p.ACTIVE).removeClass(o.ACTIVE);var c=this._indicatorsElement.children[this._getItemIndex(b)];c&&a(c).addClass(o.ACTIVE)}}},{key:"_slide",value:function(b,c){var e=this,f=a(this._element).find(p.ACTIVE_ITEM)[0],g=c||f&&this._getItemByDirection(b,f),h=!!this._interval,i=b==m.NEXT?o.LEFT:o.RIGHT;if(g&&a(g).hasClass(o.ACTIVE))return void(this._isSliding=!1);var j=this._triggerSlideEvent(g,i);if(!j.isDefaultPrevented()&&f&&g){this._isSliding=!0,h&&this.pause(),this._setActiveIndicatorElement(g);var l=a.Event(n.SLID,{relatedTarget:g,direction:i});d.supportsTransitionEnd()&&a(this._element).hasClass(o.SLIDE)?(a(g).addClass(b),d.reflow(g),a(f).addClass(i),a(g).addClass(i),a(f).one(d.TRANSITION_END,function(){a(g).removeClass(i).removeClass(b),a(g).addClass(o.ACTIVE),a(f).removeClass(o.ACTIVE).removeClass(b).removeClass(i),e._isSliding=!1,setTimeout(function(){return a(e._element).trigger(l)},0)}).emulateTransitionEnd(k)):(a(f).removeClass(o.ACTIVE),a(g).addClass(o.ACTIVE),this._isSliding=!1,a(this._element).trigger(l)),h&&this.cycle()}}}],[{key:"VERSION",get:function(){return f}},{key:"Default",get:function(){return l}},{key:"_jQueryInterface",value:function(b){return this.each(function(){var c=a(this).data(g),d=a.extend({},l,a(this).data());"object"==typeof b&&a.extend(d,b);var f="string"==typeof b?b:d.slide;c||(c=new e(this,d),a(this).data(g,c)),"number"==typeof b?c.to(b):f?c[f]():d.interval&&(c.pause(),c.cycle())})}},{key:"_dataApiClickHandler",value:function(b){var c=d.getSelectorFromElement(this);if(c){var f=a(c)[0];if(f&&a(f).hasClass(o.CAROUSEL)){var h=a.extend({},a(f).data(),a(this).data()),i=this.getAttribute("data-slide-to");i&&(h.interval=!1),e._jQueryInterface.call(a(f),h),i&&a(f).data(g).to(i),b.preventDefault()}}}}]),e}();return a(document).on(n.CLICK_DATA_API,p.DATA_SLIDE,q._dataApiClickHandler),a(window).on(n.LOAD_DATA_API,function(){a(p.DATA_RIDE).each(function(){var b=a(this);q._jQueryInterface.call(b,b.data())})}),a.fn[e]=q._jQueryInterface,a.fn[e].Constructor=q,a.fn[e].noConflict=function(){return a.fn[e]=j,q._jQueryInterface},q}(jQuery),function(a){var e="collapse",f="4.0.0",g="bs.collapse",h="."+g,i=".data-api",j=a.fn[e],k=600,l={toggle:!0,parent:null},m={SHOW:"show"+h,SHOWN:"shown"+h,HIDE:"hide"+h,HIDDEN:"hidden"+h,CLICK_DATA_API:"click"+h+i},n={IN:"in",COLLAPSE:"collapse",COLLAPSING:"collapsing",COLLAPSED:"collapsed"},o={WIDTH:"width",HEIGHT:"height"},p={ACTIVES:".panel > .in, .panel > .collapsing",DATA_TOGGLE:'[data-toggle="collapse"]'},q=function(){function e(c,d){b(this,e),this._isTransitioning=!1,this._element=c,this._config=a.extend({},l,d),this._triggerArray=a.makeArray(a('[data-toggle="collapse"][href="#'+c.id+'"],'+('[data-toggle="collapse"][data-target="#'+c.id+'"]'))),this._parent=this._config.parent?this._getParent():null,this._config.parent||this._addAriaAndCollapsedClass(this._element,this._triggerArray),this._config.toggle&&this.toggle()}return c(e,[{key:"toggle",value:function(){a(this._element).hasClass(n.IN)?this.hide():this.show()}},{key:"show",value:function(){var b=this;if(!this._isTransitioning&&!a(this._element).hasClass(n.IN)){var c=void 0,f=void 0;if(this._parent&&(c=a.makeArray(a(p.ACTIVES)),c.length||(c=null)),!(c&&(f=a(c).data(g),f&&f._isTransitioning))){var h=a.Event(m.SHOW);if(a(this._element).trigger(h),!h.isDefaultPrevented()){c&&(e._jQueryInterface.call(a(c),"hide"),f||a(c).data(g,null));var i=this._getDimension();a(this._element).removeClass(n.COLLAPSE).addClass(n.COLLAPSING),this._element.style[i]=0,this._element.setAttribute("aria-expanded",!0),this._triggerArray.length&&a(this._triggerArray).removeClass(n.COLLAPSED).attr("aria-expanded",!0),this.setTransitioning(!0);var j=function(){a(b._element).removeClass(n.COLLAPSING).addClass(n.COLLAPSE).addClass(n.IN),b._element.style[i]="",b.setTransitioning(!1),a(b._element).trigger(m.SHOWN)};if(!d.supportsTransitionEnd())return void j();var l="scroll"+(i[0].toUpperCase()+i.slice(1));a(this._element).one(d.TRANSITION_END,j).emulateTransitionEnd(k),this._element.style[i]=this._element[l]+"px"}}}}},{key:"hide",value:function(){var b=this;if(!this._isTransitioning&&a(this._element).hasClass(n.IN)){var c=a.Event(m.HIDE);if(a(this._element).trigger(c),!c.isDefaultPrevented()){var e=this._getDimension(),f=e===o.WIDTH?"offsetWidth":"offsetHeight";this._element.style[e]=this._element[f]+"px",d.reflow(this._element),a(this._element).addClass(n.COLLAPSING).removeClass(n.COLLAPSE).removeClass(n.IN),this._element.setAttribute("aria-expanded",!1),this._triggerArray.length&&a(this._triggerArray).addClass(n.COLLAPSED).attr("aria-expanded",!1),this.setTransitioning(!0);var g=function(){b.setTransitioning(!1),a(b._element).removeClass(n.COLLAPSING).addClass(n.COLLAPSE).trigger(m.HIDDEN)};return this._element.style[e]=0,d.supportsTransitionEnd()?void a(this._element).one(d.TRANSITION_END,g).emulateTransitionEnd(k):g()}}}},{key:"setTransitioning",value:function(a){this._isTransitioning=a}},{key:"dispose",value:function(){a.removeData(this._element,g),this._config=null,this._parent=null,this._element=null,this._triggerArray=null,this._isTransitioning=null}},{key:"_getDimension",value:function(){var b=a(this._element).hasClass(o.WIDTH);return b?o.WIDTH:o.HEIGHT}},{key:"_getParent",value:function(){var b=this,c=a(this._config.parent)[0],d='[data-toggle="collapse"][data-parent="'+this._config.parent+'"]';return a(c).find(d).each(function(a,c){b._addAriaAndCollapsedClass(e._getTargetFromElement(c),[c])}),c}},{key:"_addAriaAndCollapsedClass",value:function(b,c){if(b){var d=a(b).hasClass(n.IN);b.setAttribute("aria-expanded",d),c.length&&a(c).toggleClass(n.COLLAPSED,!d).attr("aria-expanded",d)}}}],[{key:"VERSION",get:function(){return f}},{key:"Default",get:function(){return l}},{key:"_getTargetFromElement",value:function(b){var c=d.getSelectorFromElement(b);return c?a(c)[0]:null}},{key:"_jQueryInterface",value:function(b){return this.each(function(){var c=a(this),d=c.data(g),f=a.extend({},l,c.data(),"object"==typeof b&&b);!d&&f.toggle&&/show|hide/.test(b)&&(f.toggle=!1),d||(d=new e(this,f),c.data(g,d)),"string"==typeof b&&d[b]()})}}]),e}();return a(document).on(m.CLICK_DATA_API,p.DATA_TOGGLE,function(b){b.preventDefault();var c=q._getTargetFromElement(this),d=a(c).data(g),e=d?"toggle":a(this).data();q._jQueryInterface.call(a(c),e)}),a.fn[e]=q._jQueryInterface,a.fn[e].Constructor=q,a.fn[e].noConflict=function(){return a.fn[e]=j,q._jQueryInterface},q}(jQuery),function(a){var e="dropdown",f="4.0.0",g="bs.dropdown",h="."+g,i=".data-api",j=a.fn[e],k={HIDE:"hide"+h,HIDDEN:"hidden"+h,SHOW:"show"+h,SHOWN:"shown"+h,CLICK:"click"+h,CLICK_DATA_API:"click"+h+i,KEYDOWN_DATA_API:"keydown"+h+i},l={BACKDROP:"dropdown-backdrop",DISABLED:"disabled",OPEN:"open"},m={BACKDROP:".dropdown-backdrop",DATA_TOGGLE:'[data-toggle="dropdown"]',FORM_CHILD:".dropdown form",ROLE_MENU:'[role="menu"]',ROLE_LISTBOX:'[role="listbox"]',NAVBAR_NAV:".navbar-nav",VISIBLE_ITEMS:'[role="menu"] li:not(.disabled) a, [role="listbox"] li:not(.disabled) a'},n=function(){function e(a){b(this,e),this._element=a,this._addEventListeners()}return c(e,[{key:"toggle",value:function(){if(!this.disabled&&!a(this).hasClass(l.DISABLED)){var b=e._getParentFromElement(this),c=a(b).hasClass(l.OPEN);if(e._clearMenus(),c)return!1;if("ontouchstart"in document.documentElement&&!a(b).closest(m.NAVBAR_NAV).length){var d=document.createElement("div");d.className=l.BACKDROP,a(d).insertBefore(this),a(d).on("click",e._clearMenus)}var f={relatedTarget:this},g=a.Event(k.SHOW,f);if(a(b).trigger(g),!g.isDefaultPrevented())return this.focus(),this.setAttribute("aria-expanded","true"),a(b).toggleClass(l.OPEN),a(b).trigger(k.SHOWN,f),!1}}},{key:"dispose",value:function(){a.removeData(this._element,g),a(this._element).off(h),this._element=null}},{key:"_addEventListeners",value:function(){a(this._element).on(k.CLICK,this.toggle)}}],[{key:"VERSION",get:function(){return f}},{key:"_jQueryInterface",value:function(b){return this.each(function(){var c=a(this).data(g);c||a(this).data(g,c=new e(this)),"string"==typeof b&&c[b].call(this)})}},{key:"_clearMenus",value:function(b){if(!b||3!==b.which){var c=a(m.BACKDROP)[0];c&&c.parentNode.removeChild(c);for(var d=a.makeArray(a(m.DATA_TOGGLE)),f=0;f0&&h--,40===b.which&&hdocument.documentElement.clientHeight;!this._isBodyOverflowing&&a&&(this._element.style.paddingLeft=this._scrollbarWidth+"px"),this._isBodyOverflowing&&!a&&(this._element.style.paddingRight=this._scrollbarWidth+"px")}},{key:"_resetAdjustments",value:function(){this._element.style.paddingLeft="",this._element.style.paddingRight=""}},{key:"_checkScrollbar",value:function(){var a=window.innerWidth;if(!a){var b=document.documentElement.getBoundingClientRect();a=b.right-Math.abs(b.left)}this._isBodyOverflowing=document.body.clientWidth a",this._offsets=[],this._targets=[],this._activeTarget=null,this._scrollHeight=0,a(this._scrollElement).on(l.SCROLL,a.proxy(this._process,this)),this.refresh(),this._process()}return c(e,[{key:"refresh",value:function(){var b=this,c="offset",e=0;this._scrollElement!==this._scrollElement.window&&(c="position",e=this._getScrollTop()),this._offsets=[],this._targets=[],this._scrollHeight=this._getScrollHeight();var f=a.makeArray(a(this._selector));f.map(function(b){var f=void 0,g=d.getSelectorFromElement(b);return g&&(f=a(g)[0]),f&&(f.offsetWidth||f.offsetHeight)?[a(f)[c]().top+e,g]:void 0}).filter(function(a){return a}).sort(function(a,b){return a[0]-b[0]}).forEach(function(a){b._offsets.push(a[0]),b._targets.push(a[1])})}},{key:"dispose",value:function(){a.removeData(this._element,g),a(this._scrollElement).off(h),this._element=null,this._scrollElement=null,this._config=null,this._selector=null,this._offsets=null,this._targets=null,this._activeTarget=null,this._scrollHeight=null}},{key:"_getScrollTop",value:function(){return this._scrollElement===window?this._scrollElement.scrollY:this._scrollElement.scrollTop}},{key:"_getScrollHeight",value:function(){return this._scrollElement.scrollHeight||Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)}},{key:"_process",value:function(){var a=this._getScrollTop()+this._config.offset,b=this._getScrollHeight(),c=this._config.offset+b-this._scrollElement.offsetHeight;if(this._scrollHeight!==b&&this.refresh(),a>=c){var d=this._targets[this._targets.length-1];this._activeTarget!==d&&this._activate(d)}if(this._activeTarget&&a=this._offsets[e]&&(void 0===this._offsets[e+1]||a .fade",ACTIVE:".active",ACTIVE_CHILD:"> .active",DATA_TOGGLE:'[data-toggle="tab"], [data-toggle="pill"]',DROPDOWN_ACTIVE_CHILD:"> .dropdown-menu > .active"},o=function(){function e(a){b(this,e),this._element=a}return c(e,[{key:"show",value:function(){var b=this;if(!this._element.parentNode||this._element.parentNode.nodeType!=Node.ELEMENT_NODE||!a(this._element).parent().hasClass(m.ACTIVE)){var c=void 0,e=void 0,f=a(this._element).closest(n.UL)[0],g=d.getSelectorFromElement(this._element);f&&(e=a.makeArray(a(f).find(n.ACTIVE)),e=e[e.length-1],e&&(e=a(e).find(n.A)[0]));var h=a.Event(l.HIDE,{relatedTarget:this._element}),i=a.Event(l.SHOW,{relatedTarget:e});if(e&&a(e).trigger(h),a(this._element).trigger(i),!i.isDefaultPrevented()&&!h.isDefaultPrevented()){g&&(c=a(g)[0]),this._activate(a(this._element).closest(n.LI)[0],f);var j=function(){var c=a.Event(l.HIDDEN,{relatedTarget:b._element}),d=a.Event(l.SHOWN,{relatedTarget:e});a(e).trigger(c),a(b._element).trigger(d)};c?this._activate(c,c.parentNode,j):j()}}}},{key:"dispose",value:function(){a.removeClass(this._element,g),this._element=null}},{key:"_activate",value:function(b,c,e){var f=a(c).find(n.ACTIVE_CHILD)[0],g=e&&d.supportsTransitionEnd()&&(f&&a(f).hasClass(m.FADE)||!!a(c).find(n.FADE_CHILD)[0]),h=a.proxy(this._transitionComplete,this,b,f,g,e);f&&g?a(f).one(d.TRANSITION_END,h).emulateTransitionEnd(k):h(),f&&a(f).removeClass(m.IN)}},{key:"_transitionComplete",value:function(b,c,e,f){if(c){a(c).removeClass(m.ACTIVE);var g=a(c).find(n.DROPDOWN_ACTIVE_CHILD)[0];g&&a(g).removeClass(m.ACTIVE);var h=a(c).find(n.DATA_TOGGLE)[0];h&&h.setAttribute("aria-expanded",!1)}a(b).addClass(m.ACTIVE);var i=a(b).find(n.DATA_TOGGLE)[0];if(i&&i.setAttribute("aria-expanded",!0),e?(d.reflow(b),a(b).addClass(m.IN)):a(b).removeClass(m.FADE),b.parentNode&&a(b.parentNode).hasClass(m.DROPDOWN_MENU)){var j=a(b).closest(n.LI_DROPDOWN)[0];j&&a(j).addClass(m.ACTIVE),i=a(b).find(n.DATA_TOGGLE)[0],i&&i.setAttribute("aria-expanded",!0)}f&&f()}}],[{key:"VERSION",get:function(){return f}},{key:"Default",get:function(){return Default}},{key:"_jQueryInterface",value:function(b){return this.each(function(){var c=a(this),d=c.data(g);d||(d=d=new e(this),c.data(g,d)),"string"==typeof b&&d[b]()})}}]),e}();return a(document).on(l.CLICK_DATA_API,n.DATA_TOGGLE,function(b){b.preventDefault(),o._jQueryInterface.call(a(this),"show")}),a.fn[e]=o._jQueryInterface,a.fn[e].Constructor=o,a.fn[e].noConflict=function(){return a.fn[e]=j,o._jQueryInterface},o}(jQuery),function(a){var e="tooltip",f="4.0.0",g="bs.tooltip",h="."+g,i=a.fn[e],j=150,k="bs-tether",l={animation:!0,template:'', +trigger:"hover focus",title:"",delay:0,html:!1,selector:!1,placement:"top",offset:"0 0",constraints:null},m={TOP:"bottom center",RIGHT:"middle left",BOTTOM:"top center",LEFT:"middle right"},n={IN:"in",OUT:"out"},o={HIDE:"hide"+h,HIDDEN:"hidden"+h,SHOW:"show"+h,SHOWN:"shown"+h,INSERTED:"inserted"+h,CLICK:"click"+h,FOCUSIN:"focusin"+h,FOCUSOUT:"focusout"+h,MOUSEENTER:"mouseenter"+h,MOUSELEAVE:"mouseleave"+h},p={FADE:"fade",IN:"in"},q={TOOLTIP:".tooltip",TOOLTIP_INNER:".tooltip-inner"},r={element:!1,enabled:!1},s={HOVER:"hover",FOCUS:"focus",CLICK:"click",MANUAL:"manual"},t=function(){function i(a,c){b(this,i),this._isEnabled=!0,this._timeout=0,this._hoverState="",this._activeTrigger={},this._tether=null,this.element=a,this.config=this._getConfig(c),this.tip=null,this._setListeners()}return c(i,[{key:"enable",value:function(){this._isEnabled=!0}},{key:"disable",value:function(){this._isEnabled=!1}},{key:"toggleEnabled",value:function(){this._isEnabled=!this._isEnabled}},{key:"toggle",value:function(b){var c=this,d=this.constructor.DATA_KEY;b?(c=a(b.currentTarget).data(d),c||(c=new this.constructor(b.currentTarget,this._getDelegateConfig()),a(b.currentTarget).data(d,c)),c._activeTrigger.click=!c._activeTrigger.click,c._isWithActiveTrigger()?c._enter(null,c):c._leave(null,c)):a(c.getTipElement()).hasClass(p.IN)?c._leave(null,c):c._enter(null,c)}},{key:"dispose",value:function(){clearTimeout(this._timeout),this.cleanupTether(),a.removeData(this.element,this.constructor.DATA_KEY),a(this.element).off(this.constructor.EVENT_KEY),this.tip&&a(this.tip).remove(),this._isEnabled=null,this._timeout=null,this._hoverState=null,this._activeTrigger=null,this._tether=null,this.element=null,this.config=null,this.tip=null}},{key:"show",value:function(){var b=this,c=a.Event(this.constructor.Event.SHOW);if(this.isWithContent()&&this._isEnabled){a(this.element).trigger(c);var e=a.contains(this.element.ownerDocument.documentElement,this.element);if(c.isDefaultPrevented()||!e)return;var f=this.getTipElement(),g=d.getUID(this.constructor.NAME);f.setAttribute("id",g),this.element.setAttribute("aria-describedby",g),this.setContent(),this.config.animation&&a(f).addClass(p.FADE);var h="function"==typeof this.config.placement?this.config.placement.call(this,f,this.element):this.config.placement,j=this._getAttachment(h);a(f).data(this.constructor.DATA_KEY,this).appendTo(document.body),a(this.element).trigger(this.constructor.Event.INSERTED),this._tether=new Tether({element:f,target:this.element,attachment:j,classes:r,classPrefix:k,offset:this.config.offset,constraints:this.config.constraints}),d.reflow(f),this._tether.position(),a(f).addClass(p.IN);var l=function(){var c=b._hoverState;b._hoverState=null,a(b.element).trigger(b.constructor.Event.SHOWN),c===n.OUT&&b._leave(null,b)};d.supportsTransitionEnd()&&a(this.tip).hasClass(p.FADE)?a(this.tip).one(d.TRANSITION_END,l).emulateTransitionEnd(i._TRANSITION_DURATION):l()}}},{key:"hide",value:function(b){var c=this,e=this.getTipElement(),f=a.Event(this.constructor.Event.HIDE),g=function(){c._hoverState!==n.IN&&e.parentNode&&e.parentNode.removeChild(e),c.element.removeAttribute("aria-describedby"),a(c.element).trigger(c.constructor.Event.HIDDEN),c.cleanupTether(),b&&b()};a(this.element).trigger(f),f.isDefaultPrevented()||(a(e).removeClass(p.IN),d.supportsTransitionEnd()&&a(this.tip).hasClass(p.FADE)?a(e).one(d.TRANSITION_END,g).emulateTransitionEnd(j):g(),this._hoverState="")}},{key:"isWithContent",value:function(){return!!this.getTitle()}},{key:"getTipElement",value:function(){return this.tip=this.tip||a(this.config.template)[0]}},{key:"setContent",value:function(){var b=this.getTipElement(),c=this.getTitle(),d=this.config.html?"innerHTML":"innerText";a(b).find(q.TOOLTIP_INNER)[0][d]=c,a(b).removeClass(p.FADE).removeClass(p.IN),this.cleanupTether()}},{key:"getTitle",value:function(){var a=this.element.getAttribute("data-original-title");return a||(a="function"==typeof this.config.title?this.config.title.call(this.element):this.config.title),a}},{key:"cleanupTether",value:function(){this._tether&&(this._tether.destroy(),a(this.element).removeClass(this._removeTetherClasses),a(this.tip).removeClass(this._removeTetherClasses))}},{key:"_getAttachment",value:function(a){return m[a.toUpperCase()]}},{key:"_setListeners",value:function(){var b=this,c=this.config.trigger.split(" ");c.forEach(function(c){if("click"===c)a(b.element).on(b.constructor.Event.CLICK,b.config.selector,a.proxy(b.toggle,b));else if(c!==s.MANUAL){var d=c==s.HOVER?b.constructor.Event.MOUSEENTER:b.constructor.Event.FOCUSIN,e=c==s.HOVER?b.constructor.Event.MOUSELEAVE:b.constructor.Event.FOCUSOUT;a(b.element).on(d,b.config.selector,a.proxy(b._enter,b)).on(e,b.config.selector,a.proxy(b._leave,b))}}),this.config.selector?this.config=a.extend({},this.config,{trigger:"manual",selector:""}):this._fixTitle()}},{key:"_removeTetherClasses",value:function(a,b){return((b.baseVal||b).match(new RegExp("(^|\\s)"+k+"-\\S+","g"))||[]).join(" ")}},{key:"_fixTitle",value:function(){var a=typeof this.element.getAttribute("data-original-title");(this.element.getAttribute("title")||"string"!==a)&&(this.element.setAttribute("data-original-title",this.element.getAttribute("title")||""),this.element.setAttribute("title",""))}},{key:"_enter",value:function(b,c){var d=this.constructor.DATA_KEY;return c=c||a(b.currentTarget).data(d),c||(c=new this.constructor(b.currentTarget,this._getDelegateConfig()),a(b.currentTarget).data(d,c)),b&&(c._activeTrigger["focusin"==b.type?s.FOCUS:s.HOVER]=!0),a(c.getTipElement()).hasClass(p.IN)||c._hoverState===n.IN?void(c._hoverState=n.IN):(clearTimeout(c._timeout),c._hoverState=n.IN,c.config.delay&&c.config.delay.show?void(c._timeout=setTimeout(function(){c._hoverState===n.IN&&c.show()},c.config.delay.show)):void c.show())}},{key:"_leave",value:function(b,c){var d=this.constructor.DATA_KEY;return c=c||a(b.currentTarget).data(d),c||(c=new this.constructor(b.currentTarget,this._getDelegateConfig()),a(b.currentTarget).data(d,c)),b&&(c._activeTrigger["focusout"==b.type?s.FOCUS:s.HOVER]=!1),c._isWithActiveTrigger()?void 0:(clearTimeout(c._timeout),c._hoverState=n.OUT,c.config.delay&&c.config.delay.hide?void(c._timeout=setTimeout(function(){c._hoverState===n.OUT&&c.hide()},c.config.delay.hide)):void c.hide())}},{key:"_isWithActiveTrigger",value:function(){for(var a in this._activeTrigger)if(this._activeTrigger[a])return!0;return!1}},{key:"_getConfig",value:function(b){return b=a.extend({},this.constructor.Default,a(this.element).data(),b),b.delay&&"number"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),b}},{key:"_getDelegateConfig",value:function(){var a={};if(this.config)for(var b in this.config){var c=this.config[b];this.constructor.Default[b]!==c&&(a[b]=c)}return a}}],[{key:"VERSION",get:function(){return f}},{key:"Default",get:function(){return l}},{key:"NAME",get:function(){return e}},{key:"DATA_KEY",get:function(){return g}},{key:"Event",get:function(){return o}},{key:"EVENT_KEY",get:function(){return h}},{key:"_jQueryInterface",value:function(b){return this.each(function(){var c=a(this).data(g),d="object"==typeof b?b:null;(c||!/destroy|hide/.test(b))&&(c||(c=new i(this,d),a(this).data(g,c)),"string"==typeof b&&c[b]())})}}]),i}();return a.fn[e]=t._jQueryInterface,a.fn[e].Constructor=t,a.fn[e].noConflict=function(){return a.fn[e]=i,t._jQueryInterface},t}(jQuery));!function(d){var f="popover",g="4.0.0",h="bs.popover",i="."+h,j=d.fn[f],k=d.extend({},e.Default,{placement:"right",trigger:"click",content:"",template:''}),l={FADE:"fade",IN:"in"},m={TITLE:".popover-title",CONTENT:".popover-content",ARROW:".popover-arrow"},n={HIDE:"hide"+i,HIDDEN:"hidden"+i,SHOW:"show"+i,SHOWN:"shown"+i,INSERTED:"inserted"+i,CLICK:"click"+i,FOCUSIN:"focusin"+i,FOCUSOUT:"focusout"+i,MOUSEENTER:"mouseenter"+i,MOUSELEAVE:"mouseleave"+i},o=function(e){function j(){b(this,j),null!=e&&e.apply(this,arguments)}return a(j,e),c(j,[{key:"isWithContent",value:function(){return this.getTitle()||this._getContent()}},{key:"getTipElement",value:function(){return this.tip=this.tip||d(this.config.template)[0]}},{key:"setContent",value:function(){var a=this.getTipElement(),b=this.getTitle(),c=this._getContent(),e=d(a).find(m.TITLE)[0];e&&(e[this.config.html?"innerHTML":"innerText"]=b),d(a).find(m.CONTENT).children().detach().end()[this.config.html?"string"==typeof c?"html":"append":"text"](c),d(a).removeClass(l.FADE).removeClass(l.IN),this.cleanupTether()}},{key:"_getContent",value:function(){return this.element.getAttribute("data-content")||("function"==typeof this.config.content?this.config.content.call(this.element):this.config.content)}}],[{key:"VERSION",get:function(){return g}},{key:"Default",get:function(){return k}},{key:"NAME",get:function(){return f}},{key:"DATA_KEY",get:function(){return h}},{key:"Event",get:function(){return n}},{key:"EVENT_KEY",get:function(){return i}},{key:"_jQueryInterface",value:function(a){return this.each(function(){var b=d(this).data(h),c="object"==typeof a?a:null;(b||!/destroy|hide/.test(a))&&(b||(b=new j(this,c),d(this).data(h,b)),"string"==typeof a&&b[a]())})}}]),j}(e);return d.fn[f]=o._jQueryInterface,d.fn[f].Constructor=o,d.fn[f].noConflict=function(){return d.fn[f]=j,o._jQueryInterface},o}(jQuery)}}(jQuery); \ No newline at end of file diff --git a/dist/js/umd/alert.js b/dist/js/umd/alert.js index 1d01fb7a3..eae17ceb6 100644 --- a/dist/js/umd/alert.js +++ b/dist/js/umd/alert.js @@ -39,6 +39,8 @@ var NAME = 'alert'; var VERSION = '4.0.0'; var DATA_KEY = 'bs.alert'; + var EVENT_KEY = '.' + DATA_KEY; + var DATA_API_KEY = '.data-api'; var JQUERY_NO_CONFLICT = $.fn[NAME]; var TRANSITION_DURATION = 150; @@ -47,9 +49,9 @@ }; var Event = { - CLOSE: 'close.bs.alert', - CLOSED: 'closed.bs.alert', - CLICK: 'click.bs.alert.data-api' + CLOSE: 'close' + EVENT_KEY, + CLOSED: 'closed' + EVENT_KEY, + CLICK_DATA_API: 'click' + EVENT_KEY + '' + DATA_API_KEY }; var ClassName = { @@ -88,6 +90,12 @@ this._removeElement(rootElement); } + }, { + key: 'dispose', + value: function dispose() { + $.removeData(this._element, DATA_KEY); + this._element = null; + } }, { key: '_getRootElement', @@ -181,7 +189,7 @@ * ------------------------------------------------------------------------ */ - $(document).on(Event.CLICK, Selector.DISMISS, Alert._handleDismiss(new Alert())); + $(document).on(Event.CLICK_DATA_API, Selector.DISMISS, Alert._handleDismiss(new Alert())); /** * ------------------------------------------------------------------------ diff --git a/dist/js/umd/button.js b/dist/js/umd/button.js index 7449af2c9..730b3ef01 100644 --- a/dist/js/umd/button.js +++ b/dist/js/umd/button.js @@ -35,6 +35,8 @@ var NAME = 'button'; var VERSION = '4.0.0'; var DATA_KEY = 'bs.button'; + var EVENT_KEY = '.' + DATA_KEY; + var DATA_API_KEY = '.data-api'; var JQUERY_NO_CONFLICT = $.fn[NAME]; var TRANSITION_DURATION = 150; @@ -53,8 +55,8 @@ }; var Event = { - CLICK: 'click.bs.button.data-api', - FOCUS_BLUR: 'focus.bs.button.data-api blur.bs.button.data-api' + CLICK_DATA_API: 'click' + EVENT_KEY + '' + DATA_API_KEY, + FOCUS_BLUR_DATA_API: 'focus' + EVENT_KEY + '' + DATA_API_KEY + ' ' + ('blur' + EVENT_KEY + '' + DATA_API_KEY) }; /** @@ -108,6 +110,12 @@ $(this._element).toggleClass(ClassName.ACTIVE); } } + }, { + key: 'dispose', + value: function dispose() { + $.removeData(this._element, DATA_KEY); + this._element = null; + } }], [{ key: 'VERSION', @@ -146,7 +154,7 @@ * ------------------------------------------------------------------------ */ - $(document).on(Event.CLICK, Selector.DATA_TOGGLE_CARROT, function (event) { + $(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE_CARROT, function (event) { event.preventDefault(); var button = event.target; @@ -156,7 +164,7 @@ } Button._jQueryInterface.call($(button), 'toggle'); - }).on(Event.FOCUS_BLUR, Selector.DATA_TOGGLE_CARROT, function (event) { + }).on(Event.FOCUS_BLUR_DATA_API, Selector.DATA_TOGGLE_CARROT, function (event) { var button = $(event.target).closest(Selector.BUTTON)[0]; $(button).toggleClass(ClassName.FOCUS, /^focus(in)?$/.test(event.type)); }); diff --git a/dist/js/umd/carousel.js b/dist/js/umd/carousel.js index 0e5b34142..a2faa92f0 100644 --- a/dist/js/umd/carousel.js +++ b/dist/js/umd/carousel.js @@ -39,6 +39,8 @@ var NAME = 'carousel'; var VERSION = '4.0.0'; var DATA_KEY = 'bs.carousel'; + var EVENT_KEY = '.' + DATA_KEY; + var DATA_API_KEY = '.data-api'; var JQUERY_NO_CONFLICT = $.fn[NAME]; var TRANSITION_DURATION = 600; @@ -56,10 +58,13 @@ }; var Event = { - SLIDE: 'slide.bs.carousel', - SLID: 'slid.bs.carousel', - CLICK: 'click.bs.carousel.data-api', - LOAD: 'load' + SLIDE: 'slide' + EVENT_KEY, + SLID: 'slid' + EVENT_KEY, + KEYDOWN: 'keydown' + EVENT_KEY, + MOUSEENTER: 'mouseenter' + EVENT_KEY, + MOUSELEAVE: 'mouseleave' + EVENT_KEY, + LOAD_DATA_API: 'load' + EVENT_KEY + '' + DATA_API_KEY, + CLICK_DATA_API: 'click' + EVENT_KEY + '' + DATA_API_KEY }; var ClassName = { @@ -183,6 +188,21 @@ this._slide(direction, this._items[index]); } + }, { + key: 'dispose', + value: function dispose() { + $(this._element).off(EVENT_KEY); + $.removeData(this._element, DATA_KEY); + + this._items = null; + this._config = null; + this._element = null; + this._interval = null; + this._isPaused = null; + this._isSliding = null; + this._activeElement = null; + this._indicatorsElement = null; + } }, { key: '_addEventListeners', @@ -190,11 +210,11 @@ value: function _addEventListeners() { if (this._config.keyboard) { - $(this._element).on('keydown.bs.carousel', $.proxy(this._keydown, this)); + $(this._element).on(Event.KEYDOWN, $.proxy(this._keydown, this)); } if (this._config.pause == 'hover' && !('ontouchstart' in document.documentElement)) { - $(this._element).on('mouseenter.bs.carousel', $.proxy(this.pause, this)).on('mouseleave.bs.carousel', $.proxy(this.cycle, this)); + $(this._element).on(Event.MOUSEENTER, $.proxy(this.pause, this)).on(Event.MOUSELEAVE, $.proxy(this.cycle, this)); } } }, { @@ -421,9 +441,9 @@ * ------------------------------------------------------------------------ */ - $(document).on(Event.CLICK, Selector.DATA_SLIDE, Carousel._dataApiClickHandler); + $(document).on(Event.CLICK_DATA_API, Selector.DATA_SLIDE, Carousel._dataApiClickHandler); - $(window).on(Event.LOAD, function () { + $(window).on(Event.LOAD_DATA_API, function () { $(Selector.DATA_RIDE).each(function () { var $carousel = $(this); Carousel._jQueryInterface.call($carousel, $carousel.data()); diff --git a/dist/js/umd/collapse.js b/dist/js/umd/collapse.js index 5a931a9b4..23784388e 100644 --- a/dist/js/umd/collapse.js +++ b/dist/js/umd/collapse.js @@ -39,6 +39,8 @@ var NAME = 'collapse'; var VERSION = '4.0.0'; var DATA_KEY = 'bs.collapse'; + var EVENT_KEY = '.' + DATA_KEY; + var DATA_API_KEY = '.data-api'; var JQUERY_NO_CONFLICT = $.fn[NAME]; var TRANSITION_DURATION = 600; @@ -48,11 +50,11 @@ }; var Event = { - SHOW: 'show.bs.collapse', - SHOWN: 'shown.bs.collapse', - HIDE: 'hide.bs.collapse', - HIDDEN: 'hidden.bs.collapse', - CLICK: 'click.bs.collapse.data-api' + SHOW: 'show' + EVENT_KEY, + SHOWN: 'shown' + EVENT_KEY, + HIDE: 'hide' + EVENT_KEY, + HIDDEN: 'hidden' + EVENT_KEY, + CLICK_DATA_API: 'click' + EVENT_KEY + '' + DATA_API_KEY }; var ClassName = { @@ -119,8 +121,8 @@ return; } - var activesData = undefined; var actives = undefined; + var activesData = undefined; if (this._parent) { actives = $.makeArray($(Selector.ACTIVES)); @@ -233,6 +235,17 @@ value: function setTransitioning(isTransitioning) { this._isTransitioning = isTransitioning; } + }, { + key: 'dispose', + value: function dispose() { + $.removeData(this._element, DATA_KEY); + + this._config = null; + this._parent = null; + this._element = null; + this._triggerArray = null; + this._isTransitioning = null; + } }, { key: '_getDimension', @@ -323,7 +336,7 @@ * ------------------------------------------------------------------------ */ - $(document).on(Event.CLICK, Selector.DATA_TOGGLE, function (event) { + $(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) { event.preventDefault(); var target = Collapse._getTargetFromElement(this); diff --git a/dist/js/umd/dropdown.js b/dist/js/umd/dropdown.js index 05cbe99a9..86ac7500d 100644 --- a/dist/js/umd/dropdown.js +++ b/dist/js/umd/dropdown.js @@ -39,16 +39,18 @@ var NAME = 'dropdown'; var VERSION = '4.0.0'; var DATA_KEY = 'bs.dropdown'; + var EVENT_KEY = '.' + DATA_KEY; + var DATA_API_KEY = '.data-api'; var JQUERY_NO_CONFLICT = $.fn[NAME]; var Event = { - HIDE: 'hide.bs.dropdown', - HIDDEN: 'hidden.bs.dropdown', - SHOW: 'show.bs.dropdown', - SHOWN: 'shown.bs.dropdown', - CLICK: 'click.bs.dropdown', - KEYDOWN: 'keydown.bs.dropdown.data-api', - CLICK_DATA: 'click.bs.dropdown.data-api' + HIDE: 'hide' + EVENT_KEY, + HIDDEN: 'hidden' + EVENT_KEY, + SHOW: 'show' + EVENT_KEY, + SHOWN: 'shown' + EVENT_KEY, + CLICK: 'click' + EVENT_KEY, + CLICK_DATA_API: 'click' + EVENT_KEY + '' + DATA_API_KEY, + KEYDOWN_DATA_API: 'keydown' + EVENT_KEY + '' + DATA_API_KEY }; var ClassName = { @@ -77,7 +79,9 @@ function Dropdown(element) { _classCallCheck(this, Dropdown); - $(element).on(Event.CLICK, this.toggle); + this._element = element; + + this._addEventListeners(); } _createClass(Dropdown, [{ @@ -125,6 +129,21 @@ return false; } + }, { + key: 'dispose', + value: function dispose() { + $.removeData(this._element, DATA_KEY); + $(this._element).off(EVENT_KEY); + this._element = null; + } + }, { + key: '_addEventListeners', + + // private + + value: function _addEventListeners() { + $(this._element).on(Event.CLICK, this.toggle); + } }], [{ key: 'VERSION', @@ -257,7 +276,7 @@ * ------------------------------------------------------------------------ */ - $(document).on(Event.KEYDOWN, Selector.DATA_TOGGLE, Dropdown._dataApiKeydownHandler).on(Event.KEYDOWN, Selector.ROLE_MENU, Dropdown._dataApiKeydownHandler).on(Event.KEYDOWN, Selector.ROLE_LISTBOX, Dropdown._dataApiKeydownHandler).on(Event.CLICK_DATA, Dropdown._clearMenus).on(Event.CLICK_DATA, Selector.DATA_TOGGLE, Dropdown.prototype.toggle).on(Event.CLICK_DATA, Selector.FORM_CHILD, function (e) { + $(document).on(Event.KEYDOWN_DATA_API, Selector.DATA_TOGGLE, Dropdown._dataApiKeydownHandler).on(Event.KEYDOWN_DATA_API, Selector.ROLE_MENU, Dropdown._dataApiKeydownHandler).on(Event.KEYDOWN_DATA_API, Selector.ROLE_LISTBOX, Dropdown._dataApiKeydownHandler).on(Event.CLICK_DATA_API, Dropdown._clearMenus).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, Dropdown.prototype.toggle).on(Event.CLICK_DATA_API, Selector.FORM_CHILD, function (e) { e.stopPropagation(); }); diff --git a/dist/js/umd/modal.js b/dist/js/umd/modal.js index 440985577..ca518198c 100644 --- a/dist/js/umd/modal.js +++ b/dist/js/umd/modal.js @@ -39,6 +39,8 @@ var NAME = 'modal'; var VERSION = '4.0.0'; var DATA_KEY = 'bs.modal'; + var EVENT_KEY = '.' + DATA_KEY; + var DATA_API_KEY = '.data-api'; var JQUERY_NO_CONFLICT = $.fn[NAME]; var TRANSITION_DURATION = 300; var BACKDROP_TRANSITION_DURATION = 150; @@ -50,17 +52,17 @@ }; var Event = { - HIDE: 'hide.bs.modal', - HIDDEN: 'hidden.bs.modal', - SHOW: 'show.bs.modal', - SHOWN: 'shown.bs.modal', - DISMISS: 'click.dismiss.bs.modal', - KEYDOWN: 'keydown.dismiss.bs.modal', - FOCUSIN: 'focusin.bs.modal', - RESIZE: 'resize.bs.modal', - CLICK: 'click.bs.modal.data-api', - MOUSEDOWN: 'mousedown.dismiss.bs.modal', - MOUSEUP: 'mouseup.dismiss.bs.modal' + HIDE: 'hide' + EVENT_KEY, + HIDDEN: 'hidden' + EVENT_KEY, + SHOW: 'show' + EVENT_KEY, + SHOWN: 'shown' + EVENT_KEY, + FOCUSIN: 'focusin' + EVENT_KEY, + RESIZE: 'resize' + EVENT_KEY, + CLICK_DISMISS: 'click.dismiss' + EVENT_KEY, + KEYDOWN_DISMISS: 'keydown.dismiss' + EVENT_KEY, + MOUSEUP_DISMISS: 'mouseup.dismiss' + EVENT_KEY, + MOUSEDOWN_DISMISS: 'mousedown.dismiss' + EVENT_KEY, + CLICK_DATA_API: 'click' + EVENT_KEY + '' + DATA_API_KEY }; var ClassName = { @@ -131,10 +133,10 @@ this._setEscapeEvent(); this._setResizeEvent(); - $(this._element).on(Event.DISMISS, Selector.DATA_DISMISS, $.proxy(this.hide, this)); + $(this._element).on(Event.CLICK_DISMISS, Selector.DATA_DISMISS, $.proxy(this.hide, this)); - $(this._dialog).on(Event.MOUSEDOWN, function () { - $(_this._element).one(Event.MOUSEUP, function (event) { + $(this._dialog).on(Event.MOUSEDOWN_DISMISS, function () { + $(_this._element).one(Event.MOUSEUP_DISMISS, function (event) { if ($(event.target).is(_this._element)) { that._ignoreBackdropClick = true; } @@ -167,8 +169,8 @@ $(this._element).removeClass(ClassName.IN); - $(this._element).off(Event.DISMISS); - $(this._dialog).off(Event.MOUSEDOWN); + $(this._element).off(Event.CLICK_DISMISS); + $(this._dialog).off(Event.MOUSEDOWN_DISMISS); if (_Util.supportsTransitionEnd() && $(this._element).hasClass(ClassName.FADE)) { @@ -177,6 +179,26 @@ this._hideModal(); } } + }, { + key: 'dispose', + value: function dispose() { + $.removeData(this._element, DATA_KEY); + + $(window).off(EVENT_KEY); + $(document).off(EVENT_KEY); + $(this._element).off(EVENT_KEY); + $(this._backdrop).off(EVENT_KEY); + + this._config = null; + this._element = null; + this._dialog = null; + this._backdrop = null; + this._isShown = null; + this._isBodyOverflowing = null; + this._ignoreBackdropClick = null; + this._originalBodyPadding = null; + this._scrollbarWidth = null; + } }, { key: '_showElement', @@ -236,13 +258,13 @@ var _this4 = this; if (this._isShown && this._config.keyboard) { - $(this._element).on(Event.KEYDOWN, function (event) { + $(this._element).on(Event.KEYDOWN_DISMISS, function (event) { if (event.which === 27) { _this4.hide(); } }); } else if (!this._isShown) { - $(this._element).off(Event.KEYDOWN); + $(this._element).off(Event.KEYDOWN_DISMISS); } } }, { @@ -294,7 +316,7 @@ $(this._backdrop).appendTo(this.$body); - $(this._element).on(Event.DISMISS, function (event) { + $(this._element).on(Event.CLICK_DISMISS, function (event) { if (_this6._ignoreBackdropClick) { _this6._ignoreBackdropClick = false; return; @@ -459,7 +481,7 @@ * ------------------------------------------------------------------------ */ - $(document).on(Event.CLICK, Selector.DATA_TOGGLE, function (event) { + $(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) { var _this7 = this; var target = undefined; diff --git a/dist/js/umd/popover.js b/dist/js/umd/popover.js index f13371b87..fa03c8229 100644 --- a/dist/js/umd/popover.js +++ b/dist/js/umd/popover.js @@ -41,6 +41,7 @@ var NAME = 'popover'; var VERSION = '4.0.0'; var DATA_KEY = 'bs.popover'; + var EVENT_KEY = '.' + DATA_KEY; var JQUERY_NO_CONFLICT = $.fn[NAME]; var Default = $.extend({}, _Tooltip2.Default, { @@ -62,16 +63,16 @@ }; var Event = { - HIDE: 'hide.bs.popover', - HIDDEN: 'hidden.bs.popover', - SHOW: 'show.bs.popover', - SHOWN: 'shown.bs.popover', - INSERTED: 'inserted.bs.popover', - CLICK: 'click.bs.popover', - FOCUSIN: 'focusin.bs.popover', - FOCUSOUT: 'focusout.bs.popover', - MOUSEENTER: 'mouseenter.bs.popover', - MOUSELEAVE: 'mouseleave.bs.popover' + HIDE: 'hide' + EVENT_KEY, + HIDDEN: 'hidden' + EVENT_KEY, + SHOW: 'show' + EVENT_KEY, + SHOWN: 'shown' + EVENT_KEY, + INSERTED: 'inserted' + EVENT_KEY, + CLICK: 'click' + EVENT_KEY, + FOCUSIN: 'focusin' + EVENT_KEY, + FOCUSOUT: 'focusout' + EVENT_KEY, + MOUSEENTER: 'mouseenter' + EVENT_KEY, + MOUSELEAVE: 'mouseleave' + EVENT_KEY }; /** @@ -159,6 +160,11 @@ get: function () { return Event; } + }, { + key: 'EVENT_KEY', + get: function () { + return EVENT_KEY; + } }, { key: '_jQueryInterface', diff --git a/dist/js/umd/scrollspy.js b/dist/js/umd/scrollspy.js index 63cbae574..d83153caa 100644 --- a/dist/js/umd/scrollspy.js +++ b/dist/js/umd/scrollspy.js @@ -39,6 +39,8 @@ var NAME = 'scrollspy'; var VERSION = '4.0.0'; var DATA_KEY = 'bs.scrollspy'; + var EVENT_KEY = '.' + DATA_KEY; + var DATA_API_KEY = '.data-api'; var JQUERY_NO_CONFLICT = $.fn[NAME]; var Default = { @@ -46,9 +48,9 @@ }; var Event = { - ACTIVATE: 'activate.bs.scrollspy', - SCROLL: 'scroll.bs.scrollspy', - LOAD: 'load.bs.scrollspy.data-api' + ACTIVATE: 'activate' + EVENT_KEY, + SCROLL: 'scroll' + EVENT_KEY, + LOAD_DATA_API: 'load' + EVENT_KEY + '' + DATA_API_KEY }; var ClassName = { @@ -73,6 +75,7 @@ function ScrollSpy(element, config) { _classCallCheck(this, ScrollSpy); + this._element = element; this._scrollElement = element.tagName === 'BODY' ? window : element; this._config = $.extend({}, Default, config); this._selector = '' + (this._config.target || '') + ' .nav li > a'; @@ -131,6 +134,21 @@ _this._targets.push(item[1]); }); } + }, { + key: 'dispose', + value: function dispose() { + $.removeData(this._element, DATA_KEY); + $(this._scrollElement).off(EVENT_KEY); + + this._element = null; + this._scrollElement = null; + this._config = null; + this._selector = null; + this._offsets = null; + this._targets = null; + this._activeTarget = null; + this._scrollHeight = null; + } }, { key: '_getScrollTop', @@ -257,7 +275,7 @@ * ------------------------------------------------------------------------ */ - $(window).on(Event.LOAD, function () { + $(window).on(Event.LOAD_DATA_API, function () { var scrollSpys = $.makeArray($(Selector.DATA_SPY)); for (var i = scrollSpys.length; i--;) { diff --git a/dist/js/umd/tab.js b/dist/js/umd/tab.js index fe51b131c..fc1a54693 100644 --- a/dist/js/umd/tab.js +++ b/dist/js/umd/tab.js @@ -39,15 +39,17 @@ var NAME = 'tab'; var VERSION = '4.0.0'; var DATA_KEY = 'bs.tab'; + var EVENT_KEY = '.' + DATA_KEY; + var DATA_API_KEY = '.data-api'; var JQUERY_NO_CONFLICT = $.fn[NAME]; var TRANSITION_DURATION = 150; var Event = { - HIDE: 'hide.bs.tab', - HIDDEN: 'hidden.bs.tab', - SHOW: 'show.bs.tab', - SHOWN: 'shown.bs.tab', - CLICK: 'click.bs.tab.data-api' + HIDE: 'hide' + EVENT_KEY, + HIDDEN: 'hidden' + EVENT_KEY, + SHOW: 'show' + EVENT_KEY, + SHOWN: 'shown' + EVENT_KEY, + CLICK_DATA_API: 'click' + EVENT_KEY + '' + DATA_API_KEY }; var ClassName = { @@ -151,6 +153,12 @@ complete(); } } + }, { + key: 'dispose', + value: function dispose() { + $.removeClass(this._element, DATA_KEY); + this._element = null; + } }, { key: '_activate', @@ -264,7 +272,7 @@ * ------------------------------------------------------------------------ */ - $(document).on(Event.CLICK, Selector.DATA_TOGGLE, function (event) { + $(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) { event.preventDefault(); Tab._jQueryInterface.call($(this), 'show'); }); diff --git a/dist/js/umd/tooltip.js b/dist/js/umd/tooltip.js index 9c57b0d8f..a2c692ecc 100644 --- a/dist/js/umd/tooltip.js +++ b/dist/js/umd/tooltip.js @@ -39,6 +39,7 @@ var NAME = 'tooltip'; var VERSION = '4.0.0'; var DATA_KEY = 'bs.tooltip'; + var EVENT_KEY = '.' + DATA_KEY; var JQUERY_NO_CONFLICT = $.fn[NAME]; var TRANSITION_DURATION = 150; var CLASS_PREFIX = 'bs-tether'; @@ -69,16 +70,16 @@ }; var Event = { - HIDE: 'hide.bs.tooltip', - HIDDEN: 'hidden.bs.tooltip', - SHOW: 'show.bs.tooltip', - SHOWN: 'shown.bs.tooltip', - INSERTED: 'inserted.bs.tooltip', - CLICK: 'click.bs.tooltip', - FOCUSIN: 'focusin.bs.tooltip', - FOCUSOUT: 'focusout.bs.tooltip', - MOUSEENTER: 'mouseenter.bs.tooltip', - MOUSELEAVE: 'mouseleave.bs.tooltip' + HIDE: 'hide' + EVENT_KEY, + HIDDEN: 'hidden' + EVENT_KEY, + SHOW: 'show' + EVENT_KEY, + SHOWN: 'shown' + EVENT_KEY, + INSERTED: 'inserted' + EVENT_KEY, + CLICK: 'click' + EVENT_KEY, + FOCUSIN: 'focusin' + EVENT_KEY, + FOCUSOUT: 'focusout' + EVENT_KEY, + MOUSEENTER: 'mouseenter' + EVENT_KEY, + MOUSELEAVE: 'mouseleave' + EVENT_KEY }; var ClassName = { @@ -172,25 +173,34 @@ } } }, { - key: 'destroy', - value: function destroy() { - var _this = this; - + key: 'dispose', + value: function dispose() { clearTimeout(this._timeout); - this.hide(function () { - $(_this.element).off('.' + _this.constructor.NAME).removeData(_this.constructor.DATA_KEY); - if (_this.tip) { - $(_this.tip).detach(); - } + this.cleanupTether(); - _this.tip = null; - }); + $.removeData(this.element, this.constructor.DATA_KEY); + + $(this.element).off(this.constructor.EVENT_KEY); + + if (this.tip) { + $(this.tip).remove(); + } + + this._isEnabled = null; + this._timeout = null; + this._hoverState = null; + this._activeTrigger = null; + this._tether = null; + + this.element = null; + this.config = null; + this.tip = null; } }, { key: 'show', value: function show() { - var _this2 = this; + var _this = this; var showEvent = $.Event(this.constructor.Event.SHOW); @@ -239,13 +249,13 @@ $(tip).addClass(ClassName.IN); var complete = function complete() { - var prevHoverState = _this2._hoverState; - _this2._hoverState = null; + var prevHoverState = _this._hoverState; + _this._hoverState = null; - $(_this2.element).trigger(_this2.constructor.Event.SHOWN); + $(_this.element).trigger(_this.constructor.Event.SHOWN); if (prevHoverState === HoverState.OUT) { - _this2._leave(null, _this2); + _this._leave(null, _this); } }; @@ -255,18 +265,18 @@ }, { key: 'hide', value: function hide(callback) { - var _this3 = this; + var _this2 = this; var tip = this.getTipElement(); var hideEvent = $.Event(this.constructor.Event.HIDE); var complete = function complete() { - if (_this3._hoverState !== HoverState.IN && tip.parentNode) { + if (_this2._hoverState !== HoverState.IN && tip.parentNode) { tip.parentNode.removeChild(tip); } - _this3.element.removeAttribute('aria-describedby'); - $(_this3.element).trigger(_this3.constructor.Event.HIDDEN); - _this3.cleanupTether(); + _this2.element.removeAttribute('aria-describedby'); + $(_this2.element).trigger(_this2.constructor.Event.HIDDEN); + _this2.cleanupTether(); if (callback) { callback(); @@ -351,18 +361,18 @@ }, { key: '_setListeners', value: function _setListeners() { - var _this4 = this; + var _this3 = this; var triggers = this.config.trigger.split(' '); triggers.forEach(function (trigger) { if (trigger === 'click') { - $(_this4.element).on(_this4.constructor.Event.CLICK, _this4.config.selector, $.proxy(_this4.toggle, _this4)); + $(_this3.element).on(_this3.constructor.Event.CLICK, _this3.config.selector, $.proxy(_this3.toggle, _this3)); } else if (trigger !== Trigger.MANUAL) { - var eventIn = trigger == Trigger.HOVER ? _this4.constructor.Event.MOUSEENTER : _this4.constructor.Event.FOCUSIN; - var eventOut = trigger == Trigger.HOVER ? _this4.constructor.Event.MOUSELEAVE : _this4.constructor.Event.FOCUSOUT; + var eventIn = trigger == Trigger.HOVER ? _this3.constructor.Event.MOUSEENTER : _this3.constructor.Event.FOCUSIN; + var eventOut = trigger == Trigger.HOVER ? _this3.constructor.Event.MOUSELEAVE : _this3.constructor.Event.FOCUSOUT; - $(_this4.element).on(eventIn, _this4.config.selector, $.proxy(_this4._enter, _this4)).on(eventOut, _this4.config.selector, $.proxy(_this4._leave, _this4)); + $(_this3.element).on(eventIn, _this3.config.selector, $.proxy(_this3._enter, _this3)).on(eventOut, _this3.config.selector, $.proxy(_this3._leave, _this3)); } }); @@ -529,6 +539,11 @@ get: function () { return Event; } + }, { + key: 'EVENT_KEY', + get: function () { + return EVENT_KEY; + } }, { key: '_jQueryInterface', -- cgit v1.2.3 From 6b2b0ed32f485103f58fe42057e93a175e14bc2a Mon Sep 17 00:00:00 2001 From: fat Date: Wed, 13 May 2015 14:52:46 -0700 Subject: al tests passing, dist rebuilt, w/typechecker --- dist/js/bootstrap.js | 173 ++++++++++++++++++++++++++++++++++++++++------- dist/js/bootstrap.min.js | 5 +- dist/js/umd/carousel.js | 19 +++++- dist/js/umd/collapse.js | 19 +++++- dist/js/umd/modal.js | 23 +++++-- dist/js/umd/popover.js | 9 +++ dist/js/umd/scrollspy.js | 52 +++++++++++--- dist/js/umd/tab.js | 5 -- dist/js/umd/tooltip.js | 22 +++++- dist/js/umd/util.js | 24 +++++++ 10 files changed, 297 insertions(+), 54 deletions(-) (limited to 'dist/js') diff --git a/dist/js/bootstrap.js b/dist/js/bootstrap.js index 725f4f828..01f0a6dac 100644 --- a/dist/js/bootstrap.js +++ b/dist/js/bootstrap.js @@ -50,6 +50,15 @@ var Util = (function ($) { transition: 'transitionend' }; + // shoutout AngusCroll (https://goo.gl/pxwQGp) + function toType(obj) { + return ({}).toString.call(obj).match(/\s([a-zA-Z]+)/)[1].toLowerCase(); + } + + function isElement(obj) { + return (obj[0] || obj).nodeType; + } + function getSpecialTransitionEndEvent() { return { bindType: transition.end, @@ -142,6 +151,21 @@ var Util = (function ($) { supportsTransitionEnd: function supportsTransitionEnd() { return !!transition; + }, + + typeCheckConfig: function typeCheckConfig(componentName, config, configTypes) { + + for (var property in configTypes) { + var expectedTypes = configTypes[property]; + var value = config[property]; + var valueType = undefined; + + if (value && isElement(value)) valueType = 'element';else valueType = toType(value); + + if (!new RegExp(expectedTypes).test(valueType)) { + throw new Error('' + componentName.toUpperCase() + ': ' + ('Option "' + property + '" provided type "' + valueType + '" ') + ('but expected type "' + expectedTypes + '".')); + } + } } }; @@ -536,6 +560,14 @@ var Carousel = (function ($) { wrap: true }; + var DefaultType = { + interval: '(number|boolean)', + keyboard: 'boolean', + slide: '(boolean|string)', + pause: '(string|boolean)', + wrap: 'boolean' + }; + var Direction = { NEXT: 'next', PREVIOUS: 'prev' @@ -587,7 +619,7 @@ var Carousel = (function ($) { this._isPaused = false; this._isSliding = false; - this._config = config; + this._config = this._getConfig(config); this._element = $(element)[0]; this._indicatorsElement = $(this._element).find(Selector.INDICATORS)[0]; @@ -688,10 +720,17 @@ var Carousel = (function ($) { this._indicatorsElement = null; } }, { - key: '_addEventListeners', + key: '_getConfig', // private + value: function _getConfig(config) { + config = $.extend({}, Default, config); + Util.typeCheckConfig(NAME, config, DefaultType); + return config; + } + }, { + key: '_addEventListeners', value: function _addEventListeners() { if (this._config.keyboard) { $(this._element).on(Event.KEYDOWN, $.proxy(this._keydown, this)); @@ -975,7 +1014,12 @@ var Collapse = (function ($) { var Default = { toggle: true, - parent: null + parent: '' + }; + + var DefaultType = { + toggle: 'boolean', + parent: 'string' }; var Event = { @@ -1015,7 +1059,7 @@ var Collapse = (function ($) { this._isTransitioning = false; this._element = element; - this._config = $.extend({}, Default, config); + this._config = this._getConfig(config); this._triggerArray = $.makeArray($('[data-toggle="collapse"][href="#' + element.id + '"],' + ('[data-toggle="collapse"][data-target="#' + element.id + '"]'))); this._parent = this._config.parent ? this._getParent() : null; @@ -1176,10 +1220,18 @@ var Collapse = (function ($) { this._isTransitioning = null; } }, { - key: '_getDimension', + key: '_getConfig', // private + value: function _getConfig(config) { + config = $.extend({}, Default, config); + config.toggle = !!config.toggle; // coerce string values + Util.typeCheckConfig(NAME, config, DefaultType); + return config; + } + }, { + key: '_getDimension', value: function _getDimension() { var hasWidth = $(this._element).hasClass(Dimension.WIDTH); return hasWidth ? Dimension.WIDTH : Dimension.HEIGHT; @@ -1594,9 +1646,17 @@ var Modal = (function ($) { var Default = { backdrop: true, keyboard: true, + focus: true, show: true }; + var DefaultType = { + backdrop: '(boolean|string)', + keyboard: 'boolean', + focus: 'boolean', + show: 'boolean' + }; + var Event = { HIDE: 'hide' + EVENT_KEY, HIDDEN: 'hidden' + EVENT_KEY, @@ -1635,7 +1695,7 @@ var Modal = (function ($) { function Modal(element, config) { _classCallCheck(this, Modal); - this._config = config; + this._config = this._getConfig(config); this._element = element; this._dialog = $(element).find(Selector.DIALOG)[0]; this._backdrop = null; @@ -1746,10 +1806,17 @@ var Modal = (function ($) { this._scrollbarWidth = null; } }, { - key: '_showElement', + key: '_getConfig', // private + value: function _getConfig(config) { + config = $.extend({}, Default, config); + Util.typeCheckConfig(NAME, config, DefaultType); + return config; + } + }, { + key: '_showElement', value: function _showElement(relatedTarget) { var _this8 = this; @@ -1769,14 +1836,14 @@ var Modal = (function ($) { $(this._element).addClass(ClassName.IN); - this._enforceFocus(); + if (this._config.focus) this._enforceFocus(); var shownEvent = $.Event(Event.SHOWN, { relatedTarget: relatedTarget }); var transitionComplete = function transitionComplete() { - _this8._element.focus(); + if (_this8._config.focus) _this8._element.focus(); $(_this8._element).trigger(shownEvent); }; @@ -2098,7 +2165,15 @@ var ScrollSpy = (function ($) { var JQUERY_NO_CONFLICT = $.fn[NAME]; var Default = { - offset: 10 + offset: 10, + method: 'auto', + target: '' + }; + + var DefaultType = { + offset: 'number', + method: 'string', + target: '(string|element)' }; var Event = { @@ -2115,8 +2190,14 @@ var ScrollSpy = (function ($) { var Selector = { DATA_SPY: '[data-spy="scroll"]', ACTIVE: '.active', + LI: 'li', LI_DROPDOWN: 'li.dropdown', - LI: 'li' + NAV_ANCHORS: '.nav li > a' + }; + + var OffsetMethod = { + OFFSET: 'offset', + POSITION: 'position' }; /** @@ -2131,8 +2212,8 @@ var ScrollSpy = (function ($) { this._element = element; this._scrollElement = element.tagName === 'BODY' ? window : element; - this._config = $.extend({}, Default, config); - this._selector = '' + (this._config.target || '') + ' .nav li > a'; + this._config = this._getConfig(config); + this._selector = '' + this._config.target + ' ' + Selector.NAV_ANCHORS; this._offsets = []; this._targets = []; this._activeTarget = null; @@ -2152,13 +2233,11 @@ var ScrollSpy = (function ($) { value: function refresh() { var _this14 = this; - var offsetMethod = 'offset'; - var offsetBase = 0; + var autoMethod = this._scrollElement !== this._scrollElement.window ? OffsetMethod.POSITION : OffsetMethod.OFFSET; - if (this._scrollElement !== this._scrollElement.window) { - offsetMethod = 'position'; - offsetBase = this._getScrollTop(); - } + var offsetMethod = this._config.method === 'auto' ? autoMethod : this._config.method; + + var offsetBase = offsetMethod === OffsetMethod.POSITION ? this._getScrollTop() : 0; this._offsets = []; this._targets = []; @@ -2204,10 +2283,28 @@ var ScrollSpy = (function ($) { this._scrollHeight = null; } }, { - key: '_getScrollTop', + key: '_getConfig', // private + value: function _getConfig(config) { + config = $.extend({}, Default, config); + + if (typeof config.target !== 'string') { + var id = $(config.target).attr('id'); + if (!id) { + id = Util.getUID(NAME); + $(config.target).attr('id', id); + } + config.target = '#' + id; + } + + Util.typeCheckConfig(NAME, config, DefaultType); + + return config; + } + }, { + key: '_getScrollTop', value: function _getScrollTop() { return this._scrollElement === window ? this._scrollElement.scrollY : this._scrollElement.scrollTop; } @@ -2569,11 +2666,6 @@ var Tab = (function ($) { get: function () { return VERSION; } - }, { - key: 'Default', - get: function () { - return Default; - } }, { key: '_jQueryInterface', @@ -2659,7 +2751,20 @@ var Tooltip = (function ($) { selector: false, placement: 'top', offset: '0 0', - constraints: null + constraints: [] + }; + + var DefaultType = { + animation: 'boolean', + template: 'string', + title: '(string|function)', + trigger: 'string', + delay: '(number|object)', + html: 'boolean', + selector: '(string|boolean)', + placement: '(string|function)', + offset: 'string', + constraints: 'array' }; var AttachmentMap = { @@ -3098,6 +3203,8 @@ var Tooltip = (function ($) { }; } + Util.typeCheckConfig(NAME, config, this.constructor.DefaultType); + return config; } }, { @@ -3149,6 +3256,11 @@ var Tooltip = (function ($) { get: function () { return EVENT_KEY; } + }, { + key: 'DefaultType', + get: function () { + return DefaultType; + } }, { key: '_jQueryInterface', @@ -3222,6 +3334,10 @@ var Popover = (function ($) { template: '' }); + var DefaultType = $.extend({}, Tooltip.DefaultType, { + content: '(string|function)' + }); + var ClassName = { FADE: 'fade', IN: 'in' @@ -3336,6 +3452,11 @@ var Popover = (function ($) { get: function () { return EVENT_KEY; } + }, { + key: 'DefaultType', + get: function () { + return DefaultType; + } }, { key: '_jQueryInterface', diff --git a/dist/js/bootstrap.min.js b/dist/js/bootstrap.min.js index 49b050aa5..497cc8176 100644 --- a/dist/js/bootstrap.min.js +++ b/dist/js/bootstrap.min.js @@ -3,5 +3,6 @@ * Copyright 2011-2015 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) */ -if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){var b=a.fn.jquery.split(" ")[0].split(".");if(b[0]<2&&b[1]<9||1==b[0]&&9==b[1]&&b[2]<1)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher")}(jQuery),+function(){"use strict";function a(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(a.__proto__=b)}function b(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}{var c=function(){function a(a,b){for(var c=0;cthis._items.length-1||0>b)){if(this._isSliding)return void a(this._element).one(n.SLID,function(){return c.to(b)});if(d==b)return this.pause(),void this.cycle();var e=b>d?m.NEXT:m.PREVIOUS;this._slide(e,this._items[b])}}},{key:"dispose",value:function(){a(this._element).off(h),a.removeData(this._element,g),this._items=null,this._config=null,this._element=null,this._interval=null,this._isPaused=null,this._isSliding=null,this._activeElement=null,this._indicatorsElement=null}},{key:"_addEventListeners",value:function(){this._config.keyboard&&a(this._element).on(n.KEYDOWN,a.proxy(this._keydown,this)),"hover"!=this._config.pause||"ontouchstart"in document.documentElement||a(this._element).on(n.MOUSEENTER,a.proxy(this.pause,this)).on(n.MOUSELEAVE,a.proxy(this.cycle,this))}},{key:"_keydown",value:function(a){if(a.preventDefault(),!/input|textarea/i.test(a.target.tagName))switch(a.which){case 37:this.prev();break;case 39:this.next();break;default:return}}},{key:"_getItemIndex",value:function(b){return this._items=a.makeArray(a(b).parent().find(p.ITEM)),this._items.indexOf(b)}},{key:"_getItemByDirection",value:function(a,b){var c=a===m.NEXT,d=a===m.PREVIOUS,e=this._getItemIndex(b),f=this._items.length-1,g=d&&0===e||c&&e==f;if(g&&!this._config.wrap)return b;var h=a==m.PREVIOUS?-1:1,i=(e+h)%this._items.length;return-1===i?this._items[this._items.length-1]:this._items[i]}},{key:"_triggerSlideEvent",value:function(b,c){var d=a.Event(n.SLIDE,{relatedTarget:b,direction:c});return a(this._element).trigger(d),d}},{key:"_setActiveIndicatorElement",value:function(b){if(this._indicatorsElement){a(this._indicatorsElement).find(p.ACTIVE).removeClass(o.ACTIVE);var c=this._indicatorsElement.children[this._getItemIndex(b)];c&&a(c).addClass(o.ACTIVE)}}},{key:"_slide",value:function(b,c){var e=this,f=a(this._element).find(p.ACTIVE_ITEM)[0],g=c||f&&this._getItemByDirection(b,f),h=!!this._interval,i=b==m.NEXT?o.LEFT:o.RIGHT;if(g&&a(g).hasClass(o.ACTIVE))return void(this._isSliding=!1);var j=this._triggerSlideEvent(g,i);if(!j.isDefaultPrevented()&&f&&g){this._isSliding=!0,h&&this.pause(),this._setActiveIndicatorElement(g);var l=a.Event(n.SLID,{relatedTarget:g,direction:i});d.supportsTransitionEnd()&&a(this._element).hasClass(o.SLIDE)?(a(g).addClass(b),d.reflow(g),a(f).addClass(i),a(g).addClass(i),a(f).one(d.TRANSITION_END,function(){a(g).removeClass(i).removeClass(b),a(g).addClass(o.ACTIVE),a(f).removeClass(o.ACTIVE).removeClass(b).removeClass(i),e._isSliding=!1,setTimeout(function(){return a(e._element).trigger(l)},0)}).emulateTransitionEnd(k)):(a(f).removeClass(o.ACTIVE),a(g).addClass(o.ACTIVE),this._isSliding=!1,a(this._element).trigger(l)),h&&this.cycle()}}}],[{key:"VERSION",get:function(){return f}},{key:"Default",get:function(){return l}},{key:"_jQueryInterface",value:function(b){return this.each(function(){var c=a(this).data(g),d=a.extend({},l,a(this).data());"object"==typeof b&&a.extend(d,b);var f="string"==typeof b?b:d.slide;c||(c=new e(this,d),a(this).data(g,c)),"number"==typeof b?c.to(b):f?c[f]():d.interval&&(c.pause(),c.cycle())})}},{key:"_dataApiClickHandler",value:function(b){var c=d.getSelectorFromElement(this);if(c){var f=a(c)[0];if(f&&a(f).hasClass(o.CAROUSEL)){var h=a.extend({},a(f).data(),a(this).data()),i=this.getAttribute("data-slide-to");i&&(h.interval=!1),e._jQueryInterface.call(a(f),h),i&&a(f).data(g).to(i),b.preventDefault()}}}}]),e}();return a(document).on(n.CLICK_DATA_API,p.DATA_SLIDE,q._dataApiClickHandler),a(window).on(n.LOAD_DATA_API,function(){a(p.DATA_RIDE).each(function(){var b=a(this);q._jQueryInterface.call(b,b.data())})}),a.fn[e]=q._jQueryInterface,a.fn[e].Constructor=q,a.fn[e].noConflict=function(){return a.fn[e]=j,q._jQueryInterface},q}(jQuery),function(a){var e="collapse",f="4.0.0",g="bs.collapse",h="."+g,i=".data-api",j=a.fn[e],k=600,l={toggle:!0,parent:null},m={SHOW:"show"+h,SHOWN:"shown"+h,HIDE:"hide"+h,HIDDEN:"hidden"+h,CLICK_DATA_API:"click"+h+i},n={IN:"in",COLLAPSE:"collapse",COLLAPSING:"collapsing",COLLAPSED:"collapsed"},o={WIDTH:"width",HEIGHT:"height"},p={ACTIVES:".panel > .in, .panel > .collapsing",DATA_TOGGLE:'[data-toggle="collapse"]'},q=function(){function e(c,d){b(this,e),this._isTransitioning=!1,this._element=c,this._config=a.extend({},l,d),this._triggerArray=a.makeArray(a('[data-toggle="collapse"][href="#'+c.id+'"],'+('[data-toggle="collapse"][data-target="#'+c.id+'"]'))),this._parent=this._config.parent?this._getParent():null,this._config.parent||this._addAriaAndCollapsedClass(this._element,this._triggerArray),this._config.toggle&&this.toggle()}return c(e,[{key:"toggle",value:function(){a(this._element).hasClass(n.IN)?this.hide():this.show()}},{key:"show",value:function(){var b=this;if(!this._isTransitioning&&!a(this._element).hasClass(n.IN)){var c=void 0,f=void 0;if(this._parent&&(c=a.makeArray(a(p.ACTIVES)),c.length||(c=null)),!(c&&(f=a(c).data(g),f&&f._isTransitioning))){var h=a.Event(m.SHOW);if(a(this._element).trigger(h),!h.isDefaultPrevented()){c&&(e._jQueryInterface.call(a(c),"hide"),f||a(c).data(g,null));var i=this._getDimension();a(this._element).removeClass(n.COLLAPSE).addClass(n.COLLAPSING),this._element.style[i]=0,this._element.setAttribute("aria-expanded",!0),this._triggerArray.length&&a(this._triggerArray).removeClass(n.COLLAPSED).attr("aria-expanded",!0),this.setTransitioning(!0);var j=function(){a(b._element).removeClass(n.COLLAPSING).addClass(n.COLLAPSE).addClass(n.IN),b._element.style[i]="",b.setTransitioning(!1),a(b._element).trigger(m.SHOWN)};if(!d.supportsTransitionEnd())return void j();var l="scroll"+(i[0].toUpperCase()+i.slice(1));a(this._element).one(d.TRANSITION_END,j).emulateTransitionEnd(k),this._element.style[i]=this._element[l]+"px"}}}}},{key:"hide",value:function(){var b=this;if(!this._isTransitioning&&a(this._element).hasClass(n.IN)){var c=a.Event(m.HIDE);if(a(this._element).trigger(c),!c.isDefaultPrevented()){var e=this._getDimension(),f=e===o.WIDTH?"offsetWidth":"offsetHeight";this._element.style[e]=this._element[f]+"px",d.reflow(this._element),a(this._element).addClass(n.COLLAPSING).removeClass(n.COLLAPSE).removeClass(n.IN),this._element.setAttribute("aria-expanded",!1),this._triggerArray.length&&a(this._triggerArray).addClass(n.COLLAPSED).attr("aria-expanded",!1),this.setTransitioning(!0);var g=function(){b.setTransitioning(!1),a(b._element).removeClass(n.COLLAPSING).addClass(n.COLLAPSE).trigger(m.HIDDEN)};return this._element.style[e]=0,d.supportsTransitionEnd()?void a(this._element).one(d.TRANSITION_END,g).emulateTransitionEnd(k):g()}}}},{key:"setTransitioning",value:function(a){this._isTransitioning=a}},{key:"dispose",value:function(){a.removeData(this._element,g),this._config=null,this._parent=null,this._element=null,this._triggerArray=null,this._isTransitioning=null}},{key:"_getDimension",value:function(){var b=a(this._element).hasClass(o.WIDTH);return b?o.WIDTH:o.HEIGHT}},{key:"_getParent",value:function(){var b=this,c=a(this._config.parent)[0],d='[data-toggle="collapse"][data-parent="'+this._config.parent+'"]';return a(c).find(d).each(function(a,c){b._addAriaAndCollapsedClass(e._getTargetFromElement(c),[c])}),c}},{key:"_addAriaAndCollapsedClass",value:function(b,c){if(b){var d=a(b).hasClass(n.IN);b.setAttribute("aria-expanded",d),c.length&&a(c).toggleClass(n.COLLAPSED,!d).attr("aria-expanded",d)}}}],[{key:"VERSION",get:function(){return f}},{key:"Default",get:function(){return l}},{key:"_getTargetFromElement",value:function(b){var c=d.getSelectorFromElement(b);return c?a(c)[0]:null}},{key:"_jQueryInterface",value:function(b){return this.each(function(){var c=a(this),d=c.data(g),f=a.extend({},l,c.data(),"object"==typeof b&&b);!d&&f.toggle&&/show|hide/.test(b)&&(f.toggle=!1),d||(d=new e(this,f),c.data(g,d)),"string"==typeof b&&d[b]()})}}]),e}();return a(document).on(m.CLICK_DATA_API,p.DATA_TOGGLE,function(b){b.preventDefault();var c=q._getTargetFromElement(this),d=a(c).data(g),e=d?"toggle":a(this).data();q._jQueryInterface.call(a(c),e)}),a.fn[e]=q._jQueryInterface,a.fn[e].Constructor=q,a.fn[e].noConflict=function(){return a.fn[e]=j,q._jQueryInterface},q}(jQuery),function(a){var e="dropdown",f="4.0.0",g="bs.dropdown",h="."+g,i=".data-api",j=a.fn[e],k={HIDE:"hide"+h,HIDDEN:"hidden"+h,SHOW:"show"+h,SHOWN:"shown"+h,CLICK:"click"+h,CLICK_DATA_API:"click"+h+i,KEYDOWN_DATA_API:"keydown"+h+i},l={BACKDROP:"dropdown-backdrop",DISABLED:"disabled",OPEN:"open"},m={BACKDROP:".dropdown-backdrop",DATA_TOGGLE:'[data-toggle="dropdown"]',FORM_CHILD:".dropdown form",ROLE_MENU:'[role="menu"]',ROLE_LISTBOX:'[role="listbox"]',NAVBAR_NAV:".navbar-nav",VISIBLE_ITEMS:'[role="menu"] li:not(.disabled) a, [role="listbox"] li:not(.disabled) a'},n=function(){function e(a){b(this,e),this._element=a,this._addEventListeners()}return c(e,[{key:"toggle",value:function(){if(!this.disabled&&!a(this).hasClass(l.DISABLED)){var b=e._getParentFromElement(this),c=a(b).hasClass(l.OPEN);if(e._clearMenus(),c)return!1;if("ontouchstart"in document.documentElement&&!a(b).closest(m.NAVBAR_NAV).length){var d=document.createElement("div");d.className=l.BACKDROP,a(d).insertBefore(this),a(d).on("click",e._clearMenus)}var f={relatedTarget:this},g=a.Event(k.SHOW,f);if(a(b).trigger(g),!g.isDefaultPrevented())return this.focus(),this.setAttribute("aria-expanded","true"),a(b).toggleClass(l.OPEN),a(b).trigger(k.SHOWN,f),!1}}},{key:"dispose",value:function(){a.removeData(this._element,g),a(this._element).off(h),this._element=null}},{key:"_addEventListeners",value:function(){a(this._element).on(k.CLICK,this.toggle)}}],[{key:"VERSION",get:function(){return f}},{key:"_jQueryInterface",value:function(b){return this.each(function(){var c=a(this).data(g);c||a(this).data(g,c=new e(this)),"string"==typeof b&&c[b].call(this)})}},{key:"_clearMenus",value:function(b){if(!b||3!==b.which){var c=a(m.BACKDROP)[0];c&&c.parentNode.removeChild(c);for(var d=a.makeArray(a(m.DATA_TOGGLE)),f=0;f0&&h--,40===b.which&&hdocument.documentElement.clientHeight;!this._isBodyOverflowing&&a&&(this._element.style.paddingLeft=this._scrollbarWidth+"px"),this._isBodyOverflowing&&!a&&(this._element.style.paddingRight=this._scrollbarWidth+"px")}},{key:"_resetAdjustments",value:function(){this._element.style.paddingLeft="",this._element.style.paddingRight=""}},{key:"_checkScrollbar",value:function(){var a=window.innerWidth;if(!a){var b=document.documentElement.getBoundingClientRect();a=b.right-Math.abs(b.left)}this._isBodyOverflowing=document.body.clientWidth a",this._offsets=[],this._targets=[],this._activeTarget=null,this._scrollHeight=0,a(this._scrollElement).on(l.SCROLL,a.proxy(this._process,this)),this.refresh(),this._process()}return c(e,[{key:"refresh",value:function(){var b=this,c="offset",e=0;this._scrollElement!==this._scrollElement.window&&(c="position",e=this._getScrollTop()),this._offsets=[],this._targets=[],this._scrollHeight=this._getScrollHeight();var f=a.makeArray(a(this._selector));f.map(function(b){var f=void 0,g=d.getSelectorFromElement(b);return g&&(f=a(g)[0]),f&&(f.offsetWidth||f.offsetHeight)?[a(f)[c]().top+e,g]:void 0}).filter(function(a){return a}).sort(function(a,b){return a[0]-b[0]}).forEach(function(a){b._offsets.push(a[0]),b._targets.push(a[1])})}},{key:"dispose",value:function(){a.removeData(this._element,g),a(this._scrollElement).off(h),this._element=null,this._scrollElement=null,this._config=null,this._selector=null,this._offsets=null,this._targets=null,this._activeTarget=null,this._scrollHeight=null}},{key:"_getScrollTop",value:function(){return this._scrollElement===window?this._scrollElement.scrollY:this._scrollElement.scrollTop}},{key:"_getScrollHeight",value:function(){return this._scrollElement.scrollHeight||Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)}},{key:"_process",value:function(){var a=this._getScrollTop()+this._config.offset,b=this._getScrollHeight(),c=this._config.offset+b-this._scrollElement.offsetHeight;if(this._scrollHeight!==b&&this.refresh(),a>=c){var d=this._targets[this._targets.length-1];this._activeTarget!==d&&this._activate(d)}if(this._activeTarget&&a=this._offsets[e]&&(void 0===this._offsets[e+1]||a .fade",ACTIVE:".active",ACTIVE_CHILD:"> .active",DATA_TOGGLE:'[data-toggle="tab"], [data-toggle="pill"]',DROPDOWN_ACTIVE_CHILD:"> .dropdown-menu > .active"},o=function(){function e(a){b(this,e),this._element=a}return c(e,[{key:"show",value:function(){var b=this;if(!this._element.parentNode||this._element.parentNode.nodeType!=Node.ELEMENT_NODE||!a(this._element).parent().hasClass(m.ACTIVE)){var c=void 0,e=void 0,f=a(this._element).closest(n.UL)[0],g=d.getSelectorFromElement(this._element);f&&(e=a.makeArray(a(f).find(n.ACTIVE)),e=e[e.length-1],e&&(e=a(e).find(n.A)[0]));var h=a.Event(l.HIDE,{relatedTarget:this._element}),i=a.Event(l.SHOW,{relatedTarget:e});if(e&&a(e).trigger(h),a(this._element).trigger(i),!i.isDefaultPrevented()&&!h.isDefaultPrevented()){g&&(c=a(g)[0]),this._activate(a(this._element).closest(n.LI)[0],f);var j=function(){var c=a.Event(l.HIDDEN,{relatedTarget:b._element}),d=a.Event(l.SHOWN,{relatedTarget:e});a(e).trigger(c),a(b._element).trigger(d)};c?this._activate(c,c.parentNode,j):j()}}}},{key:"dispose",value:function(){a.removeClass(this._element,g),this._element=null}},{key:"_activate",value:function(b,c,e){var f=a(c).find(n.ACTIVE_CHILD)[0],g=e&&d.supportsTransitionEnd()&&(f&&a(f).hasClass(m.FADE)||!!a(c).find(n.FADE_CHILD)[0]),h=a.proxy(this._transitionComplete,this,b,f,g,e);f&&g?a(f).one(d.TRANSITION_END,h).emulateTransitionEnd(k):h(),f&&a(f).removeClass(m.IN)}},{key:"_transitionComplete",value:function(b,c,e,f){if(c){a(c).removeClass(m.ACTIVE);var g=a(c).find(n.DROPDOWN_ACTIVE_CHILD)[0];g&&a(g).removeClass(m.ACTIVE);var h=a(c).find(n.DATA_TOGGLE)[0];h&&h.setAttribute("aria-expanded",!1)}a(b).addClass(m.ACTIVE);var i=a(b).find(n.DATA_TOGGLE)[0];if(i&&i.setAttribute("aria-expanded",!0),e?(d.reflow(b),a(b).addClass(m.IN)):a(b).removeClass(m.FADE),b.parentNode&&a(b.parentNode).hasClass(m.DROPDOWN_MENU)){var j=a(b).closest(n.LI_DROPDOWN)[0];j&&a(j).addClass(m.ACTIVE),i=a(b).find(n.DATA_TOGGLE)[0],i&&i.setAttribute("aria-expanded",!0)}f&&f()}}],[{key:"VERSION",get:function(){return f}},{key:"Default",get:function(){return Default}},{key:"_jQueryInterface",value:function(b){return this.each(function(){var c=a(this),d=c.data(g);d||(d=d=new e(this),c.data(g,d)),"string"==typeof b&&d[b]()})}}]),e}();return a(document).on(l.CLICK_DATA_API,n.DATA_TOGGLE,function(b){b.preventDefault(),o._jQueryInterface.call(a(this),"show")}),a.fn[e]=o._jQueryInterface,a.fn[e].Constructor=o,a.fn[e].noConflict=function(){return a.fn[e]=j,o._jQueryInterface},o}(jQuery),function(a){var e="tooltip",f="4.0.0",g="bs.tooltip",h="."+g,i=a.fn[e],j=150,k="bs-tether",l={animation:!0,template:'', -trigger:"hover focus",title:"",delay:0,html:!1,selector:!1,placement:"top",offset:"0 0",constraints:null},m={TOP:"bottom center",RIGHT:"middle left",BOTTOM:"top center",LEFT:"middle right"},n={IN:"in",OUT:"out"},o={HIDE:"hide"+h,HIDDEN:"hidden"+h,SHOW:"show"+h,SHOWN:"shown"+h,INSERTED:"inserted"+h,CLICK:"click"+h,FOCUSIN:"focusin"+h,FOCUSOUT:"focusout"+h,MOUSEENTER:"mouseenter"+h,MOUSELEAVE:"mouseleave"+h},p={FADE:"fade",IN:"in"},q={TOOLTIP:".tooltip",TOOLTIP_INNER:".tooltip-inner"},r={element:!1,enabled:!1},s={HOVER:"hover",FOCUS:"focus",CLICK:"click",MANUAL:"manual"},t=function(){function i(a,c){b(this,i),this._isEnabled=!0,this._timeout=0,this._hoverState="",this._activeTrigger={},this._tether=null,this.element=a,this.config=this._getConfig(c),this.tip=null,this._setListeners()}return c(i,[{key:"enable",value:function(){this._isEnabled=!0}},{key:"disable",value:function(){this._isEnabled=!1}},{key:"toggleEnabled",value:function(){this._isEnabled=!this._isEnabled}},{key:"toggle",value:function(b){var c=this,d=this.constructor.DATA_KEY;b?(c=a(b.currentTarget).data(d),c||(c=new this.constructor(b.currentTarget,this._getDelegateConfig()),a(b.currentTarget).data(d,c)),c._activeTrigger.click=!c._activeTrigger.click,c._isWithActiveTrigger()?c._enter(null,c):c._leave(null,c)):a(c.getTipElement()).hasClass(p.IN)?c._leave(null,c):c._enter(null,c)}},{key:"dispose",value:function(){clearTimeout(this._timeout),this.cleanupTether(),a.removeData(this.element,this.constructor.DATA_KEY),a(this.element).off(this.constructor.EVENT_KEY),this.tip&&a(this.tip).remove(),this._isEnabled=null,this._timeout=null,this._hoverState=null,this._activeTrigger=null,this._tether=null,this.element=null,this.config=null,this.tip=null}},{key:"show",value:function(){var b=this,c=a.Event(this.constructor.Event.SHOW);if(this.isWithContent()&&this._isEnabled){a(this.element).trigger(c);var e=a.contains(this.element.ownerDocument.documentElement,this.element);if(c.isDefaultPrevented()||!e)return;var f=this.getTipElement(),g=d.getUID(this.constructor.NAME);f.setAttribute("id",g),this.element.setAttribute("aria-describedby",g),this.setContent(),this.config.animation&&a(f).addClass(p.FADE);var h="function"==typeof this.config.placement?this.config.placement.call(this,f,this.element):this.config.placement,j=this._getAttachment(h);a(f).data(this.constructor.DATA_KEY,this).appendTo(document.body),a(this.element).trigger(this.constructor.Event.INSERTED),this._tether=new Tether({element:f,target:this.element,attachment:j,classes:r,classPrefix:k,offset:this.config.offset,constraints:this.config.constraints}),d.reflow(f),this._tether.position(),a(f).addClass(p.IN);var l=function(){var c=b._hoverState;b._hoverState=null,a(b.element).trigger(b.constructor.Event.SHOWN),c===n.OUT&&b._leave(null,b)};d.supportsTransitionEnd()&&a(this.tip).hasClass(p.FADE)?a(this.tip).one(d.TRANSITION_END,l).emulateTransitionEnd(i._TRANSITION_DURATION):l()}}},{key:"hide",value:function(b){var c=this,e=this.getTipElement(),f=a.Event(this.constructor.Event.HIDE),g=function(){c._hoverState!==n.IN&&e.parentNode&&e.parentNode.removeChild(e),c.element.removeAttribute("aria-describedby"),a(c.element).trigger(c.constructor.Event.HIDDEN),c.cleanupTether(),b&&b()};a(this.element).trigger(f),f.isDefaultPrevented()||(a(e).removeClass(p.IN),d.supportsTransitionEnd()&&a(this.tip).hasClass(p.FADE)?a(e).one(d.TRANSITION_END,g).emulateTransitionEnd(j):g(),this._hoverState="")}},{key:"isWithContent",value:function(){return!!this.getTitle()}},{key:"getTipElement",value:function(){return this.tip=this.tip||a(this.config.template)[0]}},{key:"setContent",value:function(){var b=this.getTipElement(),c=this.getTitle(),d=this.config.html?"innerHTML":"innerText";a(b).find(q.TOOLTIP_INNER)[0][d]=c,a(b).removeClass(p.FADE).removeClass(p.IN),this.cleanupTether()}},{key:"getTitle",value:function(){var a=this.element.getAttribute("data-original-title");return a||(a="function"==typeof this.config.title?this.config.title.call(this.element):this.config.title),a}},{key:"cleanupTether",value:function(){this._tether&&(this._tether.destroy(),a(this.element).removeClass(this._removeTetherClasses),a(this.tip).removeClass(this._removeTetherClasses))}},{key:"_getAttachment",value:function(a){return m[a.toUpperCase()]}},{key:"_setListeners",value:function(){var b=this,c=this.config.trigger.split(" ");c.forEach(function(c){if("click"===c)a(b.element).on(b.constructor.Event.CLICK,b.config.selector,a.proxy(b.toggle,b));else if(c!==s.MANUAL){var d=c==s.HOVER?b.constructor.Event.MOUSEENTER:b.constructor.Event.FOCUSIN,e=c==s.HOVER?b.constructor.Event.MOUSELEAVE:b.constructor.Event.FOCUSOUT;a(b.element).on(d,b.config.selector,a.proxy(b._enter,b)).on(e,b.config.selector,a.proxy(b._leave,b))}}),this.config.selector?this.config=a.extend({},this.config,{trigger:"manual",selector:""}):this._fixTitle()}},{key:"_removeTetherClasses",value:function(a,b){return((b.baseVal||b).match(new RegExp("(^|\\s)"+k+"-\\S+","g"))||[]).join(" ")}},{key:"_fixTitle",value:function(){var a=typeof this.element.getAttribute("data-original-title");(this.element.getAttribute("title")||"string"!==a)&&(this.element.setAttribute("data-original-title",this.element.getAttribute("title")||""),this.element.setAttribute("title",""))}},{key:"_enter",value:function(b,c){var d=this.constructor.DATA_KEY;return c=c||a(b.currentTarget).data(d),c||(c=new this.constructor(b.currentTarget,this._getDelegateConfig()),a(b.currentTarget).data(d,c)),b&&(c._activeTrigger["focusin"==b.type?s.FOCUS:s.HOVER]=!0),a(c.getTipElement()).hasClass(p.IN)||c._hoverState===n.IN?void(c._hoverState=n.IN):(clearTimeout(c._timeout),c._hoverState=n.IN,c.config.delay&&c.config.delay.show?void(c._timeout=setTimeout(function(){c._hoverState===n.IN&&c.show()},c.config.delay.show)):void c.show())}},{key:"_leave",value:function(b,c){var d=this.constructor.DATA_KEY;return c=c||a(b.currentTarget).data(d),c||(c=new this.constructor(b.currentTarget,this._getDelegateConfig()),a(b.currentTarget).data(d,c)),b&&(c._activeTrigger["focusout"==b.type?s.FOCUS:s.HOVER]=!1),c._isWithActiveTrigger()?void 0:(clearTimeout(c._timeout),c._hoverState=n.OUT,c.config.delay&&c.config.delay.hide?void(c._timeout=setTimeout(function(){c._hoverState===n.OUT&&c.hide()},c.config.delay.hide)):void c.hide())}},{key:"_isWithActiveTrigger",value:function(){for(var a in this._activeTrigger)if(this._activeTrigger[a])return!0;return!1}},{key:"_getConfig",value:function(b){return b=a.extend({},this.constructor.Default,a(this.element).data(),b),b.delay&&"number"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),b}},{key:"_getDelegateConfig",value:function(){var a={};if(this.config)for(var b in this.config){var c=this.config[b];this.constructor.Default[b]!==c&&(a[b]=c)}return a}}],[{key:"VERSION",get:function(){return f}},{key:"Default",get:function(){return l}},{key:"NAME",get:function(){return e}},{key:"DATA_KEY",get:function(){return g}},{key:"Event",get:function(){return o}},{key:"EVENT_KEY",get:function(){return h}},{key:"_jQueryInterface",value:function(b){return this.each(function(){var c=a(this).data(g),d="object"==typeof b?b:null;(c||!/destroy|hide/.test(b))&&(c||(c=new i(this,d),a(this).data(g,c)),"string"==typeof b&&c[b]())})}}]),i}();return a.fn[e]=t._jQueryInterface,a.fn[e].Constructor=t,a.fn[e].noConflict=function(){return a.fn[e]=i,t._jQueryInterface},t}(jQuery));!function(d){var f="popover",g="4.0.0",h="bs.popover",i="."+h,j=d.fn[f],k=d.extend({},e.Default,{placement:"right",trigger:"click",content:"",template:''}),l={FADE:"fade",IN:"in"},m={TITLE:".popover-title",CONTENT:".popover-content",ARROW:".popover-arrow"},n={HIDE:"hide"+i,HIDDEN:"hidden"+i,SHOW:"show"+i,SHOWN:"shown"+i,INSERTED:"inserted"+i,CLICK:"click"+i,FOCUSIN:"focusin"+i,FOCUSOUT:"focusout"+i,MOUSEENTER:"mouseenter"+i,MOUSELEAVE:"mouseleave"+i},o=function(e){function j(){b(this,j),null!=e&&e.apply(this,arguments)}return a(j,e),c(j,[{key:"isWithContent",value:function(){return this.getTitle()||this._getContent()}},{key:"getTipElement",value:function(){return this.tip=this.tip||d(this.config.template)[0]}},{key:"setContent",value:function(){var a=this.getTipElement(),b=this.getTitle(),c=this._getContent(),e=d(a).find(m.TITLE)[0];e&&(e[this.config.html?"innerHTML":"innerText"]=b),d(a).find(m.CONTENT).children().detach().end()[this.config.html?"string"==typeof c?"html":"append":"text"](c),d(a).removeClass(l.FADE).removeClass(l.IN),this.cleanupTether()}},{key:"_getContent",value:function(){return this.element.getAttribute("data-content")||("function"==typeof this.config.content?this.config.content.call(this.element):this.config.content)}}],[{key:"VERSION",get:function(){return g}},{key:"Default",get:function(){return k}},{key:"NAME",get:function(){return f}},{key:"DATA_KEY",get:function(){return h}},{key:"Event",get:function(){return n}},{key:"EVENT_KEY",get:function(){return i}},{key:"_jQueryInterface",value:function(a){return this.each(function(){var b=d(this).data(h),c="object"==typeof a?a:null;(b||!/destroy|hide/.test(a))&&(b||(b=new j(this,c),d(this).data(h,b)),"string"==typeof a&&b[a]())})}}]),j}(e);return d.fn[f]=o._jQueryInterface,d.fn[f].Constructor=o,d.fn[f].noConflict=function(){return d.fn[f]=j,o._jQueryInterface},o}(jQuery)}}(jQuery); \ No newline at end of file +if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){var b=a.fn.jquery.split(" ")[0].split(".");if(b[0]<2&&b[1]<9||1==b[0]&&9==b[1]&&b[2]<1)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher")}(jQuery),+function(){"use strict";function a(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(a.__proto__=b)}function b(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}{var c=function(){function a(a,b){for(var c=0;cthis._items.length-1||0>b)){if(this._isSliding)return void a(this._element).one(o.SLID,function(){return c.to(b)});if(d==b)return this.pause(),void this.cycle();var e=b>d?n.NEXT:n.PREVIOUS;this._slide(e,this._items[b])}}},{key:"dispose",value:function(){a(this._element).off(h),a.removeData(this._element,g),this._items=null,this._config=null,this._element=null,this._interval=null,this._isPaused=null,this._isSliding=null,this._activeElement=null,this._indicatorsElement=null}},{key:"_getConfig",value:function(b){return b=a.extend({},l,b),d.typeCheckConfig(e,b,m),b}},{key:"_addEventListeners",value:function(){this._config.keyboard&&a(this._element).on(o.KEYDOWN,a.proxy(this._keydown,this)),"hover"!=this._config.pause||"ontouchstart"in document.documentElement||a(this._element).on(o.MOUSEENTER,a.proxy(this.pause,this)).on(o.MOUSELEAVE,a.proxy(this.cycle,this))}},{key:"_keydown",value:function(a){if(a.preventDefault(),!/input|textarea/i.test(a.target.tagName))switch(a.which){case 37:this.prev();break;case 39:this.next();break;default:return}}},{key:"_getItemIndex",value:function(b){return this._items=a.makeArray(a(b).parent().find(q.ITEM)),this._items.indexOf(b)}},{key:"_getItemByDirection",value:function(a,b){var c=a===n.NEXT,d=a===n.PREVIOUS,e=this._getItemIndex(b),f=this._items.length-1,g=d&&0===e||c&&e==f;if(g&&!this._config.wrap)return b;var h=a==n.PREVIOUS?-1:1,i=(e+h)%this._items.length;return-1===i?this._items[this._items.length-1]:this._items[i]}},{key:"_triggerSlideEvent",value:function(b,c){var d=a.Event(o.SLIDE,{relatedTarget:b,direction:c});return a(this._element).trigger(d),d}},{key:"_setActiveIndicatorElement",value:function(b){if(this._indicatorsElement){a(this._indicatorsElement).find(q.ACTIVE).removeClass(p.ACTIVE);var c=this._indicatorsElement.children[this._getItemIndex(b)];c&&a(c).addClass(p.ACTIVE)}}},{key:"_slide",value:function(b,c){var e=this,f=a(this._element).find(q.ACTIVE_ITEM)[0],g=c||f&&this._getItemByDirection(b,f),h=!!this._interval,i=b==n.NEXT?p.LEFT:p.RIGHT;if(g&&a(g).hasClass(p.ACTIVE))return void(this._isSliding=!1);var j=this._triggerSlideEvent(g,i);if(!j.isDefaultPrevented()&&f&&g){this._isSliding=!0,h&&this.pause(),this._setActiveIndicatorElement(g);var l=a.Event(o.SLID,{relatedTarget:g,direction:i});d.supportsTransitionEnd()&&a(this._element).hasClass(p.SLIDE)?(a(g).addClass(b),d.reflow(g),a(f).addClass(i),a(g).addClass(i),a(f).one(d.TRANSITION_END,function(){a(g).removeClass(i).removeClass(b),a(g).addClass(p.ACTIVE),a(f).removeClass(p.ACTIVE).removeClass(b).removeClass(i),e._isSliding=!1,setTimeout(function(){return a(e._element).trigger(l)},0)}).emulateTransitionEnd(k)):(a(f).removeClass(p.ACTIVE),a(g).addClass(p.ACTIVE),this._isSliding=!1,a(this._element).trigger(l)),h&&this.cycle()}}}],[{key:"VERSION",get:function(){return f}},{key:"Default",get:function(){return l}},{key:"_jQueryInterface",value:function(b){return this.each(function(){var c=a(this).data(g),d=a.extend({},l,a(this).data());"object"==typeof b&&a.extend(d,b);var e="string"==typeof b?b:d.slide;c||(c=new i(this,d),a(this).data(g,c)),"number"==typeof b?c.to(b):e?c[e]():d.interval&&(c.pause(),c.cycle())})}},{key:"_dataApiClickHandler",value:function(b){var c=d.getSelectorFromElement(this);if(c){var e=a(c)[0];if(e&&a(e).hasClass(p.CAROUSEL)){var f=a.extend({},a(e).data(),a(this).data()),h=this.getAttribute("data-slide-to");h&&(f.interval=!1),i._jQueryInterface.call(a(e),f),h&&a(e).data(g).to(h),b.preventDefault()}}}}]),i}();return a(document).on(o.CLICK_DATA_API,q.DATA_SLIDE,r._dataApiClickHandler),a(window).on(o.LOAD_DATA_API,function(){a(q.DATA_RIDE).each(function(){var b=a(this);r._jQueryInterface.call(b,b.data())})}),a.fn[e]=r._jQueryInterface,a.fn[e].Constructor=r,a.fn[e].noConflict=function(){return a.fn[e]=j,r._jQueryInterface},r}(jQuery),function(a){var e="collapse",f="4.0.0",g="bs.collapse",h="."+g,i=".data-api",j=a.fn[e],k=600,l={toggle:!0,parent:""},m={toggle:"boolean",parent:"string"},n={SHOW:"show"+h,SHOWN:"shown"+h,HIDE:"hide"+h,HIDDEN:"hidden"+h,CLICK_DATA_API:"click"+h+i},o={IN:"in",COLLAPSE:"collapse",COLLAPSING:"collapsing",COLLAPSED:"collapsed"},p={WIDTH:"width",HEIGHT:"height"},q={ACTIVES:".panel > .in, .panel > .collapsing",DATA_TOGGLE:'[data-toggle="collapse"]'},r=function(){function h(c,d){b(this,h),this._isTransitioning=!1,this._element=c,this._config=this._getConfig(d),this._triggerArray=a.makeArray(a('[data-toggle="collapse"][href="#'+c.id+'"],'+('[data-toggle="collapse"][data-target="#'+c.id+'"]'))),this._parent=this._config.parent?this._getParent():null,this._config.parent||this._addAriaAndCollapsedClass(this._element,this._triggerArray),this._config.toggle&&this.toggle()}return c(h,[{key:"toggle",value:function(){a(this._element).hasClass(o.IN)?this.hide():this.show()}},{key:"show",value:function(){var b=this;if(!this._isTransitioning&&!a(this._element).hasClass(o.IN)){var c=void 0,e=void 0;if(this._parent&&(c=a.makeArray(a(q.ACTIVES)),c.length||(c=null)),!(c&&(e=a(c).data(g),e&&e._isTransitioning))){var f=a.Event(n.SHOW);if(a(this._element).trigger(f),!f.isDefaultPrevented()){c&&(h._jQueryInterface.call(a(c),"hide"),e||a(c).data(g,null));var i=this._getDimension();a(this._element).removeClass(o.COLLAPSE).addClass(o.COLLAPSING),this._element.style[i]=0,this._element.setAttribute("aria-expanded",!0),this._triggerArray.length&&a(this._triggerArray).removeClass(o.COLLAPSED).attr("aria-expanded",!0),this.setTransitioning(!0);var j=function(){a(b._element).removeClass(o.COLLAPSING).addClass(o.COLLAPSE).addClass(o.IN),b._element.style[i]="",b.setTransitioning(!1),a(b._element).trigger(n.SHOWN)};if(!d.supportsTransitionEnd())return void j();var l="scroll"+(i[0].toUpperCase()+i.slice(1));a(this._element).one(d.TRANSITION_END,j).emulateTransitionEnd(k),this._element.style[i]=this._element[l]+"px"}}}}},{key:"hide",value:function(){var b=this;if(!this._isTransitioning&&a(this._element).hasClass(o.IN)){var c=a.Event(n.HIDE);if(a(this._element).trigger(c),!c.isDefaultPrevented()){var e=this._getDimension(),f=e===p.WIDTH?"offsetWidth":"offsetHeight";this._element.style[e]=this._element[f]+"px",d.reflow(this._element),a(this._element).addClass(o.COLLAPSING).removeClass(o.COLLAPSE).removeClass(o.IN),this._element.setAttribute("aria-expanded",!1),this._triggerArray.length&&a(this._triggerArray).addClass(o.COLLAPSED).attr("aria-expanded",!1),this.setTransitioning(!0);var g=function(){b.setTransitioning(!1),a(b._element).removeClass(o.COLLAPSING).addClass(o.COLLAPSE).trigger(n.HIDDEN)};return this._element.style[e]=0,d.supportsTransitionEnd()?void a(this._element).one(d.TRANSITION_END,g).emulateTransitionEnd(k):g()}}}},{key:"setTransitioning",value:function(a){this._isTransitioning=a}},{key:"dispose",value:function(){a.removeData(this._element,g),this._config=null,this._parent=null,this._element=null,this._triggerArray=null,this._isTransitioning=null}},{key:"_getConfig",value:function(b){return b=a.extend({},l,b),b.toggle=!!b.toggle,d.typeCheckConfig(e,b,m),b}},{key:"_getDimension",value:function(){var b=a(this._element).hasClass(p.WIDTH);return b?p.WIDTH:p.HEIGHT}},{key:"_getParent",value:function(){var b=this,c=a(this._config.parent)[0],d='[data-toggle="collapse"][data-parent="'+this._config.parent+'"]';return a(c).find(d).each(function(a,c){b._addAriaAndCollapsedClass(h._getTargetFromElement(c),[c])}),c}},{key:"_addAriaAndCollapsedClass",value:function(b,c){if(b){var d=a(b).hasClass(o.IN);b.setAttribute("aria-expanded",d),c.length&&a(c).toggleClass(o.COLLAPSED,!d).attr("aria-expanded",d)}}}],[{key:"VERSION",get:function(){return f}},{key:"Default",get:function(){return l}},{key:"_getTargetFromElement",value:function(b){var c=d.getSelectorFromElement(b);return c?a(c)[0]:null}},{key:"_jQueryInterface",value:function(b){return this.each(function(){var c=a(this),d=c.data(g),e=a.extend({},l,c.data(),"object"==typeof b&&b);!d&&e.toggle&&/show|hide/.test(b)&&(e.toggle=!1),d||(d=new h(this,e),c.data(g,d)),"string"==typeof b&&d[b]()})}}]),h}();return a(document).on(n.CLICK_DATA_API,q.DATA_TOGGLE,function(b){b.preventDefault();var c=r._getTargetFromElement(this),d=a(c).data(g),e=d?"toggle":a(this).data();r._jQueryInterface.call(a(c),e)}),a.fn[e]=r._jQueryInterface,a.fn[e].Constructor=r,a.fn[e].noConflict=function(){return a.fn[e]=j,r._jQueryInterface},r}(jQuery),function(a){var e="dropdown",f="4.0.0",g="bs.dropdown",h="."+g,i=".data-api",j=a.fn[e],k={HIDE:"hide"+h,HIDDEN:"hidden"+h,SHOW:"show"+h,SHOWN:"shown"+h,CLICK:"click"+h,CLICK_DATA_API:"click"+h+i,KEYDOWN_DATA_API:"keydown"+h+i},l={BACKDROP:"dropdown-backdrop",DISABLED:"disabled",OPEN:"open"},m={BACKDROP:".dropdown-backdrop",DATA_TOGGLE:'[data-toggle="dropdown"]',FORM_CHILD:".dropdown form",ROLE_MENU:'[role="menu"]',ROLE_LISTBOX:'[role="listbox"]',NAVBAR_NAV:".navbar-nav",VISIBLE_ITEMS:'[role="menu"] li:not(.disabled) a, [role="listbox"] li:not(.disabled) a'},n=function(){function e(a){b(this,e),this._element=a,this._addEventListeners()}return c(e,[{key:"toggle",value:function(){if(!this.disabled&&!a(this).hasClass(l.DISABLED)){var b=e._getParentFromElement(this),c=a(b).hasClass(l.OPEN);if(e._clearMenus(),c)return!1;if("ontouchstart"in document.documentElement&&!a(b).closest(m.NAVBAR_NAV).length){var d=document.createElement("div");d.className=l.BACKDROP,a(d).insertBefore(this),a(d).on("click",e._clearMenus)}var f={relatedTarget:this},g=a.Event(k.SHOW,f);if(a(b).trigger(g),!g.isDefaultPrevented())return this.focus(),this.setAttribute("aria-expanded","true"),a(b).toggleClass(l.OPEN),a(b).trigger(k.SHOWN,f),!1}}},{key:"dispose",value:function(){a.removeData(this._element,g),a(this._element).off(h),this._element=null}},{key:"_addEventListeners",value:function(){a(this._element).on(k.CLICK,this.toggle)}}],[{key:"VERSION",get:function(){return f}},{key:"_jQueryInterface",value:function(b){return this.each(function(){var c=a(this).data(g);c||a(this).data(g,c=new e(this)),"string"==typeof b&&c[b].call(this)})}},{key:"_clearMenus",value:function(b){if(!b||3!==b.which){var c=a(m.BACKDROP)[0];c&&c.parentNode.removeChild(c);for(var d=a.makeArray(a(m.DATA_TOGGLE)),f=0;f0&&h--,40===b.which&&hdocument.documentElement.clientHeight;!this._isBodyOverflowing&&a&&(this._element.style.paddingLeft=this._scrollbarWidth+"px"),this._isBodyOverflowing&&!a&&(this._element.style.paddingRight=this._scrollbarWidth+"px")}},{key:"_resetAdjustments",value:function(){this._element.style.paddingLeft="",this._element.style.paddingRight=""}},{key:"_checkScrollbar",value:function(){var a=window.innerWidth;if(!a){var b=document.documentElement.getBoundingClientRect();a=b.right-Math.abs(b.left)}this._isBodyOverflowing=document.body.clientWidth a"},p={OFFSET:"offset",POSITION:"position"},q=function(){function i(c,d){b(this,i),this._element=c,this._scrollElement="BODY"===c.tagName?window:c,this._config=this._getConfig(d),this._selector=""+this._config.target+" "+o.NAV_ANCHORS,this._offsets=[],this._targets=[],this._activeTarget=null,this._scrollHeight=0,a(this._scrollElement).on(m.SCROLL,a.proxy(this._process,this)),this.refresh(),this._process()}return c(i,[{key:"refresh",value:function(){var b=this,c=this._scrollElement!==this._scrollElement.window?p.POSITION:p.OFFSET,e="auto"===this._config.method?c:this._config.method,f=e===p.POSITION?this._getScrollTop():0;this._offsets=[],this._targets=[],this._scrollHeight=this._getScrollHeight();var g=a.makeArray(a(this._selector));g.map(function(b){var c=void 0,g=d.getSelectorFromElement(b);return g&&(c=a(g)[0]),c&&(c.offsetWidth||c.offsetHeight)?[a(c)[e]().top+f,g]:void 0}).filter(function(a){return a}).sort(function(a,b){return a[0]-b[0]}).forEach(function(a){b._offsets.push(a[0]),b._targets.push(a[1])})}},{key:"dispose",value:function(){a.removeData(this._element,g),a(this._scrollElement).off(h),this._element=null,this._scrollElement=null,this._config=null,this._selector=null,this._offsets=null,this._targets=null,this._activeTarget=null,this._scrollHeight=null}},{key:"_getConfig",value:function(b){if(b=a.extend({},k,b),"string"!=typeof b.target){var c=a(b.target).attr("id");c||(c=d.getUID(e),a(b.target).attr("id",c)),b.target="#"+c}return d.typeCheckConfig(e,b,l),b}},{key:"_getScrollTop",value:function(){return this._scrollElement===window?this._scrollElement.scrollY:this._scrollElement.scrollTop}},{key:"_getScrollHeight",value:function(){return this._scrollElement.scrollHeight||Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)}},{key:"_process",value:function(){var a=this._getScrollTop()+this._config.offset,b=this._getScrollHeight(),c=this._config.offset+b-this._scrollElement.offsetHeight;if(this._scrollHeight!==b&&this.refresh(),a>=c){var d=this._targets[this._targets.length-1];this._activeTarget!==d&&this._activate(d)}if(this._activeTarget&&a=this._offsets[e]&&(void 0===this._offsets[e+1]||a .fade",ACTIVE:".active",ACTIVE_CHILD:"> .active",DATA_TOGGLE:'[data-toggle="tab"], [data-toggle="pill"]',DROPDOWN_ACTIVE_CHILD:"> .dropdown-menu > .active"},o=function(){function e(a){b(this,e),this._element=a}return c(e,[{key:"show",value:function(){var b=this;if(!this._element.parentNode||this._element.parentNode.nodeType!=Node.ELEMENT_NODE||!a(this._element).parent().hasClass(m.ACTIVE)){var c=void 0,e=void 0,f=a(this._element).closest(n.UL)[0],g=d.getSelectorFromElement(this._element);f&&(e=a.makeArray(a(f).find(n.ACTIVE)),e=e[e.length-1],e&&(e=a(e).find(n.A)[0]));var h=a.Event(l.HIDE,{relatedTarget:this._element}),i=a.Event(l.SHOW,{relatedTarget:e});if(e&&a(e).trigger(h),a(this._element).trigger(i),!i.isDefaultPrevented()&&!h.isDefaultPrevented()){g&&(c=a(g)[0]),this._activate(a(this._element).closest(n.LI)[0],f);var j=function(){var c=a.Event(l.HIDDEN,{relatedTarget:b._element}),d=a.Event(l.SHOWN,{relatedTarget:e});a(e).trigger(c),a(b._element).trigger(d)};c?this._activate(c,c.parentNode,j):j()}}}},{key:"dispose",value:function(){a.removeClass(this._element,g),this._element=null}},{key:"_activate",value:function(b,c,e){var f=a(c).find(n.ACTIVE_CHILD)[0],g=e&&d.supportsTransitionEnd()&&(f&&a(f).hasClass(m.FADE)||!!a(c).find(n.FADE_CHILD)[0]),h=a.proxy(this._transitionComplete,this,b,f,g,e); + +f&&g?a(f).one(d.TRANSITION_END,h).emulateTransitionEnd(k):h(),f&&a(f).removeClass(m.IN)}},{key:"_transitionComplete",value:function(b,c,e,f){if(c){a(c).removeClass(m.ACTIVE);var g=a(c).find(n.DROPDOWN_ACTIVE_CHILD)[0];g&&a(g).removeClass(m.ACTIVE);var h=a(c).find(n.DATA_TOGGLE)[0];h&&h.setAttribute("aria-expanded",!1)}a(b).addClass(m.ACTIVE);var i=a(b).find(n.DATA_TOGGLE)[0];if(i&&i.setAttribute("aria-expanded",!0),e?(d.reflow(b),a(b).addClass(m.IN)):a(b).removeClass(m.FADE),b.parentNode&&a(b.parentNode).hasClass(m.DROPDOWN_MENU)){var j=a(b).closest(n.LI_DROPDOWN)[0];j&&a(j).addClass(m.ACTIVE),i=a(b).find(n.DATA_TOGGLE)[0],i&&i.setAttribute("aria-expanded",!0)}f&&f()}}],[{key:"VERSION",get:function(){return f}},{key:"_jQueryInterface",value:function(b){return this.each(function(){var c=a(this),d=c.data(g);d||(d=d=new e(this),c.data(g,d)),"string"==typeof b&&d[b]()})}}]),e}();return a(document).on(l.CLICK_DATA_API,n.DATA_TOGGLE,function(b){b.preventDefault(),o._jQueryInterface.call(a(this),"show")}),a.fn[e]=o._jQueryInterface,a.fn[e].Constructor=o,a.fn[e].noConflict=function(){return a.fn[e]=j,o._jQueryInterface},o}(jQuery),function(a){var e="tooltip",f="4.0.0",g="bs.tooltip",h="."+g,i=a.fn[e],j=150,k="bs-tether",l={animation:!0,template:'',trigger:"hover focus",title:"",delay:0,html:!1,selector:!1,placement:"top",offset:"0 0",constraints:[]},m={animation:"boolean",template:"string",title:"(string|function)",trigger:"string",delay:"(number|object)",html:"boolean",selector:"(string|boolean)",placement:"(string|function)",offset:"string",constraints:"array"},n={TOP:"bottom center",RIGHT:"middle left",BOTTOM:"top center",LEFT:"middle right"},o={IN:"in",OUT:"out"},p={HIDE:"hide"+h,HIDDEN:"hidden"+h,SHOW:"show"+h,SHOWN:"shown"+h,INSERTED:"inserted"+h,CLICK:"click"+h,FOCUSIN:"focusin"+h,FOCUSOUT:"focusout"+h,MOUSEENTER:"mouseenter"+h,MOUSELEAVE:"mouseleave"+h},q={FADE:"fade",IN:"in"},r={TOOLTIP:".tooltip",TOOLTIP_INNER:".tooltip-inner"},s={element:!1,enabled:!1},t={HOVER:"hover",FOCUS:"focus",CLICK:"click",MANUAL:"manual"},u=function(){function i(a,c){b(this,i),this._isEnabled=!0,this._timeout=0,this._hoverState="",this._activeTrigger={},this._tether=null,this.element=a,this.config=this._getConfig(c),this.tip=null,this._setListeners()}return c(i,[{key:"enable",value:function(){this._isEnabled=!0}},{key:"disable",value:function(){this._isEnabled=!1}},{key:"toggleEnabled",value:function(){this._isEnabled=!this._isEnabled}},{key:"toggle",value:function(b){var c=this,d=this.constructor.DATA_KEY;b?(c=a(b.currentTarget).data(d),c||(c=new this.constructor(b.currentTarget,this._getDelegateConfig()),a(b.currentTarget).data(d,c)),c._activeTrigger.click=!c._activeTrigger.click,c._isWithActiveTrigger()?c._enter(null,c):c._leave(null,c)):a(c.getTipElement()).hasClass(q.IN)?c._leave(null,c):c._enter(null,c)}},{key:"dispose",value:function(){clearTimeout(this._timeout),this.cleanupTether(),a.removeData(this.element,this.constructor.DATA_KEY),a(this.element).off(this.constructor.EVENT_KEY),this.tip&&a(this.tip).remove(),this._isEnabled=null,this._timeout=null,this._hoverState=null,this._activeTrigger=null,this._tether=null,this.element=null,this.config=null,this.tip=null}},{key:"show",value:function(){var b=this,c=a.Event(this.constructor.Event.SHOW);if(this.isWithContent()&&this._isEnabled){a(this.element).trigger(c);var e=a.contains(this.element.ownerDocument.documentElement,this.element);if(c.isDefaultPrevented()||!e)return;var f=this.getTipElement(),g=d.getUID(this.constructor.NAME);f.setAttribute("id",g),this.element.setAttribute("aria-describedby",g),this.setContent(),this.config.animation&&a(f).addClass(q.FADE);var h="function"==typeof this.config.placement?this.config.placement.call(this,f,this.element):this.config.placement,j=this._getAttachment(h);a(f).data(this.constructor.DATA_KEY,this).appendTo(document.body),a(this.element).trigger(this.constructor.Event.INSERTED),this._tether=new Tether({element:f,target:this.element,attachment:j,classes:s,classPrefix:k,offset:this.config.offset,constraints:this.config.constraints}),d.reflow(f),this._tether.position(),a(f).addClass(q.IN);var l=function(){var c=b._hoverState;b._hoverState=null,a(b.element).trigger(b.constructor.Event.SHOWN),c===o.OUT&&b._leave(null,b)};d.supportsTransitionEnd()&&a(this.tip).hasClass(q.FADE)?a(this.tip).one(d.TRANSITION_END,l).emulateTransitionEnd(i._TRANSITION_DURATION):l()}}},{key:"hide",value:function(b){var c=this,e=this.getTipElement(),f=a.Event(this.constructor.Event.HIDE),g=function(){c._hoverState!==o.IN&&e.parentNode&&e.parentNode.removeChild(e),c.element.removeAttribute("aria-describedby"),a(c.element).trigger(c.constructor.Event.HIDDEN),c.cleanupTether(),b&&b()};a(this.element).trigger(f),f.isDefaultPrevented()||(a(e).removeClass(q.IN),d.supportsTransitionEnd()&&a(this.tip).hasClass(q.FADE)?a(e).one(d.TRANSITION_END,g).emulateTransitionEnd(j):g(),this._hoverState="")}},{key:"isWithContent",value:function(){return!!this.getTitle()}},{key:"getTipElement",value:function(){return this.tip=this.tip||a(this.config.template)[0]}},{key:"setContent",value:function(){var b=this.getTipElement(),c=this.getTitle(),d=this.config.html?"innerHTML":"innerText";a(b).find(r.TOOLTIP_INNER)[0][d]=c,a(b).removeClass(q.FADE).removeClass(q.IN),this.cleanupTether()}},{key:"getTitle",value:function(){var a=this.element.getAttribute("data-original-title");return a||(a="function"==typeof this.config.title?this.config.title.call(this.element):this.config.title),a}},{key:"cleanupTether",value:function(){this._tether&&(this._tether.destroy(),a(this.element).removeClass(this._removeTetherClasses),a(this.tip).removeClass(this._removeTetherClasses))}},{key:"_getAttachment",value:function(a){return n[a.toUpperCase()]}},{key:"_setListeners",value:function(){var b=this,c=this.config.trigger.split(" ");c.forEach(function(c){if("click"===c)a(b.element).on(b.constructor.Event.CLICK,b.config.selector,a.proxy(b.toggle,b));else if(c!==t.MANUAL){var d=c==t.HOVER?b.constructor.Event.MOUSEENTER:b.constructor.Event.FOCUSIN,e=c==t.HOVER?b.constructor.Event.MOUSELEAVE:b.constructor.Event.FOCUSOUT;a(b.element).on(d,b.config.selector,a.proxy(b._enter,b)).on(e,b.config.selector,a.proxy(b._leave,b))}}),this.config.selector?this.config=a.extend({},this.config,{trigger:"manual",selector:""}):this._fixTitle()}},{key:"_removeTetherClasses",value:function(a,b){return((b.baseVal||b).match(new RegExp("(^|\\s)"+k+"-\\S+","g"))||[]).join(" ")}},{key:"_fixTitle",value:function(){var a=typeof this.element.getAttribute("data-original-title");(this.element.getAttribute("title")||"string"!==a)&&(this.element.setAttribute("data-original-title",this.element.getAttribute("title")||""),this.element.setAttribute("title",""))}},{key:"_enter",value:function(b,c){var d=this.constructor.DATA_KEY;return c=c||a(b.currentTarget).data(d),c||(c=new this.constructor(b.currentTarget,this._getDelegateConfig()),a(b.currentTarget).data(d,c)),b&&(c._activeTrigger["focusin"==b.type?t.FOCUS:t.HOVER]=!0),a(c.getTipElement()).hasClass(q.IN)||c._hoverState===o.IN?void(c._hoverState=o.IN):(clearTimeout(c._timeout),c._hoverState=o.IN,c.config.delay&&c.config.delay.show?void(c._timeout=setTimeout(function(){c._hoverState===o.IN&&c.show()},c.config.delay.show)):void c.show())}},{key:"_leave",value:function(b,c){var d=this.constructor.DATA_KEY;return c=c||a(b.currentTarget).data(d),c||(c=new this.constructor(b.currentTarget,this._getDelegateConfig()),a(b.currentTarget).data(d,c)),b&&(c._activeTrigger["focusout"==b.type?t.FOCUS:t.HOVER]=!1),c._isWithActiveTrigger()?void 0:(clearTimeout(c._timeout),c._hoverState=o.OUT,c.config.delay&&c.config.delay.hide?void(c._timeout=setTimeout(function(){c._hoverState===o.OUT&&c.hide()},c.config.delay.hide)):void c.hide())}},{key:"_isWithActiveTrigger",value:function(){for(var a in this._activeTrigger)if(this._activeTrigger[a])return!0;return!1}},{key:"_getConfig",value:function(b){return b=a.extend({},this.constructor.Default,a(this.element).data(),b),b.delay&&"number"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),d.typeCheckConfig(e,b,this.constructor.DefaultType),b}},{key:"_getDelegateConfig",value:function(){var a={};if(this.config)for(var b in this.config){var c=this.config[b];this.constructor.Default[b]!==c&&(a[b]=c)}return a}}],[{key:"VERSION",get:function(){return f}},{key:"Default",get:function(){return l}},{key:"NAME",get:function(){return e}},{key:"DATA_KEY",get:function(){return g}},{key:"Event",get:function(){return p}},{key:"EVENT_KEY",get:function(){return h}},{key:"DefaultType",get:function(){return m}},{key:"_jQueryInterface",value:function(b){return this.each(function(){var c=a(this).data(g),d="object"==typeof b?b:null;(c||!/destroy|hide/.test(b))&&(c||(c=new i(this,d),a(this).data(g,c)),"string"==typeof b&&c[b]())})}}]),i}();return a.fn[e]=u._jQueryInterface,a.fn[e].Constructor=u,a.fn[e].noConflict=function(){return a.fn[e]=i,u._jQueryInterface},u}(jQuery));!function(d){var f="popover",g="4.0.0",h="bs.popover",i="."+h,j=d.fn[f],k=d.extend({},e.Default,{placement:"right",trigger:"click",content:"",template:''}),l=d.extend({},e.DefaultType,{content:"(string|function)"}),m={FADE:"fade",IN:"in"},n={TITLE:".popover-title",CONTENT:".popover-content",ARROW:".popover-arrow"},o={HIDE:"hide"+i,HIDDEN:"hidden"+i,SHOW:"show"+i,SHOWN:"shown"+i,INSERTED:"inserted"+i,CLICK:"click"+i,FOCUSIN:"focusin"+i,FOCUSOUT:"focusout"+i,MOUSEENTER:"mouseenter"+i,MOUSELEAVE:"mouseleave"+i},p=function(e){function j(){b(this,j),null!=e&&e.apply(this,arguments)}return a(j,e),c(j,[{key:"isWithContent",value:function(){return this.getTitle()||this._getContent()}},{key:"getTipElement",value:function(){return this.tip=this.tip||d(this.config.template)[0]}},{key:"setContent",value:function(){var a=this.getTipElement(),b=this.getTitle(),c=this._getContent(),e=d(a).find(n.TITLE)[0];e&&(e[this.config.html?"innerHTML":"innerText"]=b),d(a).find(n.CONTENT).children().detach().end()[this.config.html?"string"==typeof c?"html":"append":"text"](c),d(a).removeClass(m.FADE).removeClass(m.IN),this.cleanupTether()}},{key:"_getContent",value:function(){return this.element.getAttribute("data-content")||("function"==typeof this.config.content?this.config.content.call(this.element):this.config.content)}}],[{key:"VERSION",get:function(){return g}},{key:"Default",get:function(){return k}},{key:"NAME",get:function(){return f}},{key:"DATA_KEY",get:function(){return h}},{key:"Event",get:function(){return o}},{key:"EVENT_KEY",get:function(){return i}},{key:"DefaultType",get:function(){return l}},{key:"_jQueryInterface",value:function(a){return this.each(function(){var b=d(this).data(h),c="object"==typeof a?a:null;(b||!/destroy|hide/.test(a))&&(b||(b=new j(this,c),d(this).data(h,b)),"string"==typeof a&&b[a]())})}}]),j}(e);return d.fn[f]=p._jQueryInterface,d.fn[f].Constructor=p,d.fn[f].noConflict=function(){return d.fn[f]=j,p._jQueryInterface},p}(jQuery)}}(jQuery); \ No newline at end of file diff --git a/dist/js/umd/carousel.js b/dist/js/umd/carousel.js index a2faa92f0..1352a5dc2 100644 --- a/dist/js/umd/carousel.js +++ b/dist/js/umd/carousel.js @@ -52,6 +52,14 @@ wrap: true }; + var DefaultType = { + interval: '(number|boolean)', + keyboard: 'boolean', + slide: '(boolean|string)', + pause: '(string|boolean)', + wrap: 'boolean' + }; + var Direction = { NEXT: 'next', PREVIOUS: 'prev' @@ -103,7 +111,7 @@ this._isPaused = false; this._isSliding = false; - this._config = config; + this._config = this._getConfig(config); this._element = $(element)[0]; this._indicatorsElement = $(this._element).find(Selector.INDICATORS)[0]; @@ -204,10 +212,17 @@ this._indicatorsElement = null; } }, { - key: '_addEventListeners', + key: '_getConfig', // private + value: function _getConfig(config) { + config = $.extend({}, Default, config); + _Util.typeCheckConfig(NAME, config, DefaultType); + return config; + } + }, { + key: '_addEventListeners', value: function _addEventListeners() { if (this._config.keyboard) { $(this._element).on(Event.KEYDOWN, $.proxy(this._keydown, this)); diff --git a/dist/js/umd/collapse.js b/dist/js/umd/collapse.js index 23784388e..35c29c984 100644 --- a/dist/js/umd/collapse.js +++ b/dist/js/umd/collapse.js @@ -46,7 +46,12 @@ var Default = { toggle: true, - parent: null + parent: '' + }; + + var DefaultType = { + toggle: 'boolean', + parent: 'string' }; var Event = { @@ -86,7 +91,7 @@ this._isTransitioning = false; this._element = element; - this._config = $.extend({}, Default, config); + this._config = this._getConfig(config); this._triggerArray = $.makeArray($('[data-toggle="collapse"][href="#' + element.id + '"],' + ('[data-toggle="collapse"][data-target="#' + element.id + '"]'))); this._parent = this._config.parent ? this._getParent() : null; @@ -247,10 +252,18 @@ this._isTransitioning = null; } }, { - key: '_getDimension', + key: '_getConfig', // private + value: function _getConfig(config) { + config = $.extend({}, Default, config); + config.toggle = !!config.toggle; // coerce string values + _Util.typeCheckConfig(NAME, config, DefaultType); + return config; + } + }, { + key: '_getDimension', value: function _getDimension() { var hasWidth = $(this._element).hasClass(Dimension.WIDTH); return hasWidth ? Dimension.WIDTH : Dimension.HEIGHT; diff --git a/dist/js/umd/modal.js b/dist/js/umd/modal.js index ca518198c..7d4196957 100644 --- a/dist/js/umd/modal.js +++ b/dist/js/umd/modal.js @@ -48,9 +48,17 @@ var Default = { backdrop: true, keyboard: true, + focus: true, show: true }; + var DefaultType = { + backdrop: '(boolean|string)', + keyboard: 'boolean', + focus: 'boolean', + show: 'boolean' + }; + var Event = { HIDE: 'hide' + EVENT_KEY, HIDDEN: 'hidden' + EVENT_KEY, @@ -89,7 +97,7 @@ function Modal(element, config) { _classCallCheck(this, Modal); - this._config = config; + this._config = this._getConfig(config); this._element = element; this._dialog = $(element).find(Selector.DIALOG)[0]; this._backdrop = null; @@ -200,10 +208,17 @@ this._scrollbarWidth = null; } }, { - key: '_showElement', + key: '_getConfig', // private + value: function _getConfig(config) { + config = $.extend({}, Default, config); + _Util.typeCheckConfig(NAME, config, DefaultType); + return config; + } + }, { + key: '_showElement', value: function _showElement(relatedTarget) { var _this2 = this; @@ -223,14 +238,14 @@ $(this._element).addClass(ClassName.IN); - this._enforceFocus(); + if (this._config.focus) this._enforceFocus(); var shownEvent = $.Event(Event.SHOWN, { relatedTarget: relatedTarget }); var transitionComplete = function transitionComplete() { - _this2._element.focus(); + if (_this2._config.focus) _this2._element.focus(); $(_this2._element).trigger(shownEvent); }; diff --git a/dist/js/umd/popover.js b/dist/js/umd/popover.js index fa03c8229..8be0b8056 100644 --- a/dist/js/umd/popover.js +++ b/dist/js/umd/popover.js @@ -51,6 +51,10 @@ template: '' }); + var DefaultType = $.extend({}, _Tooltip2.DefaultType, { + content: '(string|function)' + }); + var ClassName = { FADE: 'fade', IN: 'in' @@ -165,6 +169,11 @@ get: function () { return EVENT_KEY; } + }, { + key: 'DefaultType', + get: function () { + return DefaultType; + } }, { key: '_jQueryInterface', diff --git a/dist/js/umd/scrollspy.js b/dist/js/umd/scrollspy.js index d83153caa..feb77672c 100644 --- a/dist/js/umd/scrollspy.js +++ b/dist/js/umd/scrollspy.js @@ -44,7 +44,15 @@ var JQUERY_NO_CONFLICT = $.fn[NAME]; var Default = { - offset: 10 + offset: 10, + method: 'auto', + target: '' + }; + + var DefaultType = { + offset: 'number', + method: 'string', + target: '(string|element)' }; var Event = { @@ -61,8 +69,14 @@ var Selector = { DATA_SPY: '[data-spy="scroll"]', ACTIVE: '.active', + LI: 'li', LI_DROPDOWN: 'li.dropdown', - LI: 'li' + NAV_ANCHORS: '.nav li > a' + }; + + var OffsetMethod = { + OFFSET: 'offset', + POSITION: 'position' }; /** @@ -77,8 +91,8 @@ this._element = element; this._scrollElement = element.tagName === 'BODY' ? window : element; - this._config = $.extend({}, Default, config); - this._selector = '' + (this._config.target || '') + ' .nav li > a'; + this._config = this._getConfig(config); + this._selector = '' + this._config.target + ' ' + Selector.NAV_ANCHORS; this._offsets = []; this._targets = []; this._activeTarget = null; @@ -98,13 +112,11 @@ value: function refresh() { var _this = this; - var offsetMethod = 'offset'; - var offsetBase = 0; + var autoMethod = this._scrollElement !== this._scrollElement.window ? OffsetMethod.POSITION : OffsetMethod.OFFSET; - if (this._scrollElement !== this._scrollElement.window) { - offsetMethod = 'position'; - offsetBase = this._getScrollTop(); - } + var offsetMethod = this._config.method === 'auto' ? autoMethod : this._config.method; + + var offsetBase = offsetMethod === OffsetMethod.POSITION ? this._getScrollTop() : 0; this._offsets = []; this._targets = []; @@ -150,10 +162,28 @@ this._scrollHeight = null; } }, { - key: '_getScrollTop', + key: '_getConfig', // private + value: function _getConfig(config) { + config = $.extend({}, Default, config); + + if (typeof config.target !== 'string') { + var id = $(config.target).attr('id'); + if (!id) { + id = _Util.getUID(NAME); + $(config.target).attr('id', id); + } + config.target = '#' + id; + } + + _Util.typeCheckConfig(NAME, config, DefaultType); + + return config; + } + }, { + key: '_getScrollTop', value: function _getScrollTop() { return this._scrollElement === window ? this._scrollElement.scrollY : this._scrollElement.scrollTop; } diff --git a/dist/js/umd/tab.js b/dist/js/umd/tab.js index fc1a54693..3fbf4869c 100644 --- a/dist/js/umd/tab.js +++ b/dist/js/umd/tab.js @@ -236,11 +236,6 @@ get: function () { return VERSION; } - }, { - key: 'Default', - get: function () { - return Default; - } }, { key: '_jQueryInterface', diff --git a/dist/js/umd/tooltip.js b/dist/js/umd/tooltip.js index a2c692ecc..07142ccd3 100644 --- a/dist/js/umd/tooltip.js +++ b/dist/js/umd/tooltip.js @@ -54,7 +54,20 @@ selector: false, placement: 'top', offset: '0 0', - constraints: null + constraints: [] + }; + + var DefaultType = { + animation: 'boolean', + template: 'string', + title: '(string|function)', + trigger: 'string', + delay: '(number|object)', + html: 'boolean', + selector: '(string|boolean)', + placement: '(string|function)', + offset: 'string', + constraints: 'array' }; var AttachmentMap = { @@ -493,6 +506,8 @@ }; } + _Util.typeCheckConfig(NAME, config, this.constructor.DefaultType); + return config; } }, { @@ -544,6 +559,11 @@ get: function () { return EVENT_KEY; } + }, { + key: 'DefaultType', + get: function () { + return DefaultType; + } }, { key: '_jQueryInterface', diff --git a/dist/js/umd/util.js b/dist/js/umd/util.js index ac8d8d114..a813505c8 100644 --- a/dist/js/umd/util.js +++ b/dist/js/umd/util.js @@ -37,6 +37,15 @@ transition: 'transitionend' }; + // shoutout AngusCroll (https://goo.gl/pxwQGp) + function toType(obj) { + return ({}).toString.call(obj).match(/\s([a-zA-Z]+)/)[1].toLowerCase(); + } + + function isElement(obj) { + return (obj[0] || obj).nodeType; + } + function getSpecialTransitionEndEvent() { return { bindType: transition.end, @@ -129,6 +138,21 @@ supportsTransitionEnd: function supportsTransitionEnd() { return !!transition; + }, + + typeCheckConfig: function typeCheckConfig(componentName, config, configTypes) { + + for (var property in configTypes) { + var expectedTypes = configTypes[property]; + var value = config[property]; + var valueType = undefined; + + if (value && isElement(value)) valueType = 'element';else valueType = toType(value); + + if (!new RegExp(expectedTypes).test(valueType)) { + throw new Error('' + componentName.toUpperCase() + ': ' + ('Option "' + property + '" provided type "' + valueType + '" ') + ('but expected type "' + expectedTypes + '".')); + } + } } }; -- cgit v1.2.3