Development of an internal social media platform with personalised dashboards for students
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

bootstrap.bundle.js 188KB

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