Keine Beschreibung
Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

bootstrap.js 142KB

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