bootstrap.bundle.js 241 KB

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