bootstrap.js 163 KB

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