bootstrap.bundle.js 256 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960
  1. /*!
  2. * Bootstrap v4.3.1 (https://getbootstrap.com/)
  3. * Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
  4. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  5. */
  6. (function (global, factory) {
  7. typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('jquery')) :
  8. typeof define === 'function' && define.amd ? define(['exports', 'jquery'], factory) :
  9. (global = global || self, factory(global.bootstrap = {}, global.jQuery));
  10. }(this, function (exports, $) {
  11. 'use strict';
  12. $ = $ && $.hasOwnProperty('default') ? $['default'] : $;
  13. function _defineProperties(target, props) {
  14. for (var i = 0; i < props.length; i++) {
  15. var descriptor = props[i];
  16. descriptor.enumerable = descriptor.enumerable || false;
  17. descriptor.configurable = true;
  18. if ("value" in descriptor) descriptor.writable = true;
  19. Object.defineProperty(target, descriptor.key, descriptor);
  20. }
  21. }
  22. function _createClass(Constructor, protoProps, staticProps) {
  23. if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  24. if (staticProps) _defineProperties(Constructor, staticProps);
  25. return Constructor;
  26. }
  27. function _defineProperty(obj, key, value) {
  28. if (key in obj) {
  29. Object.defineProperty(obj, key, {
  30. value: value,
  31. enumerable: true,
  32. configurable: true,
  33. writable: true
  34. });
  35. } else {
  36. obj[key] = value;
  37. }
  38. return obj;
  39. }
  40. function _objectSpread(target) {
  41. for (var i = 1; i < arguments.length; i++) {
  42. var source = arguments[i] != null ? arguments[i] : {};
  43. var ownKeys = Object.keys(source);
  44. if (typeof Object.getOwnPropertySymbols === 'function') {
  45. ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {
  46. return Object.getOwnPropertyDescriptor(source, sym).enumerable;
  47. }));
  48. }
  49. ownKeys.forEach(function (key) {
  50. _defineProperty(target, key, source[key]);
  51. });
  52. }
  53. return target;
  54. }
  55. function _inheritsLoose(subClass, superClass) {
  56. subClass.prototype = Object.create(superClass.prototype);
  57. subClass.prototype.constructor = subClass;
  58. subClass.__proto__ = superClass;
  59. }
  60. /**
  61. * --------------------------------------------------------------------------
  62. * Bootstrap (v4.3.1): util.js
  63. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  64. * --------------------------------------------------------------------------
  65. */
  66. /**
  67. * ------------------------------------------------------------------------
  68. * Private TransitionEnd Helpers
  69. * ------------------------------------------------------------------------
  70. */
  71. var TRANSITION_END = 'transitionend';
  72. var MAX_UID = 1000000;
  73. var MILLISECONDS_MULTIPLIER = 1000; // Shoutout AngusCroll (https://goo.gl/pxwQGp)
  74. function toType(obj) {
  75. return {}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase();
  76. }
  77. function getSpecialTransitionEndEvent() {
  78. return {
  79. bindType: TRANSITION_END,
  80. delegateType: TRANSITION_END,
  81. handle: function handle(event) {
  82. if ($(event.target).is(this)) {
  83. return event.handleObj.handler.apply(this, arguments); // eslint-disable-line prefer-rest-params
  84. }
  85. return undefined; // eslint-disable-line no-undefined
  86. }
  87. };
  88. }
  89. function transitionEndEmulator(duration) {
  90. var _this = this;
  91. var called = false;
  92. $(this).one(Util.TRANSITION_END, function () {
  93. called = true;
  94. });
  95. setTimeout(function () {
  96. if (!called) {
  97. Util.triggerTransitionEnd(_this);
  98. }
  99. }, duration);
  100. return this;
  101. }
  102. function setTransitionEndSupport() {
  103. $.fn.emulateTransitionEnd = transitionEndEmulator;
  104. $.event.special[Util.TRANSITION_END] = getSpecialTransitionEndEvent();
  105. }
  106. /**
  107. * --------------------------------------------------------------------------
  108. * Public Util Api
  109. * --------------------------------------------------------------------------
  110. */
  111. var Util = {
  112. TRANSITION_END: 'bsTransitionEnd',
  113. getUID: function getUID(prefix) {
  114. do {
  115. // eslint-disable-next-line no-bitwise
  116. prefix += ~~(Math.random() * MAX_UID); // "~~" acts like a faster Math.floor() here
  117. } while (document.getElementById(prefix));
  118. return prefix;
  119. },
  120. getSelectorFromElement: function getSelectorFromElement(element) {
  121. var selector = element.getAttribute('data-target');
  122. if (!selector || selector === '#') {
  123. var hrefAttr = element.getAttribute('href');
  124. selector = hrefAttr && hrefAttr !== '#' ? hrefAttr.trim() : '';
  125. }
  126. try {
  127. return document.querySelector(selector) ? selector : null;
  128. } catch (err) {
  129. return null;
  130. }
  131. },
  132. getTransitionDurationFromElement: function getTransitionDurationFromElement(element) {
  133. if (!element) {
  134. return 0;
  135. } // Get transition-duration of the element
  136. var transitionDuration = $(element).css('transition-duration');
  137. var transitionDelay = $(element).css('transition-delay');
  138. var floatTransitionDuration = parseFloat(transitionDuration);
  139. var floatTransitionDelay = parseFloat(transitionDelay); // Return 0 if element or transition duration is not found
  140. if (!floatTransitionDuration && !floatTransitionDelay) {
  141. return 0;
  142. } // If multiple durations are defined, take the first
  143. transitionDuration = transitionDuration.split(',')[0];
  144. transitionDelay = transitionDelay.split(',')[0];
  145. return (parseFloat(transitionDuration) + parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER;
  146. },
  147. reflow: function reflow(element) {
  148. return element.offsetHeight;
  149. },
  150. triggerTransitionEnd: function triggerTransitionEnd(element) {
  151. $(element).trigger(TRANSITION_END);
  152. },
  153. // TODO: Remove in v5
  154. supportsTransitionEnd: function supportsTransitionEnd() {
  155. return Boolean(TRANSITION_END);
  156. },
  157. isElement: function isElement(obj) {
  158. return (obj[0] || obj).nodeType;
  159. },
  160. typeCheckConfig: function typeCheckConfig(componentName, config, configTypes) {
  161. for (var property in configTypes) {
  162. if (Object.prototype.hasOwnProperty.call(configTypes, property)) {
  163. var expectedTypes = configTypes[property];
  164. var value = config[property];
  165. var valueType = value && Util.isElement(value) ? 'element' : toType(value);
  166. if (!new RegExp(expectedTypes).test(valueType)) {
  167. throw new Error(componentName.toUpperCase() + ": " + ("Option \"" + property + "\" provided type \"" + valueType + "\" ") + ("but expected type \"" + expectedTypes + "\"."));
  168. }
  169. }
  170. }
  171. },
  172. findShadowRoot: function findShadowRoot(element) {
  173. if (!document.documentElement.attachShadow) {
  174. return null;
  175. } // Can find the shadow root otherwise it'll return the document
  176. if (typeof element.getRootNode === 'function') {
  177. var root = element.getRootNode();
  178. return root instanceof ShadowRoot ? root : null;
  179. }
  180. if (element instanceof ShadowRoot) {
  181. return element;
  182. } // when we don't find a shadow root
  183. if (!element.parentNode) {
  184. return null;
  185. }
  186. return Util.findShadowRoot(element.parentNode);
  187. }
  188. };
  189. setTransitionEndSupport();
  190. /**
  191. * ------------------------------------------------------------------------
  192. * Constants
  193. * ------------------------------------------------------------------------
  194. */
  195. var NAME = 'alert';
  196. var VERSION = '4.3.1';
  197. var DATA_KEY = 'bs.alert';
  198. var EVENT_KEY = "." + DATA_KEY;
  199. var DATA_API_KEY = '.data-api';
  200. var JQUERY_NO_CONFLICT = $.fn[NAME];
  201. var Selector = {
  202. DISMISS: '[data-dismiss="alert"]'
  203. };
  204. var Event = {
  205. CLOSE: "close" + EVENT_KEY,
  206. CLOSED: "closed" + EVENT_KEY,
  207. CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY
  208. };
  209. var ClassName = {
  210. ALERT: 'alert',
  211. FADE: 'fade',
  212. SHOW: 'show'
  213. /**
  214. * ------------------------------------------------------------------------
  215. * Class Definition
  216. * ------------------------------------------------------------------------
  217. */
  218. };
  219. var Alert =
  220. /*#__PURE__*/
  221. function () {
  222. function Alert(element) {
  223. this._element = element;
  224. } // Getters
  225. var _proto = Alert.prototype;
  226. // Public
  227. _proto.close = function close(element) {
  228. var rootElement = this._element;
  229. if (element) {
  230. rootElement = this._getRootElement(element);
  231. }
  232. var customEvent = this._triggerCloseEvent(rootElement);
  233. if (customEvent.isDefaultPrevented()) {
  234. return;
  235. }
  236. this._removeElement(rootElement);
  237. };
  238. _proto.dispose = function dispose() {
  239. $.removeData(this._element, DATA_KEY);
  240. this._element = null;
  241. } // Private
  242. ;
  243. _proto._getRootElement = function _getRootElement(element) {
  244. var selector = Util.getSelectorFromElement(element);
  245. var parent = false;
  246. if (selector) {
  247. parent = document.querySelector(selector);
  248. }
  249. if (!parent) {
  250. parent = $(element).closest("." + ClassName.ALERT)[0];
  251. }
  252. return parent;
  253. };
  254. _proto._triggerCloseEvent = function _triggerCloseEvent(element) {
  255. var closeEvent = $.Event(Event.CLOSE);
  256. $(element).trigger(closeEvent);
  257. return closeEvent;
  258. };
  259. _proto._removeElement = function _removeElement(element) {
  260. var _this = this;
  261. $(element).removeClass(ClassName.SHOW);
  262. if (!$(element).hasClass(ClassName.FADE)) {
  263. this._destroyElement(element);
  264. return;
  265. }
  266. var transitionDuration = Util.getTransitionDurationFromElement(element);
  267. $(element).one(Util.TRANSITION_END, function (event) {
  268. return _this._destroyElement(element, event);
  269. }).emulateTransitionEnd(transitionDuration);
  270. };
  271. _proto._destroyElement = function _destroyElement(element) {
  272. $(element).detach().trigger(Event.CLOSED).remove();
  273. } // Static
  274. ;
  275. Alert._jQueryInterface = function _jQueryInterface(config) {
  276. return this.each(function () {
  277. var $element = $(this);
  278. var data = $element.data(DATA_KEY);
  279. if (!data) {
  280. data = new Alert(this);
  281. $element.data(DATA_KEY, data);
  282. }
  283. if (config === 'close') {
  284. data[config](this);
  285. }
  286. });
  287. };
  288. Alert._handleDismiss = function _handleDismiss(alertInstance) {
  289. return function (event) {
  290. if (event) {
  291. event.preventDefault();
  292. }
  293. alertInstance.close(this);
  294. };
  295. };
  296. _createClass(Alert, null, [{
  297. key: "VERSION",
  298. get: function get() {
  299. return VERSION;
  300. }
  301. }]);
  302. return Alert;
  303. }();
  304. /**
  305. * ------------------------------------------------------------------------
  306. * Data Api implementation
  307. * ------------------------------------------------------------------------
  308. */
  309. $(document).on(Event.CLICK_DATA_API, Selector.DISMISS, Alert._handleDismiss(new Alert()));
  310. /**
  311. * ------------------------------------------------------------------------
  312. * jQuery
  313. * ------------------------------------------------------------------------
  314. */
  315. $.fn[NAME] = Alert._jQueryInterface;
  316. $.fn[NAME].Constructor = Alert;
  317. $.fn[NAME].noConflict = function () {
  318. $.fn[NAME] = JQUERY_NO_CONFLICT;
  319. return Alert._jQueryInterface;
  320. };
  321. /**
  322. * ------------------------------------------------------------------------
  323. * Constants
  324. * ------------------------------------------------------------------------
  325. */
  326. var NAME$1 = 'button';
  327. var VERSION$1 = '4.3.1';
  328. var DATA_KEY$1 = 'bs.button';
  329. var EVENT_KEY$1 = "." + DATA_KEY$1;
  330. var DATA_API_KEY$1 = '.data-api';
  331. var JQUERY_NO_CONFLICT$1 = $.fn[NAME$1];
  332. var ClassName$1 = {
  333. ACTIVE: 'active',
  334. BUTTON: 'btn',
  335. FOCUS: 'focus'
  336. };
  337. var Selector$1 = {
  338. DATA_TOGGLE_CARROT: '[data-toggle^="button"]',
  339. DATA_TOGGLE: '[data-toggle="buttons"]',
  340. INPUT: 'input:not([type="hidden"])',
  341. ACTIVE: '.active',
  342. BUTTON: '.btn'
  343. };
  344. var Event$1 = {
  345. CLICK_DATA_API: "click" + EVENT_KEY$1 + DATA_API_KEY$1,
  346. FOCUS_BLUR_DATA_API: "focus" + EVENT_KEY$1 + DATA_API_KEY$1 + " " + ("blur" + EVENT_KEY$1 + DATA_API_KEY$1)
  347. /**
  348. * ------------------------------------------------------------------------
  349. * Class Definition
  350. * ------------------------------------------------------------------------
  351. */
  352. };
  353. var Button =
  354. /*#__PURE__*/
  355. function () {
  356. function Button(element) {
  357. this._element = element;
  358. } // Getters
  359. var _proto = Button.prototype;
  360. // Public
  361. _proto.toggle = function toggle() {
  362. var triggerChangeEvent = true;
  363. var addAriaPressed = true;
  364. var rootElement = $(this._element).closest(Selector$1.DATA_TOGGLE)[0];
  365. if (rootElement) {
  366. var input = this._element.querySelector(Selector$1.INPUT);
  367. if (input) {
  368. if (input.type === 'radio') {
  369. if (input.checked && this._element.classList.contains(ClassName$1.ACTIVE)) {
  370. triggerChangeEvent = false;
  371. } else {
  372. var activeElement = rootElement.querySelector(Selector$1.ACTIVE);
  373. if (activeElement) {
  374. $(activeElement).removeClass(ClassName$1.ACTIVE);
  375. }
  376. }
  377. }
  378. if (triggerChangeEvent) {
  379. if (input.hasAttribute('disabled') || rootElement.hasAttribute('disabled') || input.classList.contains('disabled') || rootElement.classList.contains('disabled')) {
  380. return;
  381. }
  382. input.checked = !this._element.classList.contains(ClassName$1.ACTIVE);
  383. $(input).trigger('change');
  384. }
  385. input.focus();
  386. addAriaPressed = false;
  387. }
  388. }
  389. if (addAriaPressed) {
  390. this._element.setAttribute('aria-pressed', !this._element.classList.contains(ClassName$1.ACTIVE));
  391. }
  392. if (triggerChangeEvent) {
  393. $(this._element).toggleClass(ClassName$1.ACTIVE);
  394. }
  395. };
  396. _proto.dispose = function dispose() {
  397. $.removeData(this._element, DATA_KEY$1);
  398. this._element = null;
  399. } // Static
  400. ;
  401. Button._jQueryInterface = function _jQueryInterface(config) {
  402. return this.each(function () {
  403. var data = $(this).data(DATA_KEY$1);
  404. if (!data) {
  405. data = new Button(this);
  406. $(this).data(DATA_KEY$1, data);
  407. }
  408. if (config === 'toggle') {
  409. data[config]();
  410. }
  411. });
  412. };
  413. _createClass(Button, null, [{
  414. key: "VERSION",
  415. get: function get() {
  416. return VERSION$1;
  417. }
  418. }]);
  419. return Button;
  420. }();
  421. /**
  422. * ------------------------------------------------------------------------
  423. * Data Api implementation
  424. * ------------------------------------------------------------------------
  425. */
  426. $(document).on(Event$1.CLICK_DATA_API, Selector$1.DATA_TOGGLE_CARROT, function (event) {
  427. event.preventDefault();
  428. var button = event.target;
  429. if (!$(button).hasClass(ClassName$1.BUTTON)) {
  430. button = $(button).closest(Selector$1.BUTTON);
  431. }
  432. Button._jQueryInterface.call($(button), 'toggle');
  433. }).on(Event$1.FOCUS_BLUR_DATA_API, Selector$1.DATA_TOGGLE_CARROT, function (event) {
  434. var button = $(event.target).closest(Selector$1.BUTTON)[0];
  435. $(button).toggleClass(ClassName$1.FOCUS, /^focus(in)?$/.test(event.type));
  436. });
  437. /**
  438. * ------------------------------------------------------------------------
  439. * jQuery
  440. * ------------------------------------------------------------------------
  441. */
  442. $.fn[NAME$1] = Button._jQueryInterface;
  443. $.fn[NAME$1].Constructor = Button;
  444. $.fn[NAME$1].noConflict = function () {
  445. $.fn[NAME$1] = JQUERY_NO_CONFLICT$1;
  446. return Button._jQueryInterface;
  447. };
  448. /**
  449. * ------------------------------------------------------------------------
  450. * Constants
  451. * ------------------------------------------------------------------------
  452. */
  453. var NAME$2 = 'carousel';
  454. var VERSION$2 = '4.3.1';
  455. var DATA_KEY$2 = 'bs.carousel';
  456. var EVENT_KEY$2 = "." + DATA_KEY$2;
  457. var DATA_API_KEY$2 = '.data-api';
  458. var JQUERY_NO_CONFLICT$2 = $.fn[NAME$2];
  459. var ARROW_LEFT_KEYCODE = 37; // KeyboardEvent.which value for left arrow key
  460. var ARROW_RIGHT_KEYCODE = 39; // KeyboardEvent.which value for right arrow key
  461. var TOUCHEVENT_COMPAT_WAIT = 500; // Time for mouse compat events to fire after touch
  462. var SWIPE_THRESHOLD = 40;
  463. var Default = {
  464. interval: 5000,
  465. keyboard: true,
  466. slide: false,
  467. pause: 'hover',
  468. wrap: true,
  469. touch: true
  470. };
  471. var DefaultType = {
  472. interval: '(number|boolean)',
  473. keyboard: 'boolean',
  474. slide: '(boolean|string)',
  475. pause: '(string|boolean)',
  476. wrap: 'boolean',
  477. touch: 'boolean'
  478. };
  479. var Direction = {
  480. NEXT: 'next',
  481. PREV: 'prev',
  482. LEFT: 'left',
  483. RIGHT: 'right'
  484. };
  485. var Event$2 = {
  486. SLIDE: "slide" + EVENT_KEY$2,
  487. SLID: "slid" + EVENT_KEY$2,
  488. KEYDOWN: "keydown" + EVENT_KEY$2,
  489. MOUSEENTER: "mouseenter" + EVENT_KEY$2,
  490. MOUSELEAVE: "mouseleave" + EVENT_KEY$2,
  491. TOUCHSTART: "touchstart" + EVENT_KEY$2,
  492. TOUCHMOVE: "touchmove" + EVENT_KEY$2,
  493. TOUCHEND: "touchend" + EVENT_KEY$2,
  494. POINTERDOWN: "pointerdown" + EVENT_KEY$2,
  495. POINTERUP: "pointerup" + EVENT_KEY$2,
  496. DRAG_START: "dragstart" + EVENT_KEY$2,
  497. LOAD_DATA_API: "load" + EVENT_KEY$2 + DATA_API_KEY$2,
  498. CLICK_DATA_API: "click" + EVENT_KEY$2 + DATA_API_KEY$2
  499. };
  500. var ClassName$2 = {
  501. CAROUSEL: 'carousel',
  502. ACTIVE: 'active',
  503. SLIDE: 'slide',
  504. RIGHT: 'carousel-item-right',
  505. LEFT: 'carousel-item-left',
  506. NEXT: 'carousel-item-next',
  507. PREV: 'carousel-item-prev',
  508. ITEM: 'carousel-item',
  509. POINTER_EVENT: 'pointer-event'
  510. };
  511. var Selector$2 = {
  512. ACTIVE: '.active',
  513. ACTIVE_ITEM: '.active.carousel-item',
  514. ITEM: '.carousel-item',
  515. ITEM_IMG: '.carousel-item img',
  516. NEXT_PREV: '.carousel-item-next, .carousel-item-prev',
  517. INDICATORS: '.carousel-indicators',
  518. DATA_SLIDE: '[data-slide], [data-slide-to]',
  519. DATA_RIDE: '[data-ride="carousel"]'
  520. };
  521. var PointerType = {
  522. TOUCH: 'touch',
  523. PEN: 'pen'
  524. /**
  525. * ------------------------------------------------------------------------
  526. * Class Definition
  527. * ------------------------------------------------------------------------
  528. */
  529. };
  530. var Carousel =
  531. /*#__PURE__*/
  532. function () {
  533. function Carousel(element, config) {
  534. this._items = null;
  535. this._interval = null;
  536. this._activeElement = null;
  537. this._isPaused = false;
  538. this._isSliding = false;
  539. this.touchTimeout = null;
  540. this.touchStartX = 0;
  541. this.touchDeltaX = 0;
  542. this._config = this._getConfig(config);
  543. this._element = element;
  544. this._indicatorsElement = this._element.querySelector(Selector$2.INDICATORS);
  545. this._touchSupported = 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0;
  546. this._pointerEvent = Boolean(window.PointerEvent || window.MSPointerEvent);
  547. this._addEventListeners();
  548. } // Getters
  549. var _proto = Carousel.prototype;
  550. // Public
  551. _proto.next = function next() {
  552. if (!this._isSliding) {
  553. this._slide(Direction.NEXT);
  554. }
  555. };
  556. _proto.nextWhenVisible = function nextWhenVisible() {
  557. // Don't call next when the page isn't visible
  558. // or the carousel or its parent isn't visible
  559. if (!document.hidden && $(this._element).is(':visible') && $(this._element).css('visibility') !== 'hidden') {
  560. this.next();
  561. }
  562. };
  563. _proto.prev = function prev() {
  564. if (!this._isSliding) {
  565. this._slide(Direction.PREV);
  566. }
  567. };
  568. _proto.pause = function pause(event) {
  569. if (!event) {
  570. this._isPaused = true;
  571. }
  572. if (this._element.querySelector(Selector$2.NEXT_PREV)) {
  573. Util.triggerTransitionEnd(this._element);
  574. this.cycle(true);
  575. }
  576. clearInterval(this._interval);
  577. this._interval = null;
  578. };
  579. _proto.cycle = function cycle(event) {
  580. if (!event) {
  581. this._isPaused = false;
  582. }
  583. if (this._interval) {
  584. clearInterval(this._interval);
  585. this._interval = null;
  586. }
  587. if (this._config.interval && !this._isPaused) {
  588. this._interval = setInterval((document.visibilityState ? this.nextWhenVisible : this.next).bind(this), this._config.interval);
  589. }
  590. };
  591. _proto.to = function to(index) {
  592. var _this = this;
  593. this._activeElement = this._element.querySelector(Selector$2.ACTIVE_ITEM);
  594. var activeIndex = this._getItemIndex(this._activeElement);
  595. if (index > this._items.length - 1 || index < 0) {
  596. return;
  597. }
  598. if (this._isSliding) {
  599. $(this._element).one(Event$2.SLID, function () {
  600. return _this.to(index);
  601. });
  602. return;
  603. }
  604. if (activeIndex === index) {
  605. this.pause();
  606. this.cycle();
  607. return;
  608. }
  609. var direction = index > activeIndex ? Direction.NEXT : Direction.PREV;
  610. this._slide(direction, this._items[index]);
  611. };
  612. _proto.dispose = function dispose() {
  613. $(this._element).off(EVENT_KEY$2);
  614. $.removeData(this._element, DATA_KEY$2);
  615. this._items = null;
  616. this._config = null;
  617. this._element = null;
  618. this._interval = null;
  619. this._isPaused = null;
  620. this._isSliding = null;
  621. this._activeElement = null;
  622. this._indicatorsElement = null;
  623. } // Private
  624. ;
  625. _proto._getConfig = function _getConfig(config) {
  626. config = _objectSpread({}, Default, config);
  627. Util.typeCheckConfig(NAME$2, config, DefaultType);
  628. return config;
  629. };
  630. _proto._handleSwipe = function _handleSwipe() {
  631. var absDeltax = Math.abs(this.touchDeltaX);
  632. if (absDeltax <= SWIPE_THRESHOLD) {
  633. return;
  634. }
  635. var direction = absDeltax / this.touchDeltaX; // swipe left
  636. if (direction > 0) {
  637. this.prev();
  638. } // swipe right
  639. if (direction < 0) {
  640. this.next();
  641. }
  642. };
  643. _proto._addEventListeners = function _addEventListeners() {
  644. var _this2 = this;
  645. if (this._config.keyboard) {
  646. $(this._element).on(Event$2.KEYDOWN, function (event) {
  647. return _this2._keydown(event);
  648. });
  649. }
  650. if (this._config.pause === 'hover') {
  651. $(this._element).on(Event$2.MOUSEENTER, function (event) {
  652. return _this2.pause(event);
  653. }).on(Event$2.MOUSELEAVE, function (event) {
  654. return _this2.cycle(event);
  655. });
  656. }
  657. if (this._config.touch) {
  658. this._addTouchEventListeners();
  659. }
  660. };
  661. _proto._addTouchEventListeners = function _addTouchEventListeners() {
  662. var _this3 = this;
  663. if (!this._touchSupported) {
  664. return;
  665. }
  666. var start = function start(event) {
  667. if (_this3._pointerEvent && PointerType[event.originalEvent.pointerType.toUpperCase()]) {
  668. _this3.touchStartX = event.originalEvent.clientX;
  669. } else if (!_this3._pointerEvent) {
  670. _this3.touchStartX = event.originalEvent.touches[0].clientX;
  671. }
  672. };
  673. var move = function move(event) {
  674. // ensure swiping with one touch and not pinching
  675. if (event.originalEvent.touches && event.originalEvent.touches.length > 1) {
  676. _this3.touchDeltaX = 0;
  677. } else {
  678. _this3.touchDeltaX = event.originalEvent.touches[0].clientX - _this3.touchStartX;
  679. }
  680. };
  681. var end = function end(event) {
  682. if (_this3._pointerEvent && PointerType[event.originalEvent.pointerType.toUpperCase()]) {
  683. _this3.touchDeltaX = event.originalEvent.clientX - _this3.touchStartX;
  684. }
  685. _this3._handleSwipe();
  686. if (_this3._config.pause === 'hover') {
  687. // If it's a touch-enabled device, mouseenter/leave are fired as
  688. // part of the mouse compatibility events on first tap - the carousel
  689. // would stop cycling until user tapped out of it;
  690. // here, we listen for touchend, explicitly pause the carousel
  691. // (as if it's the second time we tap on it, mouseenter compat event
  692. // is NOT fired) and after a timeout (to allow for mouse compatibility
  693. // events to fire) we explicitly restart cycling
  694. _this3.pause();
  695. if (_this3.touchTimeout) {
  696. clearTimeout(_this3.touchTimeout);
  697. }
  698. _this3.touchTimeout = setTimeout(function (event) {
  699. return _this3.cycle(event);
  700. }, TOUCHEVENT_COMPAT_WAIT + _this3._config.interval);
  701. }
  702. };
  703. $(this._element.querySelectorAll(Selector$2.ITEM_IMG)).on(Event$2.DRAG_START, function (e) {
  704. return e.preventDefault();
  705. });
  706. if (this._pointerEvent) {
  707. $(this._element).on(Event$2.POINTERDOWN, function (event) {
  708. return start(event);
  709. });
  710. $(this._element).on(Event$2.POINTERUP, function (event) {
  711. return end(event);
  712. });
  713. this._element.classList.add(ClassName$2.POINTER_EVENT);
  714. } else {
  715. $(this._element).on(Event$2.TOUCHSTART, function (event) {
  716. return start(event);
  717. });
  718. $(this._element).on(Event$2.TOUCHMOVE, function (event) {
  719. return move(event);
  720. });
  721. $(this._element).on(Event$2.TOUCHEND, function (event) {
  722. return end(event);
  723. });
  724. }
  725. };
  726. _proto._keydown = function _keydown(event) {
  727. if (/input|textarea/i.test(event.target.tagName)) {
  728. return;
  729. }
  730. switch (event.which) {
  731. case ARROW_LEFT_KEYCODE:
  732. event.preventDefault();
  733. this.prev();
  734. break;
  735. case ARROW_RIGHT_KEYCODE:
  736. event.preventDefault();
  737. this.next();
  738. break;
  739. default:
  740. }
  741. };
  742. _proto._getItemIndex = function _getItemIndex(element) {
  743. this._items = element && element.parentNode ? [].slice.call(element.parentNode.querySelectorAll(Selector$2.ITEM)) : [];
  744. return this._items.indexOf(element);
  745. };
  746. _proto._getItemByDirection = function _getItemByDirection(direction, activeElement) {
  747. var isNextDirection = direction === Direction.NEXT;
  748. var isPrevDirection = direction === Direction.PREV;
  749. var activeIndex = this._getItemIndex(activeElement);
  750. var lastItemIndex = this._items.length - 1;
  751. var isGoingToWrap = isPrevDirection && activeIndex === 0 || isNextDirection && activeIndex === lastItemIndex;
  752. if (isGoingToWrap && !this._config.wrap) {
  753. return activeElement;
  754. }
  755. var delta = direction === Direction.PREV ? -1 : 1;
  756. var itemIndex = (activeIndex + delta) % this._items.length;
  757. return itemIndex === -1 ? this._items[this._items.length - 1] : this._items[itemIndex];
  758. };
  759. _proto._triggerSlideEvent = function _triggerSlideEvent(relatedTarget, eventDirectionName) {
  760. var targetIndex = this._getItemIndex(relatedTarget);
  761. var fromIndex = this._getItemIndex(this._element.querySelector(Selector$2.ACTIVE_ITEM));
  762. var slideEvent = $.Event(Event$2.SLIDE, {
  763. relatedTarget: relatedTarget,
  764. direction: eventDirectionName,
  765. from: fromIndex,
  766. to: targetIndex
  767. });
  768. $(this._element).trigger(slideEvent);
  769. return slideEvent;
  770. };
  771. _proto._setActiveIndicatorElement = function _setActiveIndicatorElement(element) {
  772. if (this._indicatorsElement) {
  773. var indicators = [].slice.call(this._indicatorsElement.querySelectorAll(Selector$2.ACTIVE));
  774. $(indicators).removeClass(ClassName$2.ACTIVE);
  775. var nextIndicator = this._indicatorsElement.children[this._getItemIndex(element)];
  776. if (nextIndicator) {
  777. $(nextIndicator).addClass(ClassName$2.ACTIVE);
  778. }
  779. }
  780. };
  781. _proto._slide = function _slide(direction, element) {
  782. var _this4 = this;
  783. var activeElement = this._element.querySelector(Selector$2.ACTIVE_ITEM);
  784. var activeElementIndex = this._getItemIndex(activeElement);
  785. var nextElement = element || activeElement && this._getItemByDirection(direction, activeElement);
  786. var nextElementIndex = this._getItemIndex(nextElement);
  787. var isCycling = Boolean(this._interval);
  788. var directionalClassName;
  789. var orderClassName;
  790. var eventDirectionName;
  791. if (direction === Direction.NEXT) {
  792. directionalClassName = ClassName$2.LEFT;
  793. orderClassName = ClassName$2.NEXT;
  794. eventDirectionName = Direction.LEFT;
  795. } else {
  796. directionalClassName = ClassName$2.RIGHT;
  797. orderClassName = ClassName$2.PREV;
  798. eventDirectionName = Direction.RIGHT;
  799. }
  800. if (nextElement && $(nextElement).hasClass(ClassName$2.ACTIVE)) {
  801. this._isSliding = false;
  802. return;
  803. }
  804. var slideEvent = this._triggerSlideEvent(nextElement, eventDirectionName);
  805. if (slideEvent.isDefaultPrevented()) {
  806. return;
  807. }
  808. if (!activeElement || !nextElement) {
  809. // Some weirdness is happening, so we bail
  810. return;
  811. }
  812. this._isSliding = true;
  813. if (isCycling) {
  814. this.pause();
  815. }
  816. this._setActiveIndicatorElement(nextElement);
  817. var slidEvent = $.Event(Event$2.SLID, {
  818. relatedTarget: nextElement,
  819. direction: eventDirectionName,
  820. from: activeElementIndex,
  821. to: nextElementIndex
  822. });
  823. if ($(this._element).hasClass(ClassName$2.SLIDE)) {
  824. $(nextElement).addClass(orderClassName);
  825. Util.reflow(nextElement);
  826. $(activeElement).addClass(directionalClassName);
  827. $(nextElement).addClass(directionalClassName);
  828. var nextElementInterval = parseInt(nextElement.getAttribute('data-interval'), 10);
  829. if (nextElementInterval) {
  830. this._config.defaultInterval = this._config.defaultInterval || this._config.interval;
  831. this._config.interval = nextElementInterval;
  832. } else {
  833. this._config.interval = this._config.defaultInterval || this._config.interval;
  834. }
  835. var transitionDuration = Util.getTransitionDurationFromElement(activeElement);
  836. $(activeElement).one(Util.TRANSITION_END, function () {
  837. $(nextElement).removeClass(directionalClassName + " " + orderClassName).addClass(ClassName$2.ACTIVE);
  838. $(activeElement).removeClass(ClassName$2.ACTIVE + " " + orderClassName + " " + directionalClassName);
  839. _this4._isSliding = false;
  840. setTimeout(function () {
  841. return $(_this4._element).trigger(slidEvent);
  842. }, 0);
  843. }).emulateTransitionEnd(transitionDuration);
  844. } else {
  845. $(activeElement).removeClass(ClassName$2.ACTIVE);
  846. $(nextElement).addClass(ClassName$2.ACTIVE);
  847. this._isSliding = false;
  848. $(this._element).trigger(slidEvent);
  849. }
  850. if (isCycling) {
  851. this.cycle();
  852. }
  853. } // Static
  854. ;
  855. Carousel._jQueryInterface = function _jQueryInterface(config) {
  856. return this.each(function () {
  857. var data = $(this).data(DATA_KEY$2);
  858. var _config = _objectSpread({}, Default, $(this).data());
  859. if (typeof config === 'object') {
  860. _config = _objectSpread({}, _config, config);
  861. }
  862. var action = typeof config === 'string' ? config : _config.slide;
  863. if (!data) {
  864. data = new Carousel(this, _config);
  865. $(this).data(DATA_KEY$2, data);
  866. }
  867. if (typeof config === 'number') {
  868. data.to(config);
  869. } else if (typeof action === 'string') {
  870. if (typeof data[action] === 'undefined') {
  871. throw new TypeError("No method named \"" + action + "\"");
  872. }
  873. data[action]();
  874. } else if (_config.interval && _config.ride) {
  875. data.pause();
  876. data.cycle();
  877. }
  878. });
  879. };
  880. Carousel._dataApiClickHandler = function _dataApiClickHandler(event) {
  881. var selector = Util.getSelectorFromElement(this);
  882. if (!selector) {
  883. return;
  884. }
  885. var target = $(selector)[0];
  886. if (!target || !$(target).hasClass(ClassName$2.CAROUSEL)) {
  887. return;
  888. }
  889. var config = _objectSpread({}, $(target).data(), $(this).data());
  890. var slideIndex = this.getAttribute('data-slide-to');
  891. if (slideIndex) {
  892. config.interval = false;
  893. }
  894. Carousel._jQueryInterface.call($(target), config);
  895. if (slideIndex) {
  896. $(target).data(DATA_KEY$2).to(slideIndex);
  897. }
  898. event.preventDefault();
  899. };
  900. _createClass(Carousel, null, [{
  901. key: "VERSION",
  902. get: function get() {
  903. return VERSION$2;
  904. }
  905. }, {
  906. key: "Default",
  907. get: function get() {
  908. return Default;
  909. }
  910. }]);
  911. return Carousel;
  912. }();
  913. /**
  914. * ------------------------------------------------------------------------
  915. * Data Api implementation
  916. * ------------------------------------------------------------------------
  917. */
  918. $(document).on(Event$2.CLICK_DATA_API, Selector$2.DATA_SLIDE, Carousel._dataApiClickHandler);
  919. $(window).on(Event$2.LOAD_DATA_API, function () {
  920. var carousels = [].slice.call(document.querySelectorAll(Selector$2.DATA_RIDE));
  921. for (var i = 0, len = carousels.length; i < len; i++) {
  922. var $carousel = $(carousels[i]);
  923. Carousel._jQueryInterface.call($carousel, $carousel.data());
  924. }
  925. });
  926. /**
  927. * ------------------------------------------------------------------------
  928. * jQuery
  929. * ------------------------------------------------------------------------
  930. */
  931. $.fn[NAME$2] = Carousel._jQueryInterface;
  932. $.fn[NAME$2].Constructor = Carousel;
  933. $.fn[NAME$2].noConflict = function () {
  934. $.fn[NAME$2] = JQUERY_NO_CONFLICT$2;
  935. return Carousel._jQueryInterface;
  936. };
  937. /**
  938. * ------------------------------------------------------------------------
  939. * Constants
  940. * ------------------------------------------------------------------------
  941. */
  942. var NAME$3 = 'collapse';
  943. var VERSION$3 = '4.3.1';
  944. var DATA_KEY$3 = 'bs.collapse';
  945. var EVENT_KEY$3 = "." + DATA_KEY$3;
  946. var DATA_API_KEY$3 = '.data-api';
  947. var JQUERY_NO_CONFLICT$3 = $.fn[NAME$3];
  948. var Default$1 = {
  949. toggle: true,
  950. parent: ''
  951. };
  952. var DefaultType$1 = {
  953. toggle: 'boolean',
  954. parent: '(string|element)'
  955. };
  956. var Event$3 = {
  957. SHOW: "show" + EVENT_KEY$3,
  958. SHOWN: "shown" + EVENT_KEY$3,
  959. HIDE: "hide" + EVENT_KEY$3,
  960. HIDDEN: "hidden" + EVENT_KEY$3,
  961. CLICK_DATA_API: "click" + EVENT_KEY$3 + DATA_API_KEY$3
  962. };
  963. var ClassName$3 = {
  964. SHOW: 'show',
  965. COLLAPSE: 'collapse',
  966. COLLAPSING: 'collapsing',
  967. COLLAPSED: 'collapsed'
  968. };
  969. var Dimension = {
  970. WIDTH: 'width',
  971. HEIGHT: 'height'
  972. };
  973. var Selector$3 = {
  974. ACTIVES: '.show, .collapsing',
  975. DATA_TOGGLE: '[data-toggle="collapse"]'
  976. /**
  977. * ------------------------------------------------------------------------
  978. * Class Definition
  979. * ------------------------------------------------------------------------
  980. */
  981. };
  982. var Collapse =
  983. /*#__PURE__*/
  984. function () {
  985. function Collapse(element, config) {
  986. this._isTransitioning = false;
  987. this._element = element;
  988. this._config = this._getConfig(config);
  989. this._triggerArray = [].slice.call(document.querySelectorAll("[data-toggle=\"collapse\"][href=\"#" + element.id + "\"]," + ("[data-toggle=\"collapse\"][data-target=\"#" + element.id + "\"]")));
  990. var toggleList = [].slice.call(document.querySelectorAll(Selector$3.DATA_TOGGLE));
  991. for (var i = 0, len = toggleList.length; i < len; i++) {
  992. var elem = toggleList[i];
  993. var selector = Util.getSelectorFromElement(elem);
  994. var filterElement = [].slice.call(document.querySelectorAll(selector)).filter(function (foundElem) {
  995. return foundElem === element;
  996. });
  997. if (selector !== null && filterElement.length > 0) {
  998. this._selector = selector;
  999. this._triggerArray.push(elem);
  1000. }
  1001. }
  1002. this._parent = this._config.parent ? this._getParent() : null;
  1003. if (!this._config.parent) {
  1004. this._addAriaAndCollapsedClass(this._element, this._triggerArray);
  1005. }
  1006. if (this._config.toggle) {
  1007. this.toggle();
  1008. }
  1009. } // Getters
  1010. var _proto = Collapse.prototype;
  1011. // Public
  1012. _proto.toggle = function toggle() {
  1013. if ($(this._element).hasClass(ClassName$3.SHOW)) {
  1014. this.hide();
  1015. } else {
  1016. this.show();
  1017. }
  1018. };
  1019. _proto.show = function show() {
  1020. var _this = this;
  1021. if (this._isTransitioning || $(this._element).hasClass(ClassName$3.SHOW)) {
  1022. return;
  1023. }
  1024. var actives;
  1025. var activesData;
  1026. if (this._parent) {
  1027. actives = [].slice.call(this._parent.querySelectorAll(Selector$3.ACTIVES)).filter(function (elem) {
  1028. if (typeof _this._config.parent === 'string') {
  1029. return elem.getAttribute('data-parent') === _this._config.parent;
  1030. }
  1031. return elem.classList.contains(ClassName$3.COLLAPSE);
  1032. });
  1033. if (actives.length === 0) {
  1034. actives = null;
  1035. }
  1036. }
  1037. if (actives) {
  1038. activesData = $(actives).not(this._selector).data(DATA_KEY$3);
  1039. if (activesData && activesData._isTransitioning) {
  1040. return;
  1041. }
  1042. }
  1043. var startEvent = $.Event(Event$3.SHOW);
  1044. $(this._element).trigger(startEvent);
  1045. if (startEvent.isDefaultPrevented()) {
  1046. return;
  1047. }
  1048. if (actives) {
  1049. Collapse._jQueryInterface.call($(actives).not(this._selector), 'hide');
  1050. if (!activesData) {
  1051. $(actives).data(DATA_KEY$3, null);
  1052. }
  1053. }
  1054. var dimension = this._getDimension();
  1055. $(this._element).removeClass(ClassName$3.COLLAPSE).addClass(ClassName$3.COLLAPSING);
  1056. this._element.style[dimension] = 0;
  1057. if (this._triggerArray.length) {
  1058. $(this._triggerArray).removeClass(ClassName$3.COLLAPSED).attr('aria-expanded', true);
  1059. }
  1060. this.setTransitioning(true);
  1061. var complete = function complete() {
  1062. $(_this._element).removeClass(ClassName$3.COLLAPSING).addClass(ClassName$3.COLLAPSE).addClass(ClassName$3.SHOW);
  1063. _this._element.style[dimension] = '';
  1064. _this.setTransitioning(false);
  1065. $(_this._element).trigger(Event$3.SHOWN);
  1066. };
  1067. var capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1);
  1068. var scrollSize = "scroll" + capitalizedDimension;
  1069. var transitionDuration = Util.getTransitionDurationFromElement(this._element);
  1070. $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
  1071. this._element.style[dimension] = this._element[scrollSize] + "px";
  1072. };
  1073. _proto.hide = function hide() {
  1074. var _this2 = this;
  1075. if (this._isTransitioning || !$(this._element).hasClass(ClassName$3.SHOW)) {
  1076. return;
  1077. }
  1078. var startEvent = $.Event(Event$3.HIDE);
  1079. $(this._element).trigger(startEvent);
  1080. if (startEvent.isDefaultPrevented()) {
  1081. return;
  1082. }
  1083. var dimension = this._getDimension();
  1084. this._element.style[dimension] = this._element.getBoundingClientRect()[dimension] + "px";
  1085. Util.reflow(this._element);
  1086. $(this._element).addClass(ClassName$3.COLLAPSING).removeClass(ClassName$3.COLLAPSE).removeClass(ClassName$3.SHOW);
  1087. var triggerArrayLength = this._triggerArray.length;
  1088. if (triggerArrayLength > 0) {
  1089. for (var i = 0; i < triggerArrayLength; i++) {
  1090. var trigger = this._triggerArray[i];
  1091. var selector = Util.getSelectorFromElement(trigger);
  1092. if (selector !== null) {
  1093. var $elem = $([].slice.call(document.querySelectorAll(selector)));
  1094. if (!$elem.hasClass(ClassName$3.SHOW)) {
  1095. $(trigger).addClass(ClassName$3.COLLAPSED).attr('aria-expanded', false);
  1096. }
  1097. }
  1098. }
  1099. }
  1100. this.setTransitioning(true);
  1101. var complete = function complete() {
  1102. _this2.setTransitioning(false);
  1103. $(_this2._element).removeClass(ClassName$3.COLLAPSING).addClass(ClassName$3.COLLAPSE).trigger(Event$3.HIDDEN);
  1104. };
  1105. this._element.style[dimension] = '';
  1106. var transitionDuration = Util.getTransitionDurationFromElement(this._element);
  1107. $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
  1108. };
  1109. _proto.setTransitioning = function setTransitioning(isTransitioning) {
  1110. this._isTransitioning = isTransitioning;
  1111. };
  1112. _proto.dispose = function dispose() {
  1113. $.removeData(this._element, DATA_KEY$3);
  1114. this._config = null;
  1115. this._parent = null;
  1116. this._element = null;
  1117. this._triggerArray = null;
  1118. this._isTransitioning = null;
  1119. } // Private
  1120. ;
  1121. _proto._getConfig = function _getConfig(config) {
  1122. config = _objectSpread({}, Default$1, config);
  1123. config.toggle = Boolean(config.toggle); // Coerce string values
  1124. Util.typeCheckConfig(NAME$3, config, DefaultType$1);
  1125. return config;
  1126. };
  1127. _proto._getDimension = function _getDimension() {
  1128. var hasWidth = $(this._element).hasClass(Dimension.WIDTH);
  1129. return hasWidth ? Dimension.WIDTH : Dimension.HEIGHT;
  1130. };
  1131. _proto._getParent = function _getParent() {
  1132. var _this3 = this;
  1133. var parent;
  1134. if (Util.isElement(this._config.parent)) {
  1135. parent = this._config.parent; // It's a jQuery object
  1136. if (typeof this._config.parent.jquery !== 'undefined') {
  1137. parent = this._config.parent[0];
  1138. }
  1139. } else {
  1140. parent = document.querySelector(this._config.parent);
  1141. }
  1142. var selector = "[data-toggle=\"collapse\"][data-parent=\"" + this._config.parent + "\"]";
  1143. var children = [].slice.call(parent.querySelectorAll(selector));
  1144. $(children).each(function (i, element) {
  1145. _this3._addAriaAndCollapsedClass(Collapse._getTargetFromElement(element), [element]);
  1146. });
  1147. return parent;
  1148. };
  1149. _proto._addAriaAndCollapsedClass = function _addAriaAndCollapsedClass(element, triggerArray) {
  1150. var isOpen = $(element).hasClass(ClassName$3.SHOW);
  1151. if (triggerArray.length) {
  1152. $(triggerArray).toggleClass(ClassName$3.COLLAPSED, !isOpen).attr('aria-expanded', isOpen);
  1153. }
  1154. } // Static
  1155. ;
  1156. Collapse._getTargetFromElement = function _getTargetFromElement(element) {
  1157. var selector = Util.getSelectorFromElement(element);
  1158. return selector ? document.querySelector(selector) : null;
  1159. };
  1160. Collapse._jQueryInterface = function _jQueryInterface(config) {
  1161. return this.each(function () {
  1162. var $this = $(this);
  1163. var data = $this.data(DATA_KEY$3);
  1164. var _config = _objectSpread({}, Default$1, $this.data(), typeof config === 'object' && config ? config : {});
  1165. if (!data && _config.toggle && /show|hide/.test(config)) {
  1166. _config.toggle = false;
  1167. }
  1168. if (!data) {
  1169. data = new Collapse(this, _config);
  1170. $this.data(DATA_KEY$3, data);
  1171. }
  1172. if (typeof config === 'string') {
  1173. if (typeof data[config] === 'undefined') {
  1174. throw new TypeError("No method named \"" + config + "\"");
  1175. }
  1176. data[config]();
  1177. }
  1178. });
  1179. };
  1180. _createClass(Collapse, null, [{
  1181. key: "VERSION",
  1182. get: function get() {
  1183. return VERSION$3;
  1184. }
  1185. }, {
  1186. key: "Default",
  1187. get: function get() {
  1188. return Default$1;
  1189. }
  1190. }]);
  1191. return Collapse;
  1192. }();
  1193. /**
  1194. * ------------------------------------------------------------------------
  1195. * Data Api implementation
  1196. * ------------------------------------------------------------------------
  1197. */
  1198. $(document).on(Event$3.CLICK_DATA_API, Selector$3.DATA_TOGGLE, function (event) {
  1199. // preventDefault only for <a> elements (which change the URL) not inside the collapsible element
  1200. if (event.currentTarget.tagName === 'A') {
  1201. event.preventDefault();
  1202. }
  1203. var $trigger = $(this);
  1204. var selector = Util.getSelectorFromElement(this);
  1205. var selectors = [].slice.call(document.querySelectorAll(selector));
  1206. $(selectors).each(function () {
  1207. var $target = $(this);
  1208. var data = $target.data(DATA_KEY$3);
  1209. var config = data ? 'toggle' : $trigger.data();
  1210. Collapse._jQueryInterface.call($target, config);
  1211. });
  1212. });
  1213. /**
  1214. * ------------------------------------------------------------------------
  1215. * jQuery
  1216. * ------------------------------------------------------------------------
  1217. */
  1218. $.fn[NAME$3] = Collapse._jQueryInterface;
  1219. $.fn[NAME$3].Constructor = Collapse;
  1220. $.fn[NAME$3].noConflict = function () {
  1221. $.fn[NAME$3] = JQUERY_NO_CONFLICT$3;
  1222. return Collapse._jQueryInterface;
  1223. };
  1224. /**!
  1225. * @fileOverview Kickass library to create and place poppers near their reference elements.
  1226. * @version 1.14.7
  1227. * @license
  1228. * Copyright (c) 2016 Federico Zivolo and contributors
  1229. *
  1230. * Permission is hereby granted, free of charge, to any person obtaining a copy
  1231. * of this software and associated documentation files (the "Software"), to deal
  1232. * in the Software without restriction, including without limitation the rights
  1233. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  1234. * copies of the Software, and to permit persons to whom the Software is
  1235. * furnished to do so, subject to the following conditions:
  1236. *
  1237. * The above copyright notice and this permission notice shall be included in all
  1238. * copies or substantial portions of the Software.
  1239. *
  1240. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  1241. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  1242. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  1243. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  1244. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  1245. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  1246. * SOFTWARE.
  1247. */
  1248. var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined';
  1249. var longerTimeoutBrowsers = ['Edge', 'Trident', 'Firefox'];
  1250. var timeoutDuration = 0;
  1251. for (var i = 0; i < longerTimeoutBrowsers.length; i += 1) {
  1252. if (isBrowser && navigator.userAgent.indexOf(longerTimeoutBrowsers[i]) >= 0) {
  1253. timeoutDuration = 1;
  1254. break;
  1255. }
  1256. }
  1257. function microtaskDebounce(fn) {
  1258. var called = false;
  1259. return function () {
  1260. if (called) {
  1261. return;
  1262. }
  1263. called = true;
  1264. window.Promise.resolve().then(function () {
  1265. called = false;
  1266. fn();
  1267. });
  1268. };
  1269. }
  1270. function taskDebounce(fn) {
  1271. var scheduled = false;
  1272. return function () {
  1273. if (!scheduled) {
  1274. scheduled = true;
  1275. setTimeout(function () {
  1276. scheduled = false;
  1277. fn();
  1278. }, timeoutDuration);
  1279. }
  1280. };
  1281. }
  1282. var supportsMicroTasks = isBrowser && window.Promise;
  1283. /**
  1284. * Create a debounced version of a method, that's asynchronously deferred
  1285. * but called in the minimum time possible.
  1286. *
  1287. * @method
  1288. * @memberof Popper.Utils
  1289. * @argument {Function} fn
  1290. * @returns {Function}
  1291. */
  1292. var debounce = supportsMicroTasks ? microtaskDebounce : taskDebounce;
  1293. /**
  1294. * Check if the given variable is a function
  1295. * @method
  1296. * @memberof Popper.Utils
  1297. * @argument {Any} functionToCheck - variable to check
  1298. * @returns {Boolean} answer to: is a function?
  1299. */
  1300. function isFunction(functionToCheck) {
  1301. var getType = {};
  1302. return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';
  1303. }
  1304. /**
  1305. * Get CSS computed property of the given element
  1306. * @method
  1307. * @memberof Popper.Utils
  1308. * @argument {Eement} element
  1309. * @argument {String} property
  1310. */
  1311. function getStyleComputedProperty(element, property) {
  1312. if (element.nodeType !== 1) {
  1313. return [];
  1314. }
  1315. // NOTE: 1 DOM access here
  1316. var window = element.ownerDocument.defaultView;
  1317. var css = window.getComputedStyle(element, null);
  1318. return property ? css[property] : css;
  1319. }
  1320. /**
  1321. * Returns the parentNode or the host of the element
  1322. * @method
  1323. * @memberof Popper.Utils
  1324. * @argument {Element} element
  1325. * @returns {Element} parent
  1326. */
  1327. function getParentNode(element) {
  1328. if (element.nodeName === 'HTML') {
  1329. return element;
  1330. }
  1331. return element.parentNode || element.host;
  1332. }
  1333. /**
  1334. * Returns the scrolling parent of the given element
  1335. * @method
  1336. * @memberof Popper.Utils
  1337. * @argument {Element} element
  1338. * @returns {Element} scroll parent
  1339. */
  1340. function getScrollParent(element) {
  1341. // Return body, `getScroll` will take care to get the correct `scrollTop` from it
  1342. if (!element) {
  1343. return document.body;
  1344. }
  1345. switch (element.nodeName) {
  1346. case 'HTML':
  1347. case 'BODY':
  1348. return element.ownerDocument.body;
  1349. case '#document':
  1350. return element.body;
  1351. }
  1352. // Firefox want us to check `-x` and `-y` variations as well
  1353. var _getStyleComputedProp = getStyleComputedProperty(element),
  1354. overflow = _getStyleComputedProp.overflow,
  1355. overflowX = _getStyleComputedProp.overflowX,
  1356. overflowY = _getStyleComputedProp.overflowY;
  1357. if (/(auto|scroll|overlay)/.test(overflow + overflowY + overflowX)) {
  1358. return element;
  1359. }
  1360. return getScrollParent(getParentNode(element));
  1361. }
  1362. var isIE11 = isBrowser && !!(window.MSInputMethodContext && document.documentMode);
  1363. var isIE10 = isBrowser && /MSIE 10/.test(navigator.userAgent);
  1364. /**
  1365. * Determines if the browser is Internet Explorer
  1366. * @method
  1367. * @memberof Popper.Utils
  1368. * @param {Number} version to check
  1369. * @returns {Boolean} isIE
  1370. */
  1371. function isIE(version) {
  1372. if (version === 11) {
  1373. return isIE11;
  1374. }
  1375. if (version === 10) {
  1376. return isIE10;
  1377. }
  1378. return isIE11 || isIE10;
  1379. }
  1380. /**
  1381. * Returns the offset parent of the given element
  1382. * @method
  1383. * @memberof Popper.Utils
  1384. * @argument {Element} element
  1385. * @returns {Element} offset parent
  1386. */
  1387. function getOffsetParent(element) {
  1388. if (!element) {
  1389. return document.documentElement;
  1390. }
  1391. var noOffsetParent = isIE(10) ? document.body : null;
  1392. // NOTE: 1 DOM access here
  1393. var offsetParent = element.offsetParent || null;
  1394. // Skip hidden elements which don't have an offsetParent
  1395. while (offsetParent === noOffsetParent && element.nextElementSibling) {
  1396. offsetParent = (element = element.nextElementSibling).offsetParent;
  1397. }
  1398. var nodeName = offsetParent && offsetParent.nodeName;
  1399. if (!nodeName || nodeName === 'BODY' || nodeName === 'HTML') {
  1400. return element ? element.ownerDocument.documentElement : document.documentElement;
  1401. }
  1402. // .offsetParent will return the closest TH, TD or TABLE in case
  1403. // no offsetParent is present, I hate this job...
  1404. if (['TH', 'TD', 'TABLE'].indexOf(offsetParent.nodeName) !== -1 && getStyleComputedProperty(offsetParent, 'position') === 'static') {
  1405. return getOffsetParent(offsetParent);
  1406. }
  1407. return offsetParent;
  1408. }
  1409. function isOffsetContainer(element) {
  1410. var nodeName = element.nodeName;
  1411. if (nodeName === 'BODY') {
  1412. return false;
  1413. }
  1414. return nodeName === 'HTML' || getOffsetParent(element.firstElementChild) === element;
  1415. }
  1416. /**
  1417. * Finds the root node (document, shadowDOM root) of the given element
  1418. * @method
  1419. * @memberof Popper.Utils
  1420. * @argument {Element} node
  1421. * @returns {Element} root node
  1422. */
  1423. function getRoot(node) {
  1424. if (node.parentNode !== null) {
  1425. return getRoot(node.parentNode);
  1426. }
  1427. return node;
  1428. }
  1429. /**
  1430. * Finds the offset parent common to the two provided nodes
  1431. * @method
  1432. * @memberof Popper.Utils
  1433. * @argument {Element} element1
  1434. * @argument {Element} element2
  1435. * @returns {Element} common offset parent
  1436. */
  1437. function findCommonOffsetParent(element1, element2) {
  1438. // This check is needed to avoid errors in case one of the elements isn't defined for any reason
  1439. if (!element1 || !element1.nodeType || !element2 || !element2.nodeType) {
  1440. return document.documentElement;
  1441. }
  1442. // Here we make sure to give as "start" the element that comes first in the DOM
  1443. var order = element1.compareDocumentPosition(element2) & Node.DOCUMENT_POSITION_FOLLOWING;
  1444. var start = order ? element1 : element2;
  1445. var end = order ? element2 : element1;
  1446. // Get common ancestor container
  1447. var range = document.createRange();
  1448. range.setStart(start, 0);
  1449. range.setEnd(end, 0);
  1450. var commonAncestorContainer = range.commonAncestorContainer;
  1451. // Both nodes are inside #document
  1452. if (element1 !== commonAncestorContainer && element2 !== commonAncestorContainer || start.contains(end)) {
  1453. if (isOffsetContainer(commonAncestorContainer)) {
  1454. return commonAncestorContainer;
  1455. }
  1456. return getOffsetParent(commonAncestorContainer);
  1457. }
  1458. // one of the nodes is inside shadowDOM, find which one
  1459. var element1root = getRoot(element1);
  1460. if (element1root.host) {
  1461. return findCommonOffsetParent(element1root.host, element2);
  1462. } else {
  1463. return findCommonOffsetParent(element1, getRoot(element2).host);
  1464. }
  1465. }
  1466. /**
  1467. * Gets the scroll value of the given element in the given side (top and left)
  1468. * @method
  1469. * @memberof Popper.Utils
  1470. * @argument {Element} element
  1471. * @argument {String} side `top` or `left`
  1472. * @returns {number} amount of scrolled pixels
  1473. */
  1474. function getScroll(element) {
  1475. var side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'top';
  1476. var upperSide = side === 'top' ? 'scrollTop' : 'scrollLeft';
  1477. var nodeName = element.nodeName;
  1478. if (nodeName === 'BODY' || nodeName === 'HTML') {
  1479. var html = element.ownerDocument.documentElement;
  1480. var scrollingElement = element.ownerDocument.scrollingElement || html;
  1481. return scrollingElement[upperSide];
  1482. }
  1483. return element[upperSide];
  1484. }
  1485. /*
  1486. * Sum or subtract the element scroll values (left and top) from a given rect object
  1487. * @method
  1488. * @memberof Popper.Utils
  1489. * @param {Object} rect - Rect object you want to change
  1490. * @param {HTMLElement} element - The element from the function reads the scroll values
  1491. * @param {Boolean} subtract - set to true if you want to subtract the scroll values
  1492. * @return {Object} rect - The modifier rect object
  1493. */
  1494. function includeScroll(rect, element) {
  1495. var subtract = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  1496. var scrollTop = getScroll(element, 'top');
  1497. var scrollLeft = getScroll(element, 'left');
  1498. var modifier = subtract ? -1 : 1;
  1499. rect.top += scrollTop * modifier;
  1500. rect.bottom += scrollTop * modifier;
  1501. rect.left += scrollLeft * modifier;
  1502. rect.right += scrollLeft * modifier;
  1503. return rect;
  1504. }
  1505. /*
  1506. * Helper to detect borders of a given element
  1507. * @method
  1508. * @memberof Popper.Utils
  1509. * @param {CSSStyleDeclaration} styles
  1510. * Result of `getStyleComputedProperty` on the given element
  1511. * @param {String} axis - `x` or `y`
  1512. * @return {number} borders - The borders size of the given axis
  1513. */
  1514. function getBordersSize(styles, axis) {
  1515. var sideA = axis === 'x' ? 'Left' : 'Top';
  1516. var sideB = sideA === 'Left' ? 'Right' : 'Bottom';
  1517. return parseFloat(styles['border' + sideA + 'Width'], 10) + parseFloat(styles['border' + sideB + 'Width'], 10);
  1518. }
  1519. function getSize(axis, body, html, computedStyle) {
  1520. return Math.max(body['offset' + axis], body['scroll' + axis], html['client' + axis], html['offset' + axis], html['scroll' + axis], isIE(10) ? parseInt(html['offset' + axis]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Top' : 'Left')]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Bottom' : 'Right')]) : 0);
  1521. }
  1522. function getWindowSizes(document) {
  1523. var body = document.body;
  1524. var html = document.documentElement;
  1525. var computedStyle = isIE(10) && getComputedStyle(html);
  1526. return {
  1527. height: getSize('Height', body, html, computedStyle),
  1528. width: getSize('Width', body, html, computedStyle)
  1529. };
  1530. }
  1531. var classCallCheck = function (instance, Constructor) {
  1532. if (!(instance instanceof Constructor)) {
  1533. throw new TypeError("Cannot call a class as a function");
  1534. }
  1535. };
  1536. var createClass = function () {
  1537. function defineProperties(target, props) {
  1538. for (var i = 0; i < props.length; i++) {
  1539. var descriptor = props[i];
  1540. descriptor.enumerable = descriptor.enumerable || false;
  1541. descriptor.configurable = true;
  1542. if ("value" in descriptor) descriptor.writable = true;
  1543. Object.defineProperty(target, descriptor.key, descriptor);
  1544. }
  1545. }
  1546. return function (Constructor, protoProps, staticProps) {
  1547. if (protoProps) defineProperties(Constructor.prototype, protoProps);
  1548. if (staticProps) defineProperties(Constructor, staticProps);
  1549. return Constructor;
  1550. };
  1551. }();
  1552. var defineProperty = function (obj, key, value) {
  1553. if (key in obj) {
  1554. Object.defineProperty(obj, key, {
  1555. value: value,
  1556. enumerable: true,
  1557. configurable: true,
  1558. writable: true
  1559. });
  1560. } else {
  1561. obj[key] = value;
  1562. }
  1563. return obj;
  1564. };
  1565. var _extends = Object.assign || function (target) {
  1566. for (var i = 1; i < arguments.length; i++) {
  1567. var source = arguments[i];
  1568. for (var key in source) {
  1569. if (Object.prototype.hasOwnProperty.call(source, key)) {
  1570. target[key] = source[key];
  1571. }
  1572. }
  1573. }
  1574. return target;
  1575. };
  1576. /**
  1577. * Given element offsets, generate an output similar to getBoundingClientRect
  1578. * @method
  1579. * @memberof Popper.Utils
  1580. * @argument {Object} offsets
  1581. * @returns {Object} ClientRect like output
  1582. */
  1583. function getClientRect(offsets) {
  1584. return _extends({}, offsets, {
  1585. right: offsets.left + offsets.width,
  1586. bottom: offsets.top + offsets.height
  1587. });
  1588. }
  1589. /**
  1590. * Get bounding client rect of given element
  1591. * @method
  1592. * @memberof Popper.Utils
  1593. * @param {HTMLElement} element
  1594. * @return {Object} client rect
  1595. */
  1596. function getBoundingClientRect(element) {
  1597. var rect = {};
  1598. // IE10 10 FIX: Please, don't ask, the element isn't
  1599. // considered in DOM in some circumstances...
  1600. // This isn't reproducible in IE10 compatibility mode of IE11
  1601. try {
  1602. if (isIE(10)) {
  1603. rect = element.getBoundingClientRect();
  1604. var scrollTop = getScroll(element, 'top');
  1605. var scrollLeft = getScroll(element, 'left');
  1606. rect.top += scrollTop;
  1607. rect.left += scrollLeft;
  1608. rect.bottom += scrollTop;
  1609. rect.right += scrollLeft;
  1610. } else {
  1611. rect = element.getBoundingClientRect();
  1612. }
  1613. } catch (e) { }
  1614. var result = {
  1615. left: rect.left,
  1616. top: rect.top,
  1617. width: rect.right - rect.left,
  1618. height: rect.bottom - rect.top
  1619. };
  1620. // subtract scrollbar size from sizes
  1621. var sizes = element.nodeName === 'HTML' ? getWindowSizes(element.ownerDocument) : {};
  1622. var width = sizes.width || element.clientWidth || result.right - result.left;
  1623. var height = sizes.height || element.clientHeight || result.bottom - result.top;
  1624. var horizScrollbar = element.offsetWidth - width;
  1625. var vertScrollbar = element.offsetHeight - height;
  1626. // if an hypothetical scrollbar is detected, we must be sure it's not a `border`
  1627. // we make this check conditional for performance reasons
  1628. if (horizScrollbar || vertScrollbar) {
  1629. var styles = getStyleComputedProperty(element);
  1630. horizScrollbar -= getBordersSize(styles, 'x');
  1631. vertScrollbar -= getBordersSize(styles, 'y');
  1632. result.width -= horizScrollbar;
  1633. result.height -= vertScrollbar;
  1634. }
  1635. return getClientRect(result);
  1636. }
  1637. function getOffsetRectRelativeToArbitraryNode(children, parent) {
  1638. var fixedPosition = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  1639. var isIE10 = isIE(10);
  1640. var isHTML = parent.nodeName === 'HTML';
  1641. var childrenRect = getBoundingClientRect(children);
  1642. var parentRect = getBoundingClientRect(parent);
  1643. var scrollParent = getScrollParent(children);
  1644. var styles = getStyleComputedProperty(parent);
  1645. var borderTopWidth = parseFloat(styles.borderTopWidth, 10);
  1646. var borderLeftWidth = parseFloat(styles.borderLeftWidth, 10);
  1647. // In cases where the parent is fixed, we must ignore negative scroll in offset calc
  1648. if (fixedPosition && isHTML) {
  1649. parentRect.top = Math.max(parentRect.top, 0);
  1650. parentRect.left = Math.max(parentRect.left, 0);
  1651. }
  1652. var offsets = getClientRect({
  1653. top: childrenRect.top - parentRect.top - borderTopWidth,
  1654. left: childrenRect.left - parentRect.left - borderLeftWidth,
  1655. width: childrenRect.width,
  1656. height: childrenRect.height
  1657. });
  1658. offsets.marginTop = 0;
  1659. offsets.marginLeft = 0;
  1660. // Subtract margins of documentElement in case it's being used as parent
  1661. // we do this only on HTML because it's the only element that behaves
  1662. // differently when margins are applied to it. The margins are included in
  1663. // the box of the documentElement, in the other cases not.
  1664. if (!isIE10 && isHTML) {
  1665. var marginTop = parseFloat(styles.marginTop, 10);
  1666. var marginLeft = parseFloat(styles.marginLeft, 10);
  1667. offsets.top -= borderTopWidth - marginTop;
  1668. offsets.bottom -= borderTopWidth - marginTop;
  1669. offsets.left -= borderLeftWidth - marginLeft;
  1670. offsets.right -= borderLeftWidth - marginLeft;
  1671. // Attach marginTop and marginLeft because in some circumstances we may need them
  1672. offsets.marginTop = marginTop;
  1673. offsets.marginLeft = marginLeft;
  1674. }
  1675. if (isIE10 && !fixedPosition ? parent.contains(scrollParent) : parent === scrollParent && scrollParent.nodeName !== 'BODY') {
  1676. offsets = includeScroll(offsets, parent);
  1677. }
  1678. return offsets;
  1679. }
  1680. function getViewportOffsetRectRelativeToArtbitraryNode(element) {
  1681. var excludeScroll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  1682. var html = element.ownerDocument.documentElement;
  1683. var relativeOffset = getOffsetRectRelativeToArbitraryNode(element, html);
  1684. var width = Math.max(html.clientWidth, window.innerWidth || 0);
  1685. var height = Math.max(html.clientHeight, window.innerHeight || 0);
  1686. var scrollTop = !excludeScroll ? getScroll(html) : 0;
  1687. var scrollLeft = !excludeScroll ? getScroll(html, 'left') : 0;
  1688. var offset = {
  1689. top: scrollTop - relativeOffset.top + relativeOffset.marginTop,
  1690. left: scrollLeft - relativeOffset.left + relativeOffset.marginLeft,
  1691. width: width,
  1692. height: height
  1693. };
  1694. return getClientRect(offset);
  1695. }
  1696. /**
  1697. * Check if the given element is fixed or is inside a fixed parent
  1698. * @method
  1699. * @memberof Popper.Utils
  1700. * @argument {Element} element
  1701. * @argument {Element} customContainer
  1702. * @returns {Boolean} answer to "isFixed?"
  1703. */
  1704. function isFixed(element) {
  1705. var nodeName = element.nodeName;
  1706. if (nodeName === 'BODY' || nodeName === 'HTML') {
  1707. return false;
  1708. }
  1709. if (getStyleComputedProperty(element, 'position') === 'fixed') {
  1710. return true;
  1711. }
  1712. var parentNode = getParentNode(element);
  1713. if (!parentNode) {
  1714. return false;
  1715. }
  1716. return isFixed(parentNode);
  1717. }
  1718. /**
  1719. * Finds the first parent of an element that has a transformed property defined
  1720. * @method
  1721. * @memberof Popper.Utils
  1722. * @argument {Element} element
  1723. * @returns {Element} first transformed parent or documentElement
  1724. */
  1725. function getFixedPositionOffsetParent(element) {
  1726. // This check is needed to avoid errors in case one of the elements isn't defined for any reason
  1727. if (!element || !element.parentElement || isIE()) {
  1728. return document.documentElement;
  1729. }
  1730. var el = element.parentElement;
  1731. while (el && getStyleComputedProperty(el, 'transform') === 'none') {
  1732. el = el.parentElement;
  1733. }
  1734. return el || document.documentElement;
  1735. }
  1736. /**
  1737. * Computed the boundaries limits and return them
  1738. * @method
  1739. * @memberof Popper.Utils
  1740. * @param {HTMLElement} popper
  1741. * @param {HTMLElement} reference
  1742. * @param {number} padding
  1743. * @param {HTMLElement} boundariesElement - Element used to define the boundaries
  1744. * @param {Boolean} fixedPosition - Is in fixed position mode
  1745. * @returns {Object} Coordinates of the boundaries
  1746. */
  1747. function getBoundaries(popper, reference, padding, boundariesElement) {
  1748. var fixedPosition = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
  1749. // NOTE: 1 DOM access here
  1750. var boundaries = { top: 0, left: 0 };
  1751. var offsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, reference);
  1752. // Handle viewport case
  1753. if (boundariesElement === 'viewport') {
  1754. boundaries = getViewportOffsetRectRelativeToArtbitraryNode(offsetParent, fixedPosition);
  1755. } else {
  1756. // Handle other cases based on DOM element used as boundaries
  1757. var boundariesNode = void 0;
  1758. if (boundariesElement === 'scrollParent') {
  1759. boundariesNode = getScrollParent(getParentNode(reference));
  1760. if (boundariesNode.nodeName === 'BODY') {
  1761. boundariesNode = popper.ownerDocument.documentElement;
  1762. }
  1763. } else if (boundariesElement === 'window') {
  1764. boundariesNode = popper.ownerDocument.documentElement;
  1765. } else {
  1766. boundariesNode = boundariesElement;
  1767. }
  1768. var offsets = getOffsetRectRelativeToArbitraryNode(boundariesNode, offsetParent, fixedPosition);
  1769. // In case of HTML, we need a different computation
  1770. if (boundariesNode.nodeName === 'HTML' && !isFixed(offsetParent)) {
  1771. var _getWindowSizes = getWindowSizes(popper.ownerDocument),
  1772. height = _getWindowSizes.height,
  1773. width = _getWindowSizes.width;
  1774. boundaries.top += offsets.top - offsets.marginTop;
  1775. boundaries.bottom = height + offsets.top;
  1776. boundaries.left += offsets.left - offsets.marginLeft;
  1777. boundaries.right = width + offsets.left;
  1778. } else {
  1779. // for all the other DOM elements, this one is good
  1780. boundaries = offsets;
  1781. }
  1782. }
  1783. // Add paddings
  1784. padding = padding || 0;
  1785. var isPaddingNumber = typeof padding === 'number';
  1786. boundaries.left += isPaddingNumber ? padding : padding.left || 0;
  1787. boundaries.top += isPaddingNumber ? padding : padding.top || 0;
  1788. boundaries.right -= isPaddingNumber ? padding : padding.right || 0;
  1789. boundaries.bottom -= isPaddingNumber ? padding : padding.bottom || 0;
  1790. return boundaries;
  1791. }
  1792. function getArea(_ref) {
  1793. var width = _ref.width,
  1794. height = _ref.height;
  1795. return width * height;
  1796. }
  1797. /**
  1798. * Utility used to transform the `auto` placement to the placement with more
  1799. * available space.
  1800. * @method
  1801. * @memberof Popper.Utils
  1802. * @argument {Object} data - The data object generated by update method
  1803. * @argument {Object} options - Modifiers configuration and options
  1804. * @returns {Object} The data object, properly modified
  1805. */
  1806. function computeAutoPlacement(placement, refRect, popper, reference, boundariesElement) {
  1807. var padding = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0;
  1808. if (placement.indexOf('auto') === -1) {
  1809. return placement;
  1810. }
  1811. var boundaries = getBoundaries(popper, reference, padding, boundariesElement);
  1812. var rects = {
  1813. top: {
  1814. width: boundaries.width,
  1815. height: refRect.top - boundaries.top
  1816. },
  1817. right: {
  1818. width: boundaries.right - refRect.right,
  1819. height: boundaries.height
  1820. },
  1821. bottom: {
  1822. width: boundaries.width,
  1823. height: boundaries.bottom - refRect.bottom
  1824. },
  1825. left: {
  1826. width: refRect.left - boundaries.left,
  1827. height: boundaries.height
  1828. }
  1829. };
  1830. var sortedAreas = Object.keys(rects).map(function (key) {
  1831. return _extends({
  1832. key: key
  1833. }, rects[key], {
  1834. area: getArea(rects[key])
  1835. });
  1836. }).sort(function (a, b) {
  1837. return b.area - a.area;
  1838. });
  1839. var filteredAreas = sortedAreas.filter(function (_ref2) {
  1840. var width = _ref2.width,
  1841. height = _ref2.height;
  1842. return width >= popper.clientWidth && height >= popper.clientHeight;
  1843. });
  1844. var computedPlacement = filteredAreas.length > 0 ? filteredAreas[0].key : sortedAreas[0].key;
  1845. var variation = placement.split('-')[1];
  1846. return computedPlacement + (variation ? '-' + variation : '');
  1847. }
  1848. /**
  1849. * Get offsets to the reference element
  1850. * @method
  1851. * @memberof Popper.Utils
  1852. * @param {Object} state
  1853. * @param {Element} popper - the popper element
  1854. * @param {Element} reference - the reference element (the popper will be relative to this)
  1855. * @param {Element} fixedPosition - is in fixed position mode
  1856. * @returns {Object} An object containing the offsets which will be applied to the popper
  1857. */
  1858. function getReferenceOffsets(state, popper, reference) {
  1859. var fixedPosition = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
  1860. var commonOffsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, reference);
  1861. return getOffsetRectRelativeToArbitraryNode(reference, commonOffsetParent, fixedPosition);
  1862. }
  1863. /**
  1864. * Get the outer sizes of the given element (offset size + margins)
  1865. * @method
  1866. * @memberof Popper.Utils
  1867. * @argument {Element} element
  1868. * @returns {Object} object containing width and height properties
  1869. */
  1870. function getOuterSizes(element) {
  1871. var window = element.ownerDocument.defaultView;
  1872. var styles = window.getComputedStyle(element);
  1873. var x = parseFloat(styles.marginTop || 0) + parseFloat(styles.marginBottom || 0);
  1874. var y = parseFloat(styles.marginLeft || 0) + parseFloat(styles.marginRight || 0);
  1875. var result = {
  1876. width: element.offsetWidth + y,
  1877. height: element.offsetHeight + x
  1878. };
  1879. return result;
  1880. }
  1881. /**
  1882. * Get the opposite placement of the given one
  1883. * @method
  1884. * @memberof Popper.Utils
  1885. * @argument {String} placement
  1886. * @returns {String} flipped placement
  1887. */
  1888. function getOppositePlacement(placement) {
  1889. var hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' };
  1890. return placement.replace(/left|right|bottom|top/g, function (matched) {
  1891. return hash[matched];
  1892. });
  1893. }
  1894. /**
  1895. * Get offsets to the popper
  1896. * @method
  1897. * @memberof Popper.Utils
  1898. * @param {Object} position - CSS position the Popper will get applied
  1899. * @param {HTMLElement} popper - the popper element
  1900. * @param {Object} referenceOffsets - the reference offsets (the popper will be relative to this)
  1901. * @param {String} placement - one of the valid placement options
  1902. * @returns {Object} popperOffsets - An object containing the offsets which will be applied to the popper
  1903. */
  1904. function getPopperOffsets(popper, referenceOffsets, placement) {
  1905. placement = placement.split('-')[0];
  1906. // Get popper node sizes
  1907. var popperRect = getOuterSizes(popper);
  1908. // Add position, width and height to our offsets object
  1909. var popperOffsets = {
  1910. width: popperRect.width,
  1911. height: popperRect.height
  1912. };
  1913. // depending by the popper placement we have to compute its offsets slightly differently
  1914. var isHoriz = ['right', 'left'].indexOf(placement) !== -1;
  1915. var mainSide = isHoriz ? 'top' : 'left';
  1916. var secondarySide = isHoriz ? 'left' : 'top';
  1917. var measurement = isHoriz ? 'height' : 'width';
  1918. var secondaryMeasurement = !isHoriz ? 'height' : 'width';
  1919. popperOffsets[mainSide] = referenceOffsets[mainSide] + referenceOffsets[measurement] / 2 - popperRect[measurement] / 2;
  1920. if (placement === secondarySide) {
  1921. popperOffsets[secondarySide] = referenceOffsets[secondarySide] - popperRect[secondaryMeasurement];
  1922. } else {
  1923. popperOffsets[secondarySide] = referenceOffsets[getOppositePlacement(secondarySide)];
  1924. }
  1925. return popperOffsets;
  1926. }
  1927. /**
  1928. * Mimics the `find` method of Array
  1929. * @method
  1930. * @memberof Popper.Utils
  1931. * @argument {Array} arr
  1932. * @argument prop
  1933. * @argument value
  1934. * @returns index or -1
  1935. */
  1936. function find(arr, check) {
  1937. // use native find if supported
  1938. if (Array.prototype.find) {
  1939. return arr.find(check);
  1940. }
  1941. // use `filter` to obtain the same behavior of `find`
  1942. return arr.filter(check)[0];
  1943. }
  1944. /**
  1945. * Return the index of the matching object
  1946. * @method
  1947. * @memberof Popper.Utils
  1948. * @argument {Array} arr
  1949. * @argument prop
  1950. * @argument value
  1951. * @returns index or -1
  1952. */
  1953. function findIndex(arr, prop, value) {
  1954. // use native findIndex if supported
  1955. if (Array.prototype.findIndex) {
  1956. return arr.findIndex(function (cur) {
  1957. return cur[prop] === value;
  1958. });
  1959. }
  1960. // use `find` + `indexOf` if `findIndex` isn't supported
  1961. var match = find(arr, function (obj) {
  1962. return obj[prop] === value;
  1963. });
  1964. return arr.indexOf(match);
  1965. }
  1966. /**
  1967. * Loop trough the list of modifiers and run them in order,
  1968. * each of them will then edit the data object.
  1969. * @method
  1970. * @memberof Popper.Utils
  1971. * @param {dataObject} data
  1972. * @param {Array} modifiers
  1973. * @param {String} ends - Optional modifier name used as stopper
  1974. * @returns {dataObject}
  1975. */
  1976. function runModifiers(modifiers, data, ends) {
  1977. var modifiersToRun = ends === undefined ? modifiers : modifiers.slice(0, findIndex(modifiers, 'name', ends));
  1978. modifiersToRun.forEach(function (modifier) {
  1979. if (modifier['function']) {
  1980. // eslint-disable-line dot-notation
  1981. console.warn('`modifier.function` is deprecated, use `modifier.fn`!');
  1982. }
  1983. var fn = modifier['function'] || modifier.fn; // eslint-disable-line dot-notation
  1984. if (modifier.enabled && isFunction(fn)) {
  1985. // Add properties to offsets to make them a complete clientRect object
  1986. // we do this before each modifier to make sure the previous one doesn't
  1987. // mess with these values
  1988. data.offsets.popper = getClientRect(data.offsets.popper);
  1989. data.offsets.reference = getClientRect(data.offsets.reference);
  1990. data = fn(data, modifier);
  1991. }
  1992. });
  1993. return data;
  1994. }
  1995. /**
  1996. * Updates the position of the popper, computing the new offsets and applying
  1997. * the new style.<br />
  1998. * Prefer `scheduleUpdate` over `update` because of performance reasons.
  1999. * @method
  2000. * @memberof Popper
  2001. */
  2002. function update() {
  2003. // if popper is destroyed, don't perform any further update
  2004. if (this.state.isDestroyed) {
  2005. return;
  2006. }
  2007. var data = {
  2008. instance: this,
  2009. styles: {},
  2010. arrowStyles: {},
  2011. attributes: {},
  2012. flipped: false,
  2013. offsets: {}
  2014. };
  2015. // compute reference element offsets
  2016. data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);
  2017. // compute auto placement, store placement inside the data object,
  2018. // modifiers will be able to edit `placement` if needed
  2019. // and refer to originalPlacement to know the original value
  2020. data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);
  2021. // store the computed placement inside `originalPlacement`
  2022. data.originalPlacement = data.placement;
  2023. data.positionFixed = this.options.positionFixed;
  2024. // compute the popper offsets
  2025. data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);
  2026. data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';
  2027. // run the modifiers
  2028. data = runModifiers(this.modifiers, data);
  2029. // the first `update` will call `onCreate` callback
  2030. // the other ones will call `onUpdate` callback
  2031. if (!this.state.isCreated) {
  2032. this.state.isCreated = true;
  2033. this.options.onCreate(data);
  2034. } else {
  2035. this.options.onUpdate(data);
  2036. }
  2037. }
  2038. /**
  2039. * Helper used to know if the given modifier is enabled.
  2040. * @method
  2041. * @memberof Popper.Utils
  2042. * @returns {Boolean}
  2043. */
  2044. function isModifierEnabled(modifiers, modifierName) {
  2045. return modifiers.some(function (_ref) {
  2046. var name = _ref.name,
  2047. enabled = _ref.enabled;
  2048. return enabled && name === modifierName;
  2049. });
  2050. }
  2051. /**
  2052. * Get the prefixed supported property name
  2053. * @method
  2054. * @memberof Popper.Utils
  2055. * @argument {String} property (camelCase)
  2056. * @returns {String} prefixed property (camelCase or PascalCase, depending on the vendor prefix)
  2057. */
  2058. function getSupportedPropertyName(property) {
  2059. var prefixes = [false, 'ms', 'Webkit', 'Moz', 'O'];
  2060. var upperProp = property.charAt(0).toUpperCase() + property.slice(1);
  2061. for (var i = 0; i < prefixes.length; i++) {
  2062. var prefix = prefixes[i];
  2063. var toCheck = prefix ? '' + prefix + upperProp : property;
  2064. if (typeof document.body.style[toCheck] !== 'undefined') {
  2065. return toCheck;
  2066. }
  2067. }
  2068. return null;
  2069. }
  2070. /**
  2071. * Destroys the popper.
  2072. * @method
  2073. * @memberof Popper
  2074. */
  2075. function destroy() {
  2076. this.state.isDestroyed = true;
  2077. // touch DOM only if `applyStyle` modifier is enabled
  2078. if (isModifierEnabled(this.modifiers, 'applyStyle')) {
  2079. this.popper.removeAttribute('x-placement');
  2080. this.popper.style.position = '';
  2081. this.popper.style.top = '';
  2082. this.popper.style.left = '';
  2083. this.popper.style.right = '';
  2084. this.popper.style.bottom = '';
  2085. this.popper.style.willChange = '';
  2086. this.popper.style[getSupportedPropertyName('transform')] = '';
  2087. }
  2088. this.disableEventListeners();
  2089. // remove the popper if user explicity asked for the deletion on destroy
  2090. // do not use `remove` because IE11 doesn't support it
  2091. if (this.options.removeOnDestroy) {
  2092. this.popper.parentNode.removeChild(this.popper);
  2093. }
  2094. return this;
  2095. }
  2096. /**
  2097. * Get the window associated with the element
  2098. * @argument {Element} element
  2099. * @returns {Window}
  2100. */
  2101. function getWindow(element) {
  2102. var ownerDocument = element.ownerDocument;
  2103. return ownerDocument ? ownerDocument.defaultView : window;
  2104. }
  2105. function attachToScrollParents(scrollParent, event, callback, scrollParents) {
  2106. var isBody = scrollParent.nodeName === 'BODY';
  2107. var target = isBody ? scrollParent.ownerDocument.defaultView : scrollParent;
  2108. target.addEventListener(event, callback, { passive: true });
  2109. if (!isBody) {
  2110. attachToScrollParents(getScrollParent(target.parentNode), event, callback, scrollParents);
  2111. }
  2112. scrollParents.push(target);
  2113. }
  2114. /**
  2115. * Setup needed event listeners used to update the popper position
  2116. * @method
  2117. * @memberof Popper.Utils
  2118. * @private
  2119. */
  2120. function setupEventListeners(reference, options, state, updateBound) {
  2121. // Resize event listener on window
  2122. state.updateBound = updateBound;
  2123. getWindow(reference).addEventListener('resize', state.updateBound, { passive: true });
  2124. // Scroll event listener on scroll parents
  2125. var scrollElement = getScrollParent(reference);
  2126. attachToScrollParents(scrollElement, 'scroll', state.updateBound, state.scrollParents);
  2127. state.scrollElement = scrollElement;
  2128. state.eventsEnabled = true;
  2129. return state;
  2130. }
  2131. /**
  2132. * It will add resize/scroll events and start recalculating
  2133. * position of the popper element when they are triggered.
  2134. * @method
  2135. * @memberof Popper
  2136. */
  2137. function enableEventListeners() {
  2138. if (!this.state.eventsEnabled) {
  2139. this.state = setupEventListeners(this.reference, this.options, this.state, this.scheduleUpdate);
  2140. }
  2141. }
  2142. /**
  2143. * Remove event listeners used to update the popper position
  2144. * @method
  2145. * @memberof Popper.Utils
  2146. * @private
  2147. */
  2148. function removeEventListeners(reference, state) {
  2149. // Remove resize event listener on window
  2150. getWindow(reference).removeEventListener('resize', state.updateBound);
  2151. // Remove scroll event listener on scroll parents
  2152. state.scrollParents.forEach(function (target) {
  2153. target.removeEventListener('scroll', state.updateBound);
  2154. });
  2155. // Reset state
  2156. state.updateBound = null;
  2157. state.scrollParents = [];
  2158. state.scrollElement = null;
  2159. state.eventsEnabled = false;
  2160. return state;
  2161. }
  2162. /**
  2163. * It will remove resize/scroll events and won't recalculate popper position
  2164. * when they are triggered. It also won't trigger `onUpdate` callback anymore,
  2165. * unless you call `update` method manually.
  2166. * @method
  2167. * @memberof Popper
  2168. */
  2169. function disableEventListeners() {
  2170. if (this.state.eventsEnabled) {
  2171. cancelAnimationFrame(this.scheduleUpdate);
  2172. this.state = removeEventListeners(this.reference, this.state);
  2173. }
  2174. }
  2175. /**
  2176. * Tells if a given input is a number
  2177. * @method
  2178. * @memberof Popper.Utils
  2179. * @param {*} input to check
  2180. * @return {Boolean}
  2181. */
  2182. function isNumeric(n) {
  2183. return n !== '' && !isNaN(parseFloat(n)) && isFinite(n);
  2184. }
  2185. /**
  2186. * Set the style to the given popper
  2187. * @method
  2188. * @memberof Popper.Utils
  2189. * @argument {Element} element - Element to apply the style to
  2190. * @argument {Object} styles
  2191. * Object with a list of properties and values which will be applied to the element
  2192. */
  2193. function setStyles(element, styles) {
  2194. Object.keys(styles).forEach(function (prop) {
  2195. var unit = '';
  2196. // add unit if the value is numeric and is one of the following
  2197. if (['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(prop) !== -1 && isNumeric(styles[prop])) {
  2198. unit = 'px';
  2199. }
  2200. element.style[prop] = styles[prop] + unit;
  2201. });
  2202. }
  2203. /**
  2204. * Set the attributes to the given popper
  2205. * @method
  2206. * @memberof Popper.Utils
  2207. * @argument {Element} element - Element to apply the attributes to
  2208. * @argument {Object} styles
  2209. * Object with a list of properties and values which will be applied to the element
  2210. */
  2211. function setAttributes(element, attributes) {
  2212. Object.keys(attributes).forEach(function (prop) {
  2213. var value = attributes[prop];
  2214. if (value !== false) {
  2215. element.setAttribute(prop, attributes[prop]);
  2216. } else {
  2217. element.removeAttribute(prop);
  2218. }
  2219. });
  2220. }
  2221. /**
  2222. * @function
  2223. * @memberof Modifiers
  2224. * @argument {Object} data - The data object generated by `update` method
  2225. * @argument {Object} data.styles - List of style properties - values to apply to popper element
  2226. * @argument {Object} data.attributes - List of attribute properties - values to apply to popper element
  2227. * @argument {Object} options - Modifiers configuration and options
  2228. * @returns {Object} The same data object
  2229. */
  2230. function applyStyle(data) {
  2231. // any property present in `data.styles` will be applied to the popper,
  2232. // in this way we can make the 3rd party modifiers add custom styles to it
  2233. // Be aware, modifiers could override the properties defined in the previous
  2234. // lines of this modifier!
  2235. setStyles(data.instance.popper, data.styles);
  2236. // any property present in `data.attributes` will be applied to the popper,
  2237. // they will be set as HTML attributes of the element
  2238. setAttributes(data.instance.popper, data.attributes);
  2239. // if arrowElement is defined and arrowStyles has some properties
  2240. if (data.arrowElement && Object.keys(data.arrowStyles).length) {
  2241. setStyles(data.arrowElement, data.arrowStyles);
  2242. }
  2243. return data;
  2244. }
  2245. /**
  2246. * Set the x-placement attribute before everything else because it could be used
  2247. * to add margins to the popper margins needs to be calculated to get the
  2248. * correct popper offsets.
  2249. * @method
  2250. * @memberof Popper.modifiers
  2251. * @param {HTMLElement} reference - The reference element used to position the popper
  2252. * @param {HTMLElement} popper - The HTML element used as popper
  2253. * @param {Object} options - Popper.js options
  2254. */
  2255. function applyStyleOnLoad(reference, popper, options, modifierOptions, state) {
  2256. // compute reference element offsets
  2257. var referenceOffsets = getReferenceOffsets(state, popper, reference, options.positionFixed);
  2258. // compute auto placement, store placement inside the data object,
  2259. // modifiers will be able to edit `placement` if needed
  2260. // and refer to originalPlacement to know the original value
  2261. var placement = computeAutoPlacement(options.placement, referenceOffsets, popper, reference, options.modifiers.flip.boundariesElement, options.modifiers.flip.padding);
  2262. popper.setAttribute('x-placement', placement);
  2263. // Apply `position` to popper before anything else because
  2264. // without the position applied we can't guarantee correct computations
  2265. setStyles(popper, { position: options.positionFixed ? 'fixed' : 'absolute' });
  2266. return options;
  2267. }
  2268. /**
  2269. * @function
  2270. * @memberof Popper.Utils
  2271. * @argument {Object} data - The data object generated by `update` method
  2272. * @argument {Boolean} shouldRound - If the offsets should be rounded at all
  2273. * @returns {Object} The popper's position offsets rounded
  2274. *
  2275. * The tale of pixel-perfect positioning. It's still not 100% perfect, but as
  2276. * good as it can be within reason.
  2277. * Discussion here: https://github.com/FezVrasta/popper.js/pull/715
  2278. *
  2279. * Low DPI screens cause a popper to be blurry if not using full pixels (Safari
  2280. * as well on High DPI screens).
  2281. *
  2282. * Firefox prefers no rounding for positioning and does not have blurriness on
  2283. * high DPI screens.
  2284. *
  2285. * Only horizontal placement and left/right values need to be considered.
  2286. */
  2287. function getRoundedOffsets(data, shouldRound) {
  2288. var _data$offsets = data.offsets,
  2289. popper = _data$offsets.popper,
  2290. reference = _data$offsets.reference;
  2291. var round = Math.round,
  2292. floor = Math.floor;
  2293. var noRound = function noRound(v) {
  2294. return v;
  2295. };
  2296. var referenceWidth = round(reference.width);
  2297. var popperWidth = round(popper.width);
  2298. var isVertical = ['left', 'right'].indexOf(data.placement) !== -1;
  2299. var isVariation = data.placement.indexOf('-') !== -1;
  2300. var sameWidthParity = referenceWidth % 2 === popperWidth % 2;
  2301. var bothOddWidth = referenceWidth % 2 === 1 && popperWidth % 2 === 1;
  2302. var horizontalToInteger = !shouldRound ? noRound : isVertical || isVariation || sameWidthParity ? round : floor;
  2303. var verticalToInteger = !shouldRound ? noRound : round;
  2304. return {
  2305. left: horizontalToInteger(bothOddWidth && !isVariation && shouldRound ? popper.left - 1 : popper.left),
  2306. top: verticalToInteger(popper.top),
  2307. bottom: verticalToInteger(popper.bottom),
  2308. right: horizontalToInteger(popper.right)
  2309. };
  2310. }
  2311. var isFirefox = isBrowser && /Firefox/i.test(navigator.userAgent);
  2312. /**
  2313. * @function
  2314. * @memberof Modifiers
  2315. * @argument {Object} data - The data object generated by `update` method
  2316. * @argument {Object} options - Modifiers configuration and options
  2317. * @returns {Object} The data object, properly modified
  2318. */
  2319. function computeStyle(data, options) {
  2320. var x = options.x,
  2321. y = options.y;
  2322. var popper = data.offsets.popper;
  2323. // Remove this legacy support in Popper.js v2
  2324. var legacyGpuAccelerationOption = find(data.instance.modifiers, function (modifier) {
  2325. return modifier.name === 'applyStyle';
  2326. }).gpuAcceleration;
  2327. if (legacyGpuAccelerationOption !== undefined) {
  2328. console.warn('WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!');
  2329. }
  2330. var gpuAcceleration = legacyGpuAccelerationOption !== undefined ? legacyGpuAccelerationOption : options.gpuAcceleration;
  2331. var offsetParent = getOffsetParent(data.instance.popper);
  2332. var offsetParentRect = getBoundingClientRect(offsetParent);
  2333. // Styles
  2334. var styles = {
  2335. position: popper.position
  2336. };
  2337. var offsets = getRoundedOffsets(data, window.devicePixelRatio < 2 || !isFirefox);
  2338. var sideA = x === 'bottom' ? 'top' : 'bottom';
  2339. var sideB = y === 'right' ? 'left' : 'right';
  2340. // if gpuAcceleration is set to `true` and transform is supported,
  2341. // we use `translate3d` to apply the position to the popper we
  2342. // automatically use the supported prefixed version if needed
  2343. var prefixedProperty = getSupportedPropertyName('transform');
  2344. // now, let's make a step back and look at this code closely (wtf?)
  2345. // If the content of the popper grows once it's been positioned, it
  2346. // may happen that the popper gets misplaced because of the new content
  2347. // overflowing its reference element
  2348. // To avoid this problem, we provide two options (x and y), which allow
  2349. // the consumer to define the offset origin.
  2350. // If we position a popper on top of a reference element, we can set
  2351. // `x` to `top` to make the popper grow towards its top instead of
  2352. // its bottom.
  2353. var left = void 0,
  2354. top = void 0;
  2355. if (sideA === 'bottom') {
  2356. // when offsetParent is <html> the positioning is relative to the bottom of the screen (excluding the scrollbar)
  2357. // and not the bottom of the html element
  2358. if (offsetParent.nodeName === 'HTML') {
  2359. top = -offsetParent.clientHeight + offsets.bottom;
  2360. } else {
  2361. top = -offsetParentRect.height + offsets.bottom;
  2362. }
  2363. } else {
  2364. top = offsets.top;
  2365. }
  2366. if (sideB === 'right') {
  2367. if (offsetParent.nodeName === 'HTML') {
  2368. left = -offsetParent.clientWidth + offsets.right;
  2369. } else {
  2370. left = -offsetParentRect.width + offsets.right;
  2371. }
  2372. } else {
  2373. left = offsets.left;
  2374. }
  2375. if (gpuAcceleration && prefixedProperty) {
  2376. styles[prefixedProperty] = 'translate3d(' + left + 'px, ' + top + 'px, 0)';
  2377. styles[sideA] = 0;
  2378. styles[sideB] = 0;
  2379. styles.willChange = 'transform';
  2380. } else {
  2381. // othwerise, we use the standard `top`, `left`, `bottom` and `right` properties
  2382. var invertTop = sideA === 'bottom' ? -1 : 1;
  2383. var invertLeft = sideB === 'right' ? -1 : 1;
  2384. styles[sideA] = top * invertTop;
  2385. styles[sideB] = left * invertLeft;
  2386. styles.willChange = sideA + ', ' + sideB;
  2387. }
  2388. // Attributes
  2389. var attributes = {
  2390. 'x-placement': data.placement
  2391. };
  2392. // Update `data` attributes, styles and arrowStyles
  2393. data.attributes = _extends({}, attributes, data.attributes);
  2394. data.styles = _extends({}, styles, data.styles);
  2395. data.arrowStyles = _extends({}, data.offsets.arrow, data.arrowStyles);
  2396. return data;
  2397. }
  2398. /**
  2399. * Helper used to know if the given modifier depends from another one.<br />
  2400. * It checks if the needed modifier is listed and enabled.
  2401. * @method
  2402. * @memberof Popper.Utils
  2403. * @param {Array} modifiers - list of modifiers
  2404. * @param {String} requestingName - name of requesting modifier
  2405. * @param {String} requestedName - name of requested modifier
  2406. * @returns {Boolean}
  2407. */
  2408. function isModifierRequired(modifiers, requestingName, requestedName) {
  2409. var requesting = find(modifiers, function (_ref) {
  2410. var name = _ref.name;
  2411. return name === requestingName;
  2412. });
  2413. var isRequired = !!requesting && modifiers.some(function (modifier) {
  2414. return modifier.name === requestedName && modifier.enabled && modifier.order < requesting.order;
  2415. });
  2416. if (!isRequired) {
  2417. var _requesting = '`' + requestingName + '`';
  2418. var requested = '`' + requestedName + '`';
  2419. console.warn(requested + ' modifier is required by ' + _requesting + ' modifier in order to work, be sure to include it before ' + _requesting + '!');
  2420. }
  2421. return isRequired;
  2422. }
  2423. /**
  2424. * @function
  2425. * @memberof Modifiers
  2426. * @argument {Object} data - The data object generated by update method
  2427. * @argument {Object} options - Modifiers configuration and options
  2428. * @returns {Object} The data object, properly modified
  2429. */
  2430. function arrow(data, options) {
  2431. var _data$offsets$arrow;
  2432. // arrow depends on keepTogether in order to work
  2433. if (!isModifierRequired(data.instance.modifiers, 'arrow', 'keepTogether')) {
  2434. return data;
  2435. }
  2436. var arrowElement = options.element;
  2437. // if arrowElement is a string, suppose it's a CSS selector
  2438. if (typeof arrowElement === 'string') {
  2439. arrowElement = data.instance.popper.querySelector(arrowElement);
  2440. // if arrowElement is not found, don't run the modifier
  2441. if (!arrowElement) {
  2442. return data;
  2443. }
  2444. } else {
  2445. // if the arrowElement isn't a query selector we must check that the
  2446. // provided DOM node is child of its popper node
  2447. if (!data.instance.popper.contains(arrowElement)) {
  2448. console.warn('WARNING: `arrow.element` must be child of its popper element!');
  2449. return data;
  2450. }
  2451. }
  2452. var placement = data.placement.split('-')[0];
  2453. var _data$offsets = data.offsets,
  2454. popper = _data$offsets.popper,
  2455. reference = _data$offsets.reference;
  2456. var isVertical = ['left', 'right'].indexOf(placement) !== -1;
  2457. var len = isVertical ? 'height' : 'width';
  2458. var sideCapitalized = isVertical ? 'Top' : 'Left';
  2459. var side = sideCapitalized.toLowerCase();
  2460. var altSide = isVertical ? 'left' : 'top';
  2461. var opSide = isVertical ? 'bottom' : 'right';
  2462. var arrowElementSize = getOuterSizes(arrowElement)[len];
  2463. //
  2464. // extends keepTogether behavior making sure the popper and its
  2465. // reference have enough pixels in conjunction
  2466. //
  2467. // top/left side
  2468. if (reference[opSide] - arrowElementSize < popper[side]) {
  2469. data.offsets.popper[side] -= popper[side] - (reference[opSide] - arrowElementSize);
  2470. }
  2471. // bottom/right side
  2472. if (reference[side] + arrowElementSize > popper[opSide]) {
  2473. data.offsets.popper[side] += reference[side] + arrowElementSize - popper[opSide];
  2474. }
  2475. data.offsets.popper = getClientRect(data.offsets.popper);
  2476. // compute center of the popper
  2477. var center = reference[side] + reference[len] / 2 - arrowElementSize / 2;
  2478. // Compute the sideValue using the updated popper offsets
  2479. // take popper margin in account because we don't have this info available
  2480. var css = getStyleComputedProperty(data.instance.popper);
  2481. var popperMarginSide = parseFloat(css['margin' + sideCapitalized], 10);
  2482. var popperBorderSide = parseFloat(css['border' + sideCapitalized + 'Width'], 10);
  2483. var sideValue = center - data.offsets.popper[side] - popperMarginSide - popperBorderSide;
  2484. // prevent arrowElement from being placed not contiguously to its popper
  2485. sideValue = Math.max(Math.min(popper[len] - arrowElementSize, sideValue), 0);
  2486. data.arrowElement = arrowElement;
  2487. data.offsets.arrow = (_data$offsets$arrow = {}, defineProperty(_data$offsets$arrow, side, Math.round(sideValue)), defineProperty(_data$offsets$arrow, altSide, ''), _data$offsets$arrow);
  2488. return data;
  2489. }
  2490. /**
  2491. * Get the opposite placement variation of the given one
  2492. * @method
  2493. * @memberof Popper.Utils
  2494. * @argument {String} placement variation
  2495. * @returns {String} flipped placement variation
  2496. */
  2497. function getOppositeVariation(variation) {
  2498. if (variation === 'end') {
  2499. return 'start';
  2500. } else if (variation === 'start') {
  2501. return 'end';
  2502. }
  2503. return variation;
  2504. }
  2505. /**
  2506. * List of accepted placements to use as values of the `placement` option.<br />
  2507. * Valid placements are:
  2508. * - `auto`
  2509. * - `top`
  2510. * - `right`
  2511. * - `bottom`
  2512. * - `left`
  2513. *
  2514. * Each placement can have a variation from this list:
  2515. * - `-start`
  2516. * - `-end`
  2517. *
  2518. * Variations are interpreted easily if you think of them as the left to right
  2519. * written languages. Horizontally (`top` and `bottom`), `start` is left and `end`
  2520. * is right.<br />
  2521. * Vertically (`left` and `right`), `start` is top and `end` is bottom.
  2522. *
  2523. * Some valid examples are:
  2524. * - `top-end` (on top of reference, right aligned)
  2525. * - `right-start` (on right of reference, top aligned)
  2526. * - `bottom` (on bottom, centered)
  2527. * - `auto-end` (on the side with more space available, alignment depends by placement)
  2528. *
  2529. * @static
  2530. * @type {Array}
  2531. * @enum {String}
  2532. * @readonly
  2533. * @method placements
  2534. * @memberof Popper
  2535. */
  2536. var placements = ['auto-start', 'auto', 'auto-end', 'top-start', 'top', 'top-end', 'right-start', 'right', 'right-end', 'bottom-end', 'bottom', 'bottom-start', 'left-end', 'left', 'left-start'];
  2537. // Get rid of `auto` `auto-start` and `auto-end`
  2538. var validPlacements = placements.slice(3);
  2539. /**
  2540. * Given an initial placement, returns all the subsequent placements
  2541. * clockwise (or counter-clockwise).
  2542. *
  2543. * @method
  2544. * @memberof Popper.Utils
  2545. * @argument {String} placement - A valid placement (it accepts variations)
  2546. * @argument {Boolean} counter - Set to true to walk the placements counterclockwise
  2547. * @returns {Array} placements including their variations
  2548. */
  2549. function clockwise(placement) {
  2550. var counter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  2551. var index = validPlacements.indexOf(placement);
  2552. var arr = validPlacements.slice(index + 1).concat(validPlacements.slice(0, index));
  2553. return counter ? arr.reverse() : arr;
  2554. }
  2555. var BEHAVIORS = {
  2556. FLIP: 'flip',
  2557. CLOCKWISE: 'clockwise',
  2558. COUNTERCLOCKWISE: 'counterclockwise'
  2559. };
  2560. /**
  2561. * @function
  2562. * @memberof Modifiers
  2563. * @argument {Object} data - The data object generated by update method
  2564. * @argument {Object} options - Modifiers configuration and options
  2565. * @returns {Object} The data object, properly modified
  2566. */
  2567. function flip(data, options) {
  2568. // if `inner` modifier is enabled, we can't use the `flip` modifier
  2569. if (isModifierEnabled(data.instance.modifiers, 'inner')) {
  2570. return data;
  2571. }
  2572. if (data.flipped && data.placement === data.originalPlacement) {
  2573. // seems like flip is trying to loop, probably there's not enough space on any of the flippable sides
  2574. return data;
  2575. }
  2576. var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, options.boundariesElement, data.positionFixed);
  2577. var placement = data.placement.split('-')[0];
  2578. var placementOpposite = getOppositePlacement(placement);
  2579. var variation = data.placement.split('-')[1] || '';
  2580. var flipOrder = [];
  2581. switch (options.behavior) {
  2582. case BEHAVIORS.FLIP:
  2583. flipOrder = [placement, placementOpposite];
  2584. break;
  2585. case BEHAVIORS.CLOCKWISE:
  2586. flipOrder = clockwise(placement);
  2587. break;
  2588. case BEHAVIORS.COUNTERCLOCKWISE:
  2589. flipOrder = clockwise(placement, true);
  2590. break;
  2591. default:
  2592. flipOrder = options.behavior;
  2593. }
  2594. flipOrder.forEach(function (step, index) {
  2595. if (placement !== step || flipOrder.length === index + 1) {
  2596. return data;
  2597. }
  2598. placement = data.placement.split('-')[0];
  2599. placementOpposite = getOppositePlacement(placement);
  2600. var popperOffsets = data.offsets.popper;
  2601. var refOffsets = data.offsets.reference;
  2602. // using floor because the reference offsets may contain decimals we are not going to consider here
  2603. var floor = Math.floor;
  2604. var overlapsRef = placement === 'left' && floor(popperOffsets.right) > floor(refOffsets.left) || placement === 'right' && floor(popperOffsets.left) < floor(refOffsets.right) || placement === 'top' && floor(popperOffsets.bottom) > floor(refOffsets.top) || placement === 'bottom' && floor(popperOffsets.top) < floor(refOffsets.bottom);
  2605. var overflowsLeft = floor(popperOffsets.left) < floor(boundaries.left);
  2606. var overflowsRight = floor(popperOffsets.right) > floor(boundaries.right);
  2607. var overflowsTop = floor(popperOffsets.top) < floor(boundaries.top);
  2608. var overflowsBottom = floor(popperOffsets.bottom) > floor(boundaries.bottom);
  2609. var overflowsBoundaries = placement === 'left' && overflowsLeft || placement === 'right' && overflowsRight || placement === 'top' && overflowsTop || placement === 'bottom' && overflowsBottom;
  2610. // flip the variation if required
  2611. var isVertical = ['top', 'bottom'].indexOf(placement) !== -1;
  2612. var flippedVariation = !!options.flipVariations && (isVertical && variation === 'start' && overflowsLeft || isVertical && variation === 'end' && overflowsRight || !isVertical && variation === 'start' && overflowsTop || !isVertical && variation === 'end' && overflowsBottom);
  2613. if (overlapsRef || overflowsBoundaries || flippedVariation) {
  2614. // this boolean to detect any flip loop
  2615. data.flipped = true;
  2616. if (overlapsRef || overflowsBoundaries) {
  2617. placement = flipOrder[index + 1];
  2618. }
  2619. if (flippedVariation) {
  2620. variation = getOppositeVariation(variation);
  2621. }
  2622. data.placement = placement + (variation ? '-' + variation : '');
  2623. // this object contains `position`, we want to preserve it along with
  2624. // any additional property we may add in the future
  2625. data.offsets.popper = _extends({}, data.offsets.popper, getPopperOffsets(data.instance.popper, data.offsets.reference, data.placement));
  2626. data = runModifiers(data.instance.modifiers, data, 'flip');
  2627. }
  2628. });
  2629. return data;
  2630. }
  2631. /**
  2632. * @function
  2633. * @memberof Modifiers
  2634. * @argument {Object} data - The data object generated by update method
  2635. * @argument {Object} options - Modifiers configuration and options
  2636. * @returns {Object} The data object, properly modified
  2637. */
  2638. function keepTogether(data) {
  2639. var _data$offsets = data.offsets,
  2640. popper = _data$offsets.popper,
  2641. reference = _data$offsets.reference;
  2642. var placement = data.placement.split('-')[0];
  2643. var floor = Math.floor;
  2644. var isVertical = ['top', 'bottom'].indexOf(placement) !== -1;
  2645. var side = isVertical ? 'right' : 'bottom';
  2646. var opSide = isVertical ? 'left' : 'top';
  2647. var measurement = isVertical ? 'width' : 'height';
  2648. if (popper[side] < floor(reference[opSide])) {
  2649. data.offsets.popper[opSide] = floor(reference[opSide]) - popper[measurement];
  2650. }
  2651. if (popper[opSide] > floor(reference[side])) {
  2652. data.offsets.popper[opSide] = floor(reference[side]);
  2653. }
  2654. return data;
  2655. }
  2656. /**
  2657. * Converts a string containing value + unit into a px value number
  2658. * @function
  2659. * @memberof {modifiers~offset}
  2660. * @private
  2661. * @argument {String} str - Value + unit string
  2662. * @argument {String} measurement - `height` or `width`
  2663. * @argument {Object} popperOffsets
  2664. * @argument {Object} referenceOffsets
  2665. * @returns {Number|String}
  2666. * Value in pixels, or original string if no values were extracted
  2667. */
  2668. function toValue(str, measurement, popperOffsets, referenceOffsets) {
  2669. // separate value from unit
  2670. var split = str.match(/((?:\-|\+)?\d*\.?\d*)(.*)/);
  2671. var value = +split[1];
  2672. var unit = split[2];
  2673. // If it's not a number it's an operator, I guess
  2674. if (!value) {
  2675. return str;
  2676. }
  2677. if (unit.indexOf('%') === 0) {
  2678. var element = void 0;
  2679. switch (unit) {
  2680. case '%p':
  2681. element = popperOffsets;
  2682. break;
  2683. case '%':
  2684. case '%r':
  2685. default:
  2686. element = referenceOffsets;
  2687. }
  2688. var rect = getClientRect(element);
  2689. return rect[measurement] / 100 * value;
  2690. } else if (unit === 'vh' || unit === 'vw') {
  2691. // if is a vh or vw, we calculate the size based on the viewport
  2692. var size = void 0;
  2693. if (unit === 'vh') {
  2694. size = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
  2695. } else {
  2696. size = Math.max(document.documentElement.clientWidth, window.innerWidth || 0);
  2697. }
  2698. return size / 100 * value;
  2699. } else {
  2700. // if is an explicit pixel unit, we get rid of the unit and keep the value
  2701. // if is an implicit unit, it's px, and we return just the value
  2702. return value;
  2703. }
  2704. }
  2705. /**
  2706. * Parse an `offset` string to extrapolate `x` and `y` numeric offsets.
  2707. * @function
  2708. * @memberof {modifiers~offset}
  2709. * @private
  2710. * @argument {String} offset
  2711. * @argument {Object} popperOffsets
  2712. * @argument {Object} referenceOffsets
  2713. * @argument {String} basePlacement
  2714. * @returns {Array} a two cells array with x and y offsets in numbers
  2715. */
  2716. function parseOffset(offset, popperOffsets, referenceOffsets, basePlacement) {
  2717. var offsets = [0, 0];
  2718. // Use height if placement is left or right and index is 0 otherwise use width
  2719. // in this way the first offset will use an axis and the second one
  2720. // will use the other one
  2721. var useHeight = ['right', 'left'].indexOf(basePlacement) !== -1;
  2722. // Split the offset string to obtain a list of values and operands
  2723. // The regex addresses values with the plus or minus sign in front (+10, -20, etc)
  2724. var fragments = offset.split(/(\+|\-)/).map(function (frag) {
  2725. return frag.trim();
  2726. });
  2727. // Detect if the offset string contains a pair of values or a single one
  2728. // they could be separated by comma or space
  2729. var divider = fragments.indexOf(find(fragments, function (frag) {
  2730. return frag.search(/,|\s/) !== -1;
  2731. }));
  2732. if (fragments[divider] && fragments[divider].indexOf(',') === -1) {
  2733. console.warn('Offsets separated by white space(s) are deprecated, use a comma (,) instead.');
  2734. }
  2735. // If divider is found, we divide the list of values and operands to divide
  2736. // them by ofset X and Y.
  2737. var splitRegex = /\s*,\s*|\s+/;
  2738. var ops = divider !== -1 ? [fragments.slice(0, divider).concat([fragments[divider].split(splitRegex)[0]]), [fragments[divider].split(splitRegex)[1]].concat(fragments.slice(divider + 1))] : [fragments];
  2739. // Convert the values with units to absolute pixels to allow our computations
  2740. ops = ops.map(function (op, index) {
  2741. // Most of the units rely on the orientation of the popper
  2742. var measurement = (index === 1 ? !useHeight : useHeight) ? 'height' : 'width';
  2743. var mergeWithPrevious = false;
  2744. return op
  2745. // This aggregates any `+` or `-` sign that aren't considered operators
  2746. // e.g.: 10 + +5 => [10, +, +5]
  2747. .reduce(function (a, b) {
  2748. if (a[a.length - 1] === '' && ['+', '-'].indexOf(b) !== -1) {
  2749. a[a.length - 1] = b;
  2750. mergeWithPrevious = true;
  2751. return a;
  2752. } else if (mergeWithPrevious) {
  2753. a[a.length - 1] += b;
  2754. mergeWithPrevious = false;
  2755. return a;
  2756. } else {
  2757. return a.concat(b);
  2758. }
  2759. }, [])
  2760. // Here we convert the string values into number values (in px)
  2761. .map(function (str) {
  2762. return toValue(str, measurement, popperOffsets, referenceOffsets);
  2763. });
  2764. });
  2765. // Loop trough the offsets arrays and execute the operations
  2766. ops.forEach(function (op, index) {
  2767. op.forEach(function (frag, index2) {
  2768. if (isNumeric(frag)) {
  2769. offsets[index] += frag * (op[index2 - 1] === '-' ? -1 : 1);
  2770. }
  2771. });
  2772. });
  2773. return offsets;
  2774. }
  2775. /**
  2776. * @function
  2777. * @memberof Modifiers
  2778. * @argument {Object} data - The data object generated by update method
  2779. * @argument {Object} options - Modifiers configuration and options
  2780. * @argument {Number|String} options.offset=0
  2781. * The offset value as described in the modifier description
  2782. * @returns {Object} The data object, properly modified
  2783. */
  2784. function offset(data, _ref) {
  2785. var offset = _ref.offset;
  2786. var placement = data.placement,
  2787. _data$offsets = data.offsets,
  2788. popper = _data$offsets.popper,
  2789. reference = _data$offsets.reference;
  2790. var basePlacement = placement.split('-')[0];
  2791. var offsets = void 0;
  2792. if (isNumeric(+offset)) {
  2793. offsets = [+offset, 0];
  2794. } else {
  2795. offsets = parseOffset(offset, popper, reference, basePlacement);
  2796. }
  2797. if (basePlacement === 'left') {
  2798. popper.top += offsets[0];
  2799. popper.left -= offsets[1];
  2800. } else if (basePlacement === 'right') {
  2801. popper.top += offsets[0];
  2802. popper.left += offsets[1];
  2803. } else if (basePlacement === 'top') {
  2804. popper.left += offsets[0];
  2805. popper.top -= offsets[1];
  2806. } else if (basePlacement === 'bottom') {
  2807. popper.left += offsets[0];
  2808. popper.top += offsets[1];
  2809. }
  2810. data.popper = popper;
  2811. return data;
  2812. }
  2813. /**
  2814. * @function
  2815. * @memberof Modifiers
  2816. * @argument {Object} data - The data object generated by `update` method
  2817. * @argument {Object} options - Modifiers configuration and options
  2818. * @returns {Object} The data object, properly modified
  2819. */
  2820. function preventOverflow(data, options) {
  2821. var boundariesElement = options.boundariesElement || getOffsetParent(data.instance.popper);
  2822. // If offsetParent is the reference element, we really want to
  2823. // go one step up and use the next offsetParent as reference to
  2824. // avoid to make this modifier completely useless and look like broken
  2825. if (data.instance.reference === boundariesElement) {
  2826. boundariesElement = getOffsetParent(boundariesElement);
  2827. }
  2828. // NOTE: DOM access here
  2829. // resets the popper's position so that the document size can be calculated excluding
  2830. // the size of the popper element itself
  2831. var transformProp = getSupportedPropertyName('transform');
  2832. var popperStyles = data.instance.popper.style; // assignment to help minification
  2833. var top = popperStyles.top,
  2834. left = popperStyles.left,
  2835. transform = popperStyles[transformProp];
  2836. popperStyles.top = '';
  2837. popperStyles.left = '';
  2838. popperStyles[transformProp] = '';
  2839. var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, boundariesElement, data.positionFixed);
  2840. // NOTE: DOM access here
  2841. // restores the original style properties after the offsets have been computed
  2842. popperStyles.top = top;
  2843. popperStyles.left = left;
  2844. popperStyles[transformProp] = transform;
  2845. options.boundaries = boundaries;
  2846. var order = options.priority;
  2847. var popper = data.offsets.popper;
  2848. var check = {
  2849. primary: function primary(placement) {
  2850. var value = popper[placement];
  2851. if (popper[placement] < boundaries[placement] && !options.escapeWithReference) {
  2852. value = Math.max(popper[placement], boundaries[placement]);
  2853. }
  2854. return defineProperty({}, placement, value);
  2855. },
  2856. secondary: function secondary(placement) {
  2857. var mainSide = placement === 'right' ? 'left' : 'top';
  2858. var value = popper[mainSide];
  2859. if (popper[placement] > boundaries[placement] && !options.escapeWithReference) {
  2860. value = Math.min(popper[mainSide], boundaries[placement] - (placement === 'right' ? popper.width : popper.height));
  2861. }
  2862. return defineProperty({}, mainSide, value);
  2863. }
  2864. };
  2865. order.forEach(function (placement) {
  2866. var side = ['left', 'top'].indexOf(placement) !== -1 ? 'primary' : 'secondary';
  2867. popper = _extends({}, popper, check[side](placement));
  2868. });
  2869. data.offsets.popper = popper;
  2870. return data;
  2871. }
  2872. /**
  2873. * @function
  2874. * @memberof Modifiers
  2875. * @argument {Object} data - The data object generated by `update` method
  2876. * @argument {Object} options - Modifiers configuration and options
  2877. * @returns {Object} The data object, properly modified
  2878. */
  2879. function shift(data) {
  2880. var placement = data.placement;
  2881. var basePlacement = placement.split('-')[0];
  2882. var shiftvariation = placement.split('-')[1];
  2883. // if shift shiftvariation is specified, run the modifier
  2884. if (shiftvariation) {
  2885. var _data$offsets = data.offsets,
  2886. reference = _data$offsets.reference,
  2887. popper = _data$offsets.popper;
  2888. var isVertical = ['bottom', 'top'].indexOf(basePlacement) !== -1;
  2889. var side = isVertical ? 'left' : 'top';
  2890. var measurement = isVertical ? 'width' : 'height';
  2891. var shiftOffsets = {
  2892. start: defineProperty({}, side, reference[side]),
  2893. end: defineProperty({}, side, reference[side] + reference[measurement] - popper[measurement])
  2894. };
  2895. data.offsets.popper = _extends({}, popper, shiftOffsets[shiftvariation]);
  2896. }
  2897. return data;
  2898. }
  2899. /**
  2900. * @function
  2901. * @memberof Modifiers
  2902. * @argument {Object} data - The data object generated by update method
  2903. * @argument {Object} options - Modifiers configuration and options
  2904. * @returns {Object} The data object, properly modified
  2905. */
  2906. function hide(data) {
  2907. if (!isModifierRequired(data.instance.modifiers, 'hide', 'preventOverflow')) {
  2908. return data;
  2909. }
  2910. var refRect = data.offsets.reference;
  2911. var bound = find(data.instance.modifiers, function (modifier) {
  2912. return modifier.name === 'preventOverflow';
  2913. }).boundaries;
  2914. if (refRect.bottom < bound.top || refRect.left > bound.right || refRect.top > bound.bottom || refRect.right < bound.left) {
  2915. // Avoid unnecessary DOM access if visibility hasn't changed
  2916. if (data.hide === true) {
  2917. return data;
  2918. }
  2919. data.hide = true;
  2920. data.attributes['x-out-of-boundaries'] = '';
  2921. } else {
  2922. // Avoid unnecessary DOM access if visibility hasn't changed
  2923. if (data.hide === false) {
  2924. return data;
  2925. }
  2926. data.hide = false;
  2927. data.attributes['x-out-of-boundaries'] = false;
  2928. }
  2929. return data;
  2930. }
  2931. /**
  2932. * @function
  2933. * @memberof Modifiers
  2934. * @argument {Object} data - The data object generated by `update` method
  2935. * @argument {Object} options - Modifiers configuration and options
  2936. * @returns {Object} The data object, properly modified
  2937. */
  2938. function inner(data) {
  2939. var placement = data.placement;
  2940. var basePlacement = placement.split('-')[0];
  2941. var _data$offsets = data.offsets,
  2942. popper = _data$offsets.popper,
  2943. reference = _data$offsets.reference;
  2944. var isHoriz = ['left', 'right'].indexOf(basePlacement) !== -1;
  2945. var subtractLength = ['top', 'left'].indexOf(basePlacement) === -1;
  2946. popper[isHoriz ? 'left' : 'top'] = reference[basePlacement] - (subtractLength ? popper[isHoriz ? 'width' : 'height'] : 0);
  2947. data.placement = getOppositePlacement(placement);
  2948. data.offsets.popper = getClientRect(popper);
  2949. return data;
  2950. }
  2951. /**
  2952. * Modifier function, each modifier can have a function of this type assigned
  2953. * to its `fn` property.<br />
  2954. * These functions will be called on each update, this means that you must
  2955. * make sure they are performant enough to avoid performance bottlenecks.
  2956. *
  2957. * @function ModifierFn
  2958. * @argument {dataObject} data - The data object generated by `update` method
  2959. * @argument {Object} options - Modifiers configuration and options
  2960. * @returns {dataObject} The data object, properly modified
  2961. */
  2962. /**
  2963. * Modifiers are plugins used to alter the behavior of your poppers.<br />
  2964. * Popper.js uses a set of 9 modifiers to provide all the basic functionalities
  2965. * needed by the library.
  2966. *
  2967. * Usually you don't want to override the `order`, `fn` and `onLoad` props.
  2968. * All the other properties are configurations that could be tweaked.
  2969. * @namespace modifiers
  2970. */
  2971. var modifiers = {
  2972. /**
  2973. * Modifier used to shift the popper on the start or end of its reference
  2974. * element.<br />
  2975. * It will read the variation of the `placement` property.<br />
  2976. * It can be one either `-end` or `-start`.
  2977. * @memberof modifiers
  2978. * @inner
  2979. */
  2980. shift: {
  2981. /** @prop {number} order=100 - Index used to define the order of execution */
  2982. order: 100,
  2983. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  2984. enabled: true,
  2985. /** @prop {ModifierFn} */
  2986. fn: shift
  2987. },
  2988. /**
  2989. * The `offset` modifier can shift your popper on both its axis.
  2990. *
  2991. * It accepts the following units:
  2992. * - `px` or unit-less, interpreted as pixels
  2993. * - `%` or `%r`, percentage relative to the length of the reference element
  2994. * - `%p`, percentage relative to the length of the popper element
  2995. * - `vw`, CSS viewport width unit
  2996. * - `vh`, CSS viewport height unit
  2997. *
  2998. * For length is intended the main axis relative to the placement of the popper.<br />
  2999. * This means that if the placement is `top` or `bottom`, the length will be the
  3000. * `width`. In case of `left` or `right`, it will be the `height`.
  3001. *
  3002. * You can provide a single value (as `Number` or `String`), or a pair of values
  3003. * as `String` divided by a comma or one (or more) white spaces.<br />
  3004. * The latter is a deprecated method because it leads to confusion and will be
  3005. * removed in v2.<br />
  3006. * Additionally, it accepts additions and subtractions between different units.
  3007. * Note that multiplications and divisions aren't supported.
  3008. *
  3009. * Valid examples are:
  3010. * ```
  3011. * 10
  3012. * '10%'
  3013. * '10, 10'
  3014. * '10%, 10'
  3015. * '10 + 10%'
  3016. * '10 - 5vh + 3%'
  3017. * '-10px + 5vh, 5px - 6%'
  3018. * ```
  3019. * > **NB**: If you desire to apply offsets to your poppers in a way that may make them overlap
  3020. * > with their reference element, unfortunately, you will have to disable the `flip` modifier.
  3021. * > You can read more on this at this [issue](https://github.com/FezVrasta/popper.js/issues/373).
  3022. *
  3023. * @memberof modifiers
  3024. * @inner
  3025. */
  3026. offset: {
  3027. /** @prop {number} order=200 - Index used to define the order of execution */
  3028. order: 200,
  3029. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  3030. enabled: true,
  3031. /** @prop {ModifierFn} */
  3032. fn: offset,
  3033. /** @prop {Number|String} offset=0
  3034. * The offset value as described in the modifier description
  3035. */
  3036. offset: 0
  3037. },
  3038. /**
  3039. * Modifier used to prevent the popper from being positioned outside the boundary.
  3040. *
  3041. * A scenario exists where the reference itself is not within the boundaries.<br />
  3042. * We can say it has "escaped the boundaries" — or just "escaped".<br />
  3043. * In this case we need to decide whether the popper should either:
  3044. *
  3045. * - detach from the reference and remain "trapped" in the boundaries, or
  3046. * - if it should ignore the boundary and "escape with its reference"
  3047. *
  3048. * When `escapeWithReference` is set to`true` and reference is completely
  3049. * outside its boundaries, the popper will overflow (or completely leave)
  3050. * the boundaries in order to remain attached to the edge of the reference.
  3051. *
  3052. * @memberof modifiers
  3053. * @inner
  3054. */
  3055. preventOverflow: {
  3056. /** @prop {number} order=300 - Index used to define the order of execution */
  3057. order: 300,
  3058. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  3059. enabled: true,
  3060. /** @prop {ModifierFn} */
  3061. fn: preventOverflow,
  3062. /**
  3063. * @prop {Array} [priority=['left','right','top','bottom']]
  3064. * Popper will try to prevent overflow following these priorities by default,
  3065. * then, it could overflow on the left and on top of the `boundariesElement`
  3066. */
  3067. priority: ['left', 'right', 'top', 'bottom'],
  3068. /**
  3069. * @prop {number} padding=5
  3070. * Amount of pixel used to define a minimum distance between the boundaries
  3071. * and the popper. This makes sure the popper always has a little padding
  3072. * between the edges of its container
  3073. */
  3074. padding: 5,
  3075. /**
  3076. * @prop {String|HTMLElement} boundariesElement='scrollParent'
  3077. * Boundaries used by the modifier. Can be `scrollParent`, `window`,
  3078. * `viewport` or any DOM element.
  3079. */
  3080. boundariesElement: 'scrollParent'
  3081. },
  3082. /**
  3083. * Modifier used to make sure the reference and its popper stay near each other
  3084. * without leaving any gap between the two. Especially useful when the arrow is
  3085. * enabled and you want to ensure that it points to its reference element.
  3086. * It cares only about the first axis. You can still have poppers with margin
  3087. * between the popper and its reference element.
  3088. * @memberof modifiers
  3089. * @inner
  3090. */
  3091. keepTogether: {
  3092. /** @prop {number} order=400 - Index used to define the order of execution */
  3093. order: 400,
  3094. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  3095. enabled: true,
  3096. /** @prop {ModifierFn} */
  3097. fn: keepTogether
  3098. },
  3099. /**
  3100. * This modifier is used to move the `arrowElement` of the popper to make
  3101. * sure it is positioned between the reference element and its popper element.
  3102. * It will read the outer size of the `arrowElement` node to detect how many
  3103. * pixels of conjunction are needed.
  3104. *
  3105. * It has no effect if no `arrowElement` is provided.
  3106. * @memberof modifiers
  3107. * @inner
  3108. */
  3109. arrow: {
  3110. /** @prop {number} order=500 - Index used to define the order of execution */
  3111. order: 500,
  3112. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  3113. enabled: true,
  3114. /** @prop {ModifierFn} */
  3115. fn: arrow,
  3116. /** @prop {String|HTMLElement} element='[x-arrow]' - Selector or node used as arrow */
  3117. element: '[x-arrow]'
  3118. },
  3119. /**
  3120. * Modifier used to flip the popper's placement when it starts to overlap its
  3121. * reference element.
  3122. *
  3123. * Requires the `preventOverflow` modifier before it in order to work.
  3124. *
  3125. * **NOTE:** this modifier will interrupt the current update cycle and will
  3126. * restart it if it detects the need to flip the placement.
  3127. * @memberof modifiers
  3128. * @inner
  3129. */
  3130. flip: {
  3131. /** @prop {number} order=600 - Index used to define the order of execution */
  3132. order: 600,
  3133. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  3134. enabled: true,
  3135. /** @prop {ModifierFn} */
  3136. fn: flip,
  3137. /**
  3138. * @prop {String|Array} behavior='flip'
  3139. * The behavior used to change the popper's placement. It can be one of
  3140. * `flip`, `clockwise`, `counterclockwise` or an array with a list of valid
  3141. * placements (with optional variations)
  3142. */
  3143. behavior: 'flip',
  3144. /**
  3145. * @prop {number} padding=5
  3146. * The popper will flip if it hits the edges of the `boundariesElement`
  3147. */
  3148. padding: 5,
  3149. /**
  3150. * @prop {String|HTMLElement} boundariesElement='viewport'
  3151. * The element which will define the boundaries of the popper position.
  3152. * The popper will never be placed outside of the defined boundaries
  3153. * (except if `keepTogether` is enabled)
  3154. */
  3155. boundariesElement: 'viewport'
  3156. },
  3157. /**
  3158. * Modifier used to make the popper flow toward the inner of the reference element.
  3159. * By default, when this modifier is disabled, the popper will be placed outside
  3160. * the reference element.
  3161. * @memberof modifiers
  3162. * @inner
  3163. */
  3164. inner: {
  3165. /** @prop {number} order=700 - Index used to define the order of execution */
  3166. order: 700,
  3167. /** @prop {Boolean} enabled=false - Whether the modifier is enabled or not */
  3168. enabled: false,
  3169. /** @prop {ModifierFn} */
  3170. fn: inner
  3171. },
  3172. /**
  3173. * Modifier used to hide the popper when its reference element is outside of the
  3174. * popper boundaries. It will set a `x-out-of-boundaries` attribute which can
  3175. * be used to hide with a CSS selector the popper when its reference is
  3176. * out of boundaries.
  3177. *
  3178. * Requires the `preventOverflow` modifier before it in order to work.
  3179. * @memberof modifiers
  3180. * @inner
  3181. */
  3182. hide: {
  3183. /** @prop {number} order=800 - Index used to define the order of execution */
  3184. order: 800,
  3185. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  3186. enabled: true,
  3187. /** @prop {ModifierFn} */
  3188. fn: hide
  3189. },
  3190. /**
  3191. * Computes the style that will be applied to the popper element to gets
  3192. * properly positioned.
  3193. *
  3194. * Note that this modifier will not touch the DOM, it just prepares the styles
  3195. * so that `applyStyle` modifier can apply it. This separation is useful
  3196. * in case you need to replace `applyStyle` with a custom implementation.
  3197. *
  3198. * This modifier has `850` as `order` value to maintain backward compatibility
  3199. * with previous versions of Popper.js. Expect the modifiers ordering method
  3200. * to change in future major versions of the library.
  3201. *
  3202. * @memberof modifiers
  3203. * @inner
  3204. */
  3205. computeStyle: {
  3206. /** @prop {number} order=850 - Index used to define the order of execution */
  3207. order: 850,
  3208. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  3209. enabled: true,
  3210. /** @prop {ModifierFn} */
  3211. fn: computeStyle,
  3212. /**
  3213. * @prop {Boolean} gpuAcceleration=true
  3214. * If true, it uses the CSS 3D transformation to position the popper.
  3215. * Otherwise, it will use the `top` and `left` properties
  3216. */
  3217. gpuAcceleration: true,
  3218. /**
  3219. * @prop {string} [x='bottom']
  3220. * Where to anchor the X axis (`bottom` or `top`). AKA X offset origin.
  3221. * Change this if your popper should grow in a direction different from `bottom`
  3222. */
  3223. x: 'bottom',
  3224. /**
  3225. * @prop {string} [x='left']
  3226. * Where to anchor the Y axis (`left` or `right`). AKA Y offset origin.
  3227. * Change this if your popper should grow in a direction different from `right`
  3228. */
  3229. y: 'right'
  3230. },
  3231. /**
  3232. * Applies the computed styles to the popper element.
  3233. *
  3234. * All the DOM manipulations are limited to this modifier. This is useful in case
  3235. * you want to integrate Popper.js inside a framework or view library and you
  3236. * want to delegate all the DOM manipulations to it.
  3237. *
  3238. * Note that if you disable this modifier, you must make sure the popper element
  3239. * has its position set to `absolute` before Popper.js can do its work!
  3240. *
  3241. * Just disable this modifier and define your own to achieve the desired effect.
  3242. *
  3243. * @memberof modifiers
  3244. * @inner
  3245. */
  3246. applyStyle: {
  3247. /** @prop {number} order=900 - Index used to define the order of execution */
  3248. order: 900,
  3249. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  3250. enabled: true,
  3251. /** @prop {ModifierFn} */
  3252. fn: applyStyle,
  3253. /** @prop {Function} */
  3254. onLoad: applyStyleOnLoad,
  3255. /**
  3256. * @deprecated since version 1.10.0, the property moved to `computeStyle` modifier
  3257. * @prop {Boolean} gpuAcceleration=true
  3258. * If true, it uses the CSS 3D transformation to position the popper.
  3259. * Otherwise, it will use the `top` and `left` properties
  3260. */
  3261. gpuAcceleration: undefined
  3262. }
  3263. };
  3264. /**
  3265. * The `dataObject` is an object containing all the information used by Popper.js.
  3266. * This object is passed to modifiers and to the `onCreate` and `onUpdate` callbacks.
  3267. * @name dataObject
  3268. * @property {Object} data.instance The Popper.js instance
  3269. * @property {String} data.placement Placement applied to popper
  3270. * @property {String} data.originalPlacement Placement originally defined on init
  3271. * @property {Boolean} data.flipped True if popper has been flipped by flip modifier
  3272. * @property {Boolean} data.hide True if the reference element is out of boundaries, useful to know when to hide the popper
  3273. * @property {HTMLElement} data.arrowElement Node used as arrow by arrow modifier
  3274. * @property {Object} data.styles Any CSS property defined here will be applied to the popper. It expects the JavaScript nomenclature (eg. `marginBottom`)
  3275. * @property {Object} data.arrowStyles Any CSS property defined here will be applied to the popper arrow. It expects the JavaScript nomenclature (eg. `marginBottom`)
  3276. * @property {Object} data.boundaries Offsets of the popper boundaries
  3277. * @property {Object} data.offsets The measurements of popper, reference and arrow elements
  3278. * @property {Object} data.offsets.popper `top`, `left`, `width`, `height` values
  3279. * @property {Object} data.offsets.reference `top`, `left`, `width`, `height` values
  3280. * @property {Object} data.offsets.arrow] `top` and `left` offsets, only one of them will be different from 0
  3281. */
  3282. /**
  3283. * Default options provided to Popper.js constructor.<br />
  3284. * These can be overridden using the `options` argument of Popper.js.<br />
  3285. * To override an option, simply pass an object with the same
  3286. * structure of the `options` object, as the 3rd argument. For example:
  3287. * ```
  3288. * new Popper(ref, pop, {
  3289. * modifiers: {
  3290. * preventOverflow: { enabled: false }
  3291. * }
  3292. * })
  3293. * ```
  3294. * @type {Object}
  3295. * @static
  3296. * @memberof Popper
  3297. */
  3298. var Defaults = {
  3299. /**
  3300. * Popper's placement.
  3301. * @prop {Popper.placements} placement='bottom'
  3302. */
  3303. placement: 'bottom',
  3304. /**
  3305. * Set this to true if you want popper to position it self in 'fixed' mode
  3306. * @prop {Boolean} positionFixed=false
  3307. */
  3308. positionFixed: false,
  3309. /**
  3310. * Whether events (resize, scroll) are initially enabled.
  3311. * @prop {Boolean} eventsEnabled=true
  3312. */
  3313. eventsEnabled: true,
  3314. /**
  3315. * Set to true if you want to automatically remove the popper when
  3316. * you call the `destroy` method.
  3317. * @prop {Boolean} removeOnDestroy=false
  3318. */
  3319. removeOnDestroy: false,
  3320. /**
  3321. * Callback called when the popper is created.<br />
  3322. * By default, it is set to no-op.<br />
  3323. * Access Popper.js instance with `data.instance`.
  3324. * @prop {onCreate}
  3325. */
  3326. onCreate: function onCreate() { },
  3327. /**
  3328. * Callback called when the popper is updated. This callback is not called
  3329. * on the initialization/creation of the popper, but only on subsequent
  3330. * updates.<br />
  3331. * By default, it is set to no-op.<br />
  3332. * Access Popper.js instance with `data.instance`.
  3333. * @prop {onUpdate}
  3334. */
  3335. onUpdate: function onUpdate() { },
  3336. /**
  3337. * List of modifiers used to modify the offsets before they are applied to the popper.
  3338. * They provide most of the functionalities of Popper.js.
  3339. * @prop {modifiers}
  3340. */
  3341. modifiers: modifiers
  3342. };
  3343. /**
  3344. * @callback onCreate
  3345. * @param {dataObject} data
  3346. */
  3347. /**
  3348. * @callback onUpdate
  3349. * @param {dataObject} data
  3350. */
  3351. // Utils
  3352. // Methods
  3353. var Popper = function () {
  3354. /**
  3355. * Creates a new Popper.js instance.
  3356. * @class Popper
  3357. * @param {HTMLElement|referenceObject} reference - The reference element used to position the popper
  3358. * @param {HTMLElement} popper - The HTML element used as the popper
  3359. * @param {Object} options - Your custom options to override the ones defined in [Defaults](#defaults)
  3360. * @return {Object} instance - The generated Popper.js instance
  3361. */
  3362. function Popper(reference, popper) {
  3363. var _this = this;
  3364. var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  3365. classCallCheck(this, Popper);
  3366. this.scheduleUpdate = function () {
  3367. return requestAnimationFrame(_this.update);
  3368. };
  3369. // make update() debounced, so that it only runs at most once-per-tick
  3370. this.update = debounce(this.update.bind(this));
  3371. // with {} we create a new object with the options inside it
  3372. this.options = _extends({}, Popper.Defaults, options);
  3373. // init state
  3374. this.state = {
  3375. isDestroyed: false,
  3376. isCreated: false,
  3377. scrollParents: []
  3378. };
  3379. // get reference and popper elements (allow jQuery wrappers)
  3380. this.reference = reference && reference.jquery ? reference[0] : reference;
  3381. this.popper = popper && popper.jquery ? popper[0] : popper;
  3382. // Deep merge modifiers options
  3383. this.options.modifiers = {};
  3384. Object.keys(_extends({}, Popper.Defaults.modifiers, options.modifiers)).forEach(function (name) {
  3385. _this.options.modifiers[name] = _extends({}, Popper.Defaults.modifiers[name] || {}, options.modifiers ? options.modifiers[name] : {});
  3386. });
  3387. // Refactoring modifiers' list (Object => Array)
  3388. this.modifiers = Object.keys(this.options.modifiers).map(function (name) {
  3389. return _extends({
  3390. name: name
  3391. }, _this.options.modifiers[name]);
  3392. })
  3393. // sort the modifiers by order
  3394. .sort(function (a, b) {
  3395. return a.order - b.order;
  3396. });
  3397. // modifiers have the ability to execute arbitrary code when Popper.js get inited
  3398. // such code is executed in the same order of its modifier
  3399. // they could add new properties to their options configuration
  3400. // BE AWARE: don't add options to `options.modifiers.name` but to `modifierOptions`!
  3401. this.modifiers.forEach(function (modifierOptions) {
  3402. if (modifierOptions.enabled && isFunction(modifierOptions.onLoad)) {
  3403. modifierOptions.onLoad(_this.reference, _this.popper, _this.options, modifierOptions, _this.state);
  3404. }
  3405. });
  3406. // fire the first update to position the popper in the right place
  3407. this.update();
  3408. var eventsEnabled = this.options.eventsEnabled;
  3409. if (eventsEnabled) {
  3410. // setup event listeners, they will take care of update the position in specific situations
  3411. this.enableEventListeners();
  3412. }
  3413. this.state.eventsEnabled = eventsEnabled;
  3414. }
  3415. // We can't use class properties because they don't get listed in the
  3416. // class prototype and break stuff like Sinon stubs
  3417. createClass(Popper, [{
  3418. key: 'update',
  3419. value: function update$$1() {
  3420. return update.call(this);
  3421. }
  3422. }, {
  3423. key: 'destroy',
  3424. value: function destroy$$1() {
  3425. return destroy.call(this);
  3426. }
  3427. }, {
  3428. key: 'enableEventListeners',
  3429. value: function enableEventListeners$$1() {
  3430. return enableEventListeners.call(this);
  3431. }
  3432. }, {
  3433. key: 'disableEventListeners',
  3434. value: function disableEventListeners$$1() {
  3435. return disableEventListeners.call(this);
  3436. }
  3437. /**
  3438. * Schedules an update. It will run on the next UI update available.
  3439. * @method scheduleUpdate
  3440. * @memberof Popper
  3441. */
  3442. /**
  3443. * Collection of utilities useful when writing custom modifiers.
  3444. * Starting from version 1.7, this method is available only if you
  3445. * include `popper-utils.js` before `popper.js`.
  3446. *
  3447. * **DEPRECATION**: This way to access PopperUtils is deprecated
  3448. * and will be removed in v2! Use the PopperUtils module directly instead.
  3449. * Due to the high instability of the methods contained in Utils, we can't
  3450. * guarantee them to follow semver. Use them at your own risk!
  3451. * @static
  3452. * @private
  3453. * @type {Object}
  3454. * @deprecated since version 1.8
  3455. * @member Utils
  3456. * @memberof Popper
  3457. */
  3458. }]);
  3459. return Popper;
  3460. }();
  3461. /**
  3462. * The `referenceObject` is an object that provides an interface compatible with Popper.js
  3463. * and lets you use it as replacement of a real DOM node.<br />
  3464. * You can use this method to position a popper relatively to a set of coordinates
  3465. * in case you don't have a DOM node to use as reference.
  3466. *
  3467. * ```
  3468. * new Popper(referenceObject, popperNode);
  3469. * ```
  3470. *
  3471. * NB: This feature isn't supported in Internet Explorer 10.
  3472. * @name referenceObject
  3473. * @property {Function} data.getBoundingClientRect
  3474. * A function that returns a set of coordinates compatible with the native `getBoundingClientRect` method.
  3475. * @property {number} data.clientWidth
  3476. * An ES6 getter that will return the width of the virtual reference element.
  3477. * @property {number} data.clientHeight
  3478. * An ES6 getter that will return the height of the virtual reference element.
  3479. */
  3480. Popper.Utils = (typeof window !== 'undefined' ? window : global).PopperUtils;
  3481. Popper.placements = placements;
  3482. Popper.Defaults = Defaults;
  3483. /**
  3484. * ------------------------------------------------------------------------
  3485. * Constants
  3486. * ------------------------------------------------------------------------
  3487. */
  3488. var NAME$4 = 'dropdown';
  3489. var VERSION$4 = '4.3.1';
  3490. var DATA_KEY$4 = 'bs.dropdown';
  3491. var EVENT_KEY$4 = "." + DATA_KEY$4;
  3492. var DATA_API_KEY$4 = '.data-api';
  3493. var JQUERY_NO_CONFLICT$4 = $.fn[NAME$4];
  3494. var ESCAPE_KEYCODE = 27; // KeyboardEvent.which value for Escape (Esc) key
  3495. var SPACE_KEYCODE = 32; // KeyboardEvent.which value for space key
  3496. var TAB_KEYCODE = 9; // KeyboardEvent.which value for tab key
  3497. var ARROW_UP_KEYCODE = 38; // KeyboardEvent.which value for up arrow key
  3498. var ARROW_DOWN_KEYCODE = 40; // KeyboardEvent.which value for down arrow key
  3499. var RIGHT_MOUSE_BUTTON_WHICH = 3; // MouseEvent.which value for the right button (assuming a right-handed mouse)
  3500. var REGEXP_KEYDOWN = new RegExp(ARROW_UP_KEYCODE + "|" + ARROW_DOWN_KEYCODE + "|" + ESCAPE_KEYCODE);
  3501. var Event$4 = {
  3502. HIDE: "hide" + EVENT_KEY$4,
  3503. HIDDEN: "hidden" + EVENT_KEY$4,
  3504. SHOW: "show" + EVENT_KEY$4,
  3505. SHOWN: "shown" + EVENT_KEY$4,
  3506. CLICK: "click" + EVENT_KEY$4,
  3507. CLICK_DATA_API: "click" + EVENT_KEY$4 + DATA_API_KEY$4,
  3508. KEYDOWN_DATA_API: "keydown" + EVENT_KEY$4 + DATA_API_KEY$4,
  3509. KEYUP_DATA_API: "keyup" + EVENT_KEY$4 + DATA_API_KEY$4
  3510. };
  3511. var ClassName$4 = {
  3512. DISABLED: 'disabled',
  3513. SHOW: 'show',
  3514. DROPUP: 'dropup',
  3515. DROPRIGHT: 'dropright',
  3516. DROPLEFT: 'dropleft',
  3517. MENURIGHT: 'dropdown-menu-right',
  3518. MENULEFT: 'dropdown-menu-left',
  3519. POSITION_STATIC: 'position-static'
  3520. };
  3521. var Selector$4 = {
  3522. DATA_TOGGLE: '[data-toggle="dropdown"]',
  3523. FORM_CHILD: '.dropdown form',
  3524. MENU: '.dropdown-menu',
  3525. NAVBAR_NAV: '.navbar-nav',
  3526. VISIBLE_ITEMS: '.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)'
  3527. };
  3528. var AttachmentMap = {
  3529. TOP: 'top-start',
  3530. TOPEND: 'top-end',
  3531. BOTTOM: 'bottom-start',
  3532. BOTTOMEND: 'bottom-end',
  3533. RIGHT: 'right-start',
  3534. RIGHTEND: 'right-end',
  3535. LEFT: 'left-start',
  3536. LEFTEND: 'left-end'
  3537. };
  3538. var Default$2 = {
  3539. offset: 0,
  3540. flip: true,
  3541. boundary: 'scrollParent',
  3542. reference: 'toggle',
  3543. display: 'dynamic'
  3544. };
  3545. var DefaultType$2 = {
  3546. offset: '(number|string|function)',
  3547. flip: 'boolean',
  3548. boundary: '(string|element)',
  3549. reference: '(string|element)',
  3550. display: 'string'
  3551. /**
  3552. * ------------------------------------------------------------------------
  3553. * Class Definition
  3554. * ------------------------------------------------------------------------
  3555. */
  3556. };
  3557. var Dropdown =
  3558. /*#__PURE__*/
  3559. function () {
  3560. function Dropdown(element, config) {
  3561. this._element = element;
  3562. this._popper = null;
  3563. this._config = this._getConfig(config);
  3564. this._menu = this._getMenuElement();
  3565. this._inNavbar = this._detectNavbar();
  3566. this._addEventListeners();
  3567. } // Getters
  3568. var _proto = Dropdown.prototype;
  3569. // Public
  3570. _proto.toggle = function toggle() {
  3571. if (this._element.disabled || $(this._element).hasClass(ClassName$4.DISABLED)) {
  3572. return;
  3573. }
  3574. var parent = Dropdown._getParentFromElement(this._element);
  3575. var isActive = $(this._menu).hasClass(ClassName$4.SHOW);
  3576. Dropdown._clearMenus();
  3577. if (isActive) {
  3578. return;
  3579. }
  3580. var relatedTarget = {
  3581. relatedTarget: this._element
  3582. };
  3583. var showEvent = $.Event(Event$4.SHOW, relatedTarget);
  3584. $(parent).trigger(showEvent);
  3585. if (showEvent.isDefaultPrevented()) {
  3586. return;
  3587. } // Disable totally Popper.js for Dropdown in Navbar
  3588. if (!this._inNavbar) {
  3589. /**
  3590. * Check for Popper dependency
  3591. * Popper - https://popper.js.org
  3592. */
  3593. if (typeof Popper === 'undefined') {
  3594. throw new TypeError('Bootstrap\'s dropdowns require Popper.js (https://popper.js.org/)');
  3595. }
  3596. var referenceElement = this._element;
  3597. if (this._config.reference === 'parent') {
  3598. referenceElement = parent;
  3599. } else if (Util.isElement(this._config.reference)) {
  3600. referenceElement = this._config.reference; // Check if it's jQuery element
  3601. if (typeof this._config.reference.jquery !== 'undefined') {
  3602. referenceElement = this._config.reference[0];
  3603. }
  3604. } // If boundary is not `scrollParent`, then set position to `static`
  3605. // to allow the menu to "escape" the scroll parent's boundaries
  3606. // https://github.com/twbs/bootstrap/issues/24251
  3607. if (this._config.boundary !== 'scrollParent') {
  3608. $(parent).addClass(ClassName$4.POSITION_STATIC);
  3609. }
  3610. this._popper = new Popper(referenceElement, this._menu, this._getPopperConfig());
  3611. } // If this is a touch-enabled device we add extra
  3612. // empty mouseover listeners to the body's immediate children;
  3613. // only needed because of broken event delegation on iOS
  3614. // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
  3615. if ('ontouchstart' in document.documentElement && $(parent).closest(Selector$4.NAVBAR_NAV).length === 0) {
  3616. $(document.body).children().on('mouseover', null, $.noop);
  3617. }
  3618. this._element.focus();
  3619. this._element.setAttribute('aria-expanded', true);
  3620. $(this._menu).toggleClass(ClassName$4.SHOW);
  3621. $(parent).toggleClass(ClassName$4.SHOW).trigger($.Event(Event$4.SHOWN, relatedTarget));
  3622. };
  3623. _proto.show = function show() {
  3624. if (this._element.disabled || $(this._element).hasClass(ClassName$4.DISABLED) || $(this._menu).hasClass(ClassName$4.SHOW)) {
  3625. return;
  3626. }
  3627. var relatedTarget = {
  3628. relatedTarget: this._element
  3629. };
  3630. var showEvent = $.Event(Event$4.SHOW, relatedTarget);
  3631. var parent = Dropdown._getParentFromElement(this._element);
  3632. $(parent).trigger(showEvent);
  3633. if (showEvent.isDefaultPrevented()) {
  3634. return;
  3635. }
  3636. $(this._menu).toggleClass(ClassName$4.SHOW);
  3637. $(parent).toggleClass(ClassName$4.SHOW).trigger($.Event(Event$4.SHOWN, relatedTarget));
  3638. };
  3639. _proto.hide = function hide() {
  3640. if (this._element.disabled || $(this._element).hasClass(ClassName$4.DISABLED) || !$(this._menu).hasClass(ClassName$4.SHOW)) {
  3641. return;
  3642. }
  3643. var relatedTarget = {
  3644. relatedTarget: this._element
  3645. };
  3646. var hideEvent = $.Event(Event$4.HIDE, relatedTarget);
  3647. var parent = Dropdown._getParentFromElement(this._element);
  3648. $(parent).trigger(hideEvent);
  3649. if (hideEvent.isDefaultPrevented()) {
  3650. return;
  3651. }
  3652. $(this._menu).toggleClass(ClassName$4.SHOW);
  3653. $(parent).toggleClass(ClassName$4.SHOW).trigger($.Event(Event$4.HIDDEN, relatedTarget));
  3654. };
  3655. _proto.dispose = function dispose() {
  3656. $.removeData(this._element, DATA_KEY$4);
  3657. $(this._element).off(EVENT_KEY$4);
  3658. this._element = null;
  3659. this._menu = null;
  3660. if (this._popper !== null) {
  3661. this._popper.destroy();
  3662. this._popper = null;
  3663. }
  3664. };
  3665. _proto.update = function update() {
  3666. this._inNavbar = this._detectNavbar();
  3667. if (this._popper !== null) {
  3668. this._popper.scheduleUpdate();
  3669. }
  3670. } // Private
  3671. ;
  3672. _proto._addEventListeners = function _addEventListeners() {
  3673. var _this = this;
  3674. $(this._element).on(Event$4.CLICK, function (event) {
  3675. event.preventDefault();
  3676. event.stopPropagation();
  3677. _this.toggle();
  3678. });
  3679. };
  3680. _proto._getConfig = function _getConfig(config) {
  3681. config = _objectSpread({}, this.constructor.Default, $(this._element).data(), config);
  3682. Util.typeCheckConfig(NAME$4, config, this.constructor.DefaultType);
  3683. return config;
  3684. };
  3685. _proto._getMenuElement = function _getMenuElement() {
  3686. if (!this._menu) {
  3687. var parent = Dropdown._getParentFromElement(this._element);
  3688. if (parent) {
  3689. this._menu = parent.querySelector(Selector$4.MENU);
  3690. }
  3691. }
  3692. return this._menu;
  3693. };
  3694. _proto._getPlacement = function _getPlacement() {
  3695. var $parentDropdown = $(this._element.parentNode);
  3696. var placement = AttachmentMap.BOTTOM; // Handle dropup
  3697. if ($parentDropdown.hasClass(ClassName$4.DROPUP)) {
  3698. placement = AttachmentMap.TOP;
  3699. if ($(this._menu).hasClass(ClassName$4.MENURIGHT)) {
  3700. placement = AttachmentMap.TOPEND;
  3701. }
  3702. } else if ($parentDropdown.hasClass(ClassName$4.DROPRIGHT)) {
  3703. placement = AttachmentMap.RIGHT;
  3704. } else if ($parentDropdown.hasClass(ClassName$4.DROPLEFT)) {
  3705. placement = AttachmentMap.LEFT;
  3706. } else if ($(this._menu).hasClass(ClassName$4.MENURIGHT)) {
  3707. placement = AttachmentMap.BOTTOMEND;
  3708. }
  3709. return placement;
  3710. };
  3711. _proto._detectNavbar = function _detectNavbar() {
  3712. return $(this._element).closest('.navbar').length > 0;
  3713. };
  3714. _proto._getOffset = function _getOffset() {
  3715. var _this2 = this;
  3716. var offset = {};
  3717. if (typeof this._config.offset === 'function') {
  3718. offset.fn = function (data) {
  3719. data.offsets = _objectSpread({}, data.offsets, _this2._config.offset(data.offsets, _this2._element) || {});
  3720. return data;
  3721. };
  3722. } else {
  3723. offset.offset = this._config.offset;
  3724. }
  3725. return offset;
  3726. };
  3727. _proto._getPopperConfig = function _getPopperConfig() {
  3728. var popperConfig = {
  3729. placement: this._getPlacement(),
  3730. modifiers: {
  3731. offset: this._getOffset(),
  3732. flip: {
  3733. enabled: this._config.flip
  3734. },
  3735. preventOverflow: {
  3736. boundariesElement: this._config.boundary
  3737. }
  3738. } // Disable Popper.js if we have a static display
  3739. };
  3740. if (this._config.display === 'static') {
  3741. popperConfig.modifiers.applyStyle = {
  3742. enabled: false
  3743. };
  3744. }
  3745. return popperConfig;
  3746. } // Static
  3747. ;
  3748. Dropdown._jQueryInterface = function _jQueryInterface(config) {
  3749. return this.each(function () {
  3750. var data = $(this).data(DATA_KEY$4);
  3751. var _config = typeof config === 'object' ? config : null;
  3752. if (!data) {
  3753. data = new Dropdown(this, _config);
  3754. $(this).data(DATA_KEY$4, data);
  3755. }
  3756. if (typeof config === 'string') {
  3757. if (typeof data[config] === 'undefined') {
  3758. throw new TypeError("No method named \"" + config + "\"");
  3759. }
  3760. data[config]();
  3761. }
  3762. });
  3763. };
  3764. Dropdown._clearMenus = function _clearMenus(event) {
  3765. if (event && (event.which === RIGHT_MOUSE_BUTTON_WHICH || event.type === 'keyup' && event.which !== TAB_KEYCODE)) {
  3766. return;
  3767. }
  3768. var toggles = [].slice.call(document.querySelectorAll(Selector$4.DATA_TOGGLE));
  3769. for (var i = 0, len = toggles.length; i < len; i++) {
  3770. var parent = Dropdown._getParentFromElement(toggles[i]);
  3771. var context = $(toggles[i]).data(DATA_KEY$4);
  3772. var relatedTarget = {
  3773. relatedTarget: toggles[i]
  3774. };
  3775. if (event && event.type === 'click') {
  3776. relatedTarget.clickEvent = event;
  3777. }
  3778. if (!context) {
  3779. continue;
  3780. }
  3781. var dropdownMenu = context._menu;
  3782. if (!$(parent).hasClass(ClassName$4.SHOW)) {
  3783. continue;
  3784. }
  3785. if (event && (event.type === 'click' && /input|textarea/i.test(event.target.tagName) || event.type === 'keyup' && event.which === TAB_KEYCODE) && $.contains(parent, event.target)) {
  3786. continue;
  3787. }
  3788. var hideEvent = $.Event(Event$4.HIDE, relatedTarget);
  3789. $(parent).trigger(hideEvent);
  3790. if (hideEvent.isDefaultPrevented()) {
  3791. continue;
  3792. } // If this is a touch-enabled device we remove the extra
  3793. // empty mouseover listeners we added for iOS support
  3794. if ('ontouchstart' in document.documentElement) {
  3795. $(document.body).children().off('mouseover', null, $.noop);
  3796. }
  3797. toggles[i].setAttribute('aria-expanded', 'false');
  3798. $(dropdownMenu).removeClass(ClassName$4.SHOW);
  3799. $(parent).removeClass(ClassName$4.SHOW).trigger($.Event(Event$4.HIDDEN, relatedTarget));
  3800. }
  3801. };
  3802. Dropdown._getParentFromElement = function _getParentFromElement(element) {
  3803. var parent;
  3804. var selector = Util.getSelectorFromElement(element);
  3805. if (selector) {
  3806. parent = document.querySelector(selector);
  3807. }
  3808. return parent || element.parentNode;
  3809. } // eslint-disable-next-line complexity
  3810. ;
  3811. Dropdown._dataApiKeydownHandler = function _dataApiKeydownHandler(event) {
  3812. // If not input/textarea:
  3813. // - And not a key in REGEXP_KEYDOWN => not a dropdown command
  3814. // If input/textarea:
  3815. // - If space key => not a dropdown command
  3816. // - If key is other than escape
  3817. // - If key is not up or down => not a dropdown command
  3818. // - If trigger inside the menu => not a dropdown command
  3819. if (/input|textarea/i.test(event.target.tagName) ? event.which === SPACE_KEYCODE || event.which !== ESCAPE_KEYCODE && (event.which !== ARROW_DOWN_KEYCODE && event.which !== ARROW_UP_KEYCODE || $(event.target).closest(Selector$4.MENU).length) : !REGEXP_KEYDOWN.test(event.which)) {
  3820. return;
  3821. }
  3822. event.preventDefault();
  3823. event.stopPropagation();
  3824. if (this.disabled || $(this).hasClass(ClassName$4.DISABLED)) {
  3825. return;
  3826. }
  3827. var parent = Dropdown._getParentFromElement(this);
  3828. var isActive = $(parent).hasClass(ClassName$4.SHOW);
  3829. if (!isActive || isActive && (event.which === ESCAPE_KEYCODE || event.which === SPACE_KEYCODE)) {
  3830. if (event.which === ESCAPE_KEYCODE) {
  3831. var toggle = parent.querySelector(Selector$4.DATA_TOGGLE);
  3832. $(toggle).trigger('focus');
  3833. }
  3834. $(this).trigger('click');
  3835. return;
  3836. }
  3837. var items = [].slice.call(parent.querySelectorAll(Selector$4.VISIBLE_ITEMS));
  3838. if (items.length === 0) {
  3839. return;
  3840. }
  3841. var index = items.indexOf(event.target);
  3842. if (event.which === ARROW_UP_KEYCODE && index > 0) {
  3843. // Up
  3844. index--;
  3845. }
  3846. if (event.which === ARROW_DOWN_KEYCODE && index < items.length - 1) {
  3847. // Down
  3848. index++;
  3849. }
  3850. if (index < 0) {
  3851. index = 0;
  3852. }
  3853. items[index].focus();
  3854. };
  3855. _createClass(Dropdown, null, [{
  3856. key: "VERSION",
  3857. get: function get() {
  3858. return VERSION$4;
  3859. }
  3860. }, {
  3861. key: "Default",
  3862. get: function get() {
  3863. return Default$2;
  3864. }
  3865. }, {
  3866. key: "DefaultType",
  3867. get: function get() {
  3868. return DefaultType$2;
  3869. }
  3870. }]);
  3871. return Dropdown;
  3872. }();
  3873. /**
  3874. * ------------------------------------------------------------------------
  3875. * Data Api implementation
  3876. * ------------------------------------------------------------------------
  3877. */
  3878. $(document).on(Event$4.KEYDOWN_DATA_API, Selector$4.DATA_TOGGLE, Dropdown._dataApiKeydownHandler).on(Event$4.KEYDOWN_DATA_API, Selector$4.MENU, Dropdown._dataApiKeydownHandler).on(Event$4.CLICK_DATA_API + " " + Event$4.KEYUP_DATA_API, Dropdown._clearMenus).on(Event$4.CLICK_DATA_API, Selector$4.DATA_TOGGLE, function (event) {
  3879. event.preventDefault();
  3880. event.stopPropagation();
  3881. Dropdown._jQueryInterface.call($(this), 'toggle');
  3882. }).on(Event$4.CLICK_DATA_API, Selector$4.FORM_CHILD, function (e) {
  3883. e.stopPropagation();
  3884. });
  3885. /**
  3886. * ------------------------------------------------------------------------
  3887. * jQuery
  3888. * ------------------------------------------------------------------------
  3889. */
  3890. $.fn[NAME$4] = Dropdown._jQueryInterface;
  3891. $.fn[NAME$4].Constructor = Dropdown;
  3892. $.fn[NAME$4].noConflict = function () {
  3893. $.fn[NAME$4] = JQUERY_NO_CONFLICT$4;
  3894. return Dropdown._jQueryInterface;
  3895. };
  3896. /**
  3897. * ------------------------------------------------------------------------
  3898. * Constants
  3899. * ------------------------------------------------------------------------
  3900. */
  3901. var NAME$5 = 'modal';
  3902. var VERSION$5 = '4.3.1';
  3903. var DATA_KEY$5 = 'bs.modal';
  3904. var EVENT_KEY$5 = "." + DATA_KEY$5;
  3905. var DATA_API_KEY$5 = '.data-api';
  3906. var JQUERY_NO_CONFLICT$5 = $.fn[NAME$5];
  3907. var ESCAPE_KEYCODE$1 = 27; // KeyboardEvent.which value for Escape (Esc) key
  3908. var Default$3 = {
  3909. backdrop: true,
  3910. keyboard: true,
  3911. focus: true,
  3912. show: true
  3913. };
  3914. var DefaultType$3 = {
  3915. backdrop: '(boolean|string)',
  3916. keyboard: 'boolean',
  3917. focus: 'boolean',
  3918. show: 'boolean'
  3919. };
  3920. var Event$5 = {
  3921. HIDE: "hide" + EVENT_KEY$5,
  3922. HIDDEN: "hidden" + EVENT_KEY$5,
  3923. SHOW: "show" + EVENT_KEY$5,
  3924. SHOWN: "shown" + EVENT_KEY$5,
  3925. FOCUSIN: "focusin" + EVENT_KEY$5,
  3926. RESIZE: "resize" + EVENT_KEY$5,
  3927. CLICK_DISMISS: "click.dismiss" + EVENT_KEY$5,
  3928. KEYDOWN_DISMISS: "keydown.dismiss" + EVENT_KEY$5,
  3929. MOUSEUP_DISMISS: "mouseup.dismiss" + EVENT_KEY$5,
  3930. MOUSEDOWN_DISMISS: "mousedown.dismiss" + EVENT_KEY$5,
  3931. CLICK_DATA_API: "click" + EVENT_KEY$5 + DATA_API_KEY$5
  3932. };
  3933. var ClassName$5 = {
  3934. SCROLLABLE: 'modal-dialog-scrollable',
  3935. SCROLLBAR_MEASURER: 'modal-scrollbar-measure',
  3936. BACKDROP: 'modal-backdrop',
  3937. OPEN: 'modal-open',
  3938. FADE: 'fade',
  3939. SHOW: 'show'
  3940. };
  3941. var Selector$5 = {
  3942. DIALOG: '.modal-dialog',
  3943. MODAL_BODY: '.modal-body',
  3944. DATA_TOGGLE: '[data-toggle="modal"]',
  3945. DATA_DISMISS: '[data-dismiss="modal"]',
  3946. FIXED_CONTENT: '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top',
  3947. STICKY_CONTENT: '.sticky-top'
  3948. /**
  3949. * ------------------------------------------------------------------------
  3950. * Class Definition
  3951. * ------------------------------------------------------------------------
  3952. */
  3953. };
  3954. var Modal =
  3955. /*#__PURE__*/
  3956. function () {
  3957. function Modal(element, config) {
  3958. this._config = this._getConfig(config);
  3959. this._element = element;
  3960. this._dialog = element.querySelector(Selector$5.DIALOG);
  3961. this._backdrop = null;
  3962. this._isShown = false;
  3963. this._isBodyOverflowing = false;
  3964. this._ignoreBackdropClick = false;
  3965. this._isTransitioning = false;
  3966. this._scrollbarWidth = 0;
  3967. } // Getters
  3968. var _proto = Modal.prototype;
  3969. // Public
  3970. _proto.toggle = function toggle(relatedTarget) {
  3971. return this._isShown ? this.hide() : this.show(relatedTarget);
  3972. };
  3973. _proto.show = function show(relatedTarget) {
  3974. var _this = this;
  3975. if (this._isShown || this._isTransitioning) {
  3976. return;
  3977. }
  3978. if ($(this._element).hasClass(ClassName$5.FADE)) {
  3979. this._isTransitioning = true;
  3980. }
  3981. var showEvent = $.Event(Event$5.SHOW, {
  3982. relatedTarget: relatedTarget
  3983. });
  3984. $(this._element).trigger(showEvent);
  3985. if (this._isShown || showEvent.isDefaultPrevented()) {
  3986. return;
  3987. }
  3988. this._isShown = true;
  3989. this._checkScrollbar();
  3990. this._setScrollbar();
  3991. this._adjustDialog();
  3992. this._setEscapeEvent();
  3993. this._setResizeEvent();
  3994. $(this._element).on(Event$5.CLICK_DISMISS, Selector$5.DATA_DISMISS, function (event) {
  3995. return _this.hide(event);
  3996. });
  3997. $(this._dialog).on(Event$5.MOUSEDOWN_DISMISS, function () {
  3998. $(_this._element).one(Event$5.MOUSEUP_DISMISS, function (event) {
  3999. if ($(event.target).is(_this._element)) {
  4000. _this._ignoreBackdropClick = true;
  4001. }
  4002. });
  4003. });
  4004. this._showBackdrop(function () {
  4005. return _this._showElement(relatedTarget);
  4006. });
  4007. };
  4008. _proto.hide = function hide(event) {
  4009. var _this2 = this;
  4010. if (event) {
  4011. event.preventDefault();
  4012. }
  4013. if (!this._isShown || this._isTransitioning) {
  4014. return;
  4015. }
  4016. var hideEvent = $.Event(Event$5.HIDE);
  4017. $(this._element).trigger(hideEvent);
  4018. if (!this._isShown || hideEvent.isDefaultPrevented()) {
  4019. return;
  4020. }
  4021. this._isShown = false;
  4022. var transition = $(this._element).hasClass(ClassName$5.FADE);
  4023. if (transition) {
  4024. this._isTransitioning = true;
  4025. }
  4026. this._setEscapeEvent();
  4027. this._setResizeEvent();
  4028. $(document).off(Event$5.FOCUSIN);
  4029. $(this._element).removeClass(ClassName$5.SHOW);
  4030. $(this._element).off(Event$5.CLICK_DISMISS);
  4031. $(this._dialog).off(Event$5.MOUSEDOWN_DISMISS);
  4032. if (transition) {
  4033. var transitionDuration = Util.getTransitionDurationFromElement(this._element);
  4034. $(this._element).one(Util.TRANSITION_END, function (event) {
  4035. return _this2._hideModal(event);
  4036. }).emulateTransitionEnd(transitionDuration);
  4037. } else {
  4038. this._hideModal();
  4039. }
  4040. };
  4041. _proto.dispose = function dispose() {
  4042. [window, this._element, this._dialog].forEach(function (htmlElement) {
  4043. return $(htmlElement).off(EVENT_KEY$5);
  4044. });
  4045. /**
  4046. * `document` has 2 events `Event.FOCUSIN` and `Event.CLICK_DATA_API`
  4047. * Do not move `document` in `htmlElements` array
  4048. * It will remove `Event.CLICK_DATA_API` event that should remain
  4049. */
  4050. $(document).off(Event$5.FOCUSIN);
  4051. $.removeData(this._element, DATA_KEY$5);
  4052. this._config = null;
  4053. this._element = null;
  4054. this._dialog = null;
  4055. this._backdrop = null;
  4056. this._isShown = null;
  4057. this._isBodyOverflowing = null;
  4058. this._ignoreBackdropClick = null;
  4059. this._isTransitioning = null;
  4060. this._scrollbarWidth = null;
  4061. };
  4062. _proto.handleUpdate = function handleUpdate() {
  4063. this._adjustDialog();
  4064. } // Private
  4065. ;
  4066. _proto._getConfig = function _getConfig(config) {
  4067. config = _objectSpread({}, Default$3, config);
  4068. Util.typeCheckConfig(NAME$5, config, DefaultType$3);
  4069. return config;
  4070. };
  4071. _proto._showElement = function _showElement(relatedTarget) {
  4072. var _this3 = this;
  4073. var transition = $(this._element).hasClass(ClassName$5.FADE);
  4074. if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) {
  4075. // Don't move modal's DOM position
  4076. document.body.appendChild(this._element);
  4077. }
  4078. this._element.style.display = 'block';
  4079. this._element.removeAttribute('aria-hidden');
  4080. this._element.setAttribute('aria-modal', true);
  4081. if ($(this._dialog).hasClass(ClassName$5.SCROLLABLE)) {
  4082. this._dialog.querySelector(Selector$5.MODAL_BODY).scrollTop = 0;
  4083. } else {
  4084. this._element.scrollTop = 0;
  4085. }
  4086. if (transition) {
  4087. Util.reflow(this._element);
  4088. }
  4089. $(this._element).addClass(ClassName$5.SHOW);
  4090. if (this._config.focus) {
  4091. this._enforceFocus();
  4092. }
  4093. var shownEvent = $.Event(Event$5.SHOWN, {
  4094. relatedTarget: relatedTarget
  4095. });
  4096. var transitionComplete = function transitionComplete() {
  4097. if (_this3._config.focus) {
  4098. _this3._element.focus();
  4099. }
  4100. _this3._isTransitioning = false;
  4101. $(_this3._element).trigger(shownEvent);
  4102. };
  4103. if (transition) {
  4104. var transitionDuration = Util.getTransitionDurationFromElement(this._dialog);
  4105. $(this._dialog).one(Util.TRANSITION_END, transitionComplete).emulateTransitionEnd(transitionDuration);
  4106. } else {
  4107. transitionComplete();
  4108. }
  4109. };
  4110. _proto._enforceFocus = function _enforceFocus() {
  4111. var _this4 = this;
  4112. $(document).off(Event$5.FOCUSIN) // Guard against infinite focus loop
  4113. .on(Event$5.FOCUSIN, function (event) {
  4114. if (document !== event.target && _this4._element !== event.target && $(_this4._element).has(event.target).length === 0) {
  4115. _this4._element.focus();
  4116. }
  4117. });
  4118. };
  4119. _proto._setEscapeEvent = function _setEscapeEvent() {
  4120. var _this5 = this;
  4121. if (this._isShown && this._config.keyboard) {
  4122. $(this._element).on(Event$5.KEYDOWN_DISMISS, function (event) {
  4123. if (event.which === ESCAPE_KEYCODE$1) {
  4124. event.preventDefault();
  4125. _this5.hide();
  4126. }
  4127. });
  4128. } else if (!this._isShown) {
  4129. $(this._element).off(Event$5.KEYDOWN_DISMISS);
  4130. }
  4131. };
  4132. _proto._setResizeEvent = function _setResizeEvent() {
  4133. var _this6 = this;
  4134. if (this._isShown) {
  4135. $(window).on(Event$5.RESIZE, function (event) {
  4136. return _this6.handleUpdate(event);
  4137. });
  4138. } else {
  4139. $(window).off(Event$5.RESIZE);
  4140. }
  4141. };
  4142. _proto._hideModal = function _hideModal() {
  4143. var _this7 = this;
  4144. this._element.style.display = 'none';
  4145. this._element.setAttribute('aria-hidden', true);
  4146. this._element.removeAttribute('aria-modal');
  4147. this._isTransitioning = false;
  4148. this._showBackdrop(function () {
  4149. $(document.body).removeClass(ClassName$5.OPEN);
  4150. _this7._resetAdjustments();
  4151. _this7._resetScrollbar();
  4152. $(_this7._element).trigger(Event$5.HIDDEN);
  4153. });
  4154. };
  4155. _proto._removeBackdrop = function _removeBackdrop() {
  4156. if (this._backdrop) {
  4157. $(this._backdrop).remove();
  4158. this._backdrop = null;
  4159. }
  4160. };
  4161. _proto._showBackdrop = function _showBackdrop(callback) {
  4162. var _this8 = this;
  4163. var animate = $(this._element).hasClass(ClassName$5.FADE) ? ClassName$5.FADE : '';
  4164. if (this._isShown && this._config.backdrop) {
  4165. this._backdrop = document.createElement('div');
  4166. this._backdrop.className = ClassName$5.BACKDROP;
  4167. if (animate) {
  4168. this._backdrop.classList.add(animate);
  4169. }
  4170. $(this._backdrop).appendTo(document.body);
  4171. $(this._element).on(Event$5.CLICK_DISMISS, function (event) {
  4172. if (_this8._ignoreBackdropClick) {
  4173. _this8._ignoreBackdropClick = false;
  4174. return;
  4175. }
  4176. if (event.target !== event.currentTarget) {
  4177. return;
  4178. }
  4179. if (_this8._config.backdrop === 'static') {
  4180. _this8._element.focus();
  4181. } else {
  4182. _this8.hide();
  4183. }
  4184. });
  4185. if (animate) {
  4186. Util.reflow(this._backdrop);
  4187. }
  4188. $(this._backdrop).addClass(ClassName$5.SHOW);
  4189. if (!callback) {
  4190. return;
  4191. }
  4192. if (!animate) {
  4193. callback();
  4194. return;
  4195. }
  4196. var backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop);
  4197. $(this._backdrop).one(Util.TRANSITION_END, callback).emulateTransitionEnd(backdropTransitionDuration);
  4198. } else if (!this._isShown && this._backdrop) {
  4199. $(this._backdrop).removeClass(ClassName$5.SHOW);
  4200. var callbackRemove = function callbackRemove() {
  4201. _this8._removeBackdrop();
  4202. if (callback) {
  4203. callback();
  4204. }
  4205. };
  4206. if ($(this._element).hasClass(ClassName$5.FADE)) {
  4207. var _backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop);
  4208. $(this._backdrop).one(Util.TRANSITION_END, callbackRemove).emulateTransitionEnd(_backdropTransitionDuration);
  4209. } else {
  4210. callbackRemove();
  4211. }
  4212. } else if (callback) {
  4213. callback();
  4214. }
  4215. } // ----------------------------------------------------------------------
  4216. // the following methods are used to handle overflowing modals
  4217. // todo (fat): these should probably be refactored out of modal.js
  4218. // ----------------------------------------------------------------------
  4219. ;
  4220. _proto._adjustDialog = function _adjustDialog() {
  4221. var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight;
  4222. if (!this._isBodyOverflowing && isModalOverflowing) {
  4223. this._element.style.paddingLeft = this._scrollbarWidth + "px";
  4224. }
  4225. if (this._isBodyOverflowing && !isModalOverflowing) {
  4226. this._element.style.paddingRight = this._scrollbarWidth + "px";
  4227. }
  4228. };
  4229. _proto._resetAdjustments = function _resetAdjustments() {
  4230. this._element.style.paddingLeft = '';
  4231. this._element.style.paddingRight = '';
  4232. };
  4233. _proto._checkScrollbar = function _checkScrollbar() {
  4234. var rect = document.body.getBoundingClientRect();
  4235. this._isBodyOverflowing = rect.left + rect.right < window.innerWidth;
  4236. this._scrollbarWidth = this._getScrollbarWidth();
  4237. };
  4238. _proto._setScrollbar = function _setScrollbar() {
  4239. var _this9 = this;
  4240. if (this._isBodyOverflowing) {
  4241. // Note: DOMNode.style.paddingRight returns the actual value or '' if not set
  4242. // while $(DOMNode).css('padding-right') returns the calculated value or 0 if not set
  4243. var fixedContent = [].slice.call(document.querySelectorAll(Selector$5.FIXED_CONTENT));
  4244. var stickyContent = [].slice.call(document.querySelectorAll(Selector$5.STICKY_CONTENT)); // Adjust fixed content padding
  4245. $(fixedContent).each(function (index, element) {
  4246. var actualPadding = element.style.paddingRight;
  4247. var calculatedPadding = $(element).css('padding-right');
  4248. $(element).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + _this9._scrollbarWidth + "px");
  4249. }); // Adjust sticky content margin
  4250. $(stickyContent).each(function (index, element) {
  4251. var actualMargin = element.style.marginRight;
  4252. var calculatedMargin = $(element).css('margin-right');
  4253. $(element).data('margin-right', actualMargin).css('margin-right', parseFloat(calculatedMargin) - _this9._scrollbarWidth + "px");
  4254. }); // Adjust body padding
  4255. var actualPadding = document.body.style.paddingRight;
  4256. var calculatedPadding = $(document.body).css('padding-right');
  4257. $(document.body).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + this._scrollbarWidth + "px");
  4258. }
  4259. $(document.body).addClass(ClassName$5.OPEN);
  4260. };
  4261. _proto._resetScrollbar = function _resetScrollbar() {
  4262. // Restore fixed content padding
  4263. var fixedContent = [].slice.call(document.querySelectorAll(Selector$5.FIXED_CONTENT));
  4264. $(fixedContent).each(function (index, element) {
  4265. var padding = $(element).data('padding-right');
  4266. $(element).removeData('padding-right');
  4267. element.style.paddingRight = padding ? padding : '';
  4268. }); // Restore sticky content
  4269. var elements = [].slice.call(document.querySelectorAll("" + Selector$5.STICKY_CONTENT));
  4270. $(elements).each(function (index, element) {
  4271. var margin = $(element).data('margin-right');
  4272. if (typeof margin !== 'undefined') {
  4273. $(element).css('margin-right', margin).removeData('margin-right');
  4274. }
  4275. }); // Restore body padding
  4276. var padding = $(document.body).data('padding-right');
  4277. $(document.body).removeData('padding-right');
  4278. document.body.style.paddingRight = padding ? padding : '';
  4279. };
  4280. _proto._getScrollbarWidth = function _getScrollbarWidth() {
  4281. // thx d.walsh
  4282. var scrollDiv = document.createElement('div');
  4283. scrollDiv.className = ClassName$5.SCROLLBAR_MEASURER;
  4284. document.body.appendChild(scrollDiv);
  4285. var scrollbarWidth = scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth;
  4286. document.body.removeChild(scrollDiv);
  4287. return scrollbarWidth;
  4288. } // Static
  4289. ;
  4290. Modal._jQueryInterface = function _jQueryInterface(config, relatedTarget) {
  4291. return this.each(function () {
  4292. var data = $(this).data(DATA_KEY$5);
  4293. var _config = _objectSpread({}, Default$3, $(this).data(), typeof config === 'object' && config ? config : {});
  4294. if (!data) {
  4295. data = new Modal(this, _config);
  4296. $(this).data(DATA_KEY$5, data);
  4297. }
  4298. if (typeof config === 'string') {
  4299. if (typeof data[config] === 'undefined') {
  4300. throw new TypeError("No method named \"" + config + "\"");
  4301. }
  4302. data[config](relatedTarget);
  4303. } else if (_config.show) {
  4304. data.show(relatedTarget);
  4305. }
  4306. });
  4307. };
  4308. _createClass(Modal, null, [{
  4309. key: "VERSION",
  4310. get: function get() {
  4311. return VERSION$5;
  4312. }
  4313. }, {
  4314. key: "Default",
  4315. get: function get() {
  4316. return Default$3;
  4317. }
  4318. }]);
  4319. return Modal;
  4320. }();
  4321. /**
  4322. * ------------------------------------------------------------------------
  4323. * Data Api implementation
  4324. * ------------------------------------------------------------------------
  4325. */
  4326. $(document).on(Event$5.CLICK_DATA_API, Selector$5.DATA_TOGGLE, function (event) {
  4327. var _this10 = this;
  4328. var target;
  4329. var selector = Util.getSelectorFromElement(this);
  4330. if (selector) {
  4331. target = document.querySelector(selector);
  4332. }
  4333. var config = $(target).data(DATA_KEY$5) ? 'toggle' : _objectSpread({}, $(target).data(), $(this).data());
  4334. if (this.tagName === 'A' || this.tagName === 'AREA') {
  4335. event.preventDefault();
  4336. }
  4337. var $target = $(target).one(Event$5.SHOW, function (showEvent) {
  4338. if (showEvent.isDefaultPrevented()) {
  4339. // Only register focus restorer if modal will actually get shown
  4340. return;
  4341. }
  4342. $target.one(Event$5.HIDDEN, function () {
  4343. if ($(_this10).is(':visible')) {
  4344. _this10.focus();
  4345. }
  4346. });
  4347. });
  4348. Modal._jQueryInterface.call($(target), config, this);
  4349. });
  4350. /**
  4351. * ------------------------------------------------------------------------
  4352. * jQuery
  4353. * ------------------------------------------------------------------------
  4354. */
  4355. $.fn[NAME$5] = Modal._jQueryInterface;
  4356. $.fn[NAME$5].Constructor = Modal;
  4357. $.fn[NAME$5].noConflict = function () {
  4358. $.fn[NAME$5] = JQUERY_NO_CONFLICT$5;
  4359. return Modal._jQueryInterface;
  4360. };
  4361. /**
  4362. * --------------------------------------------------------------------------
  4363. * Bootstrap (v4.3.1): tools/sanitizer.js
  4364. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  4365. * --------------------------------------------------------------------------
  4366. */
  4367. var uriAttrs = ['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href'];
  4368. var ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i;
  4369. var DefaultWhitelist = {
  4370. // Global attributes allowed on any supplied element below.
  4371. '*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN],
  4372. a: ['target', 'href', 'title', 'rel'],
  4373. area: [],
  4374. b: [],
  4375. br: [],
  4376. col: [],
  4377. code: [],
  4378. div: [],
  4379. em: [],
  4380. hr: [],
  4381. h1: [],
  4382. h2: [],
  4383. h3: [],
  4384. h4: [],
  4385. h5: [],
  4386. h6: [],
  4387. i: [],
  4388. img: ['src', 'alt', 'title', 'width', 'height'],
  4389. li: [],
  4390. ol: [],
  4391. p: [],
  4392. pre: [],
  4393. s: [],
  4394. small: [],
  4395. span: [],
  4396. sub: [],
  4397. sup: [],
  4398. strong: [],
  4399. u: [],
  4400. ul: []
  4401. /**
  4402. * A pattern that recognizes a commonly useful subset of URLs that are safe.
  4403. *
  4404. * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts
  4405. */
  4406. };
  4407. var SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi;
  4408. /**
  4409. * A pattern that matches safe data URLs. Only matches image, video and audio types.
  4410. *
  4411. * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts
  4412. */
  4413. var DATA_URL_PATTERN = /^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+/]+=*$/i;
  4414. function allowedAttribute(attr, allowedAttributeList) {
  4415. var attrName = attr.nodeName.toLowerCase();
  4416. if (allowedAttributeList.indexOf(attrName) !== -1) {
  4417. if (uriAttrs.indexOf(attrName) !== -1) {
  4418. return Boolean(attr.nodeValue.match(SAFE_URL_PATTERN) || attr.nodeValue.match(DATA_URL_PATTERN));
  4419. }
  4420. return true;
  4421. }
  4422. var regExp = allowedAttributeList.filter(function (attrRegex) {
  4423. return attrRegex instanceof RegExp;
  4424. }); // Check if a regular expression validates the attribute.
  4425. for (var i = 0, l = regExp.length; i < l; i++) {
  4426. if (attrName.match(regExp[i])) {
  4427. return true;
  4428. }
  4429. }
  4430. return false;
  4431. }
  4432. function sanitizeHtml(unsafeHtml, whiteList, sanitizeFn) {
  4433. if (unsafeHtml.length === 0) {
  4434. return unsafeHtml;
  4435. }
  4436. if (sanitizeFn && typeof sanitizeFn === 'function') {
  4437. return sanitizeFn(unsafeHtml);
  4438. }
  4439. var domParser = new window.DOMParser();
  4440. var createdDocument = domParser.parseFromString(unsafeHtml, 'text/html');
  4441. var whitelistKeys = Object.keys(whiteList);
  4442. var elements = [].slice.call(createdDocument.body.querySelectorAll('*'));
  4443. var _loop = function _loop(i, len) {
  4444. var el = elements[i];
  4445. var elName = el.nodeName.toLowerCase();
  4446. if (whitelistKeys.indexOf(el.nodeName.toLowerCase()) === -1) {
  4447. el.parentNode.removeChild(el);
  4448. return "continue";
  4449. }
  4450. var attributeList = [].slice.call(el.attributes);
  4451. var whitelistedAttributes = [].concat(whiteList['*'] || [], whiteList[elName] || []);
  4452. attributeList.forEach(function (attr) {
  4453. if (!allowedAttribute(attr, whitelistedAttributes)) {
  4454. el.removeAttribute(attr.nodeName);
  4455. }
  4456. });
  4457. };
  4458. for (var i = 0, len = elements.length; i < len; i++) {
  4459. var _ret = _loop(i, len);
  4460. if (_ret === "continue") continue;
  4461. }
  4462. return createdDocument.body.innerHTML;
  4463. }
  4464. /**
  4465. * ------------------------------------------------------------------------
  4466. * Constants
  4467. * ------------------------------------------------------------------------
  4468. */
  4469. var NAME$6 = 'tooltip';
  4470. var VERSION$6 = '4.3.1';
  4471. var DATA_KEY$6 = 'bs.tooltip';
  4472. var EVENT_KEY$6 = "." + DATA_KEY$6;
  4473. var JQUERY_NO_CONFLICT$6 = $.fn[NAME$6];
  4474. var CLASS_PREFIX = 'bs-tooltip';
  4475. var BSCLS_PREFIX_REGEX = new RegExp("(^|\\s)" + CLASS_PREFIX + "\\S+", 'g');
  4476. var DISALLOWED_ATTRIBUTES = ['sanitize', 'whiteList', 'sanitizeFn'];
  4477. var DefaultType$4 = {
  4478. animation: 'boolean',
  4479. template: 'string',
  4480. title: '(string|element|function)',
  4481. trigger: 'string',
  4482. delay: '(number|object)',
  4483. html: 'boolean',
  4484. selector: '(string|boolean)',
  4485. placement: '(string|function)',
  4486. offset: '(number|string|function)',
  4487. container: '(string|element|boolean)',
  4488. fallbackPlacement: '(string|array)',
  4489. boundary: '(string|element)',
  4490. sanitize: 'boolean',
  4491. sanitizeFn: '(null|function)',
  4492. whiteList: 'object'
  4493. };
  4494. var AttachmentMap$1 = {
  4495. AUTO: 'auto',
  4496. TOP: 'top',
  4497. RIGHT: 'right',
  4498. BOTTOM: 'bottom',
  4499. LEFT: 'left'
  4500. };
  4501. var Default$4 = {
  4502. animation: true,
  4503. template: '<div class="tooltip" role="tooltip">' + '<div class="arrow"></div>' + '<div class="tooltip-inner"></div></div>',
  4504. trigger: 'hover focus',
  4505. title: '',
  4506. delay: 0,
  4507. html: false,
  4508. selector: false,
  4509. placement: 'top',
  4510. offset: 0,
  4511. container: false,
  4512. fallbackPlacement: 'flip',
  4513. boundary: 'scrollParent',
  4514. sanitize: true,
  4515. sanitizeFn: null,
  4516. whiteList: DefaultWhitelist
  4517. };
  4518. var HoverState = {
  4519. SHOW: 'show',
  4520. OUT: 'out'
  4521. };
  4522. var Event$6 = {
  4523. HIDE: "hide" + EVENT_KEY$6,
  4524. HIDDEN: "hidden" + EVENT_KEY$6,
  4525. SHOW: "show" + EVENT_KEY$6,
  4526. SHOWN: "shown" + EVENT_KEY$6,
  4527. INSERTED: "inserted" + EVENT_KEY$6,
  4528. CLICK: "click" + EVENT_KEY$6,
  4529. FOCUSIN: "focusin" + EVENT_KEY$6,
  4530. FOCUSOUT: "focusout" + EVENT_KEY$6,
  4531. MOUSEENTER: "mouseenter" + EVENT_KEY$6,
  4532. MOUSELEAVE: "mouseleave" + EVENT_KEY$6
  4533. };
  4534. var ClassName$6 = {
  4535. FADE: 'fade',
  4536. SHOW: 'show'
  4537. };
  4538. var Selector$6 = {
  4539. TOOLTIP: '.tooltip',
  4540. TOOLTIP_INNER: '.tooltip-inner',
  4541. ARROW: '.arrow'
  4542. };
  4543. var Trigger = {
  4544. HOVER: 'hover',
  4545. FOCUS: 'focus',
  4546. CLICK: 'click',
  4547. MANUAL: 'manual'
  4548. /**
  4549. * ------------------------------------------------------------------------
  4550. * Class Definition
  4551. * ------------------------------------------------------------------------
  4552. */
  4553. };
  4554. var Tooltip =
  4555. /*#__PURE__*/
  4556. function () {
  4557. function Tooltip(element, config) {
  4558. /**
  4559. * Check for Popper dependency
  4560. * Popper - https://popper.js.org
  4561. */
  4562. if (typeof Popper === 'undefined') {
  4563. throw new TypeError('Bootstrap\'s tooltips require Popper.js (https://popper.js.org/)');
  4564. } // private
  4565. this._isEnabled = true;
  4566. this._timeout = 0;
  4567. this._hoverState = '';
  4568. this._activeTrigger = {};
  4569. this._popper = null; // Protected
  4570. this.element = element;
  4571. this.config = this._getConfig(config);
  4572. this.tip = null;
  4573. this._setListeners();
  4574. } // Getters
  4575. var _proto = Tooltip.prototype;
  4576. // Public
  4577. _proto.enable = function enable() {
  4578. this._isEnabled = true;
  4579. };
  4580. _proto.disable = function disable() {
  4581. this._isEnabled = false;
  4582. };
  4583. _proto.toggleEnabled = function toggleEnabled() {
  4584. this._isEnabled = !this._isEnabled;
  4585. };
  4586. _proto.toggle = function toggle(event) {
  4587. if (!this._isEnabled) {
  4588. return;
  4589. }
  4590. if (event) {
  4591. var dataKey = this.constructor.DATA_KEY;
  4592. var context = $(event.currentTarget).data(dataKey);
  4593. if (!context) {
  4594. context = new this.constructor(event.currentTarget, this._getDelegateConfig());
  4595. $(event.currentTarget).data(dataKey, context);
  4596. }
  4597. context._activeTrigger.click = !context._activeTrigger.click;
  4598. if (context._isWithActiveTrigger()) {
  4599. context._enter(null, context);
  4600. } else {
  4601. context._leave(null, context);
  4602. }
  4603. } else {
  4604. if ($(this.getTipElement()).hasClass(ClassName$6.SHOW)) {
  4605. this._leave(null, this);
  4606. return;
  4607. }
  4608. this._enter(null, this);
  4609. }
  4610. };
  4611. _proto.dispose = function dispose() {
  4612. clearTimeout(this._timeout);
  4613. $.removeData(this.element, this.constructor.DATA_KEY);
  4614. $(this.element).off(this.constructor.EVENT_KEY);
  4615. $(this.element).closest('.modal').off('hide.bs.modal');
  4616. if (this.tip) {
  4617. $(this.tip).remove();
  4618. }
  4619. this._isEnabled = null;
  4620. this._timeout = null;
  4621. this._hoverState = null;
  4622. this._activeTrigger = null;
  4623. if (this._popper !== null) {
  4624. this._popper.destroy();
  4625. }
  4626. this._popper = null;
  4627. this.element = null;
  4628. this.config = null;
  4629. this.tip = null;
  4630. };
  4631. _proto.show = function show() {
  4632. var _this = this;
  4633. if ($(this.element).css('display') === 'none') {
  4634. throw new Error('Please use show on visible elements');
  4635. }
  4636. var showEvent = $.Event(this.constructor.Event.SHOW);
  4637. if (this.isWithContent() && this._isEnabled) {
  4638. $(this.element).trigger(showEvent);
  4639. var shadowRoot = Util.findShadowRoot(this.element);
  4640. var isInTheDom = $.contains(shadowRoot !== null ? shadowRoot : this.element.ownerDocument.documentElement, this.element);
  4641. if (showEvent.isDefaultPrevented() || !isInTheDom) {
  4642. return;
  4643. }
  4644. var tip = this.getTipElement();
  4645. var tipId = Util.getUID(this.constructor.NAME);
  4646. tip.setAttribute('id', tipId);
  4647. this.element.setAttribute('aria-describedby', tipId);
  4648. this.setContent();
  4649. if (this.config.animation) {
  4650. $(tip).addClass(ClassName$6.FADE);
  4651. }
  4652. var placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this.element) : this.config.placement;
  4653. var attachment = this._getAttachment(placement);
  4654. this.addAttachmentClass(attachment);
  4655. var container = this._getContainer();
  4656. $(tip).data(this.constructor.DATA_KEY, this);
  4657. if (!$.contains(this.element.ownerDocument.documentElement, this.tip)) {
  4658. $(tip).appendTo(container);
  4659. }
  4660. $(this.element).trigger(this.constructor.Event.INSERTED);
  4661. this._popper = new Popper(this.element, tip, {
  4662. placement: attachment,
  4663. modifiers: {
  4664. offset: this._getOffset(),
  4665. flip: {
  4666. behavior: this.config.fallbackPlacement
  4667. },
  4668. arrow: {
  4669. element: Selector$6.ARROW
  4670. },
  4671. preventOverflow: {
  4672. boundariesElement: this.config.boundary
  4673. }
  4674. },
  4675. onCreate: function onCreate(data) {
  4676. if (data.originalPlacement !== data.placement) {
  4677. _this._handlePopperPlacementChange(data);
  4678. }
  4679. },
  4680. onUpdate: function onUpdate(data) {
  4681. return _this._handlePopperPlacementChange(data);
  4682. }
  4683. });
  4684. $(tip).addClass(ClassName$6.SHOW); // If this is a touch-enabled device we add extra
  4685. // empty mouseover listeners to the body's immediate children;
  4686. // only needed because of broken event delegation on iOS
  4687. // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
  4688. if ('ontouchstart' in document.documentElement) {
  4689. $(document.body).children().on('mouseover', null, $.noop);
  4690. }
  4691. var complete = function complete() {
  4692. if (_this.config.animation) {
  4693. _this._fixTransition();
  4694. }
  4695. var prevHoverState = _this._hoverState;
  4696. _this._hoverState = null;
  4697. $(_this.element).trigger(_this.constructor.Event.SHOWN);
  4698. if (prevHoverState === HoverState.OUT) {
  4699. _this._leave(null, _this);
  4700. }
  4701. };
  4702. if ($(this.tip).hasClass(ClassName$6.FADE)) {
  4703. var transitionDuration = Util.getTransitionDurationFromElement(this.tip);
  4704. $(this.tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
  4705. } else {
  4706. complete();
  4707. }
  4708. }
  4709. };
  4710. _proto.hide = function hide(callback) {
  4711. var _this2 = this;
  4712. var tip = this.getTipElement();
  4713. var hideEvent = $.Event(this.constructor.Event.HIDE);
  4714. var complete = function complete() {
  4715. if (_this2._hoverState !== HoverState.SHOW && tip.parentNode) {
  4716. tip.parentNode.removeChild(tip);
  4717. }
  4718. _this2._cleanTipClass();
  4719. _this2.element.removeAttribute('aria-describedby');
  4720. $(_this2.element).trigger(_this2.constructor.Event.HIDDEN);
  4721. if (_this2._popper !== null) {
  4722. _this2._popper.destroy();
  4723. }
  4724. if (callback) {
  4725. callback();
  4726. }
  4727. };
  4728. $(this.element).trigger(hideEvent);
  4729. if (hideEvent.isDefaultPrevented()) {
  4730. return;
  4731. }
  4732. $(tip).removeClass(ClassName$6.SHOW); // If this is a touch-enabled device we remove the extra
  4733. // empty mouseover listeners we added for iOS support
  4734. if ('ontouchstart' in document.documentElement) {
  4735. $(document.body).children().off('mouseover', null, $.noop);
  4736. }
  4737. this._activeTrigger[Trigger.CLICK] = false;
  4738. this._activeTrigger[Trigger.FOCUS] = false;
  4739. this._activeTrigger[Trigger.HOVER] = false;
  4740. if ($(this.tip).hasClass(ClassName$6.FADE)) {
  4741. var transitionDuration = Util.getTransitionDurationFromElement(tip);
  4742. $(tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
  4743. } else {
  4744. complete();
  4745. }
  4746. this._hoverState = '';
  4747. };
  4748. _proto.update = function update() {
  4749. if (this._popper !== null) {
  4750. this._popper.scheduleUpdate();
  4751. }
  4752. } // Protected
  4753. ;
  4754. _proto.isWithContent = function isWithContent() {
  4755. return Boolean(this.getTitle());
  4756. };
  4757. _proto.addAttachmentClass = function addAttachmentClass(attachment) {
  4758. $(this.getTipElement()).addClass(CLASS_PREFIX + "-" + attachment);
  4759. };
  4760. _proto.getTipElement = function getTipElement() {
  4761. this.tip = this.tip || $(this.config.template)[0];
  4762. return this.tip;
  4763. };
  4764. _proto.setContent = function setContent() {
  4765. var tip = this.getTipElement();
  4766. this.setElementContent($(tip.querySelectorAll(Selector$6.TOOLTIP_INNER)), this.getTitle());
  4767. $(tip).removeClass(ClassName$6.FADE + " " + ClassName$6.SHOW);
  4768. };
  4769. _proto.setElementContent = function setElementContent($element, content) {
  4770. if (typeof content === 'object' && (content.nodeType || content.jquery)) {
  4771. // Content is a DOM node or a jQuery
  4772. if (this.config.html) {
  4773. if (!$(content).parent().is($element)) {
  4774. $element.empty().append(content);
  4775. }
  4776. } else {
  4777. $element.text($(content).text());
  4778. }
  4779. return;
  4780. }
  4781. if (this.config.html) {
  4782. if (this.config.sanitize) {
  4783. content = sanitizeHtml(content, this.config.whiteList, this.config.sanitizeFn);
  4784. }
  4785. $element.html(content);
  4786. } else {
  4787. $element.text(content);
  4788. }
  4789. };
  4790. _proto.getTitle = function getTitle() {
  4791. var title = this.element.getAttribute('data-original-title');
  4792. if (!title) {
  4793. title = typeof this.config.title === 'function' ? this.config.title.call(this.element) : this.config.title;
  4794. }
  4795. return title;
  4796. } // Private
  4797. ;
  4798. _proto._getOffset = function _getOffset() {
  4799. var _this3 = this;
  4800. var offset = {};
  4801. if (typeof this.config.offset === 'function') {
  4802. offset.fn = function (data) {
  4803. data.offsets = _objectSpread({}, data.offsets, _this3.config.offset(data.offsets, _this3.element) || {});
  4804. return data;
  4805. };
  4806. } else {
  4807. offset.offset = this.config.offset;
  4808. }
  4809. return offset;
  4810. };
  4811. _proto._getContainer = function _getContainer() {
  4812. if (this.config.container === false) {
  4813. return document.body;
  4814. }
  4815. if (Util.isElement(this.config.container)) {
  4816. return $(this.config.container);
  4817. }
  4818. return $(document).find(this.config.container);
  4819. };
  4820. _proto._getAttachment = function _getAttachment(placement) {
  4821. return AttachmentMap$1[placement.toUpperCase()];
  4822. };
  4823. _proto._setListeners = function _setListeners() {
  4824. var _this4 = this;
  4825. var triggers = this.config.trigger.split(' ');
  4826. triggers.forEach(function (trigger) {
  4827. if (trigger === 'click') {
  4828. $(_this4.element).on(_this4.constructor.Event.CLICK, _this4.config.selector, function (event) {
  4829. return _this4.toggle(event);
  4830. });
  4831. } else if (trigger !== Trigger.MANUAL) {
  4832. var eventIn = trigger === Trigger.HOVER ? _this4.constructor.Event.MOUSEENTER : _this4.constructor.Event.FOCUSIN;
  4833. var eventOut = trigger === Trigger.HOVER ? _this4.constructor.Event.MOUSELEAVE : _this4.constructor.Event.FOCUSOUT;
  4834. $(_this4.element).on(eventIn, _this4.config.selector, function (event) {
  4835. return _this4._enter(event);
  4836. }).on(eventOut, _this4.config.selector, function (event) {
  4837. return _this4._leave(event);
  4838. });
  4839. }
  4840. });
  4841. $(this.element).closest('.modal').on('hide.bs.modal', function () {
  4842. if (_this4.element) {
  4843. _this4.hide();
  4844. }
  4845. });
  4846. if (this.config.selector) {
  4847. this.config = _objectSpread({}, this.config, {
  4848. trigger: 'manual',
  4849. selector: ''
  4850. });
  4851. } else {
  4852. this._fixTitle();
  4853. }
  4854. };
  4855. _proto._fixTitle = function _fixTitle() {
  4856. var titleType = typeof this.element.getAttribute('data-original-title');
  4857. if (this.element.getAttribute('title') || titleType !== 'string') {
  4858. this.element.setAttribute('data-original-title', this.element.getAttribute('title') || '');
  4859. this.element.setAttribute('title', '');
  4860. }
  4861. };
  4862. _proto._enter = function _enter(event, context) {
  4863. var dataKey = this.constructor.DATA_KEY;
  4864. context = context || $(event.currentTarget).data(dataKey);
  4865. if (!context) {
  4866. context = new this.constructor(event.currentTarget, this._getDelegateConfig());
  4867. $(event.currentTarget).data(dataKey, context);
  4868. }
  4869. if (event) {
  4870. context._activeTrigger[event.type === 'focusin' ? Trigger.FOCUS : Trigger.HOVER] = true;
  4871. }
  4872. if ($(context.getTipElement()).hasClass(ClassName$6.SHOW) || context._hoverState === HoverState.SHOW) {
  4873. context._hoverState = HoverState.SHOW;
  4874. return;
  4875. }
  4876. clearTimeout(context._timeout);
  4877. context._hoverState = HoverState.SHOW;
  4878. if (!context.config.delay || !context.config.delay.show) {
  4879. context.show();
  4880. return;
  4881. }
  4882. context._timeout = setTimeout(function () {
  4883. if (context._hoverState === HoverState.SHOW) {
  4884. context.show();
  4885. }
  4886. }, context.config.delay.show);
  4887. };
  4888. _proto._leave = function _leave(event, context) {
  4889. var dataKey = this.constructor.DATA_KEY;
  4890. context = context || $(event.currentTarget).data(dataKey);
  4891. if (!context) {
  4892. context = new this.constructor(event.currentTarget, this._getDelegateConfig());
  4893. $(event.currentTarget).data(dataKey, context);
  4894. }
  4895. if (event) {
  4896. context._activeTrigger[event.type === 'focusout' ? Trigger.FOCUS : Trigger.HOVER] = false;
  4897. }
  4898. if (context._isWithActiveTrigger()) {
  4899. return;
  4900. }
  4901. clearTimeout(context._timeout);
  4902. context._hoverState = HoverState.OUT;
  4903. if (!context.config.delay || !context.config.delay.hide) {
  4904. context.hide();
  4905. return;
  4906. }
  4907. context._timeout = setTimeout(function () {
  4908. if (context._hoverState === HoverState.OUT) {
  4909. context.hide();
  4910. }
  4911. }, context.config.delay.hide);
  4912. };
  4913. _proto._isWithActiveTrigger = function _isWithActiveTrigger() {
  4914. for (var trigger in this._activeTrigger) {
  4915. if (this._activeTrigger[trigger]) {
  4916. return true;
  4917. }
  4918. }
  4919. return false;
  4920. };
  4921. _proto._getConfig = function _getConfig(config) {
  4922. var dataAttributes = $(this.element).data();
  4923. Object.keys(dataAttributes).forEach(function (dataAttr) {
  4924. if (DISALLOWED_ATTRIBUTES.indexOf(dataAttr) !== -1) {
  4925. delete dataAttributes[dataAttr];
  4926. }
  4927. });
  4928. config = _objectSpread({}, this.constructor.Default, dataAttributes, typeof config === 'object' && config ? config : {});
  4929. if (typeof config.delay === 'number') {
  4930. config.delay = {
  4931. show: config.delay,
  4932. hide: config.delay
  4933. };
  4934. }
  4935. if (typeof config.title === 'number') {
  4936. config.title = config.title.toString();
  4937. }
  4938. if (typeof config.content === 'number') {
  4939. config.content = config.content.toString();
  4940. }
  4941. Util.typeCheckConfig(NAME$6, config, this.constructor.DefaultType);
  4942. if (config.sanitize) {
  4943. config.template = sanitizeHtml(config.template, config.whiteList, config.sanitizeFn);
  4944. }
  4945. return config;
  4946. };
  4947. _proto._getDelegateConfig = function _getDelegateConfig() {
  4948. var config = {};
  4949. if (this.config) {
  4950. for (var key in this.config) {
  4951. if (this.constructor.Default[key] !== this.config[key]) {
  4952. config[key] = this.config[key];
  4953. }
  4954. }
  4955. }
  4956. return config;
  4957. };
  4958. _proto._cleanTipClass = function _cleanTipClass() {
  4959. var $tip = $(this.getTipElement());
  4960. var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX);
  4961. if (tabClass !== null && tabClass.length) {
  4962. $tip.removeClass(tabClass.join(''));
  4963. }
  4964. };
  4965. _proto._handlePopperPlacementChange = function _handlePopperPlacementChange(popperData) {
  4966. var popperInstance = popperData.instance;
  4967. this.tip = popperInstance.popper;
  4968. this._cleanTipClass();
  4969. this.addAttachmentClass(this._getAttachment(popperData.placement));
  4970. };
  4971. _proto._fixTransition = function _fixTransition() {
  4972. var tip = this.getTipElement();
  4973. var initConfigAnimation = this.config.animation;
  4974. if (tip.getAttribute('x-placement') !== null) {
  4975. return;
  4976. }
  4977. $(tip).removeClass(ClassName$6.FADE);
  4978. this.config.animation = false;
  4979. this.hide();
  4980. this.show();
  4981. this.config.animation = initConfigAnimation;
  4982. } // Static
  4983. ;
  4984. Tooltip._jQueryInterface = function _jQueryInterface(config) {
  4985. return this.each(function () {
  4986. var data = $(this).data(DATA_KEY$6);
  4987. var _config = typeof config === 'object' && config;
  4988. if (!data && /dispose|hide/.test(config)) {
  4989. return;
  4990. }
  4991. if (!data) {
  4992. data = new Tooltip(this, _config);
  4993. $(this).data(DATA_KEY$6, data);
  4994. }
  4995. if (typeof config === 'string') {
  4996. if (typeof data[config] === 'undefined') {
  4997. throw new TypeError("No method named \"" + config + "\"");
  4998. }
  4999. data[config]();
  5000. }
  5001. });
  5002. };
  5003. _createClass(Tooltip, null, [{
  5004. key: "VERSION",
  5005. get: function get() {
  5006. return VERSION$6;
  5007. }
  5008. }, {
  5009. key: "Default",
  5010. get: function get() {
  5011. return Default$4;
  5012. }
  5013. }, {
  5014. key: "NAME",
  5015. get: function get() {
  5016. return NAME$6;
  5017. }
  5018. }, {
  5019. key: "DATA_KEY",
  5020. get: function get() {
  5021. return DATA_KEY$6;
  5022. }
  5023. }, {
  5024. key: "Event",
  5025. get: function get() {
  5026. return Event$6;
  5027. }
  5028. }, {
  5029. key: "EVENT_KEY",
  5030. get: function get() {
  5031. return EVENT_KEY$6;
  5032. }
  5033. }, {
  5034. key: "DefaultType",
  5035. get: function get() {
  5036. return DefaultType$4;
  5037. }
  5038. }]);
  5039. return Tooltip;
  5040. }();
  5041. /**
  5042. * ------------------------------------------------------------------------
  5043. * jQuery
  5044. * ------------------------------------------------------------------------
  5045. */
  5046. $.fn[NAME$6] = Tooltip._jQueryInterface;
  5047. $.fn[NAME$6].Constructor = Tooltip;
  5048. $.fn[NAME$6].noConflict = function () {
  5049. $.fn[NAME$6] = JQUERY_NO_CONFLICT$6;
  5050. return Tooltip._jQueryInterface;
  5051. };
  5052. /**
  5053. * ------------------------------------------------------------------------
  5054. * Constants
  5055. * ------------------------------------------------------------------------
  5056. */
  5057. var NAME$7 = 'popover';
  5058. var VERSION$7 = '4.3.1';
  5059. var DATA_KEY$7 = 'bs.popover';
  5060. var EVENT_KEY$7 = "." + DATA_KEY$7;
  5061. var JQUERY_NO_CONFLICT$7 = $.fn[NAME$7];
  5062. var CLASS_PREFIX$1 = 'bs-popover';
  5063. var BSCLS_PREFIX_REGEX$1 = new RegExp("(^|\\s)" + CLASS_PREFIX$1 + "\\S+", 'g');
  5064. var Default$5 = _objectSpread({}, Tooltip.Default, {
  5065. placement: 'right',
  5066. trigger: 'click',
  5067. content: '',
  5068. template: '<div class="popover" role="tooltip">' + '<div class="arrow"></div>' + '<h3 class="popover-header"></h3>' + '<div class="popover-body"></div></div>'
  5069. });
  5070. var DefaultType$5 = _objectSpread({}, Tooltip.DefaultType, {
  5071. content: '(string|element|function)'
  5072. });
  5073. var ClassName$7 = {
  5074. FADE: 'fade',
  5075. SHOW: 'show'
  5076. };
  5077. var Selector$7 = {
  5078. TITLE: '.popover-header',
  5079. CONTENT: '.popover-body'
  5080. };
  5081. var Event$7 = {
  5082. HIDE: "hide" + EVENT_KEY$7,
  5083. HIDDEN: "hidden" + EVENT_KEY$7,
  5084. SHOW: "show" + EVENT_KEY$7,
  5085. SHOWN: "shown" + EVENT_KEY$7,
  5086. INSERTED: "inserted" + EVENT_KEY$7,
  5087. CLICK: "click" + EVENT_KEY$7,
  5088. FOCUSIN: "focusin" + EVENT_KEY$7,
  5089. FOCUSOUT: "focusout" + EVENT_KEY$7,
  5090. MOUSEENTER: "mouseenter" + EVENT_KEY$7,
  5091. MOUSELEAVE: "mouseleave" + EVENT_KEY$7
  5092. /**
  5093. * ------------------------------------------------------------------------
  5094. * Class Definition
  5095. * ------------------------------------------------------------------------
  5096. */
  5097. };
  5098. var Popover =
  5099. /*#__PURE__*/
  5100. function (_Tooltip) {
  5101. _inheritsLoose(Popover, _Tooltip);
  5102. function Popover() {
  5103. return _Tooltip.apply(this, arguments) || this;
  5104. }
  5105. var _proto = Popover.prototype;
  5106. // Overrides
  5107. _proto.isWithContent = function isWithContent() {
  5108. return this.getTitle() || this._getContent();
  5109. };
  5110. _proto.addAttachmentClass = function addAttachmentClass(attachment) {
  5111. $(this.getTipElement()).addClass(CLASS_PREFIX$1 + "-" + attachment);
  5112. };
  5113. _proto.getTipElement = function getTipElement() {
  5114. this.tip = this.tip || $(this.config.template)[0];
  5115. return this.tip;
  5116. };
  5117. _proto.setContent = function setContent() {
  5118. var $tip = $(this.getTipElement()); // We use append for html objects to maintain js events
  5119. this.setElementContent($tip.find(Selector$7.TITLE), this.getTitle());
  5120. var content = this._getContent();
  5121. if (typeof content === 'function') {
  5122. content = content.call(this.element);
  5123. }
  5124. this.setElementContent($tip.find(Selector$7.CONTENT), content);
  5125. $tip.removeClass(ClassName$7.FADE + " " + ClassName$7.SHOW);
  5126. } // Private
  5127. ;
  5128. _proto._getContent = function _getContent() {
  5129. return this.element.getAttribute('data-content') || this.config.content;
  5130. };
  5131. _proto._cleanTipClass = function _cleanTipClass() {
  5132. var $tip = $(this.getTipElement());
  5133. var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX$1);
  5134. if (tabClass !== null && tabClass.length > 0) {
  5135. $tip.removeClass(tabClass.join(''));
  5136. }
  5137. } // Static
  5138. ;
  5139. Popover._jQueryInterface = function _jQueryInterface(config) {
  5140. return this.each(function () {
  5141. var data = $(this).data(DATA_KEY$7);
  5142. var _config = typeof config === 'object' ? config : null;
  5143. if (!data && /dispose|hide/.test(config)) {
  5144. return;
  5145. }
  5146. if (!data) {
  5147. data = new Popover(this, _config);
  5148. $(this).data(DATA_KEY$7, data);
  5149. }
  5150. if (typeof config === 'string') {
  5151. if (typeof data[config] === 'undefined') {
  5152. throw new TypeError("No method named \"" + config + "\"");
  5153. }
  5154. data[config]();
  5155. }
  5156. });
  5157. };
  5158. _createClass(Popover, null, [{
  5159. key: "VERSION",
  5160. // Getters
  5161. get: function get() {
  5162. return VERSION$7;
  5163. }
  5164. }, {
  5165. key: "Default",
  5166. get: function get() {
  5167. return Default$5;
  5168. }
  5169. }, {
  5170. key: "NAME",
  5171. get: function get() {
  5172. return NAME$7;
  5173. }
  5174. }, {
  5175. key: "DATA_KEY",
  5176. get: function get() {
  5177. return DATA_KEY$7;
  5178. }
  5179. }, {
  5180. key: "Event",
  5181. get: function get() {
  5182. return Event$7;
  5183. }
  5184. }, {
  5185. key: "EVENT_KEY",
  5186. get: function get() {
  5187. return EVENT_KEY$7;
  5188. }
  5189. }, {
  5190. key: "DefaultType",
  5191. get: function get() {
  5192. return DefaultType$5;
  5193. }
  5194. }]);
  5195. return Popover;
  5196. }(Tooltip);
  5197. /**
  5198. * ------------------------------------------------------------------------
  5199. * jQuery
  5200. * ------------------------------------------------------------------------
  5201. */
  5202. $.fn[NAME$7] = Popover._jQueryInterface;
  5203. $.fn[NAME$7].Constructor = Popover;
  5204. $.fn[NAME$7].noConflict = function () {
  5205. $.fn[NAME$7] = JQUERY_NO_CONFLICT$7;
  5206. return Popover._jQueryInterface;
  5207. };
  5208. /**
  5209. * ------------------------------------------------------------------------
  5210. * Constants
  5211. * ------------------------------------------------------------------------
  5212. */
  5213. var NAME$8 = 'scrollspy';
  5214. var VERSION$8 = '4.3.1';
  5215. var DATA_KEY$8 = 'bs.scrollspy';
  5216. var EVENT_KEY$8 = "." + DATA_KEY$8;
  5217. var DATA_API_KEY$6 = '.data-api';
  5218. var JQUERY_NO_CONFLICT$8 = $.fn[NAME$8];
  5219. var Default$6 = {
  5220. offset: 10,
  5221. method: 'auto',
  5222. target: ''
  5223. };
  5224. var DefaultType$6 = {
  5225. offset: 'number',
  5226. method: 'string',
  5227. target: '(string|element)'
  5228. };
  5229. var Event$8 = {
  5230. ACTIVATE: "activate" + EVENT_KEY$8,
  5231. SCROLL: "scroll" + EVENT_KEY$8,
  5232. LOAD_DATA_API: "load" + EVENT_KEY$8 + DATA_API_KEY$6
  5233. };
  5234. var ClassName$8 = {
  5235. DROPDOWN_ITEM: 'dropdown-item',
  5236. DROPDOWN_MENU: 'dropdown-menu',
  5237. ACTIVE: 'active'
  5238. };
  5239. var Selector$8 = {
  5240. DATA_SPY: '[data-spy="scroll"]',
  5241. ACTIVE: '.active',
  5242. NAV_LIST_GROUP: '.nav, .list-group',
  5243. NAV_LINKS: '.nav-link',
  5244. NAV_ITEMS: '.nav-item',
  5245. LIST_ITEMS: '.list-group-item',
  5246. DROPDOWN: '.dropdown',
  5247. DROPDOWN_ITEMS: '.dropdown-item',
  5248. DROPDOWN_TOGGLE: '.dropdown-toggle'
  5249. };
  5250. var OffsetMethod = {
  5251. OFFSET: 'offset',
  5252. POSITION: 'position'
  5253. /**
  5254. * ------------------------------------------------------------------------
  5255. * Class Definition
  5256. * ------------------------------------------------------------------------
  5257. */
  5258. };
  5259. var ScrollSpy =
  5260. /*#__PURE__*/
  5261. function () {
  5262. function ScrollSpy(element, config) {
  5263. var _this = this;
  5264. this._element = element;
  5265. this._scrollElement = element.tagName === 'BODY' ? window : element;
  5266. this._config = this._getConfig(config);
  5267. this._selector = this._config.target + " " + Selector$8.NAV_LINKS + "," + (this._config.target + " " + Selector$8.LIST_ITEMS + ",") + (this._config.target + " " + Selector$8.DROPDOWN_ITEMS);
  5268. this._offsets = [];
  5269. this._targets = [];
  5270. this._activeTarget = null;
  5271. this._scrollHeight = 0;
  5272. $(this._scrollElement).on(Event$8.SCROLL, function (event) {
  5273. return _this._process(event);
  5274. });
  5275. this.refresh();
  5276. this._process();
  5277. } // Getters
  5278. var _proto = ScrollSpy.prototype;
  5279. // Public
  5280. _proto.refresh = function refresh() {
  5281. var _this2 = this;
  5282. var autoMethod = this._scrollElement === this._scrollElement.window ? OffsetMethod.OFFSET : OffsetMethod.POSITION;
  5283. var offsetMethod = this._config.method === 'auto' ? autoMethod : this._config.method;
  5284. var offsetBase = offsetMethod === OffsetMethod.POSITION ? this._getScrollTop() : 0;
  5285. this._offsets = [];
  5286. this._targets = [];
  5287. this._scrollHeight = this._getScrollHeight();
  5288. var targets = [].slice.call(document.querySelectorAll(this._selector));
  5289. targets.map(function (element) {
  5290. var target;
  5291. var targetSelector = Util.getSelectorFromElement(element);
  5292. if (targetSelector) {
  5293. target = document.querySelector(targetSelector);
  5294. }
  5295. if (target) {
  5296. var targetBCR = target.getBoundingClientRect();
  5297. if (targetBCR.width || targetBCR.height) {
  5298. // TODO (fat): remove sketch reliance on jQuery position/offset
  5299. return [$(target)[offsetMethod]().top + offsetBase, targetSelector];
  5300. }
  5301. }
  5302. return null;
  5303. }).filter(function (item) {
  5304. return item;
  5305. }).sort(function (a, b) {
  5306. return a[0] - b[0];
  5307. }).forEach(function (item) {
  5308. _this2._offsets.push(item[0]);
  5309. _this2._targets.push(item[1]);
  5310. });
  5311. };
  5312. _proto.dispose = function dispose() {
  5313. $.removeData(this._element, DATA_KEY$8);
  5314. $(this._scrollElement).off(EVENT_KEY$8);
  5315. this._element = null;
  5316. this._scrollElement = null;
  5317. this._config = null;
  5318. this._selector = null;
  5319. this._offsets = null;
  5320. this._targets = null;
  5321. this._activeTarget = null;
  5322. this._scrollHeight = null;
  5323. } // Private
  5324. ;
  5325. _proto._getConfig = function _getConfig(config) {
  5326. config = _objectSpread({}, Default$6, typeof config === 'object' && config ? config : {});
  5327. if (typeof config.target !== 'string') {
  5328. var id = $(config.target).attr('id');
  5329. if (!id) {
  5330. id = Util.getUID(NAME$8);
  5331. $(config.target).attr('id', id);
  5332. }
  5333. config.target = "#" + id;
  5334. }
  5335. Util.typeCheckConfig(NAME$8, config, DefaultType$6);
  5336. return config;
  5337. };
  5338. _proto._getScrollTop = function _getScrollTop() {
  5339. return this._scrollElement === window ? this._scrollElement.pageYOffset : this._scrollElement.scrollTop;
  5340. };
  5341. _proto._getScrollHeight = function _getScrollHeight() {
  5342. return this._scrollElement.scrollHeight || Math.max(document.body.scrollHeight, document.documentElement.scrollHeight);
  5343. };
  5344. _proto._getOffsetHeight = function _getOffsetHeight() {
  5345. return this._scrollElement === window ? window.innerHeight : this._scrollElement.getBoundingClientRect().height;
  5346. };
  5347. _proto._process = function _process() {
  5348. var scrollTop = this._getScrollTop() + this._config.offset;
  5349. var scrollHeight = this._getScrollHeight();
  5350. var maxScroll = this._config.offset + scrollHeight - this._getOffsetHeight();
  5351. if (this._scrollHeight !== scrollHeight) {
  5352. this.refresh();
  5353. }
  5354. if (scrollTop >= maxScroll) {
  5355. var target = this._targets[this._targets.length - 1];
  5356. if (this._activeTarget !== target) {
  5357. this._activate(target);
  5358. }
  5359. return;
  5360. }
  5361. if (this._activeTarget && scrollTop < this._offsets[0] && this._offsets[0] > 0) {
  5362. this._activeTarget = null;
  5363. this._clear();
  5364. return;
  5365. }
  5366. var offsetLength = this._offsets.length;
  5367. for (var i = offsetLength; i--;) {
  5368. var isActiveTarget = this._activeTarget !== this._targets[i] && scrollTop >= this._offsets[i] && (typeof this._offsets[i + 1] === 'undefined' || scrollTop < this._offsets[i + 1]);
  5369. if (isActiveTarget) {
  5370. this._activate(this._targets[i]);
  5371. }
  5372. }
  5373. };
  5374. _proto._activate = function _activate(target) {
  5375. this._activeTarget = target;
  5376. this._clear();
  5377. var queries = this._selector.split(',').map(function (selector) {
  5378. return selector + "[data-target=\"" + target + "\"]," + selector + "[href=\"" + target + "\"]";
  5379. });
  5380. var $link = $([].slice.call(document.querySelectorAll(queries.join(','))));
  5381. if ($link.hasClass(ClassName$8.DROPDOWN_ITEM)) {
  5382. $link.closest(Selector$8.DROPDOWN).find(Selector$8.DROPDOWN_TOGGLE).addClass(ClassName$8.ACTIVE);
  5383. $link.addClass(ClassName$8.ACTIVE);
  5384. } else {
  5385. // Set triggered link as active
  5386. $link.addClass(ClassName$8.ACTIVE); // Set triggered links parents as active
  5387. // With both <ul> and <nav> markup a parent is the previous sibling of any nav ancestor
  5388. $link.parents(Selector$8.NAV_LIST_GROUP).prev(Selector$8.NAV_LINKS + ", " + Selector$8.LIST_ITEMS).addClass(ClassName$8.ACTIVE); // Handle special case when .nav-link is inside .nav-item
  5389. $link.parents(Selector$8.NAV_LIST_GROUP).prev(Selector$8.NAV_ITEMS).children(Selector$8.NAV_LINKS).addClass(ClassName$8.ACTIVE);
  5390. }
  5391. $(this._scrollElement).trigger(Event$8.ACTIVATE, {
  5392. relatedTarget: target
  5393. });
  5394. };
  5395. _proto._clear = function _clear() {
  5396. [].slice.call(document.querySelectorAll(this._selector)).filter(function (node) {
  5397. return node.classList.contains(ClassName$8.ACTIVE);
  5398. }).forEach(function (node) {
  5399. return node.classList.remove(ClassName$8.ACTIVE);
  5400. });
  5401. } // Static
  5402. ;
  5403. ScrollSpy._jQueryInterface = function _jQueryInterface(config) {
  5404. return this.each(function () {
  5405. var data = $(this).data(DATA_KEY$8);
  5406. var _config = typeof config === 'object' && config;
  5407. if (!data) {
  5408. data = new ScrollSpy(this, _config);
  5409. $(this).data(DATA_KEY$8, data);
  5410. }
  5411. if (typeof config === 'string') {
  5412. if (typeof data[config] === 'undefined') {
  5413. throw new TypeError("No method named \"" + config + "\"");
  5414. }
  5415. data[config]();
  5416. }
  5417. });
  5418. };
  5419. _createClass(ScrollSpy, null, [{
  5420. key: "VERSION",
  5421. get: function get() {
  5422. return VERSION$8;
  5423. }
  5424. }, {
  5425. key: "Default",
  5426. get: function get() {
  5427. return Default$6;
  5428. }
  5429. }]);
  5430. return ScrollSpy;
  5431. }();
  5432. /**
  5433. * ------------------------------------------------------------------------
  5434. * Data Api implementation
  5435. * ------------------------------------------------------------------------
  5436. */
  5437. $(window).on(Event$8.LOAD_DATA_API, function () {
  5438. var scrollSpys = [].slice.call(document.querySelectorAll(Selector$8.DATA_SPY));
  5439. var scrollSpysLength = scrollSpys.length;
  5440. for (var i = scrollSpysLength; i--;) {
  5441. var $spy = $(scrollSpys[i]);
  5442. ScrollSpy._jQueryInterface.call($spy, $spy.data());
  5443. }
  5444. });
  5445. /**
  5446. * ------------------------------------------------------------------------
  5447. * jQuery
  5448. * ------------------------------------------------------------------------
  5449. */
  5450. $.fn[NAME$8] = ScrollSpy._jQueryInterface;
  5451. $.fn[NAME$8].Constructor = ScrollSpy;
  5452. $.fn[NAME$8].noConflict = function () {
  5453. $.fn[NAME$8] = JQUERY_NO_CONFLICT$8;
  5454. return ScrollSpy._jQueryInterface;
  5455. };
  5456. /**
  5457. * ------------------------------------------------------------------------
  5458. * Constants
  5459. * ------------------------------------------------------------------------
  5460. */
  5461. var NAME$9 = 'tab';
  5462. var VERSION$9 = '4.3.1';
  5463. var DATA_KEY$9 = 'bs.tab';
  5464. var EVENT_KEY$9 = "." + DATA_KEY$9;
  5465. var DATA_API_KEY$7 = '.data-api';
  5466. var JQUERY_NO_CONFLICT$9 = $.fn[NAME$9];
  5467. var Event$9 = {
  5468. HIDE: "hide" + EVENT_KEY$9,
  5469. HIDDEN: "hidden" + EVENT_KEY$9,
  5470. SHOW: "show" + EVENT_KEY$9,
  5471. SHOWN: "shown" + EVENT_KEY$9,
  5472. CLICK_DATA_API: "click" + EVENT_KEY$9 + DATA_API_KEY$7
  5473. };
  5474. var ClassName$9 = {
  5475. DROPDOWN_MENU: 'dropdown-menu',
  5476. ACTIVE: 'active',
  5477. DISABLED: 'disabled',
  5478. FADE: 'fade',
  5479. SHOW: 'show'
  5480. };
  5481. var Selector$9 = {
  5482. DROPDOWN: '.dropdown',
  5483. NAV_LIST_GROUP: '.nav, .list-group',
  5484. ACTIVE: '.active',
  5485. ACTIVE_UL: '> li > .active',
  5486. DATA_TOGGLE: '[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]',
  5487. DROPDOWN_TOGGLE: '.dropdown-toggle',
  5488. DROPDOWN_ACTIVE_CHILD: '> .dropdown-menu .active'
  5489. /**
  5490. * ------------------------------------------------------------------------
  5491. * Class Definition
  5492. * ------------------------------------------------------------------------
  5493. */
  5494. };
  5495. var Tab =
  5496. /*#__PURE__*/
  5497. function () {
  5498. function Tab(element) {
  5499. this._element = element;
  5500. } // Getters
  5501. var _proto = Tab.prototype;
  5502. // Public
  5503. _proto.show = function show() {
  5504. var _this = this;
  5505. if (this._element.parentNode && this._element.parentNode.nodeType === Node.ELEMENT_NODE && $(this._element).hasClass(ClassName$9.ACTIVE) || $(this._element).hasClass(ClassName$9.DISABLED)) {
  5506. return;
  5507. }
  5508. var target;
  5509. var previous;
  5510. var listElement = $(this._element).closest(Selector$9.NAV_LIST_GROUP)[0];
  5511. var selector = Util.getSelectorFromElement(this._element);
  5512. if (listElement) {
  5513. var itemSelector = listElement.nodeName === 'UL' || listElement.nodeName === 'OL' ? Selector$9.ACTIVE_UL : Selector$9.ACTIVE;
  5514. previous = $.makeArray($(listElement).find(itemSelector));
  5515. previous = previous[previous.length - 1];
  5516. }
  5517. var hideEvent = $.Event(Event$9.HIDE, {
  5518. relatedTarget: this._element
  5519. });
  5520. var showEvent = $.Event(Event$9.SHOW, {
  5521. relatedTarget: previous
  5522. });
  5523. if (previous) {
  5524. $(previous).trigger(hideEvent);
  5525. }
  5526. $(this._element).trigger(showEvent);
  5527. if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) {
  5528. return;
  5529. }
  5530. if (selector) {
  5531. target = document.querySelector(selector);
  5532. }
  5533. this._activate(this._element, listElement);
  5534. var complete = function complete() {
  5535. var hiddenEvent = $.Event(Event$9.HIDDEN, {
  5536. relatedTarget: _this._element
  5537. });
  5538. var shownEvent = $.Event(Event$9.SHOWN, {
  5539. relatedTarget: previous
  5540. });
  5541. $(previous).trigger(hiddenEvent);
  5542. $(_this._element).trigger(shownEvent);
  5543. };
  5544. if (target) {
  5545. this._activate(target, target.parentNode, complete);
  5546. } else {
  5547. complete();
  5548. }
  5549. };
  5550. _proto.dispose = function dispose() {
  5551. $.removeData(this._element, DATA_KEY$9);
  5552. this._element = null;
  5553. } // Private
  5554. ;
  5555. _proto._activate = function _activate(element, container, callback) {
  5556. var _this2 = this;
  5557. var activeElements = container && (container.nodeName === 'UL' || container.nodeName === 'OL') ? $(container).find(Selector$9.ACTIVE_UL) : $(container).children(Selector$9.ACTIVE);
  5558. var active = activeElements[0];
  5559. var isTransitioning = callback && active && $(active).hasClass(ClassName$9.FADE);
  5560. var complete = function complete() {
  5561. return _this2._transitionComplete(element, active, callback);
  5562. };
  5563. if (active && isTransitioning) {
  5564. var transitionDuration = Util.getTransitionDurationFromElement(active);
  5565. $(active).removeClass(ClassName$9.SHOW).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
  5566. } else {
  5567. complete();
  5568. }
  5569. };
  5570. _proto._transitionComplete = function _transitionComplete(element, active, callback) {
  5571. if (active) {
  5572. $(active).removeClass(ClassName$9.ACTIVE);
  5573. var dropdownChild = $(active.parentNode).find(Selector$9.DROPDOWN_ACTIVE_CHILD)[0];
  5574. if (dropdownChild) {
  5575. $(dropdownChild).removeClass(ClassName$9.ACTIVE);
  5576. }
  5577. if (active.getAttribute('role') === 'tab') {
  5578. active.setAttribute('aria-selected', false);
  5579. }
  5580. }
  5581. $(element).addClass(ClassName$9.ACTIVE);
  5582. if (element.getAttribute('role') === 'tab') {
  5583. element.setAttribute('aria-selected', true);
  5584. }
  5585. Util.reflow(element);
  5586. if (element.classList.contains(ClassName$9.FADE)) {
  5587. element.classList.add(ClassName$9.SHOW);
  5588. }
  5589. if (element.parentNode && $(element.parentNode).hasClass(ClassName$9.DROPDOWN_MENU)) {
  5590. var dropdownElement = $(element).closest(Selector$9.DROPDOWN)[0];
  5591. if (dropdownElement) {
  5592. var dropdownToggleList = [].slice.call(dropdownElement.querySelectorAll(Selector$9.DROPDOWN_TOGGLE));
  5593. $(dropdownToggleList).addClass(ClassName$9.ACTIVE);
  5594. }
  5595. element.setAttribute('aria-expanded', true);
  5596. }
  5597. if (callback) {
  5598. callback();
  5599. }
  5600. } // Static
  5601. ;
  5602. Tab._jQueryInterface = function _jQueryInterface(config) {
  5603. return this.each(function () {
  5604. var $this = $(this);
  5605. var data = $this.data(DATA_KEY$9);
  5606. if (!data) {
  5607. data = new Tab(this);
  5608. $this.data(DATA_KEY$9, data);
  5609. }
  5610. if (typeof config === 'string') {
  5611. if (typeof data[config] === 'undefined') {
  5612. throw new TypeError("No method named \"" + config + "\"");
  5613. }
  5614. data[config]();
  5615. }
  5616. });
  5617. };
  5618. _createClass(Tab, null, [{
  5619. key: "VERSION",
  5620. get: function get() {
  5621. return VERSION$9;
  5622. }
  5623. }]);
  5624. return Tab;
  5625. }();
  5626. /**
  5627. * ------------------------------------------------------------------------
  5628. * Data Api implementation
  5629. * ------------------------------------------------------------------------
  5630. */
  5631. $(document).on(Event$9.CLICK_DATA_API, Selector$9.DATA_TOGGLE, function (event) {
  5632. event.preventDefault();
  5633. Tab._jQueryInterface.call($(this), 'show');
  5634. });
  5635. /**
  5636. * ------------------------------------------------------------------------
  5637. * jQuery
  5638. * ------------------------------------------------------------------------
  5639. */
  5640. $.fn[NAME$9] = Tab._jQueryInterface;
  5641. $.fn[NAME$9].Constructor = Tab;
  5642. $.fn[NAME$9].noConflict = function () {
  5643. $.fn[NAME$9] = JQUERY_NO_CONFLICT$9;
  5644. return Tab._jQueryInterface;
  5645. };
  5646. /**
  5647. * ------------------------------------------------------------------------
  5648. * Constants
  5649. * ------------------------------------------------------------------------
  5650. */
  5651. var NAME$a = 'toast';
  5652. var VERSION$a = '4.3.1';
  5653. var DATA_KEY$a = 'bs.toast';
  5654. var EVENT_KEY$a = "." + DATA_KEY$a;
  5655. var JQUERY_NO_CONFLICT$a = $.fn[NAME$a];
  5656. var Event$a = {
  5657. CLICK_DISMISS: "click.dismiss" + EVENT_KEY$a,
  5658. HIDE: "hide" + EVENT_KEY$a,
  5659. HIDDEN: "hidden" + EVENT_KEY$a,
  5660. SHOW: "show" + EVENT_KEY$a,
  5661. SHOWN: "shown" + EVENT_KEY$a
  5662. };
  5663. var ClassName$a = {
  5664. FADE: 'fade',
  5665. HIDE: 'hide',
  5666. SHOW: 'show',
  5667. SHOWING: 'showing'
  5668. };
  5669. var DefaultType$7 = {
  5670. animation: 'boolean',
  5671. autohide: 'boolean',
  5672. delay: 'number'
  5673. };
  5674. var Default$7 = {
  5675. animation: true,
  5676. autohide: true,
  5677. delay: 500
  5678. };
  5679. var Selector$a = {
  5680. DATA_DISMISS: '[data-dismiss="toast"]'
  5681. /**
  5682. * ------------------------------------------------------------------------
  5683. * Class Definition
  5684. * ------------------------------------------------------------------------
  5685. */
  5686. };
  5687. var Toast =
  5688. /*#__PURE__*/
  5689. function () {
  5690. function Toast(element, config) {
  5691. this._element = element;
  5692. this._config = this._getConfig(config);
  5693. this._timeout = null;
  5694. this._setListeners();
  5695. } // Getters
  5696. var _proto = Toast.prototype;
  5697. // Public
  5698. _proto.show = function show() {
  5699. var _this = this;
  5700. $(this._element).trigger(Event$a.SHOW);
  5701. if (this._config.animation) {
  5702. this._element.classList.add(ClassName$a.FADE);
  5703. }
  5704. var complete = function complete() {
  5705. _this._element.classList.remove(ClassName$a.SHOWING);
  5706. _this._element.classList.add(ClassName$a.SHOW);
  5707. $(_this._element).trigger(Event$a.SHOWN);
  5708. if (_this._config.autohide) {
  5709. _this.hide();
  5710. }
  5711. };
  5712. this._element.classList.remove(ClassName$a.HIDE);
  5713. this._element.classList.add(ClassName$a.SHOWING);
  5714. if (this._config.animation) {
  5715. var transitionDuration = Util.getTransitionDurationFromElement(this._element);
  5716. $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
  5717. } else {
  5718. complete();
  5719. }
  5720. };
  5721. _proto.hide = function hide(withoutTimeout) {
  5722. var _this2 = this;
  5723. if (!this._element.classList.contains(ClassName$a.SHOW)) {
  5724. return;
  5725. }
  5726. $(this._element).trigger(Event$a.HIDE);
  5727. if (withoutTimeout) {
  5728. this._close();
  5729. } else {
  5730. this._timeout = setTimeout(function () {
  5731. _this2._close();
  5732. }, this._config.delay);
  5733. }
  5734. };
  5735. _proto.dispose = function dispose() {
  5736. clearTimeout(this._timeout);
  5737. this._timeout = null;
  5738. if (this._element.classList.contains(ClassName$a.SHOW)) {
  5739. this._element.classList.remove(ClassName$a.SHOW);
  5740. }
  5741. $(this._element).off(Event$a.CLICK_DISMISS);
  5742. $.removeData(this._element, DATA_KEY$a);
  5743. this._element = null;
  5744. this._config = null;
  5745. } // Private
  5746. ;
  5747. _proto._getConfig = function _getConfig(config) {
  5748. config = _objectSpread({}, Default$7, $(this._element).data(), typeof config === 'object' && config ? config : {});
  5749. Util.typeCheckConfig(NAME$a, config, this.constructor.DefaultType);
  5750. return config;
  5751. };
  5752. _proto._setListeners = function _setListeners() {
  5753. var _this3 = this;
  5754. $(this._element).on(Event$a.CLICK_DISMISS, Selector$a.DATA_DISMISS, function () {
  5755. return _this3.hide(true);
  5756. });
  5757. };
  5758. _proto._close = function _close() {
  5759. var _this4 = this;
  5760. var complete = function complete() {
  5761. _this4._element.classList.add(ClassName$a.HIDE);
  5762. $(_this4._element).trigger(Event$a.HIDDEN);
  5763. };
  5764. this._element.classList.remove(ClassName$a.SHOW);
  5765. if (this._config.animation) {
  5766. var transitionDuration = Util.getTransitionDurationFromElement(this._element);
  5767. $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
  5768. } else {
  5769. complete();
  5770. }
  5771. } // Static
  5772. ;
  5773. Toast._jQueryInterface = function _jQueryInterface(config) {
  5774. return this.each(function () {
  5775. var $element = $(this);
  5776. var data = $element.data(DATA_KEY$a);
  5777. var _config = typeof config === 'object' && config;
  5778. if (!data) {
  5779. data = new Toast(this, _config);
  5780. $element.data(DATA_KEY$a, data);
  5781. }
  5782. if (typeof config === 'string') {
  5783. if (typeof data[config] === 'undefined') {
  5784. throw new TypeError("No method named \"" + config + "\"");
  5785. }
  5786. data[config](this);
  5787. }
  5788. });
  5789. };
  5790. _createClass(Toast, null, [{
  5791. key: "VERSION",
  5792. get: function get() {
  5793. return VERSION$a;
  5794. }
  5795. }, {
  5796. key: "DefaultType",
  5797. get: function get() {
  5798. return DefaultType$7;
  5799. }
  5800. }, {
  5801. key: "Default",
  5802. get: function get() {
  5803. return Default$7;
  5804. }
  5805. }]);
  5806. return Toast;
  5807. }();
  5808. /**
  5809. * ------------------------------------------------------------------------
  5810. * jQuery
  5811. * ------------------------------------------------------------------------
  5812. */
  5813. $.fn[NAME$a] = Toast._jQueryInterface;
  5814. $.fn[NAME$a].Constructor = Toast;
  5815. $.fn[NAME$a].noConflict = function () {
  5816. $.fn[NAME$a] = JQUERY_NO_CONFLICT$a;
  5817. return Toast._jQueryInterface;
  5818. };
  5819. /**
  5820. * --------------------------------------------------------------------------
  5821. * Bootstrap (v4.3.1): index.js
  5822. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  5823. * --------------------------------------------------------------------------
  5824. */
  5825. (function () {
  5826. if (typeof $ === 'undefined') {
  5827. throw new TypeError('Bootstrap\'s JavaScript requires jQuery. jQuery must be included before Bootstrap\'s JavaScript.');
  5828. }
  5829. var version = $.fn.jquery.split(' ')[0].split('.');
  5830. var minMajor = 1;
  5831. var ltMajor = 2;
  5832. var minMinor = 9;
  5833. var minPatch = 1;
  5834. var maxMajor = 4;
  5835. if (version[0] < ltMajor && version[1] < minMinor || version[0] === minMajor && version[1] === minMinor && version[2] < minPatch || version[0] >= maxMajor) {
  5836. throw new Error('Bootstrap\'s JavaScript requires at least jQuery v1.9.1 but less than v4.0.0');
  5837. }
  5838. })();
  5839. exports.Util = Util;
  5840. exports.Alert = Alert;
  5841. exports.Button = Button;
  5842. exports.Carousel = Carousel;
  5843. exports.Collapse = Collapse;
  5844. exports.Dropdown = Dropdown;
  5845. exports.Modal = Modal;
  5846. exports.Popover = Popover;
  5847. exports.Scrollspy = ScrollSpy;
  5848. exports.Tab = Tab;
  5849. exports.Toast = Toast;
  5850. exports.Tooltip = Tooltip;
  5851. Object.defineProperty(exports, '__esModule', { value: true });
  5852. }));
  5853. //# sourceMappingURL=bootstrap.bundle.js.map