bootstrap.bundle.js 207 KB

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