bootstrap.js 97KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536
  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. }();