bootstrap.js 97 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535
  1. /*!
  2. * Bootstrap v4.0.0-alpha.6 (https://getbootstrap.com)
  3. * Copyright 2011-2017 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
  4. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  5. */
  6. if (typeof jQuery === 'undefined') {
  7. throw new Error('Bootstrap\'s JavaScript requires jQuery. jQuery must be included before Bootstrap\'s JavaScript.')
  8. }
  9. +function ($) {
  10. var version = $.fn.jquery.split(' ')[0].split('.')
  11. if ((version[0] < 2 && version[1] < 9) || (version[0] == 1 && version[1] == 9 && version[2] < 1) || (version[0] >= 4)) {
  12. throw new Error('Bootstrap\'s JavaScript requires at least jQuery v1.9.1 but less than v4.0.0')
  13. }
  14. }(jQuery);
  15. +function () {
  16. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
  17. 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; }; }();
  18. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  19. 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) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  20. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  21. /**
  22. * --------------------------------------------------------------------------
  23. * Bootstrap (v4.0.0-alpha.6): util.js
  24. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  25. * --------------------------------------------------------------------------
  26. */
  27. var Util = function ($) {
  28. /**
  29. * ------------------------------------------------------------------------
  30. * Private TransitionEnd Helpers
  31. * ------------------------------------------------------------------------
  32. */
  33. var transition = false;
  34. var MAX_UID = 1000000;
  35. var TransitionEndEvent = {
  36. WebkitTransition: 'webkitTransitionEnd',
  37. MozTransition: 'transitionend',
  38. OTransition: 'oTransitionEnd otransitionend',
  39. transition: 'transitionend'
  40. };
  41. // shoutout AngusCroll (https://goo.gl/pxwQGp)
  42. function toType(obj) {
  43. return {}.toString.call(obj).match(/\s([a-zA-Z]+)/)[1].toLowerCase();
  44. }
  45. function isElement(obj) {
  46. return (obj[0] || obj).nodeType;
  47. }
  48. function getSpecialTransitionEndEvent() {
  49. return {
  50. bindType: transition.end,
  51. delegateType: transition.end,
  52. handle: function handle(event) {
  53. if ($(event.target).is(this)) {
  54. return event.handleObj.handler.apply(this, arguments); // eslint-disable-line prefer-rest-params
  55. }
  56. return undefined;
  57. }
  58. };
  59. }
  60. function transitionEndTest() {
  61. if (window.QUnit) {
  62. return false;
  63. }
  64. var el = document.createElement('bootstrap');
  65. for (var name in TransitionEndEvent) {
  66. if (el.style[name] !== undefined) {
  67. return {
  68. end: TransitionEndEvent[name]
  69. };
  70. }
  71. }
  72. return false;
  73. }
  74. function transitionEndEmulator(duration) {
  75. var _this = this;
  76. var called = false;
  77. $(this).one(Util.TRANSITION_END, function () {
  78. called = true;
  79. });
  80. setTimeout(function () {
  81. if (!called) {
  82. Util.triggerTransitionEnd(_this);
  83. }
  84. }, duration);
  85. return this;
  86. }
  87. function setTransitionEndSupport() {
  88. transition = transitionEndTest();
  89. $.fn.emulateTransitionEnd = transitionEndEmulator;
  90. if (Util.supportsTransitionEnd()) {
  91. $.event.special[Util.TRANSITION_END] = getSpecialTransitionEndEvent();
  92. }
  93. }
  94. /**
  95. * --------------------------------------------------------------------------
  96. * Public Util Api
  97. * --------------------------------------------------------------------------
  98. */
  99. var Util = {
  100. TRANSITION_END: 'bsTransitionEnd',
  101. getUID: function getUID(prefix) {
  102. do {
  103. // eslint-disable-next-line no-bitwise
  104. prefix += ~~(Math.random() * MAX_UID); // "~~" acts like a faster Math.floor() here
  105. } while (document.getElementById(prefix));
  106. return prefix;
  107. },
  108. getSelectorFromElement: function getSelectorFromElement(element) {
  109. var selector = element.getAttribute('data-target');
  110. if (!selector) {
  111. selector = element.getAttribute('href') || '';
  112. selector = /^#[a-z]/i.test(selector) ? selector : null;
  113. }
  114. return selector;
  115. },
  116. reflow: function reflow(element) {
  117. return element.offsetHeight;
  118. },
  119. triggerTransitionEnd: function triggerTransitionEnd(element) {
  120. $(element).trigger(transition.end);
  121. },
  122. supportsTransitionEnd: function supportsTransitionEnd() {
  123. return Boolean(transition);
  124. },
  125. typeCheckConfig: function typeCheckConfig(componentName, config, configTypes) {
  126. for (var property in configTypes) {
  127. if (configTypes.hasOwnProperty(property)) {
  128. var expectedTypes = configTypes[property];
  129. var value = config[property];
  130. var valueType = value && isElement(value) ? 'element' : toType(value);
  131. if (!new RegExp(expectedTypes).test(valueType)) {
  132. throw new Error(componentName.toUpperCase() + ': ' + ('Option "' + property + '" provided type "' + valueType + '" ') + ('but expected type "' + expectedTypes + '".'));
  133. }
  134. }
  135. }
  136. }
  137. };
  138. setTransitionEndSupport();
  139. return Util;
  140. }(jQuery);
  141. /**
  142. * --------------------------------------------------------------------------
  143. * Bootstrap (v4.0.0-alpha.6): alert.js
  144. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  145. * --------------------------------------------------------------------------
  146. */
  147. var Alert = function ($) {
  148. /**
  149. * ------------------------------------------------------------------------
  150. * Constants
  151. * ------------------------------------------------------------------------
  152. */
  153. var NAME = 'alert';
  154. var VERSION = '4.0.0-alpha.6';
  155. var DATA_KEY = 'bs.alert';
  156. var EVENT_KEY = '.' + DATA_KEY;
  157. var DATA_API_KEY = '.data-api';
  158. var JQUERY_NO_CONFLICT = $.fn[NAME];
  159. var TRANSITION_DURATION = 150;
  160. var Selector = {
  161. DISMISS: '[data-dismiss="alert"]'
  162. };
  163. var Event = {
  164. CLOSE: 'close' + EVENT_KEY,
  165. CLOSED: 'closed' + EVENT_KEY,
  166. CLICK_DATA_API: 'click' + EVENT_KEY + DATA_API_KEY
  167. };
  168. var ClassName = {
  169. ALERT: 'alert',
  170. FADE: 'fade',
  171. SHOW: 'show'
  172. };
  173. /**
  174. * ------------------------------------------------------------------------
  175. * Class Definition
  176. * ------------------------------------------------------------------------
  177. */
  178. var Alert = function () {
  179. function Alert(element) {
  180. _classCallCheck(this, Alert);
  181. this._element = element;
  182. }
  183. // getters
  184. // public
  185. Alert.prototype.close = function close(element) {
  186. element = element || this._element;
  187. var rootElement = this._getRootElement(element);
  188. var customEvent = this._triggerCloseEvent(rootElement);
  189. if (customEvent.isDefaultPrevented()) {
  190. return;
  191. }
  192. this._removeElement(rootElement);
  193. };
  194. Alert.prototype.dispose = function dispose() {
  195. $.removeData(this._element, DATA_KEY);
  196. this._element = null;
  197. };
  198. // private
  199. Alert.prototype._getRootElement = function _getRootElement(element) {
  200. var selector = Util.getSelectorFromElement(element);
  201. var parent = false;
  202. if (selector) {
  203. parent = $(selector)[0];
  204. }
  205. if (!parent) {
  206. parent = $(element).closest('.' + ClassName.ALERT)[0];
  207. }
  208. return parent;
  209. };
  210. Alert.prototype._triggerCloseEvent = function _triggerCloseEvent(element) {
  211. var closeEvent = $.Event(Event.CLOSE);
  212. $(element).trigger(closeEvent);
  213. return closeEvent;
  214. };
  215. Alert.prototype._removeElement = function _removeElement(element) {
  216. var _this2 = this;
  217. $(element).removeClass(ClassName.SHOW);
  218. if (!Util.supportsTransitionEnd() || !$(element).hasClass(ClassName.FADE)) {
  219. this._destroyElement(element);
  220. return;
  221. }
  222. $(element).one(Util.TRANSITION_END, function (event) {
  223. return _this2._destroyElement(element, event);
  224. }).emulateTransitionEnd(TRANSITION_DURATION);
  225. };
  226. Alert.prototype._destroyElement = function _destroyElement(element) {
  227. $(element).detach().trigger(Event.CLOSED).remove();
  228. };
  229. // static
  230. Alert._jQueryInterface = function _jQueryInterface(config) {
  231. return this.each(function () {
  232. var $element = $(this);
  233. var data = $element.data(DATA_KEY);
  234. if (!data) {
  235. data = new Alert(this);
  236. $element.data(DATA_KEY, data);
  237. }
  238. if (config === 'close') {
  239. data[config](this);
  240. }
  241. });
  242. };
  243. Alert._handleDismiss = function _handleDismiss(alertInstance) {
  244. return function (event) {
  245. if (event) {
  246. event.preventDefault();
  247. }
  248. alertInstance.close(this);
  249. };
  250. };
  251. _createClass(Alert, null, [{
  252. key: 'VERSION',
  253. get: function get() {
  254. return VERSION;
  255. }
  256. }]);
  257. return Alert;
  258. }();
  259. /**
  260. * ------------------------------------------------------------------------
  261. * Data Api implementation
  262. * ------------------------------------------------------------------------
  263. */
  264. $(document).on(Event.CLICK_DATA_API, Selector.DISMISS, Alert._handleDismiss(new Alert()));
  265. /**
  266. * ------------------------------------------------------------------------
  267. * jQuery
  268. * ------------------------------------------------------------------------
  269. */
  270. $.fn[NAME] = Alert._jQueryInterface;
  271. $.fn[NAME].Constructor = Alert;
  272. $.fn[NAME].noConflict = function () {
  273. $.fn[NAME] = JQUERY_NO_CONFLICT;
  274. return Alert._jQueryInterface;
  275. };
  276. return Alert;
  277. }(jQuery);
  278. /**
  279. * --------------------------------------------------------------------------
  280. * Bootstrap (v4.0.0-alpha.6): button.js
  281. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  282. * --------------------------------------------------------------------------
  283. */
  284. var Button = function ($) {
  285. /**
  286. * ------------------------------------------------------------------------
  287. * Constants
  288. * ------------------------------------------------------------------------
  289. */
  290. var NAME = 'button';
  291. var VERSION = '4.0.0-alpha.6';
  292. var DATA_KEY = 'bs.button';
  293. var EVENT_KEY = '.' + DATA_KEY;
  294. var DATA_API_KEY = '.data-api';
  295. var JQUERY_NO_CONFLICT = $.fn[NAME];
  296. var ClassName = {
  297. ACTIVE: 'active',
  298. BUTTON: 'btn',
  299. FOCUS: 'focus'
  300. };
  301. var Selector = {
  302. DATA_TOGGLE_CARROT: '[data-toggle^="button"]',
  303. DATA_TOGGLE: '[data-toggle="buttons"]',
  304. INPUT: 'input',
  305. ACTIVE: '.active',
  306. BUTTON: '.btn'
  307. };
  308. var Event = {
  309. CLICK_DATA_API: 'click' + EVENT_KEY + DATA_API_KEY,
  310. FOCUS_BLUR_DATA_API: 'focus' + EVENT_KEY + DATA_API_KEY + ' ' + ('blur' + EVENT_KEY + DATA_API_KEY)
  311. };
  312. /**
  313. * ------------------------------------------------------------------------
  314. * Class Definition
  315. * ------------------------------------------------------------------------
  316. */
  317. var Button = function () {
  318. function Button(element) {
  319. _classCallCheck(this, Button);
  320. this._element = element;
  321. }
  322. // getters
  323. // public
  324. Button.prototype.toggle = function toggle() {
  325. var triggerChangeEvent = true;
  326. var rootElement = $(this._element).closest(Selector.DATA_TOGGLE)[0];
  327. if (rootElement) {
  328. var input = $(this._element).find(Selector.INPUT)[0];
  329. if (input) {
  330. if (input.type === 'radio') {
  331. if (input.checked && $(this._element).hasClass(ClassName.ACTIVE)) {
  332. triggerChangeEvent = false;
  333. } else {
  334. var activeElement = $(rootElement).find(Selector.ACTIVE)[0];
  335. if (activeElement) {
  336. $(activeElement).removeClass(ClassName.ACTIVE);
  337. }
  338. }
  339. }
  340. if (triggerChangeEvent) {
  341. input.checked = !$(this._element).hasClass(ClassName.ACTIVE);
  342. $(input).trigger('change');
  343. }
  344. input.focus();
  345. }
  346. }
  347. this._element.setAttribute('aria-pressed', !$(this._element).hasClass(ClassName.ACTIVE));
  348. if (triggerChangeEvent) {
  349. $(this._element).toggleClass(ClassName.ACTIVE);
  350. }
  351. };
  352. Button.prototype.dispose = function dispose() {
  353. $.removeData(this._element, DATA_KEY);
  354. this._element = null;
  355. };
  356. // static
  357. Button._jQueryInterface = function _jQueryInterface(config) {
  358. return this.each(function () {
  359. var data = $(this).data(DATA_KEY);
  360. if (!data) {
  361. data = new Button(this);
  362. $(this).data(DATA_KEY, data);
  363. }
  364. if (config === 'toggle') {
  365. data[config]();
  366. }
  367. });
  368. };
  369. _createClass(Button, null, [{
  370. key: 'VERSION',
  371. get: function get() {
  372. return VERSION;
  373. }
  374. }]);
  375. return Button;
  376. }();
  377. /**
  378. * ------------------------------------------------------------------------
  379. * Data Api implementation
  380. * ------------------------------------------------------------------------
  381. */
  382. $(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE_CARROT, function (event) {
  383. event.preventDefault();
  384. var button = event.target;
  385. if (!$(button).hasClass(ClassName.BUTTON)) {
  386. button = $(button).closest(Selector.BUTTON);
  387. }
  388. Button._jQueryInterface.call($(button), 'toggle');
  389. }).on(Event.FOCUS_BLUR_DATA_API, Selector.DATA_TOGGLE_CARROT, function (event) {
  390. var button = $(event.target).closest(Selector.BUTTON)[0];
  391. $(button).toggleClass(ClassName.FOCUS, /^focus(in)?$/.test(event.type));
  392. });
  393. /**
  394. * ------------------------------------------------------------------------
  395. * jQuery
  396. * ------------------------------------------------------------------------
  397. */
  398. $.fn[NAME] = Button._jQueryInterface;
  399. $.fn[NAME].Constructor = Button;
  400. $.fn[NAME].noConflict = function () {
  401. $.fn[NAME] = JQUERY_NO_CONFLICT;
  402. return Button._jQueryInterface;
  403. };
  404. return Button;
  405. }(jQuery);
  406. /**
  407. * --------------------------------------------------------------------------
  408. * Bootstrap (v4.0.0-alpha.6): carousel.js
  409. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  410. * --------------------------------------------------------------------------
  411. */
  412. var Carousel = function ($) {
  413. /**
  414. * ------------------------------------------------------------------------
  415. * Constants
  416. * ------------------------------------------------------------------------
  417. */
  418. var NAME = 'carousel';
  419. var VERSION = '4.0.0-alpha.6';
  420. var DATA_KEY = 'bs.carousel';
  421. var EVENT_KEY = '.' + DATA_KEY;
  422. var DATA_API_KEY = '.data-api';
  423. var JQUERY_NO_CONFLICT = $.fn[NAME];
  424. var TRANSITION_DURATION = 600;
  425. var ARROW_LEFT_KEYCODE = 37; // KeyboardEvent.which value for left arrow key
  426. var ARROW_RIGHT_KEYCODE = 39; // KeyboardEvent.which value for right arrow key
  427. var Default = {
  428. interval: 5000,
  429. keyboard: true,
  430. slide: false,
  431. pause: 'hover',
  432. wrap: true
  433. };
  434. var DefaultType = {
  435. interval: '(number|boolean)',
  436. keyboard: 'boolean',
  437. slide: '(boolean|string)',
  438. pause: '(string|boolean)',
  439. wrap: 'boolean'
  440. };
  441. var Direction = {
  442. NEXT: 'next',
  443. PREV: 'prev',
  444. LEFT: 'left',
  445. RIGHT: 'right'
  446. };
  447. var Event = {
  448. SLIDE: 'slide' + EVENT_KEY,
  449. SLID: 'slid' + EVENT_KEY,
  450. KEYDOWN: 'keydown' + EVENT_KEY,
  451. MOUSEENTER: 'mouseenter' + EVENT_KEY,
  452. MOUSELEAVE: 'mouseleave' + EVENT_KEY,
  453. LOAD_DATA_API: 'load' + EVENT_KEY + DATA_API_KEY,
  454. CLICK_DATA_API: 'click' + EVENT_KEY + DATA_API_KEY
  455. };
  456. var ClassName = {
  457. CAROUSEL: 'carousel',
  458. ACTIVE: 'active',
  459. SLIDE: 'slide',
  460. RIGHT: 'carousel-item-right',
  461. LEFT: 'carousel-item-left',
  462. NEXT: 'carousel-item-next',
  463. PREV: 'carousel-item-prev',
  464. ITEM: 'carousel-item'
  465. };
  466. var Selector = {
  467. ACTIVE: '.active',
  468. ACTIVE_ITEM: '.active.carousel-item',
  469. ITEM: '.carousel-item',
  470. NEXT_PREV: '.carousel-item-next, .carousel-item-prev',
  471. INDICATORS: '.carousel-indicators',
  472. DATA_SLIDE: '[data-slide], [data-slide-to]',
  473. DATA_RIDE: '[data-ride="carousel"]'
  474. };
  475. /**
  476. * ------------------------------------------------------------------------
  477. * Class Definition
  478. * ------------------------------------------------------------------------
  479. */
  480. var Carousel = function () {
  481. function Carousel(element, config) {
  482. _classCallCheck(this, Carousel);
  483. this._items = null;
  484. this._interval = null;
  485. this._activeElement = null;
  486. this._isPaused = false;
  487. this._isSliding = false;
  488. this._config = this._getConfig(config);
  489. this._element = $(element)[0];
  490. this._indicatorsElement = $(this._element).find(Selector.INDICATORS)[0];
  491. this._addEventListeners();
  492. }
  493. // getters
  494. // public
  495. Carousel.prototype.next = function next() {
  496. if (this._isSliding) {
  497. throw new Error('Carousel is sliding');
  498. }
  499. this._slide(Direction.NEXT);
  500. };
  501. Carousel.prototype.nextWhenVisible = function nextWhenVisible() {
  502. // Don't call next when the page isn't visible
  503. if (!document.hidden) {
  504. this.next();
  505. }
  506. };
  507. Carousel.prototype.prev = function prev() {
  508. if (this._isSliding) {
  509. throw new Error('Carousel is sliding');
  510. }
  511. this._slide(Direction.PREVIOUS);
  512. };
  513. Carousel.prototype.pause = function pause(event) {
  514. if (!event) {
  515. this._isPaused = true;
  516. }
  517. if ($(this._element).find(Selector.NEXT_PREV)[0] && Util.supportsTransitionEnd()) {
  518. Util.triggerTransitionEnd(this._element);
  519. this.cycle(true);
  520. }
  521. clearInterval(this._interval);
  522. this._interval = null;
  523. };
  524. Carousel.prototype.cycle = function cycle(event) {
  525. if (!event) {
  526. this._isPaused = false;
  527. }
  528. if (this._interval) {
  529. clearInterval(this._interval);
  530. this._interval = null;
  531. }
  532. if (this._config.interval && !this._isPaused) {
  533. this._interval = setInterval((document.visibilityState ? this.nextWhenVisible : this.next).bind(this), this._config.interval);
  534. }
  535. };
  536. Carousel.prototype.to = function to(index) {
  537. var _this3 = this;
  538. this._activeElement = $(this._element).find(Selector.ACTIVE_ITEM)[0];
  539. var activeIndex = this._getItemIndex(this._activeElement);
  540. if (index > this._items.length - 1 || index < 0) {
  541. return;
  542. }
  543. if (this._isSliding) {
  544. $(this._element).one(Event.SLID, function () {
  545. return _this3.to(index);
  546. });
  547. return;
  548. }
  549. if (activeIndex === index) {
  550. this.pause();
  551. this.cycle();
  552. return;
  553. }
  554. var direction = index > activeIndex ? Direction.NEXT : Direction.PREVIOUS;
  555. this._slide(direction, this._items[index]);
  556. };
  557. Carousel.prototype.dispose = function dispose() {
  558. $(this._element).off(EVENT_KEY);
  559. $.removeData(this._element, DATA_KEY);
  560. this._items = null;
  561. this._config = null;
  562. this._element = null;
  563. this._interval = null;
  564. this._isPaused = null;
  565. this._isSliding = null;
  566. this._activeElement = null;
  567. this._indicatorsElement = null;
  568. };
  569. // private
  570. Carousel.prototype._getConfig = function _getConfig(config) {
  571. config = $.extend({}, Default, config);
  572. Util.typeCheckConfig(NAME, config, DefaultType);
  573. return config;
  574. };
  575. Carousel.prototype._addEventListeners = function _addEventListeners() {
  576. var _this4 = this;
  577. if (this._config.keyboard) {
  578. $(this._element).on(Event.KEYDOWN, function (event) {
  579. return _this4._keydown(event);
  580. });
  581. }
  582. if (this._config.pause === 'hover' && !('ontouchstart' in document.documentElement)) {
  583. $(this._element).on(Event.MOUSEENTER, function (event) {
  584. return _this4.pause(event);
  585. }).on(Event.MOUSELEAVE, function (event) {
  586. return _this4.cycle(event);
  587. });
  588. }
  589. };
  590. Carousel.prototype._keydown = function _keydown(event) {
  591. if (/input|textarea/i.test(event.target.tagName)) {
  592. return;
  593. }
  594. switch (event.which) {
  595. case ARROW_LEFT_KEYCODE:
  596. event.preventDefault();
  597. this.prev();
  598. break;
  599. case ARROW_RIGHT_KEYCODE:
  600. event.preventDefault();
  601. this.next();
  602. break;
  603. default:
  604. return;
  605. }
  606. };
  607. Carousel.prototype._getItemIndex = function _getItemIndex(element) {
  608. this._items = $.makeArray($(element).parent().find(Selector.ITEM));
  609. return this._items.indexOf(element);
  610. };
  611. Carousel.prototype._getItemByDirection = function _getItemByDirection(direction, activeElement) {
  612. var isNextDirection = direction === Direction.NEXT;
  613. var isPrevDirection = direction === Direction.PREVIOUS;
  614. var activeIndex = this._getItemIndex(activeElement);
  615. var lastItemIndex = this._items.length - 1;
  616. var isGoingToWrap = isPrevDirection && activeIndex === 0 || isNextDirection && activeIndex === lastItemIndex;
  617. if (isGoingToWrap && !this._config.wrap) {
  618. return activeElement;
  619. }
  620. var delta = direction === Direction.PREVIOUS ? -1 : 1;
  621. var itemIndex = (activeIndex + delta) % this._items.length;
  622. return itemIndex === -1 ? this._items[this._items.length - 1] : this._items[itemIndex];
  623. };
  624. Carousel.prototype._triggerSlideEvent = function _triggerSlideEvent(relatedTarget, eventDirectionName) {
  625. var slideEvent = $.Event(Event.SLIDE, {
  626. relatedTarget: relatedTarget,
  627. direction: eventDirectionName
  628. });
  629. $(this._element).trigger(slideEvent);
  630. return slideEvent;
  631. };
  632. Carousel.prototype._setActiveIndicatorElement = function _setActiveIndicatorElement(element) {
  633. if (this._indicatorsElement) {
  634. $(this._indicatorsElement).find(Selector.ACTIVE).removeClass(ClassName.ACTIVE);
  635. var nextIndicator = this._indicatorsElement.children[this._getItemIndex(element)];
  636. if (nextIndicator) {
  637. $(nextIndicator).addClass(ClassName.ACTIVE);
  638. }
  639. }
  640. };
  641. Carousel.prototype._slide = function _slide(direction, element) {
  642. var _this5 = this;
  643. var activeElement = $(this._element).find(Selector.ACTIVE_ITEM)[0];
  644. var nextElement = element || activeElement && this._getItemByDirection(direction, activeElement);
  645. var isCycling = Boolean(this._interval);
  646. var directionalClassName = void 0;
  647. var orderClassName = void 0;
  648. var eventDirectionName = void 0;
  649. if (direction === Direction.NEXT) {
  650. directionalClassName = ClassName.LEFT;
  651. orderClassName = ClassName.NEXT;
  652. eventDirectionName = Direction.LEFT;
  653. } else {
  654. directionalClassName = ClassName.RIGHT;
  655. orderClassName = ClassName.PREV;
  656. eventDirectionName = Direction.RIGHT;
  657. }
  658. if (nextElement && $(nextElement).hasClass(ClassName.ACTIVE)) {
  659. this._isSliding = false;
  660. return;
  661. }
  662. var slideEvent = this._triggerSlideEvent(nextElement, eventDirectionName);
  663. if (slideEvent.isDefaultPrevented()) {
  664. return;
  665. }
  666. if (!activeElement || !nextElement) {
  667. // some weirdness is happening, so we bail
  668. return;
  669. }
  670. this._isSliding = true;
  671. if (isCycling) {
  672. this.pause();
  673. }
  674. this._setActiveIndicatorElement(nextElement);
  675. var slidEvent = $.Event(Event.SLID, {
  676. relatedTarget: nextElement,
  677. direction: eventDirectionName
  678. });
  679. if (Util.supportsTransitionEnd() && $(this._element).hasClass(ClassName.SLIDE)) {
  680. $(nextElement).addClass(orderClassName);
  681. Util.reflow(nextElement);
  682. $(activeElement).addClass(directionalClassName);
  683. $(nextElement).addClass(directionalClassName);
  684. $(activeElement).one(Util.TRANSITION_END, function () {
  685. $(nextElement).removeClass(directionalClassName + ' ' + orderClassName).addClass(ClassName.ACTIVE);
  686. $(activeElement).removeClass(ClassName.ACTIVE + ' ' + orderClassName + ' ' + directionalClassName);
  687. _this5._isSliding = false;
  688. setTimeout(function () {
  689. return $(_this5._element).trigger(slidEvent);
  690. }, 0);
  691. }).emulateTransitionEnd(TRANSITION_DURATION);
  692. } else {
  693. $(activeElement).removeClass(ClassName.ACTIVE);
  694. $(nextElement).addClass(ClassName.ACTIVE);
  695. this._isSliding = false;
  696. $(this._element).trigger(slidEvent);
  697. }
  698. if (isCycling) {
  699. this.cycle();
  700. }
  701. };
  702. // static
  703. Carousel._jQueryInterface = function _jQueryInterface(config) {
  704. return this.each(function () {
  705. var data = $(this).data(DATA_KEY);
  706. var _config = $.extend({}, Default, $(this).data());
  707. if ((typeof config === 'undefined' ? 'undefined' : _typeof(config)) === 'object') {
  708. $.extend(_config, config);
  709. }
  710. var action = typeof config === 'string' ? config : _config.slide;
  711. if (!data) {
  712. data = new Carousel(this, _config);
  713. $(this).data(DATA_KEY, data);
  714. }
  715. if (typeof config === 'number') {
  716. data.to(config);
  717. } else if (typeof action === 'string') {
  718. if (data[action] === undefined) {
  719. throw new Error('No method named "' + action + '"');
  720. }
  721. data[action]();
  722. } else if (_config.interval) {
  723. data.pause();
  724. data.cycle();
  725. }
  726. });
  727. };
  728. Carousel._dataApiClickHandler = function _dataApiClickHandler(event) {
  729. var selector = Util.getSelectorFromElement(this);
  730. if (!selector) {
  731. return;
  732. }
  733. var target = $(selector)[0];
  734. if (!target || !$(target).hasClass(ClassName.CAROUSEL)) {
  735. return;
  736. }
  737. var config = $.extend({}, $(target).data(), $(this).data());
  738. var slideIndex = this.getAttribute('data-slide-to');
  739. if (slideIndex) {
  740. config.interval = false;
  741. }
  742. Carousel._jQueryInterface.call($(target), config);
  743. if (slideIndex) {
  744. $(target).data(DATA_KEY).to(slideIndex);
  745. }
  746. event.preventDefault();
  747. };
  748. _createClass(Carousel, null, [{
  749. key: 'VERSION',
  750. get: function get() {
  751. return VERSION;
  752. }
  753. }, {
  754. key: 'Default',
  755. get: function get() {
  756. return Default;
  757. }
  758. }]);
  759. return Carousel;
  760. }();
  761. /**
  762. * ------------------------------------------------------------------------
  763. * Data Api implementation
  764. * ------------------------------------------------------------------------
  765. */
  766. $(document).on(Event.CLICK_DATA_API, Selector.DATA_SLIDE, Carousel._dataApiClickHandler);
  767. $(window).on(Event.LOAD_DATA_API, function () {
  768. $(Selector.DATA_RIDE).each(function () {
  769. var $carousel = $(this);
  770. Carousel._jQueryInterface.call($carousel, $carousel.data());
  771. });
  772. });
  773. /**
  774. * ------------------------------------------------------------------------
  775. * jQuery
  776. * ------------------------------------------------------------------------
  777. */
  778. $.fn[NAME] = Carousel._jQueryInterface;
  779. $.fn[NAME].Constructor = Carousel;
  780. $.fn[NAME].noConflict = function () {
  781. $.fn[NAME] = JQUERY_NO_CONFLICT;
  782. return Carousel._jQueryInterface;
  783. };
  784. return Carousel;
  785. }(jQuery);
  786. /**
  787. * --------------------------------------------------------------------------
  788. * Bootstrap (v4.0.0-alpha.6): collapse.js
  789. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  790. * --------------------------------------------------------------------------
  791. */
  792. var Collapse = function ($) {
  793. /**
  794. * ------------------------------------------------------------------------
  795. * Constants
  796. * ------------------------------------------------------------------------
  797. */
  798. var NAME = 'collapse';
  799. var VERSION = '4.0.0-alpha.6';
  800. var DATA_KEY = 'bs.collapse';
  801. var EVENT_KEY = '.' + DATA_KEY;
  802. var DATA_API_KEY = '.data-api';
  803. var JQUERY_NO_CONFLICT = $.fn[NAME];
  804. var TRANSITION_DURATION = 600;
  805. var Default = {
  806. toggle: true,
  807. parent: ''
  808. };
  809. var DefaultType = {
  810. toggle: 'boolean',
  811. parent: 'string'
  812. };
  813. var Event = {
  814. SHOW: 'show' + EVENT_KEY,
  815. SHOWN: 'shown' + EVENT_KEY,
  816. HIDE: 'hide' + EVENT_KEY,
  817. HIDDEN: 'hidden' + EVENT_KEY,
  818. CLICK_DATA_API: 'click' + EVENT_KEY + DATA_API_KEY
  819. };
  820. var ClassName = {
  821. SHOW: 'show',
  822. COLLAPSE: 'collapse',
  823. COLLAPSING: 'collapsing',
  824. COLLAPSED: 'collapsed'
  825. };
  826. var Dimension = {
  827. WIDTH: 'width',
  828. HEIGHT: 'height'
  829. };
  830. var Selector = {
  831. ACTIVES: '.card > .show, .card > .collapsing',
  832. DATA_TOGGLE: '[data-toggle="collapse"]'
  833. };
  834. /**
  835. * ------------------------------------------------------------------------
  836. * Class Definition
  837. * ------------------------------------------------------------------------
  838. */
  839. var Collapse = function () {
  840. function Collapse(element, config) {
  841. _classCallCheck(this, Collapse);
  842. this._isTransitioning = false;
  843. this._element = element;
  844. this._config = this._getConfig(config);
  845. this._triggerArray = $.makeArray($('[data-toggle="collapse"][href="#' + element.id + '"],' + ('[data-toggle="collapse"][data-target="#' + element.id + '"]')));
  846. this._parent = this._config.parent ? this._getParent() : null;
  847. if (!this._config.parent) {
  848. this._addAriaAndCollapsedClass(this._element, this._triggerArray);
  849. }
  850. if (this._config.toggle) {
  851. this.toggle();
  852. }
  853. }
  854. // getters
  855. // public
  856. Collapse.prototype.toggle = function toggle() {
  857. if ($(this._element).hasClass(ClassName.SHOW)) {
  858. this.hide();
  859. } else {
  860. this.show();
  861. }
  862. };
  863. Collapse.prototype.show = function show() {
  864. var _this6 = this;
  865. if (this._isTransitioning) {
  866. throw new Error('Collapse is transitioning');
  867. }
  868. if ($(this._element).hasClass(ClassName.SHOW)) {
  869. return;
  870. }
  871. var actives = void 0;
  872. var activesData = void 0;
  873. if (this._parent) {
  874. actives = $.makeArray($(this._parent).find(Selector.ACTIVES));
  875. if (!actives.length) {
  876. actives = null;
  877. }
  878. }
  879. if (actives) {
  880. activesData = $(actives).data(DATA_KEY);
  881. if (activesData && activesData._isTransitioning) {
  882. return;
  883. }
  884. }
  885. var startEvent = $.Event(Event.SHOW);
  886. $(this._element).trigger(startEvent);
  887. if (startEvent.isDefaultPrevented()) {
  888. return;
  889. }
  890. if (actives) {
  891. Collapse._jQueryInterface.call($(actives), 'hide');
  892. if (!activesData) {
  893. $(actives).data(DATA_KEY, null);
  894. }
  895. }
  896. var dimension = this._getDimension();
  897. $(this._element).removeClass(ClassName.COLLAPSE).addClass(ClassName.COLLAPSING);
  898. this._element.style[dimension] = 0;
  899. this._element.setAttribute('aria-expanded', true);
  900. if (this._triggerArray.length) {
  901. $(this._triggerArray).removeClass(ClassName.COLLAPSED).attr('aria-expanded', true);
  902. }
  903. this.setTransitioning(true);
  904. var complete = function complete() {
  905. $(_this6._element).removeClass(ClassName.COLLAPSING).addClass(ClassName.COLLAPSE).addClass(ClassName.SHOW);
  906. _this6._element.style[dimension] = '';
  907. _this6.setTransitioning(false);
  908. $(_this6._element).trigger(Event.SHOWN);
  909. };
  910. if (!Util.supportsTransitionEnd()) {
  911. complete();
  912. return;
  913. }
  914. var capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1);
  915. var scrollSize = 'scroll' + capitalizedDimension;
  916. $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(TRANSITION_DURATION);
  917. this._element.style[dimension] = this._element[scrollSize] + 'px';
  918. };
  919. Collapse.prototype.hide = function hide() {
  920. var _this7 = this;
  921. if (this._isTransitioning) {
  922. throw new Error('Collapse is transitioning');
  923. }
  924. if (!$(this._element).hasClass(ClassName.SHOW)) {
  925. return;
  926. }
  927. var startEvent = $.Event(Event.HIDE);
  928. $(this._element).trigger(startEvent);
  929. if (startEvent.isDefaultPrevented()) {
  930. return;
  931. }
  932. var dimension = this._getDimension();
  933. var offsetDimension = dimension === Dimension.WIDTH ? 'offsetWidth' : 'offsetHeight';
  934. this._element.style[dimension] = this._element[offsetDimension] + 'px';
  935. Util.reflow(this._element);
  936. $(this._element).addClass(ClassName.COLLAPSING).removeClass(ClassName.COLLAPSE).removeClass(ClassName.SHOW);
  937. this._element.setAttribute('aria-expanded', false);
  938. if (this._triggerArray.length) {
  939. $(this._triggerArray).addClass(ClassName.COLLAPSED).attr('aria-expanded', false);
  940. }
  941. this.setTransitioning(true);
  942. var complete = function complete() {
  943. _this7.setTransitioning(false);
  944. $(_this7._element).removeClass(ClassName.COLLAPSING).addClass(ClassName.COLLAPSE).trigger(Event.HIDDEN);
  945. };
  946. this._element.style[dimension] = '';
  947. if (!Util.supportsTransitionEnd()) {
  948. complete();
  949. return;
  950. }
  951. $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(TRANSITION_DURATION);
  952. };
  953. Collapse.prototype.setTransitioning = function setTransitioning(isTransitioning) {
  954. this._isTransitioning = isTransitioning;
  955. };
  956. Collapse.prototype.dispose = function dispose() {
  957. $.removeData(this._element, DATA_KEY);
  958. this._config = null;
  959. this._parent = null;
  960. this._element = null;
  961. this._triggerArray = null;
  962. this._isTransitioning = null;
  963. };
  964. // private
  965. Collapse.prototype._getConfig = function _getConfig(config) {
  966. config = $.extend({}, Default, config);
  967. config.toggle = Boolean(config.toggle); // coerce string values
  968. Util.typeCheckConfig(NAME, config, DefaultType);
  969. return config;
  970. };
  971. Collapse.prototype._getDimension = function _getDimension() {
  972. var hasWidth = $(this._element).hasClass(Dimension.WIDTH);
  973. return hasWidth ? Dimension.WIDTH : Dimension.HEIGHT;
  974. };
  975. Collapse.prototype._getParent = function _getParent() {
  976. var _this8 = this;
  977. var parent = $(this._config.parent)[0];
  978. var selector = '[data-toggle="collapse"][data-parent="' + this._config.parent + '"]';
  979. $(parent).find(selector).each(function (i, element) {
  980. _this8._addAriaAndCollapsedClass(Collapse._getTargetFromElement(element), [element]);
  981. });
  982. return parent;
  983. };
  984. Collapse.prototype._addAriaAndCollapsedClass = function _addAriaAndCollapsedClass(element, triggerArray) {
  985. if (element) {
  986. var isOpen = $(element).hasClass(ClassName.SHOW);
  987. element.setAttribute('aria-expanded', isOpen);
  988. if (triggerArray.length) {
  989. $(triggerArray).toggleClass(ClassName.COLLAPSED, !isOpen).attr('aria-expanded', isOpen);
  990. }
  991. }
  992. };
  993. // static
  994. Collapse._getTargetFromElement = function _getTargetFromElement(element) {
  995. var selector = Util.getSelectorFromElement(element);
  996. return selector ? $(selector)[0] : null;
  997. };
  998. Collapse._jQueryInterface = function _jQueryInterface(config) {
  999. return this.each(function () {
  1000. var $this = $(this);
  1001. var data = $this.data(DATA_KEY);
  1002. var _config = $.extend({}, Default, $this.data(), (typeof config === 'undefined' ? 'undefined' : _typeof(config)) === 'object' && config);
  1003. if (!data && _config.toggle && /show|hide/.test(config)) {
  1004. _config.toggle = false;
  1005. }
  1006. if (!data) {
  1007. data = new Collapse(this, _config);
  1008. $this.data(DATA_KEY, data);
  1009. }
  1010. if (typeof config === 'string') {
  1011. if (data[config] === undefined) {
  1012. throw new Error('No method named "' + config + '"');
  1013. }
  1014. data[config]();
  1015. }
  1016. });
  1017. };
  1018. _createClass(Collapse, null, [{
  1019. key: 'VERSION',
  1020. get: function get() {
  1021. return VERSION;
  1022. }
  1023. }, {
  1024. key: 'Default',
  1025. get: function get() {
  1026. return Default;
  1027. }
  1028. }]);
  1029. return Collapse;
  1030. }();
  1031. /**
  1032. * ------------------------------------------------------------------------
  1033. * Data Api implementation
  1034. * ------------------------------------------------------------------------
  1035. */
  1036. $(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {
  1037. event.preventDefault();
  1038. var target = Collapse._getTargetFromElement(this);
  1039. var data = $(target).data(DATA_KEY);
  1040. var config = data ? 'toggle' : $(this).data();
  1041. Collapse._jQueryInterface.call($(target), config);
  1042. });
  1043. /**
  1044. * ------------------------------------------------------------------------
  1045. * jQuery
  1046. * ------------------------------------------------------------------------
  1047. */
  1048. $.fn[NAME] = Collapse._jQueryInterface;
  1049. $.fn[NAME].Constructor = Collapse;
  1050. $.fn[NAME].noConflict = function () {
  1051. $.fn[NAME] = JQUERY_NO_CONFLICT;
  1052. return Collapse._jQueryInterface;
  1053. };
  1054. return Collapse;
  1055. }(jQuery);
  1056. /**
  1057. * --------------------------------------------------------------------------
  1058. * Bootstrap (v4.0.0-alpha.6): dropdown.js
  1059. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  1060. * --------------------------------------------------------------------------
  1061. */
  1062. var Dropdown = function ($) {
  1063. /**
  1064. * ------------------------------------------------------------------------
  1065. * Constants
  1066. * ------------------------------------------------------------------------
  1067. */
  1068. var NAME = 'dropdown';
  1069. var VERSION = '4.0.0-alpha.6';
  1070. var DATA_KEY = 'bs.dropdown';
  1071. var EVENT_KEY = '.' + DATA_KEY;
  1072. var DATA_API_KEY = '.data-api';
  1073. var JQUERY_NO_CONFLICT = $.fn[NAME];
  1074. var ESCAPE_KEYCODE = 27; // KeyboardEvent.which value for Escape (Esc) key
  1075. var ARROW_UP_KEYCODE = 38; // KeyboardEvent.which value for up arrow key
  1076. var ARROW_DOWN_KEYCODE = 40; // KeyboardEvent.which value for down arrow key
  1077. var RIGHT_MOUSE_BUTTON_WHICH = 3; // MouseEvent.which value for the right button (assuming a right-handed mouse)
  1078. var Event = {
  1079. HIDE: 'hide' + EVENT_KEY,
  1080. HIDDEN: 'hidden' + EVENT_KEY,
  1081. SHOW: 'show' + EVENT_KEY,
  1082. SHOWN: 'shown' + EVENT_KEY,
  1083. CLICK: 'click' + EVENT_KEY,
  1084. CLICK_DATA_API: 'click' + EVENT_KEY + DATA_API_KEY,
  1085. FOCUSIN_DATA_API: 'focusin' + EVENT_KEY + DATA_API_KEY,
  1086. KEYDOWN_DATA_API: 'keydown' + EVENT_KEY + DATA_API_KEY
  1087. };
  1088. var ClassName = {
  1089. BACKDROP: 'dropdown-backdrop',
  1090. DISABLED: 'disabled',
  1091. SHOW: 'show'
  1092. };
  1093. var Selector = {
  1094. BACKDROP: '.dropdown-backdrop',
  1095. DATA_TOGGLE: '[data-toggle="dropdown"]',
  1096. FORM_CHILD: '.dropdown form',
  1097. ROLE_MENU: '[role="menu"]',
  1098. ROLE_LISTBOX: '[role="listbox"]',
  1099. NAVBAR_NAV: '.navbar-nav',
  1100. VISIBLE_ITEMS: '[role="menu"] li:not(.disabled) a, ' + '[role="listbox"] li:not(.disabled) a'
  1101. };
  1102. /**
  1103. * ------------------------------------------------------------------------
  1104. * Class Definition
  1105. * ------------------------------------------------------------------------
  1106. */
  1107. var Dropdown = function () {
  1108. function Dropdown(element) {
  1109. _classCallCheck(this, Dropdown);
  1110. this._element = element;
  1111. this._addEventListeners();
  1112. }
  1113. // getters
  1114. // public
  1115. Dropdown.prototype.toggle = function toggle() {
  1116. if (this.disabled || $(this).hasClass(ClassName.DISABLED)) {
  1117. return false;
  1118. }
  1119. var parent = Dropdown._getParentFromElement(this);
  1120. var isActive = $(parent).hasClass(ClassName.SHOW);
  1121. Dropdown._clearMenus();
  1122. if (isActive) {
  1123. return false;
  1124. }
  1125. if ('ontouchstart' in document.documentElement && !$(parent).closest(Selector.NAVBAR_NAV).length) {
  1126. // if mobile we use a backdrop because click events don't delegate
  1127. var dropdown = document.createElement('div');
  1128. dropdown.className = ClassName.BACKDROP;
  1129. $(dropdown).insertBefore(this);
  1130. $(dropdown).on('click', Dropdown._clearMenus);
  1131. }
  1132. var relatedTarget = {
  1133. relatedTarget: this
  1134. };
  1135. var showEvent = $.Event(Event.SHOW, relatedTarget);
  1136. $(parent).trigger(showEvent);
  1137. if (showEvent.isDefaultPrevented()) {
  1138. return false;
  1139. }
  1140. this.focus();
  1141. this.setAttribute('aria-expanded', true);
  1142. $(parent).toggleClass(ClassName.SHOW);
  1143. $(parent).trigger($.Event(Event.SHOWN, relatedTarget));
  1144. return false;
  1145. };
  1146. Dropdown.prototype.dispose = function dispose() {
  1147. $.removeData(this._element, DATA_KEY);
  1148. $(this._element).off(EVENT_KEY);
  1149. this._element = null;
  1150. };
  1151. // private
  1152. Dropdown.prototype._addEventListeners = function _addEventListeners() {
  1153. $(this._element).on(Event.CLICK, this.toggle);
  1154. };
  1155. // static
  1156. Dropdown._jQueryInterface = function _jQueryInterface(config) {
  1157. return this.each(function () {
  1158. var data = $(this).data(DATA_KEY);
  1159. if (!data) {
  1160. data = new Dropdown(this);
  1161. $(this).data(DATA_KEY, data);
  1162. }
  1163. if (typeof config === 'string') {
  1164. if (data[config] === undefined) {
  1165. throw new Error('No method named "' + config + '"');
  1166. }
  1167. data[config].call(this);
  1168. }
  1169. });
  1170. };
  1171. Dropdown._clearMenus = function _clearMenus(event) {
  1172. if (event && event.which === RIGHT_MOUSE_BUTTON_WHICH) {
  1173. return;
  1174. }
  1175. var backdrop = $(Selector.BACKDROP)[0];
  1176. if (backdrop) {
  1177. backdrop.parentNode.removeChild(backdrop);
  1178. }
  1179. var toggles = $.makeArray($(Selector.DATA_TOGGLE));
  1180. for (var i = 0; i < toggles.length; i++) {
  1181. var parent = Dropdown._getParentFromElement(toggles[i]);
  1182. var relatedTarget = {
  1183. relatedTarget: toggles[i]
  1184. };
  1185. if (!$(parent).hasClass(ClassName.SHOW)) {
  1186. continue;
  1187. }
  1188. if (event && (event.type === 'click' && /input|textarea/i.test(event.target.tagName) || event.type === 'focusin') && $.contains(parent, event.target)) {
  1189. continue;
  1190. }
  1191. var hideEvent = $.Event(Event.HIDE, relatedTarget);
  1192. $(parent).trigger(hideEvent);
  1193. if (hideEvent.isDefaultPrevented()) {
  1194. continue;
  1195. }
  1196. toggles[i].setAttribute('aria-expanded', 'false');
  1197. $(parent).removeClass(ClassName.SHOW).trigger($.Event(Event.HIDDEN, relatedTarget));
  1198. }
  1199. };
  1200. Dropdown._getParentFromElement = function _getParentFromElement(element) {
  1201. var parent = void 0;
  1202. var selector = Util.getSelectorFromElement(element);
  1203. if (selector) {
  1204. parent = $(selector)[0];
  1205. }
  1206. return parent || element.parentNode;
  1207. };
  1208. Dropdown._dataApiKeydownHandler = function _dataApiKeydownHandler(event) {
  1209. if (!/(38|40|27|32)/.test(event.which) || /input|textarea/i.test(event.target.tagName)) {
  1210. return;
  1211. }
  1212. event.preventDefault();
  1213. event.stopPropagation();
  1214. if (this.disabled || $(this).hasClass(ClassName.DISABLED)) {
  1215. return;
  1216. }
  1217. var parent = Dropdown._getParentFromElement(this);
  1218. var isActive = $(parent).hasClass(ClassName.SHOW);
  1219. if (!isActive && event.which !== ESCAPE_KEYCODE || isActive && event.which === ESCAPE_KEYCODE) {
  1220. if (event.which === ESCAPE_KEYCODE) {
  1221. var toggle = $(parent).find(Selector.DATA_TOGGLE)[0];
  1222. $(toggle).trigger('focus');
  1223. }
  1224. $(this).trigger('click');
  1225. return;
  1226. }
  1227. var items = $(parent).find(Selector.VISIBLE_ITEMS).get();
  1228. if (!items.length) {
  1229. return;
  1230. }
  1231. var index = items.indexOf(event.target);
  1232. if (event.which === ARROW_UP_KEYCODE && index > 0) {
  1233. // up
  1234. index--;
  1235. }
  1236. if (event.which === ARROW_DOWN_KEYCODE && index < items.length - 1) {
  1237. // down
  1238. index++;
  1239. }
  1240. if (index < 0) {
  1241. index = 0;
  1242. }
  1243. items[index].focus();
  1244. };
  1245. _createClass(Dropdown, null, [{
  1246. key: 'VERSION',
  1247. get: function get() {
  1248. return VERSION;
  1249. }
  1250. }]);
  1251. return Dropdown;
  1252. }();
  1253. /**
  1254. * ------------------------------------------------------------------------
  1255. * Data Api implementation
  1256. * ------------------------------------------------------------------------
  1257. */
  1258. $(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 + ' ' + Event.FOCUSIN_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) {
  1259. e.stopPropagation();
  1260. });
  1261. /**
  1262. * ------------------------------------------------------------------------
  1263. * jQuery
  1264. * ------------------------------------------------------------------------
  1265. */
  1266. $.fn[NAME] = Dropdown._jQueryInterface;
  1267. $.fn[NAME].Constructor = Dropdown;
  1268. $.fn[NAME].noConflict = function () {
  1269. $.fn[NAME] = JQUERY_NO_CONFLICT;
  1270. return Dropdown._jQueryInterface;
  1271. };
  1272. return Dropdown;
  1273. }(jQuery);
  1274. /**
  1275. * --------------------------------------------------------------------------
  1276. * Bootstrap (v4.0.0-alpha.6): modal.js
  1277. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  1278. * --------------------------------------------------------------------------
  1279. */
  1280. var Modal = function ($) {
  1281. /**
  1282. * ------------------------------------------------------------------------
  1283. * Constants
  1284. * ------------------------------------------------------------------------
  1285. */
  1286. var NAME = 'modal';
  1287. var VERSION = '4.0.0-alpha.6';
  1288. var DATA_KEY = 'bs.modal';
  1289. var EVENT_KEY = '.' + DATA_KEY;
  1290. var DATA_API_KEY = '.data-api';
  1291. var JQUERY_NO_CONFLICT = $.fn[NAME];
  1292. var TRANSITION_DURATION = 300;
  1293. var BACKDROP_TRANSITION_DURATION = 150;
  1294. var ESCAPE_KEYCODE = 27; // KeyboardEvent.which value for Escape (Esc) key
  1295. var Default = {
  1296. backdrop: true,
  1297. keyboard: true,
  1298. focus: true,
  1299. show: true
  1300. };
  1301. var DefaultType = {
  1302. backdrop: '(boolean|string)',
  1303. keyboard: 'boolean',
  1304. focus: 'boolean',
  1305. show: 'boolean'
  1306. };
  1307. var Event = {
  1308. HIDE: 'hide' + EVENT_KEY,
  1309. HIDDEN: 'hidden' + EVENT_KEY,
  1310. SHOW: 'show' + EVENT_KEY,
  1311. SHOWN: 'shown' + EVENT_KEY,
  1312. FOCUSIN: 'focusin' + EVENT_KEY,
  1313. RESIZE: 'resize' + EVENT_KEY,
  1314. CLICK_DISMISS: 'click.dismiss' + EVENT_KEY,
  1315. KEYDOWN_DISMISS: 'keydown.dismiss' + EVENT_KEY,
  1316. MOUSEUP_DISMISS: 'mouseup.dismiss' + EVENT_KEY,
  1317. MOUSEDOWN_DISMISS: 'mousedown.dismiss' + EVENT_KEY,
  1318. CLICK_DATA_API: 'click' + EVENT_KEY + DATA_API_KEY
  1319. };
  1320. var ClassName = {
  1321. SCROLLBAR_MEASURER: 'modal-scrollbar-measure',
  1322. BACKDROP: 'modal-backdrop',
  1323. OPEN: 'modal-open',
  1324. FADE: 'fade',
  1325. SHOW: 'show'
  1326. };
  1327. var Selector = {
  1328. DIALOG: '.modal-dialog',
  1329. DATA_TOGGLE: '[data-toggle="modal"]',
  1330. DATA_DISMISS: '[data-dismiss="modal"]',
  1331. FIXED_CONTENT: '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top'
  1332. };
  1333. /**
  1334. * ------------------------------------------------------------------------
  1335. * Class Definition
  1336. * ------------------------------------------------------------------------
  1337. */
  1338. var Modal = function () {
  1339. function Modal(element, config) {
  1340. _classCallCheck(this, Modal);
  1341. this._config = this._getConfig(config);
  1342. this._element = element;
  1343. this._dialog = $(element).find(Selector.DIALOG)[0];
  1344. this._backdrop = null;
  1345. this._isShown = false;
  1346. this._isBodyOverflowing = false;
  1347. this._ignoreBackdropClick = false;
  1348. this._isTransitioning = false;
  1349. this._originalBodyPadding = 0;
  1350. this._scrollbarWidth = 0;
  1351. }
  1352. // getters
  1353. // public
  1354. Modal.prototype.toggle = function toggle(relatedTarget) {
  1355. return this._isShown ? this.hide() : this.show(relatedTarget);
  1356. };
  1357. Modal.prototype.show = function show(relatedTarget) {
  1358. var _this9 = this;
  1359. if (this._isTransitioning) {
  1360. throw new Error('Modal is transitioning');
  1361. }
  1362. if (Util.supportsTransitionEnd() && $(this._element).hasClass(ClassName.FADE)) {
  1363. this._isTransitioning = true;
  1364. }
  1365. var showEvent = $.Event(Event.SHOW, {
  1366. relatedTarget: relatedTarget
  1367. });
  1368. $(this._element).trigger(showEvent);
  1369. if (this._isShown || showEvent.isDefaultPrevented()) {
  1370. return;
  1371. }
  1372. this._isShown = true;
  1373. this._checkScrollbar();
  1374. this._setScrollbar();
  1375. $(document.body).addClass(ClassName.OPEN);
  1376. this._setEscapeEvent();
  1377. this._setResizeEvent();
  1378. $(this._element).on(Event.CLICK_DISMISS, Selector.DATA_DISMISS, function (event) {
  1379. return _this9.hide(event);
  1380. });
  1381. $(this._dialog).on(Event.MOUSEDOWN_DISMISS, function () {
  1382. $(_this9._element).one(Event.MOUSEUP_DISMISS, function (event) {
  1383. if ($(event.target).is(_this9._element)) {
  1384. _this9._ignoreBackdropClick = true;
  1385. }
  1386. });
  1387. });
  1388. this._showBackdrop(function () {
  1389. return _this9._showElement(relatedTarget);
  1390. });
  1391. };
  1392. Modal.prototype.hide = function hide(event) {
  1393. var _this10 = this;
  1394. if (event) {
  1395. event.preventDefault();
  1396. }
  1397. if (this._isTransitioning) {
  1398. throw new Error('Modal is transitioning');
  1399. }
  1400. var transition = Util.supportsTransitionEnd() && $(this._element).hasClass(ClassName.FADE);
  1401. if (transition) {
  1402. this._isTransitioning = true;
  1403. }
  1404. var hideEvent = $.Event(Event.HIDE);
  1405. $(this._element).trigger(hideEvent);
  1406. if (!this._isShown || hideEvent.isDefaultPrevented()) {
  1407. return;
  1408. }
  1409. this._isShown = false;
  1410. this._setEscapeEvent();
  1411. this._setResizeEvent();
  1412. $(document).off(Event.FOCUSIN);
  1413. $(this._element).removeClass(ClassName.SHOW);
  1414. $(this._element).off(Event.CLICK_DISMISS);
  1415. $(this._dialog).off(Event.MOUSEDOWN_DISMISS);
  1416. if (transition) {
  1417. $(this._element).one(Util.TRANSITION_END, function (event) {
  1418. return _this10._hideModal(event);
  1419. }).emulateTransitionEnd(TRANSITION_DURATION);
  1420. } else {
  1421. this._hideModal();
  1422. }
  1423. };
  1424. Modal.prototype.dispose = function dispose() {
  1425. $.removeData(this._element, DATA_KEY);
  1426. $(window, document, this._element, this._backdrop).off(EVENT_KEY);
  1427. this._config = null;
  1428. this._element = null;
  1429. this._dialog = null;
  1430. this._backdrop = null;
  1431. this._isShown = null;
  1432. this._isBodyOverflowing = null;
  1433. this._ignoreBackdropClick = null;
  1434. this._originalBodyPadding = null;
  1435. this._scrollbarWidth = null;
  1436. };
  1437. // private
  1438. Modal.prototype._getConfig = function _getConfig(config) {
  1439. config = $.extend({}, Default, config);
  1440. Util.typeCheckConfig(NAME, config, DefaultType);
  1441. return config;
  1442. };
  1443. Modal.prototype._showElement = function _showElement(relatedTarget) {
  1444. var _this11 = this;
  1445. var transition = Util.supportsTransitionEnd() && $(this._element).hasClass(ClassName.FADE);
  1446. if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) {
  1447. // don't move modals dom position
  1448. document.body.appendChild(this._element);
  1449. }
  1450. this._element.style.display = 'block';
  1451. this._element.removeAttribute('aria-hidden');
  1452. this._element.scrollTop = 0;
  1453. if (transition) {
  1454. Util.reflow(this._element);
  1455. }
  1456. $(this._element).addClass(ClassName.SHOW);
  1457. if (this._config.focus) {
  1458. this._enforceFocus();
  1459. }
  1460. var shownEvent = $.Event(Event.SHOWN, {
  1461. relatedTarget: relatedTarget
  1462. });
  1463. var transitionComplete = function transitionComplete() {
  1464. if (_this11._config.focus) {
  1465. _this11._element.focus();
  1466. }
  1467. _this11._isTransitioning = false;
  1468. $(_this11._element).trigger(shownEvent);
  1469. };
  1470. if (transition) {
  1471. $(this._dialog).one(Util.TRANSITION_END, transitionComplete).emulateTransitionEnd(TRANSITION_DURATION);
  1472. } else {
  1473. transitionComplete();
  1474. }
  1475. };
  1476. Modal.prototype._enforceFocus = function _enforceFocus() {
  1477. var _this12 = this;
  1478. $(document).off(Event.FOCUSIN) // guard against infinite focus loop
  1479. .on(Event.FOCUSIN, function (event) {
  1480. if (document !== event.target && _this12._element !== event.target && !$(_this12._element).has(event.target).length) {
  1481. _this12._element.focus();
  1482. }
  1483. });
  1484. };
  1485. Modal.prototype._setEscapeEvent = function _setEscapeEvent() {
  1486. var _this13 = this;
  1487. if (this._isShown && this._config.keyboard) {
  1488. $(this._element).on(Event.KEYDOWN_DISMISS, function (event) {
  1489. if (event.which === ESCAPE_KEYCODE) {
  1490. _this13.hide();
  1491. }
  1492. });
  1493. } else if (!this._isShown) {
  1494. $(this._element).off(Event.KEYDOWN_DISMISS);
  1495. }
  1496. };
  1497. Modal.prototype._setResizeEvent = function _setResizeEvent() {
  1498. var _this14 = this;
  1499. if (this._isShown) {
  1500. $(window).on(Event.RESIZE, function (event) {
  1501. return _this14._handleUpdate(event);
  1502. });
  1503. } else {
  1504. $(window).off(Event.RESIZE);
  1505. }
  1506. };
  1507. Modal.prototype._hideModal = function _hideModal() {
  1508. var _this15 = this;
  1509. this._element.style.display = 'none';
  1510. this._element.setAttribute('aria-hidden', 'true');
  1511. this._isTransitioning = false;
  1512. this._showBackdrop(function () {
  1513. $(document.body).removeClass(ClassName.OPEN);
  1514. _this15._resetAdjustments();
  1515. _this15._resetScrollbar();
  1516. $(_this15._element).trigger(Event.HIDDEN);
  1517. });
  1518. };
  1519. Modal.prototype._removeBackdrop = function _removeBackdrop() {
  1520. if (this._backdrop) {
  1521. $(this._backdrop).remove();
  1522. this._backdrop = null;
  1523. }
  1524. };
  1525. Modal.prototype._showBackdrop = function _showBackdrop(callback) {
  1526. var _this16 = this;
  1527. var animate = $(this._element).hasClass(ClassName.FADE) ? ClassName.FADE : '';
  1528. if (this._isShown && this._config.backdrop) {
  1529. var doAnimate = Util.supportsTransitionEnd() && animate;
  1530. this._backdrop = document.createElement('div');
  1531. this._backdrop.className = ClassName.BACKDROP;
  1532. if (animate) {
  1533. $(this._backdrop).addClass(animate);
  1534. }
  1535. $(this._backdrop).appendTo(document.body);
  1536. $(this._element).on(Event.CLICK_DISMISS, function (event) {
  1537. if (_this16._ignoreBackdropClick) {
  1538. _this16._ignoreBackdropClick = false;
  1539. return;
  1540. }
  1541. if (event.target !== event.currentTarget) {
  1542. return;
  1543. }
  1544. if (_this16._config.backdrop === 'static') {
  1545. _this16._element.focus();
  1546. } else {
  1547. _this16.hide();
  1548. }
  1549. });
  1550. if (doAnimate) {
  1551. Util.reflow(this._backdrop);
  1552. }
  1553. $(this._backdrop).addClass(ClassName.SHOW);
  1554. if (!callback) {
  1555. return;
  1556. }
  1557. if (!doAnimate) {
  1558. callback();
  1559. return;
  1560. }
  1561. $(this._backdrop).one(Util.TRANSITION_END, callback).emulateTransitionEnd(BACKDROP_TRANSITION_DURATION);
  1562. } else if (!this._isShown && this._backdrop) {
  1563. $(this._backdrop).removeClass(ClassName.SHOW);
  1564. var callbackRemove = function callbackRemove() {
  1565. _this16._removeBackdrop();
  1566. if (callback) {
  1567. callback();
  1568. }
  1569. };
  1570. if (Util.supportsTransitionEnd() && $(this._element).hasClass(ClassName.FADE)) {
  1571. $(this._backdrop).one(Util.TRANSITION_END, callbackRemove).emulateTransitionEnd(BACKDROP_TRANSITION_DURATION);
  1572. } else {
  1573. callbackRemove();
  1574. }
  1575. } else if (callback) {
  1576. callback();
  1577. }
  1578. };
  1579. // ----------------------------------------------------------------------
  1580. // the following methods are used to handle overflowing modals
  1581. // todo (fat): these should probably be refactored out of modal.js
  1582. // ----------------------------------------------------------------------
  1583. Modal.prototype._handleUpdate = function _handleUpdate() {
  1584. this._adjustDialog();
  1585. };
  1586. Modal.prototype._adjustDialog = function _adjustDialog() {
  1587. var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight;
  1588. if (!this._isBodyOverflowing && isModalOverflowing) {
  1589. this._element.style.paddingLeft = this._scrollbarWidth + 'px';
  1590. }
  1591. if (this._isBodyOverflowing && !isModalOverflowing) {
  1592. this._element.style.paddingRight = this._scrollbarWidth + 'px';
  1593. }
  1594. };
  1595. Modal.prototype._resetAdjustments = function _resetAdjustments() {
  1596. this._element.style.paddingLeft = '';
  1597. this._element.style.paddingRight = '';
  1598. };
  1599. Modal.prototype._checkScrollbar = function _checkScrollbar() {
  1600. this._isBodyOverflowing = document.body.clientWidth < window.innerWidth;
  1601. this._scrollbarWidth = this._getScrollbarWidth();
  1602. };
  1603. Modal.prototype._setScrollbar = function _setScrollbar() {
  1604. var bodyPadding = parseInt($(Selector.FIXED_CONTENT).css('padding-right') || 0, 10);
  1605. this._originalBodyPadding = document.body.style.paddingRight || '';
  1606. if (this._isBodyOverflowing) {
  1607. document.body.style.paddingRight = bodyPadding + this._scrollbarWidth + 'px';
  1608. }
  1609. };
  1610. Modal.prototype._resetScrollbar = function _resetScrollbar() {
  1611. document.body.style.paddingRight = this._originalBodyPadding;
  1612. };
  1613. Modal.prototype._getScrollbarWidth = function _getScrollbarWidth() {
  1614. // thx d.walsh
  1615. var scrollDiv = document.createElement('div');
  1616. scrollDiv.className = ClassName.SCROLLBAR_MEASURER;
  1617. document.body.appendChild(scrollDiv);
  1618. var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth;
  1619. document.body.removeChild(scrollDiv);
  1620. return scrollbarWidth;
  1621. };
  1622. // static
  1623. Modal._jQueryInterface = function _jQueryInterface(config, relatedTarget) {
  1624. return this.each(function () {
  1625. var data = $(this).data(DATA_KEY);
  1626. var _config = $.extend({}, Modal.Default, $(this).data(), (typeof config === 'undefined' ? 'undefined' : _typeof(config)) === 'object' && config);
  1627. if (!data) {
  1628. data = new Modal(this, _config);
  1629. $(this).data(DATA_KEY, data);
  1630. }
  1631. if (typeof config === 'string') {
  1632. if (data[config] === undefined) {
  1633. throw new Error('No method named "' + config + '"');
  1634. }
  1635. data[config](relatedTarget);
  1636. } else if (_config.show) {
  1637. data.show(relatedTarget);
  1638. }
  1639. });
  1640. };
  1641. _createClass(Modal, null, [{
  1642. key: 'VERSION',
  1643. get: function get() {
  1644. return VERSION;
  1645. }
  1646. }, {
  1647. key: 'Default',
  1648. get: function get() {
  1649. return Default;
  1650. }
  1651. }]);
  1652. return Modal;
  1653. }();
  1654. /**
  1655. * ------------------------------------------------------------------------
  1656. * Data Api implementation
  1657. * ------------------------------------------------------------------------
  1658. */
  1659. $(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {
  1660. var _this17 = this;
  1661. var target = void 0;
  1662. var selector = Util.getSelectorFromElement(this);
  1663. if (selector) {
  1664. target = $(selector)[0];
  1665. }
  1666. var config = $(target).data(DATA_KEY) ? 'toggle' : $.extend({}, $(target).data(), $(this).data());
  1667. if (this.tagName === 'A' || this.tagName === 'AREA') {
  1668. event.preventDefault();
  1669. }
  1670. var $target = $(target).one(Event.SHOW, function (showEvent) {
  1671. if (showEvent.isDefaultPrevented()) {
  1672. // only register focus restorer if modal will actually get shown
  1673. return;
  1674. }
  1675. $target.one(Event.HIDDEN, function () {
  1676. if ($(_this17).is(':visible')) {
  1677. _this17.focus();
  1678. }
  1679. });
  1680. });
  1681. Modal._jQueryInterface.call($(target), config, this);
  1682. });
  1683. /**
  1684. * ------------------------------------------------------------------------
  1685. * jQuery
  1686. * ------------------------------------------------------------------------
  1687. */
  1688. $.fn[NAME] = Modal._jQueryInterface;
  1689. $.fn[NAME].Constructor = Modal;
  1690. $.fn[NAME].noConflict = function () {
  1691. $.fn[NAME] = JQUERY_NO_CONFLICT;
  1692. return Modal._jQueryInterface;
  1693. };
  1694. return Modal;
  1695. }(jQuery);
  1696. /**
  1697. * --------------------------------------------------------------------------
  1698. * Bootstrap (v4.0.0-alpha.6): scrollspy.js
  1699. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  1700. * --------------------------------------------------------------------------
  1701. */
  1702. var ScrollSpy = function ($) {
  1703. /**
  1704. * ------------------------------------------------------------------------
  1705. * Constants
  1706. * ------------------------------------------------------------------------
  1707. */
  1708. var NAME = 'scrollspy';
  1709. var VERSION = '4.0.0-alpha.6';
  1710. var DATA_KEY = 'bs.scrollspy';
  1711. var EVENT_KEY = '.' + DATA_KEY;
  1712. var DATA_API_KEY = '.data-api';
  1713. var JQUERY_NO_CONFLICT = $.fn[NAME];
  1714. var Default = {
  1715. offset: 10,
  1716. method: 'auto',
  1717. target: ''
  1718. };
  1719. var DefaultType = {
  1720. offset: 'number',
  1721. method: 'string',
  1722. target: '(string|element)'
  1723. };
  1724. var Event = {
  1725. ACTIVATE: 'activate' + EVENT_KEY,
  1726. SCROLL: 'scroll' + EVENT_KEY,
  1727. LOAD_DATA_API: 'load' + EVENT_KEY + DATA_API_KEY
  1728. };
  1729. var ClassName = {
  1730. DROPDOWN_ITEM: 'dropdown-item',
  1731. DROPDOWN_MENU: 'dropdown-menu',
  1732. NAV_LINK: 'nav-link',
  1733. NAV: 'nav',
  1734. ACTIVE: 'active'
  1735. };
  1736. var Selector = {
  1737. DATA_SPY: '[data-spy="scroll"]',
  1738. ACTIVE: '.active',
  1739. LIST_ITEM: '.list-item',
  1740. LI: 'li',
  1741. LI_DROPDOWN: 'li.dropdown',
  1742. NAV_LINKS: '.nav-link',
  1743. DROPDOWN: '.dropdown',
  1744. DROPDOWN_ITEMS: '.dropdown-item',
  1745. DROPDOWN_TOGGLE: '.dropdown-toggle'
  1746. };
  1747. var OffsetMethod = {
  1748. OFFSET: 'offset',
  1749. POSITION: 'position'
  1750. };
  1751. /**
  1752. * ------------------------------------------------------------------------
  1753. * Class Definition
  1754. * ------------------------------------------------------------------------
  1755. */
  1756. var ScrollSpy = function () {
  1757. function ScrollSpy(element, config) {
  1758. var _this18 = this;
  1759. _classCallCheck(this, ScrollSpy);
  1760. this._element = element;
  1761. this._scrollElement = element.tagName === 'BODY' ? window : element;
  1762. this._config = this._getConfig(config);
  1763. this._selector = this._config.target + ' ' + Selector.NAV_LINKS + ',' + (this._config.target + ' ' + Selector.DROPDOWN_ITEMS);
  1764. this._offsets = [];
  1765. this._targets = [];
  1766. this._activeTarget = null;
  1767. this._scrollHeight = 0;
  1768. $(this._scrollElement).on(Event.SCROLL, function (event) {
  1769. return _this18._process(event);
  1770. });
  1771. this.refresh();
  1772. this._process();
  1773. }
  1774. // getters
  1775. // public
  1776. ScrollSpy.prototype.refresh = function refresh() {
  1777. var _this19 = this;
  1778. var autoMethod = this._scrollElement !== this._scrollElement.window ? OffsetMethod.POSITION : OffsetMethod.OFFSET;
  1779. var offsetMethod = this._config.method === 'auto' ? autoMethod : this._config.method;
  1780. var offsetBase = offsetMethod === OffsetMethod.POSITION ? this._getScrollTop() : 0;
  1781. this._offsets = [];
  1782. this._targets = [];
  1783. this._scrollHeight = this._getScrollHeight();
  1784. var targets = $.makeArray($(this._selector));
  1785. targets.map(function (element) {
  1786. var target = void 0;
  1787. var targetSelector = Util.getSelectorFromElement(element);
  1788. if (targetSelector) {
  1789. target = $(targetSelector)[0];
  1790. }
  1791. if (target && (target.offsetWidth || target.offsetHeight)) {
  1792. // todo (fat): remove sketch reliance on jQuery position/offset
  1793. return [$(target)[offsetMethod]().top + offsetBase, targetSelector];
  1794. }
  1795. return null;
  1796. }).filter(function (item) {
  1797. return item;
  1798. }).sort(function (a, b) {
  1799. return a[0] - b[0];
  1800. }).forEach(function (item) {
  1801. _this19._offsets.push(item[0]);
  1802. _this19._targets.push(item[1]);
  1803. });
  1804. };
  1805. ScrollSpy.prototype.dispose = function dispose() {
  1806. $.removeData(this._element, DATA_KEY);
  1807. $(this._scrollElement).off(EVENT_KEY);
  1808. this._element = null;
  1809. this._scrollElement = null;
  1810. this._config = null;
  1811. this._selector = null;
  1812. this._offsets = null;
  1813. this._targets = null;
  1814. this._activeTarget = null;
  1815. this._scrollHeight = null;
  1816. };
  1817. // private
  1818. ScrollSpy.prototype._getConfig = function _getConfig(config) {
  1819. config = $.extend({}, Default, config);
  1820. if (typeof config.target !== 'string') {
  1821. var id = $(config.target).attr('id');
  1822. if (!id) {
  1823. id = Util.getUID(NAME);
  1824. $(config.target).attr('id', id);
  1825. }
  1826. config.target = '#' + id;
  1827. }
  1828. Util.typeCheckConfig(NAME, config, DefaultType);
  1829. return config;
  1830. };
  1831. ScrollSpy.prototype._getScrollTop = function _getScrollTop() {
  1832. return this._scrollElement === window ? this._scrollElement.pageYOffset : this._scrollElement.scrollTop;
  1833. };
  1834. ScrollSpy.prototype._getScrollHeight = function _getScrollHeight() {
  1835. return this._scrollElement.scrollHeight || Math.max(document.body.scrollHeight, document.documentElement.scrollHeight);
  1836. };
  1837. ScrollSpy.prototype._getOffsetHeight = function _getOffsetHeight() {
  1838. return this._scrollElement === window ? window.innerHeight : this._scrollElement.offsetHeight;
  1839. };
  1840. ScrollSpy.prototype._process = function _process() {
  1841. var scrollTop = this._getScrollTop() + this._config.offset;
  1842. var scrollHeight = this._getScrollHeight();
  1843. var maxScroll = this._config.offset + scrollHeight - this._getOffsetHeight();
  1844. if (this._scrollHeight !== scrollHeight) {
  1845. this.refresh();
  1846. }
  1847. if (scrollTop >= maxScroll) {
  1848. var target = this._targets[this._targets.length - 1];
  1849. if (this._activeTarget !== target) {
  1850. this._activate(target);
  1851. }
  1852. return;
  1853. }
  1854. if (this._activeTarget && scrollTop < this._offsets[0] && this._offsets[0] > 0) {
  1855. this._activeTarget = null;
  1856. this._clear();
  1857. return;
  1858. }
  1859. for (var i = this._offsets.length; i--;) {
  1860. var isActiveTarget = this._activeTarget !== this._targets[i] && scrollTop >= this._offsets[i] && (this._offsets[i + 1] === undefined || scrollTop < this._offsets[i + 1]);
  1861. if (isActiveTarget) {
  1862. this._activate(this._targets[i]);
  1863. }
  1864. }
  1865. };
  1866. ScrollSpy.prototype._activate = function _activate(target) {
  1867. this._activeTarget = target;
  1868. this._clear();
  1869. var queries = this._selector.split(',');
  1870. queries = queries.map(function (selector) {
  1871. return selector + '[data-target="' + target + '"],' + (selector + '[href="' + target + '"]');
  1872. });
  1873. var $link = $(queries.join(','));
  1874. if ($link.hasClass(ClassName.DROPDOWN_ITEM)) {
  1875. $link.closest(Selector.DROPDOWN).find(Selector.DROPDOWN_TOGGLE).addClass(ClassName.ACTIVE);
  1876. $link.addClass(ClassName.ACTIVE);
  1877. } else {
  1878. // todo (fat) this is kinda sus...
  1879. // recursively add actives to tested nav-links
  1880. $link.parents(Selector.LI).find('> ' + Selector.NAV_LINKS).addClass(ClassName.ACTIVE);
  1881. }
  1882. $(this._scrollElement).trigger(Event.ACTIVATE, {
  1883. relatedTarget: target
  1884. });
  1885. };
  1886. ScrollSpy.prototype._clear = function _clear() {
  1887. $(this._selector).filter(Selector.ACTIVE).removeClass(ClassName.ACTIVE);
  1888. };
  1889. // static
  1890. ScrollSpy._jQueryInterface = function _jQueryInterface(config) {
  1891. return this.each(function () {
  1892. var data = $(this).data(DATA_KEY);
  1893. var _config = (typeof config === 'undefined' ? 'undefined' : _typeof(config)) === 'object' && config;
  1894. if (!data) {
  1895. data = new ScrollSpy(this, _config);
  1896. $(this).data(DATA_KEY, data);
  1897. }
  1898. if (typeof config === 'string') {
  1899. if (data[config] === undefined) {
  1900. throw new Error('No method named "' + config + '"');
  1901. }
  1902. data[config]();
  1903. }
  1904. });
  1905. };
  1906. _createClass(ScrollSpy, null, [{
  1907. key: 'VERSION',
  1908. get: function get() {
  1909. return VERSION;
  1910. }
  1911. }, {
  1912. key: 'Default',
  1913. get: function get() {
  1914. return Default;
  1915. }
  1916. }]);
  1917. return ScrollSpy;
  1918. }();
  1919. /**
  1920. * ------------------------------------------------------------------------
  1921. * Data Api implementation
  1922. * ------------------------------------------------------------------------
  1923. */
  1924. $(window).on(Event.LOAD_DATA_API, function () {
  1925. var scrollSpys = $.makeArray($(Selector.DATA_SPY));
  1926. for (var i = scrollSpys.length; i--;) {
  1927. var $spy = $(scrollSpys[i]);
  1928. ScrollSpy._jQueryInterface.call($spy, $spy.data());
  1929. }
  1930. });
  1931. /**
  1932. * ------------------------------------------------------------------------
  1933. * jQuery
  1934. * ------------------------------------------------------------------------
  1935. */
  1936. $.fn[NAME] = ScrollSpy._jQueryInterface;
  1937. $.fn[NAME].Constructor = ScrollSpy;
  1938. $.fn[NAME].noConflict = function () {
  1939. $.fn[NAME] = JQUERY_NO_CONFLICT;
  1940. return ScrollSpy._jQueryInterface;
  1941. };
  1942. return ScrollSpy;
  1943. }(jQuery);
  1944. /**
  1945. * --------------------------------------------------------------------------
  1946. * Bootstrap (v4.0.0-alpha.6): tab.js
  1947. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  1948. * --------------------------------------------------------------------------
  1949. */
  1950. var Tab = function ($) {
  1951. /**
  1952. * ------------------------------------------------------------------------
  1953. * Constants
  1954. * ------------------------------------------------------------------------
  1955. */
  1956. var NAME = 'tab';
  1957. var VERSION = '4.0.0-alpha.6';
  1958. var DATA_KEY = 'bs.tab';
  1959. var EVENT_KEY = '.' + DATA_KEY;
  1960. var DATA_API_KEY = '.data-api';
  1961. var JQUERY_NO_CONFLICT = $.fn[NAME];
  1962. var TRANSITION_DURATION = 150;
  1963. var Event = {
  1964. HIDE: 'hide' + EVENT_KEY,
  1965. HIDDEN: 'hidden' + EVENT_KEY,
  1966. SHOW: 'show' + EVENT_KEY,
  1967. SHOWN: 'shown' + EVENT_KEY,
  1968. CLICK_DATA_API: 'click' + EVENT_KEY + DATA_API_KEY
  1969. };
  1970. var ClassName = {
  1971. DROPDOWN_MENU: 'dropdown-menu',
  1972. ACTIVE: 'active',
  1973. DISABLED: 'disabled',
  1974. FADE: 'fade',
  1975. SHOW: 'show'
  1976. };
  1977. var Selector = {
  1978. A: 'a',
  1979. LI: 'li',
  1980. DROPDOWN: '.dropdown',
  1981. LIST: 'ul:not(.dropdown-menu), ol:not(.dropdown-menu), nav:not(.dropdown-menu)',
  1982. FADE_CHILD: '> .nav-item .fade, > .fade',
  1983. ACTIVE: '.active',
  1984. ACTIVE_CHILD: '> .nav-item > .active, > .active',
  1985. DATA_TOGGLE: '[data-toggle="tab"], [data-toggle="pill"]',
  1986. DROPDOWN_TOGGLE: '.dropdown-toggle',
  1987. DROPDOWN_ACTIVE_CHILD: '> .dropdown-menu .active'
  1988. };
  1989. /**
  1990. * ------------------------------------------------------------------------
  1991. * Class Definition
  1992. * ------------------------------------------------------------------------
  1993. */
  1994. var Tab = function () {
  1995. function Tab(element) {
  1996. _classCallCheck(this, Tab);
  1997. this._element = element;
  1998. }
  1999. // getters
  2000. // public
  2001. Tab.prototype.show = function show() {
  2002. var _this20 = this;
  2003. if (this._element.parentNode && this._element.parentNode.nodeType === Node.ELEMENT_NODE && $(this._element).hasClass(ClassName.ACTIVE) || $(this._element).hasClass(ClassName.DISABLED)) {
  2004. return;
  2005. }
  2006. var target = void 0;
  2007. var previous = void 0;
  2008. var listElement = $(this._element).closest(Selector.LIST)[0];
  2009. var selector = Util.getSelectorFromElement(this._element);
  2010. if (listElement) {
  2011. previous = $.makeArray($(listElement).find(Selector.ACTIVE));
  2012. previous = previous[previous.length - 1];
  2013. }
  2014. var hideEvent = $.Event(Event.HIDE, {
  2015. relatedTarget: this._element
  2016. });
  2017. var showEvent = $.Event(Event.SHOW, {
  2018. relatedTarget: previous
  2019. });
  2020. if (previous) {
  2021. $(previous).trigger(hideEvent);
  2022. }
  2023. $(this._element).trigger(showEvent);
  2024. if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) {
  2025. return;
  2026. }
  2027. if (selector) {
  2028. target = $(selector)[0];
  2029. }
  2030. this._activate(this._element, listElement);
  2031. var complete = function complete() {
  2032. var hiddenEvent = $.Event(Event.HIDDEN, {
  2033. relatedTarget: _this20._element
  2034. });
  2035. var shownEvent = $.Event(Event.SHOWN, {
  2036. relatedTarget: previous
  2037. });
  2038. $(previous).trigger(hiddenEvent);
  2039. $(_this20._element).trigger(shownEvent);
  2040. };
  2041. if (target) {
  2042. this._activate(target, target.parentNode, complete);
  2043. } else {
  2044. complete();
  2045. }
  2046. };
  2047. Tab.prototype.dispose = function dispose() {
  2048. $.removeClass(this._element, DATA_KEY);
  2049. this._element = null;
  2050. };
  2051. // private
  2052. Tab.prototype._activate = function _activate(element, container, callback) {
  2053. var _this21 = this;
  2054. var active = $(container).find(Selector.ACTIVE_CHILD)[0];
  2055. var isTransitioning = callback && Util.supportsTransitionEnd() && (active && $(active).hasClass(ClassName.FADE) || Boolean($(container).find(Selector.FADE_CHILD)[0]));
  2056. var complete = function complete() {
  2057. return _this21._transitionComplete(element, active, isTransitioning, callback);
  2058. };
  2059. if (active && isTransitioning) {
  2060. $(active).one(Util.TRANSITION_END, complete).emulateTransitionEnd(TRANSITION_DURATION);
  2061. } else {
  2062. complete();
  2063. }
  2064. if (active) {
  2065. $(active).removeClass(ClassName.SHOW);
  2066. }
  2067. };
  2068. Tab.prototype._transitionComplete = function _transitionComplete(element, active, isTransitioning, callback) {
  2069. if (active) {
  2070. $(active).removeClass(ClassName.ACTIVE);
  2071. var dropdownChild = $(active.parentNode).find(Selector.DROPDOWN_ACTIVE_CHILD)[0];
  2072. if (dropdownChild) {
  2073. $(dropdownChild).removeClass(ClassName.ACTIVE);
  2074. }
  2075. active.setAttribute('aria-expanded', false);
  2076. }
  2077. $(element).addClass(ClassName.ACTIVE);
  2078. element.setAttribute('aria-expanded', true);
  2079. if (isTransitioning) {
  2080. Util.reflow(element);
  2081. $(element).addClass(ClassName.SHOW);
  2082. } else {
  2083. $(element).removeClass(ClassName.FADE);
  2084. }
  2085. if (element.parentNode && $(element.parentNode).hasClass(ClassName.DROPDOWN_MENU)) {
  2086. var dropdownElement = $(element).closest(Selector.DROPDOWN)[0];
  2087. if (dropdownElement) {
  2088. $(dropdownElement).find(Selector.DROPDOWN_TOGGLE).addClass(ClassName.ACTIVE);
  2089. }
  2090. element.setAttribute('aria-expanded', true);
  2091. }
  2092. if (callback) {
  2093. callback();
  2094. }
  2095. };
  2096. // static
  2097. Tab._jQueryInterface = function _jQueryInterface(config) {
  2098. return this.each(function () {
  2099. var $this = $(this);
  2100. var data = $this.data(DATA_KEY);
  2101. if (!data) {
  2102. data = new Tab(this);
  2103. $this.data(DATA_KEY, data);
  2104. }
  2105. if (typeof config === 'string') {
  2106. if (data[config] === undefined) {
  2107. throw new Error('No method named "' + config + '"');
  2108. }
  2109. data[config]();
  2110. }
  2111. });
  2112. };
  2113. _createClass(Tab, null, [{
  2114. key: 'VERSION',
  2115. get: function get() {
  2116. return VERSION;
  2117. }
  2118. }]);
  2119. return Tab;
  2120. }();
  2121. /**
  2122. * ------------------------------------------------------------------------
  2123. * Data Api implementation
  2124. * ------------------------------------------------------------------------
  2125. */
  2126. $(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {
  2127. event.preventDefault();
  2128. Tab._jQueryInterface.call($(this), 'show');
  2129. });
  2130. /**
  2131. * ------------------------------------------------------------------------
  2132. * jQuery
  2133. * ------------------------------------------------------------------------
  2134. */
  2135. $.fn[NAME] = Tab._jQueryInterface;
  2136. $.fn[NAME].Constructor = Tab;
  2137. $.fn[NAME].noConflict = function () {
  2138. $.fn[NAME] = JQUERY_NO_CONFLICT;
  2139. return Tab._jQueryInterface;
  2140. };
  2141. return Tab;
  2142. }(jQuery);
  2143. /* global Tether */
  2144. /**
  2145. * --------------------------------------------------------------------------
  2146. * Bootstrap (v4.0.0-alpha.6): tooltip.js
  2147. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  2148. * --------------------------------------------------------------------------
  2149. */
  2150. var Tooltip = function ($) {
  2151. /**
  2152. * Check for Tether dependency
  2153. * Tether - http://tether.io/
  2154. */
  2155. if (typeof Tether === 'undefined') {
  2156. throw new Error('Bootstrap tooltips require Tether (http://tether.io/)');
  2157. }
  2158. /**
  2159. * ------------------------------------------------------------------------
  2160. * Constants
  2161. * ------------------------------------------------------------------------
  2162. */
  2163. var NAME = 'tooltip';
  2164. var VERSION = '4.0.0-alpha.6';
  2165. var DATA_KEY = 'bs.tooltip';
  2166. var EVENT_KEY = '.' + DATA_KEY;
  2167. var JQUERY_NO_CONFLICT = $.fn[NAME];
  2168. var TRANSITION_DURATION = 150;
  2169. var CLASS_PREFIX = 'bs-tether';
  2170. var Default = {
  2171. animation: true,
  2172. template: '<div class="tooltip" role="tooltip">' + '<div class="tooltip-inner"></div></div>',
  2173. trigger: 'hover focus',
  2174. title: '',
  2175. delay: 0,
  2176. html: false,
  2177. selector: false,
  2178. placement: 'top',
  2179. offset: '0 0',
  2180. constraints: [],
  2181. container: false
  2182. };
  2183. var DefaultType = {
  2184. animation: 'boolean',
  2185. template: 'string',
  2186. title: '(string|element|function)',
  2187. trigger: 'string',
  2188. delay: '(number|object)',
  2189. html: 'boolean',
  2190. selector: '(string|boolean)',
  2191. placement: '(string|function)',
  2192. offset: 'string',
  2193. constraints: 'array',
  2194. container: '(string|element|boolean)'
  2195. };
  2196. var AttachmentMap = {
  2197. TOP: 'bottom center',
  2198. RIGHT: 'middle left',
  2199. BOTTOM: 'top center',
  2200. LEFT: 'middle right'
  2201. };
  2202. var HoverState = {
  2203. SHOW: 'show',
  2204. OUT: 'out'
  2205. };
  2206. var Event = {
  2207. HIDE: 'hide' + EVENT_KEY,
  2208. HIDDEN: 'hidden' + EVENT_KEY,
  2209. SHOW: 'show' + EVENT_KEY,
  2210. SHOWN: 'shown' + EVENT_KEY,
  2211. INSERTED: 'inserted' + EVENT_KEY,
  2212. CLICK: 'click' + EVENT_KEY,
  2213. FOCUSIN: 'focusin' + EVENT_KEY,
  2214. FOCUSOUT: 'focusout' + EVENT_KEY,
  2215. MOUSEENTER: 'mouseenter' + EVENT_KEY,
  2216. MOUSELEAVE: 'mouseleave' + EVENT_KEY
  2217. };
  2218. var ClassName = {
  2219. FADE: 'fade',
  2220. SHOW: 'show'
  2221. };
  2222. var Selector = {
  2223. TOOLTIP: '.tooltip',
  2224. TOOLTIP_INNER: '.tooltip-inner'
  2225. };
  2226. var TetherClass = {
  2227. element: false,
  2228. enabled: false
  2229. };
  2230. var Trigger = {
  2231. HOVER: 'hover',
  2232. FOCUS: 'focus',
  2233. CLICK: 'click',
  2234. MANUAL: 'manual'
  2235. };
  2236. /**
  2237. * ------------------------------------------------------------------------
  2238. * Class Definition
  2239. * ------------------------------------------------------------------------
  2240. */
  2241. var Tooltip = function () {
  2242. function Tooltip(element, config) {
  2243. _classCallCheck(this, Tooltip);
  2244. // private
  2245. this._isEnabled = true;
  2246. this._timeout = 0;
  2247. this._hoverState = '';
  2248. this._activeTrigger = {};
  2249. this._isTransitioning = false;
  2250. this._tether = null;
  2251. // protected
  2252. this.element = element;
  2253. this.config = this._getConfig(config);
  2254. this.tip = null;
  2255. this._setListeners();
  2256. }
  2257. // getters
  2258. // public
  2259. Tooltip.prototype.enable = function enable() {
  2260. this._isEnabled = true;
  2261. };
  2262. Tooltip.prototype.disable = function disable() {
  2263. this._isEnabled = false;
  2264. };
  2265. Tooltip.prototype.toggleEnabled = function toggleEnabled() {
  2266. this._isEnabled = !this._isEnabled;
  2267. };
  2268. Tooltip.prototype.toggle = function toggle(event) {
  2269. if (event) {
  2270. var dataKey = this.constructor.DATA_KEY;
  2271. var context = $(event.currentTarget).data(dataKey);
  2272. if (!context) {
  2273. context = new this.constructor(event.currentTarget, this._getDelegateConfig());
  2274. $(event.currentTarget).data(dataKey, context);
  2275. }
  2276. context._activeTrigger.click = !context._activeTrigger.click;
  2277. if (context._isWithActiveTrigger()) {
  2278. context._enter(null, context);
  2279. } else {
  2280. context._leave(null, context);
  2281. }
  2282. } else {
  2283. if ($(this.getTipElement()).hasClass(ClassName.SHOW)) {
  2284. this._leave(null, this);
  2285. return;
  2286. }
  2287. this._enter(null, this);
  2288. }
  2289. };
  2290. Tooltip.prototype.dispose = function dispose() {
  2291. clearTimeout(this._timeout);
  2292. this.cleanupTether();
  2293. $.removeData(this.element, this.constructor.DATA_KEY);
  2294. $(this.element).off(this.constructor.EVENT_KEY);
  2295. $(this.element).closest('.modal').off('hide.bs.modal');
  2296. if (this.tip) {
  2297. $(this.tip).remove();
  2298. }
  2299. this._isEnabled = null;
  2300. this._timeout = null;
  2301. this._hoverState = null;
  2302. this._activeTrigger = null;
  2303. this._tether = null;
  2304. this.element = null;
  2305. this.config = null;
  2306. this.tip = null;
  2307. };
  2308. Tooltip.prototype.show = function show() {
  2309. var _this22 = this;
  2310. if ($(this.element).css('display') === 'none') {
  2311. throw new Error('Please use show on visible elements');
  2312. }
  2313. var showEvent = $.Event(this.constructor.Event.SHOW);
  2314. if (this.isWithContent() && this._isEnabled) {
  2315. if (this._isTransitioning) {
  2316. throw new Error('Tooltip is transitioning');
  2317. }
  2318. $(this.element).trigger(showEvent);
  2319. var isInTheDom = $.contains(this.element.ownerDocument.documentElement, this.element);
  2320. if (showEvent.isDefaultPrevented() || !isInTheDom) {
  2321. return;
  2322. }
  2323. var tip = this.getTipElement();
  2324. var tipId = Util.getUID(this.constructor.NAME);
  2325. tip.setAttribute('id', tipId);
  2326. this.element.setAttribute('aria-describedby', tipId);
  2327. this.setContent();
  2328. if (this.config.animation) {
  2329. $(tip).addClass(ClassName.FADE);
  2330. }
  2331. var placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this.element) : this.config.placement;
  2332. var attachment = this._getAttachment(placement);
  2333. var container = this.config.container === false ? document.body : $(this.config.container);
  2334. $(tip).data(this.constructor.DATA_KEY, this).appendTo(container);
  2335. $(this.element).trigger(this.constructor.Event.INSERTED);
  2336. this._tether = new Tether({
  2337. attachment: attachment,
  2338. element: tip,
  2339. target: this.element,
  2340. classes: TetherClass,
  2341. classPrefix: CLASS_PREFIX,
  2342. offset: this.config.offset,
  2343. constraints: this.config.constraints,
  2344. addTargetClasses: false
  2345. });
  2346. Util.reflow(tip);
  2347. this._tether.position();
  2348. $(tip).addClass(ClassName.SHOW);
  2349. var complete = function complete() {
  2350. var prevHoverState = _this22._hoverState;
  2351. _this22._hoverState = null;
  2352. _this22._isTransitioning = false;
  2353. $(_this22.element).trigger(_this22.constructor.Event.SHOWN);
  2354. if (prevHoverState === HoverState.OUT) {
  2355. _this22._leave(null, _this22);
  2356. }
  2357. };
  2358. if (Util.supportsTransitionEnd() && $(this.tip).hasClass(ClassName.FADE)) {
  2359. this._isTransitioning = true;
  2360. $(this.tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(Tooltip._TRANSITION_DURATION);
  2361. return;
  2362. }
  2363. complete();
  2364. }
  2365. };
  2366. Tooltip.prototype.hide = function hide(callback) {
  2367. var _this23 = this;
  2368. var tip = this.getTipElement();
  2369. var hideEvent = $.Event(this.constructor.Event.HIDE);
  2370. if (this._isTransitioning) {
  2371. throw new Error('Tooltip is transitioning');
  2372. }
  2373. var complete = function complete() {
  2374. if (_this23._hoverState !== HoverState.SHOW && tip.parentNode) {
  2375. tip.parentNode.removeChild(tip);
  2376. }
  2377. _this23.element.removeAttribute('aria-describedby');
  2378. $(_this23.element).trigger(_this23.constructor.Event.HIDDEN);
  2379. _this23._isTransitioning = false;
  2380. _this23.cleanupTether();
  2381. if (callback) {
  2382. callback();
  2383. }
  2384. };
  2385. $(this.element).trigger(hideEvent);
  2386. if (hideEvent.isDefaultPrevented()) {
  2387. return;
  2388. }
  2389. $(tip).removeClass(ClassName.SHOW);
  2390. this._activeTrigger[Trigger.CLICK] = false;
  2391. this._activeTrigger[Trigger.FOCUS] = false;
  2392. this._activeTrigger[Trigger.HOVER] = false;
  2393. if (Util.supportsTransitionEnd() && $(this.tip).hasClass(ClassName.FADE)) {
  2394. this._isTransitioning = true;
  2395. $(tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(TRANSITION_DURATION);
  2396. } else {
  2397. complete();
  2398. }
  2399. this._hoverState = '';
  2400. };
  2401. // protected
  2402. Tooltip.prototype.isWithContent = function isWithContent() {
  2403. return Boolean(this.getTitle());
  2404. };
  2405. Tooltip.prototype.getTipElement = function getTipElement() {
  2406. return this.tip = this.tip || $(this.config.template)[0];
  2407. };
  2408. Tooltip.prototype.setContent = function setContent() {
  2409. var $tip = $(this.getTipElement());
  2410. this.setElementContent($tip.find(Selector.TOOLTIP_INNER), this.getTitle());
  2411. $tip.removeClass(ClassName.FADE + ' ' + ClassName.SHOW);
  2412. this.cleanupTether();
  2413. };
  2414. Tooltip.prototype.setElementContent = function setElementContent($element, content) {
  2415. var html = this.config.html;
  2416. if ((typeof content === 'undefined' ? 'undefined' : _typeof(content)) === 'object' && (content.nodeType || content.jquery)) {
  2417. // content is a DOM node or a jQuery
  2418. if (html) {
  2419. if (!$(content).parent().is($element)) {
  2420. $element.empty().append(content);
  2421. }
  2422. } else {
  2423. $element.text($(content).text());
  2424. }
  2425. } else {
  2426. $element[html ? 'html' : 'text'](content);
  2427. }
  2428. };
  2429. Tooltip.prototype.getTitle = function getTitle() {
  2430. var title = this.element.getAttribute('data-original-title');
  2431. if (!title) {
  2432. title = typeof this.config.title === 'function' ? this.config.title.call(this.element) : this.config.title;
  2433. }
  2434. return title;
  2435. };
  2436. Tooltip.prototype.cleanupTether = function cleanupTether() {
  2437. if (this._tether) {
  2438. this._tether.destroy();
  2439. }
  2440. };
  2441. // private
  2442. Tooltip.prototype._getAttachment = function _getAttachment(placement) {
  2443. return AttachmentMap[placement.toUpperCase()];
  2444. };
  2445. Tooltip.prototype._setListeners = function _setListeners() {
  2446. var _this24 = this;
  2447. var triggers = this.config.trigger.split(' ');
  2448. triggers.forEach(function (trigger) {
  2449. if (trigger === 'click') {
  2450. $(_this24.element).on(_this24.constructor.Event.CLICK, _this24.config.selector, function (event) {
  2451. return _this24.toggle(event);
  2452. });
  2453. } else if (trigger !== Trigger.MANUAL) {
  2454. var eventIn = trigger === Trigger.HOVER ? _this24.constructor.Event.MOUSEENTER : _this24.constructor.Event.FOCUSIN;
  2455. var eventOut = trigger === Trigger.HOVER ? _this24.constructor.Event.MOUSELEAVE : _this24.constructor.Event.FOCUSOUT;
  2456. $(_this24.element).on(eventIn, _this24.config.selector, function (event) {
  2457. return _this24._enter(event);
  2458. }).on(eventOut, _this24.config.selector, function (event) {
  2459. return _this24._leave(event);
  2460. });
  2461. }
  2462. $(_this24.element).closest('.modal').on('hide.bs.modal', function () {
  2463. return _this24.hide();
  2464. });
  2465. });
  2466. if (this.config.selector) {
  2467. this.config = $.extend({}, this.config, {
  2468. trigger: 'manual',
  2469. selector: ''
  2470. });
  2471. } else {
  2472. this._fixTitle();
  2473. }
  2474. };
  2475. Tooltip.prototype._fixTitle = function _fixTitle() {
  2476. var titleType = _typeof(this.element.getAttribute('data-original-title'));
  2477. if (this.element.getAttribute('title') || titleType !== 'string') {
  2478. this.element.setAttribute('data-original-title', this.element.getAttribute('title') || '');
  2479. this.element.setAttribute('title', '');
  2480. }
  2481. };
  2482. Tooltip.prototype._enter = function _enter(event, context) {
  2483. var dataKey = this.constructor.DATA_KEY;
  2484. context = context || $(event.currentTarget).data(dataKey);
  2485. if (!context) {
  2486. context = new this.constructor(event.currentTarget, this._getDelegateConfig());
  2487. $(event.currentTarget).data(dataKey, context);
  2488. }
  2489. if (event) {
  2490. context._activeTrigger[event.type === 'focusin' ? Trigger.FOCUS : Trigger.HOVER] = true;
  2491. }
  2492. if ($(context.getTipElement()).hasClass(ClassName.SHOW) || context._hoverState === HoverState.SHOW) {
  2493. context._hoverState = HoverState.SHOW;
  2494. return;
  2495. }
  2496. clearTimeout(context._timeout);
  2497. context._hoverState = HoverState.SHOW;
  2498. if (!context.config.delay || !context.config.delay.show) {
  2499. context.show();
  2500. return;
  2501. }
  2502. context._timeout = setTimeout(function () {
  2503. if (context._hoverState === HoverState.SHOW) {
  2504. context.show();
  2505. }
  2506. }, context.config.delay.show);
  2507. };
  2508. Tooltip.prototype._leave = function _leave(event, context) {
  2509. var dataKey = this.constructor.DATA_KEY;
  2510. context = context || $(event.currentTarget).data(dataKey);
  2511. if (!context) {
  2512. context = new this.constructor(event.currentTarget, this._getDelegateConfig());
  2513. $(event.currentTarget).data(dataKey, context);
  2514. }
  2515. if (event) {
  2516. context._activeTrigger[event.type === 'focusout' ? Trigger.FOCUS : Trigger.HOVER] = false;
  2517. }
  2518. if (context._isWithActiveTrigger()) {
  2519. return;
  2520. }
  2521. clearTimeout(context._timeout);
  2522. context._hoverState = HoverState.OUT;
  2523. if (!context.config.delay || !context.config.delay.hide) {
  2524. context.hide();
  2525. return;
  2526. }
  2527. context._timeout = setTimeout(function () {
  2528. if (context._hoverState === HoverState.OUT) {
  2529. context.hide();
  2530. }
  2531. }, context.config.delay.hide);
  2532. };
  2533. Tooltip.prototype._isWithActiveTrigger = function _isWithActiveTrigger() {
  2534. for (var trigger in this._activeTrigger) {
  2535. if (this._activeTrigger[trigger]) {
  2536. return true;
  2537. }
  2538. }
  2539. return false;
  2540. };
  2541. Tooltip.prototype._getConfig = function _getConfig(config) {
  2542. config = $.extend({}, this.constructor.Default, $(this.element).data(), config);
  2543. if (config.delay && typeof config.delay === 'number') {
  2544. config.delay = {
  2545. show: config.delay,
  2546. hide: config.delay
  2547. };
  2548. }
  2549. Util.typeCheckConfig(NAME, config, this.constructor.DefaultType);
  2550. return config;
  2551. };
  2552. Tooltip.prototype._getDelegateConfig = function _getDelegateConfig() {
  2553. var config = {};
  2554. if (this.config) {
  2555. for (var key in this.config) {
  2556. if (this.constructor.Default[key] !== this.config[key]) {
  2557. config[key] = this.config[key];
  2558. }
  2559. }
  2560. }
  2561. return config;
  2562. };
  2563. // static
  2564. Tooltip._jQueryInterface = function _jQueryInterface(config) {
  2565. return this.each(function () {
  2566. var data = $(this).data(DATA_KEY);
  2567. var _config = (typeof config === 'undefined' ? 'undefined' : _typeof(config)) === 'object' && config;
  2568. if (!data && /dispose|hide/.test(config)) {
  2569. return;
  2570. }
  2571. if (!data) {
  2572. data = new Tooltip(this, _config);
  2573. $(this).data(DATA_KEY, data);
  2574. }
  2575. if (typeof config === 'string') {
  2576. if (data[config] === undefined) {
  2577. throw new Error('No method named "' + config + '"');
  2578. }
  2579. data[config]();
  2580. }
  2581. });
  2582. };
  2583. _createClass(Tooltip, null, [{
  2584. key: 'VERSION',
  2585. get: function get() {
  2586. return VERSION;
  2587. }
  2588. }, {
  2589. key: 'Default',
  2590. get: function get() {
  2591. return Default;
  2592. }
  2593. }, {
  2594. key: 'NAME',
  2595. get: function get() {
  2596. return NAME;
  2597. }
  2598. }, {
  2599. key: 'DATA_KEY',
  2600. get: function get() {
  2601. return DATA_KEY;
  2602. }
  2603. }, {
  2604. key: 'Event',
  2605. get: function get() {
  2606. return Event;
  2607. }
  2608. }, {
  2609. key: 'EVENT_KEY',
  2610. get: function get() {
  2611. return EVENT_KEY;
  2612. }
  2613. }, {
  2614. key: 'DefaultType',
  2615. get: function get() {
  2616. return DefaultType;
  2617. }
  2618. }]);
  2619. return Tooltip;
  2620. }();
  2621. /**
  2622. * ------------------------------------------------------------------------
  2623. * jQuery
  2624. * ------------------------------------------------------------------------
  2625. */
  2626. $.fn[NAME] = Tooltip._jQueryInterface;
  2627. $.fn[NAME].Constructor = Tooltip;
  2628. $.fn[NAME].noConflict = function () {
  2629. $.fn[NAME] = JQUERY_NO_CONFLICT;
  2630. return Tooltip._jQueryInterface;
  2631. };
  2632. return Tooltip;
  2633. }(jQuery);
  2634. /**
  2635. * --------------------------------------------------------------------------
  2636. * Bootstrap (v4.0.0-alpha.6): popover.js
  2637. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  2638. * --------------------------------------------------------------------------
  2639. */
  2640. var Popover = function ($) {
  2641. /**
  2642. * ------------------------------------------------------------------------
  2643. * Constants
  2644. * ------------------------------------------------------------------------
  2645. */
  2646. var NAME = 'popover';
  2647. var VERSION = '4.0.0-alpha.6';
  2648. var DATA_KEY = 'bs.popover';
  2649. var EVENT_KEY = '.' + DATA_KEY;
  2650. var JQUERY_NO_CONFLICT = $.fn[NAME];
  2651. var Default = $.extend({}, Tooltip.Default, {
  2652. placement: 'right',
  2653. trigger: 'click',
  2654. content: '',
  2655. template: '<div class="popover" role="tooltip">' + '<h3 class="popover-title"></h3>' + '<div class="popover-content"></div></div>'
  2656. });
  2657. var DefaultType = $.extend({}, Tooltip.DefaultType, {
  2658. content: '(string|element|function)'
  2659. });
  2660. var ClassName = {
  2661. FADE: 'fade',
  2662. SHOW: 'show'
  2663. };
  2664. var Selector = {
  2665. TITLE: '.popover-title',
  2666. CONTENT: '.popover-content'
  2667. };
  2668. var Event = {
  2669. HIDE: 'hide' + EVENT_KEY,
  2670. HIDDEN: 'hidden' + EVENT_KEY,
  2671. SHOW: 'show' + EVENT_KEY,
  2672. SHOWN: 'shown' + EVENT_KEY,
  2673. INSERTED: 'inserted' + EVENT_KEY,
  2674. CLICK: 'click' + EVENT_KEY,
  2675. FOCUSIN: 'focusin' + EVENT_KEY,
  2676. FOCUSOUT: 'focusout' + EVENT_KEY,
  2677. MOUSEENTER: 'mouseenter' + EVENT_KEY,
  2678. MOUSELEAVE: 'mouseleave' + EVENT_KEY
  2679. };
  2680. /**
  2681. * ------------------------------------------------------------------------
  2682. * Class Definition
  2683. * ------------------------------------------------------------------------
  2684. */
  2685. var Popover = function (_Tooltip) {
  2686. _inherits(Popover, _Tooltip);
  2687. function Popover() {
  2688. _classCallCheck(this, Popover);
  2689. return _possibleConstructorReturn(this, _Tooltip.apply(this, arguments));
  2690. }
  2691. // overrides
  2692. Popover.prototype.isWithContent = function isWithContent() {
  2693. return this.getTitle() || this._getContent();
  2694. };
  2695. Popover.prototype.getTipElement = function getTipElement() {
  2696. return this.tip = this.tip || $(this.config.template)[0];
  2697. };
  2698. Popover.prototype.setContent = function setContent() {
  2699. var $tip = $(this.getTipElement());
  2700. // we use append for html objects to maintain js events
  2701. this.setElementContent($tip.find(Selector.TITLE), this.getTitle());
  2702. this.setElementContent($tip.find(Selector.CONTENT), this._getContent());
  2703. $tip.removeClass(ClassName.FADE + ' ' + ClassName.SHOW);
  2704. this.cleanupTether();
  2705. };
  2706. // private
  2707. Popover.prototype._getContent = function _getContent() {
  2708. return this.element.getAttribute('data-content') || (typeof this.config.content === 'function' ? this.config.content.call(this.element) : this.config.content);
  2709. };
  2710. // static
  2711. Popover._jQueryInterface = function _jQueryInterface(config) {
  2712. return this.each(function () {
  2713. var data = $(this).data(DATA_KEY);
  2714. var _config = (typeof config === 'undefined' ? 'undefined' : _typeof(config)) === 'object' ? config : null;
  2715. if (!data && /destroy|hide/.test(config)) {
  2716. return;
  2717. }
  2718. if (!data) {
  2719. data = new Popover(this, _config);
  2720. $(this).data(DATA_KEY, data);
  2721. }
  2722. if (typeof config === 'string') {
  2723. if (data[config] === undefined) {
  2724. throw new Error('No method named "' + config + '"');
  2725. }
  2726. data[config]();
  2727. }
  2728. });
  2729. };
  2730. _createClass(Popover, null, [{
  2731. key: 'VERSION',
  2732. // getters
  2733. get: function get() {
  2734. return VERSION;
  2735. }
  2736. }, {
  2737. key: 'Default',
  2738. get: function get() {
  2739. return Default;
  2740. }
  2741. }, {
  2742. key: 'NAME',
  2743. get: function get() {
  2744. return NAME;
  2745. }
  2746. }, {
  2747. key: 'DATA_KEY',
  2748. get: function get() {
  2749. return DATA_KEY;
  2750. }
  2751. }, {
  2752. key: 'Event',
  2753. get: function get() {
  2754. return Event;
  2755. }
  2756. }, {
  2757. key: 'EVENT_KEY',
  2758. get: function get() {
  2759. return EVENT_KEY;
  2760. }
  2761. }, {
  2762. key: 'DefaultType',
  2763. get: function get() {
  2764. return DefaultType;
  2765. }
  2766. }]);
  2767. return Popover;
  2768. }(Tooltip);
  2769. /**
  2770. * ------------------------------------------------------------------------
  2771. * jQuery
  2772. * ------------------------------------------------------------------------
  2773. */
  2774. $.fn[NAME] = Popover._jQueryInterface;
  2775. $.fn[NAME].Constructor = Popover;
  2776. $.fn[NAME].noConflict = function () {
  2777. $.fn[NAME] = JQUERY_NO_CONFLICT;
  2778. return Popover._jQueryInterface;
  2779. };
  2780. return Popover;
  2781. }(jQuery);
  2782. }();