bootstrap.js 140 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418
  1. /*!
  2. * Bootstrap v4.5.3 (https://getbootstrap.com/)
  3. * Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
  4. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
  5. */
  6. (function (global, factory) {
  7. typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('jquery'), require('popper.js')) :
  8. typeof define === 'function' && define.amd ? define(['exports', 'jquery', 'popper.js'], factory) :
  9. (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.bootstrap = {}, global.jQuery, global.Popper));
  10. }(this, (function (exports, $, Popper) { 'use strict';
  11. function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
  12. var $__default = /*#__PURE__*/_interopDefaultLegacy($);
  13. var Popper__default = /*#__PURE__*/_interopDefaultLegacy(Popper);
  14. function _defineProperties(target, props) {
  15. for (var i = 0; i < props.length; i++) {
  16. var descriptor = props[i];
  17. descriptor.enumerable = descriptor.enumerable || false;
  18. descriptor.configurable = true;
  19. if ("value" in descriptor) descriptor.writable = true;
  20. Object.defineProperty(target, descriptor.key, descriptor);
  21. }
  22. }
  23. function _createClass(Constructor, protoProps, staticProps) {
  24. if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  25. if (staticProps) _defineProperties(Constructor, staticProps);
  26. return Constructor;
  27. }
  28. function _extends() {
  29. _extends = Object.assign || function (target) {
  30. for (var i = 1; i < arguments.length; i++) {
  31. var source = arguments[i];
  32. for (var key in source) {
  33. if (Object.prototype.hasOwnProperty.call(source, key)) {
  34. target[key] = source[key];
  35. }
  36. }
  37. }
  38. return target;
  39. };
  40. return _extends.apply(this, arguments);
  41. }
  42. function _inheritsLoose(subClass, superClass) {
  43. subClass.prototype = Object.create(superClass.prototype);
  44. subClass.prototype.constructor = subClass;
  45. subClass.__proto__ = superClass;
  46. }
  47. /**
  48. * --------------------------------------------------------------------------
  49. * Bootstrap (v4.5.3): util.js
  50. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
  51. * --------------------------------------------------------------------------
  52. */
  53. /**
  54. * ------------------------------------------------------------------------
  55. * Private TransitionEnd Helpers
  56. * ------------------------------------------------------------------------
  57. */
  58. var TRANSITION_END = 'transitionend';
  59. var MAX_UID = 1000000;
  60. var MILLISECONDS_MULTIPLIER = 1000; // Shoutout AngusCroll (https://goo.gl/pxwQGp)
  61. function toType(obj) {
  62. if (obj === null || typeof obj === 'undefined') {
  63. return "" + obj;
  64. }
  65. return {}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase();
  66. }
  67. function getSpecialTransitionEndEvent() {
  68. return {
  69. bindType: TRANSITION_END,
  70. delegateType: TRANSITION_END,
  71. handle: function handle(event) {
  72. if ($__default['default'](event.target).is(this)) {
  73. return event.handleObj.handler.apply(this, arguments); // eslint-disable-line prefer-rest-params
  74. }
  75. return undefined;
  76. }
  77. };
  78. }
  79. function transitionEndEmulator(duration) {
  80. var _this = this;
  81. var called = false;
  82. $__default['default'](this).one(Util.TRANSITION_END, function () {
  83. called = true;
  84. });
  85. setTimeout(function () {
  86. if (!called) {
  87. Util.triggerTransitionEnd(_this);
  88. }
  89. }, duration);
  90. return this;
  91. }
  92. function setTransitionEndSupport() {
  93. $__default['default'].fn.emulateTransitionEnd = transitionEndEmulator;
  94. $__default['default'].event.special[Util.TRANSITION_END] = getSpecialTransitionEndEvent();
  95. }
  96. /**
  97. * --------------------------------------------------------------------------
  98. * Public Util Api
  99. * --------------------------------------------------------------------------
  100. */
  101. var Util = {
  102. TRANSITION_END: 'bsTransitionEnd',
  103. getUID: function getUID(prefix) {
  104. do {
  105. prefix += ~~(Math.random() * MAX_UID); // "~~" acts like a faster Math.floor() here
  106. } while (document.getElementById(prefix));
  107. return prefix;
  108. },
  109. getSelectorFromElement: function getSelectorFromElement(element) {
  110. var selector = element.getAttribute('data-target');
  111. if (!selector || selector === '#') {
  112. var hrefAttr = element.getAttribute('href');
  113. selector = hrefAttr && hrefAttr !== '#' ? hrefAttr.trim() : '';
  114. }
  115. try {
  116. return document.querySelector(selector) ? selector : null;
  117. } catch (_) {
  118. return null;
  119. }
  120. },
  121. getTransitionDurationFromElement: function getTransitionDurationFromElement(element) {
  122. if (!element) {
  123. return 0;
  124. } // Get transition-duration of the element
  125. var transitionDuration = $__default['default'](element).css('transition-duration');
  126. var transitionDelay = $__default['default'](element).css('transition-delay');
  127. var floatTransitionDuration = parseFloat(transitionDuration);
  128. var floatTransitionDelay = parseFloat(transitionDelay); // Return 0 if element or transition duration is not found
  129. if (!floatTransitionDuration && !floatTransitionDelay) {
  130. return 0;
  131. } // If multiple durations are defined, take the first
  132. transitionDuration = transitionDuration.split(',')[0];
  133. transitionDelay = transitionDelay.split(',')[0];
  134. return (parseFloat(transitionDuration) + parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER;
  135. },
  136. reflow: function reflow(element) {
  137. return element.offsetHeight;
  138. },
  139. triggerTransitionEnd: function triggerTransitionEnd(element) {
  140. $__default['default'](element).trigger(TRANSITION_END);
  141. },
  142. supportsTransitionEnd: function supportsTransitionEnd() {
  143. return Boolean(TRANSITION_END);
  144. },
  145. isElement: function isElement(obj) {
  146. return (obj[0] || obj).nodeType;
  147. },
  148. typeCheckConfig: function typeCheckConfig(componentName, config, configTypes) {
  149. for (var property in configTypes) {
  150. if (Object.prototype.hasOwnProperty.call(configTypes, property)) {
  151. var expectedTypes = configTypes[property];
  152. var value = config[property];
  153. var valueType = value && Util.isElement(value) ? 'element' : toType(value);
  154. if (!new RegExp(expectedTypes).test(valueType)) {
  155. throw new Error(componentName.toUpperCase() + ": " + ("Option \"" + property + "\" provided type \"" + valueType + "\" ") + ("but expected type \"" + expectedTypes + "\"."));
  156. }
  157. }
  158. }
  159. },
  160. findShadowRoot: function findShadowRoot(element) {
  161. if (!document.documentElement.attachShadow) {
  162. return null;
  163. } // Can find the shadow root otherwise it'll return the document
  164. if (typeof element.getRootNode === 'function') {
  165. var root = element.getRootNode();
  166. return root instanceof ShadowRoot ? root : null;
  167. }
  168. if (element instanceof ShadowRoot) {
  169. return element;
  170. } // when we don't find a shadow root
  171. if (!element.parentNode) {
  172. return null;
  173. }
  174. return Util.findShadowRoot(element.parentNode);
  175. },
  176. jQueryDetection: function jQueryDetection() {
  177. if (typeof $__default['default'] === 'undefined') {
  178. throw new TypeError('Bootstrap\'s JavaScript requires jQuery. jQuery must be included before Bootstrap\'s JavaScript.');
  179. }
  180. var version = $__default['default'].fn.jquery.split(' ')[0].split('.');
  181. var minMajor = 1;
  182. var ltMajor = 2;
  183. var minMinor = 9;
  184. var minPatch = 1;
  185. var maxMajor = 4;
  186. if (version[0] < ltMajor && version[1] < minMinor || version[0] === minMajor && version[1] === minMinor && version[2] < minPatch || version[0] >= maxMajor) {
  187. throw new Error('Bootstrap\'s JavaScript requires at least jQuery v1.9.1 but less than v4.0.0');
  188. }
  189. }
  190. };
  191. Util.jQueryDetection();
  192. setTransitionEndSupport();
  193. /**
  194. * ------------------------------------------------------------------------
  195. * Constants
  196. * ------------------------------------------------------------------------
  197. */
  198. var NAME = 'alert';
  199. var VERSION = '4.5.3';
  200. var DATA_KEY = 'bs.alert';
  201. var EVENT_KEY = "." + DATA_KEY;
  202. var DATA_API_KEY = '.data-api';
  203. var JQUERY_NO_CONFLICT = $__default['default'].fn[NAME];
  204. var SELECTOR_DISMISS = '[data-dismiss="alert"]';
  205. var EVENT_CLOSE = "close" + EVENT_KEY;
  206. var EVENT_CLOSED = "closed" + EVENT_KEY;
  207. var EVENT_CLICK_DATA_API = "click" + EVENT_KEY + DATA_API_KEY;
  208. var CLASS_NAME_ALERT = 'alert';
  209. var CLASS_NAME_FADE = 'fade';
  210. var CLASS_NAME_SHOW = 'show';
  211. /**
  212. * ------------------------------------------------------------------------
  213. * Class Definition
  214. * ------------------------------------------------------------------------
  215. */
  216. var Alert = /*#__PURE__*/function () {
  217. function Alert(element) {
  218. this._element = element;
  219. } // Getters
  220. var _proto = Alert.prototype;
  221. // Public
  222. _proto.close = function close(element) {
  223. var rootElement = this._element;
  224. if (element) {
  225. rootElement = this._getRootElement(element);
  226. }
  227. var customEvent = this._triggerCloseEvent(rootElement);
  228. if (customEvent.isDefaultPrevented()) {
  229. return;
  230. }
  231. this._removeElement(rootElement);
  232. };
  233. _proto.dispose = function dispose() {
  234. $__default['default'].removeData(this._element, DATA_KEY);
  235. this._element = null;
  236. } // Private
  237. ;
  238. _proto._getRootElement = function _getRootElement(element) {
  239. var selector = Util.getSelectorFromElement(element);
  240. var parent = false;
  241. if (selector) {
  242. parent = document.querySelector(selector);
  243. }
  244. if (!parent) {
  245. parent = $__default['default'](element).closest("." + CLASS_NAME_ALERT)[0];
  246. }
  247. return parent;
  248. };
  249. _proto._triggerCloseEvent = function _triggerCloseEvent(element) {
  250. var closeEvent = $__default['default'].Event(EVENT_CLOSE);
  251. $__default['default'](element).trigger(closeEvent);
  252. return closeEvent;
  253. };
  254. _proto._removeElement = function _removeElement(element) {
  255. var _this = this;
  256. $__default['default'](element).removeClass(CLASS_NAME_SHOW);
  257. if (!$__default['default'](element).hasClass(CLASS_NAME_FADE)) {
  258. this._destroyElement(element);
  259. return;
  260. }
  261. var transitionDuration = Util.getTransitionDurationFromElement(element);
  262. $__default['default'](element).one(Util.TRANSITION_END, function (event) {
  263. return _this._destroyElement(element, event);
  264. }).emulateTransitionEnd(transitionDuration);
  265. };
  266. _proto._destroyElement = function _destroyElement(element) {
  267. $__default['default'](element).detach().trigger(EVENT_CLOSED).remove();
  268. } // Static
  269. ;
  270. Alert._jQueryInterface = function _jQueryInterface(config) {
  271. return this.each(function () {
  272. var $element = $__default['default'](this);
  273. var data = $element.data(DATA_KEY);
  274. if (!data) {
  275. data = new Alert(this);
  276. $element.data(DATA_KEY, data);
  277. }
  278. if (config === 'close') {
  279. data[config](this);
  280. }
  281. });
  282. };
  283. Alert._handleDismiss = function _handleDismiss(alertInstance) {
  284. return function (event) {
  285. if (event) {
  286. event.preventDefault();
  287. }
  288. alertInstance.close(this);
  289. };
  290. };
  291. _createClass(Alert, null, [{
  292. key: "VERSION",
  293. get: function get() {
  294. return VERSION;
  295. }
  296. }]);
  297. return Alert;
  298. }();
  299. /**
  300. * ------------------------------------------------------------------------
  301. * Data Api implementation
  302. * ------------------------------------------------------------------------
  303. */
  304. $__default['default'](document).on(EVENT_CLICK_DATA_API, SELECTOR_DISMISS, Alert._handleDismiss(new Alert()));
  305. /**
  306. * ------------------------------------------------------------------------
  307. * jQuery
  308. * ------------------------------------------------------------------------
  309. */
  310. $__default['default'].fn[NAME] = Alert._jQueryInterface;
  311. $__default['default'].fn[NAME].Constructor = Alert;
  312. $__default['default'].fn[NAME].noConflict = function () {
  313. $__default['default'].fn[NAME] = JQUERY_NO_CONFLICT;
  314. return Alert._jQueryInterface;
  315. };
  316. /**
  317. * ------------------------------------------------------------------------
  318. * Constants
  319. * ------------------------------------------------------------------------
  320. */
  321. var NAME$1 = 'button';
  322. var VERSION$1 = '4.5.3';
  323. var DATA_KEY$1 = 'bs.button';
  324. var EVENT_KEY$1 = "." + DATA_KEY$1;
  325. var DATA_API_KEY$1 = '.data-api';
  326. var JQUERY_NO_CONFLICT$1 = $__default['default'].fn[NAME$1];
  327. var CLASS_NAME_ACTIVE = 'active';
  328. var CLASS_NAME_BUTTON = 'btn';
  329. var CLASS_NAME_FOCUS = 'focus';
  330. var SELECTOR_DATA_TOGGLE_CARROT = '[data-toggle^="button"]';
  331. var SELECTOR_DATA_TOGGLES = '[data-toggle="buttons"]';
  332. var SELECTOR_DATA_TOGGLE = '[data-toggle="button"]';
  333. var SELECTOR_DATA_TOGGLES_BUTTONS = '[data-toggle="buttons"] .btn';
  334. var SELECTOR_INPUT = 'input:not([type="hidden"])';
  335. var SELECTOR_ACTIVE = '.active';
  336. var SELECTOR_BUTTON = '.btn';
  337. var EVENT_CLICK_DATA_API$1 = "click" + EVENT_KEY$1 + DATA_API_KEY$1;
  338. var EVENT_FOCUS_BLUR_DATA_API = "focus" + EVENT_KEY$1 + DATA_API_KEY$1 + " " + ("blur" + EVENT_KEY$1 + DATA_API_KEY$1);
  339. var EVENT_LOAD_DATA_API = "load" + EVENT_KEY$1 + DATA_API_KEY$1;
  340. /**
  341. * ------------------------------------------------------------------------
  342. * Class Definition
  343. * ------------------------------------------------------------------------
  344. */
  345. var Button = /*#__PURE__*/function () {
  346. function Button(element) {
  347. this._element = element;
  348. this.shouldAvoidTriggerChange = false;
  349. } // Getters
  350. var _proto = Button.prototype;
  351. // Public
  352. _proto.toggle = function toggle() {
  353. var triggerChangeEvent = true;
  354. var addAriaPressed = true;
  355. var rootElement = $__default['default'](this._element).closest(SELECTOR_DATA_TOGGLES)[0];
  356. if (rootElement) {
  357. var input = this._element.querySelector(SELECTOR_INPUT);
  358. if (input) {
  359. if (input.type === 'radio') {
  360. if (input.checked && this._element.classList.contains(CLASS_NAME_ACTIVE)) {
  361. triggerChangeEvent = false;
  362. } else {
  363. var activeElement = rootElement.querySelector(SELECTOR_ACTIVE);
  364. if (activeElement) {
  365. $__default['default'](activeElement).removeClass(CLASS_NAME_ACTIVE);
  366. }
  367. }
  368. }
  369. if (triggerChangeEvent) {
  370. // if it's not a radio button or checkbox don't add a pointless/invalid checked property to the input
  371. if (input.type === 'checkbox' || input.type === 'radio') {
  372. input.checked = !this._element.classList.contains(CLASS_NAME_ACTIVE);
  373. }
  374. if (!this.shouldAvoidTriggerChange) {
  375. $__default['default'](input).trigger('change');
  376. }
  377. }
  378. input.focus();
  379. addAriaPressed = false;
  380. }
  381. }
  382. if (!(this._element.hasAttribute('disabled') || this._element.classList.contains('disabled'))) {
  383. if (addAriaPressed) {
  384. this._element.setAttribute('aria-pressed', !this._element.classList.contains(CLASS_NAME_ACTIVE));
  385. }
  386. if (triggerChangeEvent) {
  387. $__default['default'](this._element).toggleClass(CLASS_NAME_ACTIVE);
  388. }
  389. }
  390. };
  391. _proto.dispose = function dispose() {
  392. $__default['default'].removeData(this._element, DATA_KEY$1);
  393. this._element = null;
  394. } // Static
  395. ;
  396. Button._jQueryInterface = function _jQueryInterface(config, avoidTriggerChange) {
  397. return this.each(function () {
  398. var $element = $__default['default'](this);
  399. var data = $element.data(DATA_KEY$1);
  400. if (!data) {
  401. data = new Button(this);
  402. $element.data(DATA_KEY$1, data);
  403. }
  404. data.shouldAvoidTriggerChange = avoidTriggerChange;
  405. if (config === 'toggle') {
  406. data[config]();
  407. }
  408. });
  409. };
  410. _createClass(Button, null, [{
  411. key: "VERSION",
  412. get: function get() {
  413. return VERSION$1;
  414. }
  415. }]);
  416. return Button;
  417. }();
  418. /**
  419. * ------------------------------------------------------------------------
  420. * Data Api implementation
  421. * ------------------------------------------------------------------------
  422. */
  423. $__default['default'](document).on(EVENT_CLICK_DATA_API$1, SELECTOR_DATA_TOGGLE_CARROT, function (event) {
  424. var button = event.target;
  425. var initialButton = button;
  426. if (!$__default['default'](button).hasClass(CLASS_NAME_BUTTON)) {
  427. button = $__default['default'](button).closest(SELECTOR_BUTTON)[0];
  428. }
  429. if (!button || button.hasAttribute('disabled') || button.classList.contains('disabled')) {
  430. event.preventDefault(); // work around Firefox bug #1540995
  431. } else {
  432. var inputBtn = button.querySelector(SELECTOR_INPUT);
  433. if (inputBtn && (inputBtn.hasAttribute('disabled') || inputBtn.classList.contains('disabled'))) {
  434. event.preventDefault(); // work around Firefox bug #1540995
  435. return;
  436. }
  437. if (initialButton.tagName === 'INPUT' || button.tagName !== 'LABEL') {
  438. Button._jQueryInterface.call($__default['default'](button), 'toggle', initialButton.tagName === 'INPUT');
  439. }
  440. }
  441. }).on(EVENT_FOCUS_BLUR_DATA_API, SELECTOR_DATA_TOGGLE_CARROT, function (event) {
  442. var button = $__default['default'](event.target).closest(SELECTOR_BUTTON)[0];
  443. $__default['default'](button).toggleClass(CLASS_NAME_FOCUS, /^focus(in)?$/.test(event.type));
  444. });
  445. $__default['default'](window).on(EVENT_LOAD_DATA_API, function () {
  446. // ensure correct active class is set to match the controls' actual values/states
  447. // find all checkboxes/readio buttons inside data-toggle groups
  448. var buttons = [].slice.call(document.querySelectorAll(SELECTOR_DATA_TOGGLES_BUTTONS));
  449. for (var i = 0, len = buttons.length; i < len; i++) {
  450. var button = buttons[i];
  451. var input = button.querySelector(SELECTOR_INPUT);
  452. if (input.checked || input.hasAttribute('checked')) {
  453. button.classList.add(CLASS_NAME_ACTIVE);
  454. } else {
  455. button.classList.remove(CLASS_NAME_ACTIVE);
  456. }
  457. } // find all button toggles
  458. buttons = [].slice.call(document.querySelectorAll(SELECTOR_DATA_TOGGLE));
  459. for (var _i = 0, _len = buttons.length; _i < _len; _i++) {
  460. var _button = buttons[_i];
  461. if (_button.getAttribute('aria-pressed') === 'true') {
  462. _button.classList.add(CLASS_NAME_ACTIVE);
  463. } else {
  464. _button.classList.remove(CLASS_NAME_ACTIVE);
  465. }
  466. }
  467. });
  468. /**
  469. * ------------------------------------------------------------------------
  470. * jQuery
  471. * ------------------------------------------------------------------------
  472. */
  473. $__default['default'].fn[NAME$1] = Button._jQueryInterface;
  474. $__default['default'].fn[NAME$1].Constructor = Button;
  475. $__default['default'].fn[NAME$1].noConflict = function () {
  476. $__default['default'].fn[NAME$1] = JQUERY_NO_CONFLICT$1;
  477. return Button._jQueryInterface;
  478. };
  479. /**
  480. * ------------------------------------------------------------------------
  481. * Constants
  482. * ------------------------------------------------------------------------
  483. */
  484. var NAME$2 = 'carousel';
  485. var VERSION$2 = '4.5.3';
  486. var DATA_KEY$2 = 'bs.carousel';
  487. var EVENT_KEY$2 = "." + DATA_KEY$2;
  488. var DATA_API_KEY$2 = '.data-api';
  489. var JQUERY_NO_CONFLICT$2 = $__default['default'].fn[NAME$2];
  490. var ARROW_LEFT_KEYCODE = 37; // KeyboardEvent.which value for left arrow key
  491. var ARROW_RIGHT_KEYCODE = 39; // KeyboardEvent.which value for right arrow key
  492. var TOUCHEVENT_COMPAT_WAIT = 500; // Time for mouse compat events to fire after touch
  493. var SWIPE_THRESHOLD = 40;
  494. var Default = {
  495. interval: 5000,
  496. keyboard: true,
  497. slide: false,
  498. pause: 'hover',
  499. wrap: true,
  500. touch: true
  501. };
  502. var DefaultType = {
  503. interval: '(number|boolean)',
  504. keyboard: 'boolean',
  505. slide: '(boolean|string)',
  506. pause: '(string|boolean)',
  507. wrap: 'boolean',
  508. touch: 'boolean'
  509. };
  510. var DIRECTION_NEXT = 'next';
  511. var DIRECTION_PREV = 'prev';
  512. var DIRECTION_LEFT = 'left';
  513. var DIRECTION_RIGHT = 'right';
  514. var EVENT_SLIDE = "slide" + EVENT_KEY$2;
  515. var EVENT_SLID = "slid" + EVENT_KEY$2;
  516. var EVENT_KEYDOWN = "keydown" + EVENT_KEY$2;
  517. var EVENT_MOUSEENTER = "mouseenter" + EVENT_KEY$2;
  518. var EVENT_MOUSELEAVE = "mouseleave" + EVENT_KEY$2;
  519. var EVENT_TOUCHSTART = "touchstart" + EVENT_KEY$2;
  520. var EVENT_TOUCHMOVE = "touchmove" + EVENT_KEY$2;
  521. var EVENT_TOUCHEND = "touchend" + EVENT_KEY$2;
  522. var EVENT_POINTERDOWN = "pointerdown" + EVENT_KEY$2;
  523. var EVENT_POINTERUP = "pointerup" + EVENT_KEY$2;
  524. var EVENT_DRAG_START = "dragstart" + EVENT_KEY$2;
  525. var EVENT_LOAD_DATA_API$1 = "load" + EVENT_KEY$2 + DATA_API_KEY$2;
  526. var EVENT_CLICK_DATA_API$2 = "click" + EVENT_KEY$2 + DATA_API_KEY$2;
  527. var CLASS_NAME_CAROUSEL = 'carousel';
  528. var CLASS_NAME_ACTIVE$1 = 'active';
  529. var CLASS_NAME_SLIDE = 'slide';
  530. var CLASS_NAME_RIGHT = 'carousel-item-right';
  531. var CLASS_NAME_LEFT = 'carousel-item-left';
  532. var CLASS_NAME_NEXT = 'carousel-item-next';
  533. var CLASS_NAME_PREV = 'carousel-item-prev';
  534. var CLASS_NAME_POINTER_EVENT = 'pointer-event';
  535. var SELECTOR_ACTIVE$1 = '.active';
  536. var SELECTOR_ACTIVE_ITEM = '.active.carousel-item';
  537. var SELECTOR_ITEM = '.carousel-item';
  538. var SELECTOR_ITEM_IMG = '.carousel-item img';
  539. var SELECTOR_NEXT_PREV = '.carousel-item-next, .carousel-item-prev';
  540. var SELECTOR_INDICATORS = '.carousel-indicators';
  541. var SELECTOR_DATA_SLIDE = '[data-slide], [data-slide-to]';
  542. var SELECTOR_DATA_RIDE = '[data-ride="carousel"]';
  543. var PointerType = {
  544. TOUCH: 'touch',
  545. PEN: 'pen'
  546. };
  547. /**
  548. * ------------------------------------------------------------------------
  549. * Class Definition
  550. * ------------------------------------------------------------------------
  551. */
  552. var Carousel = /*#__PURE__*/function () {
  553. function Carousel(element, config) {
  554. this._items = null;
  555. this._interval = null;
  556. this._activeElement = null;
  557. this._isPaused = false;
  558. this._isSliding = false;
  559. this.touchTimeout = null;
  560. this.touchStartX = 0;
  561. this.touchDeltaX = 0;
  562. this._config = this._getConfig(config);
  563. this._element = element;
  564. this._indicatorsElement = this._element.querySelector(SELECTOR_INDICATORS);
  565. this._touchSupported = 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0;
  566. this._pointerEvent = Boolean(window.PointerEvent || window.MSPointerEvent);
  567. this._addEventListeners();
  568. } // Getters
  569. var _proto = Carousel.prototype;
  570. // Public
  571. _proto.next = function next() {
  572. if (!this._isSliding) {
  573. this._slide(DIRECTION_NEXT);
  574. }
  575. };
  576. _proto.nextWhenVisible = function nextWhenVisible() {
  577. var $element = $__default['default'](this._element); // Don't call next when the page isn't visible
  578. // or the carousel or its parent isn't visible
  579. if (!document.hidden && $element.is(':visible') && $element.css('visibility') !== 'hidden') {
  580. this.next();
  581. }
  582. };
  583. _proto.prev = function prev() {
  584. if (!this._isSliding) {
  585. this._slide(DIRECTION_PREV);
  586. }
  587. };
  588. _proto.pause = function pause(event) {
  589. if (!event) {
  590. this._isPaused = true;
  591. }
  592. if (this._element.querySelector(SELECTOR_NEXT_PREV)) {
  593. Util.triggerTransitionEnd(this._element);
  594. this.cycle(true);
  595. }
  596. clearInterval(this._interval);
  597. this._interval = null;
  598. };
  599. _proto.cycle = function cycle(event) {
  600. if (!event) {
  601. this._isPaused = false;
  602. }
  603. if (this._interval) {
  604. clearInterval(this._interval);
  605. this._interval = null;
  606. }
  607. if (this._config.interval && !this._isPaused) {
  608. this._interval = setInterval((document.visibilityState ? this.nextWhenVisible : this.next).bind(this), this._config.interval);
  609. }
  610. };
  611. _proto.to = function to(index) {
  612. var _this = this;
  613. this._activeElement = this._element.querySelector(SELECTOR_ACTIVE_ITEM);
  614. var activeIndex = this._getItemIndex(this._activeElement);
  615. if (index > this._items.length - 1 || index < 0) {
  616. return;
  617. }
  618. if (this._isSliding) {
  619. $__default['default'](this._element).one(EVENT_SLID, function () {
  620. return _this.to(index);
  621. });
  622. return;
  623. }
  624. if (activeIndex === index) {
  625. this.pause();
  626. this.cycle();
  627. return;
  628. }
  629. var direction = index > activeIndex ? DIRECTION_NEXT : DIRECTION_PREV;
  630. this._slide(direction, this._items[index]);
  631. };
  632. _proto.dispose = function dispose() {
  633. $__default['default'](this._element).off(EVENT_KEY$2);
  634. $__default['default'].removeData(this._element, DATA_KEY$2);
  635. this._items = null;
  636. this._config = null;
  637. this._element = null;
  638. this._interval = null;
  639. this._isPaused = null;
  640. this._isSliding = null;
  641. this._activeElement = null;
  642. this._indicatorsElement = null;
  643. } // Private
  644. ;
  645. _proto._getConfig = function _getConfig(config) {
  646. config = _extends({}, Default, config);
  647. Util.typeCheckConfig(NAME$2, config, DefaultType);
  648. return config;
  649. };
  650. _proto._handleSwipe = function _handleSwipe() {
  651. var absDeltax = Math.abs(this.touchDeltaX);
  652. if (absDeltax <= SWIPE_THRESHOLD) {
  653. return;
  654. }
  655. var direction = absDeltax / this.touchDeltaX;
  656. this.touchDeltaX = 0; // swipe left
  657. if (direction > 0) {
  658. this.prev();
  659. } // swipe right
  660. if (direction < 0) {
  661. this.next();
  662. }
  663. };
  664. _proto._addEventListeners = function _addEventListeners() {
  665. var _this2 = this;
  666. if (this._config.keyboard) {
  667. $__default['default'](this._element).on(EVENT_KEYDOWN, function (event) {
  668. return _this2._keydown(event);
  669. });
  670. }
  671. if (this._config.pause === 'hover') {
  672. $__default['default'](this._element).on(EVENT_MOUSEENTER, function (event) {
  673. return _this2.pause(event);
  674. }).on(EVENT_MOUSELEAVE, function (event) {
  675. return _this2.cycle(event);
  676. });
  677. }
  678. if (this._config.touch) {
  679. this._addTouchEventListeners();
  680. }
  681. };
  682. _proto._addTouchEventListeners = function _addTouchEventListeners() {
  683. var _this3 = this;
  684. if (!this._touchSupported) {
  685. return;
  686. }
  687. var start = function start(event) {
  688. if (_this3._pointerEvent && PointerType[event.originalEvent.pointerType.toUpperCase()]) {
  689. _this3.touchStartX = event.originalEvent.clientX;
  690. } else if (!_this3._pointerEvent) {
  691. _this3.touchStartX = event.originalEvent.touches[0].clientX;
  692. }
  693. };
  694. var move = function move(event) {
  695. // ensure swiping with one touch and not pinching
  696. if (event.originalEvent.touches && event.originalEvent.touches.length > 1) {
  697. _this3.touchDeltaX = 0;
  698. } else {
  699. _this3.touchDeltaX = event.originalEvent.touches[0].clientX - _this3.touchStartX;
  700. }
  701. };
  702. var end = function end(event) {
  703. if (_this3._pointerEvent && PointerType[event.originalEvent.pointerType.toUpperCase()]) {
  704. _this3.touchDeltaX = event.originalEvent.clientX - _this3.touchStartX;
  705. }
  706. _this3._handleSwipe();
  707. if (_this3._config.pause === 'hover') {
  708. // If it's a touch-enabled device, mouseenter/leave are fired as
  709. // part of the mouse compatibility events on first tap - the carousel
  710. // would stop cycling until user tapped out of it;
  711. // here, we listen for touchend, explicitly pause the carousel
  712. // (as if it's the second time we tap on it, mouseenter compat event
  713. // is NOT fired) and after a timeout (to allow for mouse compatibility
  714. // events to fire) we explicitly restart cycling
  715. _this3.pause();
  716. if (_this3.touchTimeout) {
  717. clearTimeout(_this3.touchTimeout);
  718. }
  719. _this3.touchTimeout = setTimeout(function (event) {
  720. return _this3.cycle(event);
  721. }, TOUCHEVENT_COMPAT_WAIT + _this3._config.interval);
  722. }
  723. };
  724. $__default['default'](this._element.querySelectorAll(SELECTOR_ITEM_IMG)).on(EVENT_DRAG_START, function (e) {
  725. return e.preventDefault();
  726. });
  727. if (this._pointerEvent) {
  728. $__default['default'](this._element).on(EVENT_POINTERDOWN, function (event) {
  729. return start(event);
  730. });
  731. $__default['default'](this._element).on(EVENT_POINTERUP, function (event) {
  732. return end(event);
  733. });
  734. this._element.classList.add(CLASS_NAME_POINTER_EVENT);
  735. } else {
  736. $__default['default'](this._element).on(EVENT_TOUCHSTART, function (event) {
  737. return start(event);
  738. });
  739. $__default['default'](this._element).on(EVENT_TOUCHMOVE, function (event) {
  740. return move(event);
  741. });
  742. $__default['default'](this._element).on(EVENT_TOUCHEND, function (event) {
  743. return end(event);
  744. });
  745. }
  746. };
  747. _proto._keydown = function _keydown(event) {
  748. if (/input|textarea/i.test(event.target.tagName)) {
  749. return;
  750. }
  751. switch (event.which) {
  752. case ARROW_LEFT_KEYCODE:
  753. event.preventDefault();
  754. this.prev();
  755. break;
  756. case ARROW_RIGHT_KEYCODE:
  757. event.preventDefault();
  758. this.next();
  759. break;
  760. }
  761. };
  762. _proto._getItemIndex = function _getItemIndex(element) {
  763. this._items = element && element.parentNode ? [].slice.call(element.parentNode.querySelectorAll(SELECTOR_ITEM)) : [];
  764. return this._items.indexOf(element);
  765. };
  766. _proto._getItemByDirection = function _getItemByDirection(direction, activeElement) {
  767. var isNextDirection = direction === DIRECTION_NEXT;
  768. var isPrevDirection = direction === DIRECTION_PREV;
  769. var activeIndex = this._getItemIndex(activeElement);
  770. var lastItemIndex = this._items.length - 1;
  771. var isGoingToWrap = isPrevDirection && activeIndex === 0 || isNextDirection && activeIndex === lastItemIndex;
  772. if (isGoingToWrap && !this._config.wrap) {
  773. return activeElement;
  774. }
  775. var delta = direction === DIRECTION_PREV ? -1 : 1;
  776. var itemIndex = (activeIndex + delta) % this._items.length;
  777. return itemIndex === -1 ? this._items[this._items.length - 1] : this._items[itemIndex];
  778. };
  779. _proto._triggerSlideEvent = function _triggerSlideEvent(relatedTarget, eventDirectionName) {
  780. var targetIndex = this._getItemIndex(relatedTarget);
  781. var fromIndex = this._getItemIndex(this._element.querySelector(SELECTOR_ACTIVE_ITEM));
  782. var slideEvent = $__default['default'].Event(EVENT_SLIDE, {
  783. relatedTarget: relatedTarget,
  784. direction: eventDirectionName,
  785. from: fromIndex,
  786. to: targetIndex
  787. });
  788. $__default['default'](this._element).trigger(slideEvent);
  789. return slideEvent;
  790. };
  791. _proto._setActiveIndicatorElement = function _setActiveIndicatorElement(element) {
  792. if (this._indicatorsElement) {
  793. var indicators = [].slice.call(this._indicatorsElement.querySelectorAll(SELECTOR_ACTIVE$1));
  794. $__default['default'](indicators).removeClass(CLASS_NAME_ACTIVE$1);
  795. var nextIndicator = this._indicatorsElement.children[this._getItemIndex(element)];
  796. if (nextIndicator) {
  797. $__default['default'](nextIndicator).addClass(CLASS_NAME_ACTIVE$1);
  798. }
  799. }
  800. };
  801. _proto._slide = function _slide(direction, element) {
  802. var _this4 = this;
  803. var activeElement = this._element.querySelector(SELECTOR_ACTIVE_ITEM);
  804. var activeElementIndex = this._getItemIndex(activeElement);
  805. var nextElement = element || activeElement && this._getItemByDirection(direction, activeElement);
  806. var nextElementIndex = this._getItemIndex(nextElement);
  807. var isCycling = Boolean(this._interval);
  808. var directionalClassName;
  809. var orderClassName;
  810. var eventDirectionName;
  811. if (direction === DIRECTION_NEXT) {
  812. directionalClassName = CLASS_NAME_LEFT;
  813. orderClassName = CLASS_NAME_NEXT;
  814. eventDirectionName = DIRECTION_LEFT;
  815. } else {
  816. directionalClassName = CLASS_NAME_RIGHT;
  817. orderClassName = CLASS_NAME_PREV;
  818. eventDirectionName = DIRECTION_RIGHT;
  819. }
  820. if (nextElement && $__default['default'](nextElement).hasClass(CLASS_NAME_ACTIVE$1)) {
  821. this._isSliding = false;
  822. return;
  823. }
  824. var slideEvent = this._triggerSlideEvent(nextElement, eventDirectionName);
  825. if (slideEvent.isDefaultPrevented()) {
  826. return;
  827. }
  828. if (!activeElement || !nextElement) {
  829. // Some weirdness is happening, so we bail
  830. return;
  831. }
  832. this._isSliding = true;
  833. if (isCycling) {
  834. this.pause();
  835. }
  836. this._setActiveIndicatorElement(nextElement);
  837. var slidEvent = $__default['default'].Event(EVENT_SLID, {
  838. relatedTarget: nextElement,
  839. direction: eventDirectionName,
  840. from: activeElementIndex,
  841. to: nextElementIndex
  842. });
  843. if ($__default['default'](this._element).hasClass(CLASS_NAME_SLIDE)) {
  844. $__default['default'](nextElement).addClass(orderClassName);
  845. Util.reflow(nextElement);
  846. $__default['default'](activeElement).addClass(directionalClassName);
  847. $__default['default'](nextElement).addClass(directionalClassName);
  848. var nextElementInterval = parseInt(nextElement.getAttribute('data-interval'), 10);
  849. if (nextElementInterval) {
  850. this._config.defaultInterval = this._config.defaultInterval || this._config.interval;
  851. this._config.interval = nextElementInterval;
  852. } else {
  853. this._config.interval = this._config.defaultInterval || this._config.interval;
  854. }
  855. var transitionDuration = Util.getTransitionDurationFromElement(activeElement);
  856. $__default['default'](activeElement).one(Util.TRANSITION_END, function () {
  857. $__default['default'](nextElement).removeClass(directionalClassName + " " + orderClassName).addClass(CLASS_NAME_ACTIVE$1);
  858. $__default['default'](activeElement).removeClass(CLASS_NAME_ACTIVE$1 + " " + orderClassName + " " + directionalClassName);
  859. _this4._isSliding = false;
  860. setTimeout(function () {
  861. return $__default['default'](_this4._element).trigger(slidEvent);
  862. }, 0);
  863. }).emulateTransitionEnd(transitionDuration);
  864. } else {
  865. $__default['default'](activeElement).removeClass(CLASS_NAME_ACTIVE$1);
  866. $__default['default'](nextElement).addClass(CLASS_NAME_ACTIVE$1);
  867. this._isSliding = false;
  868. $__default['default'](this._element).trigger(slidEvent);
  869. }
  870. if (isCycling) {
  871. this.cycle();
  872. }
  873. } // Static
  874. ;
  875. Carousel._jQueryInterface = function _jQueryInterface(config) {
  876. return this.each(function () {
  877. var data = $__default['default'](this).data(DATA_KEY$2);
  878. var _config = _extends({}, Default, $__default['default'](this).data());
  879. if (typeof config === 'object') {
  880. _config = _extends({}, _config, config);
  881. }
  882. var action = typeof config === 'string' ? config : _config.slide;
  883. if (!data) {
  884. data = new Carousel(this, _config);
  885. $__default['default'](this).data(DATA_KEY$2, data);
  886. }
  887. if (typeof config === 'number') {
  888. data.to(config);
  889. } else if (typeof action === 'string') {
  890. if (typeof data[action] === 'undefined') {
  891. throw new TypeError("No method named \"" + action + "\"");
  892. }
  893. data[action]();
  894. } else if (_config.interval && _config.ride) {
  895. data.pause();
  896. data.cycle();
  897. }
  898. });
  899. };
  900. Carousel._dataApiClickHandler = function _dataApiClickHandler(event) {
  901. var selector = Util.getSelectorFromElement(this);
  902. if (!selector) {
  903. return;
  904. }
  905. var target = $__default['default'](selector)[0];
  906. if (!target || !$__default['default'](target).hasClass(CLASS_NAME_CAROUSEL)) {
  907. return;
  908. }
  909. var config = _extends({}, $__default['default'](target).data(), $__default['default'](this).data());
  910. var slideIndex = this.getAttribute('data-slide-to');
  911. if (slideIndex) {
  912. config.interval = false;
  913. }
  914. Carousel._jQueryInterface.call($__default['default'](target), config);
  915. if (slideIndex) {
  916. $__default['default'](target).data(DATA_KEY$2).to(slideIndex);
  917. }
  918. event.preventDefault();
  919. };
  920. _createClass(Carousel, null, [{
  921. key: "VERSION",
  922. get: function get() {
  923. return VERSION$2;
  924. }
  925. }, {
  926. key: "Default",
  927. get: function get() {
  928. return Default;
  929. }
  930. }]);
  931. return Carousel;
  932. }();
  933. /**
  934. * ------------------------------------------------------------------------
  935. * Data Api implementation
  936. * ------------------------------------------------------------------------
  937. */
  938. $__default['default'](document).on(EVENT_CLICK_DATA_API$2, SELECTOR_DATA_SLIDE, Carousel._dataApiClickHandler);
  939. $__default['default'](window).on(EVENT_LOAD_DATA_API$1, function () {
  940. var carousels = [].slice.call(document.querySelectorAll(SELECTOR_DATA_RIDE));
  941. for (var i = 0, len = carousels.length; i < len; i++) {
  942. var $carousel = $__default['default'](carousels[i]);
  943. Carousel._jQueryInterface.call($carousel, $carousel.data());
  944. }
  945. });
  946. /**
  947. * ------------------------------------------------------------------------
  948. * jQuery
  949. * ------------------------------------------------------------------------
  950. */
  951. $__default['default'].fn[NAME$2] = Carousel._jQueryInterface;
  952. $__default['default'].fn[NAME$2].Constructor = Carousel;
  953. $__default['default'].fn[NAME$2].noConflict = function () {
  954. $__default['default'].fn[NAME$2] = JQUERY_NO_CONFLICT$2;
  955. return Carousel._jQueryInterface;
  956. };
  957. /**
  958. * ------------------------------------------------------------------------
  959. * Constants
  960. * ------------------------------------------------------------------------
  961. */
  962. var NAME$3 = 'collapse';
  963. var VERSION$3 = '4.5.3';
  964. var DATA_KEY$3 = 'bs.collapse';
  965. var EVENT_KEY$3 = "." + DATA_KEY$3;
  966. var DATA_API_KEY$3 = '.data-api';
  967. var JQUERY_NO_CONFLICT$3 = $__default['default'].fn[NAME$3];
  968. var Default$1 = {
  969. toggle: true,
  970. parent: ''
  971. };
  972. var DefaultType$1 = {
  973. toggle: 'boolean',
  974. parent: '(string|element)'
  975. };
  976. var EVENT_SHOW = "show" + EVENT_KEY$3;
  977. var EVENT_SHOWN = "shown" + EVENT_KEY$3;
  978. var EVENT_HIDE = "hide" + EVENT_KEY$3;
  979. var EVENT_HIDDEN = "hidden" + EVENT_KEY$3;
  980. var EVENT_CLICK_DATA_API$3 = "click" + EVENT_KEY$3 + DATA_API_KEY$3;
  981. var CLASS_NAME_SHOW$1 = 'show';
  982. var CLASS_NAME_COLLAPSE = 'collapse';
  983. var CLASS_NAME_COLLAPSING = 'collapsing';
  984. var CLASS_NAME_COLLAPSED = 'collapsed';
  985. var DIMENSION_WIDTH = 'width';
  986. var DIMENSION_HEIGHT = 'height';
  987. var SELECTOR_ACTIVES = '.show, .collapsing';
  988. var SELECTOR_DATA_TOGGLE$1 = '[data-toggle="collapse"]';
  989. /**
  990. * ------------------------------------------------------------------------
  991. * Class Definition
  992. * ------------------------------------------------------------------------
  993. */
  994. var Collapse = /*#__PURE__*/function () {
  995. function Collapse(element, config) {
  996. this._isTransitioning = false;
  997. this._element = element;
  998. this._config = this._getConfig(config);
  999. this._triggerArray = [].slice.call(document.querySelectorAll("[data-toggle=\"collapse\"][href=\"#" + element.id + "\"]," + ("[data-toggle=\"collapse\"][data-target=\"#" + element.id + "\"]")));
  1000. var toggleList = [].slice.call(document.querySelectorAll(SELECTOR_DATA_TOGGLE$1));
  1001. for (var i = 0, len = toggleList.length; i < len; i++) {
  1002. var elem = toggleList[i];
  1003. var selector = Util.getSelectorFromElement(elem);
  1004. var filterElement = [].slice.call(document.querySelectorAll(selector)).filter(function (foundElem) {
  1005. return foundElem === element;
  1006. });
  1007. if (selector !== null && filterElement.length > 0) {
  1008. this._selector = selector;
  1009. this._triggerArray.push(elem);
  1010. }
  1011. }
  1012. this._parent = this._config.parent ? this._getParent() : null;
  1013. if (!this._config.parent) {
  1014. this._addAriaAndCollapsedClass(this._element, this._triggerArray);
  1015. }
  1016. if (this._config.toggle) {
  1017. this.toggle();
  1018. }
  1019. } // Getters
  1020. var _proto = Collapse.prototype;
  1021. // Public
  1022. _proto.toggle = function toggle() {
  1023. if ($__default['default'](this._element).hasClass(CLASS_NAME_SHOW$1)) {
  1024. this.hide();
  1025. } else {
  1026. this.show();
  1027. }
  1028. };
  1029. _proto.show = function show() {
  1030. var _this = this;
  1031. if (this._isTransitioning || $__default['default'](this._element).hasClass(CLASS_NAME_SHOW$1)) {
  1032. return;
  1033. }
  1034. var actives;
  1035. var activesData;
  1036. if (this._parent) {
  1037. actives = [].slice.call(this._parent.querySelectorAll(SELECTOR_ACTIVES)).filter(function (elem) {
  1038. if (typeof _this._config.parent === 'string') {
  1039. return elem.getAttribute('data-parent') === _this._config.parent;
  1040. }
  1041. return elem.classList.contains(CLASS_NAME_COLLAPSE);
  1042. });
  1043. if (actives.length === 0) {
  1044. actives = null;
  1045. }
  1046. }
  1047. if (actives) {
  1048. activesData = $__default['default'](actives).not(this._selector).data(DATA_KEY$3);
  1049. if (activesData && activesData._isTransitioning) {
  1050. return;
  1051. }
  1052. }
  1053. var startEvent = $__default['default'].Event(EVENT_SHOW);
  1054. $__default['default'](this._element).trigger(startEvent);
  1055. if (startEvent.isDefaultPrevented()) {
  1056. return;
  1057. }
  1058. if (actives) {
  1059. Collapse._jQueryInterface.call($__default['default'](actives).not(this._selector), 'hide');
  1060. if (!activesData) {
  1061. $__default['default'](actives).data(DATA_KEY$3, null);
  1062. }
  1063. }
  1064. var dimension = this._getDimension();
  1065. $__default['default'](this._element).removeClass(CLASS_NAME_COLLAPSE).addClass(CLASS_NAME_COLLAPSING);
  1066. this._element.style[dimension] = 0;
  1067. if (this._triggerArray.length) {
  1068. $__default['default'](this._triggerArray).removeClass(CLASS_NAME_COLLAPSED).attr('aria-expanded', true);
  1069. }
  1070. this.setTransitioning(true);
  1071. var complete = function complete() {
  1072. $__default['default'](_this._element).removeClass(CLASS_NAME_COLLAPSING).addClass(CLASS_NAME_COLLAPSE + " " + CLASS_NAME_SHOW$1);
  1073. _this._element.style[dimension] = '';
  1074. _this.setTransitioning(false);
  1075. $__default['default'](_this._element).trigger(EVENT_SHOWN);
  1076. };
  1077. var capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1);
  1078. var scrollSize = "scroll" + capitalizedDimension;
  1079. var transitionDuration = Util.getTransitionDurationFromElement(this._element);
  1080. $__default['default'](this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
  1081. this._element.style[dimension] = this._element[scrollSize] + "px";
  1082. };
  1083. _proto.hide = function hide() {
  1084. var _this2 = this;
  1085. if (this._isTransitioning || !$__default['default'](this._element).hasClass(CLASS_NAME_SHOW$1)) {
  1086. return;
  1087. }
  1088. var startEvent = $__default['default'].Event(EVENT_HIDE);
  1089. $__default['default'](this._element).trigger(startEvent);
  1090. if (startEvent.isDefaultPrevented()) {
  1091. return;
  1092. }
  1093. var dimension = this._getDimension();
  1094. this._element.style[dimension] = this._element.getBoundingClientRect()[dimension] + "px";
  1095. Util.reflow(this._element);
  1096. $__default['default'](this._element).addClass(CLASS_NAME_COLLAPSING).removeClass(CLASS_NAME_COLLAPSE + " " + CLASS_NAME_SHOW$1);
  1097. var triggerArrayLength = this._triggerArray.length;
  1098. if (triggerArrayLength > 0) {
  1099. for (var i = 0; i < triggerArrayLength; i++) {
  1100. var trigger = this._triggerArray[i];
  1101. var selector = Util.getSelectorFromElement(trigger);
  1102. if (selector !== null) {
  1103. var $elem = $__default['default']([].slice.call(document.querySelectorAll(selector)));
  1104. if (!$elem.hasClass(CLASS_NAME_SHOW$1)) {
  1105. $__default['default'](trigger).addClass(CLASS_NAME_COLLAPSED).attr('aria-expanded', false);
  1106. }
  1107. }
  1108. }
  1109. }
  1110. this.setTransitioning(true);
  1111. var complete = function complete() {
  1112. _this2.setTransitioning(false);
  1113. $__default['default'](_this2._element).removeClass(CLASS_NAME_COLLAPSING).addClass(CLASS_NAME_COLLAPSE).trigger(EVENT_HIDDEN);
  1114. };
  1115. this._element.style[dimension] = '';
  1116. var transitionDuration = Util.getTransitionDurationFromElement(this._element);
  1117. $__default['default'](this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
  1118. };
  1119. _proto.setTransitioning = function setTransitioning(isTransitioning) {
  1120. this._isTransitioning = isTransitioning;
  1121. };
  1122. _proto.dispose = function dispose() {
  1123. $__default['default'].removeData(this._element, DATA_KEY$3);
  1124. this._config = null;
  1125. this._parent = null;
  1126. this._element = null;
  1127. this._triggerArray = null;
  1128. this._isTransitioning = null;
  1129. } // Private
  1130. ;
  1131. _proto._getConfig = function _getConfig(config) {
  1132. config = _extends({}, Default$1, config);
  1133. config.toggle = Boolean(config.toggle); // Coerce string values
  1134. Util.typeCheckConfig(NAME$3, config, DefaultType$1);
  1135. return config;
  1136. };
  1137. _proto._getDimension = function _getDimension() {
  1138. var hasWidth = $__default['default'](this._element).hasClass(DIMENSION_WIDTH);
  1139. return hasWidth ? DIMENSION_WIDTH : DIMENSION_HEIGHT;
  1140. };
  1141. _proto._getParent = function _getParent() {
  1142. var _this3 = this;
  1143. var parent;
  1144. if (Util.isElement(this._config.parent)) {
  1145. parent = this._config.parent; // It's a jQuery object
  1146. if (typeof this._config.parent.jquery !== 'undefined') {
  1147. parent = this._config.parent[0];
  1148. }
  1149. } else {
  1150. parent = document.querySelector(this._config.parent);
  1151. }
  1152. var selector = "[data-toggle=\"collapse\"][data-parent=\"" + this._config.parent + "\"]";
  1153. var children = [].slice.call(parent.querySelectorAll(selector));
  1154. $__default['default'](children).each(function (i, element) {
  1155. _this3._addAriaAndCollapsedClass(Collapse._getTargetFromElement(element), [element]);
  1156. });
  1157. return parent;
  1158. };
  1159. _proto._addAriaAndCollapsedClass = function _addAriaAndCollapsedClass(element, triggerArray) {
  1160. var isOpen = $__default['default'](element).hasClass(CLASS_NAME_SHOW$1);
  1161. if (triggerArray.length) {
  1162. $__default['default'](triggerArray).toggleClass(CLASS_NAME_COLLAPSED, !isOpen).attr('aria-expanded', isOpen);
  1163. }
  1164. } // Static
  1165. ;
  1166. Collapse._getTargetFromElement = function _getTargetFromElement(element) {
  1167. var selector = Util.getSelectorFromElement(element);
  1168. return selector ? document.querySelector(selector) : null;
  1169. };
  1170. Collapse._jQueryInterface = function _jQueryInterface(config) {
  1171. return this.each(function () {
  1172. var $element = $__default['default'](this);
  1173. var data = $element.data(DATA_KEY$3);
  1174. var _config = _extends({}, Default$1, $element.data(), typeof config === 'object' && config ? config : {});
  1175. if (!data && _config.toggle && typeof config === 'string' && /show|hide/.test(config)) {
  1176. _config.toggle = false;
  1177. }
  1178. if (!data) {
  1179. data = new Collapse(this, _config);
  1180. $element.data(DATA_KEY$3, data);
  1181. }
  1182. if (typeof config === 'string') {
  1183. if (typeof data[config] === 'undefined') {
  1184. throw new TypeError("No method named \"" + config + "\"");
  1185. }
  1186. data[config]();
  1187. }
  1188. });
  1189. };
  1190. _createClass(Collapse, null, [{
  1191. key: "VERSION",
  1192. get: function get() {
  1193. return VERSION$3;
  1194. }
  1195. }, {
  1196. key: "Default",
  1197. get: function get() {
  1198. return Default$1;
  1199. }
  1200. }]);
  1201. return Collapse;
  1202. }();
  1203. /**
  1204. * ------------------------------------------------------------------------
  1205. * Data Api implementation
  1206. * ------------------------------------------------------------------------
  1207. */
  1208. $__default['default'](document).on(EVENT_CLICK_DATA_API$3, SELECTOR_DATA_TOGGLE$1, function (event) {
  1209. // preventDefault only for <a> elements (which change the URL) not inside the collapsible element
  1210. if (event.currentTarget.tagName === 'A') {
  1211. event.preventDefault();
  1212. }
  1213. var $trigger = $__default['default'](this);
  1214. var selector = Util.getSelectorFromElement(this);
  1215. var selectors = [].slice.call(document.querySelectorAll(selector));
  1216. $__default['default'](selectors).each(function () {
  1217. var $target = $__default['default'](this);
  1218. var data = $target.data(DATA_KEY$3);
  1219. var config = data ? 'toggle' : $trigger.data();
  1220. Collapse._jQueryInterface.call($target, config);
  1221. });
  1222. });
  1223. /**
  1224. * ------------------------------------------------------------------------
  1225. * jQuery
  1226. * ------------------------------------------------------------------------
  1227. */
  1228. $__default['default'].fn[NAME$3] = Collapse._jQueryInterface;
  1229. $__default['default'].fn[NAME$3].Constructor = Collapse;
  1230. $__default['default'].fn[NAME$3].noConflict = function () {
  1231. $__default['default'].fn[NAME$3] = JQUERY_NO_CONFLICT$3;
  1232. return Collapse._jQueryInterface;
  1233. };
  1234. /**
  1235. * ------------------------------------------------------------------------
  1236. * Constants
  1237. * ------------------------------------------------------------------------
  1238. */
  1239. var NAME$4 = 'dropdown';
  1240. var VERSION$4 = '4.5.3';
  1241. var DATA_KEY$4 = 'bs.dropdown';
  1242. var EVENT_KEY$4 = "." + DATA_KEY$4;
  1243. var DATA_API_KEY$4 = '.data-api';
  1244. var JQUERY_NO_CONFLICT$4 = $__default['default'].fn[NAME$4];
  1245. var ESCAPE_KEYCODE = 27; // KeyboardEvent.which value for Escape (Esc) key
  1246. var SPACE_KEYCODE = 32; // KeyboardEvent.which value for space key
  1247. var TAB_KEYCODE = 9; // KeyboardEvent.which value for tab key
  1248. var ARROW_UP_KEYCODE = 38; // KeyboardEvent.which value for up arrow key
  1249. var ARROW_DOWN_KEYCODE = 40; // KeyboardEvent.which value for down arrow key
  1250. var RIGHT_MOUSE_BUTTON_WHICH = 3; // MouseEvent.which value for the right button (assuming a right-handed mouse)
  1251. var REGEXP_KEYDOWN = new RegExp(ARROW_UP_KEYCODE + "|" + ARROW_DOWN_KEYCODE + "|" + ESCAPE_KEYCODE);
  1252. var EVENT_HIDE$1 = "hide" + EVENT_KEY$4;
  1253. var EVENT_HIDDEN$1 = "hidden" + EVENT_KEY$4;
  1254. var EVENT_SHOW$1 = "show" + EVENT_KEY$4;
  1255. var EVENT_SHOWN$1 = "shown" + EVENT_KEY$4;
  1256. var EVENT_CLICK = "click" + EVENT_KEY$4;
  1257. var EVENT_CLICK_DATA_API$4 = "click" + EVENT_KEY$4 + DATA_API_KEY$4;
  1258. var EVENT_KEYDOWN_DATA_API = "keydown" + EVENT_KEY$4 + DATA_API_KEY$4;
  1259. var EVENT_KEYUP_DATA_API = "keyup" + EVENT_KEY$4 + DATA_API_KEY$4;
  1260. var CLASS_NAME_DISABLED = 'disabled';
  1261. var CLASS_NAME_SHOW$2 = 'show';
  1262. var CLASS_NAME_DROPUP = 'dropup';
  1263. var CLASS_NAME_DROPRIGHT = 'dropright';
  1264. var CLASS_NAME_DROPLEFT = 'dropleft';
  1265. var CLASS_NAME_MENURIGHT = 'dropdown-menu-right';
  1266. var CLASS_NAME_POSITION_STATIC = 'position-static';
  1267. var SELECTOR_DATA_TOGGLE$2 = '[data-toggle="dropdown"]';
  1268. var SELECTOR_FORM_CHILD = '.dropdown form';
  1269. var SELECTOR_MENU = '.dropdown-menu';
  1270. var SELECTOR_NAVBAR_NAV = '.navbar-nav';
  1271. var SELECTOR_VISIBLE_ITEMS = '.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)';
  1272. var PLACEMENT_TOP = 'top-start';
  1273. var PLACEMENT_TOPEND = 'top-end';
  1274. var PLACEMENT_BOTTOM = 'bottom-start';
  1275. var PLACEMENT_BOTTOMEND = 'bottom-end';
  1276. var PLACEMENT_RIGHT = 'right-start';
  1277. var PLACEMENT_LEFT = 'left-start';
  1278. var Default$2 = {
  1279. offset: 0,
  1280. flip: true,
  1281. boundary: 'scrollParent',
  1282. reference: 'toggle',
  1283. display: 'dynamic',
  1284. popperConfig: null
  1285. };
  1286. var DefaultType$2 = {
  1287. offset: '(number|string|function)',
  1288. flip: 'boolean',
  1289. boundary: '(string|element)',
  1290. reference: '(string|element)',
  1291. display: 'string',
  1292. popperConfig: '(null|object)'
  1293. };
  1294. /**
  1295. * ------------------------------------------------------------------------
  1296. * Class Definition
  1297. * ------------------------------------------------------------------------
  1298. */
  1299. var Dropdown = /*#__PURE__*/function () {
  1300. function Dropdown(element, config) {
  1301. this._element = element;
  1302. this._popper = null;
  1303. this._config = this._getConfig(config);
  1304. this._menu = this._getMenuElement();
  1305. this._inNavbar = this._detectNavbar();
  1306. this._addEventListeners();
  1307. } // Getters
  1308. var _proto = Dropdown.prototype;
  1309. // Public
  1310. _proto.toggle = function toggle() {
  1311. if (this._element.disabled || $__default['default'](this._element).hasClass(CLASS_NAME_DISABLED)) {
  1312. return;
  1313. }
  1314. var isActive = $__default['default'](this._menu).hasClass(CLASS_NAME_SHOW$2);
  1315. Dropdown._clearMenus();
  1316. if (isActive) {
  1317. return;
  1318. }
  1319. this.show(true);
  1320. };
  1321. _proto.show = function show(usePopper) {
  1322. if (usePopper === void 0) {
  1323. usePopper = false;
  1324. }
  1325. if (this._element.disabled || $__default['default'](this._element).hasClass(CLASS_NAME_DISABLED) || $__default['default'](this._menu).hasClass(CLASS_NAME_SHOW$2)) {
  1326. return;
  1327. }
  1328. var relatedTarget = {
  1329. relatedTarget: this._element
  1330. };
  1331. var showEvent = $__default['default'].Event(EVENT_SHOW$1, relatedTarget);
  1332. var parent = Dropdown._getParentFromElement(this._element);
  1333. $__default['default'](parent).trigger(showEvent);
  1334. if (showEvent.isDefaultPrevented()) {
  1335. return;
  1336. } // Disable totally Popper.js for Dropdown in Navbar
  1337. if (!this._inNavbar && usePopper) {
  1338. /**
  1339. * Check for Popper dependency
  1340. * Popper - https://popper.js.org
  1341. */
  1342. if (typeof Popper__default['default'] === 'undefined') {
  1343. throw new TypeError('Bootstrap\'s dropdowns require Popper.js (https://popper.js.org/)');
  1344. }
  1345. var referenceElement = this._element;
  1346. if (this._config.reference === 'parent') {
  1347. referenceElement = parent;
  1348. } else if (Util.isElement(this._config.reference)) {
  1349. referenceElement = this._config.reference; // Check if it's jQuery element
  1350. if (typeof this._config.reference.jquery !== 'undefined') {
  1351. referenceElement = this._config.reference[0];
  1352. }
  1353. } // If boundary is not `scrollParent`, then set position to `static`
  1354. // to allow the menu to "escape" the scroll parent's boundaries
  1355. // https://github.com/twbs/bootstrap/issues/24251
  1356. if (this._config.boundary !== 'scrollParent') {
  1357. $__default['default'](parent).addClass(CLASS_NAME_POSITION_STATIC);
  1358. }
  1359. this._popper = new Popper__default['default'](referenceElement, this._menu, this._getPopperConfig());
  1360. } // If this is a touch-enabled device we add extra
  1361. // empty mouseover listeners to the body's immediate children;
  1362. // only needed because of broken event delegation on iOS
  1363. // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
  1364. if ('ontouchstart' in document.documentElement && $__default['default'](parent).closest(SELECTOR_NAVBAR_NAV).length === 0) {
  1365. $__default['default'](document.body).children().on('mouseover', null, $__default['default'].noop);
  1366. }
  1367. this._element.focus();
  1368. this._element.setAttribute('aria-expanded', true);
  1369. $__default['default'](this._menu).toggleClass(CLASS_NAME_SHOW$2);
  1370. $__default['default'](parent).toggleClass(CLASS_NAME_SHOW$2).trigger($__default['default'].Event(EVENT_SHOWN$1, relatedTarget));
  1371. };
  1372. _proto.hide = function hide() {
  1373. if (this._element.disabled || $__default['default'](this._element).hasClass(CLASS_NAME_DISABLED) || !$__default['default'](this._menu).hasClass(CLASS_NAME_SHOW$2)) {
  1374. return;
  1375. }
  1376. var relatedTarget = {
  1377. relatedTarget: this._element
  1378. };
  1379. var hideEvent = $__default['default'].Event(EVENT_HIDE$1, relatedTarget);
  1380. var parent = Dropdown._getParentFromElement(this._element);
  1381. $__default['default'](parent).trigger(hideEvent);
  1382. if (hideEvent.isDefaultPrevented()) {
  1383. return;
  1384. }
  1385. if (this._popper) {
  1386. this._popper.destroy();
  1387. }
  1388. $__default['default'](this._menu).toggleClass(CLASS_NAME_SHOW$2);
  1389. $__default['default'](parent).toggleClass(CLASS_NAME_SHOW$2).trigger($__default['default'].Event(EVENT_HIDDEN$1, relatedTarget));
  1390. };
  1391. _proto.dispose = function dispose() {
  1392. $__default['default'].removeData(this._element, DATA_KEY$4);
  1393. $__default['default'](this._element).off(EVENT_KEY$4);
  1394. this._element = null;
  1395. this._menu = null;
  1396. if (this._popper !== null) {
  1397. this._popper.destroy();
  1398. this._popper = null;
  1399. }
  1400. };
  1401. _proto.update = function update() {
  1402. this._inNavbar = this._detectNavbar();
  1403. if (this._popper !== null) {
  1404. this._popper.scheduleUpdate();
  1405. }
  1406. } // Private
  1407. ;
  1408. _proto._addEventListeners = function _addEventListeners() {
  1409. var _this = this;
  1410. $__default['default'](this._element).on(EVENT_CLICK, function (event) {
  1411. event.preventDefault();
  1412. event.stopPropagation();
  1413. _this.toggle();
  1414. });
  1415. };
  1416. _proto._getConfig = function _getConfig(config) {
  1417. config = _extends({}, this.constructor.Default, $__default['default'](this._element).data(), config);
  1418. Util.typeCheckConfig(NAME$4, config, this.constructor.DefaultType);
  1419. return config;
  1420. };
  1421. _proto._getMenuElement = function _getMenuElement() {
  1422. if (!this._menu) {
  1423. var parent = Dropdown._getParentFromElement(this._element);
  1424. if (parent) {
  1425. this._menu = parent.querySelector(SELECTOR_MENU);
  1426. }
  1427. }
  1428. return this._menu;
  1429. };
  1430. _proto._getPlacement = function _getPlacement() {
  1431. var $parentDropdown = $__default['default'](this._element.parentNode);
  1432. var placement = PLACEMENT_BOTTOM; // Handle dropup
  1433. if ($parentDropdown.hasClass(CLASS_NAME_DROPUP)) {
  1434. placement = $__default['default'](this._menu).hasClass(CLASS_NAME_MENURIGHT) ? PLACEMENT_TOPEND : PLACEMENT_TOP;
  1435. } else if ($parentDropdown.hasClass(CLASS_NAME_DROPRIGHT)) {
  1436. placement = PLACEMENT_RIGHT;
  1437. } else if ($parentDropdown.hasClass(CLASS_NAME_DROPLEFT)) {
  1438. placement = PLACEMENT_LEFT;
  1439. } else if ($__default['default'](this._menu).hasClass(CLASS_NAME_MENURIGHT)) {
  1440. placement = PLACEMENT_BOTTOMEND;
  1441. }
  1442. return placement;
  1443. };
  1444. _proto._detectNavbar = function _detectNavbar() {
  1445. return $__default['default'](this._element).closest('.navbar').length > 0;
  1446. };
  1447. _proto._getOffset = function _getOffset() {
  1448. var _this2 = this;
  1449. var offset = {};
  1450. if (typeof this._config.offset === 'function') {
  1451. offset.fn = function (data) {
  1452. data.offsets = _extends({}, data.offsets, _this2._config.offset(data.offsets, _this2._element) || {});
  1453. return data;
  1454. };
  1455. } else {
  1456. offset.offset = this._config.offset;
  1457. }
  1458. return offset;
  1459. };
  1460. _proto._getPopperConfig = function _getPopperConfig() {
  1461. var popperConfig = {
  1462. placement: this._getPlacement(),
  1463. modifiers: {
  1464. offset: this._getOffset(),
  1465. flip: {
  1466. enabled: this._config.flip
  1467. },
  1468. preventOverflow: {
  1469. boundariesElement: this._config.boundary
  1470. }
  1471. }
  1472. }; // Disable Popper.js if we have a static display
  1473. if (this._config.display === 'static') {
  1474. popperConfig.modifiers.applyStyle = {
  1475. enabled: false
  1476. };
  1477. }
  1478. return _extends({}, popperConfig, this._config.popperConfig);
  1479. } // Static
  1480. ;
  1481. Dropdown._jQueryInterface = function _jQueryInterface(config) {
  1482. return this.each(function () {
  1483. var data = $__default['default'](this).data(DATA_KEY$4);
  1484. var _config = typeof config === 'object' ? config : null;
  1485. if (!data) {
  1486. data = new Dropdown(this, _config);
  1487. $__default['default'](this).data(DATA_KEY$4, data);
  1488. }
  1489. if (typeof config === 'string') {
  1490. if (typeof data[config] === 'undefined') {
  1491. throw new TypeError("No method named \"" + config + "\"");
  1492. }
  1493. data[config]();
  1494. }
  1495. });
  1496. };
  1497. Dropdown._clearMenus = function _clearMenus(event) {
  1498. if (event && (event.which === RIGHT_MOUSE_BUTTON_WHICH || event.type === 'keyup' && event.which !== TAB_KEYCODE)) {
  1499. return;
  1500. }
  1501. var toggles = [].slice.call(document.querySelectorAll(SELECTOR_DATA_TOGGLE$2));
  1502. for (var i = 0, len = toggles.length; i < len; i++) {
  1503. var parent = Dropdown._getParentFromElement(toggles[i]);
  1504. var context = $__default['default'](toggles[i]).data(DATA_KEY$4);
  1505. var relatedTarget = {
  1506. relatedTarget: toggles[i]
  1507. };
  1508. if (event && event.type === 'click') {
  1509. relatedTarget.clickEvent = event;
  1510. }
  1511. if (!context) {
  1512. continue;
  1513. }
  1514. var dropdownMenu = context._menu;
  1515. if (!$__default['default'](parent).hasClass(CLASS_NAME_SHOW$2)) {
  1516. continue;
  1517. }
  1518. if (event && (event.type === 'click' && /input|textarea/i.test(event.target.tagName) || event.type === 'keyup' && event.which === TAB_KEYCODE) && $__default['default'].contains(parent, event.target)) {
  1519. continue;
  1520. }
  1521. var hideEvent = $__default['default'].Event(EVENT_HIDE$1, relatedTarget);
  1522. $__default['default'](parent).trigger(hideEvent);
  1523. if (hideEvent.isDefaultPrevented()) {
  1524. continue;
  1525. } // If this is a touch-enabled device we remove the extra
  1526. // empty mouseover listeners we added for iOS support
  1527. if ('ontouchstart' in document.documentElement) {
  1528. $__default['default'](document.body).children().off('mouseover', null, $__default['default'].noop);
  1529. }
  1530. toggles[i].setAttribute('aria-expanded', 'false');
  1531. if (context._popper) {
  1532. context._popper.destroy();
  1533. }
  1534. $__default['default'](dropdownMenu).removeClass(CLASS_NAME_SHOW$2);
  1535. $__default['default'](parent).removeClass(CLASS_NAME_SHOW$2).trigger($__default['default'].Event(EVENT_HIDDEN$1, relatedTarget));
  1536. }
  1537. };
  1538. Dropdown._getParentFromElement = function _getParentFromElement(element) {
  1539. var parent;
  1540. var selector = Util.getSelectorFromElement(element);
  1541. if (selector) {
  1542. parent = document.querySelector(selector);
  1543. }
  1544. return parent || element.parentNode;
  1545. } // eslint-disable-next-line complexity
  1546. ;
  1547. Dropdown._dataApiKeydownHandler = function _dataApiKeydownHandler(event) {
  1548. // If not input/textarea:
  1549. // - And not a key in REGEXP_KEYDOWN => not a dropdown command
  1550. // If input/textarea:
  1551. // - If space key => not a dropdown command
  1552. // - If key is other than escape
  1553. // - If key is not up or down => not a dropdown command
  1554. // - If trigger inside the menu => not a dropdown command
  1555. if (/input|textarea/i.test(event.target.tagName) ? event.which === SPACE_KEYCODE || event.which !== ESCAPE_KEYCODE && (event.which !== ARROW_DOWN_KEYCODE && event.which !== ARROW_UP_KEYCODE || $__default['default'](event.target).closest(SELECTOR_MENU).length) : !REGEXP_KEYDOWN.test(event.which)) {
  1556. return;
  1557. }
  1558. if (this.disabled || $__default['default'](this).hasClass(CLASS_NAME_DISABLED)) {
  1559. return;
  1560. }
  1561. var parent = Dropdown._getParentFromElement(this);
  1562. var isActive = $__default['default'](parent).hasClass(CLASS_NAME_SHOW$2);
  1563. if (!isActive && event.which === ESCAPE_KEYCODE) {
  1564. return;
  1565. }
  1566. event.preventDefault();
  1567. event.stopPropagation();
  1568. if (!isActive || event.which === ESCAPE_KEYCODE || event.which === SPACE_KEYCODE) {
  1569. if (event.which === ESCAPE_KEYCODE) {
  1570. $__default['default'](parent.querySelector(SELECTOR_DATA_TOGGLE$2)).trigger('focus');
  1571. }
  1572. $__default['default'](this).trigger('click');
  1573. return;
  1574. }
  1575. var items = [].slice.call(parent.querySelectorAll(SELECTOR_VISIBLE_ITEMS)).filter(function (item) {
  1576. return $__default['default'](item).is(':visible');
  1577. });
  1578. if (items.length === 0) {
  1579. return;
  1580. }
  1581. var index = items.indexOf(event.target);
  1582. if (event.which === ARROW_UP_KEYCODE && index > 0) {
  1583. // Up
  1584. index--;
  1585. }
  1586. if (event.which === ARROW_DOWN_KEYCODE && index < items.length - 1) {
  1587. // Down
  1588. index++;
  1589. }
  1590. if (index < 0) {
  1591. index = 0;
  1592. }
  1593. items[index].focus();
  1594. };
  1595. _createClass(Dropdown, null, [{
  1596. key: "VERSION",
  1597. get: function get() {
  1598. return VERSION$4;
  1599. }
  1600. }, {
  1601. key: "Default",
  1602. get: function get() {
  1603. return Default$2;
  1604. }
  1605. }, {
  1606. key: "DefaultType",
  1607. get: function get() {
  1608. return DefaultType$2;
  1609. }
  1610. }]);
  1611. return Dropdown;
  1612. }();
  1613. /**
  1614. * ------------------------------------------------------------------------
  1615. * Data Api implementation
  1616. * ------------------------------------------------------------------------
  1617. */
  1618. $__default['default'](document).on(EVENT_KEYDOWN_DATA_API, SELECTOR_DATA_TOGGLE$2, Dropdown._dataApiKeydownHandler).on(EVENT_KEYDOWN_DATA_API, SELECTOR_MENU, Dropdown._dataApiKeydownHandler).on(EVENT_CLICK_DATA_API$4 + " " + EVENT_KEYUP_DATA_API, Dropdown._clearMenus).on(EVENT_CLICK_DATA_API$4, SELECTOR_DATA_TOGGLE$2, function (event) {
  1619. event.preventDefault();
  1620. event.stopPropagation();
  1621. Dropdown._jQueryInterface.call($__default['default'](this), 'toggle');
  1622. }).on(EVENT_CLICK_DATA_API$4, SELECTOR_FORM_CHILD, function (e) {
  1623. e.stopPropagation();
  1624. });
  1625. /**
  1626. * ------------------------------------------------------------------------
  1627. * jQuery
  1628. * ------------------------------------------------------------------------
  1629. */
  1630. $__default['default'].fn[NAME$4] = Dropdown._jQueryInterface;
  1631. $__default['default'].fn[NAME$4].Constructor = Dropdown;
  1632. $__default['default'].fn[NAME$4].noConflict = function () {
  1633. $__default['default'].fn[NAME$4] = JQUERY_NO_CONFLICT$4;
  1634. return Dropdown._jQueryInterface;
  1635. };
  1636. /**
  1637. * ------------------------------------------------------------------------
  1638. * Constants
  1639. * ------------------------------------------------------------------------
  1640. */
  1641. var NAME$5 = 'modal';
  1642. var VERSION$5 = '4.5.3';
  1643. var DATA_KEY$5 = 'bs.modal';
  1644. var EVENT_KEY$5 = "." + DATA_KEY$5;
  1645. var DATA_API_KEY$5 = '.data-api';
  1646. var JQUERY_NO_CONFLICT$5 = $__default['default'].fn[NAME$5];
  1647. var ESCAPE_KEYCODE$1 = 27; // KeyboardEvent.which value for Escape (Esc) key
  1648. var Default$3 = {
  1649. backdrop: true,
  1650. keyboard: true,
  1651. focus: true,
  1652. show: true
  1653. };
  1654. var DefaultType$3 = {
  1655. backdrop: '(boolean|string)',
  1656. keyboard: 'boolean',
  1657. focus: 'boolean',
  1658. show: 'boolean'
  1659. };
  1660. var EVENT_HIDE$2 = "hide" + EVENT_KEY$5;
  1661. var EVENT_HIDE_PREVENTED = "hidePrevented" + EVENT_KEY$5;
  1662. var EVENT_HIDDEN$2 = "hidden" + EVENT_KEY$5;
  1663. var EVENT_SHOW$2 = "show" + EVENT_KEY$5;
  1664. var EVENT_SHOWN$2 = "shown" + EVENT_KEY$5;
  1665. var EVENT_FOCUSIN = "focusin" + EVENT_KEY$5;
  1666. var EVENT_RESIZE = "resize" + EVENT_KEY$5;
  1667. var EVENT_CLICK_DISMISS = "click.dismiss" + EVENT_KEY$5;
  1668. var EVENT_KEYDOWN_DISMISS = "keydown.dismiss" + EVENT_KEY$5;
  1669. var EVENT_MOUSEUP_DISMISS = "mouseup.dismiss" + EVENT_KEY$5;
  1670. var EVENT_MOUSEDOWN_DISMISS = "mousedown.dismiss" + EVENT_KEY$5;
  1671. var EVENT_CLICK_DATA_API$5 = "click" + EVENT_KEY$5 + DATA_API_KEY$5;
  1672. var CLASS_NAME_SCROLLABLE = 'modal-dialog-scrollable';
  1673. var CLASS_NAME_SCROLLBAR_MEASURER = 'modal-scrollbar-measure';
  1674. var CLASS_NAME_BACKDROP = 'modal-backdrop';
  1675. var CLASS_NAME_OPEN = 'modal-open';
  1676. var CLASS_NAME_FADE$1 = 'fade';
  1677. var CLASS_NAME_SHOW$3 = 'show';
  1678. var CLASS_NAME_STATIC = 'modal-static';
  1679. var SELECTOR_DIALOG = '.modal-dialog';
  1680. var SELECTOR_MODAL_BODY = '.modal-body';
  1681. var SELECTOR_DATA_TOGGLE$3 = '[data-toggle="modal"]';
  1682. var SELECTOR_DATA_DISMISS = '[data-dismiss="modal"]';
  1683. var SELECTOR_FIXED_CONTENT = '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top';
  1684. var SELECTOR_STICKY_CONTENT = '.sticky-top';
  1685. /**
  1686. * ------------------------------------------------------------------------
  1687. * Class Definition
  1688. * ------------------------------------------------------------------------
  1689. */
  1690. var Modal = /*#__PURE__*/function () {
  1691. function Modal(element, config) {
  1692. this._config = this._getConfig(config);
  1693. this._element = element;
  1694. this._dialog = element.querySelector(SELECTOR_DIALOG);
  1695. this._backdrop = null;
  1696. this._isShown = false;
  1697. this._isBodyOverflowing = false;
  1698. this._ignoreBackdropClick = false;
  1699. this._isTransitioning = false;
  1700. this._scrollbarWidth = 0;
  1701. } // Getters
  1702. var _proto = Modal.prototype;
  1703. // Public
  1704. _proto.toggle = function toggle(relatedTarget) {
  1705. return this._isShown ? this.hide() : this.show(relatedTarget);
  1706. };
  1707. _proto.show = function show(relatedTarget) {
  1708. var _this = this;
  1709. if (this._isShown || this._isTransitioning) {
  1710. return;
  1711. }
  1712. if ($__default['default'](this._element).hasClass(CLASS_NAME_FADE$1)) {
  1713. this._isTransitioning = true;
  1714. }
  1715. var showEvent = $__default['default'].Event(EVENT_SHOW$2, {
  1716. relatedTarget: relatedTarget
  1717. });
  1718. $__default['default'](this._element).trigger(showEvent);
  1719. if (this._isShown || showEvent.isDefaultPrevented()) {
  1720. return;
  1721. }
  1722. this._isShown = true;
  1723. this._checkScrollbar();
  1724. this._setScrollbar();
  1725. this._adjustDialog();
  1726. this._setEscapeEvent();
  1727. this._setResizeEvent();
  1728. $__default['default'](this._element).on(EVENT_CLICK_DISMISS, SELECTOR_DATA_DISMISS, function (event) {
  1729. return _this.hide(event);
  1730. });
  1731. $__default['default'](this._dialog).on(EVENT_MOUSEDOWN_DISMISS, function () {
  1732. $__default['default'](_this._element).one(EVENT_MOUSEUP_DISMISS, function (event) {
  1733. if ($__default['default'](event.target).is(_this._element)) {
  1734. _this._ignoreBackdropClick = true;
  1735. }
  1736. });
  1737. });
  1738. this._showBackdrop(function () {
  1739. return _this._showElement(relatedTarget);
  1740. });
  1741. };
  1742. _proto.hide = function hide(event) {
  1743. var _this2 = this;
  1744. if (event) {
  1745. event.preventDefault();
  1746. }
  1747. if (!this._isShown || this._isTransitioning) {
  1748. return;
  1749. }
  1750. var hideEvent = $__default['default'].Event(EVENT_HIDE$2);
  1751. $__default['default'](this._element).trigger(hideEvent);
  1752. if (!this._isShown || hideEvent.isDefaultPrevented()) {
  1753. return;
  1754. }
  1755. this._isShown = false;
  1756. var transition = $__default['default'](this._element).hasClass(CLASS_NAME_FADE$1);
  1757. if (transition) {
  1758. this._isTransitioning = true;
  1759. }
  1760. this._setEscapeEvent();
  1761. this._setResizeEvent();
  1762. $__default['default'](document).off(EVENT_FOCUSIN);
  1763. $__default['default'](this._element).removeClass(CLASS_NAME_SHOW$3);
  1764. $__default['default'](this._element).off(EVENT_CLICK_DISMISS);
  1765. $__default['default'](this._dialog).off(EVENT_MOUSEDOWN_DISMISS);
  1766. if (transition) {
  1767. var transitionDuration = Util.getTransitionDurationFromElement(this._element);
  1768. $__default['default'](this._element).one(Util.TRANSITION_END, function (event) {
  1769. return _this2._hideModal(event);
  1770. }).emulateTransitionEnd(transitionDuration);
  1771. } else {
  1772. this._hideModal();
  1773. }
  1774. };
  1775. _proto.dispose = function dispose() {
  1776. [window, this._element, this._dialog].forEach(function (htmlElement) {
  1777. return $__default['default'](htmlElement).off(EVENT_KEY$5);
  1778. });
  1779. /**
  1780. * `document` has 2 events `EVENT_FOCUSIN` and `EVENT_CLICK_DATA_API`
  1781. * Do not move `document` in `htmlElements` array
  1782. * It will remove `EVENT_CLICK_DATA_API` event that should remain
  1783. */
  1784. $__default['default'](document).off(EVENT_FOCUSIN);
  1785. $__default['default'].removeData(this._element, DATA_KEY$5);
  1786. this._config = null;
  1787. this._element = null;
  1788. this._dialog = null;
  1789. this._backdrop = null;
  1790. this._isShown = null;
  1791. this._isBodyOverflowing = null;
  1792. this._ignoreBackdropClick = null;
  1793. this._isTransitioning = null;
  1794. this._scrollbarWidth = null;
  1795. };
  1796. _proto.handleUpdate = function handleUpdate() {
  1797. this._adjustDialog();
  1798. } // Private
  1799. ;
  1800. _proto._getConfig = function _getConfig(config) {
  1801. config = _extends({}, Default$3, config);
  1802. Util.typeCheckConfig(NAME$5, config, DefaultType$3);
  1803. return config;
  1804. };
  1805. _proto._triggerBackdropTransition = function _triggerBackdropTransition() {
  1806. var _this3 = this;
  1807. if (this._config.backdrop === 'static') {
  1808. var hideEventPrevented = $__default['default'].Event(EVENT_HIDE_PREVENTED);
  1809. $__default['default'](this._element).trigger(hideEventPrevented);
  1810. if (hideEventPrevented.isDefaultPrevented()) {
  1811. return;
  1812. }
  1813. var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight;
  1814. if (!isModalOverflowing) {
  1815. this._element.style.overflowY = 'hidden';
  1816. }
  1817. this._element.classList.add(CLASS_NAME_STATIC);
  1818. var modalTransitionDuration = Util.getTransitionDurationFromElement(this._dialog);
  1819. $__default['default'](this._element).off(Util.TRANSITION_END);
  1820. $__default['default'](this._element).one(Util.TRANSITION_END, function () {
  1821. _this3._element.classList.remove(CLASS_NAME_STATIC);
  1822. if (!isModalOverflowing) {
  1823. $__default['default'](_this3._element).one(Util.TRANSITION_END, function () {
  1824. _this3._element.style.overflowY = '';
  1825. }).emulateTransitionEnd(_this3._element, modalTransitionDuration);
  1826. }
  1827. }).emulateTransitionEnd(modalTransitionDuration);
  1828. this._element.focus();
  1829. } else {
  1830. this.hide();
  1831. }
  1832. };
  1833. _proto._showElement = function _showElement(relatedTarget) {
  1834. var _this4 = this;
  1835. var transition = $__default['default'](this._element).hasClass(CLASS_NAME_FADE$1);
  1836. var modalBody = this._dialog ? this._dialog.querySelector(SELECTOR_MODAL_BODY) : null;
  1837. if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) {
  1838. // Don't move modal's DOM position
  1839. document.body.appendChild(this._element);
  1840. }
  1841. this._element.style.display = 'block';
  1842. this._element.removeAttribute('aria-hidden');
  1843. this._element.setAttribute('aria-modal', true);
  1844. this._element.setAttribute('role', 'dialog');
  1845. if ($__default['default'](this._dialog).hasClass(CLASS_NAME_SCROLLABLE) && modalBody) {
  1846. modalBody.scrollTop = 0;
  1847. } else {
  1848. this._element.scrollTop = 0;
  1849. }
  1850. if (transition) {
  1851. Util.reflow(this._element);
  1852. }
  1853. $__default['default'](this._element).addClass(CLASS_NAME_SHOW$3);
  1854. if (this._config.focus) {
  1855. this._enforceFocus();
  1856. }
  1857. var shownEvent = $__default['default'].Event(EVENT_SHOWN$2, {
  1858. relatedTarget: relatedTarget
  1859. });
  1860. var transitionComplete = function transitionComplete() {
  1861. if (_this4._config.focus) {
  1862. _this4._element.focus();
  1863. }
  1864. _this4._isTransitioning = false;
  1865. $__default['default'](_this4._element).trigger(shownEvent);
  1866. };
  1867. if (transition) {
  1868. var transitionDuration = Util.getTransitionDurationFromElement(this._dialog);
  1869. $__default['default'](this._dialog).one(Util.TRANSITION_END, transitionComplete).emulateTransitionEnd(transitionDuration);
  1870. } else {
  1871. transitionComplete();
  1872. }
  1873. };
  1874. _proto._enforceFocus = function _enforceFocus() {
  1875. var _this5 = this;
  1876. $__default['default'](document).off(EVENT_FOCUSIN) // Guard against infinite focus loop
  1877. .on(EVENT_FOCUSIN, function (event) {
  1878. if (document !== event.target && _this5._element !== event.target && $__default['default'](_this5._element).has(event.target).length === 0) {
  1879. _this5._element.focus();
  1880. }
  1881. });
  1882. };
  1883. _proto._setEscapeEvent = function _setEscapeEvent() {
  1884. var _this6 = this;
  1885. if (this._isShown) {
  1886. $__default['default'](this._element).on(EVENT_KEYDOWN_DISMISS, function (event) {
  1887. if (_this6._config.keyboard && event.which === ESCAPE_KEYCODE$1) {
  1888. event.preventDefault();
  1889. _this6.hide();
  1890. } else if (!_this6._config.keyboard && event.which === ESCAPE_KEYCODE$1) {
  1891. _this6._triggerBackdropTransition();
  1892. }
  1893. });
  1894. } else if (!this._isShown) {
  1895. $__default['default'](this._element).off(EVENT_KEYDOWN_DISMISS);
  1896. }
  1897. };
  1898. _proto._setResizeEvent = function _setResizeEvent() {
  1899. var _this7 = this;
  1900. if (this._isShown) {
  1901. $__default['default'](window).on(EVENT_RESIZE, function (event) {
  1902. return _this7.handleUpdate(event);
  1903. });
  1904. } else {
  1905. $__default['default'](window).off(EVENT_RESIZE);
  1906. }
  1907. };
  1908. _proto._hideModal = function _hideModal() {
  1909. var _this8 = this;
  1910. this._element.style.display = 'none';
  1911. this._element.setAttribute('aria-hidden', true);
  1912. this._element.removeAttribute('aria-modal');
  1913. this._element.removeAttribute('role');
  1914. this._isTransitioning = false;
  1915. this._showBackdrop(function () {
  1916. $__default['default'](document.body).removeClass(CLASS_NAME_OPEN);
  1917. _this8._resetAdjustments();
  1918. _this8._resetScrollbar();
  1919. $__default['default'](_this8._element).trigger(EVENT_HIDDEN$2);
  1920. });
  1921. };
  1922. _proto._removeBackdrop = function _removeBackdrop() {
  1923. if (this._backdrop) {
  1924. $__default['default'](this._backdrop).remove();
  1925. this._backdrop = null;
  1926. }
  1927. };
  1928. _proto._showBackdrop = function _showBackdrop(callback) {
  1929. var _this9 = this;
  1930. var animate = $__default['default'](this._element).hasClass(CLASS_NAME_FADE$1) ? CLASS_NAME_FADE$1 : '';
  1931. if (this._isShown && this._config.backdrop) {
  1932. this._backdrop = document.createElement('div');
  1933. this._backdrop.className = CLASS_NAME_BACKDROP;
  1934. if (animate) {
  1935. this._backdrop.classList.add(animate);
  1936. }
  1937. $__default['default'](this._backdrop).appendTo(document.body);
  1938. $__default['default'](this._element).on(EVENT_CLICK_DISMISS, function (event) {
  1939. if (_this9._ignoreBackdropClick) {
  1940. _this9._ignoreBackdropClick = false;
  1941. return;
  1942. }
  1943. if (event.target !== event.currentTarget) {
  1944. return;
  1945. }
  1946. _this9._triggerBackdropTransition();
  1947. });
  1948. if (animate) {
  1949. Util.reflow(this._backdrop);
  1950. }
  1951. $__default['default'](this._backdrop).addClass(CLASS_NAME_SHOW$3);
  1952. if (!callback) {
  1953. return;
  1954. }
  1955. if (!animate) {
  1956. callback();
  1957. return;
  1958. }
  1959. var backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop);
  1960. $__default['default'](this._backdrop).one(Util.TRANSITION_END, callback).emulateTransitionEnd(backdropTransitionDuration);
  1961. } else if (!this._isShown && this._backdrop) {
  1962. $__default['default'](this._backdrop).removeClass(CLASS_NAME_SHOW$3);
  1963. var callbackRemove = function callbackRemove() {
  1964. _this9._removeBackdrop();
  1965. if (callback) {
  1966. callback();
  1967. }
  1968. };
  1969. if ($__default['default'](this._element).hasClass(CLASS_NAME_FADE$1)) {
  1970. var _backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop);
  1971. $__default['default'](this._backdrop).one(Util.TRANSITION_END, callbackRemove).emulateTransitionEnd(_backdropTransitionDuration);
  1972. } else {
  1973. callbackRemove();
  1974. }
  1975. } else if (callback) {
  1976. callback();
  1977. }
  1978. } // ----------------------------------------------------------------------
  1979. // the following methods are used to handle overflowing modals
  1980. // todo (fat): these should probably be refactored out of modal.js
  1981. // ----------------------------------------------------------------------
  1982. ;
  1983. _proto._adjustDialog = function _adjustDialog() {
  1984. var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight;
  1985. if (!this._isBodyOverflowing && isModalOverflowing) {
  1986. this._element.style.paddingLeft = this._scrollbarWidth + "px";
  1987. }
  1988. if (this._isBodyOverflowing && !isModalOverflowing) {
  1989. this._element.style.paddingRight = this._scrollbarWidth + "px";
  1990. }
  1991. };
  1992. _proto._resetAdjustments = function _resetAdjustments() {
  1993. this._element.style.paddingLeft = '';
  1994. this._element.style.paddingRight = '';
  1995. };
  1996. _proto._checkScrollbar = function _checkScrollbar() {
  1997. var rect = document.body.getBoundingClientRect();
  1998. this._isBodyOverflowing = Math.round(rect.left + rect.right) < window.innerWidth;
  1999. this._scrollbarWidth = this._getScrollbarWidth();
  2000. };
  2001. _proto._setScrollbar = function _setScrollbar() {
  2002. var _this10 = this;
  2003. if (this._isBodyOverflowing) {
  2004. // Note: DOMNode.style.paddingRight returns the actual value or '' if not set
  2005. // while $(DOMNode).css('padding-right') returns the calculated value or 0 if not set
  2006. var fixedContent = [].slice.call(document.querySelectorAll(SELECTOR_FIXED_CONTENT));
  2007. var stickyContent = [].slice.call(document.querySelectorAll(SELECTOR_STICKY_CONTENT)); // Adjust fixed content padding
  2008. $__default['default'](fixedContent).each(function (index, element) {
  2009. var actualPadding = element.style.paddingRight;
  2010. var calculatedPadding = $__default['default'](element).css('padding-right');
  2011. $__default['default'](element).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + _this10._scrollbarWidth + "px");
  2012. }); // Adjust sticky content margin
  2013. $__default['default'](stickyContent).each(function (index, element) {
  2014. var actualMargin = element.style.marginRight;
  2015. var calculatedMargin = $__default['default'](element).css('margin-right');
  2016. $__default['default'](element).data('margin-right', actualMargin).css('margin-right', parseFloat(calculatedMargin) - _this10._scrollbarWidth + "px");
  2017. }); // Adjust body padding
  2018. var actualPadding = document.body.style.paddingRight;
  2019. var calculatedPadding = $__default['default'](document.body).css('padding-right');
  2020. $__default['default'](document.body).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + this._scrollbarWidth + "px");
  2021. }
  2022. $__default['default'](document.body).addClass(CLASS_NAME_OPEN);
  2023. };
  2024. _proto._resetScrollbar = function _resetScrollbar() {
  2025. // Restore fixed content padding
  2026. var fixedContent = [].slice.call(document.querySelectorAll(SELECTOR_FIXED_CONTENT));
  2027. $__default['default'](fixedContent).each(function (index, element) {
  2028. var padding = $__default['default'](element).data('padding-right');
  2029. $__default['default'](element).removeData('padding-right');
  2030. element.style.paddingRight = padding ? padding : '';
  2031. }); // Restore sticky content
  2032. var elements = [].slice.call(document.querySelectorAll("" + SELECTOR_STICKY_CONTENT));
  2033. $__default['default'](elements).each(function (index, element) {
  2034. var margin = $__default['default'](element).data('margin-right');
  2035. if (typeof margin !== 'undefined') {
  2036. $__default['default'](element).css('margin-right', margin).removeData('margin-right');
  2037. }
  2038. }); // Restore body padding
  2039. var padding = $__default['default'](document.body).data('padding-right');
  2040. $__default['default'](document.body).removeData('padding-right');
  2041. document.body.style.paddingRight = padding ? padding : '';
  2042. };
  2043. _proto._getScrollbarWidth = function _getScrollbarWidth() {
  2044. // thx d.walsh
  2045. var scrollDiv = document.createElement('div');
  2046. scrollDiv.className = CLASS_NAME_SCROLLBAR_MEASURER;
  2047. document.body.appendChild(scrollDiv);
  2048. var scrollbarWidth = scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth;
  2049. document.body.removeChild(scrollDiv);
  2050. return scrollbarWidth;
  2051. } // Static
  2052. ;
  2053. Modal._jQueryInterface = function _jQueryInterface(config, relatedTarget) {
  2054. return this.each(function () {
  2055. var data = $__default['default'](this).data(DATA_KEY$5);
  2056. var _config = _extends({}, Default$3, $__default['default'](this).data(), typeof config === 'object' && config ? config : {});
  2057. if (!data) {
  2058. data = new Modal(this, _config);
  2059. $__default['default'](this).data(DATA_KEY$5, data);
  2060. }
  2061. if (typeof config === 'string') {
  2062. if (typeof data[config] === 'undefined') {
  2063. throw new TypeError("No method named \"" + config + "\"");
  2064. }
  2065. data[config](relatedTarget);
  2066. } else if (_config.show) {
  2067. data.show(relatedTarget);
  2068. }
  2069. });
  2070. };
  2071. _createClass(Modal, null, [{
  2072. key: "VERSION",
  2073. get: function get() {
  2074. return VERSION$5;
  2075. }
  2076. }, {
  2077. key: "Default",
  2078. get: function get() {
  2079. return Default$3;
  2080. }
  2081. }]);
  2082. return Modal;
  2083. }();
  2084. /**
  2085. * ------------------------------------------------------------------------
  2086. * Data Api implementation
  2087. * ------------------------------------------------------------------------
  2088. */
  2089. $__default['default'](document).on(EVENT_CLICK_DATA_API$5, SELECTOR_DATA_TOGGLE$3, function (event) {
  2090. var _this11 = this;
  2091. var target;
  2092. var selector = Util.getSelectorFromElement(this);
  2093. if (selector) {
  2094. target = document.querySelector(selector);
  2095. }
  2096. var config = $__default['default'](target).data(DATA_KEY$5) ? 'toggle' : _extends({}, $__default['default'](target).data(), $__default['default'](this).data());
  2097. if (this.tagName === 'A' || this.tagName === 'AREA') {
  2098. event.preventDefault();
  2099. }
  2100. var $target = $__default['default'](target).one(EVENT_SHOW$2, function (showEvent) {
  2101. if (showEvent.isDefaultPrevented()) {
  2102. // Only register focus restorer if modal will actually get shown
  2103. return;
  2104. }
  2105. $target.one(EVENT_HIDDEN$2, function () {
  2106. if ($__default['default'](_this11).is(':visible')) {
  2107. _this11.focus();
  2108. }
  2109. });
  2110. });
  2111. Modal._jQueryInterface.call($__default['default'](target), config, this);
  2112. });
  2113. /**
  2114. * ------------------------------------------------------------------------
  2115. * jQuery
  2116. * ------------------------------------------------------------------------
  2117. */
  2118. $__default['default'].fn[NAME$5] = Modal._jQueryInterface;
  2119. $__default['default'].fn[NAME$5].Constructor = Modal;
  2120. $__default['default'].fn[NAME$5].noConflict = function () {
  2121. $__default['default'].fn[NAME$5] = JQUERY_NO_CONFLICT$5;
  2122. return Modal._jQueryInterface;
  2123. };
  2124. /**
  2125. * --------------------------------------------------------------------------
  2126. * Bootstrap (v4.5.3): tools/sanitizer.js
  2127. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
  2128. * --------------------------------------------------------------------------
  2129. */
  2130. var uriAttrs = ['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href'];
  2131. var ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i;
  2132. var DefaultWhitelist = {
  2133. // Global attributes allowed on any supplied element below.
  2134. '*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN],
  2135. a: ['target', 'href', 'title', 'rel'],
  2136. area: [],
  2137. b: [],
  2138. br: [],
  2139. col: [],
  2140. code: [],
  2141. div: [],
  2142. em: [],
  2143. hr: [],
  2144. h1: [],
  2145. h2: [],
  2146. h3: [],
  2147. h4: [],
  2148. h5: [],
  2149. h6: [],
  2150. i: [],
  2151. img: ['src', 'srcset', 'alt', 'title', 'width', 'height'],
  2152. li: [],
  2153. ol: [],
  2154. p: [],
  2155. pre: [],
  2156. s: [],
  2157. small: [],
  2158. span: [],
  2159. sub: [],
  2160. sup: [],
  2161. strong: [],
  2162. u: [],
  2163. ul: []
  2164. };
  2165. /**
  2166. * A pattern that recognizes a commonly useful subset of URLs that are safe.
  2167. *
  2168. * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts
  2169. */
  2170. var SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^#&/:?]*(?:[#/?]|$))/gi;
  2171. /**
  2172. * A pattern that matches safe data URLs. Only matches image, video and audio types.
  2173. *
  2174. * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts
  2175. */
  2176. var DATA_URL_PATTERN = /^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[\d+/a-z]+=*$/i;
  2177. function allowedAttribute(attr, allowedAttributeList) {
  2178. var attrName = attr.nodeName.toLowerCase();
  2179. if (allowedAttributeList.indexOf(attrName) !== -1) {
  2180. if (uriAttrs.indexOf(attrName) !== -1) {
  2181. return Boolean(attr.nodeValue.match(SAFE_URL_PATTERN) || attr.nodeValue.match(DATA_URL_PATTERN));
  2182. }
  2183. return true;
  2184. }
  2185. var regExp = allowedAttributeList.filter(function (attrRegex) {
  2186. return attrRegex instanceof RegExp;
  2187. }); // Check if a regular expression validates the attribute.
  2188. for (var i = 0, len = regExp.length; i < len; i++) {
  2189. if (attrName.match(regExp[i])) {
  2190. return true;
  2191. }
  2192. }
  2193. return false;
  2194. }
  2195. function sanitizeHtml(unsafeHtml, whiteList, sanitizeFn) {
  2196. if (unsafeHtml.length === 0) {
  2197. return unsafeHtml;
  2198. }
  2199. if (sanitizeFn && typeof sanitizeFn === 'function') {
  2200. return sanitizeFn(unsafeHtml);
  2201. }
  2202. var domParser = new window.DOMParser();
  2203. var createdDocument = domParser.parseFromString(unsafeHtml, 'text/html');
  2204. var whitelistKeys = Object.keys(whiteList);
  2205. var elements = [].slice.call(createdDocument.body.querySelectorAll('*'));
  2206. var _loop = function _loop(i, len) {
  2207. var el = elements[i];
  2208. var elName = el.nodeName.toLowerCase();
  2209. if (whitelistKeys.indexOf(el.nodeName.toLowerCase()) === -1) {
  2210. el.parentNode.removeChild(el);
  2211. return "continue";
  2212. }
  2213. var attributeList = [].slice.call(el.attributes);
  2214. var whitelistedAttributes = [].concat(whiteList['*'] || [], whiteList[elName] || []);
  2215. attributeList.forEach(function (attr) {
  2216. if (!allowedAttribute(attr, whitelistedAttributes)) {
  2217. el.removeAttribute(attr.nodeName);
  2218. }
  2219. });
  2220. };
  2221. for (var i = 0, len = elements.length; i < len; i++) {
  2222. var _ret = _loop(i);
  2223. if (_ret === "continue") continue;
  2224. }
  2225. return createdDocument.body.innerHTML;
  2226. }
  2227. /**
  2228. * ------------------------------------------------------------------------
  2229. * Constants
  2230. * ------------------------------------------------------------------------
  2231. */
  2232. var NAME$6 = 'tooltip';
  2233. var VERSION$6 = '4.5.3';
  2234. var DATA_KEY$6 = 'bs.tooltip';
  2235. var EVENT_KEY$6 = "." + DATA_KEY$6;
  2236. var JQUERY_NO_CONFLICT$6 = $__default['default'].fn[NAME$6];
  2237. var CLASS_PREFIX = 'bs-tooltip';
  2238. var BSCLS_PREFIX_REGEX = new RegExp("(^|\\s)" + CLASS_PREFIX + "\\S+", 'g');
  2239. var DISALLOWED_ATTRIBUTES = ['sanitize', 'whiteList', 'sanitizeFn'];
  2240. var DefaultType$4 = {
  2241. animation: 'boolean',
  2242. template: 'string',
  2243. title: '(string|element|function)',
  2244. trigger: 'string',
  2245. delay: '(number|object)',
  2246. html: 'boolean',
  2247. selector: '(string|boolean)',
  2248. placement: '(string|function)',
  2249. offset: '(number|string|function)',
  2250. container: '(string|element|boolean)',
  2251. fallbackPlacement: '(string|array)',
  2252. boundary: '(string|element)',
  2253. sanitize: 'boolean',
  2254. sanitizeFn: '(null|function)',
  2255. whiteList: 'object',
  2256. popperConfig: '(null|object)'
  2257. };
  2258. var AttachmentMap = {
  2259. AUTO: 'auto',
  2260. TOP: 'top',
  2261. RIGHT: 'right',
  2262. BOTTOM: 'bottom',
  2263. LEFT: 'left'
  2264. };
  2265. var Default$4 = {
  2266. animation: true,
  2267. template: '<div class="tooltip" role="tooltip">' + '<div class="arrow"></div>' + '<div class="tooltip-inner"></div></div>',
  2268. trigger: 'hover focus',
  2269. title: '',
  2270. delay: 0,
  2271. html: false,
  2272. selector: false,
  2273. placement: 'top',
  2274. offset: 0,
  2275. container: false,
  2276. fallbackPlacement: 'flip',
  2277. boundary: 'scrollParent',
  2278. sanitize: true,
  2279. sanitizeFn: null,
  2280. whiteList: DefaultWhitelist,
  2281. popperConfig: null
  2282. };
  2283. var HOVER_STATE_SHOW = 'show';
  2284. var HOVER_STATE_OUT = 'out';
  2285. var Event = {
  2286. HIDE: "hide" + EVENT_KEY$6,
  2287. HIDDEN: "hidden" + EVENT_KEY$6,
  2288. SHOW: "show" + EVENT_KEY$6,
  2289. SHOWN: "shown" + EVENT_KEY$6,
  2290. INSERTED: "inserted" + EVENT_KEY$6,
  2291. CLICK: "click" + EVENT_KEY$6,
  2292. FOCUSIN: "focusin" + EVENT_KEY$6,
  2293. FOCUSOUT: "focusout" + EVENT_KEY$6,
  2294. MOUSEENTER: "mouseenter" + EVENT_KEY$6,
  2295. MOUSELEAVE: "mouseleave" + EVENT_KEY$6
  2296. };
  2297. var CLASS_NAME_FADE$2 = 'fade';
  2298. var CLASS_NAME_SHOW$4 = 'show';
  2299. var SELECTOR_TOOLTIP_INNER = '.tooltip-inner';
  2300. var SELECTOR_ARROW = '.arrow';
  2301. var TRIGGER_HOVER = 'hover';
  2302. var TRIGGER_FOCUS = 'focus';
  2303. var TRIGGER_CLICK = 'click';
  2304. var TRIGGER_MANUAL = 'manual';
  2305. /**
  2306. * ------------------------------------------------------------------------
  2307. * Class Definition
  2308. * ------------------------------------------------------------------------
  2309. */
  2310. var Tooltip = /*#__PURE__*/function () {
  2311. function Tooltip(element, config) {
  2312. if (typeof Popper__default['default'] === 'undefined') {
  2313. throw new TypeError('Bootstrap\'s tooltips require Popper.js (https://popper.js.org/)');
  2314. } // private
  2315. this._isEnabled = true;
  2316. this._timeout = 0;
  2317. this._hoverState = '';
  2318. this._activeTrigger = {};
  2319. this._popper = null; // Protected
  2320. this.element = element;
  2321. this.config = this._getConfig(config);
  2322. this.tip = null;
  2323. this._setListeners();
  2324. } // Getters
  2325. var _proto = Tooltip.prototype;
  2326. // Public
  2327. _proto.enable = function enable() {
  2328. this._isEnabled = true;
  2329. };
  2330. _proto.disable = function disable() {
  2331. this._isEnabled = false;
  2332. };
  2333. _proto.toggleEnabled = function toggleEnabled() {
  2334. this._isEnabled = !this._isEnabled;
  2335. };
  2336. _proto.toggle = function toggle(event) {
  2337. if (!this._isEnabled) {
  2338. return;
  2339. }
  2340. if (event) {
  2341. var dataKey = this.constructor.DATA_KEY;
  2342. var context = $__default['default'](event.currentTarget).data(dataKey);
  2343. if (!context) {
  2344. context = new this.constructor(event.currentTarget, this._getDelegateConfig());
  2345. $__default['default'](event.currentTarget).data(dataKey, context);
  2346. }
  2347. context._activeTrigger.click = !context._activeTrigger.click;
  2348. if (context._isWithActiveTrigger()) {
  2349. context._enter(null, context);
  2350. } else {
  2351. context._leave(null, context);
  2352. }
  2353. } else {
  2354. if ($__default['default'](this.getTipElement()).hasClass(CLASS_NAME_SHOW$4)) {
  2355. this._leave(null, this);
  2356. return;
  2357. }
  2358. this._enter(null, this);
  2359. }
  2360. };
  2361. _proto.dispose = function dispose() {
  2362. clearTimeout(this._timeout);
  2363. $__default['default'].removeData(this.element, this.constructor.DATA_KEY);
  2364. $__default['default'](this.element).off(this.constructor.EVENT_KEY);
  2365. $__default['default'](this.element).closest('.modal').off('hide.bs.modal', this._hideModalHandler);
  2366. if (this.tip) {
  2367. $__default['default'](this.tip).remove();
  2368. }
  2369. this._isEnabled = null;
  2370. this._timeout = null;
  2371. this._hoverState = null;
  2372. this._activeTrigger = null;
  2373. if (this._popper) {
  2374. this._popper.destroy();
  2375. }
  2376. this._popper = null;
  2377. this.element = null;
  2378. this.config = null;
  2379. this.tip = null;
  2380. };
  2381. _proto.show = function show() {
  2382. var _this = this;
  2383. if ($__default['default'](this.element).css('display') === 'none') {
  2384. throw new Error('Please use show on visible elements');
  2385. }
  2386. var showEvent = $__default['default'].Event(this.constructor.Event.SHOW);
  2387. if (this.isWithContent() && this._isEnabled) {
  2388. $__default['default'](this.element).trigger(showEvent);
  2389. var shadowRoot = Util.findShadowRoot(this.element);
  2390. var isInTheDom = $__default['default'].contains(shadowRoot !== null ? shadowRoot : this.element.ownerDocument.documentElement, this.element);
  2391. if (showEvent.isDefaultPrevented() || !isInTheDom) {
  2392. return;
  2393. }
  2394. var tip = this.getTipElement();
  2395. var tipId = Util.getUID(this.constructor.NAME);
  2396. tip.setAttribute('id', tipId);
  2397. this.element.setAttribute('aria-describedby', tipId);
  2398. this.setContent();
  2399. if (this.config.animation) {
  2400. $__default['default'](tip).addClass(CLASS_NAME_FADE$2);
  2401. }
  2402. var placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this.element) : this.config.placement;
  2403. var attachment = this._getAttachment(placement);
  2404. this.addAttachmentClass(attachment);
  2405. var container = this._getContainer();
  2406. $__default['default'](tip).data(this.constructor.DATA_KEY, this);
  2407. if (!$__default['default'].contains(this.element.ownerDocument.documentElement, this.tip)) {
  2408. $__default['default'](tip).appendTo(container);
  2409. }
  2410. $__default['default'](this.element).trigger(this.constructor.Event.INSERTED);
  2411. this._popper = new Popper__default['default'](this.element, tip, this._getPopperConfig(attachment));
  2412. $__default['default'](tip).addClass(CLASS_NAME_SHOW$4); // If this is a touch-enabled device we add extra
  2413. // empty mouseover listeners to the body's immediate children;
  2414. // only needed because of broken event delegation on iOS
  2415. // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
  2416. if ('ontouchstart' in document.documentElement) {
  2417. $__default['default'](document.body).children().on('mouseover', null, $__default['default'].noop);
  2418. }
  2419. var complete = function complete() {
  2420. if (_this.config.animation) {
  2421. _this._fixTransition();
  2422. }
  2423. var prevHoverState = _this._hoverState;
  2424. _this._hoverState = null;
  2425. $__default['default'](_this.element).trigger(_this.constructor.Event.SHOWN);
  2426. if (prevHoverState === HOVER_STATE_OUT) {
  2427. _this._leave(null, _this);
  2428. }
  2429. };
  2430. if ($__default['default'](this.tip).hasClass(CLASS_NAME_FADE$2)) {
  2431. var transitionDuration = Util.getTransitionDurationFromElement(this.tip);
  2432. $__default['default'](this.tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
  2433. } else {
  2434. complete();
  2435. }
  2436. }
  2437. };
  2438. _proto.hide = function hide(callback) {
  2439. var _this2 = this;
  2440. var tip = this.getTipElement();
  2441. var hideEvent = $__default['default'].Event(this.constructor.Event.HIDE);
  2442. var complete = function complete() {
  2443. if (_this2._hoverState !== HOVER_STATE_SHOW && tip.parentNode) {
  2444. tip.parentNode.removeChild(tip);
  2445. }
  2446. _this2._cleanTipClass();
  2447. _this2.element.removeAttribute('aria-describedby');
  2448. $__default['default'](_this2.element).trigger(_this2.constructor.Event.HIDDEN);
  2449. if (_this2._popper !== null) {
  2450. _this2._popper.destroy();
  2451. }
  2452. if (callback) {
  2453. callback();
  2454. }
  2455. };
  2456. $__default['default'](this.element).trigger(hideEvent);
  2457. if (hideEvent.isDefaultPrevented()) {
  2458. return;
  2459. }
  2460. $__default['default'](tip).removeClass(CLASS_NAME_SHOW$4); // If this is a touch-enabled device we remove the extra
  2461. // empty mouseover listeners we added for iOS support
  2462. if ('ontouchstart' in document.documentElement) {
  2463. $__default['default'](document.body).children().off('mouseover', null, $__default['default'].noop);
  2464. }
  2465. this._activeTrigger[TRIGGER_CLICK] = false;
  2466. this._activeTrigger[TRIGGER_FOCUS] = false;
  2467. this._activeTrigger[TRIGGER_HOVER] = false;
  2468. if ($__default['default'](this.tip).hasClass(CLASS_NAME_FADE$2)) {
  2469. var transitionDuration = Util.getTransitionDurationFromElement(tip);
  2470. $__default['default'](tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
  2471. } else {
  2472. complete();
  2473. }
  2474. this._hoverState = '';
  2475. };
  2476. _proto.update = function update() {
  2477. if (this._popper !== null) {
  2478. this._popper.scheduleUpdate();
  2479. }
  2480. } // Protected
  2481. ;
  2482. _proto.isWithContent = function isWithContent() {
  2483. return Boolean(this.getTitle());
  2484. };
  2485. _proto.addAttachmentClass = function addAttachmentClass(attachment) {
  2486. $__default['default'](this.getTipElement()).addClass(CLASS_PREFIX + "-" + attachment);
  2487. };
  2488. _proto.getTipElement = function getTipElement() {
  2489. this.tip = this.tip || $__default['default'](this.config.template)[0];
  2490. return this.tip;
  2491. };
  2492. _proto.setContent = function setContent() {
  2493. var tip = this.getTipElement();
  2494. this.setElementContent($__default['default'](tip.querySelectorAll(SELECTOR_TOOLTIP_INNER)), this.getTitle());
  2495. $__default['default'](tip).removeClass(CLASS_NAME_FADE$2 + " " + CLASS_NAME_SHOW$4);
  2496. };
  2497. _proto.setElementContent = function setElementContent($element, content) {
  2498. if (typeof content === 'object' && (content.nodeType || content.jquery)) {
  2499. // Content is a DOM node or a jQuery
  2500. if (this.config.html) {
  2501. if (!$__default['default'](content).parent().is($element)) {
  2502. $element.empty().append(content);
  2503. }
  2504. } else {
  2505. $element.text($__default['default'](content).text());
  2506. }
  2507. return;
  2508. }
  2509. if (this.config.html) {
  2510. if (this.config.sanitize) {
  2511. content = sanitizeHtml(content, this.config.whiteList, this.config.sanitizeFn);
  2512. }
  2513. $element.html(content);
  2514. } else {
  2515. $element.text(content);
  2516. }
  2517. };
  2518. _proto.getTitle = function getTitle() {
  2519. var title = this.element.getAttribute('data-original-title');
  2520. if (!title) {
  2521. title = typeof this.config.title === 'function' ? this.config.title.call(this.element) : this.config.title;
  2522. }
  2523. return title;
  2524. } // Private
  2525. ;
  2526. _proto._getPopperConfig = function _getPopperConfig(attachment) {
  2527. var _this3 = this;
  2528. var defaultBsConfig = {
  2529. placement: attachment,
  2530. modifiers: {
  2531. offset: this._getOffset(),
  2532. flip: {
  2533. behavior: this.config.fallbackPlacement
  2534. },
  2535. arrow: {
  2536. element: SELECTOR_ARROW
  2537. },
  2538. preventOverflow: {
  2539. boundariesElement: this.config.boundary
  2540. }
  2541. },
  2542. onCreate: function onCreate(data) {
  2543. if (data.originalPlacement !== data.placement) {
  2544. _this3._handlePopperPlacementChange(data);
  2545. }
  2546. },
  2547. onUpdate: function onUpdate(data) {
  2548. return _this3._handlePopperPlacementChange(data);
  2549. }
  2550. };
  2551. return _extends({}, defaultBsConfig, this.config.popperConfig);
  2552. };
  2553. _proto._getOffset = function _getOffset() {
  2554. var _this4 = this;
  2555. var offset = {};
  2556. if (typeof this.config.offset === 'function') {
  2557. offset.fn = function (data) {
  2558. data.offsets = _extends({}, data.offsets, _this4.config.offset(data.offsets, _this4.element) || {});
  2559. return data;
  2560. };
  2561. } else {
  2562. offset.offset = this.config.offset;
  2563. }
  2564. return offset;
  2565. };
  2566. _proto._getContainer = function _getContainer() {
  2567. if (this.config.container === false) {
  2568. return document.body;
  2569. }
  2570. if (Util.isElement(this.config.container)) {
  2571. return $__default['default'](this.config.container);
  2572. }
  2573. return $__default['default'](document).find(this.config.container);
  2574. };
  2575. _proto._getAttachment = function _getAttachment(placement) {
  2576. return AttachmentMap[placement.toUpperCase()];
  2577. };
  2578. _proto._setListeners = function _setListeners() {
  2579. var _this5 = this;
  2580. var triggers = this.config.trigger.split(' ');
  2581. triggers.forEach(function (trigger) {
  2582. if (trigger === 'click') {
  2583. $__default['default'](_this5.element).on(_this5.constructor.Event.CLICK, _this5.config.selector, function (event) {
  2584. return _this5.toggle(event);
  2585. });
  2586. } else if (trigger !== TRIGGER_MANUAL) {
  2587. var eventIn = trigger === TRIGGER_HOVER ? _this5.constructor.Event.MOUSEENTER : _this5.constructor.Event.FOCUSIN;
  2588. var eventOut = trigger === TRIGGER_HOVER ? _this5.constructor.Event.MOUSELEAVE : _this5.constructor.Event.FOCUSOUT;
  2589. $__default['default'](_this5.element).on(eventIn, _this5.config.selector, function (event) {
  2590. return _this5._enter(event);
  2591. }).on(eventOut, _this5.config.selector, function (event) {
  2592. return _this5._leave(event);
  2593. });
  2594. }
  2595. });
  2596. this._hideModalHandler = function () {
  2597. if (_this5.element) {
  2598. _this5.hide();
  2599. }
  2600. };
  2601. $__default['default'](this.element).closest('.modal').on('hide.bs.modal', this._hideModalHandler);
  2602. if (this.config.selector) {
  2603. this.config = _extends({}, this.config, {
  2604. trigger: 'manual',
  2605. selector: ''
  2606. });
  2607. } else {
  2608. this._fixTitle();
  2609. }
  2610. };
  2611. _proto._fixTitle = function _fixTitle() {
  2612. var titleType = typeof this.element.getAttribute('data-original-title');
  2613. if (this.element.getAttribute('title') || titleType !== 'string') {
  2614. this.element.setAttribute('data-original-title', this.element.getAttribute('title') || '');
  2615. this.element.setAttribute('title', '');
  2616. }
  2617. };
  2618. _proto._enter = function _enter(event, context) {
  2619. var dataKey = this.constructor.DATA_KEY;
  2620. context = context || $__default['default'](event.currentTarget).data(dataKey);
  2621. if (!context) {
  2622. context = new this.constructor(event.currentTarget, this._getDelegateConfig());
  2623. $__default['default'](event.currentTarget).data(dataKey, context);
  2624. }
  2625. if (event) {
  2626. context._activeTrigger[event.type === 'focusin' ? TRIGGER_FOCUS : TRIGGER_HOVER] = true;
  2627. }
  2628. if ($__default['default'](context.getTipElement()).hasClass(CLASS_NAME_SHOW$4) || context._hoverState === HOVER_STATE_SHOW) {
  2629. context._hoverState = HOVER_STATE_SHOW;
  2630. return;
  2631. }
  2632. clearTimeout(context._timeout);
  2633. context._hoverState = HOVER_STATE_SHOW;
  2634. if (!context.config.delay || !context.config.delay.show) {
  2635. context.show();
  2636. return;
  2637. }
  2638. context._timeout = setTimeout(function () {
  2639. if (context._hoverState === HOVER_STATE_SHOW) {
  2640. context.show();
  2641. }
  2642. }, context.config.delay.show);
  2643. };
  2644. _proto._leave = function _leave(event, context) {
  2645. var dataKey = this.constructor.DATA_KEY;
  2646. context = context || $__default['default'](event.currentTarget).data(dataKey);
  2647. if (!context) {
  2648. context = new this.constructor(event.currentTarget, this._getDelegateConfig());
  2649. $__default['default'](event.currentTarget).data(dataKey, context);
  2650. }
  2651. if (event) {
  2652. context._activeTrigger[event.type === 'focusout' ? TRIGGER_FOCUS : TRIGGER_HOVER] = false;
  2653. }
  2654. if (context._isWithActiveTrigger()) {
  2655. return;
  2656. }
  2657. clearTimeout(context._timeout);
  2658. context._hoverState = HOVER_STATE_OUT;
  2659. if (!context.config.delay || !context.config.delay.hide) {
  2660. context.hide();
  2661. return;
  2662. }
  2663. context._timeout = setTimeout(function () {
  2664. if (context._hoverState === HOVER_STATE_OUT) {
  2665. context.hide();
  2666. }
  2667. }, context.config.delay.hide);
  2668. };
  2669. _proto._isWithActiveTrigger = function _isWithActiveTrigger() {
  2670. for (var trigger in this._activeTrigger) {
  2671. if (this._activeTrigger[trigger]) {
  2672. return true;
  2673. }
  2674. }
  2675. return false;
  2676. };
  2677. _proto._getConfig = function _getConfig(config) {
  2678. var dataAttributes = $__default['default'](this.element).data();
  2679. Object.keys(dataAttributes).forEach(function (dataAttr) {
  2680. if (DISALLOWED_ATTRIBUTES.indexOf(dataAttr) !== -1) {
  2681. delete dataAttributes[dataAttr];
  2682. }
  2683. });
  2684. config = _extends({}, this.constructor.Default, dataAttributes, typeof config === 'object' && config ? config : {});
  2685. if (typeof config.delay === 'number') {
  2686. config.delay = {
  2687. show: config.delay,
  2688. hide: config.delay
  2689. };
  2690. }
  2691. if (typeof config.title === 'number') {
  2692. config.title = config.title.toString();
  2693. }
  2694. if (typeof config.content === 'number') {
  2695. config.content = config.content.toString();
  2696. }
  2697. Util.typeCheckConfig(NAME$6, config, this.constructor.DefaultType);
  2698. if (config.sanitize) {
  2699. config.template = sanitizeHtml(config.template, config.whiteList, config.sanitizeFn);
  2700. }
  2701. return config;
  2702. };
  2703. _proto._getDelegateConfig = function _getDelegateConfig() {
  2704. var config = {};
  2705. if (this.config) {
  2706. for (var key in this.config) {
  2707. if (this.constructor.Default[key] !== this.config[key]) {
  2708. config[key] = this.config[key];
  2709. }
  2710. }
  2711. }
  2712. return config;
  2713. };
  2714. _proto._cleanTipClass = function _cleanTipClass() {
  2715. var $tip = $__default['default'](this.getTipElement());
  2716. var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX);
  2717. if (tabClass !== null && tabClass.length) {
  2718. $tip.removeClass(tabClass.join(''));
  2719. }
  2720. };
  2721. _proto._handlePopperPlacementChange = function _handlePopperPlacementChange(popperData) {
  2722. this.tip = popperData.instance.popper;
  2723. this._cleanTipClass();
  2724. this.addAttachmentClass(this._getAttachment(popperData.placement));
  2725. };
  2726. _proto._fixTransition = function _fixTransition() {
  2727. var tip = this.getTipElement();
  2728. var initConfigAnimation = this.config.animation;
  2729. if (tip.getAttribute('x-placement') !== null) {
  2730. return;
  2731. }
  2732. $__default['default'](tip).removeClass(CLASS_NAME_FADE$2);
  2733. this.config.animation = false;
  2734. this.hide();
  2735. this.show();
  2736. this.config.animation = initConfigAnimation;
  2737. } // Static
  2738. ;
  2739. Tooltip._jQueryInterface = function _jQueryInterface(config) {
  2740. return this.each(function () {
  2741. var $element = $__default['default'](this);
  2742. var data = $element.data(DATA_KEY$6);
  2743. var _config = typeof config === 'object' && config;
  2744. if (!data && /dispose|hide/.test(config)) {
  2745. return;
  2746. }
  2747. if (!data) {
  2748. data = new Tooltip(this, _config);
  2749. $element.data(DATA_KEY$6, data);
  2750. }
  2751. if (typeof config === 'string') {
  2752. if (typeof data[config] === 'undefined') {
  2753. throw new TypeError("No method named \"" + config + "\"");
  2754. }
  2755. data[config]();
  2756. }
  2757. });
  2758. };
  2759. _createClass(Tooltip, null, [{
  2760. key: "VERSION",
  2761. get: function get() {
  2762. return VERSION$6;
  2763. }
  2764. }, {
  2765. key: "Default",
  2766. get: function get() {
  2767. return Default$4;
  2768. }
  2769. }, {
  2770. key: "NAME",
  2771. get: function get() {
  2772. return NAME$6;
  2773. }
  2774. }, {
  2775. key: "DATA_KEY",
  2776. get: function get() {
  2777. return DATA_KEY$6;
  2778. }
  2779. }, {
  2780. key: "Event",
  2781. get: function get() {
  2782. return Event;
  2783. }
  2784. }, {
  2785. key: "EVENT_KEY",
  2786. get: function get() {
  2787. return EVENT_KEY$6;
  2788. }
  2789. }, {
  2790. key: "DefaultType",
  2791. get: function get() {
  2792. return DefaultType$4;
  2793. }
  2794. }]);
  2795. return Tooltip;
  2796. }();
  2797. /**
  2798. * ------------------------------------------------------------------------
  2799. * jQuery
  2800. * ------------------------------------------------------------------------
  2801. */
  2802. $__default['default'].fn[NAME$6] = Tooltip._jQueryInterface;
  2803. $__default['default'].fn[NAME$6].Constructor = Tooltip;
  2804. $__default['default'].fn[NAME$6].noConflict = function () {
  2805. $__default['default'].fn[NAME$6] = JQUERY_NO_CONFLICT$6;
  2806. return Tooltip._jQueryInterface;
  2807. };
  2808. /**
  2809. * ------------------------------------------------------------------------
  2810. * Constants
  2811. * ------------------------------------------------------------------------
  2812. */
  2813. var NAME$7 = 'popover';
  2814. var VERSION$7 = '4.5.3';
  2815. var DATA_KEY$7 = 'bs.popover';
  2816. var EVENT_KEY$7 = "." + DATA_KEY$7;
  2817. var JQUERY_NO_CONFLICT$7 = $__default['default'].fn[NAME$7];
  2818. var CLASS_PREFIX$1 = 'bs-popover';
  2819. var BSCLS_PREFIX_REGEX$1 = new RegExp("(^|\\s)" + CLASS_PREFIX$1 + "\\S+", 'g');
  2820. var Default$5 = _extends({}, Tooltip.Default, {
  2821. placement: 'right',
  2822. trigger: 'click',
  2823. content: '',
  2824. template: '<div class="popover" role="tooltip">' + '<div class="arrow"></div>' + '<h3 class="popover-header"></h3>' + '<div class="popover-body"></div></div>'
  2825. });
  2826. var DefaultType$5 = _extends({}, Tooltip.DefaultType, {
  2827. content: '(string|element|function)'
  2828. });
  2829. var CLASS_NAME_FADE$3 = 'fade';
  2830. var CLASS_NAME_SHOW$5 = 'show';
  2831. var SELECTOR_TITLE = '.popover-header';
  2832. var SELECTOR_CONTENT = '.popover-body';
  2833. var Event$1 = {
  2834. HIDE: "hide" + EVENT_KEY$7,
  2835. HIDDEN: "hidden" + EVENT_KEY$7,
  2836. SHOW: "show" + EVENT_KEY$7,
  2837. SHOWN: "shown" + EVENT_KEY$7,
  2838. INSERTED: "inserted" + EVENT_KEY$7,
  2839. CLICK: "click" + EVENT_KEY$7,
  2840. FOCUSIN: "focusin" + EVENT_KEY$7,
  2841. FOCUSOUT: "focusout" + EVENT_KEY$7,
  2842. MOUSEENTER: "mouseenter" + EVENT_KEY$7,
  2843. MOUSELEAVE: "mouseleave" + EVENT_KEY$7
  2844. };
  2845. /**
  2846. * ------------------------------------------------------------------------
  2847. * Class Definition
  2848. * ------------------------------------------------------------------------
  2849. */
  2850. var Popover = /*#__PURE__*/function (_Tooltip) {
  2851. _inheritsLoose(Popover, _Tooltip);
  2852. function Popover() {
  2853. return _Tooltip.apply(this, arguments) || this;
  2854. }
  2855. var _proto = Popover.prototype;
  2856. // Overrides
  2857. _proto.isWithContent = function isWithContent() {
  2858. return this.getTitle() || this._getContent();
  2859. };
  2860. _proto.addAttachmentClass = function addAttachmentClass(attachment) {
  2861. $__default['default'](this.getTipElement()).addClass(CLASS_PREFIX$1 + "-" + attachment);
  2862. };
  2863. _proto.getTipElement = function getTipElement() {
  2864. this.tip = this.tip || $__default['default'](this.config.template)[0];
  2865. return this.tip;
  2866. };
  2867. _proto.setContent = function setContent() {
  2868. var $tip = $__default['default'](this.getTipElement()); // We use append for html objects to maintain js events
  2869. this.setElementContent($tip.find(SELECTOR_TITLE), this.getTitle());
  2870. var content = this._getContent();
  2871. if (typeof content === 'function') {
  2872. content = content.call(this.element);
  2873. }
  2874. this.setElementContent($tip.find(SELECTOR_CONTENT), content);
  2875. $tip.removeClass(CLASS_NAME_FADE$3 + " " + CLASS_NAME_SHOW$5);
  2876. } // Private
  2877. ;
  2878. _proto._getContent = function _getContent() {
  2879. return this.element.getAttribute('data-content') || this.config.content;
  2880. };
  2881. _proto._cleanTipClass = function _cleanTipClass() {
  2882. var $tip = $__default['default'](this.getTipElement());
  2883. var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX$1);
  2884. if (tabClass !== null && tabClass.length > 0) {
  2885. $tip.removeClass(tabClass.join(''));
  2886. }
  2887. } // Static
  2888. ;
  2889. Popover._jQueryInterface = function _jQueryInterface(config) {
  2890. return this.each(function () {
  2891. var data = $__default['default'](this).data(DATA_KEY$7);
  2892. var _config = typeof config === 'object' ? config : null;
  2893. if (!data && /dispose|hide/.test(config)) {
  2894. return;
  2895. }
  2896. if (!data) {
  2897. data = new Popover(this, _config);
  2898. $__default['default'](this).data(DATA_KEY$7, data);
  2899. }
  2900. if (typeof config === 'string') {
  2901. if (typeof data[config] === 'undefined') {
  2902. throw new TypeError("No method named \"" + config + "\"");
  2903. }
  2904. data[config]();
  2905. }
  2906. });
  2907. };
  2908. _createClass(Popover, null, [{
  2909. key: "VERSION",
  2910. // Getters
  2911. get: function get() {
  2912. return VERSION$7;
  2913. }
  2914. }, {
  2915. key: "Default",
  2916. get: function get() {
  2917. return Default$5;
  2918. }
  2919. }, {
  2920. key: "NAME",
  2921. get: function get() {
  2922. return NAME$7;
  2923. }
  2924. }, {
  2925. key: "DATA_KEY",
  2926. get: function get() {
  2927. return DATA_KEY$7;
  2928. }
  2929. }, {
  2930. key: "Event",
  2931. get: function get() {
  2932. return Event$1;
  2933. }
  2934. }, {
  2935. key: "EVENT_KEY",
  2936. get: function get() {
  2937. return EVENT_KEY$7;
  2938. }
  2939. }, {
  2940. key: "DefaultType",
  2941. get: function get() {
  2942. return DefaultType$5;
  2943. }
  2944. }]);
  2945. return Popover;
  2946. }(Tooltip);
  2947. /**
  2948. * ------------------------------------------------------------------------
  2949. * jQuery
  2950. * ------------------------------------------------------------------------
  2951. */
  2952. $__default['default'].fn[NAME$7] = Popover._jQueryInterface;
  2953. $__default['default'].fn[NAME$7].Constructor = Popover;
  2954. $__default['default'].fn[NAME$7].noConflict = function () {
  2955. $__default['default'].fn[NAME$7] = JQUERY_NO_CONFLICT$7;
  2956. return Popover._jQueryInterface;
  2957. };
  2958. /**
  2959. * ------------------------------------------------------------------------
  2960. * Constants
  2961. * ------------------------------------------------------------------------
  2962. */
  2963. var NAME$8 = 'scrollspy';
  2964. var VERSION$8 = '4.5.3';
  2965. var DATA_KEY$8 = 'bs.scrollspy';
  2966. var EVENT_KEY$8 = "." + DATA_KEY$8;
  2967. var DATA_API_KEY$6 = '.data-api';
  2968. var JQUERY_NO_CONFLICT$8 = $__default['default'].fn[NAME$8];
  2969. var Default$6 = {
  2970. offset: 10,
  2971. method: 'auto',
  2972. target: ''
  2973. };
  2974. var DefaultType$6 = {
  2975. offset: 'number',
  2976. method: 'string',
  2977. target: '(string|element)'
  2978. };
  2979. var EVENT_ACTIVATE = "activate" + EVENT_KEY$8;
  2980. var EVENT_SCROLL = "scroll" + EVENT_KEY$8;
  2981. var EVENT_LOAD_DATA_API$2 = "load" + EVENT_KEY$8 + DATA_API_KEY$6;
  2982. var CLASS_NAME_DROPDOWN_ITEM = 'dropdown-item';
  2983. var CLASS_NAME_ACTIVE$2 = 'active';
  2984. var SELECTOR_DATA_SPY = '[data-spy="scroll"]';
  2985. var SELECTOR_NAV_LIST_GROUP = '.nav, .list-group';
  2986. var SELECTOR_NAV_LINKS = '.nav-link';
  2987. var SELECTOR_NAV_ITEMS = '.nav-item';
  2988. var SELECTOR_LIST_ITEMS = '.list-group-item';
  2989. var SELECTOR_DROPDOWN = '.dropdown';
  2990. var SELECTOR_DROPDOWN_ITEMS = '.dropdown-item';
  2991. var SELECTOR_DROPDOWN_TOGGLE = '.dropdown-toggle';
  2992. var METHOD_OFFSET = 'offset';
  2993. var METHOD_POSITION = 'position';
  2994. /**
  2995. * ------------------------------------------------------------------------
  2996. * Class Definition
  2997. * ------------------------------------------------------------------------
  2998. */
  2999. var ScrollSpy = /*#__PURE__*/function () {
  3000. function ScrollSpy(element, config) {
  3001. var _this = this;
  3002. this._element = element;
  3003. this._scrollElement = element.tagName === 'BODY' ? window : element;
  3004. this._config = this._getConfig(config);
  3005. this._selector = this._config.target + " " + SELECTOR_NAV_LINKS + "," + (this._config.target + " " + SELECTOR_LIST_ITEMS + ",") + (this._config.target + " " + SELECTOR_DROPDOWN_ITEMS);
  3006. this._offsets = [];
  3007. this._targets = [];
  3008. this._activeTarget = null;
  3009. this._scrollHeight = 0;
  3010. $__default['default'](this._scrollElement).on(EVENT_SCROLL, function (event) {
  3011. return _this._process(event);
  3012. });
  3013. this.refresh();
  3014. this._process();
  3015. } // Getters
  3016. var _proto = ScrollSpy.prototype;
  3017. // Public
  3018. _proto.refresh = function refresh() {
  3019. var _this2 = this;
  3020. var autoMethod = this._scrollElement === this._scrollElement.window ? METHOD_OFFSET : METHOD_POSITION;
  3021. var offsetMethod = this._config.method === 'auto' ? autoMethod : this._config.method;
  3022. var offsetBase = offsetMethod === METHOD_POSITION ? this._getScrollTop() : 0;
  3023. this._offsets = [];
  3024. this._targets = [];
  3025. this._scrollHeight = this._getScrollHeight();
  3026. var targets = [].slice.call(document.querySelectorAll(this._selector));
  3027. targets.map(function (element) {
  3028. var target;
  3029. var targetSelector = Util.getSelectorFromElement(element);
  3030. if (targetSelector) {
  3031. target = document.querySelector(targetSelector);
  3032. }
  3033. if (target) {
  3034. var targetBCR = target.getBoundingClientRect();
  3035. if (targetBCR.width || targetBCR.height) {
  3036. // TODO (fat): remove sketch reliance on jQuery position/offset
  3037. return [$__default['default'](target)[offsetMethod]().top + offsetBase, targetSelector];
  3038. }
  3039. }
  3040. return null;
  3041. }).filter(function (item) {
  3042. return item;
  3043. }).sort(function (a, b) {
  3044. return a[0] - b[0];
  3045. }).forEach(function (item) {
  3046. _this2._offsets.push(item[0]);
  3047. _this2._targets.push(item[1]);
  3048. });
  3049. };
  3050. _proto.dispose = function dispose() {
  3051. $__default['default'].removeData(this._element, DATA_KEY$8);
  3052. $__default['default'](this._scrollElement).off(EVENT_KEY$8);
  3053. this._element = null;
  3054. this._scrollElement = null;
  3055. this._config = null;
  3056. this._selector = null;
  3057. this._offsets = null;
  3058. this._targets = null;
  3059. this._activeTarget = null;
  3060. this._scrollHeight = null;
  3061. } // Private
  3062. ;
  3063. _proto._getConfig = function _getConfig(config) {
  3064. config = _extends({}, Default$6, typeof config === 'object' && config ? config : {});
  3065. if (typeof config.target !== 'string' && Util.isElement(config.target)) {
  3066. var id = $__default['default'](config.target).attr('id');
  3067. if (!id) {
  3068. id = Util.getUID(NAME$8);
  3069. $__default['default'](config.target).attr('id', id);
  3070. }
  3071. config.target = "#" + id;
  3072. }
  3073. Util.typeCheckConfig(NAME$8, config, DefaultType$6);
  3074. return config;
  3075. };
  3076. _proto._getScrollTop = function _getScrollTop() {
  3077. return this._scrollElement === window ? this._scrollElement.pageYOffset : this._scrollElement.scrollTop;
  3078. };
  3079. _proto._getScrollHeight = function _getScrollHeight() {
  3080. return this._scrollElement.scrollHeight || Math.max(document.body.scrollHeight, document.documentElement.scrollHeight);
  3081. };
  3082. _proto._getOffsetHeight = function _getOffsetHeight() {
  3083. return this._scrollElement === window ? window.innerHeight : this._scrollElement.getBoundingClientRect().height;
  3084. };
  3085. _proto._process = function _process() {
  3086. var scrollTop = this._getScrollTop() + this._config.offset;
  3087. var scrollHeight = this._getScrollHeight();
  3088. var maxScroll = this._config.offset + scrollHeight - this._getOffsetHeight();
  3089. if (this._scrollHeight !== scrollHeight) {
  3090. this.refresh();
  3091. }
  3092. if (scrollTop >= maxScroll) {
  3093. var target = this._targets[this._targets.length - 1];
  3094. if (this._activeTarget !== target) {
  3095. this._activate(target);
  3096. }
  3097. return;
  3098. }
  3099. if (this._activeTarget && scrollTop < this._offsets[0] && this._offsets[0] > 0) {
  3100. this._activeTarget = null;
  3101. this._clear();
  3102. return;
  3103. }
  3104. for (var i = this._offsets.length; i--;) {
  3105. var isActiveTarget = this._activeTarget !== this._targets[i] && scrollTop >= this._offsets[i] && (typeof this._offsets[i + 1] === 'undefined' || scrollTop < this._offsets[i + 1]);
  3106. if (isActiveTarget) {
  3107. this._activate(this._targets[i]);
  3108. }
  3109. }
  3110. };
  3111. _proto._activate = function _activate(target) {
  3112. this._activeTarget = target;
  3113. this._clear();
  3114. var queries = this._selector.split(',').map(function (selector) {
  3115. return selector + "[data-target=\"" + target + "\"]," + selector + "[href=\"" + target + "\"]";
  3116. });
  3117. var $link = $__default['default']([].slice.call(document.querySelectorAll(queries.join(','))));
  3118. if ($link.hasClass(CLASS_NAME_DROPDOWN_ITEM)) {
  3119. $link.closest(SELECTOR_DROPDOWN).find(SELECTOR_DROPDOWN_TOGGLE).addClass(CLASS_NAME_ACTIVE$2);
  3120. $link.addClass(CLASS_NAME_ACTIVE$2);
  3121. } else {
  3122. // Set triggered link as active
  3123. $link.addClass(CLASS_NAME_ACTIVE$2); // Set triggered links parents as active
  3124. // With both <ul> and <nav> markup a parent is the previous sibling of any nav ancestor
  3125. $link.parents(SELECTOR_NAV_LIST_GROUP).prev(SELECTOR_NAV_LINKS + ", " + SELECTOR_LIST_ITEMS).addClass(CLASS_NAME_ACTIVE$2); // Handle special case when .nav-link is inside .nav-item
  3126. $link.parents(SELECTOR_NAV_LIST_GROUP).prev(SELECTOR_NAV_ITEMS).children(SELECTOR_NAV_LINKS).addClass(CLASS_NAME_ACTIVE$2);
  3127. }
  3128. $__default['default'](this._scrollElement).trigger(EVENT_ACTIVATE, {
  3129. relatedTarget: target
  3130. });
  3131. };
  3132. _proto._clear = function _clear() {
  3133. [].slice.call(document.querySelectorAll(this._selector)).filter(function (node) {
  3134. return node.classList.contains(CLASS_NAME_ACTIVE$2);
  3135. }).forEach(function (node) {
  3136. return node.classList.remove(CLASS_NAME_ACTIVE$2);
  3137. });
  3138. } // Static
  3139. ;
  3140. ScrollSpy._jQueryInterface = function _jQueryInterface(config) {
  3141. return this.each(function () {
  3142. var data = $__default['default'](this).data(DATA_KEY$8);
  3143. var _config = typeof config === 'object' && config;
  3144. if (!data) {
  3145. data = new ScrollSpy(this, _config);
  3146. $__default['default'](this).data(DATA_KEY$8, data);
  3147. }
  3148. if (typeof config === 'string') {
  3149. if (typeof data[config] === 'undefined') {
  3150. throw new TypeError("No method named \"" + config + "\"");
  3151. }
  3152. data[config]();
  3153. }
  3154. });
  3155. };
  3156. _createClass(ScrollSpy, null, [{
  3157. key: "VERSION",
  3158. get: function get() {
  3159. return VERSION$8;
  3160. }
  3161. }, {
  3162. key: "Default",
  3163. get: function get() {
  3164. return Default$6;
  3165. }
  3166. }]);
  3167. return ScrollSpy;
  3168. }();
  3169. /**
  3170. * ------------------------------------------------------------------------
  3171. * Data Api implementation
  3172. * ------------------------------------------------------------------------
  3173. */
  3174. $__default['default'](window).on(EVENT_LOAD_DATA_API$2, function () {
  3175. var scrollSpys = [].slice.call(document.querySelectorAll(SELECTOR_DATA_SPY));
  3176. var scrollSpysLength = scrollSpys.length;
  3177. for (var i = scrollSpysLength; i--;) {
  3178. var $spy = $__default['default'](scrollSpys[i]);
  3179. ScrollSpy._jQueryInterface.call($spy, $spy.data());
  3180. }
  3181. });
  3182. /**
  3183. * ------------------------------------------------------------------------
  3184. * jQuery
  3185. * ------------------------------------------------------------------------
  3186. */
  3187. $__default['default'].fn[NAME$8] = ScrollSpy._jQueryInterface;
  3188. $__default['default'].fn[NAME$8].Constructor = ScrollSpy;
  3189. $__default['default'].fn[NAME$8].noConflict = function () {
  3190. $__default['default'].fn[NAME$8] = JQUERY_NO_CONFLICT$8;
  3191. return ScrollSpy._jQueryInterface;
  3192. };
  3193. /**
  3194. * ------------------------------------------------------------------------
  3195. * Constants
  3196. * ------------------------------------------------------------------------
  3197. */
  3198. var NAME$9 = 'tab';
  3199. var VERSION$9 = '4.5.3';
  3200. var DATA_KEY$9 = 'bs.tab';
  3201. var EVENT_KEY$9 = "." + DATA_KEY$9;
  3202. var DATA_API_KEY$7 = '.data-api';
  3203. var JQUERY_NO_CONFLICT$9 = $__default['default'].fn[NAME$9];
  3204. var EVENT_HIDE$3 = "hide" + EVENT_KEY$9;
  3205. var EVENT_HIDDEN$3 = "hidden" + EVENT_KEY$9;
  3206. var EVENT_SHOW$3 = "show" + EVENT_KEY$9;
  3207. var EVENT_SHOWN$3 = "shown" + EVENT_KEY$9;
  3208. var EVENT_CLICK_DATA_API$6 = "click" + EVENT_KEY$9 + DATA_API_KEY$7;
  3209. var CLASS_NAME_DROPDOWN_MENU = 'dropdown-menu';
  3210. var CLASS_NAME_ACTIVE$3 = 'active';
  3211. var CLASS_NAME_DISABLED$1 = 'disabled';
  3212. var CLASS_NAME_FADE$4 = 'fade';
  3213. var CLASS_NAME_SHOW$6 = 'show';
  3214. var SELECTOR_DROPDOWN$1 = '.dropdown';
  3215. var SELECTOR_NAV_LIST_GROUP$1 = '.nav, .list-group';
  3216. var SELECTOR_ACTIVE$2 = '.active';
  3217. var SELECTOR_ACTIVE_UL = '> li > .active';
  3218. var SELECTOR_DATA_TOGGLE$4 = '[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]';
  3219. var SELECTOR_DROPDOWN_TOGGLE$1 = '.dropdown-toggle';
  3220. var SELECTOR_DROPDOWN_ACTIVE_CHILD = '> .dropdown-menu .active';
  3221. /**
  3222. * ------------------------------------------------------------------------
  3223. * Class Definition
  3224. * ------------------------------------------------------------------------
  3225. */
  3226. var Tab = /*#__PURE__*/function () {
  3227. function Tab(element) {
  3228. this._element = element;
  3229. } // Getters
  3230. var _proto = Tab.prototype;
  3231. // Public
  3232. _proto.show = function show() {
  3233. var _this = this;
  3234. if (this._element.parentNode && this._element.parentNode.nodeType === Node.ELEMENT_NODE && $__default['default'](this._element).hasClass(CLASS_NAME_ACTIVE$3) || $__default['default'](this._element).hasClass(CLASS_NAME_DISABLED$1)) {
  3235. return;
  3236. }
  3237. var target;
  3238. var previous;
  3239. var listElement = $__default['default'](this._element).closest(SELECTOR_NAV_LIST_GROUP$1)[0];
  3240. var selector = Util.getSelectorFromElement(this._element);
  3241. if (listElement) {
  3242. var itemSelector = listElement.nodeName === 'UL' || listElement.nodeName === 'OL' ? SELECTOR_ACTIVE_UL : SELECTOR_ACTIVE$2;
  3243. previous = $__default['default'].makeArray($__default['default'](listElement).find(itemSelector));
  3244. previous = previous[previous.length - 1];
  3245. }
  3246. var hideEvent = $__default['default'].Event(EVENT_HIDE$3, {
  3247. relatedTarget: this._element
  3248. });
  3249. var showEvent = $__default['default'].Event(EVENT_SHOW$3, {
  3250. relatedTarget: previous
  3251. });
  3252. if (previous) {
  3253. $__default['default'](previous).trigger(hideEvent);
  3254. }
  3255. $__default['default'](this._element).trigger(showEvent);
  3256. if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) {
  3257. return;
  3258. }
  3259. if (selector) {
  3260. target = document.querySelector(selector);
  3261. }
  3262. this._activate(this._element, listElement);
  3263. var complete = function complete() {
  3264. var hiddenEvent = $__default['default'].Event(EVENT_HIDDEN$3, {
  3265. relatedTarget: _this._element
  3266. });
  3267. var shownEvent = $__default['default'].Event(EVENT_SHOWN$3, {
  3268. relatedTarget: previous
  3269. });
  3270. $__default['default'](previous).trigger(hiddenEvent);
  3271. $__default['default'](_this._element).trigger(shownEvent);
  3272. };
  3273. if (target) {
  3274. this._activate(target, target.parentNode, complete);
  3275. } else {
  3276. complete();
  3277. }
  3278. };
  3279. _proto.dispose = function dispose() {
  3280. $__default['default'].removeData(this._element, DATA_KEY$9);
  3281. this._element = null;
  3282. } // Private
  3283. ;
  3284. _proto._activate = function _activate(element, container, callback) {
  3285. var _this2 = this;
  3286. var activeElements = container && (container.nodeName === 'UL' || container.nodeName === 'OL') ? $__default['default'](container).find(SELECTOR_ACTIVE_UL) : $__default['default'](container).children(SELECTOR_ACTIVE$2);
  3287. var active = activeElements[0];
  3288. var isTransitioning = callback && active && $__default['default'](active).hasClass(CLASS_NAME_FADE$4);
  3289. var complete = function complete() {
  3290. return _this2._transitionComplete(element, active, callback);
  3291. };
  3292. if (active && isTransitioning) {
  3293. var transitionDuration = Util.getTransitionDurationFromElement(active);
  3294. $__default['default'](active).removeClass(CLASS_NAME_SHOW$6).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
  3295. } else {
  3296. complete();
  3297. }
  3298. };
  3299. _proto._transitionComplete = function _transitionComplete(element, active, callback) {
  3300. if (active) {
  3301. $__default['default'](active).removeClass(CLASS_NAME_ACTIVE$3);
  3302. var dropdownChild = $__default['default'](active.parentNode).find(SELECTOR_DROPDOWN_ACTIVE_CHILD)[0];
  3303. if (dropdownChild) {
  3304. $__default['default'](dropdownChild).removeClass(CLASS_NAME_ACTIVE$3);
  3305. }
  3306. if (active.getAttribute('role') === 'tab') {
  3307. active.setAttribute('aria-selected', false);
  3308. }
  3309. }
  3310. $__default['default'](element).addClass(CLASS_NAME_ACTIVE$3);
  3311. if (element.getAttribute('role') === 'tab') {
  3312. element.setAttribute('aria-selected', true);
  3313. }
  3314. Util.reflow(element);
  3315. if (element.classList.contains(CLASS_NAME_FADE$4)) {
  3316. element.classList.add(CLASS_NAME_SHOW$6);
  3317. }
  3318. if (element.parentNode && $__default['default'](element.parentNode).hasClass(CLASS_NAME_DROPDOWN_MENU)) {
  3319. var dropdownElement = $__default['default'](element).closest(SELECTOR_DROPDOWN$1)[0];
  3320. if (dropdownElement) {
  3321. var dropdownToggleList = [].slice.call(dropdownElement.querySelectorAll(SELECTOR_DROPDOWN_TOGGLE$1));
  3322. $__default['default'](dropdownToggleList).addClass(CLASS_NAME_ACTIVE$3);
  3323. }
  3324. element.setAttribute('aria-expanded', true);
  3325. }
  3326. if (callback) {
  3327. callback();
  3328. }
  3329. } // Static
  3330. ;
  3331. Tab._jQueryInterface = function _jQueryInterface(config) {
  3332. return this.each(function () {
  3333. var $this = $__default['default'](this);
  3334. var data = $this.data(DATA_KEY$9);
  3335. if (!data) {
  3336. data = new Tab(this);
  3337. $this.data(DATA_KEY$9, data);
  3338. }
  3339. if (typeof config === 'string') {
  3340. if (typeof data[config] === 'undefined') {
  3341. throw new TypeError("No method named \"" + config + "\"");
  3342. }
  3343. data[config]();
  3344. }
  3345. });
  3346. };
  3347. _createClass(Tab, null, [{
  3348. key: "VERSION",
  3349. get: function get() {
  3350. return VERSION$9;
  3351. }
  3352. }]);
  3353. return Tab;
  3354. }();
  3355. /**
  3356. * ------------------------------------------------------------------------
  3357. * Data Api implementation
  3358. * ------------------------------------------------------------------------
  3359. */
  3360. $__default['default'](document).on(EVENT_CLICK_DATA_API$6, SELECTOR_DATA_TOGGLE$4, function (event) {
  3361. event.preventDefault();
  3362. Tab._jQueryInterface.call($__default['default'](this), 'show');
  3363. });
  3364. /**
  3365. * ------------------------------------------------------------------------
  3366. * jQuery
  3367. * ------------------------------------------------------------------------
  3368. */
  3369. $__default['default'].fn[NAME$9] = Tab._jQueryInterface;
  3370. $__default['default'].fn[NAME$9].Constructor = Tab;
  3371. $__default['default'].fn[NAME$9].noConflict = function () {
  3372. $__default['default'].fn[NAME$9] = JQUERY_NO_CONFLICT$9;
  3373. return Tab._jQueryInterface;
  3374. };
  3375. /**
  3376. * ------------------------------------------------------------------------
  3377. * Constants
  3378. * ------------------------------------------------------------------------
  3379. */
  3380. var NAME$a = 'toast';
  3381. var VERSION$a = '4.5.3';
  3382. var DATA_KEY$a = 'bs.toast';
  3383. var EVENT_KEY$a = "." + DATA_KEY$a;
  3384. var JQUERY_NO_CONFLICT$a = $__default['default'].fn[NAME$a];
  3385. var EVENT_CLICK_DISMISS$1 = "click.dismiss" + EVENT_KEY$a;
  3386. var EVENT_HIDE$4 = "hide" + EVENT_KEY$a;
  3387. var EVENT_HIDDEN$4 = "hidden" + EVENT_KEY$a;
  3388. var EVENT_SHOW$4 = "show" + EVENT_KEY$a;
  3389. var EVENT_SHOWN$4 = "shown" + EVENT_KEY$a;
  3390. var CLASS_NAME_FADE$5 = 'fade';
  3391. var CLASS_NAME_HIDE = 'hide';
  3392. var CLASS_NAME_SHOW$7 = 'show';
  3393. var CLASS_NAME_SHOWING = 'showing';
  3394. var DefaultType$7 = {
  3395. animation: 'boolean',
  3396. autohide: 'boolean',
  3397. delay: 'number'
  3398. };
  3399. var Default$7 = {
  3400. animation: true,
  3401. autohide: true,
  3402. delay: 500
  3403. };
  3404. var SELECTOR_DATA_DISMISS$1 = '[data-dismiss="toast"]';
  3405. /**
  3406. * ------------------------------------------------------------------------
  3407. * Class Definition
  3408. * ------------------------------------------------------------------------
  3409. */
  3410. var Toast = /*#__PURE__*/function () {
  3411. function Toast(element, config) {
  3412. this._element = element;
  3413. this._config = this._getConfig(config);
  3414. this._timeout = null;
  3415. this._setListeners();
  3416. } // Getters
  3417. var _proto = Toast.prototype;
  3418. // Public
  3419. _proto.show = function show() {
  3420. var _this = this;
  3421. var showEvent = $__default['default'].Event(EVENT_SHOW$4);
  3422. $__default['default'](this._element).trigger(showEvent);
  3423. if (showEvent.isDefaultPrevented()) {
  3424. return;
  3425. }
  3426. this._clearTimeout();
  3427. if (this._config.animation) {
  3428. this._element.classList.add(CLASS_NAME_FADE$5);
  3429. }
  3430. var complete = function complete() {
  3431. _this._element.classList.remove(CLASS_NAME_SHOWING);
  3432. _this._element.classList.add(CLASS_NAME_SHOW$7);
  3433. $__default['default'](_this._element).trigger(EVENT_SHOWN$4);
  3434. if (_this._config.autohide) {
  3435. _this._timeout = setTimeout(function () {
  3436. _this.hide();
  3437. }, _this._config.delay);
  3438. }
  3439. };
  3440. this._element.classList.remove(CLASS_NAME_HIDE);
  3441. Util.reflow(this._element);
  3442. this._element.classList.add(CLASS_NAME_SHOWING);
  3443. if (this._config.animation) {
  3444. var transitionDuration = Util.getTransitionDurationFromElement(this._element);
  3445. $__default['default'](this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
  3446. } else {
  3447. complete();
  3448. }
  3449. };
  3450. _proto.hide = function hide() {
  3451. if (!this._element.classList.contains(CLASS_NAME_SHOW$7)) {
  3452. return;
  3453. }
  3454. var hideEvent = $__default['default'].Event(EVENT_HIDE$4);
  3455. $__default['default'](this._element).trigger(hideEvent);
  3456. if (hideEvent.isDefaultPrevented()) {
  3457. return;
  3458. }
  3459. this._close();
  3460. };
  3461. _proto.dispose = function dispose() {
  3462. this._clearTimeout();
  3463. if (this._element.classList.contains(CLASS_NAME_SHOW$7)) {
  3464. this._element.classList.remove(CLASS_NAME_SHOW$7);
  3465. }
  3466. $__default['default'](this._element).off(EVENT_CLICK_DISMISS$1);
  3467. $__default['default'].removeData(this._element, DATA_KEY$a);
  3468. this._element = null;
  3469. this._config = null;
  3470. } // Private
  3471. ;
  3472. _proto._getConfig = function _getConfig(config) {
  3473. config = _extends({}, Default$7, $__default['default'](this._element).data(), typeof config === 'object' && config ? config : {});
  3474. Util.typeCheckConfig(NAME$a, config, this.constructor.DefaultType);
  3475. return config;
  3476. };
  3477. _proto._setListeners = function _setListeners() {
  3478. var _this2 = this;
  3479. $__default['default'](this._element).on(EVENT_CLICK_DISMISS$1, SELECTOR_DATA_DISMISS$1, function () {
  3480. return _this2.hide();
  3481. });
  3482. };
  3483. _proto._close = function _close() {
  3484. var _this3 = this;
  3485. var complete = function complete() {
  3486. _this3._element.classList.add(CLASS_NAME_HIDE);
  3487. $__default['default'](_this3._element).trigger(EVENT_HIDDEN$4);
  3488. };
  3489. this._element.classList.remove(CLASS_NAME_SHOW$7);
  3490. if (this._config.animation) {
  3491. var transitionDuration = Util.getTransitionDurationFromElement(this._element);
  3492. $__default['default'](this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
  3493. } else {
  3494. complete();
  3495. }
  3496. };
  3497. _proto._clearTimeout = function _clearTimeout() {
  3498. clearTimeout(this._timeout);
  3499. this._timeout = null;
  3500. } // Static
  3501. ;
  3502. Toast._jQueryInterface = function _jQueryInterface(config) {
  3503. return this.each(function () {
  3504. var $element = $__default['default'](this);
  3505. var data = $element.data(DATA_KEY$a);
  3506. var _config = typeof config === 'object' && config;
  3507. if (!data) {
  3508. data = new Toast(this, _config);
  3509. $element.data(DATA_KEY$a, data);
  3510. }
  3511. if (typeof config === 'string') {
  3512. if (typeof data[config] === 'undefined') {
  3513. throw new TypeError("No method named \"" + config + "\"");
  3514. }
  3515. data[config](this);
  3516. }
  3517. });
  3518. };
  3519. _createClass(Toast, null, [{
  3520. key: "VERSION",
  3521. get: function get() {
  3522. return VERSION$a;
  3523. }
  3524. }, {
  3525. key: "DefaultType",
  3526. get: function get() {
  3527. return DefaultType$7;
  3528. }
  3529. }, {
  3530. key: "Default",
  3531. get: function get() {
  3532. return Default$7;
  3533. }
  3534. }]);
  3535. return Toast;
  3536. }();
  3537. /**
  3538. * ------------------------------------------------------------------------
  3539. * jQuery
  3540. * ------------------------------------------------------------------------
  3541. */
  3542. $__default['default'].fn[NAME$a] = Toast._jQueryInterface;
  3543. $__default['default'].fn[NAME$a].Constructor = Toast;
  3544. $__default['default'].fn[NAME$a].noConflict = function () {
  3545. $__default['default'].fn[NAME$a] = JQUERY_NO_CONFLICT$a;
  3546. return Toast._jQueryInterface;
  3547. };
  3548. exports.Alert = Alert;
  3549. exports.Button = Button;
  3550. exports.Carousel = Carousel;
  3551. exports.Collapse = Collapse;
  3552. exports.Dropdown = Dropdown;
  3553. exports.Modal = Modal;
  3554. exports.Popover = Popover;
  3555. exports.Scrollspy = ScrollSpy;
  3556. exports.Tab = Tab;
  3557. exports.Toast = Toast;
  3558. exports.Tooltip = Tooltip;
  3559. exports.Util = Util;
  3560. Object.defineProperty(exports, '__esModule', { value: true });
  3561. })));
  3562. //# sourceMappingURL=bootstrap.js.map