選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

reactstrap.full.js 341 KiB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640
  1. (function (global, factory) {
  2. typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react'), require('react-dom')) :
  3. typeof define === 'function' && define.amd ? define(['exports', 'react', 'react-dom'], factory) :
  4. (global = global || self, factory(global.Reactstrap = {}, global.React, global.ReactDOM));
  5. }(this, function (exports, React, ReactDOM) { 'use strict';
  6. var React__default = 'default' in React ? React['default'] : React;
  7. ReactDOM = ReactDOM && ReactDOM.hasOwnProperty('default') ? ReactDOM['default'] : ReactDOM;
  8. function _extends() {
  9. _extends = Object.assign || function (target) {
  10. for (var i = 1; i < arguments.length; i++) {
  11. var source = arguments[i];
  12. for (var key in source) {
  13. if (Object.prototype.hasOwnProperty.call(source, key)) {
  14. target[key] = source[key];
  15. }
  16. }
  17. }
  18. return target;
  19. };
  20. return _extends.apply(this, arguments);
  21. }
  22. function _inheritsLoose(subClass, superClass) {
  23. subClass.prototype = Object.create(superClass.prototype);
  24. subClass.prototype.constructor = subClass;
  25. subClass.__proto__ = superClass;
  26. }
  27. function _objectWithoutPropertiesLoose(source, excluded) {
  28. if (source == null) return {};
  29. var target = {};
  30. var sourceKeys = Object.keys(source);
  31. var key, i;
  32. for (i = 0; i < sourceKeys.length; i++) {
  33. key = sourceKeys[i];
  34. if (excluded.indexOf(key) >= 0) continue;
  35. target[key] = source[key];
  36. }
  37. return target;
  38. }
  39. function _assertThisInitialized(self) {
  40. if (self === void 0) {
  41. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  42. }
  43. return self;
  44. }
  45. var commonjsGlobal = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
  46. function unwrapExports (x) {
  47. return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x.default : x;
  48. }
  49. function createCommonjsModule(fn, module) {
  50. return module = { exports: {} }, fn(module, module.exports), module.exports;
  51. }
  52. /*
  53. object-assign
  54. (c) Sindre Sorhus
  55. @license MIT
  56. */
  57. /* eslint-disable no-unused-vars */
  58. var getOwnPropertySymbols = Object.getOwnPropertySymbols;
  59. var hasOwnProperty = Object.prototype.hasOwnProperty;
  60. var propIsEnumerable = Object.prototype.propertyIsEnumerable;
  61. function toObject(val) {
  62. if (val === null || val === undefined) {
  63. throw new TypeError('Object.assign cannot be called with null or undefined');
  64. }
  65. return Object(val);
  66. }
  67. function shouldUseNative() {
  68. try {
  69. if (!Object.assign) {
  70. return false;
  71. } // Detect buggy property enumeration order in older V8 versions.
  72. // https://bugs.chromium.org/p/v8/issues/detail?id=4118
  73. var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
  74. test1[5] = 'de';
  75. if (Object.getOwnPropertyNames(test1)[0] === '5') {
  76. return false;
  77. } // https://bugs.chromium.org/p/v8/issues/detail?id=3056
  78. var test2 = {};
  79. for (var i = 0; i < 10; i++) {
  80. test2['_' + String.fromCharCode(i)] = i;
  81. }
  82. var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
  83. return test2[n];
  84. });
  85. if (order2.join('') !== '0123456789') {
  86. return false;
  87. } // https://bugs.chromium.org/p/v8/issues/detail?id=3056
  88. var test3 = {};
  89. 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
  90. test3[letter] = letter;
  91. });
  92. if (Object.keys(Object.assign({}, test3)).join('') !== 'abcdefghijklmnopqrst') {
  93. return false;
  94. }
  95. return true;
  96. } catch (err) {
  97. // We don't expect any of the above to throw, but better to be safe.
  98. return false;
  99. }
  100. }
  101. var objectAssign = shouldUseNative() ? Object.assign : function (target, source) {
  102. var from;
  103. var to = toObject(target);
  104. var symbols;
  105. for (var s = 1; s < arguments.length; s++) {
  106. from = Object(arguments[s]);
  107. for (var key in from) {
  108. if (hasOwnProperty.call(from, key)) {
  109. to[key] = from[key];
  110. }
  111. }
  112. if (getOwnPropertySymbols) {
  113. symbols = getOwnPropertySymbols(from);
  114. for (var i = 0; i < symbols.length; i++) {
  115. if (propIsEnumerable.call(from, symbols[i])) {
  116. to[symbols[i]] = from[symbols[i]];
  117. }
  118. }
  119. }
  120. }
  121. return to;
  122. };
  123. /**
  124. * Copyright (c) 2013-present, Facebook, Inc.
  125. *
  126. * This source code is licensed under the MIT license found in the
  127. * LICENSE file in the root directory of this source tree.
  128. */
  129. var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
  130. var ReactPropTypesSecret_1 = ReactPropTypesSecret;
  131. function emptyFunction() {}
  132. var factoryWithThrowingShims = function factoryWithThrowingShims() {
  133. function shim(props, propName, componentName, location, propFullName, secret) {
  134. if (secret === ReactPropTypesSecret_1) {
  135. // It is still safe when called from React.
  136. return;
  137. }
  138. var err = new Error('Calling PropTypes validators directly is not supported by the `prop-types` package. ' + 'Use PropTypes.checkPropTypes() to call them. ' + 'Read more at http://fb.me/use-check-prop-types');
  139. err.name = 'Invariant Violation';
  140. throw err;
  141. }
  142. shim.isRequired = shim;
  143. function getShim() {
  144. return shim;
  145. }
  146. // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
  147. var ReactPropTypes = {
  148. array: shim,
  149. bool: shim,
  150. func: shim,
  151. number: shim,
  152. object: shim,
  153. string: shim,
  154. symbol: shim,
  155. any: shim,
  156. arrayOf: getShim,
  157. element: shim,
  158. instanceOf: getShim,
  159. node: shim,
  160. objectOf: getShim,
  161. oneOf: getShim,
  162. oneOfType: getShim,
  163. shape: getShim,
  164. exact: getShim
  165. };
  166. ReactPropTypes.checkPropTypes = emptyFunction;
  167. ReactPropTypes.PropTypes = ReactPropTypes;
  168. return ReactPropTypes;
  169. };
  170. var propTypes = createCommonjsModule(function (module) {
  171. /**
  172. * Copyright (c) 2013-present, Facebook, Inc.
  173. *
  174. * This source code is licensed under the MIT license found in the
  175. * LICENSE file in the root directory of this source tree.
  176. */
  177. {
  178. // By explicitly using `prop-types` you are opting into new production behavior.
  179. // http://fb.me/prop-types-in-prod
  180. module.exports = factoryWithThrowingShims();
  181. }
  182. });
  183. var classnames = createCommonjsModule(function (module) {
  184. /*!
  185. Copyright (c) 2017 Jed Watson.
  186. Licensed under the MIT License (MIT), see
  187. http://jedwatson.github.io/classnames
  188. */
  189. /* global define */
  190. (function () {
  191. var hasOwn = {}.hasOwnProperty;
  192. function classNames() {
  193. var classes = [];
  194. for (var i = 0; i < arguments.length; i++) {
  195. var arg = arguments[i];
  196. if (!arg) continue;
  197. var argType = typeof arg;
  198. if (argType === 'string' || argType === 'number') {
  199. classes.push(arg);
  200. } else if (Array.isArray(arg) && arg.length) {
  201. var inner = classNames.apply(null, arg);
  202. if (inner) {
  203. classes.push(inner);
  204. }
  205. } else if (argType === 'object') {
  206. for (var key in arg) {
  207. if (hasOwn.call(arg, key) && arg[key]) {
  208. classes.push(key);
  209. }
  210. }
  211. }
  212. }
  213. return classes.join(' ');
  214. }
  215. if (module.exports) {
  216. classNames.default = classNames;
  217. module.exports = classNames;
  218. } else {
  219. window.classNames = classNames;
  220. }
  221. })();
  222. });
  223. /**
  224. * Lodash (Custom Build) <https://lodash.com/>
  225. * Build: `lodash modularize exports="npm" -o ./`
  226. * Copyright JS Foundation and other contributors <https://js.foundation/>
  227. * Released under MIT license <https://lodash.com/license>
  228. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  229. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  230. */
  231. /** `Object#toString` result references. */
  232. var asyncTag = '[object AsyncFunction]',
  233. funcTag = '[object Function]',
  234. genTag = '[object GeneratorFunction]',
  235. nullTag = '[object Null]',
  236. proxyTag = '[object Proxy]',
  237. undefinedTag = '[object Undefined]';
  238. /** Detect free variable `global` from Node.js. */
  239. var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
  240. /** Detect free variable `self`. */
  241. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  242. /** Used as a reference to the global object. */
  243. var root = freeGlobal || freeSelf || Function('return this')();
  244. /** Used for built-in method references. */
  245. var objectProto = Object.prototype;
  246. /** Used to check objects for own properties. */
  247. var hasOwnProperty$1 = objectProto.hasOwnProperty;
  248. /**
  249. * Used to resolve the
  250. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  251. * of values.
  252. */
  253. var nativeObjectToString = objectProto.toString;
  254. /** Built-in value references. */
  255. var Symbol$1 = root.Symbol,
  256. symToStringTag = Symbol$1 ? Symbol$1.toStringTag : undefined;
  257. /**
  258. * The base implementation of `getTag` without fallbacks for buggy environments.
  259. *
  260. * @private
  261. * @param {*} value The value to query.
  262. * @returns {string} Returns the `toStringTag`.
  263. */
  264. function baseGetTag(value) {
  265. if (value == null) {
  266. return value === undefined ? undefinedTag : nullTag;
  267. }
  268. return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);
  269. }
  270. /**
  271. * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
  272. *
  273. * @private
  274. * @param {*} value The value to query.
  275. * @returns {string} Returns the raw `toStringTag`.
  276. */
  277. function getRawTag(value) {
  278. var isOwn = hasOwnProperty$1.call(value, symToStringTag),
  279. tag = value[symToStringTag];
  280. try {
  281. value[symToStringTag] = undefined;
  282. var unmasked = true;
  283. } catch (e) {}
  284. var result = nativeObjectToString.call(value);
  285. if (unmasked) {
  286. if (isOwn) {
  287. value[symToStringTag] = tag;
  288. } else {
  289. delete value[symToStringTag];
  290. }
  291. }
  292. return result;
  293. }
  294. /**
  295. * Converts `value` to a string using `Object.prototype.toString`.
  296. *
  297. * @private
  298. * @param {*} value The value to convert.
  299. * @returns {string} Returns the converted string.
  300. */
  301. function objectToString(value) {
  302. return nativeObjectToString.call(value);
  303. }
  304. /**
  305. * Checks if `value` is classified as a `Function` object.
  306. *
  307. * @static
  308. * @memberOf _
  309. * @since 0.1.0
  310. * @category Lang
  311. * @param {*} value The value to check.
  312. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  313. * @example
  314. *
  315. * _.isFunction(_);
  316. * // => true
  317. *
  318. * _.isFunction(/abc/);
  319. * // => false
  320. */
  321. function isFunction(value) {
  322. if (!isObject(value)) {
  323. return false;
  324. } // The use of `Object#toString` avoids issues with the `typeof` operator
  325. // in Safari 9 which returns 'object' for typed arrays and other constructors.
  326. var tag = baseGetTag(value);
  327. return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
  328. }
  329. /**
  330. * Checks if `value` is the
  331. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  332. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  333. *
  334. * @static
  335. * @memberOf _
  336. * @since 0.1.0
  337. * @category Lang
  338. * @param {*} value The value to check.
  339. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  340. * @example
  341. *
  342. * _.isObject({});
  343. * // => true
  344. *
  345. * _.isObject([1, 2, 3]);
  346. * // => true
  347. *
  348. * _.isObject(_.noop);
  349. * // => true
  350. *
  351. * _.isObject(null);
  352. * // => false
  353. */
  354. function isObject(value) {
  355. var type = typeof value;
  356. return value != null && (type == 'object' || type == 'function');
  357. }
  358. var lodash_isfunction = isFunction;
  359. function getScrollbarWidth() {
  360. var scrollDiv = document.createElement('div'); // .modal-scrollbar-measure styles // https://github.com/twbs/bootstrap/blob/v4.0.0-alpha.4/scss/_modal.scss#L106-L113
  361. scrollDiv.style.position = 'absolute';
  362. scrollDiv.style.top = '-9999px';
  363. scrollDiv.style.width = '50px';
  364. scrollDiv.style.height = '50px';
  365. scrollDiv.style.overflow = 'scroll';
  366. document.body.appendChild(scrollDiv);
  367. var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth;
  368. document.body.removeChild(scrollDiv);
  369. return scrollbarWidth;
  370. }
  371. function setScrollbarWidth(padding) {
  372. document.body.style.paddingRight = padding > 0 ? padding + "px" : null;
  373. }
  374. function isBodyOverflowing() {
  375. return document.body.clientWidth < window.innerWidth;
  376. }
  377. function getOriginalBodyPadding() {
  378. var style = window.getComputedStyle(document.body, null);
  379. return parseInt(style && style.getPropertyValue('padding-right') || 0, 10);
  380. }
  381. function conditionallyUpdateScrollbar() {
  382. var scrollbarWidth = getScrollbarWidth(); // https://github.com/twbs/bootstrap/blob/v4.0.0-alpha.6/js/src/modal.js#L433
  383. var fixedContent = document.querySelectorAll('.fixed-top, .fixed-bottom, .is-fixed, .sticky-top')[0];
  384. var bodyPadding = fixedContent ? parseInt(fixedContent.style.paddingRight || 0, 10) : 0;
  385. if (isBodyOverflowing()) {
  386. setScrollbarWidth(bodyPadding + scrollbarWidth);
  387. }
  388. }
  389. var globalCssModule;
  390. function setGlobalCssModule(cssModule) {
  391. globalCssModule = cssModule;
  392. }
  393. function mapToCssModules(className, cssModule) {
  394. if (className === void 0) {
  395. className = '';
  396. }
  397. if (cssModule === void 0) {
  398. cssModule = globalCssModule;
  399. }
  400. if (!cssModule) return className;
  401. return className.split(' ').map(function (c) {
  402. return cssModule[c] || c;
  403. }).join(' ');
  404. }
  405. /**
  406. * Returns a new object with the key/value pairs from `obj` that are not in the array `omitKeys`.
  407. */
  408. function omit(obj, omitKeys) {
  409. var result = {};
  410. Object.keys(obj).forEach(function (key) {
  411. if (omitKeys.indexOf(key) === -1) {
  412. result[key] = obj[key];
  413. }
  414. });
  415. return result;
  416. }
  417. /**
  418. * Returns a filtered copy of an object with only the specified keys.
  419. */
  420. function pick(obj, keys) {
  421. var pickKeys = Array.isArray(keys) ? keys : [keys];
  422. var length = pickKeys.length;
  423. var key;
  424. var result = {};
  425. while (length > 0) {
  426. length -= 1;
  427. key = pickKeys[length];
  428. result[key] = obj[key];
  429. }
  430. return result;
  431. }
  432. var warned = {};
  433. function warnOnce(message) {
  434. if (!warned[message]) {
  435. /* istanbul ignore else */
  436. if (typeof console !== 'undefined') {
  437. console.error(message); // eslint-disable-line no-console
  438. }
  439. warned[message] = true;
  440. }
  441. }
  442. function deprecated(propType, explanation) {
  443. return function validate(props, propName, componentName) {
  444. if (props[propName] !== null && typeof props[propName] !== 'undefined') {
  445. warnOnce("\"" + propName + "\" property of \"" + componentName + "\" has been deprecated.\n" + explanation);
  446. }
  447. for (var _len = arguments.length, rest = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
  448. rest[_key - 3] = arguments[_key];
  449. }
  450. return propType.apply(void 0, [props, propName, componentName].concat(rest));
  451. };
  452. }
  453. function DOMElement(props, propName, componentName) {
  454. if (!(props[propName] instanceof Element)) {
  455. return new Error('Invalid prop `' + propName + '` supplied to `' + componentName + '`. Expected prop to be an instance of Element. Validation failed.');
  456. }
  457. }
  458. var targetPropType = propTypes.oneOfType([propTypes.string, propTypes.func, DOMElement, propTypes.shape({
  459. current: propTypes.any
  460. })]);
  461. var tagPropType = propTypes.oneOfType([propTypes.func, propTypes.string, propTypes.shape({
  462. $$typeof: propTypes.symbol,
  463. render: propTypes.func
  464. }), propTypes.arrayOf(propTypes.oneOfType([propTypes.func, propTypes.string, propTypes.shape({
  465. $$typeof: propTypes.symbol,
  466. render: propTypes.func
  467. })]))]);
  468. /* eslint key-spacing: ["error", { afterColon: true, align: "value" }] */
  469. // These are all setup to match what is in the bootstrap _variables.scss
  470. // https://github.com/twbs/bootstrap/blob/v4-dev/scss/_variables.scss
  471. var TransitionTimeouts = {
  472. Fade: 150,
  473. // $transition-fade
  474. Collapse: 350,
  475. // $transition-collapse
  476. Modal: 300,
  477. // $modal-transition
  478. Carousel: 600 // $carousel-transition
  479. }; // Duplicated Transition.propType keys to ensure that Reactstrap builds
  480. // for distribution properly exclude these keys for nested child HTML attributes
  481. // since `react-transition-group` removes propTypes in production builds.
  482. var TransitionPropTypeKeys = ['in', 'mountOnEnter', 'unmountOnExit', 'appear', 'enter', 'exit', 'timeout', 'onEnter', 'onEntering', 'onEntered', 'onExit', 'onExiting', 'onExited'];
  483. var TransitionStatuses = {
  484. ENTERING: 'entering',
  485. ENTERED: 'entered',
  486. EXITING: 'exiting',
  487. EXITED: 'exited'
  488. };
  489. var keyCodes = {
  490. esc: 27,
  491. space: 32,
  492. enter: 13,
  493. tab: 9,
  494. up: 38,
  495. down: 40,
  496. home: 36,
  497. end: 35,
  498. n: 78,
  499. p: 80
  500. };
  501. var PopperPlacements = ['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'];
  502. var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
  503. function isReactRefObj(target) {
  504. if (target && typeof target === 'object') {
  505. return 'current' in target;
  506. }
  507. return false;
  508. }
  509. function findDOMElements(target) {
  510. if (isReactRefObj(target)) {
  511. return target.current;
  512. }
  513. if (lodash_isfunction(target)) {
  514. return target();
  515. }
  516. if (typeof target === 'string' && canUseDOM) {
  517. var selection = document.querySelectorAll(target);
  518. if (!selection.length) {
  519. selection = document.querySelectorAll("#" + target);
  520. }
  521. if (!selection.length) {
  522. throw new Error("The target '" + target + "' could not be identified in the dom, tip: check spelling");
  523. }
  524. return selection;
  525. }
  526. return target;
  527. }
  528. function isArrayOrNodeList(els) {
  529. if (els === null) {
  530. return false;
  531. }
  532. return Array.isArray(els) || canUseDOM && typeof els.length === 'number';
  533. }
  534. function getTarget(target) {
  535. var els = findDOMElements(target);
  536. if (isArrayOrNodeList(els)) {
  537. return els[0];
  538. }
  539. return els;
  540. }
  541. var defaultToggleEvents = ['touchstart', 'click'];
  542. function addMultipleEventListeners(_els, handler, _events, useCapture) {
  543. var els = _els;
  544. if (!isArrayOrNodeList(els)) {
  545. els = [els];
  546. }
  547. var events = _events;
  548. if (typeof events === 'string') {
  549. events = events.split(/\s+/);
  550. }
  551. if (!isArrayOrNodeList(els) || typeof handler !== 'function' || !Array.isArray(events)) {
  552. throw new Error("\n The first argument of this function must be DOM node or an array on DOM nodes or NodeList.\n The second must be a function.\n The third is a string or an array of strings that represents DOM events\n ");
  553. }
  554. Array.prototype.forEach.call(events, function (event) {
  555. Array.prototype.forEach.call(els, function (el) {
  556. el.addEventListener(event, handler, useCapture);
  557. });
  558. });
  559. return function removeEvents() {
  560. Array.prototype.forEach.call(events, function (event) {
  561. Array.prototype.forEach.call(els, function (el) {
  562. el.removeEventListener(event, handler, useCapture);
  563. });
  564. });
  565. };
  566. }
  567. var focusableElements = ['a[href]', 'area[href]', 'input:not([disabled]):not([type=hidden])', 'select:not([disabled])', 'textarea:not([disabled])', 'button:not([disabled])', 'object', 'embed', '[tabindex]:not(.modal)', 'audio[controls]', 'video[controls]', '[contenteditable]:not([contenteditable="false"])'];
  568. var utils = /*#__PURE__*/Object.freeze({
  569. getScrollbarWidth: getScrollbarWidth,
  570. setScrollbarWidth: setScrollbarWidth,
  571. isBodyOverflowing: isBodyOverflowing,
  572. getOriginalBodyPadding: getOriginalBodyPadding,
  573. conditionallyUpdateScrollbar: conditionallyUpdateScrollbar,
  574. setGlobalCssModule: setGlobalCssModule,
  575. mapToCssModules: mapToCssModules,
  576. omit: omit,
  577. pick: pick,
  578. warnOnce: warnOnce,
  579. deprecated: deprecated,
  580. DOMElement: DOMElement,
  581. targetPropType: targetPropType,
  582. tagPropType: tagPropType,
  583. TransitionTimeouts: TransitionTimeouts,
  584. TransitionPropTypeKeys: TransitionPropTypeKeys,
  585. TransitionStatuses: TransitionStatuses,
  586. keyCodes: keyCodes,
  587. PopperPlacements: PopperPlacements,
  588. canUseDOM: canUseDOM,
  589. isReactRefObj: isReactRefObj,
  590. findDOMElements: findDOMElements,
  591. isArrayOrNodeList: isArrayOrNodeList,
  592. getTarget: getTarget,
  593. defaultToggleEvents: defaultToggleEvents,
  594. addMultipleEventListeners: addMultipleEventListeners,
  595. focusableElements: focusableElements
  596. });
  597. var propTypes$1 = {
  598. tag: tagPropType,
  599. fluid: propTypes.bool,
  600. className: propTypes.string,
  601. cssModule: propTypes.object
  602. };
  603. var defaultProps = {
  604. tag: 'div'
  605. };
  606. var Container = function Container(props) {
  607. var className = props.className,
  608. cssModule = props.cssModule,
  609. fluid = props.fluid,
  610. Tag = props.tag,
  611. attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "fluid", "tag"]);
  612. var classes = mapToCssModules(classnames(className, fluid ? 'container-fluid' : 'container'), cssModule);
  613. return React__default.createElement(Tag, _extends({}, attributes, {
  614. className: classes
  615. }));
  616. };
  617. Container.propTypes = propTypes$1;
  618. Container.defaultProps = defaultProps;
  619. var propTypes$2 = {
  620. tag: tagPropType,
  621. noGutters: propTypes.bool,
  622. className: propTypes.string,
  623. cssModule: propTypes.object,
  624. form: propTypes.bool
  625. };
  626. var defaultProps$1 = {
  627. tag: 'div'
  628. };
  629. var Row = function Row(props) {
  630. var className = props.className,
  631. cssModule = props.cssModule,
  632. noGutters = props.noGutters,
  633. Tag = props.tag,
  634. form = props.form,
  635. attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "noGutters", "tag", "form"]);
  636. var classes = mapToCssModules(classnames(className, noGutters ? 'no-gutters' : null, form ? 'form-row' : 'row'), cssModule);
  637. return React__default.createElement(Tag, _extends({}, attributes, {
  638. className: classes
  639. }));
  640. };
  641. Row.propTypes = propTypes$2;
  642. Row.defaultProps = defaultProps$1;
  643. /**
  644. * lodash 3.0.2 (Custom Build) <https://lodash.com/>
  645. * Build: `lodash modern modularize exports="npm" -o ./`
  646. * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/>
  647. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  648. * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  649. * Available under MIT license <https://lodash.com/license>
  650. */
  651. /**
  652. * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.
  653. * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  654. *
  655. * @static
  656. * @memberOf _
  657. * @category Lang
  658. * @param {*} value The value to check.
  659. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  660. * @example
  661. *
  662. * _.isObject({});
  663. * // => true
  664. *
  665. * _.isObject([1, 2, 3]);
  666. * // => true
  667. *
  668. * _.isObject(1);
  669. * // => false
  670. */
  671. function isObject$1(value) {
  672. // Avoid a V8 JIT bug in Chrome 19-20.
  673. // See https://code.google.com/p/v8/issues/detail?id=2291 for more details.
  674. var type = typeof value;
  675. return !!value && (type == 'object' || type == 'function');
  676. }
  677. var lodash_isobject = isObject$1;
  678. var colWidths = ['xs', 'sm', 'md', 'lg', 'xl'];
  679. var stringOrNumberProp = propTypes.oneOfType([propTypes.number, propTypes.string]);
  680. var columnProps = propTypes.oneOfType([propTypes.bool, propTypes.number, propTypes.string, propTypes.shape({
  681. size: propTypes.oneOfType([propTypes.bool, propTypes.number, propTypes.string]),
  682. push: deprecated(stringOrNumberProp, 'Please use the prop "order"'),
  683. pull: deprecated(stringOrNumberProp, 'Please use the prop "order"'),
  684. order: stringOrNumberProp,
  685. offset: stringOrNumberProp
  686. })]);
  687. var propTypes$3 = {
  688. tag: tagPropType,
  689. xs: columnProps,
  690. sm: columnProps,
  691. md: columnProps,
  692. lg: columnProps,
  693. xl: columnProps,
  694. className: propTypes.string,
  695. cssModule: propTypes.object,
  696. widths: propTypes.array
  697. };
  698. var defaultProps$2 = {
  699. tag: 'div',
  700. widths: colWidths
  701. };
  702. var getColumnSizeClass = function getColumnSizeClass(isXs, colWidth, colSize) {
  703. if (colSize === true || colSize === '') {
  704. return isXs ? 'col' : "col-" + colWidth;
  705. } else if (colSize === 'auto') {
  706. return isXs ? 'col-auto' : "col-" + colWidth + "-auto";
  707. }
  708. return isXs ? "col-" + colSize : "col-" + colWidth + "-" + colSize;
  709. };
  710. var Col = function Col(props) {
  711. var className = props.className,
  712. cssModule = props.cssModule,
  713. widths = props.widths,
  714. Tag = props.tag,
  715. attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "widths", "tag"]);
  716. var colClasses = [];
  717. widths.forEach(function (colWidth, i) {
  718. var columnProp = props[colWidth];
  719. delete attributes[colWidth];
  720. if (!columnProp && columnProp !== '') {
  721. return;
  722. }
  723. var isXs = !i;
  724. if (lodash_isobject(columnProp)) {
  725. var _classNames;
  726. var colSizeInterfix = isXs ? '-' : "-" + colWidth + "-";
  727. var colClass = getColumnSizeClass(isXs, colWidth, columnProp.size);
  728. colClasses.push(mapToCssModules(classnames((_classNames = {}, _classNames[colClass] = columnProp.size || columnProp.size === '', _classNames["order" + colSizeInterfix + columnProp.order] = columnProp.order || columnProp.order === 0, _classNames["offset" + colSizeInterfix + columnProp.offset] = columnProp.offset || columnProp.offset === 0, _classNames)), cssModule));
  729. } else {
  730. var _colClass = getColumnSizeClass(isXs, colWidth, columnProp);
  731. colClasses.push(_colClass);
  732. }
  733. });
  734. if (!colClasses.length) {
  735. colClasses.push('col');
  736. }
  737. var classes = mapToCssModules(classnames(className, colClasses), cssModule);
  738. return React__default.createElement(Tag, _extends({}, attributes, {
  739. className: classes
  740. }));
  741. };
  742. Col.propTypes = propTypes$3;
  743. Col.defaultProps = defaultProps$2;
  744. var propTypes$4 = {
  745. light: propTypes.bool,
  746. dark: propTypes.bool,
  747. inverse: deprecated(propTypes.bool, 'Please use the prop "dark"'),
  748. full: propTypes.bool,
  749. fixed: propTypes.string,
  750. sticky: propTypes.string,
  751. color: propTypes.string,
  752. role: propTypes.string,
  753. tag: tagPropType,
  754. className: propTypes.string,
  755. cssModule: propTypes.object,
  756. toggleable: deprecated(propTypes.oneOfType([propTypes.bool, propTypes.string]), 'Please use the prop "expand"'),
  757. expand: propTypes.oneOfType([propTypes.bool, propTypes.string])
  758. };
  759. var defaultProps$3 = {
  760. tag: 'nav',
  761. expand: false
  762. };
  763. var getExpandClass = function getExpandClass(expand) {
  764. if (expand === false) {
  765. return false;
  766. } else if (expand === true || expand === 'xs') {
  767. return 'navbar-expand';
  768. }
  769. return "navbar-expand-" + expand;
  770. }; // To better maintain backwards compatibility while toggleable is deprecated.
  771. // We must map breakpoints to the next breakpoint so that toggleable and expand do the same things at the same breakpoint.
  772. var toggleableToExpand = {
  773. xs: 'sm',
  774. sm: 'md',
  775. md: 'lg',
  776. lg: 'xl'
  777. };
  778. var getToggleableClass = function getToggleableClass(toggleable) {
  779. if (toggleable === undefined || toggleable === 'xl') {
  780. return false;
  781. } else if (toggleable === false) {
  782. return 'navbar-expand';
  783. }
  784. return "navbar-expand-" + (toggleable === true ? 'sm' : toggleableToExpand[toggleable] || toggleable);
  785. };
  786. var Navbar = function Navbar(props) {
  787. var _classNames;
  788. var toggleable = props.toggleable,
  789. expand = props.expand,
  790. className = props.className,
  791. cssModule = props.cssModule,
  792. light = props.light,
  793. dark = props.dark,
  794. inverse = props.inverse,
  795. fixed = props.fixed,
  796. sticky = props.sticky,
  797. color = props.color,
  798. Tag = props.tag,
  799. attributes = _objectWithoutPropertiesLoose(props, ["toggleable", "expand", "className", "cssModule", "light", "dark", "inverse", "fixed", "sticky", "color", "tag"]);
  800. var classes = mapToCssModules(classnames(className, 'navbar', getExpandClass(expand) || getToggleableClass(toggleable), (_classNames = {
  801. 'navbar-light': light,
  802. 'navbar-dark': inverse || dark
  803. }, _classNames["bg-" + color] = color, _classNames["fixed-" + fixed] = fixed, _classNames["sticky-" + sticky] = sticky, _classNames)), cssModule);
  804. return React__default.createElement(Tag, _extends({}, attributes, {
  805. className: classes
  806. }));
  807. };
  808. Navbar.propTypes = propTypes$4;
  809. Navbar.defaultProps = defaultProps$3;
  810. var propTypes$5 = {
  811. tag: tagPropType,
  812. className: propTypes.string,
  813. cssModule: propTypes.object
  814. };
  815. var defaultProps$4 = {
  816. tag: 'a'
  817. };
  818. var NavbarBrand = function NavbarBrand(props) {
  819. var className = props.className,
  820. cssModule = props.cssModule,
  821. Tag = props.tag,
  822. attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
  823. var classes = mapToCssModules(classnames(className, 'navbar-brand'), cssModule);
  824. return React__default.createElement(Tag, _extends({}, attributes, {
  825. className: classes
  826. }));
  827. };
  828. NavbarBrand.propTypes = propTypes$5;
  829. NavbarBrand.defaultProps = defaultProps$4;
  830. var propTypes$6 = {
  831. tag: tagPropType,
  832. type: propTypes.string,
  833. className: propTypes.string,
  834. cssModule: propTypes.object,
  835. children: propTypes.node
  836. };
  837. var defaultProps$5 = {
  838. tag: 'button',
  839. type: 'button'
  840. };
  841. var NavbarToggler = function NavbarToggler(props) {
  842. var className = props.className,
  843. cssModule = props.cssModule,
  844. children = props.children,
  845. Tag = props.tag,
  846. attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "children", "tag"]);
  847. var classes = mapToCssModules(classnames(className, 'navbar-toggler'), cssModule);
  848. return React__default.createElement(Tag, _extends({}, attributes, {
  849. className: classes
  850. }), children || React__default.createElement("span", {
  851. className: mapToCssModules('navbar-toggler-icon', cssModule)
  852. }));
  853. };
  854. NavbarToggler.propTypes = propTypes$6;
  855. NavbarToggler.defaultProps = defaultProps$5;
  856. var propTypes$7 = {
  857. tabs: propTypes.bool,
  858. pills: propTypes.bool,
  859. vertical: propTypes.oneOfType([propTypes.bool, propTypes.string]),
  860. horizontal: propTypes.string,
  861. justified: propTypes.bool,
  862. fill: propTypes.bool,
  863. navbar: propTypes.bool,
  864. card: propTypes.bool,
  865. tag: tagPropType,
  866. className: propTypes.string,
  867. cssModule: propTypes.object
  868. };
  869. var defaultProps$6 = {
  870. tag: 'ul',
  871. vertical: false
  872. };
  873. var getVerticalClass = function getVerticalClass(vertical) {
  874. if (vertical === false) {
  875. return false;
  876. } else if (vertical === true || vertical === 'xs') {
  877. return 'flex-column';
  878. }
  879. return "flex-" + vertical + "-column";
  880. };
  881. var Nav = function Nav(props) {
  882. var className = props.className,
  883. cssModule = props.cssModule,
  884. tabs = props.tabs,
  885. pills = props.pills,
  886. vertical = props.vertical,
  887. horizontal = props.horizontal,
  888. justified = props.justified,
  889. fill = props.fill,
  890. navbar = props.navbar,
  891. card = props.card,
  892. Tag = props.tag,
  893. attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tabs", "pills", "vertical", "horizontal", "justified", "fill", "navbar", "card", "tag"]);
  894. var classes = mapToCssModules(classnames(className, navbar ? 'navbar-nav' : 'nav', horizontal ? "justify-content-" + horizontal : false, getVerticalClass(vertical), {
  895. 'nav-tabs': tabs,
  896. 'card-header-tabs': card && tabs,
  897. 'nav-pills': pills,
  898. 'card-header-pills': card && pills,
  899. 'nav-justified': justified,
  900. 'nav-fill': fill
  901. }), cssModule);
  902. return React__default.createElement(Tag, _extends({}, attributes, {
  903. className: classes
  904. }));
  905. };
  906. Nav.propTypes = propTypes$7;
  907. Nav.defaultProps = defaultProps$6;
  908. var propTypes$8 = {
  909. tag: tagPropType,
  910. active: propTypes.bool,
  911. className: propTypes.string,
  912. cssModule: propTypes.object
  913. };
  914. var defaultProps$7 = {
  915. tag: 'li'
  916. };
  917. var NavItem = function NavItem(props) {
  918. var className = props.className,
  919. cssModule = props.cssModule,
  920. active = props.active,
  921. Tag = props.tag,
  922. attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "active", "tag"]);
  923. var classes = mapToCssModules(classnames(className, 'nav-item', active ? 'active' : false), cssModule);
  924. return React__default.createElement(Tag, _extends({}, attributes, {
  925. className: classes
  926. }));
  927. };
  928. NavItem.propTypes = propTypes$8;
  929. NavItem.defaultProps = defaultProps$7;
  930. var _createClass$1 = function () {
  931. function defineProperties(target, props) {
  932. for (var i = 0; i < props.length; i++) {
  933. var descriptor = props[i];
  934. descriptor.enumerable = descriptor.enumerable || false;
  935. descriptor.configurable = true;
  936. if ("value" in descriptor) descriptor.writable = true;
  937. Object.defineProperty(target, descriptor.key, descriptor);
  938. }
  939. }
  940. return function (Constructor, protoProps, staticProps) {
  941. if (protoProps) defineProperties(Constructor.prototype, protoProps);
  942. if (staticProps) defineProperties(Constructor, staticProps);
  943. return Constructor;
  944. };
  945. }();
  946. function _objectWithoutProperties$1(obj, keys) {
  947. var target = {};
  948. for (var i in obj) {
  949. if (keys.indexOf(i) >= 0) continue;
  950. if (!Object.prototype.hasOwnProperty.call(obj, i)) continue;
  951. target[i] = obj[i];
  952. }
  953. return target;
  954. }
  955. function _classCallCheck$1(instance, Constructor) {
  956. if (!(instance instanceof Constructor)) {
  957. throw new TypeError("Cannot call a class as a function");
  958. }
  959. }
  960. function _possibleConstructorReturn$1(self, call) {
  961. if (!self) {
  962. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  963. }
  964. return call && (typeof call === "object" || typeof call === "function") ? call : self;
  965. }
  966. function _inherits$1(subClass, superClass) {
  967. if (typeof superClass !== "function" && superClass !== null) {
  968. throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
  969. }
  970. subClass.prototype = Object.create(superClass && superClass.prototype, {
  971. constructor: {
  972. value: subClass,
  973. enumerable: false,
  974. writable: true,
  975. configurable: true
  976. }
  977. });
  978. if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
  979. }
  980. var Manager = function (_Component) {
  981. _inherits$1(Manager, _Component);
  982. function Manager() {
  983. var _ref;
  984. var _temp, _this, _ret;
  985. _classCallCheck$1(this, Manager);
  986. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  987. args[_key] = arguments[_key];
  988. }
  989. return _ret = (_temp = (_this = _possibleConstructorReturn$1(this, (_ref = Manager.__proto__ || Object.getPrototypeOf(Manager)).call.apply(_ref, [this].concat(args))), _this), _this._setTargetNode = function (node) {
  990. _this._targetNode = node;
  991. }, _this._getTargetNode = function () {
  992. return _this._targetNode;
  993. }, _temp), _possibleConstructorReturn$1(_this, _ret);
  994. }
  995. _createClass$1(Manager, [{
  996. key: 'getChildContext',
  997. value: function getChildContext() {
  998. return {
  999. popperManager: {
  1000. setTargetNode: this._setTargetNode,
  1001. getTargetNode: this._getTargetNode
  1002. }
  1003. };
  1004. }
  1005. }, {
  1006. key: 'render',
  1007. value: function render() {
  1008. var _props = this.props,
  1009. tag = _props.tag,
  1010. children = _props.children,
  1011. restProps = _objectWithoutProperties$1(_props, ['tag', 'children']);
  1012. if (tag !== false) {
  1013. return React.createElement(tag, restProps, children);
  1014. } else {
  1015. return children;
  1016. }
  1017. }
  1018. }]);
  1019. return Manager;
  1020. }(React.Component);
  1021. Manager.childContextTypes = {
  1022. popperManager: propTypes.object.isRequired
  1023. };
  1024. Manager.propTypes = {
  1025. tag: propTypes.oneOfType([propTypes.string, propTypes.bool]),
  1026. children: propTypes.oneOfType([propTypes.node, propTypes.func])
  1027. };
  1028. Manager.defaultProps = {
  1029. tag: 'div'
  1030. };
  1031. var _extends$1 = Object.assign || function (target) {
  1032. for (var i = 1; i < arguments.length; i++) {
  1033. var source = arguments[i];
  1034. for (var key in source) {
  1035. if (Object.prototype.hasOwnProperty.call(source, key)) {
  1036. target[key] = source[key];
  1037. }
  1038. }
  1039. }
  1040. return target;
  1041. };
  1042. function _objectWithoutProperties$2(obj, keys) {
  1043. var target = {};
  1044. for (var i in obj) {
  1045. if (keys.indexOf(i) >= 0) continue;
  1046. if (!Object.prototype.hasOwnProperty.call(obj, i)) continue;
  1047. target[i] = obj[i];
  1048. }
  1049. return target;
  1050. }
  1051. var Target = function Target(props, context) {
  1052. var _props$component = props.component,
  1053. component = _props$component === undefined ? 'div' : _props$component,
  1054. innerRef = props.innerRef,
  1055. children = props.children,
  1056. restProps = _objectWithoutProperties$2(props, ['component', 'innerRef', 'children']);
  1057. var popperManager = context.popperManager;
  1058. var targetRef = function targetRef(node) {
  1059. popperManager.setTargetNode(node);
  1060. if (typeof innerRef === 'function') {
  1061. innerRef(node);
  1062. }
  1063. };
  1064. if (typeof children === 'function') {
  1065. var targetProps = {
  1066. ref: targetRef
  1067. };
  1068. return children({
  1069. targetProps: targetProps,
  1070. restProps: restProps
  1071. });
  1072. }
  1073. var componentProps = _extends$1({}, restProps);
  1074. if (typeof component === 'string') {
  1075. componentProps.ref = targetRef;
  1076. } else {
  1077. componentProps.innerRef = targetRef;
  1078. }
  1079. return React.createElement(component, componentProps, children);
  1080. };
  1081. Target.contextTypes = {
  1082. popperManager: propTypes.object.isRequired
  1083. };
  1084. Target.propTypes = {
  1085. component: propTypes.oneOfType([propTypes.node, propTypes.func]),
  1086. innerRef: propTypes.func,
  1087. children: propTypes.oneOfType([propTypes.node, propTypes.func])
  1088. };
  1089. /**!
  1090. * @fileOverview Kickass library to create and place poppers near their reference elements.
  1091. * @version 1.14.6
  1092. * @license
  1093. * Copyright (c) 2016 Federico Zivolo and contributors
  1094. *
  1095. * Permission is hereby granted, free of charge, to any person obtaining a copy
  1096. * of this software and associated documentation files (the "Software"), to deal
  1097. * in the Software without restriction, including without limitation the rights
  1098. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  1099. * copies of the Software, and to permit persons to whom the Software is
  1100. * furnished to do so, subject to the following conditions:
  1101. *
  1102. * The above copyright notice and this permission notice shall be included in all
  1103. * copies or substantial portions of the Software.
  1104. *
  1105. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  1106. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  1107. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  1108. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  1109. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  1110. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  1111. * SOFTWARE.
  1112. */
  1113. var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined';
  1114. var longerTimeoutBrowsers = ['Edge', 'Trident', 'Firefox'];
  1115. var timeoutDuration = 0;
  1116. for (var i = 0; i < longerTimeoutBrowsers.length; i += 1) {
  1117. if (isBrowser && navigator.userAgent.indexOf(longerTimeoutBrowsers[i]) >= 0) {
  1118. timeoutDuration = 1;
  1119. break;
  1120. }
  1121. }
  1122. function microtaskDebounce(fn) {
  1123. var called = false;
  1124. return function () {
  1125. if (called) {
  1126. return;
  1127. }
  1128. called = true;
  1129. window.Promise.resolve().then(function () {
  1130. called = false;
  1131. fn();
  1132. });
  1133. };
  1134. }
  1135. function taskDebounce(fn) {
  1136. var scheduled = false;
  1137. return function () {
  1138. if (!scheduled) {
  1139. scheduled = true;
  1140. setTimeout(function () {
  1141. scheduled = false;
  1142. fn();
  1143. }, timeoutDuration);
  1144. }
  1145. };
  1146. }
  1147. var supportsMicroTasks = isBrowser && window.Promise;
  1148. /**
  1149. * Create a debounced version of a method, that's asynchronously deferred
  1150. * but called in the minimum time possible.
  1151. *
  1152. * @method
  1153. * @memberof Popper.Utils
  1154. * @argument {Function} fn
  1155. * @returns {Function}
  1156. */
  1157. var debounce = supportsMicroTasks ? microtaskDebounce : taskDebounce;
  1158. /**
  1159. * Check if the given variable is a function
  1160. * @method
  1161. * @memberof Popper.Utils
  1162. * @argument {Any} functionToCheck - variable to check
  1163. * @returns {Boolean} answer to: is a function?
  1164. */
  1165. function isFunction$1(functionToCheck) {
  1166. var getType = {};
  1167. return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';
  1168. }
  1169. /**
  1170. * Get CSS computed property of the given element
  1171. * @method
  1172. * @memberof Popper.Utils
  1173. * @argument {Eement} element
  1174. * @argument {String} property
  1175. */
  1176. function getStyleComputedProperty(element, property) {
  1177. if (element.nodeType !== 1) {
  1178. return [];
  1179. } // NOTE: 1 DOM access here
  1180. var window = element.ownerDocument.defaultView;
  1181. var css = window.getComputedStyle(element, null);
  1182. return property ? css[property] : css;
  1183. }
  1184. /**
  1185. * Returns the parentNode or the host of the element
  1186. * @method
  1187. * @memberof Popper.Utils
  1188. * @argument {Element} element
  1189. * @returns {Element} parent
  1190. */
  1191. function getParentNode(element) {
  1192. if (element.nodeName === 'HTML') {
  1193. return element;
  1194. }
  1195. return element.parentNode || element.host;
  1196. }
  1197. /**
  1198. * Returns the scrolling parent of the given element
  1199. * @method
  1200. * @memberof Popper.Utils
  1201. * @argument {Element} element
  1202. * @returns {Element} scroll parent
  1203. */
  1204. function getScrollParent(element) {
  1205. // Return body, `getScroll` will take care to get the correct `scrollTop` from it
  1206. if (!element) {
  1207. return document.body;
  1208. }
  1209. switch (element.nodeName) {
  1210. case 'HTML':
  1211. case 'BODY':
  1212. return element.ownerDocument.body;
  1213. case '#document':
  1214. return element.body;
  1215. } // Firefox want us to check `-x` and `-y` variations as well
  1216. var _getStyleComputedProp = getStyleComputedProperty(element),
  1217. overflow = _getStyleComputedProp.overflow,
  1218. overflowX = _getStyleComputedProp.overflowX,
  1219. overflowY = _getStyleComputedProp.overflowY;
  1220. if (/(auto|scroll|overlay)/.test(overflow + overflowY + overflowX)) {
  1221. return element;
  1222. }
  1223. return getScrollParent(getParentNode(element));
  1224. }
  1225. var isIE11 = isBrowser && !!(window.MSInputMethodContext && document.documentMode);
  1226. var isIE10 = isBrowser && /MSIE 10/.test(navigator.userAgent);
  1227. /**
  1228. * Determines if the browser is Internet Explorer
  1229. * @method
  1230. * @memberof Popper.Utils
  1231. * @param {Number} version to check
  1232. * @returns {Boolean} isIE
  1233. */
  1234. function isIE(version) {
  1235. if (version === 11) {
  1236. return isIE11;
  1237. }
  1238. if (version === 10) {
  1239. return isIE10;
  1240. }
  1241. return isIE11 || isIE10;
  1242. }
  1243. /**
  1244. * Returns the offset parent of the given element
  1245. * @method
  1246. * @memberof Popper.Utils
  1247. * @argument {Element} element
  1248. * @returns {Element} offset parent
  1249. */
  1250. function getOffsetParent(element) {
  1251. if (!element) {
  1252. return document.documentElement;
  1253. }
  1254. var noOffsetParent = isIE(10) ? document.body : null; // NOTE: 1 DOM access here
  1255. var offsetParent = element.offsetParent || null; // Skip hidden elements which don't have an offsetParent
  1256. while (offsetParent === noOffsetParent && element.nextElementSibling) {
  1257. offsetParent = (element = element.nextElementSibling).offsetParent;
  1258. }
  1259. var nodeName = offsetParent && offsetParent.nodeName;
  1260. if (!nodeName || nodeName === 'BODY' || nodeName === 'HTML') {
  1261. return element ? element.ownerDocument.documentElement : document.documentElement;
  1262. } // .offsetParent will return the closest TH, TD or TABLE in case
  1263. // no offsetParent is present, I hate this job...
  1264. if (['TH', 'TD', 'TABLE'].indexOf(offsetParent.nodeName) !== -1 && getStyleComputedProperty(offsetParent, 'position') === 'static') {
  1265. return getOffsetParent(offsetParent);
  1266. }
  1267. return offsetParent;
  1268. }
  1269. function isOffsetContainer(element) {
  1270. var nodeName = element.nodeName;
  1271. if (nodeName === 'BODY') {
  1272. return false;
  1273. }
  1274. return nodeName === 'HTML' || getOffsetParent(element.firstElementChild) === element;
  1275. }
  1276. /**
  1277. * Finds the root node (document, shadowDOM root) of the given element
  1278. * @method
  1279. * @memberof Popper.Utils
  1280. * @argument {Element} node
  1281. * @returns {Element} root node
  1282. */
  1283. function getRoot(node) {
  1284. if (node.parentNode !== null) {
  1285. return getRoot(node.parentNode);
  1286. }
  1287. return node;
  1288. }
  1289. /**
  1290. * Finds the offset parent common to the two provided nodes
  1291. * @method
  1292. * @memberof Popper.Utils
  1293. * @argument {Element} element1
  1294. * @argument {Element} element2
  1295. * @returns {Element} common offset parent
  1296. */
  1297. function findCommonOffsetParent(element1, element2) {
  1298. // This check is needed to avoid errors in case one of the elements isn't defined for any reason
  1299. if (!element1 || !element1.nodeType || !element2 || !element2.nodeType) {
  1300. return document.documentElement;
  1301. } // Here we make sure to give as "start" the element that comes first in the DOM
  1302. var order = element1.compareDocumentPosition(element2) & Node.DOCUMENT_POSITION_FOLLOWING;
  1303. var start = order ? element1 : element2;
  1304. var end = order ? element2 : element1; // Get common ancestor container
  1305. var range = document.createRange();
  1306. range.setStart(start, 0);
  1307. range.setEnd(end, 0);
  1308. var commonAncestorContainer = range.commonAncestorContainer; // Both nodes are inside #document
  1309. if (element1 !== commonAncestorContainer && element2 !== commonAncestorContainer || start.contains(end)) {
  1310. if (isOffsetContainer(commonAncestorContainer)) {
  1311. return commonAncestorContainer;
  1312. }
  1313. return getOffsetParent(commonAncestorContainer);
  1314. } // one of the nodes is inside shadowDOM, find which one
  1315. var element1root = getRoot(element1);
  1316. if (element1root.host) {
  1317. return findCommonOffsetParent(element1root.host, element2);
  1318. } else {
  1319. return findCommonOffsetParent(element1, getRoot(element2).host);
  1320. }
  1321. }
  1322. /**
  1323. * Gets the scroll value of the given element in the given side (top and left)
  1324. * @method
  1325. * @memberof Popper.Utils
  1326. * @argument {Element} element
  1327. * @argument {String} side `top` or `left`
  1328. * @returns {number} amount of scrolled pixels
  1329. */
  1330. function getScroll(element) {
  1331. var side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'top';
  1332. var upperSide = side === 'top' ? 'scrollTop' : 'scrollLeft';
  1333. var nodeName = element.nodeName;
  1334. if (nodeName === 'BODY' || nodeName === 'HTML') {
  1335. var html = element.ownerDocument.documentElement;
  1336. var scrollingElement = element.ownerDocument.scrollingElement || html;
  1337. return scrollingElement[upperSide];
  1338. }
  1339. return element[upperSide];
  1340. }
  1341. /*
  1342. * Sum or subtract the element scroll values (left and top) from a given rect object
  1343. * @method
  1344. * @memberof Popper.Utils
  1345. * @param {Object} rect - Rect object you want to change
  1346. * @param {HTMLElement} element - The element from the function reads the scroll values
  1347. * @param {Boolean} subtract - set to true if you want to subtract the scroll values
  1348. * @return {Object} rect - The modifier rect object
  1349. */
  1350. function includeScroll(rect, element) {
  1351. var subtract = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  1352. var scrollTop = getScroll(element, 'top');
  1353. var scrollLeft = getScroll(element, 'left');
  1354. var modifier = subtract ? -1 : 1;
  1355. rect.top += scrollTop * modifier;
  1356. rect.bottom += scrollTop * modifier;
  1357. rect.left += scrollLeft * modifier;
  1358. rect.right += scrollLeft * modifier;
  1359. return rect;
  1360. }
  1361. /*
  1362. * Helper to detect borders of a given element
  1363. * @method
  1364. * @memberof Popper.Utils
  1365. * @param {CSSStyleDeclaration} styles
  1366. * Result of `getStyleComputedProperty` on the given element
  1367. * @param {String} axis - `x` or `y`
  1368. * @return {number} borders - The borders size of the given axis
  1369. */
  1370. function getBordersSize(styles, axis) {
  1371. var sideA = axis === 'x' ? 'Left' : 'Top';
  1372. var sideB = sideA === 'Left' ? 'Right' : 'Bottom';
  1373. return parseFloat(styles['border' + sideA + 'Width'], 10) + parseFloat(styles['border' + sideB + 'Width'], 10);
  1374. }
  1375. function getSize(axis, body, html, computedStyle) {
  1376. return Math.max(body['offset' + axis], body['scroll' + axis], html['client' + axis], html['offset' + axis], html['scroll' + axis], isIE(10) ? parseInt(html['offset' + axis]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Top' : 'Left')]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Bottom' : 'Right')]) : 0);
  1377. }
  1378. function getWindowSizes(document) {
  1379. var body = document.body;
  1380. var html = document.documentElement;
  1381. var computedStyle = isIE(10) && getComputedStyle(html);
  1382. return {
  1383. height: getSize('Height', body, html, computedStyle),
  1384. width: getSize('Width', body, html, computedStyle)
  1385. };
  1386. }
  1387. var classCallCheck = function classCallCheck(instance, Constructor) {
  1388. if (!(instance instanceof Constructor)) {
  1389. throw new TypeError("Cannot call a class as a function");
  1390. }
  1391. };
  1392. var createClass = function () {
  1393. function defineProperties(target, props) {
  1394. for (var i = 0; i < props.length; i++) {
  1395. var descriptor = props[i];
  1396. descriptor.enumerable = descriptor.enumerable || false;
  1397. descriptor.configurable = true;
  1398. if ("value" in descriptor) descriptor.writable = true;
  1399. Object.defineProperty(target, descriptor.key, descriptor);
  1400. }
  1401. }
  1402. return function (Constructor, protoProps, staticProps) {
  1403. if (protoProps) defineProperties(Constructor.prototype, protoProps);
  1404. if (staticProps) defineProperties(Constructor, staticProps);
  1405. return Constructor;
  1406. };
  1407. }();
  1408. var defineProperty = function defineProperty(obj, key, value) {
  1409. if (key in obj) {
  1410. Object.defineProperty(obj, key, {
  1411. value: value,
  1412. enumerable: true,
  1413. configurable: true,
  1414. writable: true
  1415. });
  1416. } else {
  1417. obj[key] = value;
  1418. }
  1419. return obj;
  1420. };
  1421. var _extends$2 = Object.assign || function (target) {
  1422. for (var i = 1; i < arguments.length; i++) {
  1423. var source = arguments[i];
  1424. for (var key in source) {
  1425. if (Object.prototype.hasOwnProperty.call(source, key)) {
  1426. target[key] = source[key];
  1427. }
  1428. }
  1429. }
  1430. return target;
  1431. };
  1432. /**
  1433. * Given element offsets, generate an output similar to getBoundingClientRect
  1434. * @method
  1435. * @memberof Popper.Utils
  1436. * @argument {Object} offsets
  1437. * @returns {Object} ClientRect like output
  1438. */
  1439. function getClientRect(offsets) {
  1440. return _extends$2({}, offsets, {
  1441. right: offsets.left + offsets.width,
  1442. bottom: offsets.top + offsets.height
  1443. });
  1444. }
  1445. /**
  1446. * Get bounding client rect of given element
  1447. * @method
  1448. * @memberof Popper.Utils
  1449. * @param {HTMLElement} element
  1450. * @return {Object} client rect
  1451. */
  1452. function getBoundingClientRect(element) {
  1453. var rect = {}; // IE10 10 FIX: Please, don't ask, the element isn't
  1454. // considered in DOM in some circumstances...
  1455. // This isn't reproducible in IE10 compatibility mode of IE11
  1456. try {
  1457. if (isIE(10)) {
  1458. rect = element.getBoundingClientRect();
  1459. var scrollTop = getScroll(element, 'top');
  1460. var scrollLeft = getScroll(element, 'left');
  1461. rect.top += scrollTop;
  1462. rect.left += scrollLeft;
  1463. rect.bottom += scrollTop;
  1464. rect.right += scrollLeft;
  1465. } else {
  1466. rect = element.getBoundingClientRect();
  1467. }
  1468. } catch (e) {}
  1469. var result = {
  1470. left: rect.left,
  1471. top: rect.top,
  1472. width: rect.right - rect.left,
  1473. height: rect.bottom - rect.top
  1474. }; // subtract scrollbar size from sizes
  1475. var sizes = element.nodeName === 'HTML' ? getWindowSizes(element.ownerDocument) : {};
  1476. var width = sizes.width || element.clientWidth || result.right - result.left;
  1477. var height = sizes.height || element.clientHeight || result.bottom - result.top;
  1478. var horizScrollbar = element.offsetWidth - width;
  1479. var vertScrollbar = element.offsetHeight - height; // if an hypothetical scrollbar is detected, we must be sure it's not a `border`
  1480. // we make this check conditional for performance reasons
  1481. if (horizScrollbar || vertScrollbar) {
  1482. var styles = getStyleComputedProperty(element);
  1483. horizScrollbar -= getBordersSize(styles, 'x');
  1484. vertScrollbar -= getBordersSize(styles, 'y');
  1485. result.width -= horizScrollbar;
  1486. result.height -= vertScrollbar;
  1487. }
  1488. return getClientRect(result);
  1489. }
  1490. function getOffsetRectRelativeToArbitraryNode(children, parent) {
  1491. var fixedPosition = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  1492. var isIE10 = isIE(10);
  1493. var isHTML = parent.nodeName === 'HTML';
  1494. var childrenRect = getBoundingClientRect(children);
  1495. var parentRect = getBoundingClientRect(parent);
  1496. var scrollParent = getScrollParent(children);
  1497. var styles = getStyleComputedProperty(parent);
  1498. var borderTopWidth = parseFloat(styles.borderTopWidth, 10);
  1499. var borderLeftWidth = parseFloat(styles.borderLeftWidth, 10); // In cases where the parent is fixed, we must ignore negative scroll in offset calc
  1500. if (fixedPosition && isHTML) {
  1501. parentRect.top = Math.max(parentRect.top, 0);
  1502. parentRect.left = Math.max(parentRect.left, 0);
  1503. }
  1504. var offsets = getClientRect({
  1505. top: childrenRect.top - parentRect.top - borderTopWidth,
  1506. left: childrenRect.left - parentRect.left - borderLeftWidth,
  1507. width: childrenRect.width,
  1508. height: childrenRect.height
  1509. });
  1510. offsets.marginTop = 0;
  1511. offsets.marginLeft = 0; // Subtract margins of documentElement in case it's being used as parent
  1512. // we do this only on HTML because it's the only element that behaves
  1513. // differently when margins are applied to it. The margins are included in
  1514. // the box of the documentElement, in the other cases not.
  1515. if (!isIE10 && isHTML) {
  1516. var marginTop = parseFloat(styles.marginTop, 10);
  1517. var marginLeft = parseFloat(styles.marginLeft, 10);
  1518. offsets.top -= borderTopWidth - marginTop;
  1519. offsets.bottom -= borderTopWidth - marginTop;
  1520. offsets.left -= borderLeftWidth - marginLeft;
  1521. offsets.right -= borderLeftWidth - marginLeft; // Attach marginTop and marginLeft because in some circumstances we may need them
  1522. offsets.marginTop = marginTop;
  1523. offsets.marginLeft = marginLeft;
  1524. }
  1525. if (isIE10 && !fixedPosition ? parent.contains(scrollParent) : parent === scrollParent && scrollParent.nodeName !== 'BODY') {
  1526. offsets = includeScroll(offsets, parent);
  1527. }
  1528. return offsets;
  1529. }
  1530. function getViewportOffsetRectRelativeToArtbitraryNode(element) {
  1531. var excludeScroll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  1532. var html = element.ownerDocument.documentElement;
  1533. var relativeOffset = getOffsetRectRelativeToArbitraryNode(element, html);
  1534. var width = Math.max(html.clientWidth, window.innerWidth || 0);
  1535. var height = Math.max(html.clientHeight, window.innerHeight || 0);
  1536. var scrollTop = !excludeScroll ? getScroll(html) : 0;
  1537. var scrollLeft = !excludeScroll ? getScroll(html, 'left') : 0;
  1538. var offset = {
  1539. top: scrollTop - relativeOffset.top + relativeOffset.marginTop,
  1540. left: scrollLeft - relativeOffset.left + relativeOffset.marginLeft,
  1541. width: width,
  1542. height: height
  1543. };
  1544. return getClientRect(offset);
  1545. }
  1546. /**
  1547. * Check if the given element is fixed or is inside a fixed parent
  1548. * @method
  1549. * @memberof Popper.Utils
  1550. * @argument {Element} element
  1551. * @argument {Element} customContainer
  1552. * @returns {Boolean} answer to "isFixed?"
  1553. */
  1554. function isFixed(element) {
  1555. var nodeName = element.nodeName;
  1556. if (nodeName === 'BODY' || nodeName === 'HTML') {
  1557. return false;
  1558. }
  1559. if (getStyleComputedProperty(element, 'position') === 'fixed') {
  1560. return true;
  1561. }
  1562. return isFixed(getParentNode(element));
  1563. }
  1564. /**
  1565. * Finds the first parent of an element that has a transformed property defined
  1566. * @method
  1567. * @memberof Popper.Utils
  1568. * @argument {Element} element
  1569. * @returns {Element} first transformed parent or documentElement
  1570. */
  1571. function getFixedPositionOffsetParent(element) {
  1572. // This check is needed to avoid errors in case one of the elements isn't defined for any reason
  1573. if (!element || !element.parentElement || isIE()) {
  1574. return document.documentElement;
  1575. }
  1576. var el = element.parentElement;
  1577. while (el && getStyleComputedProperty(el, 'transform') === 'none') {
  1578. el = el.parentElement;
  1579. }
  1580. return el || document.documentElement;
  1581. }
  1582. /**
  1583. * Computed the boundaries limits and return them
  1584. * @method
  1585. * @memberof Popper.Utils
  1586. * @param {HTMLElement} popper
  1587. * @param {HTMLElement} reference
  1588. * @param {number} padding
  1589. * @param {HTMLElement} boundariesElement - Element used to define the boundaries
  1590. * @param {Boolean} fixedPosition - Is in fixed position mode
  1591. * @returns {Object} Coordinates of the boundaries
  1592. */
  1593. function getBoundaries(popper, reference, padding, boundariesElement) {
  1594. var fixedPosition = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false; // NOTE: 1 DOM access here
  1595. var boundaries = {
  1596. top: 0,
  1597. left: 0
  1598. };
  1599. var offsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, reference); // Handle viewport case
  1600. if (boundariesElement === 'viewport') {
  1601. boundaries = getViewportOffsetRectRelativeToArtbitraryNode(offsetParent, fixedPosition);
  1602. } else {
  1603. // Handle other cases based on DOM element used as boundaries
  1604. var boundariesNode = void 0;
  1605. if (boundariesElement === 'scrollParent') {
  1606. boundariesNode = getScrollParent(getParentNode(reference));
  1607. if (boundariesNode.nodeName === 'BODY') {
  1608. boundariesNode = popper.ownerDocument.documentElement;
  1609. }
  1610. } else if (boundariesElement === 'window') {
  1611. boundariesNode = popper.ownerDocument.documentElement;
  1612. } else {
  1613. boundariesNode = boundariesElement;
  1614. }
  1615. var offsets = getOffsetRectRelativeToArbitraryNode(boundariesNode, offsetParent, fixedPosition); // In case of HTML, we need a different computation
  1616. if (boundariesNode.nodeName === 'HTML' && !isFixed(offsetParent)) {
  1617. var _getWindowSizes = getWindowSizes(popper.ownerDocument),
  1618. height = _getWindowSizes.height,
  1619. width = _getWindowSizes.width;
  1620. boundaries.top += offsets.top - offsets.marginTop;
  1621. boundaries.bottom = height + offsets.top;
  1622. boundaries.left += offsets.left - offsets.marginLeft;
  1623. boundaries.right = width + offsets.left;
  1624. } else {
  1625. // for all the other DOM elements, this one is good
  1626. boundaries = offsets;
  1627. }
  1628. } // Add paddings
  1629. padding = padding || 0;
  1630. var isPaddingNumber = typeof padding === 'number';
  1631. boundaries.left += isPaddingNumber ? padding : padding.left || 0;
  1632. boundaries.top += isPaddingNumber ? padding : padding.top || 0;
  1633. boundaries.right -= isPaddingNumber ? padding : padding.right || 0;
  1634. boundaries.bottom -= isPaddingNumber ? padding : padding.bottom || 0;
  1635. return boundaries;
  1636. }
  1637. function getArea(_ref) {
  1638. var width = _ref.width,
  1639. height = _ref.height;
  1640. return width * height;
  1641. }
  1642. /**
  1643. * Utility used to transform the `auto` placement to the placement with more
  1644. * available space.
  1645. * @method
  1646. * @memberof Popper.Utils
  1647. * @argument {Object} data - The data object generated by update method
  1648. * @argument {Object} options - Modifiers configuration and options
  1649. * @returns {Object} The data object, properly modified
  1650. */
  1651. function computeAutoPlacement(placement, refRect, popper, reference, boundariesElement) {
  1652. var padding = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0;
  1653. if (placement.indexOf('auto') === -1) {
  1654. return placement;
  1655. }
  1656. var boundaries = getBoundaries(popper, reference, padding, boundariesElement);
  1657. var rects = {
  1658. top: {
  1659. width: boundaries.width,
  1660. height: refRect.top - boundaries.top
  1661. },
  1662. right: {
  1663. width: boundaries.right - refRect.right,
  1664. height: boundaries.height
  1665. },
  1666. bottom: {
  1667. width: boundaries.width,
  1668. height: boundaries.bottom - refRect.bottom
  1669. },
  1670. left: {
  1671. width: refRect.left - boundaries.left,
  1672. height: boundaries.height
  1673. }
  1674. };
  1675. var sortedAreas = Object.keys(rects).map(function (key) {
  1676. return _extends$2({
  1677. key: key
  1678. }, rects[key], {
  1679. area: getArea(rects[key])
  1680. });
  1681. }).sort(function (a, b) {
  1682. return b.area - a.area;
  1683. });
  1684. var filteredAreas = sortedAreas.filter(function (_ref2) {
  1685. var width = _ref2.width,
  1686. height = _ref2.height;
  1687. return width >= popper.clientWidth && height >= popper.clientHeight;
  1688. });
  1689. var computedPlacement = filteredAreas.length > 0 ? filteredAreas[0].key : sortedAreas[0].key;
  1690. var variation = placement.split('-')[1];
  1691. return computedPlacement + (variation ? '-' + variation : '');
  1692. }
  1693. /**
  1694. * Get offsets to the reference element
  1695. * @method
  1696. * @memberof Popper.Utils
  1697. * @param {Object} state
  1698. * @param {Element} popper - the popper element
  1699. * @param {Element} reference - the reference element (the popper will be relative to this)
  1700. * @param {Element} fixedPosition - is in fixed position mode
  1701. * @returns {Object} An object containing the offsets which will be applied to the popper
  1702. */
  1703. function getReferenceOffsets(state, popper, reference) {
  1704. var fixedPosition = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
  1705. var commonOffsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, reference);
  1706. return getOffsetRectRelativeToArbitraryNode(reference, commonOffsetParent, fixedPosition);
  1707. }
  1708. /**
  1709. * Get the outer sizes of the given element (offset size + margins)
  1710. * @method
  1711. * @memberof Popper.Utils
  1712. * @argument {Element} element
  1713. * @returns {Object} object containing width and height properties
  1714. */
  1715. function getOuterSizes(element) {
  1716. var window = element.ownerDocument.defaultView;
  1717. var styles = window.getComputedStyle(element);
  1718. var x = parseFloat(styles.marginTop || 0) + parseFloat(styles.marginBottom || 0);
  1719. var y = parseFloat(styles.marginLeft || 0) + parseFloat(styles.marginRight || 0);
  1720. var result = {
  1721. width: element.offsetWidth + y,
  1722. height: element.offsetHeight + x
  1723. };
  1724. return result;
  1725. }
  1726. /**
  1727. * Get the opposite placement of the given one
  1728. * @method
  1729. * @memberof Popper.Utils
  1730. * @argument {String} placement
  1731. * @returns {String} flipped placement
  1732. */
  1733. function getOppositePlacement(placement) {
  1734. var hash = {
  1735. left: 'right',
  1736. right: 'left',
  1737. bottom: 'top',
  1738. top: 'bottom'
  1739. };
  1740. return placement.replace(/left|right|bottom|top/g, function (matched) {
  1741. return hash[matched];
  1742. });
  1743. }
  1744. /**
  1745. * Get offsets to the popper
  1746. * @method
  1747. * @memberof Popper.Utils
  1748. * @param {Object} position - CSS position the Popper will get applied
  1749. * @param {HTMLElement} popper - the popper element
  1750. * @param {Object} referenceOffsets - the reference offsets (the popper will be relative to this)
  1751. * @param {String} placement - one of the valid placement options
  1752. * @returns {Object} popperOffsets - An object containing the offsets which will be applied to the popper
  1753. */
  1754. function getPopperOffsets(popper, referenceOffsets, placement) {
  1755. placement = placement.split('-')[0]; // Get popper node sizes
  1756. var popperRect = getOuterSizes(popper); // Add position, width and height to our offsets object
  1757. var popperOffsets = {
  1758. width: popperRect.width,
  1759. height: popperRect.height
  1760. }; // depending by the popper placement we have to compute its offsets slightly differently
  1761. var isHoriz = ['right', 'left'].indexOf(placement) !== -1;
  1762. var mainSide = isHoriz ? 'top' : 'left';
  1763. var secondarySide = isHoriz ? 'left' : 'top';
  1764. var measurement = isHoriz ? 'height' : 'width';
  1765. var secondaryMeasurement = !isHoriz ? 'height' : 'width';
  1766. popperOffsets[mainSide] = referenceOffsets[mainSide] + referenceOffsets[measurement] / 2 - popperRect[measurement] / 2;
  1767. if (placement === secondarySide) {
  1768. popperOffsets[secondarySide] = referenceOffsets[secondarySide] - popperRect[secondaryMeasurement];
  1769. } else {
  1770. popperOffsets[secondarySide] = referenceOffsets[getOppositePlacement(secondarySide)];
  1771. }
  1772. return popperOffsets;
  1773. }
  1774. /**
  1775. * Mimics the `find` method of Array
  1776. * @method
  1777. * @memberof Popper.Utils
  1778. * @argument {Array} arr
  1779. * @argument prop
  1780. * @argument value
  1781. * @returns index or -1
  1782. */
  1783. function find(arr, check) {
  1784. // use native find if supported
  1785. if (Array.prototype.find) {
  1786. return arr.find(check);
  1787. } // use `filter` to obtain the same behavior of `find`
  1788. return arr.filter(check)[0];
  1789. }
  1790. /**
  1791. * Return the index of the matching object
  1792. * @method
  1793. * @memberof Popper.Utils
  1794. * @argument {Array} arr
  1795. * @argument prop
  1796. * @argument value
  1797. * @returns index or -1
  1798. */
  1799. function findIndex(arr, prop, value) {
  1800. // use native findIndex if supported
  1801. if (Array.prototype.findIndex) {
  1802. return arr.findIndex(function (cur) {
  1803. return cur[prop] === value;
  1804. });
  1805. } // use `find` + `indexOf` if `findIndex` isn't supported
  1806. var match = find(arr, function (obj) {
  1807. return obj[prop] === value;
  1808. });
  1809. return arr.indexOf(match);
  1810. }
  1811. /**
  1812. * Loop trough the list of modifiers and run them in order,
  1813. * each of them will then edit the data object.
  1814. * @method
  1815. * @memberof Popper.Utils
  1816. * @param {dataObject} data
  1817. * @param {Array} modifiers
  1818. * @param {String} ends - Optional modifier name used as stopper
  1819. * @returns {dataObject}
  1820. */
  1821. function runModifiers(modifiers, data, ends) {
  1822. var modifiersToRun = ends === undefined ? modifiers : modifiers.slice(0, findIndex(modifiers, 'name', ends));
  1823. modifiersToRun.forEach(function (modifier) {
  1824. if (modifier['function']) {
  1825. // eslint-disable-line dot-notation
  1826. console.warn('`modifier.function` is deprecated, use `modifier.fn`!');
  1827. }
  1828. var fn = modifier['function'] || modifier.fn; // eslint-disable-line dot-notation
  1829. if (modifier.enabled && isFunction$1(fn)) {
  1830. // Add properties to offsets to make them a complete clientRect object
  1831. // we do this before each modifier to make sure the previous one doesn't
  1832. // mess with these values
  1833. data.offsets.popper = getClientRect(data.offsets.popper);
  1834. data.offsets.reference = getClientRect(data.offsets.reference);
  1835. data = fn(data, modifier);
  1836. }
  1837. });
  1838. return data;
  1839. }
  1840. /**
  1841. * Updates the position of the popper, computing the new offsets and applying
  1842. * the new style.<br />
  1843. * Prefer `scheduleUpdate` over `update` because of performance reasons.
  1844. * @method
  1845. * @memberof Popper
  1846. */
  1847. function update() {
  1848. // if popper is destroyed, don't perform any further update
  1849. if (this.state.isDestroyed) {
  1850. return;
  1851. }
  1852. var data = {
  1853. instance: this,
  1854. styles: {},
  1855. arrowStyles: {},
  1856. attributes: {},
  1857. flipped: false,
  1858. offsets: {}
  1859. }; // compute reference element offsets
  1860. data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed); // compute auto placement, store placement inside the data object,
  1861. // modifiers will be able to edit `placement` if needed
  1862. // and refer to originalPlacement to know the original value
  1863. data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding); // store the computed placement inside `originalPlacement`
  1864. data.originalPlacement = data.placement;
  1865. data.positionFixed = this.options.positionFixed; // compute the popper offsets
  1866. data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);
  1867. data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute'; // run the modifiers
  1868. data = runModifiers(this.modifiers, data); // the first `update` will call `onCreate` callback
  1869. // the other ones will call `onUpdate` callback
  1870. if (!this.state.isCreated) {
  1871. this.state.isCreated = true;
  1872. this.options.onCreate(data);
  1873. } else {
  1874. this.options.onUpdate(data);
  1875. }
  1876. }
  1877. /**
  1878. * Helper used to know if the given modifier is enabled.
  1879. * @method
  1880. * @memberof Popper.Utils
  1881. * @returns {Boolean}
  1882. */
  1883. function isModifierEnabled(modifiers, modifierName) {
  1884. return modifiers.some(function (_ref) {
  1885. var name = _ref.name,
  1886. enabled = _ref.enabled;
  1887. return enabled && name === modifierName;
  1888. });
  1889. }
  1890. /**
  1891. * Get the prefixed supported property name
  1892. * @method
  1893. * @memberof Popper.Utils
  1894. * @argument {String} property (camelCase)
  1895. * @returns {String} prefixed property (camelCase or PascalCase, depending on the vendor prefix)
  1896. */
  1897. function getSupportedPropertyName(property) {
  1898. var prefixes = [false, 'ms', 'Webkit', 'Moz', 'O'];
  1899. var upperProp = property.charAt(0).toUpperCase() + property.slice(1);
  1900. for (var i = 0; i < prefixes.length; i++) {
  1901. var prefix = prefixes[i];
  1902. var toCheck = prefix ? '' + prefix + upperProp : property;
  1903. if (typeof document.body.style[toCheck] !== 'undefined') {
  1904. return toCheck;
  1905. }
  1906. }
  1907. return null;
  1908. }
  1909. /**
  1910. * Destroys the popper.
  1911. * @method
  1912. * @memberof Popper
  1913. */
  1914. function destroy() {
  1915. this.state.isDestroyed = true; // touch DOM only if `applyStyle` modifier is enabled
  1916. if (isModifierEnabled(this.modifiers, 'applyStyle')) {
  1917. this.popper.removeAttribute('x-placement');
  1918. this.popper.style.position = '';
  1919. this.popper.style.top = '';
  1920. this.popper.style.left = '';
  1921. this.popper.style.right = '';
  1922. this.popper.style.bottom = '';
  1923. this.popper.style.willChange = '';
  1924. this.popper.style[getSupportedPropertyName('transform')] = '';
  1925. }
  1926. this.disableEventListeners(); // remove the popper if user explicity asked for the deletion on destroy
  1927. // do not use `remove` because IE11 doesn't support it
  1928. if (this.options.removeOnDestroy) {
  1929. this.popper.parentNode.removeChild(this.popper);
  1930. }
  1931. return this;
  1932. }
  1933. /**
  1934. * Get the window associated with the element
  1935. * @argument {Element} element
  1936. * @returns {Window}
  1937. */
  1938. function getWindow(element) {
  1939. var ownerDocument = element.ownerDocument;
  1940. return ownerDocument ? ownerDocument.defaultView : window;
  1941. }
  1942. function attachToScrollParents(scrollParent, event, callback, scrollParents) {
  1943. var isBody = scrollParent.nodeName === 'BODY';
  1944. var target = isBody ? scrollParent.ownerDocument.defaultView : scrollParent;
  1945. target.addEventListener(event, callback, {
  1946. passive: true
  1947. });
  1948. if (!isBody) {
  1949. attachToScrollParents(getScrollParent(target.parentNode), event, callback, scrollParents);
  1950. }
  1951. scrollParents.push(target);
  1952. }
  1953. /**
  1954. * Setup needed event listeners used to update the popper position
  1955. * @method
  1956. * @memberof Popper.Utils
  1957. * @private
  1958. */
  1959. function setupEventListeners(reference, options, state, updateBound) {
  1960. // Resize event listener on window
  1961. state.updateBound = updateBound;
  1962. getWindow(reference).addEventListener('resize', state.updateBound, {
  1963. passive: true
  1964. }); // Scroll event listener on scroll parents
  1965. var scrollElement = getScrollParent(reference);
  1966. attachToScrollParents(scrollElement, 'scroll', state.updateBound, state.scrollParents);
  1967. state.scrollElement = scrollElement;
  1968. state.eventsEnabled = true;
  1969. return state;
  1970. }
  1971. /**
  1972. * It will add resize/scroll events and start recalculating
  1973. * position of the popper element when they are triggered.
  1974. * @method
  1975. * @memberof Popper
  1976. */
  1977. function enableEventListeners() {
  1978. if (!this.state.eventsEnabled) {
  1979. this.state = setupEventListeners(this.reference, this.options, this.state, this.scheduleUpdate);
  1980. }
  1981. }
  1982. /**
  1983. * Remove event listeners used to update the popper position
  1984. * @method
  1985. * @memberof Popper.Utils
  1986. * @private
  1987. */
  1988. function removeEventListeners(reference, state) {
  1989. // Remove resize event listener on window
  1990. getWindow(reference).removeEventListener('resize', state.updateBound); // Remove scroll event listener on scroll parents
  1991. state.scrollParents.forEach(function (target) {
  1992. target.removeEventListener('scroll', state.updateBound);
  1993. }); // Reset state
  1994. state.updateBound = null;
  1995. state.scrollParents = [];
  1996. state.scrollElement = null;
  1997. state.eventsEnabled = false;
  1998. return state;
  1999. }
  2000. /**
  2001. * It will remove resize/scroll events and won't recalculate popper position
  2002. * when they are triggered. It also won't trigger `onUpdate` callback anymore,
  2003. * unless you call `update` method manually.
  2004. * @method
  2005. * @memberof Popper
  2006. */
  2007. function disableEventListeners() {
  2008. if (this.state.eventsEnabled) {
  2009. cancelAnimationFrame(this.scheduleUpdate);
  2010. this.state = removeEventListeners(this.reference, this.state);
  2011. }
  2012. }
  2013. /**
  2014. * Tells if a given input is a number
  2015. * @method
  2016. * @memberof Popper.Utils
  2017. * @param {*} input to check
  2018. * @return {Boolean}
  2019. */
  2020. function isNumeric(n) {
  2021. return n !== '' && !isNaN(parseFloat(n)) && isFinite(n);
  2022. }
  2023. /**
  2024. * Set the style to the given popper
  2025. * @method
  2026. * @memberof Popper.Utils
  2027. * @argument {Element} element - Element to apply the style to
  2028. * @argument {Object} styles
  2029. * Object with a list of properties and values which will be applied to the element
  2030. */
  2031. function setStyles(element, styles) {
  2032. Object.keys(styles).forEach(function (prop) {
  2033. var unit = ''; // add unit if the value is numeric and is one of the following
  2034. if (['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(prop) !== -1 && isNumeric(styles[prop])) {
  2035. unit = 'px';
  2036. }
  2037. element.style[prop] = styles[prop] + unit;
  2038. });
  2039. }
  2040. /**
  2041. * Set the attributes to the given popper
  2042. * @method
  2043. * @memberof Popper.Utils
  2044. * @argument {Element} element - Element to apply the attributes to
  2045. * @argument {Object} styles
  2046. * Object with a list of properties and values which will be applied to the element
  2047. */
  2048. function setAttributes(element, attributes) {
  2049. Object.keys(attributes).forEach(function (prop) {
  2050. var value = attributes[prop];
  2051. if (value !== false) {
  2052. element.setAttribute(prop, attributes[prop]);
  2053. } else {
  2054. element.removeAttribute(prop);
  2055. }
  2056. });
  2057. }
  2058. /**
  2059. * @function
  2060. * @memberof Modifiers
  2061. * @argument {Object} data - The data object generated by `update` method
  2062. * @argument {Object} data.styles - List of style properties - values to apply to popper element
  2063. * @argument {Object} data.attributes - List of attribute properties - values to apply to popper element
  2064. * @argument {Object} options - Modifiers configuration and options
  2065. * @returns {Object} The same data object
  2066. */
  2067. function applyStyle(data) {
  2068. // any property present in `data.styles` will be applied to the popper,
  2069. // in this way we can make the 3rd party modifiers add custom styles to it
  2070. // Be aware, modifiers could override the properties defined in the previous
  2071. // lines of this modifier!
  2072. setStyles(data.instance.popper, data.styles); // any property present in `data.attributes` will be applied to the popper,
  2073. // they will be set as HTML attributes of the element
  2074. setAttributes(data.instance.popper, data.attributes); // if arrowElement is defined and arrowStyles has some properties
  2075. if (data.arrowElement && Object.keys(data.arrowStyles).length) {
  2076. setStyles(data.arrowElement, data.arrowStyles);
  2077. }
  2078. return data;
  2079. }
  2080. /**
  2081. * Set the x-placement attribute before everything else because it could be used
  2082. * to add margins to the popper margins needs to be calculated to get the
  2083. * correct popper offsets.
  2084. * @method
  2085. * @memberof Popper.modifiers
  2086. * @param {HTMLElement} reference - The reference element used to position the popper
  2087. * @param {HTMLElement} popper - The HTML element used as popper
  2088. * @param {Object} options - Popper.js options
  2089. */
  2090. function applyStyleOnLoad(reference, popper, options, modifierOptions, state) {
  2091. // compute reference element offsets
  2092. var referenceOffsets = getReferenceOffsets(state, popper, reference, options.positionFixed); // compute auto placement, store placement inside the data object,
  2093. // modifiers will be able to edit `placement` if needed
  2094. // and refer to originalPlacement to know the original value
  2095. var placement = computeAutoPlacement(options.placement, referenceOffsets, popper, reference, options.modifiers.flip.boundariesElement, options.modifiers.flip.padding);
  2096. popper.setAttribute('x-placement', placement); // Apply `position` to popper before anything else because
  2097. // without the position applied we can't guarantee correct computations
  2098. setStyles(popper, {
  2099. position: options.positionFixed ? 'fixed' : 'absolute'
  2100. });
  2101. return options;
  2102. }
  2103. /**
  2104. * @function
  2105. * @memberof Popper.Utils
  2106. * @argument {Object} data - The data object generated by `update` method
  2107. * @argument {Boolean} shouldRound - If the offsets should be rounded at all
  2108. * @returns {Object} The popper's position offsets rounded
  2109. *
  2110. * The tale of pixel-perfect positioning. It's still not 100% perfect, but as
  2111. * good as it can be within reason.
  2112. * Discussion here: https://github.com/FezVrasta/popper.js/pull/715
  2113. *
  2114. * Low DPI screens cause a popper to be blurry if not using full pixels (Safari
  2115. * as well on High DPI screens).
  2116. *
  2117. * Firefox prefers no rounding for positioning and does not have blurriness on
  2118. * high DPI screens.
  2119. *
  2120. * Only horizontal placement and left/right values need to be considered.
  2121. */
  2122. function getRoundedOffsets(data, shouldRound) {
  2123. var _data$offsets = data.offsets,
  2124. popper = _data$offsets.popper,
  2125. reference = _data$offsets.reference;
  2126. var isVertical = ['left', 'right'].indexOf(data.placement) !== -1;
  2127. var isVariation = data.placement.indexOf('-') !== -1;
  2128. var sameWidthOddness = reference.width % 2 === popper.width % 2;
  2129. var bothOddWidth = reference.width % 2 === 1 && popper.width % 2 === 1;
  2130. var noRound = function noRound(v) {
  2131. return v;
  2132. };
  2133. var horizontalToInteger = !shouldRound ? noRound : isVertical || isVariation || sameWidthOddness ? Math.round : Math.floor;
  2134. var verticalToInteger = !shouldRound ? noRound : Math.round;
  2135. return {
  2136. left: horizontalToInteger(bothOddWidth && !isVariation && shouldRound ? popper.left - 1 : popper.left),
  2137. top: verticalToInteger(popper.top),
  2138. bottom: verticalToInteger(popper.bottom),
  2139. right: horizontalToInteger(popper.right)
  2140. };
  2141. }
  2142. var isFirefox = isBrowser && /Firefox/i.test(navigator.userAgent);
  2143. /**
  2144. * @function
  2145. * @memberof Modifiers
  2146. * @argument {Object} data - The data object generated by `update` method
  2147. * @argument {Object} options - Modifiers configuration and options
  2148. * @returns {Object} The data object, properly modified
  2149. */
  2150. function computeStyle(data, options) {
  2151. var x = options.x,
  2152. y = options.y;
  2153. var popper = data.offsets.popper; // Remove this legacy support in Popper.js v2
  2154. var legacyGpuAccelerationOption = find(data.instance.modifiers, function (modifier) {
  2155. return modifier.name === 'applyStyle';
  2156. }).gpuAcceleration;
  2157. if (legacyGpuAccelerationOption !== undefined) {
  2158. console.warn('WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!');
  2159. }
  2160. var gpuAcceleration = legacyGpuAccelerationOption !== undefined ? legacyGpuAccelerationOption : options.gpuAcceleration;
  2161. var offsetParent = getOffsetParent(data.instance.popper);
  2162. var offsetParentRect = getBoundingClientRect(offsetParent); // Styles
  2163. var styles = {
  2164. position: popper.position
  2165. };
  2166. var offsets = getRoundedOffsets(data, window.devicePixelRatio < 2 || !isFirefox);
  2167. var sideA = x === 'bottom' ? 'top' : 'bottom';
  2168. var sideB = y === 'right' ? 'left' : 'right'; // if gpuAcceleration is set to `true` and transform is supported,
  2169. // we use `translate3d` to apply the position to the popper we
  2170. // automatically use the supported prefixed version if needed
  2171. var prefixedProperty = getSupportedPropertyName('transform'); // now, let's make a step back and look at this code closely (wtf?)
  2172. // If the content of the popper grows once it's been positioned, it
  2173. // may happen that the popper gets misplaced because of the new content
  2174. // overflowing its reference element
  2175. // To avoid this problem, we provide two options (x and y), which allow
  2176. // the consumer to define the offset origin.
  2177. // If we position a popper on top of a reference element, we can set
  2178. // `x` to `top` to make the popper grow towards its top instead of
  2179. // its bottom.
  2180. var left = void 0,
  2181. top = void 0;
  2182. if (sideA === 'bottom') {
  2183. // when offsetParent is <html> the positioning is relative to the bottom of the screen (excluding the scrollbar)
  2184. // and not the bottom of the html element
  2185. if (offsetParent.nodeName === 'HTML') {
  2186. top = -offsetParent.clientHeight + offsets.bottom;
  2187. } else {
  2188. top = -offsetParentRect.height + offsets.bottom;
  2189. }
  2190. } else {
  2191. top = offsets.top;
  2192. }
  2193. if (sideB === 'right') {
  2194. if (offsetParent.nodeName === 'HTML') {
  2195. left = -offsetParent.clientWidth + offsets.right;
  2196. } else {
  2197. left = -offsetParentRect.width + offsets.right;
  2198. }
  2199. } else {
  2200. left = offsets.left;
  2201. }
  2202. if (gpuAcceleration && prefixedProperty) {
  2203. styles[prefixedProperty] = 'translate3d(' + left + 'px, ' + top + 'px, 0)';
  2204. styles[sideA] = 0;
  2205. styles[sideB] = 0;
  2206. styles.willChange = 'transform';
  2207. } else {
  2208. // othwerise, we use the standard `top`, `left`, `bottom` and `right` properties
  2209. var invertTop = sideA === 'bottom' ? -1 : 1;
  2210. var invertLeft = sideB === 'right' ? -1 : 1;
  2211. styles[sideA] = top * invertTop;
  2212. styles[sideB] = left * invertLeft;
  2213. styles.willChange = sideA + ', ' + sideB;
  2214. } // Attributes
  2215. var attributes = {
  2216. 'x-placement': data.placement
  2217. }; // Update `data` attributes, styles and arrowStyles
  2218. data.attributes = _extends$2({}, attributes, data.attributes);
  2219. data.styles = _extends$2({}, styles, data.styles);
  2220. data.arrowStyles = _extends$2({}, data.offsets.arrow, data.arrowStyles);
  2221. return data;
  2222. }
  2223. /**
  2224. * Helper used to know if the given modifier depends from another one.<br />
  2225. * It checks if the needed modifier is listed and enabled.
  2226. * @method
  2227. * @memberof Popper.Utils
  2228. * @param {Array} modifiers - list of modifiers
  2229. * @param {String} requestingName - name of requesting modifier
  2230. * @param {String} requestedName - name of requested modifier
  2231. * @returns {Boolean}
  2232. */
  2233. function isModifierRequired(modifiers, requestingName, requestedName) {
  2234. var requesting = find(modifiers, function (_ref) {
  2235. var name = _ref.name;
  2236. return name === requestingName;
  2237. });
  2238. var isRequired = !!requesting && modifiers.some(function (modifier) {
  2239. return modifier.name === requestedName && modifier.enabled && modifier.order < requesting.order;
  2240. });
  2241. if (!isRequired) {
  2242. var _requesting = '`' + requestingName + '`';
  2243. var requested = '`' + requestedName + '`';
  2244. console.warn(requested + ' modifier is required by ' + _requesting + ' modifier in order to work, be sure to include it before ' + _requesting + '!');
  2245. }
  2246. return isRequired;
  2247. }
  2248. /**
  2249. * @function
  2250. * @memberof Modifiers
  2251. * @argument {Object} data - The data object generated by update method
  2252. * @argument {Object} options - Modifiers configuration and options
  2253. * @returns {Object} The data object, properly modified
  2254. */
  2255. function arrow(data, options) {
  2256. var _data$offsets$arrow; // arrow depends on keepTogether in order to work
  2257. if (!isModifierRequired(data.instance.modifiers, 'arrow', 'keepTogether')) {
  2258. return data;
  2259. }
  2260. var arrowElement = options.element; // if arrowElement is a string, suppose it's a CSS selector
  2261. if (typeof arrowElement === 'string') {
  2262. arrowElement = data.instance.popper.querySelector(arrowElement); // if arrowElement is not found, don't run the modifier
  2263. if (!arrowElement) {
  2264. return data;
  2265. }
  2266. } else {
  2267. // if the arrowElement isn't a query selector we must check that the
  2268. // provided DOM node is child of its popper node
  2269. if (!data.instance.popper.contains(arrowElement)) {
  2270. console.warn('WARNING: `arrow.element` must be child of its popper element!');
  2271. return data;
  2272. }
  2273. }
  2274. var placement = data.placement.split('-')[0];
  2275. var _data$offsets = data.offsets,
  2276. popper = _data$offsets.popper,
  2277. reference = _data$offsets.reference;
  2278. var isVertical = ['left', 'right'].indexOf(placement) !== -1;
  2279. var len = isVertical ? 'height' : 'width';
  2280. var sideCapitalized = isVertical ? 'Top' : 'Left';
  2281. var side = sideCapitalized.toLowerCase();
  2282. var altSide = isVertical ? 'left' : 'top';
  2283. var opSide = isVertical ? 'bottom' : 'right';
  2284. var arrowElementSize = getOuterSizes(arrowElement)[len]; //
  2285. // extends keepTogether behavior making sure the popper and its
  2286. // reference have enough pixels in conjunction
  2287. //
  2288. // top/left side
  2289. if (reference[opSide] - arrowElementSize < popper[side]) {
  2290. data.offsets.popper[side] -= popper[side] - (reference[opSide] - arrowElementSize);
  2291. } // bottom/right side
  2292. if (reference[side] + arrowElementSize > popper[opSide]) {
  2293. data.offsets.popper[side] += reference[side] + arrowElementSize - popper[opSide];
  2294. }
  2295. data.offsets.popper = getClientRect(data.offsets.popper); // compute center of the popper
  2296. var center = reference[side] + reference[len] / 2 - arrowElementSize / 2; // Compute the sideValue using the updated popper offsets
  2297. // take popper margin in account because we don't have this info available
  2298. var css = getStyleComputedProperty(data.instance.popper);
  2299. var popperMarginSide = parseFloat(css['margin' + sideCapitalized], 10);
  2300. var popperBorderSide = parseFloat(css['border' + sideCapitalized + 'Width'], 10);
  2301. var sideValue = center - data.offsets.popper[side] - popperMarginSide - popperBorderSide; // prevent arrowElement from being placed not contiguously to its popper
  2302. sideValue = Math.max(Math.min(popper[len] - arrowElementSize, sideValue), 0);
  2303. data.arrowElement = arrowElement;
  2304. data.offsets.arrow = (_data$offsets$arrow = {}, defineProperty(_data$offsets$arrow, side, Math.round(sideValue)), defineProperty(_data$offsets$arrow, altSide, ''), _data$offsets$arrow);
  2305. return data;
  2306. }
  2307. /**
  2308. * Get the opposite placement variation of the given one
  2309. * @method
  2310. * @memberof Popper.Utils
  2311. * @argument {String} placement variation
  2312. * @returns {String} flipped placement variation
  2313. */
  2314. function getOppositeVariation(variation) {
  2315. if (variation === 'end') {
  2316. return 'start';
  2317. } else if (variation === 'start') {
  2318. return 'end';
  2319. }
  2320. return variation;
  2321. }
  2322. /**
  2323. * List of accepted placements to use as values of the `placement` option.<br />
  2324. * Valid placements are:
  2325. * - `auto`
  2326. * - `top`
  2327. * - `right`
  2328. * - `bottom`
  2329. * - `left`
  2330. *
  2331. * Each placement can have a variation from this list:
  2332. * - `-start`
  2333. * - `-end`
  2334. *
  2335. * Variations are interpreted easily if you think of them as the left to right
  2336. * written languages. Horizontally (`top` and `bottom`), `start` is left and `end`
  2337. * is right.<br />
  2338. * Vertically (`left` and `right`), `start` is top and `end` is bottom.
  2339. *
  2340. * Some valid examples are:
  2341. * - `top-end` (on top of reference, right aligned)
  2342. * - `right-start` (on right of reference, top aligned)
  2343. * - `bottom` (on bottom, centered)
  2344. * - `auto-end` (on the side with more space available, alignment depends by placement)
  2345. *
  2346. * @static
  2347. * @type {Array}
  2348. * @enum {String}
  2349. * @readonly
  2350. * @method placements
  2351. * @memberof Popper
  2352. */
  2353. 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']; // Get rid of `auto` `auto-start` and `auto-end`
  2354. var validPlacements = placements.slice(3);
  2355. /**
  2356. * Given an initial placement, returns all the subsequent placements
  2357. * clockwise (or counter-clockwise).
  2358. *
  2359. * @method
  2360. * @memberof Popper.Utils
  2361. * @argument {String} placement - A valid placement (it accepts variations)
  2362. * @argument {Boolean} counter - Set to true to walk the placements counterclockwise
  2363. * @returns {Array} placements including their variations
  2364. */
  2365. function clockwise(placement) {
  2366. var counter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  2367. var index = validPlacements.indexOf(placement);
  2368. var arr = validPlacements.slice(index + 1).concat(validPlacements.slice(0, index));
  2369. return counter ? arr.reverse() : arr;
  2370. }
  2371. var BEHAVIORS = {
  2372. FLIP: 'flip',
  2373. CLOCKWISE: 'clockwise',
  2374. COUNTERCLOCKWISE: 'counterclockwise'
  2375. };
  2376. /**
  2377. * @function
  2378. * @memberof Modifiers
  2379. * @argument {Object} data - The data object generated by update method
  2380. * @argument {Object} options - Modifiers configuration and options
  2381. * @returns {Object} The data object, properly modified
  2382. */
  2383. function flip(data, options) {
  2384. // if `inner` modifier is enabled, we can't use the `flip` modifier
  2385. if (isModifierEnabled(data.instance.modifiers, 'inner')) {
  2386. return data;
  2387. }
  2388. if (data.flipped && data.placement === data.originalPlacement) {
  2389. // seems like flip is trying to loop, probably there's not enough space on any of the flippable sides
  2390. return data;
  2391. }
  2392. var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, options.boundariesElement, data.positionFixed);
  2393. var placement = data.placement.split('-')[0];
  2394. var placementOpposite = getOppositePlacement(placement);
  2395. var variation = data.placement.split('-')[1] || '';
  2396. var flipOrder = [];
  2397. switch (options.behavior) {
  2398. case BEHAVIORS.FLIP:
  2399. flipOrder = [placement, placementOpposite];
  2400. break;
  2401. case BEHAVIORS.CLOCKWISE:
  2402. flipOrder = clockwise(placement);
  2403. break;
  2404. case BEHAVIORS.COUNTERCLOCKWISE:
  2405. flipOrder = clockwise(placement, true);
  2406. break;
  2407. default:
  2408. flipOrder = options.behavior;
  2409. }
  2410. flipOrder.forEach(function (step, index) {
  2411. if (placement !== step || flipOrder.length === index + 1) {
  2412. return data;
  2413. }
  2414. placement = data.placement.split('-')[0];
  2415. placementOpposite = getOppositePlacement(placement);
  2416. var popperOffsets = data.offsets.popper;
  2417. var refOffsets = data.offsets.reference; // using floor because the reference offsets may contain decimals we are not going to consider here
  2418. var floor = Math.floor;
  2419. 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);
  2420. var overflowsLeft = floor(popperOffsets.left) < floor(boundaries.left);
  2421. var overflowsRight = floor(popperOffsets.right) > floor(boundaries.right);
  2422. var overflowsTop = floor(popperOffsets.top) < floor(boundaries.top);
  2423. var overflowsBottom = floor(popperOffsets.bottom) > floor(boundaries.bottom);
  2424. var overflowsBoundaries = placement === 'left' && overflowsLeft || placement === 'right' && overflowsRight || placement === 'top' && overflowsTop || placement === 'bottom' && overflowsBottom; // flip the variation if required
  2425. var isVertical = ['top', 'bottom'].indexOf(placement) !== -1;
  2426. var flippedVariation = !!options.flipVariations && (isVertical && variation === 'start' && overflowsLeft || isVertical && variation === 'end' && overflowsRight || !isVertical && variation === 'start' && overflowsTop || !isVertical && variation === 'end' && overflowsBottom);
  2427. if (overlapsRef || overflowsBoundaries || flippedVariation) {
  2428. // this boolean to detect any flip loop
  2429. data.flipped = true;
  2430. if (overlapsRef || overflowsBoundaries) {
  2431. placement = flipOrder[index + 1];
  2432. }
  2433. if (flippedVariation) {
  2434. variation = getOppositeVariation(variation);
  2435. }
  2436. data.placement = placement + (variation ? '-' + variation : ''); // this object contains `position`, we want to preserve it along with
  2437. // any additional property we may add in the future
  2438. data.offsets.popper = _extends$2({}, data.offsets.popper, getPopperOffsets(data.instance.popper, data.offsets.reference, data.placement));
  2439. data = runModifiers(data.instance.modifiers, data, 'flip');
  2440. }
  2441. });
  2442. return data;
  2443. }
  2444. /**
  2445. * @function
  2446. * @memberof Modifiers
  2447. * @argument {Object} data - The data object generated by update method
  2448. * @argument {Object} options - Modifiers configuration and options
  2449. * @returns {Object} The data object, properly modified
  2450. */
  2451. function keepTogether(data) {
  2452. var _data$offsets = data.offsets,
  2453. popper = _data$offsets.popper,
  2454. reference = _data$offsets.reference;
  2455. var placement = data.placement.split('-')[0];
  2456. var floor = Math.floor;
  2457. var isVertical = ['top', 'bottom'].indexOf(placement) !== -1;
  2458. var side = isVertical ? 'right' : 'bottom';
  2459. var opSide = isVertical ? 'left' : 'top';
  2460. var measurement = isVertical ? 'width' : 'height';
  2461. if (popper[side] < floor(reference[opSide])) {
  2462. data.offsets.popper[opSide] = floor(reference[opSide]) - popper[measurement];
  2463. }
  2464. if (popper[opSide] > floor(reference[side])) {
  2465. data.offsets.popper[opSide] = floor(reference[side]);
  2466. }
  2467. return data;
  2468. }
  2469. /**
  2470. * Converts a string containing value + unit into a px value number
  2471. * @function
  2472. * @memberof {modifiers~offset}
  2473. * @private
  2474. * @argument {String} str - Value + unit string
  2475. * @argument {String} measurement - `height` or `width`
  2476. * @argument {Object} popperOffsets
  2477. * @argument {Object} referenceOffsets
  2478. * @returns {Number|String}
  2479. * Value in pixels, or original string if no values were extracted
  2480. */
  2481. function toValue(str, measurement, popperOffsets, referenceOffsets) {
  2482. // separate value from unit
  2483. var split = str.match(/((?:\-|\+)?\d*\.?\d*)(.*)/);
  2484. var value = +split[1];
  2485. var unit = split[2]; // If it's not a number it's an operator, I guess
  2486. if (!value) {
  2487. return str;
  2488. }
  2489. if (unit.indexOf('%') === 0) {
  2490. var element = void 0;
  2491. switch (unit) {
  2492. case '%p':
  2493. element = popperOffsets;
  2494. break;
  2495. case '%':
  2496. case '%r':
  2497. default:
  2498. element = referenceOffsets;
  2499. }
  2500. var rect = getClientRect(element);
  2501. return rect[measurement] / 100 * value;
  2502. } else if (unit === 'vh' || unit === 'vw') {
  2503. // if is a vh or vw, we calculate the size based on the viewport
  2504. var size = void 0;
  2505. if (unit === 'vh') {
  2506. size = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
  2507. } else {
  2508. size = Math.max(document.documentElement.clientWidth, window.innerWidth || 0);
  2509. }
  2510. return size / 100 * value;
  2511. } else {
  2512. // if is an explicit pixel unit, we get rid of the unit and keep the value
  2513. // if is an implicit unit, it's px, and we return just the value
  2514. return value;
  2515. }
  2516. }
  2517. /**
  2518. * Parse an `offset` string to extrapolate `x` and `y` numeric offsets.
  2519. * @function
  2520. * @memberof {modifiers~offset}
  2521. * @private
  2522. * @argument {String} offset
  2523. * @argument {Object} popperOffsets
  2524. * @argument {Object} referenceOffsets
  2525. * @argument {String} basePlacement
  2526. * @returns {Array} a two cells array with x and y offsets in numbers
  2527. */
  2528. function parseOffset(offset, popperOffsets, referenceOffsets, basePlacement) {
  2529. var offsets = [0, 0]; // Use height if placement is left or right and index is 0 otherwise use width
  2530. // in this way the first offset will use an axis and the second one
  2531. // will use the other one
  2532. var useHeight = ['right', 'left'].indexOf(basePlacement) !== -1; // Split the offset string to obtain a list of values and operands
  2533. // The regex addresses values with the plus or minus sign in front (+10, -20, etc)
  2534. var fragments = offset.split(/(\+|\-)/).map(function (frag) {
  2535. return frag.trim();
  2536. }); // Detect if the offset string contains a pair of values or a single one
  2537. // they could be separated by comma or space
  2538. var divider = fragments.indexOf(find(fragments, function (frag) {
  2539. return frag.search(/,|\s/) !== -1;
  2540. }));
  2541. if (fragments[divider] && fragments[divider].indexOf(',') === -1) {
  2542. console.warn('Offsets separated by white space(s) are deprecated, use a comma (,) instead.');
  2543. } // If divider is found, we divide the list of values and operands to divide
  2544. // them by ofset X and Y.
  2545. var splitRegex = /\s*,\s*|\s+/;
  2546. 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]; // Convert the values with units to absolute pixels to allow our computations
  2547. ops = ops.map(function (op, index) {
  2548. // Most of the units rely on the orientation of the popper
  2549. var measurement = (index === 1 ? !useHeight : useHeight) ? 'height' : 'width';
  2550. var mergeWithPrevious = false;
  2551. return op // This aggregates any `+` or `-` sign that aren't considered operators
  2552. // e.g.: 10 + +5 => [10, +, +5]
  2553. .reduce(function (a, b) {
  2554. if (a[a.length - 1] === '' && ['+', '-'].indexOf(b) !== -1) {
  2555. a[a.length - 1] = b;
  2556. mergeWithPrevious = true;
  2557. return a;
  2558. } else if (mergeWithPrevious) {
  2559. a[a.length - 1] += b;
  2560. mergeWithPrevious = false;
  2561. return a;
  2562. } else {
  2563. return a.concat(b);
  2564. }
  2565. }, []) // Here we convert the string values into number values (in px)
  2566. .map(function (str) {
  2567. return toValue(str, measurement, popperOffsets, referenceOffsets);
  2568. });
  2569. }); // Loop trough the offsets arrays and execute the operations
  2570. ops.forEach(function (op, index) {
  2571. op.forEach(function (frag, index2) {
  2572. if (isNumeric(frag)) {
  2573. offsets[index] += frag * (op[index2 - 1] === '-' ? -1 : 1);
  2574. }
  2575. });
  2576. });
  2577. return offsets;
  2578. }
  2579. /**
  2580. * @function
  2581. * @memberof Modifiers
  2582. * @argument {Object} data - The data object generated by update method
  2583. * @argument {Object} options - Modifiers configuration and options
  2584. * @argument {Number|String} options.offset=0
  2585. * The offset value as described in the modifier description
  2586. * @returns {Object} The data object, properly modified
  2587. */
  2588. function offset(data, _ref) {
  2589. var offset = _ref.offset;
  2590. var placement = data.placement,
  2591. _data$offsets = data.offsets,
  2592. popper = _data$offsets.popper,
  2593. reference = _data$offsets.reference;
  2594. var basePlacement = placement.split('-')[0];
  2595. var offsets = void 0;
  2596. if (isNumeric(+offset)) {
  2597. offsets = [+offset, 0];
  2598. } else {
  2599. offsets = parseOffset(offset, popper, reference, basePlacement);
  2600. }
  2601. if (basePlacement === 'left') {
  2602. popper.top += offsets[0];
  2603. popper.left -= offsets[1];
  2604. } else if (basePlacement === 'right') {
  2605. popper.top += offsets[0];
  2606. popper.left += offsets[1];
  2607. } else if (basePlacement === 'top') {
  2608. popper.left += offsets[0];
  2609. popper.top -= offsets[1];
  2610. } else if (basePlacement === 'bottom') {
  2611. popper.left += offsets[0];
  2612. popper.top += offsets[1];
  2613. }
  2614. data.popper = popper;
  2615. return data;
  2616. }
  2617. /**
  2618. * @function
  2619. * @memberof Modifiers
  2620. * @argument {Object} data - The data object generated by `update` method
  2621. * @argument {Object} options - Modifiers configuration and options
  2622. * @returns {Object} The data object, properly modified
  2623. */
  2624. function preventOverflow(data, options) {
  2625. var boundariesElement = options.boundariesElement || getOffsetParent(data.instance.popper); // If offsetParent is the reference element, we really want to
  2626. // go one step up and use the next offsetParent as reference to
  2627. // avoid to make this modifier completely useless and look like broken
  2628. if (data.instance.reference === boundariesElement) {
  2629. boundariesElement = getOffsetParent(boundariesElement);
  2630. } // NOTE: DOM access here
  2631. // resets the popper's position so that the document size can be calculated excluding
  2632. // the size of the popper element itself
  2633. var transformProp = getSupportedPropertyName('transform');
  2634. var popperStyles = data.instance.popper.style; // assignment to help minification
  2635. var top = popperStyles.top,
  2636. left = popperStyles.left,
  2637. transform = popperStyles[transformProp];
  2638. popperStyles.top = '';
  2639. popperStyles.left = '';
  2640. popperStyles[transformProp] = '';
  2641. var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, boundariesElement, data.positionFixed); // NOTE: DOM access here
  2642. // restores the original style properties after the offsets have been computed
  2643. popperStyles.top = top;
  2644. popperStyles.left = left;
  2645. popperStyles[transformProp] = transform;
  2646. options.boundaries = boundaries;
  2647. var order = options.priority;
  2648. var popper = data.offsets.popper;
  2649. var check = {
  2650. primary: function primary(placement) {
  2651. var value = popper[placement];
  2652. if (popper[placement] < boundaries[placement] && !options.escapeWithReference) {
  2653. value = Math.max(popper[placement], boundaries[placement]);
  2654. }
  2655. return defineProperty({}, placement, value);
  2656. },
  2657. secondary: function secondary(placement) {
  2658. var mainSide = placement === 'right' ? 'left' : 'top';
  2659. var value = popper[mainSide];
  2660. if (popper[placement] > boundaries[placement] && !options.escapeWithReference) {
  2661. value = Math.min(popper[mainSide], boundaries[placement] - (placement === 'right' ? popper.width : popper.height));
  2662. }
  2663. return defineProperty({}, mainSide, value);
  2664. }
  2665. };
  2666. order.forEach(function (placement) {
  2667. var side = ['left', 'top'].indexOf(placement) !== -1 ? 'primary' : 'secondary';
  2668. popper = _extends$2({}, popper, check[side](placement));
  2669. });
  2670. data.offsets.popper = popper;
  2671. return data;
  2672. }
  2673. /**
  2674. * @function
  2675. * @memberof Modifiers
  2676. * @argument {Object} data - The data object generated by `update` method
  2677. * @argument {Object} options - Modifiers configuration and options
  2678. * @returns {Object} The data object, properly modified
  2679. */
  2680. function shift(data) {
  2681. var placement = data.placement;
  2682. var basePlacement = placement.split('-')[0];
  2683. var shiftvariation = placement.split('-')[1]; // if shift shiftvariation is specified, run the modifier
  2684. if (shiftvariation) {
  2685. var _data$offsets = data.offsets,
  2686. reference = _data$offsets.reference,
  2687. popper = _data$offsets.popper;
  2688. var isVertical = ['bottom', 'top'].indexOf(basePlacement) !== -1;
  2689. var side = isVertical ? 'left' : 'top';
  2690. var measurement = isVertical ? 'width' : 'height';
  2691. var shiftOffsets = {
  2692. start: defineProperty({}, side, reference[side]),
  2693. end: defineProperty({}, side, reference[side] + reference[measurement] - popper[measurement])
  2694. };
  2695. data.offsets.popper = _extends$2({}, popper, shiftOffsets[shiftvariation]);
  2696. }
  2697. return data;
  2698. }
  2699. /**
  2700. * @function
  2701. * @memberof Modifiers
  2702. * @argument {Object} data - The data object generated by update method
  2703. * @argument {Object} options - Modifiers configuration and options
  2704. * @returns {Object} The data object, properly modified
  2705. */
  2706. function hide(data) {
  2707. if (!isModifierRequired(data.instance.modifiers, 'hide', 'preventOverflow')) {
  2708. return data;
  2709. }
  2710. var refRect = data.offsets.reference;
  2711. var bound = find(data.instance.modifiers, function (modifier) {
  2712. return modifier.name === 'preventOverflow';
  2713. }).boundaries;
  2714. if (refRect.bottom < bound.top || refRect.left > bound.right || refRect.top > bound.bottom || refRect.right < bound.left) {
  2715. // Avoid unnecessary DOM access if visibility hasn't changed
  2716. if (data.hide === true) {
  2717. return data;
  2718. }
  2719. data.hide = true;
  2720. data.attributes['x-out-of-boundaries'] = '';
  2721. } else {
  2722. // Avoid unnecessary DOM access if visibility hasn't changed
  2723. if (data.hide === false) {
  2724. return data;
  2725. }
  2726. data.hide = false;
  2727. data.attributes['x-out-of-boundaries'] = false;
  2728. }
  2729. return data;
  2730. }
  2731. /**
  2732. * @function
  2733. * @memberof Modifiers
  2734. * @argument {Object} data - The data object generated by `update` method
  2735. * @argument {Object} options - Modifiers configuration and options
  2736. * @returns {Object} The data object, properly modified
  2737. */
  2738. function inner(data) {
  2739. var placement = data.placement;
  2740. var basePlacement = placement.split('-')[0];
  2741. var _data$offsets = data.offsets,
  2742. popper = _data$offsets.popper,
  2743. reference = _data$offsets.reference;
  2744. var isHoriz = ['left', 'right'].indexOf(basePlacement) !== -1;
  2745. var subtractLength = ['top', 'left'].indexOf(basePlacement) === -1;
  2746. popper[isHoriz ? 'left' : 'top'] = reference[basePlacement] - (subtractLength ? popper[isHoriz ? 'width' : 'height'] : 0);
  2747. data.placement = getOppositePlacement(placement);
  2748. data.offsets.popper = getClientRect(popper);
  2749. return data;
  2750. }
  2751. /**
  2752. * Modifier function, each modifier can have a function of this type assigned
  2753. * to its `fn` property.<br />
  2754. * These functions will be called on each update, this means that you must
  2755. * make sure they are performant enough to avoid performance bottlenecks.
  2756. *
  2757. * @function ModifierFn
  2758. * @argument {dataObject} data - The data object generated by `update` method
  2759. * @argument {Object} options - Modifiers configuration and options
  2760. * @returns {dataObject} The data object, properly modified
  2761. */
  2762. /**
  2763. * Modifiers are plugins used to alter the behavior of your poppers.<br />
  2764. * Popper.js uses a set of 9 modifiers to provide all the basic functionalities
  2765. * needed by the library.
  2766. *
  2767. * Usually you don't want to override the `order`, `fn` and `onLoad` props.
  2768. * All the other properties are configurations that could be tweaked.
  2769. * @namespace modifiers
  2770. */
  2771. var modifiers = {
  2772. /**
  2773. * Modifier used to shift the popper on the start or end of its reference
  2774. * element.<br />
  2775. * It will read the variation of the `placement` property.<br />
  2776. * It can be one either `-end` or `-start`.
  2777. * @memberof modifiers
  2778. * @inner
  2779. */
  2780. shift: {
  2781. /** @prop {number} order=100 - Index used to define the order of execution */
  2782. order: 100,
  2783. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  2784. enabled: true,
  2785. /** @prop {ModifierFn} */
  2786. fn: shift
  2787. },
  2788. /**
  2789. * The `offset` modifier can shift your popper on both its axis.
  2790. *
  2791. * It accepts the following units:
  2792. * - `px` or unit-less, interpreted as pixels
  2793. * - `%` or `%r`, percentage relative to the length of the reference element
  2794. * - `%p`, percentage relative to the length of the popper element
  2795. * - `vw`, CSS viewport width unit
  2796. * - `vh`, CSS viewport height unit
  2797. *
  2798. * For length is intended the main axis relative to the placement of the popper.<br />
  2799. * This means that if the placement is `top` or `bottom`, the length will be the
  2800. * `width`. In case of `left` or `right`, it will be the `height`.
  2801. *
  2802. * You can provide a single value (as `Number` or `String`), or a pair of values
  2803. * as `String` divided by a comma or one (or more) white spaces.<br />
  2804. * The latter is a deprecated method because it leads to confusion and will be
  2805. * removed in v2.<br />
  2806. * Additionally, it accepts additions and subtractions between different units.
  2807. * Note that multiplications and divisions aren't supported.
  2808. *
  2809. * Valid examples are:
  2810. * ```
  2811. * 10
  2812. * '10%'
  2813. * '10, 10'
  2814. * '10%, 10'
  2815. * '10 + 10%'
  2816. * '10 - 5vh + 3%'
  2817. * '-10px + 5vh, 5px - 6%'
  2818. * ```
  2819. * > **NB**: If you desire to apply offsets to your poppers in a way that may make them overlap
  2820. * > with their reference element, unfortunately, you will have to disable the `flip` modifier.
  2821. * > You can read more on this at this [issue](https://github.com/FezVrasta/popper.js/issues/373).
  2822. *
  2823. * @memberof modifiers
  2824. * @inner
  2825. */
  2826. offset: {
  2827. /** @prop {number} order=200 - Index used to define the order of execution */
  2828. order: 200,
  2829. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  2830. enabled: true,
  2831. /** @prop {ModifierFn} */
  2832. fn: offset,
  2833. /** @prop {Number|String} offset=0
  2834. * The offset value as described in the modifier description
  2835. */
  2836. offset: 0
  2837. },
  2838. /**
  2839. * Modifier used to prevent the popper from being positioned outside the boundary.
  2840. *
  2841. * A scenario exists where the reference itself is not within the boundaries.<br />
  2842. * We can say it has "escaped the boundaries" — or just "escaped".<br />
  2843. * In this case we need to decide whether the popper should either:
  2844. *
  2845. * - detach from the reference and remain "trapped" in the boundaries, or
  2846. * - if it should ignore the boundary and "escape with its reference"
  2847. *
  2848. * When `escapeWithReference` is set to`true` and reference is completely
  2849. * outside its boundaries, the popper will overflow (or completely leave)
  2850. * the boundaries in order to remain attached to the edge of the reference.
  2851. *
  2852. * @memberof modifiers
  2853. * @inner
  2854. */
  2855. preventOverflow: {
  2856. /** @prop {number} order=300 - Index used to define the order of execution */
  2857. order: 300,
  2858. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  2859. enabled: true,
  2860. /** @prop {ModifierFn} */
  2861. fn: preventOverflow,
  2862. /**
  2863. * @prop {Array} [priority=['left','right','top','bottom']]
  2864. * Popper will try to prevent overflow following these priorities by default,
  2865. * then, it could overflow on the left and on top of the `boundariesElement`
  2866. */
  2867. priority: ['left', 'right', 'top', 'bottom'],
  2868. /**
  2869. * @prop {number} padding=5
  2870. * Amount of pixel used to define a minimum distance between the boundaries
  2871. * and the popper. This makes sure the popper always has a little padding
  2872. * between the edges of its container
  2873. */
  2874. padding: 5,
  2875. /**
  2876. * @prop {String|HTMLElement} boundariesElement='scrollParent'
  2877. * Boundaries used by the modifier. Can be `scrollParent`, `window`,
  2878. * `viewport` or any DOM element.
  2879. */
  2880. boundariesElement: 'scrollParent'
  2881. },
  2882. /**
  2883. * Modifier used to make sure the reference and its popper stay near each other
  2884. * without leaving any gap between the two. Especially useful when the arrow is
  2885. * enabled and you want to ensure that it points to its reference element.
  2886. * It cares only about the first axis. You can still have poppers with margin
  2887. * between the popper and its reference element.
  2888. * @memberof modifiers
  2889. * @inner
  2890. */
  2891. keepTogether: {
  2892. /** @prop {number} order=400 - Index used to define the order of execution */
  2893. order: 400,
  2894. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  2895. enabled: true,
  2896. /** @prop {ModifierFn} */
  2897. fn: keepTogether
  2898. },
  2899. /**
  2900. * This modifier is used to move the `arrowElement` of the popper to make
  2901. * sure it is positioned between the reference element and its popper element.
  2902. * It will read the outer size of the `arrowElement` node to detect how many
  2903. * pixels of conjunction are needed.
  2904. *
  2905. * It has no effect if no `arrowElement` is provided.
  2906. * @memberof modifiers
  2907. * @inner
  2908. */
  2909. arrow: {
  2910. /** @prop {number} order=500 - Index used to define the order of execution */
  2911. order: 500,
  2912. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  2913. enabled: true,
  2914. /** @prop {ModifierFn} */
  2915. fn: arrow,
  2916. /** @prop {String|HTMLElement} element='[x-arrow]' - Selector or node used as arrow */
  2917. element: '[x-arrow]'
  2918. },
  2919. /**
  2920. * Modifier used to flip the popper's placement when it starts to overlap its
  2921. * reference element.
  2922. *
  2923. * Requires the `preventOverflow` modifier before it in order to work.
  2924. *
  2925. * **NOTE:** this modifier will interrupt the current update cycle and will
  2926. * restart it if it detects the need to flip the placement.
  2927. * @memberof modifiers
  2928. * @inner
  2929. */
  2930. flip: {
  2931. /** @prop {number} order=600 - Index used to define the order of execution */
  2932. order: 600,
  2933. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  2934. enabled: true,
  2935. /** @prop {ModifierFn} */
  2936. fn: flip,
  2937. /**
  2938. * @prop {String|Array} behavior='flip'
  2939. * The behavior used to change the popper's placement. It can be one of
  2940. * `flip`, `clockwise`, `counterclockwise` or an array with a list of valid
  2941. * placements (with optional variations)
  2942. */
  2943. behavior: 'flip',
  2944. /**
  2945. * @prop {number} padding=5
  2946. * The popper will flip if it hits the edges of the `boundariesElement`
  2947. */
  2948. padding: 5,
  2949. /**
  2950. * @prop {String|HTMLElement} boundariesElement='viewport'
  2951. * The element which will define the boundaries of the popper position.
  2952. * The popper will never be placed outside of the defined boundaries
  2953. * (except if `keepTogether` is enabled)
  2954. */
  2955. boundariesElement: 'viewport'
  2956. },
  2957. /**
  2958. * Modifier used to make the popper flow toward the inner of the reference element.
  2959. * By default, when this modifier is disabled, the popper will be placed outside
  2960. * the reference element.
  2961. * @memberof modifiers
  2962. * @inner
  2963. */
  2964. inner: {
  2965. /** @prop {number} order=700 - Index used to define the order of execution */
  2966. order: 700,
  2967. /** @prop {Boolean} enabled=false - Whether the modifier is enabled or not */
  2968. enabled: false,
  2969. /** @prop {ModifierFn} */
  2970. fn: inner
  2971. },
  2972. /**
  2973. * Modifier used to hide the popper when its reference element is outside of the
  2974. * popper boundaries. It will set a `x-out-of-boundaries` attribute which can
  2975. * be used to hide with a CSS selector the popper when its reference is
  2976. * out of boundaries.
  2977. *
  2978. * Requires the `preventOverflow` modifier before it in order to work.
  2979. * @memberof modifiers
  2980. * @inner
  2981. */
  2982. hide: {
  2983. /** @prop {number} order=800 - Index used to define the order of execution */
  2984. order: 800,
  2985. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  2986. enabled: true,
  2987. /** @prop {ModifierFn} */
  2988. fn: hide
  2989. },
  2990. /**
  2991. * Computes the style that will be applied to the popper element to gets
  2992. * properly positioned.
  2993. *
  2994. * Note that this modifier will not touch the DOM, it just prepares the styles
  2995. * so that `applyStyle` modifier can apply it. This separation is useful
  2996. * in case you need to replace `applyStyle` with a custom implementation.
  2997. *
  2998. * This modifier has `850` as `order` value to maintain backward compatibility
  2999. * with previous versions of Popper.js. Expect the modifiers ordering method
  3000. * to change in future major versions of the library.
  3001. *
  3002. * @memberof modifiers
  3003. * @inner
  3004. */
  3005. computeStyle: {
  3006. /** @prop {number} order=850 - Index used to define the order of execution */
  3007. order: 850,
  3008. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  3009. enabled: true,
  3010. /** @prop {ModifierFn} */
  3011. fn: computeStyle,
  3012. /**
  3013. * @prop {Boolean} gpuAcceleration=true
  3014. * If true, it uses the CSS 3D transformation to position the popper.
  3015. * Otherwise, it will use the `top` and `left` properties
  3016. */
  3017. gpuAcceleration: true,
  3018. /**
  3019. * @prop {string} [x='bottom']
  3020. * Where to anchor the X axis (`bottom` or `top`). AKA X offset origin.
  3021. * Change this if your popper should grow in a direction different from `bottom`
  3022. */
  3023. x: 'bottom',
  3024. /**
  3025. * @prop {string} [x='left']
  3026. * Where to anchor the Y axis (`left` or `right`). AKA Y offset origin.
  3027. * Change this if your popper should grow in a direction different from `right`
  3028. */
  3029. y: 'right'
  3030. },
  3031. /**
  3032. * Applies the computed styles to the popper element.
  3033. *
  3034. * All the DOM manipulations are limited to this modifier. This is useful in case
  3035. * you want to integrate Popper.js inside a framework or view library and you
  3036. * want to delegate all the DOM manipulations to it.
  3037. *
  3038. * Note that if you disable this modifier, you must make sure the popper element
  3039. * has its position set to `absolute` before Popper.js can do its work!
  3040. *
  3041. * Just disable this modifier and define your own to achieve the desired effect.
  3042. *
  3043. * @memberof modifiers
  3044. * @inner
  3045. */
  3046. applyStyle: {
  3047. /** @prop {number} order=900 - Index used to define the order of execution */
  3048. order: 900,
  3049. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  3050. enabled: true,
  3051. /** @prop {ModifierFn} */
  3052. fn: applyStyle,
  3053. /** @prop {Function} */
  3054. onLoad: applyStyleOnLoad,
  3055. /**
  3056. * @deprecated since version 1.10.0, the property moved to `computeStyle` modifier
  3057. * @prop {Boolean} gpuAcceleration=true
  3058. * If true, it uses the CSS 3D transformation to position the popper.
  3059. * Otherwise, it will use the `top` and `left` properties
  3060. */
  3061. gpuAcceleration: undefined
  3062. }
  3063. };
  3064. /**
  3065. * The `dataObject` is an object containing all the information used by Popper.js.
  3066. * This object is passed to modifiers and to the `onCreate` and `onUpdate` callbacks.
  3067. * @name dataObject
  3068. * @property {Object} data.instance The Popper.js instance
  3069. * @property {String} data.placement Placement applied to popper
  3070. * @property {String} data.originalPlacement Placement originally defined on init
  3071. * @property {Boolean} data.flipped True if popper has been flipped by flip modifier
  3072. * @property {Boolean} data.hide True if the reference element is out of boundaries, useful to know when to hide the popper
  3073. * @property {HTMLElement} data.arrowElement Node used as arrow by arrow modifier
  3074. * @property {Object} data.styles Any CSS property defined here will be applied to the popper. It expects the JavaScript nomenclature (eg. `marginBottom`)
  3075. * @property {Object} data.arrowStyles Any CSS property defined here will be applied to the popper arrow. It expects the JavaScript nomenclature (eg. `marginBottom`)
  3076. * @property {Object} data.boundaries Offsets of the popper boundaries
  3077. * @property {Object} data.offsets The measurements of popper, reference and arrow elements
  3078. * @property {Object} data.offsets.popper `top`, `left`, `width`, `height` values
  3079. * @property {Object} data.offsets.reference `top`, `left`, `width`, `height` values
  3080. * @property {Object} data.offsets.arrow] `top` and `left` offsets, only one of them will be different from 0
  3081. */
  3082. /**
  3083. * Default options provided to Popper.js constructor.<br />
  3084. * These can be overridden using the `options` argument of Popper.js.<br />
  3085. * To override an option, simply pass an object with the same
  3086. * structure of the `options` object, as the 3rd argument. For example:
  3087. * ```
  3088. * new Popper(ref, pop, {
  3089. * modifiers: {
  3090. * preventOverflow: { enabled: false }
  3091. * }
  3092. * })
  3093. * ```
  3094. * @type {Object}
  3095. * @static
  3096. * @memberof Popper
  3097. */
  3098. var Defaults = {
  3099. /**
  3100. * Popper's placement.
  3101. * @prop {Popper.placements} placement='bottom'
  3102. */
  3103. placement: 'bottom',
  3104. /**
  3105. * Set this to true if you want popper to position it self in 'fixed' mode
  3106. * @prop {Boolean} positionFixed=false
  3107. */
  3108. positionFixed: false,
  3109. /**
  3110. * Whether events (resize, scroll) are initially enabled.
  3111. * @prop {Boolean} eventsEnabled=true
  3112. */
  3113. eventsEnabled: true,
  3114. /**
  3115. * Set to true if you want to automatically remove the popper when
  3116. * you call the `destroy` method.
  3117. * @prop {Boolean} removeOnDestroy=false
  3118. */
  3119. removeOnDestroy: false,
  3120. /**
  3121. * Callback called when the popper is created.<br />
  3122. * By default, it is set to no-op.<br />
  3123. * Access Popper.js instance with `data.instance`.
  3124. * @prop {onCreate}
  3125. */
  3126. onCreate: function onCreate() {},
  3127. /**
  3128. * Callback called when the popper is updated. This callback is not called
  3129. * on the initialization/creation of the popper, but only on subsequent
  3130. * updates.<br />
  3131. * By default, it is set to no-op.<br />
  3132. * Access Popper.js instance with `data.instance`.
  3133. * @prop {onUpdate}
  3134. */
  3135. onUpdate: function onUpdate() {},
  3136. /**
  3137. * List of modifiers used to modify the offsets before they are applied to the popper.
  3138. * They provide most of the functionalities of Popper.js.
  3139. * @prop {modifiers}
  3140. */
  3141. modifiers: modifiers
  3142. };
  3143. /**
  3144. * @callback onCreate
  3145. * @param {dataObject} data
  3146. */
  3147. /**
  3148. * @callback onUpdate
  3149. * @param {dataObject} data
  3150. */
  3151. // Utils
  3152. // Methods
  3153. var Popper = function () {
  3154. /**
  3155. * Creates a new Popper.js instance.
  3156. * @class Popper
  3157. * @param {HTMLElement|referenceObject} reference - The reference element used to position the popper
  3158. * @param {HTMLElement} popper - The HTML element used as the popper
  3159. * @param {Object} options - Your custom options to override the ones defined in [Defaults](#defaults)
  3160. * @return {Object} instance - The generated Popper.js instance
  3161. */
  3162. function Popper(reference, popper) {
  3163. var _this = this;
  3164. var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  3165. classCallCheck(this, Popper);
  3166. this.scheduleUpdate = function () {
  3167. return requestAnimationFrame(_this.update);
  3168. }; // make update() debounced, so that it only runs at most once-per-tick
  3169. this.update = debounce(this.update.bind(this)); // with {} we create a new object with the options inside it
  3170. this.options = _extends$2({}, Popper.Defaults, options); // init state
  3171. this.state = {
  3172. isDestroyed: false,
  3173. isCreated: false,
  3174. scrollParents: []
  3175. }; // get reference and popper elements (allow jQuery wrappers)
  3176. this.reference = reference && reference.jquery ? reference[0] : reference;
  3177. this.popper = popper && popper.jquery ? popper[0] : popper; // Deep merge modifiers options
  3178. this.options.modifiers = {};
  3179. Object.keys(_extends$2({}, Popper.Defaults.modifiers, options.modifiers)).forEach(function (name) {
  3180. _this.options.modifiers[name] = _extends$2({}, Popper.Defaults.modifiers[name] || {}, options.modifiers ? options.modifiers[name] : {});
  3181. }); // Refactoring modifiers' list (Object => Array)
  3182. this.modifiers = Object.keys(this.options.modifiers).map(function (name) {
  3183. return _extends$2({
  3184. name: name
  3185. }, _this.options.modifiers[name]);
  3186. }) // sort the modifiers by order
  3187. .sort(function (a, b) {
  3188. return a.order - b.order;
  3189. }); // modifiers have the ability to execute arbitrary code when Popper.js get inited
  3190. // such code is executed in the same order of its modifier
  3191. // they could add new properties to their options configuration
  3192. // BE AWARE: don't add options to `options.modifiers.name` but to `modifierOptions`!
  3193. this.modifiers.forEach(function (modifierOptions) {
  3194. if (modifierOptions.enabled && isFunction$1(modifierOptions.onLoad)) {
  3195. modifierOptions.onLoad(_this.reference, _this.popper, _this.options, modifierOptions, _this.state);
  3196. }
  3197. }); // fire the first update to position the popper in the right place
  3198. this.update();
  3199. var eventsEnabled = this.options.eventsEnabled;
  3200. if (eventsEnabled) {
  3201. // setup event listeners, they will take care of update the position in specific situations
  3202. this.enableEventListeners();
  3203. }
  3204. this.state.eventsEnabled = eventsEnabled;
  3205. } // We can't use class properties because they don't get listed in the
  3206. // class prototype and break stuff like Sinon stubs
  3207. createClass(Popper, [{
  3208. key: 'update',
  3209. value: function update$$1() {
  3210. return update.call(this);
  3211. }
  3212. }, {
  3213. key: 'destroy',
  3214. value: function destroy$$1() {
  3215. return destroy.call(this);
  3216. }
  3217. }, {
  3218. key: 'enableEventListeners',
  3219. value: function enableEventListeners$$1() {
  3220. return enableEventListeners.call(this);
  3221. }
  3222. }, {
  3223. key: 'disableEventListeners',
  3224. value: function disableEventListeners$$1() {
  3225. return disableEventListeners.call(this);
  3226. }
  3227. /**
  3228. * Schedules an update. It will run on the next UI update available.
  3229. * @method scheduleUpdate
  3230. * @memberof Popper
  3231. */
  3232. /**
  3233. * Collection of utilities useful when writing custom modifiers.
  3234. * Starting from version 1.7, this method is available only if you
  3235. * include `popper-utils.js` before `popper.js`.
  3236. *
  3237. * **DEPRECATION**: This way to access PopperUtils is deprecated
  3238. * and will be removed in v2! Use the PopperUtils module directly instead.
  3239. * Due to the high instability of the methods contained in Utils, we can't
  3240. * guarantee them to follow semver. Use them at your own risk!
  3241. * @static
  3242. * @private
  3243. * @type {Object}
  3244. * @deprecated since version 1.8
  3245. * @member Utils
  3246. * @memberof Popper
  3247. */
  3248. }]);
  3249. return Popper;
  3250. }();
  3251. /**
  3252. * The `referenceObject` is an object that provides an interface compatible with Popper.js
  3253. * and lets you use it as replacement of a real DOM node.<br />
  3254. * You can use this method to position a popper relatively to a set of coordinates
  3255. * in case you don't have a DOM node to use as reference.
  3256. *
  3257. * ```
  3258. * new Popper(referenceObject, popperNode);
  3259. * ```
  3260. *
  3261. * NB: This feature isn't supported in Internet Explorer 10.
  3262. * @name referenceObject
  3263. * @property {Function} data.getBoundingClientRect
  3264. * A function that returns a set of coordinates compatible with the native `getBoundingClientRect` method.
  3265. * @property {number} data.clientWidth
  3266. * An ES6 getter that will return the width of the virtual reference element.
  3267. * @property {number} data.clientHeight
  3268. * An ES6 getter that will return the height of the virtual reference element.
  3269. */
  3270. Popper.Utils = (typeof window !== 'undefined' ? window : global).PopperUtils;
  3271. Popper.placements = placements;
  3272. Popper.Defaults = Defaults;
  3273. var _extends$3 = Object.assign || function (target) {
  3274. for (var i = 1; i < arguments.length; i++) {
  3275. var source = arguments[i];
  3276. for (var key in source) {
  3277. if (Object.prototype.hasOwnProperty.call(source, key)) {
  3278. target[key] = source[key];
  3279. }
  3280. }
  3281. }
  3282. return target;
  3283. };
  3284. var _createClass$2 = function () {
  3285. function defineProperties(target, props) {
  3286. for (var i = 0; i < props.length; i++) {
  3287. var descriptor = props[i];
  3288. descriptor.enumerable = descriptor.enumerable || false;
  3289. descriptor.configurable = true;
  3290. if ("value" in descriptor) descriptor.writable = true;
  3291. Object.defineProperty(target, descriptor.key, descriptor);
  3292. }
  3293. }
  3294. return function (Constructor, protoProps, staticProps) {
  3295. if (protoProps) defineProperties(Constructor.prototype, protoProps);
  3296. if (staticProps) defineProperties(Constructor, staticProps);
  3297. return Constructor;
  3298. };
  3299. }();
  3300. function _objectWithoutProperties$3(obj, keys) {
  3301. var target = {};
  3302. for (var i in obj) {
  3303. if (keys.indexOf(i) >= 0) continue;
  3304. if (!Object.prototype.hasOwnProperty.call(obj, i)) continue;
  3305. target[i] = obj[i];
  3306. }
  3307. return target;
  3308. }
  3309. function _classCallCheck$2(instance, Constructor) {
  3310. if (!(instance instanceof Constructor)) {
  3311. throw new TypeError("Cannot call a class as a function");
  3312. }
  3313. }
  3314. function _possibleConstructorReturn$2(self, call) {
  3315. if (!self) {
  3316. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  3317. }
  3318. return call && (typeof call === "object" || typeof call === "function") ? call : self;
  3319. }
  3320. function _inherits$2(subClass, superClass) {
  3321. if (typeof superClass !== "function" && superClass !== null) {
  3322. throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
  3323. }
  3324. subClass.prototype = Object.create(superClass && superClass.prototype, {
  3325. constructor: {
  3326. value: subClass,
  3327. enumerable: false,
  3328. writable: true,
  3329. configurable: true
  3330. }
  3331. });
  3332. if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
  3333. }
  3334. var placements$1 = Popper.placements;
  3335. var Popper$1 = function (_Component) {
  3336. _inherits$2(Popper$$1, _Component);
  3337. function Popper$$1() {
  3338. var _ref;
  3339. var _temp, _this, _ret;
  3340. _classCallCheck$2(this, Popper$$1);
  3341. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  3342. args[_key] = arguments[_key];
  3343. }
  3344. return _ret = (_temp = (_this = _possibleConstructorReturn$2(this, (_ref = Popper$$1.__proto__ || Object.getPrototypeOf(Popper$$1)).call.apply(_ref, [this].concat(args))), _this), _this.state = {}, _this._setArrowNode = function (node) {
  3345. _this._arrowNode = node;
  3346. }, _this._getTargetNode = function () {
  3347. if (_this.props.target) {
  3348. return _this.props.target;
  3349. } else if (!_this.context.popperManager || !_this.context.popperManager.getTargetNode()) {
  3350. throw new Error('Target missing. Popper must be given a target from the Popper Manager, or as a prop.');
  3351. }
  3352. return _this.context.popperManager.getTargetNode();
  3353. }, _this._getOffsets = function (data) {
  3354. return Object.keys(data.offsets).map(function (key) {
  3355. return data.offsets[key];
  3356. });
  3357. }, _this._isDataDirty = function (data) {
  3358. if (_this.state.data) {
  3359. return JSON.stringify(_this._getOffsets(_this.state.data)) !== JSON.stringify(_this._getOffsets(data));
  3360. } else {
  3361. return true;
  3362. }
  3363. }, _this._updateStateModifier = {
  3364. enabled: true,
  3365. order: 900,
  3366. fn: function fn(data) {
  3367. if (_this._isDataDirty(data)) {
  3368. _this.setState({
  3369. data: data
  3370. });
  3371. }
  3372. return data;
  3373. }
  3374. }, _this._getPopperStyle = function () {
  3375. var data = _this.state.data;
  3376. if (!_this._popper || !data) {
  3377. return {
  3378. position: 'absolute',
  3379. pointerEvents: 'none',
  3380. opacity: 0
  3381. };
  3382. }
  3383. return _extends$3({
  3384. position: data.offsets.popper.position
  3385. }, data.styles);
  3386. }, _this._getPopperPlacement = function () {
  3387. return _this.state.data ? _this.state.data.placement : undefined;
  3388. }, _this._getPopperHide = function () {
  3389. return !!_this.state.data && _this.state.data.hide ? '' : undefined;
  3390. }, _this._getArrowStyle = function () {
  3391. if (!_this.state.data || !_this.state.data.offsets.arrow) {
  3392. return {};
  3393. } else {
  3394. var _this$state$data$offs = _this.state.data.offsets.arrow,
  3395. top = _this$state$data$offs.top,
  3396. left = _this$state$data$offs.left;
  3397. return {
  3398. top: top,
  3399. left: left
  3400. };
  3401. }
  3402. }, _this._handlePopperRef = function (node) {
  3403. _this._popperNode = node;
  3404. if (node) {
  3405. _this._createPopper();
  3406. } else {
  3407. _this._destroyPopper();
  3408. }
  3409. if (_this.props.innerRef) {
  3410. _this.props.innerRef(node);
  3411. }
  3412. }, _this._scheduleUpdate = function () {
  3413. _this._popper && _this._popper.scheduleUpdate();
  3414. }, _temp), _possibleConstructorReturn$2(_this, _ret);
  3415. }
  3416. _createClass$2(Popper$$1, [{
  3417. key: 'getChildContext',
  3418. value: function getChildContext() {
  3419. return {
  3420. popper: {
  3421. setArrowNode: this._setArrowNode,
  3422. getArrowStyle: this._getArrowStyle
  3423. }
  3424. };
  3425. }
  3426. }, {
  3427. key: 'componentDidUpdate',
  3428. value: function componentDidUpdate(lastProps) {
  3429. if (lastProps.placement !== this.props.placement || lastProps.eventsEnabled !== this.props.eventsEnabled || lastProps.target !== this.props.target) {
  3430. this._destroyPopper();
  3431. this._createPopper();
  3432. }
  3433. if (lastProps.children !== this.props.children) {
  3434. this._scheduleUpdate();
  3435. }
  3436. }
  3437. }, {
  3438. key: 'componentWillUnmount',
  3439. value: function componentWillUnmount() {
  3440. this._destroyPopper();
  3441. }
  3442. }, {
  3443. key: '_createPopper',
  3444. value: function _createPopper() {
  3445. var _this2 = this;
  3446. var _props = this.props,
  3447. placement = _props.placement,
  3448. eventsEnabled = _props.eventsEnabled,
  3449. positionFixed = _props.positionFixed;
  3450. var modifiers = _extends$3({}, this.props.modifiers, {
  3451. applyStyle: {
  3452. enabled: false
  3453. },
  3454. updateState: this._updateStateModifier
  3455. });
  3456. if (this._arrowNode) {
  3457. modifiers.arrow = _extends$3({}, this.props.modifiers.arrow || {}, {
  3458. element: this._arrowNode
  3459. });
  3460. }
  3461. this._popper = new Popper(this._getTargetNode(), this._popperNode, {
  3462. placement: placement,
  3463. positionFixed: positionFixed,
  3464. eventsEnabled: eventsEnabled,
  3465. modifiers: modifiers
  3466. }); // TODO: look into setTimeout scheduleUpdate call, without it, the popper will not position properly on creation
  3467. setTimeout(function () {
  3468. return _this2._scheduleUpdate();
  3469. });
  3470. }
  3471. }, {
  3472. key: '_destroyPopper',
  3473. value: function _destroyPopper() {
  3474. if (this._popper) {
  3475. this._popper.destroy();
  3476. }
  3477. }
  3478. }, {
  3479. key: 'render',
  3480. value: function render() {
  3481. var _props2 = this.props,
  3482. component = _props2.component,
  3483. innerRef = _props2.innerRef,
  3484. placement = _props2.placement,
  3485. eventsEnabled = _props2.eventsEnabled,
  3486. positionFixed = _props2.positionFixed,
  3487. modifiers = _props2.modifiers,
  3488. children = _props2.children,
  3489. restProps = _objectWithoutProperties$3(_props2, ['component', 'innerRef', 'placement', 'eventsEnabled', 'positionFixed', 'modifiers', 'children']);
  3490. var popperStyle = this._getPopperStyle();
  3491. var popperPlacement = this._getPopperPlacement();
  3492. var popperHide = this._getPopperHide();
  3493. if (typeof children === 'function') {
  3494. var popperProps = {
  3495. ref: this._handlePopperRef,
  3496. style: popperStyle,
  3497. 'data-placement': popperPlacement,
  3498. 'data-x-out-of-boundaries': popperHide
  3499. };
  3500. return children({
  3501. popperProps: popperProps,
  3502. restProps: restProps,
  3503. scheduleUpdate: this._scheduleUpdate
  3504. });
  3505. }
  3506. var componentProps = _extends$3({}, restProps, {
  3507. style: _extends$3({}, restProps.style, popperStyle),
  3508. 'data-placement': popperPlacement,
  3509. 'data-x-out-of-boundaries': popperHide
  3510. });
  3511. if (typeof component === 'string') {
  3512. componentProps.ref = this._handlePopperRef;
  3513. } else {
  3514. componentProps.innerRef = this._handlePopperRef;
  3515. }
  3516. return React.createElement(component, componentProps, children);
  3517. }
  3518. }]);
  3519. return Popper$$1;
  3520. }(React.Component);
  3521. Popper$1.contextTypes = {
  3522. popperManager: propTypes.object
  3523. };
  3524. Popper$1.childContextTypes = {
  3525. popper: propTypes.object.isRequired
  3526. };
  3527. Popper$1.propTypes = {
  3528. component: propTypes.oneOfType([propTypes.node, propTypes.func]),
  3529. innerRef: propTypes.func,
  3530. placement: propTypes.oneOf(placements$1),
  3531. eventsEnabled: propTypes.bool,
  3532. positionFixed: propTypes.bool,
  3533. modifiers: propTypes.object,
  3534. children: propTypes.oneOfType([propTypes.node, propTypes.func]),
  3535. target: propTypes.oneOfType([// the following check is needed for SSR
  3536. propTypes.instanceOf(typeof Element !== 'undefined' ? Element : Object), propTypes.shape({
  3537. getBoundingClientRect: propTypes.func.isRequired,
  3538. clientWidth: propTypes.number.isRequired,
  3539. clientHeight: propTypes.number.isRequired
  3540. })])
  3541. };
  3542. Popper$1.defaultProps = {
  3543. component: 'div',
  3544. placement: 'bottom',
  3545. eventsEnabled: true,
  3546. positionFixed: false,
  3547. modifiers: {}
  3548. };
  3549. var _extends$4 = Object.assign || function (target) {
  3550. for (var i = 1; i < arguments.length; i++) {
  3551. var source = arguments[i];
  3552. for (var key in source) {
  3553. if (Object.prototype.hasOwnProperty.call(source, key)) {
  3554. target[key] = source[key];
  3555. }
  3556. }
  3557. }
  3558. return target;
  3559. };
  3560. function _objectWithoutProperties$4(obj, keys) {
  3561. var target = {};
  3562. for (var i in obj) {
  3563. if (keys.indexOf(i) >= 0) continue;
  3564. if (!Object.prototype.hasOwnProperty.call(obj, i)) continue;
  3565. target[i] = obj[i];
  3566. }
  3567. return target;
  3568. }
  3569. var Arrow = function Arrow(props, context) {
  3570. var _props$component = props.component,
  3571. component = _props$component === undefined ? 'span' : _props$component,
  3572. innerRef = props.innerRef,
  3573. children = props.children,
  3574. restProps = _objectWithoutProperties$4(props, ['component', 'innerRef', 'children']);
  3575. var popper = context.popper;
  3576. var arrowRef = function arrowRef(node) {
  3577. popper.setArrowNode(node);
  3578. if (typeof innerRef === 'function') {
  3579. innerRef(node);
  3580. }
  3581. };
  3582. var arrowStyle = popper.getArrowStyle();
  3583. if (typeof children === 'function') {
  3584. var arrowProps = {
  3585. ref: arrowRef,
  3586. style: arrowStyle
  3587. };
  3588. return children({
  3589. arrowProps: arrowProps,
  3590. restProps: restProps
  3591. });
  3592. }
  3593. var componentProps = _extends$4({}, restProps, {
  3594. style: _extends$4({}, arrowStyle, restProps.style)
  3595. });
  3596. if (typeof component === 'string') {
  3597. componentProps.ref = arrowRef;
  3598. } else {
  3599. componentProps.innerRef = arrowRef;
  3600. }
  3601. return React.createElement(component, componentProps, children);
  3602. };
  3603. Arrow.contextTypes = {
  3604. popper: propTypes.object.isRequired
  3605. };
  3606. Arrow.propTypes = {
  3607. component: propTypes.oneOfType([propTypes.node, propTypes.func]),
  3608. innerRef: propTypes.func,
  3609. children: propTypes.oneOfType([propTypes.node, propTypes.func])
  3610. };
  3611. var propTypes$9 = {
  3612. disabled: propTypes.bool,
  3613. dropup: deprecated(propTypes.bool, 'Please use the prop "direction" with the value "up".'),
  3614. direction: propTypes.oneOf(['up', 'down', 'left', 'right']),
  3615. group: propTypes.bool,
  3616. isOpen: propTypes.bool,
  3617. nav: propTypes.bool,
  3618. active: propTypes.bool,
  3619. addonType: propTypes.oneOfType([propTypes.bool, propTypes.oneOf(['prepend', 'append'])]),
  3620. size: propTypes.string,
  3621. tag: tagPropType,
  3622. toggle: propTypes.func,
  3623. children: propTypes.node,
  3624. className: propTypes.string,
  3625. cssModule: propTypes.object,
  3626. inNavbar: propTypes.bool,
  3627. setActiveFromChild: propTypes.bool
  3628. };
  3629. var defaultProps$8 = {
  3630. isOpen: false,
  3631. direction: 'down',
  3632. nav: false,
  3633. active: false,
  3634. addonType: false,
  3635. inNavbar: false,
  3636. setActiveFromChild: false
  3637. };
  3638. var childContextTypes = {
  3639. toggle: propTypes.func.isRequired,
  3640. isOpen: propTypes.bool.isRequired,
  3641. direction: propTypes.oneOf(['up', 'down', 'left', 'right']).isRequired,
  3642. inNavbar: propTypes.bool.isRequired
  3643. };
  3644. var Dropdown =
  3645. /*#__PURE__*/
  3646. function (_React$Component) {
  3647. _inheritsLoose(Dropdown, _React$Component);
  3648. function Dropdown(props) {
  3649. var _this;
  3650. _this = _React$Component.call(this, props) || this;
  3651. _this.addEvents = _this.addEvents.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  3652. _this.handleDocumentClick = _this.handleDocumentClick.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  3653. _this.handleKeyDown = _this.handleKeyDown.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  3654. _this.removeEvents = _this.removeEvents.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  3655. _this.toggle = _this.toggle.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  3656. return _this;
  3657. }
  3658. var _proto = Dropdown.prototype;
  3659. _proto.getChildContext = function getChildContext() {
  3660. return {
  3661. toggle: this.props.toggle,
  3662. isOpen: this.props.isOpen,
  3663. direction: this.props.direction === 'down' && this.props.dropup ? 'up' : this.props.direction,
  3664. inNavbar: this.props.inNavbar
  3665. };
  3666. };
  3667. _proto.componentDidMount = function componentDidMount() {
  3668. this.handleProps();
  3669. };
  3670. _proto.componentDidUpdate = function componentDidUpdate(prevProps) {
  3671. if (this.props.isOpen !== prevProps.isOpen) {
  3672. this.handleProps();
  3673. }
  3674. };
  3675. _proto.componentWillUnmount = function componentWillUnmount() {
  3676. this.removeEvents();
  3677. };
  3678. _proto.getContainer = function getContainer() {
  3679. if (this._$container) return this._$container;
  3680. this._$container = ReactDOM.findDOMNode(this);
  3681. return ReactDOM.findDOMNode(this);
  3682. };
  3683. _proto.getMenuCtrl = function getMenuCtrl() {
  3684. if (this._$menuCtrl) return this._$menuCtrl;
  3685. this._$menuCtrl = this.getContainer().querySelector('[aria-expanded]');
  3686. return this._$menuCtrl;
  3687. };
  3688. _proto.getMenuItems = function getMenuItems() {
  3689. return [].slice.call(this.getContainer().querySelectorAll('[role="menuitem"]'));
  3690. };
  3691. _proto.addEvents = function addEvents() {
  3692. var _this2 = this;
  3693. ['click', 'touchstart', 'keyup'].forEach(function (event) {
  3694. return document.addEventListener(event, _this2.handleDocumentClick, true);
  3695. });
  3696. };
  3697. _proto.removeEvents = function removeEvents() {
  3698. var _this3 = this;
  3699. ['click', 'touchstart', 'keyup'].forEach(function (event) {
  3700. return document.removeEventListener(event, _this3.handleDocumentClick, true);
  3701. });
  3702. };
  3703. _proto.handleDocumentClick = function handleDocumentClick(e) {
  3704. if (e && (e.which === 3 || e.type === 'keyup' && e.which !== keyCodes.tab)) return;
  3705. var container = this.getContainer();
  3706. if (container.contains(e.target) && container !== e.target && (e.type !== 'keyup' || e.which === keyCodes.tab)) {
  3707. return;
  3708. }
  3709. this.toggle(e);
  3710. };
  3711. _proto.handleKeyDown = function handleKeyDown(e) {
  3712. var _this4 = this;
  3713. if (/input|textarea/i.test(e.target.tagName) || keyCodes.tab === e.which && e.target.getAttribute('role') !== 'menuitem') {
  3714. return;
  3715. }
  3716. e.preventDefault();
  3717. if (this.props.disabled) return;
  3718. if (this.getMenuCtrl() === e.target) {
  3719. if (!this.props.isOpen && [keyCodes.space, keyCodes.enter, keyCodes.up, keyCodes.down].indexOf(e.which) > -1) {
  3720. this.toggle(e);
  3721. setTimeout(function () {
  3722. return _this4.getMenuItems()[0].focus();
  3723. });
  3724. }
  3725. }
  3726. if (this.props.isOpen && e.target.getAttribute('role') === 'menuitem') {
  3727. if ([keyCodes.tab, keyCodes.esc].indexOf(e.which) > -1) {
  3728. this.toggle(e);
  3729. this.getMenuCtrl().focus();
  3730. } else if ([keyCodes.space, keyCodes.enter].indexOf(e.which) > -1) {
  3731. e.target.click();
  3732. this.getMenuCtrl().focus();
  3733. } else if ([keyCodes.down, keyCodes.up].indexOf(e.which) > -1 || [keyCodes.n, keyCodes.p].indexOf(e.which) > -1 && e.ctrlKey) {
  3734. var $menuitems = this.getMenuItems();
  3735. var index = $menuitems.indexOf(e.target);
  3736. if (keyCodes.up === e.which || keyCodes.p === e.which && e.ctrlKey) {
  3737. index = index !== 0 ? index - 1 : $menuitems.length - 1;
  3738. } else if (keyCodes.down === e.which || keyCodes.n === e.which && e.ctrlKey) {
  3739. index = index === $menuitems.length - 1 ? 0 : index + 1;
  3740. }
  3741. $menuitems[index].focus();
  3742. } else if (keyCodes.end === e.which) {
  3743. var _$menuitems = this.getMenuItems();
  3744. _$menuitems[_$menuitems.length - 1].focus();
  3745. } else if (keyCodes.home === e.which) {
  3746. var _$menuitems2 = this.getMenuItems();
  3747. _$menuitems2[0].focus();
  3748. } else if (e.which >= 48 && e.which <= 90) {
  3749. var _$menuitems3 = this.getMenuItems();
  3750. var charPressed = String.fromCharCode(e.which).toLowerCase();
  3751. for (var i = 0; i < _$menuitems3.length; i += 1) {
  3752. var firstLetter = _$menuitems3[i].textContent && _$menuitems3[i].textContent[0].toLowerCase();
  3753. if (firstLetter === charPressed) {
  3754. _$menuitems3[i].focus();
  3755. break;
  3756. }
  3757. }
  3758. }
  3759. }
  3760. };
  3761. _proto.handleProps = function handleProps() {
  3762. if (this.props.isOpen) {
  3763. this.addEvents();
  3764. } else {
  3765. this.removeEvents();
  3766. }
  3767. };
  3768. _proto.toggle = function toggle(e) {
  3769. if (this.props.disabled) {
  3770. return e && e.preventDefault();
  3771. }
  3772. return this.props.toggle(e);
  3773. };
  3774. _proto.render = function render() {
  3775. var _classNames;
  3776. var _omit = omit(this.props, ['toggle', 'disabled', 'inNavbar', 'direction']),
  3777. className = _omit.className,
  3778. cssModule = _omit.cssModule,
  3779. dropup = _omit.dropup,
  3780. isOpen = _omit.isOpen,
  3781. group = _omit.group,
  3782. size = _omit.size,
  3783. nav = _omit.nav,
  3784. setActiveFromChild = _omit.setActiveFromChild,
  3785. active = _omit.active,
  3786. addonType = _omit.addonType,
  3787. attrs = _objectWithoutPropertiesLoose(_omit, ["className", "cssModule", "dropup", "isOpen", "group", "size", "nav", "setActiveFromChild", "active", "addonType"]);
  3788. var direction = this.props.direction === 'down' && dropup ? 'up' : this.props.direction;
  3789. attrs.tag = attrs.tag || (nav ? 'li' : 'div');
  3790. var subItemIsActive = false;
  3791. if (setActiveFromChild) {
  3792. React__default.Children.map(this.props.children[1].props.children, function (dropdownItem) {
  3793. if (dropdownItem && dropdownItem.props.active) subItemIsActive = true;
  3794. });
  3795. }
  3796. var classes = mapToCssModules(classnames(className, direction !== 'down' && "drop" + direction, nav && active ? 'active' : false, setActiveFromChild && subItemIsActive ? 'active' : false, (_classNames = {}, _classNames["input-group-" + addonType] = addonType, _classNames['btn-group'] = group, _classNames["btn-group-" + size] = !!size, _classNames.dropdown = !group && !addonType, _classNames.show = isOpen, _classNames['nav-item'] = nav, _classNames)), cssModule);
  3797. return React__default.createElement(Manager, _extends({}, attrs, {
  3798. className: classes,
  3799. onKeyDown: this.handleKeyDown
  3800. }));
  3801. };
  3802. return Dropdown;
  3803. }(React__default.Component);
  3804. Dropdown.propTypes = propTypes$9;
  3805. Dropdown.defaultProps = defaultProps$8;
  3806. Dropdown.childContextTypes = childContextTypes;
  3807. function NavDropdown(props) {
  3808. warnOnce('The "NavDropdown" component has been deprecated.\nPlease use component "Dropdown" with nav prop.');
  3809. return React__default.createElement(Dropdown, _extends({
  3810. nav: true
  3811. }, props));
  3812. }
  3813. var propTypes$a = {
  3814. tag: tagPropType,
  3815. innerRef: propTypes.oneOfType([propTypes.object, propTypes.func, propTypes.string]),
  3816. disabled: propTypes.bool,
  3817. active: propTypes.bool,
  3818. className: propTypes.string,
  3819. cssModule: propTypes.object,
  3820. onClick: propTypes.func,
  3821. href: propTypes.any
  3822. };
  3823. var defaultProps$9 = {
  3824. tag: 'a'
  3825. };
  3826. var NavLink =
  3827. /*#__PURE__*/
  3828. function (_React$Component) {
  3829. _inheritsLoose(NavLink, _React$Component);
  3830. function NavLink(props) {
  3831. var _this;
  3832. _this = _React$Component.call(this, props) || this;
  3833. _this.onClick = _this.onClick.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  3834. return _this;
  3835. }
  3836. var _proto = NavLink.prototype;
  3837. _proto.onClick = function onClick(e) {
  3838. if (this.props.disabled) {
  3839. e.preventDefault();
  3840. return;
  3841. }
  3842. if (this.props.href === '#') {
  3843. e.preventDefault();
  3844. }
  3845. if (this.props.onClick) {
  3846. this.props.onClick(e);
  3847. }
  3848. };
  3849. _proto.render = function render() {
  3850. var _this$props = this.props,
  3851. className = _this$props.className,
  3852. cssModule = _this$props.cssModule,
  3853. active = _this$props.active,
  3854. Tag = _this$props.tag,
  3855. innerRef = _this$props.innerRef,
  3856. attributes = _objectWithoutPropertiesLoose(_this$props, ["className", "cssModule", "active", "tag", "innerRef"]);
  3857. var classes = mapToCssModules(classnames(className, 'nav-link', {
  3858. disabled: attributes.disabled,
  3859. active: active
  3860. }), cssModule);
  3861. return React__default.createElement(Tag, _extends({}, attributes, {
  3862. ref: innerRef,
  3863. onClick: this.onClick,
  3864. className: classes
  3865. }));
  3866. };
  3867. return NavLink;
  3868. }(React__default.Component);
  3869. NavLink.propTypes = propTypes$a;
  3870. NavLink.defaultProps = defaultProps$9;
  3871. var propTypes$b = {
  3872. tag: tagPropType,
  3873. listTag: tagPropType,
  3874. className: propTypes.string,
  3875. listClassName: propTypes.string,
  3876. cssModule: propTypes.object,
  3877. children: propTypes.node,
  3878. 'aria-label': propTypes.string
  3879. };
  3880. var defaultProps$a = {
  3881. tag: 'nav',
  3882. listTag: 'ol',
  3883. 'aria-label': 'breadcrumb'
  3884. };
  3885. var Breadcrumb = function Breadcrumb(props) {
  3886. var className = props.className,
  3887. listClassName = props.listClassName,
  3888. cssModule = props.cssModule,
  3889. children = props.children,
  3890. Tag = props.tag,
  3891. ListTag = props.listTag,
  3892. label = props['aria-label'],
  3893. attributes = _objectWithoutPropertiesLoose(props, ["className", "listClassName", "cssModule", "children", "tag", "listTag", "aria-label"]);
  3894. var classes = mapToCssModules(classnames(className), cssModule);
  3895. var listClasses = mapToCssModules(classnames('breadcrumb', listClassName), cssModule);
  3896. return React__default.createElement(Tag, _extends({}, attributes, {
  3897. className: classes,
  3898. "aria-label": label
  3899. }), React__default.createElement(ListTag, {
  3900. className: listClasses
  3901. }, children));
  3902. };
  3903. Breadcrumb.propTypes = propTypes$b;
  3904. Breadcrumb.defaultProps = defaultProps$a;
  3905. var propTypes$c = {
  3906. tag: tagPropType,
  3907. active: propTypes.bool,
  3908. className: propTypes.string,
  3909. cssModule: propTypes.object
  3910. };
  3911. var defaultProps$b = {
  3912. tag: 'li'
  3913. };
  3914. var BreadcrumbItem = function BreadcrumbItem(props) {
  3915. var className = props.className,
  3916. cssModule = props.cssModule,
  3917. active = props.active,
  3918. Tag = props.tag,
  3919. attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "active", "tag"]);
  3920. var classes = mapToCssModules(classnames(className, active ? 'active' : false, 'breadcrumb-item'), cssModule);
  3921. return React__default.createElement(Tag, _extends({}, attributes, {
  3922. className: classes,
  3923. "aria-current": active ? 'page' : undefined
  3924. }));
  3925. };
  3926. BreadcrumbItem.propTypes = propTypes$c;
  3927. BreadcrumbItem.defaultProps = defaultProps$b;
  3928. var propTypes$d = {
  3929. active: propTypes.bool,
  3930. 'aria-label': propTypes.string,
  3931. block: propTypes.bool,
  3932. color: propTypes.string,
  3933. disabled: propTypes.bool,
  3934. outline: propTypes.bool,
  3935. tag: tagPropType,
  3936. innerRef: propTypes.oneOfType([propTypes.object, propTypes.func, propTypes.string]),
  3937. onClick: propTypes.func,
  3938. size: propTypes.string,
  3939. children: propTypes.node,
  3940. className: propTypes.string,
  3941. cssModule: propTypes.object,
  3942. close: propTypes.bool
  3943. };
  3944. var defaultProps$c = {
  3945. color: 'secondary',
  3946. tag: 'button'
  3947. };
  3948. var Button =
  3949. /*#__PURE__*/
  3950. function (_React$Component) {
  3951. _inheritsLoose(Button, _React$Component);
  3952. function Button(props) {
  3953. var _this;
  3954. _this = _React$Component.call(this, props) || this;
  3955. _this.onClick = _this.onClick.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  3956. return _this;
  3957. }
  3958. var _proto = Button.prototype;
  3959. _proto.onClick = function onClick(e) {
  3960. if (this.props.disabled) {
  3961. e.preventDefault();
  3962. return;
  3963. }
  3964. if (this.props.onClick) {
  3965. this.props.onClick(e);
  3966. }
  3967. };
  3968. _proto.render = function render() {
  3969. var _this$props = this.props,
  3970. active = _this$props.active,
  3971. ariaLabel = _this$props['aria-label'],
  3972. block = _this$props.block,
  3973. className = _this$props.className,
  3974. close = _this$props.close,
  3975. cssModule = _this$props.cssModule,
  3976. color = _this$props.color,
  3977. outline = _this$props.outline,
  3978. size = _this$props.size,
  3979. Tag = _this$props.tag,
  3980. innerRef = _this$props.innerRef,
  3981. attributes = _objectWithoutPropertiesLoose(_this$props, ["active", "aria-label", "block", "className", "close", "cssModule", "color", "outline", "size", "tag", "innerRef"]);
  3982. if (close && typeof attributes.children === 'undefined') {
  3983. attributes.children = React__default.createElement("span", {
  3984. "aria-hidden": true
  3985. }, "\xD7");
  3986. }
  3987. var btnOutlineColor = "btn" + (outline ? '-outline' : '') + "-" + color;
  3988. var classes = mapToCssModules(classnames(className, {
  3989. close: close
  3990. }, close || 'btn', close || btnOutlineColor, size ? "btn-" + size : false, block ? 'btn-block' : false, {
  3991. active: active,
  3992. disabled: this.props.disabled
  3993. }), cssModule);
  3994. if (attributes.href && Tag === 'button') {
  3995. Tag = 'a';
  3996. }
  3997. var defaultAriaLabel = close ? 'Close' : null;
  3998. return React__default.createElement(Tag, _extends({
  3999. type: Tag === 'button' && attributes.onClick ? 'button' : undefined
  4000. }, attributes, {
  4001. className: classes,
  4002. ref: innerRef,
  4003. onClick: this.onClick,
  4004. "aria-label": ariaLabel || defaultAriaLabel
  4005. }));
  4006. };
  4007. return Button;
  4008. }(React__default.Component);
  4009. Button.propTypes = propTypes$d;
  4010. Button.defaultProps = defaultProps$c;
  4011. var propTypes$e = {
  4012. children: propTypes.node
  4013. };
  4014. var ButtonDropdown = function ButtonDropdown(props) {
  4015. return React__default.createElement(Dropdown, _extends({
  4016. group: true
  4017. }, props));
  4018. };
  4019. ButtonDropdown.propTypes = propTypes$e;
  4020. var propTypes$f = {
  4021. tag: tagPropType,
  4022. 'aria-label': propTypes.string,
  4023. className: propTypes.string,
  4024. cssModule: propTypes.object,
  4025. role: propTypes.string,
  4026. size: propTypes.string,
  4027. vertical: propTypes.bool
  4028. };
  4029. var defaultProps$d = {
  4030. tag: 'div',
  4031. role: 'group'
  4032. };
  4033. var ButtonGroup = function ButtonGroup(props) {
  4034. var className = props.className,
  4035. cssModule = props.cssModule,
  4036. size = props.size,
  4037. vertical = props.vertical,
  4038. Tag = props.tag,
  4039. attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "size", "vertical", "tag"]);
  4040. var classes = mapToCssModules(classnames(className, size ? 'btn-group-' + size : false, vertical ? 'btn-group-vertical' : 'btn-group'), cssModule);
  4041. return React__default.createElement(Tag, _extends({}, attributes, {
  4042. className: classes
  4043. }));
  4044. };
  4045. ButtonGroup.propTypes = propTypes$f;
  4046. ButtonGroup.defaultProps = defaultProps$d;
  4047. var propTypes$g = {
  4048. tag: tagPropType,
  4049. 'aria-label': propTypes.string,
  4050. className: propTypes.string,
  4051. cssModule: propTypes.object,
  4052. role: propTypes.string
  4053. };
  4054. var defaultProps$e = {
  4055. tag: 'div',
  4056. role: 'toolbar'
  4057. };
  4058. var ButtonToolbar = function ButtonToolbar(props) {
  4059. var className = props.className,
  4060. cssModule = props.cssModule,
  4061. Tag = props.tag,
  4062. attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
  4063. var classes = mapToCssModules(classnames(className, 'btn-toolbar'), cssModule);
  4064. return React__default.createElement(Tag, _extends({}, attributes, {
  4065. className: classes
  4066. }));
  4067. };
  4068. ButtonToolbar.propTypes = propTypes$g;
  4069. ButtonToolbar.defaultProps = defaultProps$e;
  4070. var propTypes$h = {
  4071. children: propTypes.node,
  4072. active: propTypes.bool,
  4073. disabled: propTypes.bool,
  4074. divider: propTypes.bool,
  4075. tag: tagPropType,
  4076. header: propTypes.bool,
  4077. onClick: propTypes.func,
  4078. className: propTypes.string,
  4079. cssModule: propTypes.object,
  4080. toggle: propTypes.bool
  4081. };
  4082. var contextTypes = {
  4083. toggle: propTypes.func
  4084. };
  4085. var defaultProps$f = {
  4086. tag: 'button',
  4087. toggle: true
  4088. };
  4089. var DropdownItem =
  4090. /*#__PURE__*/
  4091. function (_React$Component) {
  4092. _inheritsLoose(DropdownItem, _React$Component);
  4093. function DropdownItem(props) {
  4094. var _this;
  4095. _this = _React$Component.call(this, props) || this;
  4096. _this.onClick = _this.onClick.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  4097. _this.getTabIndex = _this.getTabIndex.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  4098. return _this;
  4099. }
  4100. var _proto = DropdownItem.prototype;
  4101. _proto.onClick = function onClick(e) {
  4102. if (this.props.disabled || this.props.header || this.props.divider) {
  4103. e.preventDefault();
  4104. return;
  4105. }
  4106. if (this.props.onClick) {
  4107. this.props.onClick(e);
  4108. }
  4109. if (this.props.toggle) {
  4110. this.context.toggle(e);
  4111. }
  4112. };
  4113. _proto.getTabIndex = function getTabIndex() {
  4114. if (this.props.disabled || this.props.header || this.props.divider) {
  4115. return '-1';
  4116. }
  4117. return '0';
  4118. };
  4119. _proto.render = function render() {
  4120. var tabIndex = this.getTabIndex();
  4121. var role = tabIndex > -1 ? 'menuitem' : undefined;
  4122. var _omit = omit(this.props, ['toggle']),
  4123. className = _omit.className,
  4124. cssModule = _omit.cssModule,
  4125. divider = _omit.divider,
  4126. Tag = _omit.tag,
  4127. header = _omit.header,
  4128. active = _omit.active,
  4129. props = _objectWithoutPropertiesLoose(_omit, ["className", "cssModule", "divider", "tag", "header", "active"]);
  4130. var classes = mapToCssModules(classnames(className, {
  4131. disabled: props.disabled,
  4132. 'dropdown-item': !divider && !header,
  4133. active: active,
  4134. 'dropdown-header': header,
  4135. 'dropdown-divider': divider
  4136. }), cssModule);
  4137. if (Tag === 'button') {
  4138. if (header) {
  4139. Tag = 'h6';
  4140. } else if (divider) {
  4141. Tag = 'div';
  4142. } else if (props.href) {
  4143. Tag = 'a';
  4144. }
  4145. }
  4146. return React__default.createElement(Tag, _extends({
  4147. type: Tag === 'button' && (props.onClick || this.props.toggle) ? 'button' : undefined
  4148. }, props, {
  4149. tabIndex: tabIndex,
  4150. role: role,
  4151. className: classes,
  4152. onClick: this.onClick
  4153. }));
  4154. };
  4155. return DropdownItem;
  4156. }(React__default.Component);
  4157. DropdownItem.propTypes = propTypes$h;
  4158. DropdownItem.defaultProps = defaultProps$f;
  4159. DropdownItem.contextTypes = contextTypes;
  4160. var propTypes$i = {
  4161. tag: tagPropType,
  4162. children: propTypes.node.isRequired,
  4163. right: propTypes.bool,
  4164. flip: propTypes.bool,
  4165. modifiers: propTypes.object,
  4166. className: propTypes.string,
  4167. cssModule: propTypes.object,
  4168. persist: propTypes.bool
  4169. };
  4170. var defaultProps$g = {
  4171. tag: 'div',
  4172. flip: true
  4173. };
  4174. var contextTypes$1 = {
  4175. isOpen: propTypes.bool.isRequired,
  4176. direction: propTypes.oneOf(['up', 'down', 'left', 'right']).isRequired,
  4177. inNavbar: propTypes.bool.isRequired
  4178. };
  4179. var noFlipModifier = {
  4180. flip: {
  4181. enabled: false
  4182. }
  4183. };
  4184. var directionPositionMap = {
  4185. up: 'top',
  4186. left: 'left',
  4187. right: 'right',
  4188. down: 'bottom'
  4189. };
  4190. var DropdownMenu = function DropdownMenu(props, context) {
  4191. var className = props.className,
  4192. cssModule = props.cssModule,
  4193. right = props.right,
  4194. tag = props.tag,
  4195. flip = props.flip,
  4196. modifiers = props.modifiers,
  4197. persist = props.persist,
  4198. attrs = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "right", "tag", "flip", "modifiers", "persist"]);
  4199. var classes = mapToCssModules(classnames(className, 'dropdown-menu', {
  4200. 'dropdown-menu-right': right,
  4201. show: context.isOpen
  4202. }), cssModule);
  4203. var Tag = tag;
  4204. if (persist || context.isOpen && !context.inNavbar) {
  4205. Tag = Popper$1;
  4206. var position1 = directionPositionMap[context.direction] || 'bottom';
  4207. var position2 = right ? 'end' : 'start';
  4208. attrs.placement = position1 + "-" + position2;
  4209. attrs.component = tag;
  4210. attrs.modifiers = !flip ? _extends({}, modifiers, noFlipModifier) : modifiers;
  4211. }
  4212. return React__default.createElement(Tag, _extends({
  4213. tabIndex: "-1",
  4214. role: "menu"
  4215. }, attrs, {
  4216. "aria-hidden": !context.isOpen,
  4217. className: classes,
  4218. "x-placement": attrs.placement
  4219. }));
  4220. };
  4221. DropdownMenu.propTypes = propTypes$i;
  4222. DropdownMenu.defaultProps = defaultProps$g;
  4223. DropdownMenu.contextTypes = contextTypes$1;
  4224. var propTypes$j = {
  4225. caret: propTypes.bool,
  4226. color: propTypes.string,
  4227. children: propTypes.node,
  4228. className: propTypes.string,
  4229. cssModule: propTypes.object,
  4230. disabled: propTypes.bool,
  4231. onClick: propTypes.func,
  4232. 'aria-haspopup': propTypes.bool,
  4233. split: propTypes.bool,
  4234. tag: tagPropType,
  4235. nav: propTypes.bool
  4236. };
  4237. var defaultProps$h = {
  4238. 'aria-haspopup': true,
  4239. color: 'secondary'
  4240. };
  4241. var contextTypes$2 = {
  4242. isOpen: propTypes.bool.isRequired,
  4243. toggle: propTypes.func.isRequired,
  4244. inNavbar: propTypes.bool.isRequired
  4245. };
  4246. var DropdownToggle =
  4247. /*#__PURE__*/
  4248. function (_React$Component) {
  4249. _inheritsLoose(DropdownToggle, _React$Component);
  4250. function DropdownToggle(props) {
  4251. var _this;
  4252. _this = _React$Component.call(this, props) || this;
  4253. _this.onClick = _this.onClick.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  4254. return _this;
  4255. }
  4256. var _proto = DropdownToggle.prototype;
  4257. _proto.onClick = function onClick(e) {
  4258. if (this.props.disabled) {
  4259. e.preventDefault();
  4260. return;
  4261. }
  4262. if (this.props.nav && !this.props.tag) {
  4263. e.preventDefault();
  4264. }
  4265. if (this.props.onClick) {
  4266. this.props.onClick(e);
  4267. }
  4268. this.context.toggle(e);
  4269. };
  4270. _proto.render = function render() {
  4271. var _this$props = this.props,
  4272. className = _this$props.className,
  4273. color = _this$props.color,
  4274. cssModule = _this$props.cssModule,
  4275. caret = _this$props.caret,
  4276. split = _this$props.split,
  4277. nav = _this$props.nav,
  4278. tag = _this$props.tag,
  4279. props = _objectWithoutPropertiesLoose(_this$props, ["className", "color", "cssModule", "caret", "split", "nav", "tag"]);
  4280. var ariaLabel = props['aria-label'] || 'Toggle Dropdown';
  4281. var classes = mapToCssModules(classnames(className, {
  4282. 'dropdown-toggle': caret || split,
  4283. 'dropdown-toggle-split': split,
  4284. 'nav-link': nav
  4285. }), cssModule);
  4286. var children = props.children || React__default.createElement("span", {
  4287. className: "sr-only"
  4288. }, ariaLabel);
  4289. var Tag;
  4290. if (nav && !tag) {
  4291. Tag = 'a';
  4292. props.href = '#';
  4293. } else if (!tag) {
  4294. Tag = Button;
  4295. props.color = color;
  4296. props.cssModule = cssModule;
  4297. } else {
  4298. Tag = tag;
  4299. }
  4300. if (this.context.inNavbar) {
  4301. return React__default.createElement(Tag, _extends({}, props, {
  4302. className: classes,
  4303. onClick: this.onClick,
  4304. "aria-expanded": this.context.isOpen,
  4305. children: children
  4306. }));
  4307. }
  4308. return React__default.createElement(Target, _extends({}, props, {
  4309. className: classes,
  4310. component: Tag,
  4311. onClick: this.onClick,
  4312. "aria-expanded": this.context.isOpen,
  4313. children: children
  4314. }));
  4315. };
  4316. return DropdownToggle;
  4317. }(React__default.Component);
  4318. DropdownToggle.propTypes = propTypes$j;
  4319. DropdownToggle.defaultProps = defaultProps$h;
  4320. DropdownToggle.contextTypes = contextTypes$2;
  4321. var interopRequireDefault = createCommonjsModule(function (module) {
  4322. function _interopRequireDefault(obj) {
  4323. return obj && obj.__esModule ? obj : {
  4324. default: obj
  4325. };
  4326. }
  4327. module.exports = _interopRequireDefault;
  4328. });
  4329. unwrapExports(interopRequireDefault);
  4330. var hasClass_1 = createCommonjsModule(function (module, exports) {
  4331. exports.__esModule = true;
  4332. exports.default = hasClass;
  4333. function hasClass(element, className) {
  4334. if (element.classList) return !!className && element.classList.contains(className);else return (" " + (element.className.baseVal || element.className) + " ").indexOf(" " + className + " ") !== -1;
  4335. }
  4336. module.exports = exports["default"];
  4337. });
  4338. unwrapExports(hasClass_1);
  4339. var addClass_1 = createCommonjsModule(function (module, exports) {
  4340. exports.__esModule = true;
  4341. exports.default = addClass;
  4342. var _hasClass = interopRequireDefault(hasClass_1);
  4343. function addClass(element, className) {
  4344. if (element.classList) element.classList.add(className);else if (!(0, _hasClass.default)(element, className)) if (typeof element.className === 'string') element.className = element.className + ' ' + className;else element.setAttribute('class', (element.className && element.className.baseVal || '') + ' ' + className);
  4345. }
  4346. module.exports = exports["default"];
  4347. });
  4348. unwrapExports(addClass_1);
  4349. function replaceClassName(origClass, classToRemove) {
  4350. return origClass.replace(new RegExp('(^|\\s)' + classToRemove + '(?:\\s|$)', 'g'), '$1').replace(/\s+/g, ' ').replace(/^\s*|\s*$/g, '');
  4351. }
  4352. var removeClass = function removeClass(element, className) {
  4353. if (element.classList) element.classList.remove(className);else if (typeof element.className === 'string') element.className = replaceClassName(element.className, className);else element.setAttribute('class', replaceClassName(element.className && element.className.baseVal || '', className));
  4354. };
  4355. /**
  4356. * Copyright (c) 2013-present, Facebook, Inc.
  4357. *
  4358. * This source code is licensed under the MIT license found in the
  4359. * LICENSE file in the root directory of this source tree.
  4360. */
  4361. function componentWillMount() {
  4362. // Call this.constructor.gDSFP to support sub-classes.
  4363. var state = this.constructor.getDerivedStateFromProps(this.props, this.state);
  4364. if (state !== null && state !== undefined) {
  4365. this.setState(state);
  4366. }
  4367. }
  4368. function componentWillReceiveProps(nextProps) {
  4369. // Call this.constructor.gDSFP to support sub-classes.
  4370. // Use the setState() updater to ensure state isn't stale in certain edge cases.
  4371. function updater(prevState) {
  4372. var state = this.constructor.getDerivedStateFromProps(nextProps, prevState);
  4373. return state !== null && state !== undefined ? state : null;
  4374. } // Binding "this" is important for shallow renderer support.
  4375. this.setState(updater.bind(this));
  4376. }
  4377. function componentWillUpdate(nextProps, nextState) {
  4378. try {
  4379. var prevProps = this.props;
  4380. var prevState = this.state;
  4381. this.props = nextProps;
  4382. this.state = nextState;
  4383. this.__reactInternalSnapshotFlag = true;
  4384. this.__reactInternalSnapshot = this.getSnapshotBeforeUpdate(prevProps, prevState);
  4385. } finally {
  4386. this.props = prevProps;
  4387. this.state = prevState;
  4388. }
  4389. } // React may warn about cWM/cWRP/cWU methods being deprecated.
  4390. // Add a flag to suppress these warnings for this special case.
  4391. componentWillMount.__suppressDeprecationWarning = true;
  4392. componentWillReceiveProps.__suppressDeprecationWarning = true;
  4393. componentWillUpdate.__suppressDeprecationWarning = true;
  4394. function polyfill(Component) {
  4395. var prototype = Component.prototype;
  4396. if (!prototype || !prototype.isReactComponent) {
  4397. throw new Error('Can only polyfill class components');
  4398. }
  4399. if (typeof Component.getDerivedStateFromProps !== 'function' && typeof prototype.getSnapshotBeforeUpdate !== 'function') {
  4400. return Component;
  4401. } // If new component APIs are defined, "unsafe" lifecycles won't be called.
  4402. // Error if any of these lifecycles are present,
  4403. // Because they would work differently between older and newer (16.3+) versions of React.
  4404. var foundWillMountName = null;
  4405. var foundWillReceivePropsName = null;
  4406. var foundWillUpdateName = null;
  4407. if (typeof prototype.componentWillMount === 'function') {
  4408. foundWillMountName = 'componentWillMount';
  4409. } else if (typeof prototype.UNSAFE_componentWillMount === 'function') {
  4410. foundWillMountName = 'UNSAFE_componentWillMount';
  4411. }
  4412. if (typeof prototype.componentWillReceiveProps === 'function') {
  4413. foundWillReceivePropsName = 'componentWillReceiveProps';
  4414. } else if (typeof prototype.UNSAFE_componentWillReceiveProps === 'function') {
  4415. foundWillReceivePropsName = 'UNSAFE_componentWillReceiveProps';
  4416. }
  4417. if (typeof prototype.componentWillUpdate === 'function') {
  4418. foundWillUpdateName = 'componentWillUpdate';
  4419. } else if (typeof prototype.UNSAFE_componentWillUpdate === 'function') {
  4420. foundWillUpdateName = 'UNSAFE_componentWillUpdate';
  4421. }
  4422. if (foundWillMountName !== null || foundWillReceivePropsName !== null || foundWillUpdateName !== null) {
  4423. var componentName = Component.displayName || Component.name;
  4424. var newApiName = typeof Component.getDerivedStateFromProps === 'function' ? 'getDerivedStateFromProps()' : 'getSnapshotBeforeUpdate()';
  4425. throw Error('Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n' + componentName + ' uses ' + newApiName + ' but also contains the following legacy lifecycles:' + (foundWillMountName !== null ? '\n ' + foundWillMountName : '') + (foundWillReceivePropsName !== null ? '\n ' + foundWillReceivePropsName : '') + (foundWillUpdateName !== null ? '\n ' + foundWillUpdateName : '') + '\n\nThe above lifecycles should be removed. Learn more about this warning here:\n' + 'https://fb.me/react-async-component-lifecycle-hooks');
  4426. } // React <= 16.2 does not support static getDerivedStateFromProps.
  4427. // As a workaround, use cWM and cWRP to invoke the new static lifecycle.
  4428. // Newer versions of React will ignore these lifecycles if gDSFP exists.
  4429. if (typeof Component.getDerivedStateFromProps === 'function') {
  4430. prototype.componentWillMount = componentWillMount;
  4431. prototype.componentWillReceiveProps = componentWillReceiveProps;
  4432. } // React <= 16.2 does not support getSnapshotBeforeUpdate.
  4433. // As a workaround, use cWU to invoke the new lifecycle.
  4434. // Newer versions of React will ignore that lifecycle if gSBU exists.
  4435. if (typeof prototype.getSnapshotBeforeUpdate === 'function') {
  4436. if (typeof prototype.componentDidUpdate !== 'function') {
  4437. throw new Error('Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype');
  4438. }
  4439. prototype.componentWillUpdate = componentWillUpdate;
  4440. var componentDidUpdate = prototype.componentDidUpdate;
  4441. prototype.componentDidUpdate = function componentDidUpdatePolyfill(prevProps, prevState, maybeSnapshot) {
  4442. // 16.3+ will not execute our will-update method;
  4443. // It will pass a snapshot value to did-update though.
  4444. // Older versions will require our polyfilled will-update value.
  4445. // We need to handle both cases, but can't just check for the presence of "maybeSnapshot",
  4446. // Because for <= 15.x versions this might be a "prevContext" object.
  4447. // We also can't just check "__reactInternalSnapshot",
  4448. // Because get-snapshot might return a falsy value.
  4449. // So check for the explicit __reactInternalSnapshotFlag flag to determine behavior.
  4450. var snapshot = this.__reactInternalSnapshotFlag ? this.__reactInternalSnapshot : maybeSnapshot;
  4451. componentDidUpdate.call(this, prevProps, prevState, snapshot);
  4452. };
  4453. }
  4454. return Component;
  4455. }
  4456. var reactLifecyclesCompat_es = /*#__PURE__*/Object.freeze({
  4457. polyfill: polyfill
  4458. });
  4459. var PropTypes = createCommonjsModule(function (module, exports) {
  4460. exports.__esModule = true;
  4461. exports.transitionTimeout = transitionTimeout;
  4462. exports.classNamesShape = exports.timeoutsShape = void 0;
  4463. var _propTypes = _interopRequireDefault(propTypes);
  4464. function _interopRequireDefault(obj) {
  4465. return obj && obj.__esModule ? obj : {
  4466. default: obj
  4467. };
  4468. }
  4469. function transitionTimeout(transitionType) {
  4470. var timeoutPropName = 'transition' + transitionType + 'Timeout';
  4471. var enabledPropName = 'transition' + transitionType;
  4472. return function (props) {
  4473. // If the transition is enabled
  4474. if (props[enabledPropName]) {
  4475. // If no timeout duration is provided
  4476. if (props[timeoutPropName] == null) {
  4477. return new Error(timeoutPropName + ' wasn\'t supplied to CSSTransitionGroup: ' + 'this can cause unreliable animations and won\'t be supported in ' + 'a future version of React. See ' + 'https://fb.me/react-animation-transition-group-timeout for more ' + 'information.'); // If the duration isn't a number
  4478. } else if (typeof props[timeoutPropName] !== 'number') {
  4479. return new Error(timeoutPropName + ' must be a number (in milliseconds)');
  4480. }
  4481. }
  4482. return null;
  4483. };
  4484. }
  4485. var timeoutsShape = _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.shape({
  4486. enter: _propTypes.default.number,
  4487. exit: _propTypes.default.number
  4488. }).isRequired]);
  4489. exports.timeoutsShape = timeoutsShape;
  4490. var classNamesShape = _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.shape({
  4491. enter: _propTypes.default.string,
  4492. exit: _propTypes.default.string,
  4493. active: _propTypes.default.string
  4494. }), _propTypes.default.shape({
  4495. enter: _propTypes.default.string,
  4496. enterDone: _propTypes.default.string,
  4497. enterActive: _propTypes.default.string,
  4498. exit: _propTypes.default.string,
  4499. exitDone: _propTypes.default.string,
  4500. exitActive: _propTypes.default.string
  4501. })]);
  4502. exports.classNamesShape = classNamesShape;
  4503. });
  4504. unwrapExports(PropTypes);
  4505. var PropTypes_1 = PropTypes.transitionTimeout;
  4506. var PropTypes_2 = PropTypes.classNamesShape;
  4507. var PropTypes_3 = PropTypes.timeoutsShape;
  4508. var Transition_1 = createCommonjsModule(function (module, exports) {
  4509. exports.__esModule = true;
  4510. exports.default = exports.EXITING = exports.ENTERED = exports.ENTERING = exports.EXITED = exports.UNMOUNTED = void 0;
  4511. var PropTypes$$1 = _interopRequireWildcard(propTypes);
  4512. var _react = _interopRequireDefault(React__default);
  4513. var _reactDom = _interopRequireDefault(ReactDOM);
  4514. function _interopRequireDefault(obj) {
  4515. return obj && obj.__esModule ? obj : {
  4516. default: obj
  4517. };
  4518. }
  4519. function _interopRequireWildcard(obj) {
  4520. if (obj && obj.__esModule) {
  4521. return obj;
  4522. } else {
  4523. var newObj = {};
  4524. if (obj != null) {
  4525. for (var key in obj) {
  4526. if (Object.prototype.hasOwnProperty.call(obj, key)) {
  4527. var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {};
  4528. if (desc.get || desc.set) {
  4529. Object.defineProperty(newObj, key, desc);
  4530. } else {
  4531. newObj[key] = obj[key];
  4532. }
  4533. }
  4534. }
  4535. }
  4536. newObj.default = obj;
  4537. return newObj;
  4538. }
  4539. }
  4540. function _objectWithoutPropertiesLoose(source, excluded) {
  4541. if (source == null) return {};
  4542. var target = {};
  4543. var sourceKeys = Object.keys(source);
  4544. var key, i;
  4545. for (i = 0; i < sourceKeys.length; i++) {
  4546. key = sourceKeys[i];
  4547. if (excluded.indexOf(key) >= 0) continue;
  4548. target[key] = source[key];
  4549. }
  4550. return target;
  4551. }
  4552. function _inheritsLoose(subClass, superClass) {
  4553. subClass.prototype = Object.create(superClass.prototype);
  4554. subClass.prototype.constructor = subClass;
  4555. subClass.__proto__ = superClass;
  4556. }
  4557. var UNMOUNTED = 'unmounted';
  4558. exports.UNMOUNTED = UNMOUNTED;
  4559. var EXITED = 'exited';
  4560. exports.EXITED = EXITED;
  4561. var ENTERING = 'entering';
  4562. exports.ENTERING = ENTERING;
  4563. var ENTERED = 'entered';
  4564. exports.ENTERED = ENTERED;
  4565. var EXITING = 'exiting';
  4566. /**
  4567. * The Transition component lets you describe a transition from one component
  4568. * state to another _over time_ with a simple declarative API. Most commonly
  4569. * it's used to animate the mounting and unmounting of a component, but can also
  4570. * be used to describe in-place transition states as well.
  4571. *
  4572. * By default the `Transition` component does not alter the behavior of the
  4573. * component it renders, it only tracks "enter" and "exit" states for the components.
  4574. * It's up to you to give meaning and effect to those states. For example we can
  4575. * add styles to a component when it enters or exits:
  4576. *
  4577. * ```jsx
  4578. * import Transition from 'react-transition-group/Transition';
  4579. *
  4580. * const duration = 300;
  4581. *
  4582. * const defaultStyle = {
  4583. * transition: `opacity ${duration}ms ease-in-out`,
  4584. * opacity: 0,
  4585. * }
  4586. *
  4587. * const transitionStyles = {
  4588. * entering: { opacity: 0 },
  4589. * entered: { opacity: 1 },
  4590. * };
  4591. *
  4592. * const Fade = ({ in: inProp }) => (
  4593. * <Transition in={inProp} timeout={duration}>
  4594. * {(state) => (
  4595. * <div style={{
  4596. * ...defaultStyle,
  4597. * ...transitionStyles[state]
  4598. * }}>
  4599. * I'm a fade Transition!
  4600. * </div>
  4601. * )}
  4602. * </Transition>
  4603. * );
  4604. * ```
  4605. *
  4606. * As noted the `Transition` component doesn't _do_ anything by itself to its child component.
  4607. * What it does do is track transition states over time so you can update the
  4608. * component (such as by adding styles or classes) when it changes states.
  4609. *
  4610. * There are 4 main states a Transition can be in:
  4611. * - `'entering'`
  4612. * - `'entered'`
  4613. * - `'exiting'`
  4614. * - `'exited'`
  4615. *
  4616. * Transition state is toggled via the `in` prop. When `true` the component begins the
  4617. * "Enter" stage. During this stage, the component will shift from its current transition state,
  4618. * to `'entering'` for the duration of the transition and then to the `'entered'` stage once
  4619. * it's complete. Let's take the following example:
  4620. *
  4621. * ```jsx
  4622. * state = { in: false };
  4623. *
  4624. * toggleEnterState = () => {
  4625. * this.setState({ in: true });
  4626. * }
  4627. *
  4628. * render() {
  4629. * return (
  4630. * <div>
  4631. * <Transition in={this.state.in} timeout={500} />
  4632. * <button onClick={this.toggleEnterState}>Click to Enter</button>
  4633. * </div>
  4634. * );
  4635. * }
  4636. * ```
  4637. *
  4638. * When the button is clicked the component will shift to the `'entering'` state and
  4639. * stay there for 500ms (the value of `timeout`) before it finally switches to `'entered'`.
  4640. *
  4641. * When `in` is `false` the same thing happens except the state moves from `'exiting'` to `'exited'`.
  4642. *
  4643. * ## Timing
  4644. *
  4645. * Timing is often the trickiest part of animation, mistakes can result in slight delays
  4646. * that are hard to pin down. A common example is when you want to add an exit transition,
  4647. * you should set the desired final styles when the state is `'exiting'`. That's when the
  4648. * transition to those styles will start and, if you matched the `timeout` prop with the
  4649. * CSS Transition duration, it will end exactly when the state changes to `'exited'`.
  4650. *
  4651. * > **Note**: For simpler transitions the `Transition` component might be enough, but
  4652. * > take into account that it's platform-agnostic, while the `CSSTransition` component
  4653. * > [forces reflows](https://github.com/reactjs/react-transition-group/blob/5007303e729a74be66a21c3e2205e4916821524b/src/CSSTransition.js#L208-L215)
  4654. * > in order to make more complex transitions more predictable. For example, even though
  4655. * > classes `example-enter` and `example-enter-active` are applied immediately one after
  4656. * > another, you can still transition from one to the other because of the forced reflow
  4657. * > (read [this issue](https://github.com/reactjs/react-transition-group/issues/159#issuecomment-322761171)
  4658. * > for more info). Take this into account when choosing between `Transition` and
  4659. * > `CSSTransition`.
  4660. */
  4661. exports.EXITING = EXITING;
  4662. var Transition =
  4663. /*#__PURE__*/
  4664. function (_React$Component) {
  4665. _inheritsLoose(Transition, _React$Component);
  4666. function Transition(props, context) {
  4667. var _this;
  4668. _this = _React$Component.call(this, props, context) || this;
  4669. var parentGroup = context.transitionGroup; // In the context of a TransitionGroup all enters are really appears
  4670. var appear = parentGroup && !parentGroup.isMounting ? props.enter : props.appear;
  4671. var initialStatus;
  4672. _this.appearStatus = null;
  4673. if (props.in) {
  4674. if (appear) {
  4675. initialStatus = EXITED;
  4676. _this.appearStatus = ENTERING;
  4677. } else {
  4678. initialStatus = ENTERED;
  4679. }
  4680. } else {
  4681. if (props.unmountOnExit || props.mountOnEnter) {
  4682. initialStatus = UNMOUNTED;
  4683. } else {
  4684. initialStatus = EXITED;
  4685. }
  4686. }
  4687. _this.state = {
  4688. status: initialStatus
  4689. };
  4690. _this.nextCallback = null;
  4691. return _this;
  4692. }
  4693. var _proto = Transition.prototype;
  4694. _proto.getChildContext = function getChildContext() {
  4695. return {
  4696. transitionGroup: null // allows for nested Transitions
  4697. };
  4698. };
  4699. Transition.getDerivedStateFromProps = function getDerivedStateFromProps(_ref, prevState) {
  4700. var nextIn = _ref.in;
  4701. if (nextIn && prevState.status === UNMOUNTED) {
  4702. return {
  4703. status: EXITED
  4704. };
  4705. }
  4706. return null;
  4707. }; // getSnapshotBeforeUpdate(prevProps) {
  4708. // let nextStatus = null
  4709. // if (prevProps !== this.props) {
  4710. // const { status } = this.state
  4711. // if (this.props.in) {
  4712. // if (status !== ENTERING && status !== ENTERED) {
  4713. // nextStatus = ENTERING
  4714. // }
  4715. // } else {
  4716. // if (status === ENTERING || status === ENTERED) {
  4717. // nextStatus = EXITING
  4718. // }
  4719. // }
  4720. // }
  4721. // return { nextStatus }
  4722. // }
  4723. _proto.componentDidMount = function componentDidMount() {
  4724. this.updateStatus(true, this.appearStatus);
  4725. };
  4726. _proto.componentDidUpdate = function componentDidUpdate(prevProps) {
  4727. var nextStatus = null;
  4728. if (prevProps !== this.props) {
  4729. var status = this.state.status;
  4730. if (this.props.in) {
  4731. if (status !== ENTERING && status !== ENTERED) {
  4732. nextStatus = ENTERING;
  4733. }
  4734. } else {
  4735. if (status === ENTERING || status === ENTERED) {
  4736. nextStatus = EXITING;
  4737. }
  4738. }
  4739. }
  4740. this.updateStatus(false, nextStatus);
  4741. };
  4742. _proto.componentWillUnmount = function componentWillUnmount() {
  4743. this.cancelNextCallback();
  4744. };
  4745. _proto.getTimeouts = function getTimeouts() {
  4746. var timeout = this.props.timeout;
  4747. var exit, enter, appear;
  4748. exit = enter = appear = timeout;
  4749. if (timeout != null && typeof timeout !== 'number') {
  4750. exit = timeout.exit;
  4751. enter = timeout.enter;
  4752. appear = timeout.appear;
  4753. }
  4754. return {
  4755. exit: exit,
  4756. enter: enter,
  4757. appear: appear
  4758. };
  4759. };
  4760. _proto.updateStatus = function updateStatus(mounting, nextStatus) {
  4761. if (mounting === void 0) {
  4762. mounting = false;
  4763. }
  4764. if (nextStatus !== null) {
  4765. // nextStatus will always be ENTERING or EXITING.
  4766. this.cancelNextCallback();
  4767. var node = _reactDom.default.findDOMNode(this);
  4768. if (nextStatus === ENTERING) {
  4769. this.performEnter(node, mounting);
  4770. } else {
  4771. this.performExit(node);
  4772. }
  4773. } else if (this.props.unmountOnExit && this.state.status === EXITED) {
  4774. this.setState({
  4775. status: UNMOUNTED
  4776. });
  4777. }
  4778. };
  4779. _proto.performEnter = function performEnter(node, mounting) {
  4780. var _this2 = this;
  4781. var enter = this.props.enter;
  4782. var appearing = this.context.transitionGroup ? this.context.transitionGroup.isMounting : mounting;
  4783. var timeouts = this.getTimeouts(); // no enter animation skip right to ENTERED
  4784. // if we are mounting and running this it means appear _must_ be set
  4785. if (!mounting && !enter) {
  4786. this.safeSetState({
  4787. status: ENTERED
  4788. }, function () {
  4789. _this2.props.onEntered(node);
  4790. });
  4791. return;
  4792. }
  4793. this.props.onEnter(node, appearing);
  4794. this.safeSetState({
  4795. status: ENTERING
  4796. }, function () {
  4797. _this2.props.onEntering(node, appearing); // FIXME: appear timeout?
  4798. _this2.onTransitionEnd(node, timeouts.enter, function () {
  4799. _this2.safeSetState({
  4800. status: ENTERED
  4801. }, function () {
  4802. _this2.props.onEntered(node, appearing);
  4803. });
  4804. });
  4805. });
  4806. };
  4807. _proto.performExit = function performExit(node) {
  4808. var _this3 = this;
  4809. var exit = this.props.exit;
  4810. var timeouts = this.getTimeouts(); // no exit animation skip right to EXITED
  4811. if (!exit) {
  4812. this.safeSetState({
  4813. status: EXITED
  4814. }, function () {
  4815. _this3.props.onExited(node);
  4816. });
  4817. return;
  4818. }
  4819. this.props.onExit(node);
  4820. this.safeSetState({
  4821. status: EXITING
  4822. }, function () {
  4823. _this3.props.onExiting(node);
  4824. _this3.onTransitionEnd(node, timeouts.exit, function () {
  4825. _this3.safeSetState({
  4826. status: EXITED
  4827. }, function () {
  4828. _this3.props.onExited(node);
  4829. });
  4830. });
  4831. });
  4832. };
  4833. _proto.cancelNextCallback = function cancelNextCallback() {
  4834. if (this.nextCallback !== null) {
  4835. this.nextCallback.cancel();
  4836. this.nextCallback = null;
  4837. }
  4838. };
  4839. _proto.safeSetState = function safeSetState(nextState, callback) {
  4840. // This shouldn't be necessary, but there are weird race conditions with
  4841. // setState callbacks and unmounting in testing, so always make sure that
  4842. // we can cancel any pending setState callbacks after we unmount.
  4843. callback = this.setNextCallback(callback);
  4844. this.setState(nextState, callback);
  4845. };
  4846. _proto.setNextCallback = function setNextCallback(callback) {
  4847. var _this4 = this;
  4848. var active = true;
  4849. this.nextCallback = function (event) {
  4850. if (active) {
  4851. active = false;
  4852. _this4.nextCallback = null;
  4853. callback(event);
  4854. }
  4855. };
  4856. this.nextCallback.cancel = function () {
  4857. active = false;
  4858. };
  4859. return this.nextCallback;
  4860. };
  4861. _proto.onTransitionEnd = function onTransitionEnd(node, timeout, handler) {
  4862. this.setNextCallback(handler);
  4863. if (node) {
  4864. if (this.props.addEndListener) {
  4865. this.props.addEndListener(node, this.nextCallback);
  4866. }
  4867. if (timeout != null) {
  4868. setTimeout(this.nextCallback, timeout);
  4869. }
  4870. } else {
  4871. setTimeout(this.nextCallback, 0);
  4872. }
  4873. };
  4874. _proto.render = function render() {
  4875. var status = this.state.status;
  4876. if (status === UNMOUNTED) {
  4877. return null;
  4878. }
  4879. var _this$props = this.props,
  4880. children = _this$props.children,
  4881. childProps = _objectWithoutPropertiesLoose(_this$props, ["children"]); // filter props for Transtition
  4882. delete childProps.in;
  4883. delete childProps.mountOnEnter;
  4884. delete childProps.unmountOnExit;
  4885. delete childProps.appear;
  4886. delete childProps.enter;
  4887. delete childProps.exit;
  4888. delete childProps.timeout;
  4889. delete childProps.addEndListener;
  4890. delete childProps.onEnter;
  4891. delete childProps.onEntering;
  4892. delete childProps.onEntered;
  4893. delete childProps.onExit;
  4894. delete childProps.onExiting;
  4895. delete childProps.onExited;
  4896. if (typeof children === 'function') {
  4897. return children(status, childProps);
  4898. }
  4899. var child = _react.default.Children.only(children);
  4900. return _react.default.cloneElement(child, childProps);
  4901. };
  4902. return Transition;
  4903. }(_react.default.Component);
  4904. Transition.contextTypes = {
  4905. transitionGroup: PropTypes$$1.object
  4906. };
  4907. Transition.childContextTypes = {
  4908. transitionGroup: function transitionGroup() {}
  4909. };
  4910. Transition.propTypes = {};
  4911. function noop() {}
  4912. Transition.defaultProps = {
  4913. in: false,
  4914. mountOnEnter: false,
  4915. unmountOnExit: false,
  4916. appear: false,
  4917. enter: true,
  4918. exit: true,
  4919. onEnter: noop,
  4920. onEntering: noop,
  4921. onEntered: noop,
  4922. onExit: noop,
  4923. onExiting: noop,
  4924. onExited: noop
  4925. };
  4926. Transition.UNMOUNTED = 0;
  4927. Transition.EXITED = 1;
  4928. Transition.ENTERING = 2;
  4929. Transition.ENTERED = 3;
  4930. Transition.EXITING = 4;
  4931. var _default = (0, reactLifecyclesCompat_es.polyfill)(Transition);
  4932. exports.default = _default;
  4933. });
  4934. unwrapExports(Transition_1);
  4935. var Transition_2 = Transition_1.EXITING;
  4936. var Transition_3 = Transition_1.ENTERED;
  4937. var Transition_4 = Transition_1.ENTERING;
  4938. var Transition_5 = Transition_1.EXITED;
  4939. var Transition_6 = Transition_1.UNMOUNTED;
  4940. var CSSTransition_1 = createCommonjsModule(function (module, exports) {
  4941. exports.__esModule = true;
  4942. exports.default = void 0;
  4943. var PropTypes$$1 = _interopRequireWildcard(propTypes);
  4944. var _addClass = _interopRequireDefault(addClass_1);
  4945. var _removeClass = _interopRequireDefault(removeClass);
  4946. var _react = _interopRequireDefault(React__default);
  4947. var _Transition = _interopRequireDefault(Transition_1);
  4948. function _interopRequireDefault(obj) {
  4949. return obj && obj.__esModule ? obj : {
  4950. default: obj
  4951. };
  4952. }
  4953. function _interopRequireWildcard(obj) {
  4954. if (obj && obj.__esModule) {
  4955. return obj;
  4956. } else {
  4957. var newObj = {};
  4958. if (obj != null) {
  4959. for (var key in obj) {
  4960. if (Object.prototype.hasOwnProperty.call(obj, key)) {
  4961. var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {};
  4962. if (desc.get || desc.set) {
  4963. Object.defineProperty(newObj, key, desc);
  4964. } else {
  4965. newObj[key] = obj[key];
  4966. }
  4967. }
  4968. }
  4969. }
  4970. newObj.default = obj;
  4971. return newObj;
  4972. }
  4973. }
  4974. function _inheritsLoose(subClass, superClass) {
  4975. subClass.prototype = Object.create(superClass.prototype);
  4976. subClass.prototype.constructor = subClass;
  4977. subClass.__proto__ = superClass;
  4978. }
  4979. function _extends() {
  4980. _extends = Object.assign || function (target) {
  4981. for (var i = 1; i < arguments.length; i++) {
  4982. var source = arguments[i];
  4983. for (var key in source) {
  4984. if (Object.prototype.hasOwnProperty.call(source, key)) {
  4985. target[key] = source[key];
  4986. }
  4987. }
  4988. }
  4989. return target;
  4990. };
  4991. return _extends.apply(this, arguments);
  4992. }
  4993. var addClass = function addClass(node, classes) {
  4994. return node && classes && classes.split(' ').forEach(function (c) {
  4995. return (0, _addClass.default)(node, c);
  4996. });
  4997. };
  4998. var removeClass$$1 = function removeClass$$1(node, classes) {
  4999. return node && classes && classes.split(' ').forEach(function (c) {
  5000. return (0, _removeClass.default)(node, c);
  5001. });
  5002. };
  5003. /**
  5004. * A `Transition` component using CSS transitions and animations.
  5005. * It's inspired by the excellent [ng-animate](http://www.nganimate.org/) library.
  5006. *
  5007. * `CSSTransition` applies a pair of class names during the `appear`, `enter`,
  5008. * and `exit` stages of the transition. The first class is applied and then a
  5009. * second "active" class in order to activate the css animation. After the animation,
  5010. * matching `done` class names are applied to persist the animation state.
  5011. *
  5012. * When the `in` prop is toggled to `true` the Component will get
  5013. * the `example-enter` CSS class and the `example-enter-active` CSS class
  5014. * added in the next tick. This is a convention based on the `classNames` prop.
  5015. */
  5016. var CSSTransition =
  5017. /*#__PURE__*/
  5018. function (_React$Component) {
  5019. _inheritsLoose(CSSTransition, _React$Component);
  5020. function CSSTransition() {
  5021. var _this;
  5022. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  5023. args[_key] = arguments[_key];
  5024. }
  5025. _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
  5026. _this.onEnter = function (node, appearing) {
  5027. var _this$getClassNames = _this.getClassNames(appearing ? 'appear' : 'enter'),
  5028. className = _this$getClassNames.className;
  5029. _this.removeClasses(node, 'exit');
  5030. addClass(node, className);
  5031. if (_this.props.onEnter) {
  5032. _this.props.onEnter(node, appearing);
  5033. }
  5034. };
  5035. _this.onEntering = function (node, appearing) {
  5036. var _this$getClassNames2 = _this.getClassNames(appearing ? 'appear' : 'enter'),
  5037. activeClassName = _this$getClassNames2.activeClassName;
  5038. _this.reflowAndAddClass(node, activeClassName);
  5039. if (_this.props.onEntering) {
  5040. _this.props.onEntering(node, appearing);
  5041. }
  5042. };
  5043. _this.onEntered = function (node, appearing) {
  5044. var _this$getClassNames3 = _this.getClassNames('enter'),
  5045. doneClassName = _this$getClassNames3.doneClassName;
  5046. _this.removeClasses(node, appearing ? 'appear' : 'enter');
  5047. addClass(node, doneClassName);
  5048. if (_this.props.onEntered) {
  5049. _this.props.onEntered(node, appearing);
  5050. }
  5051. };
  5052. _this.onExit = function (node) {
  5053. var _this$getClassNames4 = _this.getClassNames('exit'),
  5054. className = _this$getClassNames4.className;
  5055. _this.removeClasses(node, 'appear');
  5056. _this.removeClasses(node, 'enter');
  5057. addClass(node, className);
  5058. if (_this.props.onExit) {
  5059. _this.props.onExit(node);
  5060. }
  5061. };
  5062. _this.onExiting = function (node) {
  5063. var _this$getClassNames5 = _this.getClassNames('exit'),
  5064. activeClassName = _this$getClassNames5.activeClassName;
  5065. _this.reflowAndAddClass(node, activeClassName);
  5066. if (_this.props.onExiting) {
  5067. _this.props.onExiting(node);
  5068. }
  5069. };
  5070. _this.onExited = function (node) {
  5071. var _this$getClassNames6 = _this.getClassNames('exit'),
  5072. doneClassName = _this$getClassNames6.doneClassName;
  5073. _this.removeClasses(node, 'exit');
  5074. addClass(node, doneClassName);
  5075. if (_this.props.onExited) {
  5076. _this.props.onExited(node);
  5077. }
  5078. };
  5079. _this.getClassNames = function (type) {
  5080. var classNames = _this.props.classNames;
  5081. var className = typeof classNames !== 'string' ? classNames[type] : classNames + '-' + type;
  5082. var activeClassName = typeof classNames !== 'string' ? classNames[type + 'Active'] : className + '-active';
  5083. var doneClassName = typeof classNames !== 'string' ? classNames[type + 'Done'] : className + '-done';
  5084. return {
  5085. className: className,
  5086. activeClassName: activeClassName,
  5087. doneClassName: doneClassName
  5088. };
  5089. };
  5090. return _this;
  5091. }
  5092. var _proto = CSSTransition.prototype;
  5093. _proto.removeClasses = function removeClasses(node, type) {
  5094. var _this$getClassNames7 = this.getClassNames(type),
  5095. className = _this$getClassNames7.className,
  5096. activeClassName = _this$getClassNames7.activeClassName,
  5097. doneClassName = _this$getClassNames7.doneClassName;
  5098. className && removeClass$$1(node, className);
  5099. activeClassName && removeClass$$1(node, activeClassName);
  5100. doneClassName && removeClass$$1(node, doneClassName);
  5101. };
  5102. _proto.reflowAndAddClass = function reflowAndAddClass(node, className) {
  5103. // This is for to force a repaint,
  5104. // which is necessary in order to transition styles when adding a class name.
  5105. if (className) {
  5106. /* eslint-disable no-unused-expressions */
  5107. node && node.scrollTop;
  5108. /* eslint-enable no-unused-expressions */
  5109. addClass(node, className);
  5110. }
  5111. };
  5112. _proto.render = function render() {
  5113. var props = _extends({}, this.props);
  5114. delete props.classNames;
  5115. return _react.default.createElement(_Transition.default, _extends({}, props, {
  5116. onEnter: this.onEnter,
  5117. onEntered: this.onEntered,
  5118. onEntering: this.onEntering,
  5119. onExit: this.onExit,
  5120. onExiting: this.onExiting,
  5121. onExited: this.onExited
  5122. }));
  5123. };
  5124. return CSSTransition;
  5125. }(_react.default.Component);
  5126. CSSTransition.propTypes = {};
  5127. var _default = CSSTransition;
  5128. exports.default = _default;
  5129. module.exports = exports["default"];
  5130. });
  5131. unwrapExports(CSSTransition_1);
  5132. var ChildMapping = createCommonjsModule(function (module, exports) {
  5133. exports.__esModule = true;
  5134. exports.getChildMapping = getChildMapping;
  5135. exports.mergeChildMappings = mergeChildMappings;
  5136. exports.getInitialChildMapping = getInitialChildMapping;
  5137. exports.getNextChildMapping = getNextChildMapping;
  5138. /**
  5139. * Given `this.props.children`, return an object mapping key to child.
  5140. *
  5141. * @param {*} children `this.props.children`
  5142. * @return {object} Mapping of key to child
  5143. */
  5144. function getChildMapping(children, mapFn) {
  5145. var mapper = function mapper(child) {
  5146. return mapFn && (0, React__default.isValidElement)(child) ? mapFn(child) : child;
  5147. };
  5148. var result = Object.create(null);
  5149. if (children) React__default.Children.map(children, function (c) {
  5150. return c;
  5151. }).forEach(function (child) {
  5152. // run the map function here instead so that the key is the computed one
  5153. result[child.key] = mapper(child);
  5154. });
  5155. return result;
  5156. }
  5157. /**
  5158. * When you're adding or removing children some may be added or removed in the
  5159. * same render pass. We want to show *both* since we want to simultaneously
  5160. * animate elements in and out. This function takes a previous set of keys
  5161. * and a new set of keys and merges them with its best guess of the correct
  5162. * ordering. In the future we may expose some of the utilities in
  5163. * ReactMultiChild to make this easy, but for now React itself does not
  5164. * directly have this concept of the union of prevChildren and nextChildren
  5165. * so we implement it here.
  5166. *
  5167. * @param {object} prev prev children as returned from
  5168. * `ReactTransitionChildMapping.getChildMapping()`.
  5169. * @param {object} next next children as returned from
  5170. * `ReactTransitionChildMapping.getChildMapping()`.
  5171. * @return {object} a key set that contains all keys in `prev` and all keys
  5172. * in `next` in a reasonable order.
  5173. */
  5174. function mergeChildMappings(prev, next) {
  5175. prev = prev || {};
  5176. next = next || {};
  5177. function getValueForKey(key) {
  5178. return key in next ? next[key] : prev[key];
  5179. } // For each key of `next`, the list of keys to insert before that key in
  5180. // the combined list
  5181. var nextKeysPending = Object.create(null);
  5182. var pendingKeys = [];
  5183. for (var prevKey in prev) {
  5184. if (prevKey in next) {
  5185. if (pendingKeys.length) {
  5186. nextKeysPending[prevKey] = pendingKeys;
  5187. pendingKeys = [];
  5188. }
  5189. } else {
  5190. pendingKeys.push(prevKey);
  5191. }
  5192. }
  5193. var i;
  5194. var childMapping = {};
  5195. for (var nextKey in next) {
  5196. if (nextKeysPending[nextKey]) {
  5197. for (i = 0; i < nextKeysPending[nextKey].length; i++) {
  5198. var pendingNextKey = nextKeysPending[nextKey][i];
  5199. childMapping[nextKeysPending[nextKey][i]] = getValueForKey(pendingNextKey);
  5200. }
  5201. }
  5202. childMapping[nextKey] = getValueForKey(nextKey);
  5203. } // Finally, add the keys which didn't appear before any key in `next`
  5204. for (i = 0; i < pendingKeys.length; i++) {
  5205. childMapping[pendingKeys[i]] = getValueForKey(pendingKeys[i]);
  5206. }
  5207. return childMapping;
  5208. }
  5209. function getProp(child, prop, props) {
  5210. return props[prop] != null ? props[prop] : child.props[prop];
  5211. }
  5212. function getInitialChildMapping(props, onExited) {
  5213. return getChildMapping(props.children, function (child) {
  5214. return (0, React__default.cloneElement)(child, {
  5215. onExited: onExited.bind(null, child),
  5216. in: true,
  5217. appear: getProp(child, 'appear', props),
  5218. enter: getProp(child, 'enter', props),
  5219. exit: getProp(child, 'exit', props)
  5220. });
  5221. });
  5222. }
  5223. function getNextChildMapping(nextProps, prevChildMapping, onExited) {
  5224. var nextChildMapping = getChildMapping(nextProps.children);
  5225. var children = mergeChildMappings(prevChildMapping, nextChildMapping);
  5226. Object.keys(children).forEach(function (key) {
  5227. var child = children[key];
  5228. if (!(0, React__default.isValidElement)(child)) return;
  5229. var hasPrev = key in prevChildMapping;
  5230. var hasNext = key in nextChildMapping;
  5231. var prevChild = prevChildMapping[key];
  5232. var isLeaving = (0, React__default.isValidElement)(prevChild) && !prevChild.props.in; // item is new (entering)
  5233. if (hasNext && (!hasPrev || isLeaving)) {
  5234. // console.log('entering', key)
  5235. children[key] = (0, React__default.cloneElement)(child, {
  5236. onExited: onExited.bind(null, child),
  5237. in: true,
  5238. exit: getProp(child, 'exit', nextProps),
  5239. enter: getProp(child, 'enter', nextProps)
  5240. });
  5241. } else if (!hasNext && hasPrev && !isLeaving) {
  5242. // item is old (exiting)
  5243. // console.log('leaving', key)
  5244. children[key] = (0, React__default.cloneElement)(child, {
  5245. in: false
  5246. });
  5247. } else if (hasNext && hasPrev && (0, React__default.isValidElement)(prevChild)) {
  5248. // item hasn't changed transition states
  5249. // copy over the last transition props;
  5250. // console.log('unchanged', key)
  5251. children[key] = (0, React__default.cloneElement)(child, {
  5252. onExited: onExited.bind(null, child),
  5253. in: prevChild.props.in,
  5254. exit: getProp(child, 'exit', nextProps),
  5255. enter: getProp(child, 'enter', nextProps)
  5256. });
  5257. }
  5258. });
  5259. return children;
  5260. }
  5261. });
  5262. unwrapExports(ChildMapping);
  5263. var ChildMapping_1 = ChildMapping.getChildMapping;
  5264. var ChildMapping_2 = ChildMapping.mergeChildMappings;
  5265. var ChildMapping_3 = ChildMapping.getInitialChildMapping;
  5266. var ChildMapping_4 = ChildMapping.getNextChildMapping;
  5267. var TransitionGroup_1 = createCommonjsModule(function (module, exports) {
  5268. exports.__esModule = true;
  5269. exports.default = void 0;
  5270. var _propTypes = _interopRequireDefault(propTypes);
  5271. var _react = _interopRequireDefault(React__default);
  5272. function _interopRequireDefault(obj) {
  5273. return obj && obj.__esModule ? obj : {
  5274. default: obj
  5275. };
  5276. }
  5277. function _objectWithoutPropertiesLoose(source, excluded) {
  5278. if (source == null) return {};
  5279. var target = {};
  5280. var sourceKeys = Object.keys(source);
  5281. var key, i;
  5282. for (i = 0; i < sourceKeys.length; i++) {
  5283. key = sourceKeys[i];
  5284. if (excluded.indexOf(key) >= 0) continue;
  5285. target[key] = source[key];
  5286. }
  5287. return target;
  5288. }
  5289. function _extends() {
  5290. _extends = Object.assign || function (target) {
  5291. for (var i = 1; i < arguments.length; i++) {
  5292. var source = arguments[i];
  5293. for (var key in source) {
  5294. if (Object.prototype.hasOwnProperty.call(source, key)) {
  5295. target[key] = source[key];
  5296. }
  5297. }
  5298. }
  5299. return target;
  5300. };
  5301. return _extends.apply(this, arguments);
  5302. }
  5303. function _inheritsLoose(subClass, superClass) {
  5304. subClass.prototype = Object.create(superClass.prototype);
  5305. subClass.prototype.constructor = subClass;
  5306. subClass.__proto__ = superClass;
  5307. }
  5308. function _assertThisInitialized(self) {
  5309. if (self === void 0) {
  5310. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  5311. }
  5312. return self;
  5313. }
  5314. var values = Object.values || function (obj) {
  5315. return Object.keys(obj).map(function (k) {
  5316. return obj[k];
  5317. });
  5318. };
  5319. var defaultProps = {
  5320. component: 'div',
  5321. childFactory: function childFactory(child) {
  5322. return child;
  5323. }
  5324. /**
  5325. * The `<TransitionGroup>` component manages a set of transition components
  5326. * (`<Transition>` and `<CSSTransition>`) in a list. Like with the transition
  5327. * components, `<TransitionGroup>` is a state machine for managing the mounting
  5328. * and unmounting of components over time.
  5329. *
  5330. * Consider the example below. As items are removed or added to the TodoList the
  5331. * `in` prop is toggled automatically by the `<TransitionGroup>`.
  5332. *
  5333. * Note that `<TransitionGroup>` does not define any animation behavior!
  5334. * Exactly _how_ a list item animates is up to the individual transition
  5335. * component. This means you can mix and match animations across different list
  5336. * items.
  5337. */
  5338. };
  5339. var TransitionGroup =
  5340. /*#__PURE__*/
  5341. function (_React$Component) {
  5342. _inheritsLoose(TransitionGroup, _React$Component);
  5343. function TransitionGroup(props, context) {
  5344. var _this;
  5345. _this = _React$Component.call(this, props, context) || this;
  5346. var handleExited = _this.handleExited.bind(_assertThisInitialized(_assertThisInitialized(_this))); // Initial children should all be entering, dependent on appear
  5347. _this.state = {
  5348. handleExited: handleExited,
  5349. firstRender: true
  5350. };
  5351. return _this;
  5352. }
  5353. var _proto = TransitionGroup.prototype;
  5354. _proto.getChildContext = function getChildContext() {
  5355. return {
  5356. transitionGroup: {
  5357. isMounting: !this.appeared
  5358. }
  5359. };
  5360. };
  5361. _proto.componentDidMount = function componentDidMount() {
  5362. this.appeared = true;
  5363. this.mounted = true;
  5364. };
  5365. _proto.componentWillUnmount = function componentWillUnmount() {
  5366. this.mounted = false;
  5367. };
  5368. TransitionGroup.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, _ref) {
  5369. var prevChildMapping = _ref.children,
  5370. handleExited = _ref.handleExited,
  5371. firstRender = _ref.firstRender;
  5372. return {
  5373. children: firstRender ? (0, ChildMapping.getInitialChildMapping)(nextProps, handleExited) : (0, ChildMapping.getNextChildMapping)(nextProps, prevChildMapping, handleExited),
  5374. firstRender: false
  5375. };
  5376. };
  5377. _proto.handleExited = function handleExited(child, node) {
  5378. var currentChildMapping = (0, ChildMapping.getChildMapping)(this.props.children);
  5379. if (child.key in currentChildMapping) return;
  5380. if (child.props.onExited) {
  5381. child.props.onExited(node);
  5382. }
  5383. if (this.mounted) {
  5384. this.setState(function (state) {
  5385. var children = _extends({}, state.children);
  5386. delete children[child.key];
  5387. return {
  5388. children: children
  5389. };
  5390. });
  5391. }
  5392. };
  5393. _proto.render = function render() {
  5394. var _this$props = this.props,
  5395. Component = _this$props.component,
  5396. childFactory = _this$props.childFactory,
  5397. props = _objectWithoutPropertiesLoose(_this$props, ["component", "childFactory"]);
  5398. var children = values(this.state.children).map(childFactory);
  5399. delete props.appear;
  5400. delete props.enter;
  5401. delete props.exit;
  5402. if (Component === null) {
  5403. return children;
  5404. }
  5405. return _react.default.createElement(Component, props, children);
  5406. };
  5407. return TransitionGroup;
  5408. }(_react.default.Component);
  5409. TransitionGroup.childContextTypes = {
  5410. transitionGroup: _propTypes.default.object.isRequired
  5411. };
  5412. TransitionGroup.propTypes = {};
  5413. TransitionGroup.defaultProps = defaultProps;
  5414. var _default = (0, reactLifecyclesCompat_es.polyfill)(TransitionGroup);
  5415. exports.default = _default;
  5416. module.exports = exports["default"];
  5417. });
  5418. unwrapExports(TransitionGroup_1);
  5419. var ReplaceTransition_1 = createCommonjsModule(function (module, exports) {
  5420. exports.__esModule = true;
  5421. exports.default = void 0;
  5422. var _propTypes = _interopRequireDefault(propTypes);
  5423. var _react = _interopRequireDefault(React__default);
  5424. var _TransitionGroup = _interopRequireDefault(TransitionGroup_1);
  5425. function _interopRequireDefault(obj) {
  5426. return obj && obj.__esModule ? obj : {
  5427. default: obj
  5428. };
  5429. }
  5430. function _objectWithoutPropertiesLoose(source, excluded) {
  5431. if (source == null) return {};
  5432. var target = {};
  5433. var sourceKeys = Object.keys(source);
  5434. var key, i;
  5435. for (i = 0; i < sourceKeys.length; i++) {
  5436. key = sourceKeys[i];
  5437. if (excluded.indexOf(key) >= 0) continue;
  5438. target[key] = source[key];
  5439. }
  5440. return target;
  5441. }
  5442. function _inheritsLoose(subClass, superClass) {
  5443. subClass.prototype = Object.create(superClass.prototype);
  5444. subClass.prototype.constructor = subClass;
  5445. subClass.__proto__ = superClass;
  5446. }
  5447. /**
  5448. * The `<ReplaceTransition>` component is a specialized `Transition` component
  5449. * that animates between two children.
  5450. *
  5451. * ```jsx
  5452. * <ReplaceTransition in>
  5453. * <Fade><div>I appear first</div></Fade>
  5454. * <Fade><div>I replace the above</div></Fade>
  5455. * </ReplaceTransition>
  5456. * ```
  5457. */
  5458. var ReplaceTransition =
  5459. /*#__PURE__*/
  5460. function (_React$Component) {
  5461. _inheritsLoose(ReplaceTransition, _React$Component);
  5462. function ReplaceTransition() {
  5463. var _this;
  5464. for (var _len = arguments.length, _args = new Array(_len), _key = 0; _key < _len; _key++) {
  5465. _args[_key] = arguments[_key];
  5466. }
  5467. _this = _React$Component.call.apply(_React$Component, [this].concat(_args)) || this;
  5468. _this.handleEnter = function () {
  5469. for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
  5470. args[_key2] = arguments[_key2];
  5471. }
  5472. return _this.handleLifecycle('onEnter', 0, args);
  5473. };
  5474. _this.handleEntering = function () {
  5475. for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
  5476. args[_key3] = arguments[_key3];
  5477. }
  5478. return _this.handleLifecycle('onEntering', 0, args);
  5479. };
  5480. _this.handleEntered = function () {
  5481. for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
  5482. args[_key4] = arguments[_key4];
  5483. }
  5484. return _this.handleLifecycle('onEntered', 0, args);
  5485. };
  5486. _this.handleExit = function () {
  5487. for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
  5488. args[_key5] = arguments[_key5];
  5489. }
  5490. return _this.handleLifecycle('onExit', 1, args);
  5491. };
  5492. _this.handleExiting = function () {
  5493. for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
  5494. args[_key6] = arguments[_key6];
  5495. }
  5496. return _this.handleLifecycle('onExiting', 1, args);
  5497. };
  5498. _this.handleExited = function () {
  5499. for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
  5500. args[_key7] = arguments[_key7];
  5501. }
  5502. return _this.handleLifecycle('onExited', 1, args);
  5503. };
  5504. return _this;
  5505. }
  5506. var _proto = ReplaceTransition.prototype;
  5507. _proto.handleLifecycle = function handleLifecycle(handler, idx, originalArgs) {
  5508. var _child$props;
  5509. var children = this.props.children;
  5510. var child = _react.default.Children.toArray(children)[idx];
  5511. if (child.props[handler]) (_child$props = child.props)[handler].apply(_child$props, originalArgs);
  5512. if (this.props[handler]) this.props[handler]((0, ReactDOM.findDOMNode)(this));
  5513. };
  5514. _proto.render = function render() {
  5515. var _this$props = this.props,
  5516. children = _this$props.children,
  5517. inProp = _this$props.in,
  5518. props = _objectWithoutPropertiesLoose(_this$props, ["children", "in"]);
  5519. var _React$Children$toArr = _react.default.Children.toArray(children),
  5520. first = _React$Children$toArr[0],
  5521. second = _React$Children$toArr[1];
  5522. delete props.onEnter;
  5523. delete props.onEntering;
  5524. delete props.onEntered;
  5525. delete props.onExit;
  5526. delete props.onExiting;
  5527. delete props.onExited;
  5528. return _react.default.createElement(_TransitionGroup.default, props, inProp ? _react.default.cloneElement(first, {
  5529. key: 'first',
  5530. onEnter: this.handleEnter,
  5531. onEntering: this.handleEntering,
  5532. onEntered: this.handleEntered
  5533. }) : _react.default.cloneElement(second, {
  5534. key: 'second',
  5535. onEnter: this.handleExit,
  5536. onEntering: this.handleExiting,
  5537. onEntered: this.handleExited
  5538. }));
  5539. };
  5540. return ReplaceTransition;
  5541. }(_react.default.Component);
  5542. ReplaceTransition.propTypes = {};
  5543. var _default = ReplaceTransition;
  5544. exports.default = _default;
  5545. module.exports = exports["default"];
  5546. });
  5547. unwrapExports(ReplaceTransition_1);
  5548. var reactTransitionGroup = createCommonjsModule(function (module) {
  5549. var _CSSTransition = _interopRequireDefault(CSSTransition_1);
  5550. var _ReplaceTransition = _interopRequireDefault(ReplaceTransition_1);
  5551. var _TransitionGroup = _interopRequireDefault(TransitionGroup_1);
  5552. var _Transition = _interopRequireDefault(Transition_1);
  5553. function _interopRequireDefault(obj) {
  5554. return obj && obj.__esModule ? obj : {
  5555. default: obj
  5556. };
  5557. }
  5558. module.exports = {
  5559. Transition: _Transition.default,
  5560. TransitionGroup: _TransitionGroup.default,
  5561. ReplaceTransition: _ReplaceTransition.default,
  5562. CSSTransition: _CSSTransition.default
  5563. };
  5564. });
  5565. unwrapExports(reactTransitionGroup);
  5566. var reactTransitionGroup_1 = reactTransitionGroup.Transition;
  5567. var reactTransitionGroup_2 = reactTransitionGroup.TransitionGroup;
  5568. var reactTransitionGroup_3 = reactTransitionGroup.ReplaceTransition;
  5569. var reactTransitionGroup_4 = reactTransitionGroup.CSSTransition;
  5570. var propTypes$k = _extends({}, reactTransitionGroup_1.propTypes, {
  5571. children: propTypes.oneOfType([propTypes.arrayOf(propTypes.node), propTypes.node]),
  5572. tag: tagPropType,
  5573. baseClass: propTypes.string,
  5574. baseClassActive: propTypes.string,
  5575. className: propTypes.string,
  5576. cssModule: propTypes.object,
  5577. innerRef: propTypes.oneOfType([propTypes.object, propTypes.string, propTypes.func])
  5578. });
  5579. var defaultProps$i = _extends({}, reactTransitionGroup_1.defaultProps, {
  5580. tag: 'div',
  5581. baseClass: 'fade',
  5582. baseClassActive: 'show',
  5583. timeout: TransitionTimeouts.Fade,
  5584. appear: true,
  5585. enter: true,
  5586. exit: true,
  5587. in: true
  5588. });
  5589. function Fade(props) {
  5590. var Tag = props.tag,
  5591. baseClass = props.baseClass,
  5592. baseClassActive = props.baseClassActive,
  5593. className = props.className,
  5594. cssModule = props.cssModule,
  5595. children = props.children,
  5596. innerRef = props.innerRef,
  5597. otherProps = _objectWithoutPropertiesLoose(props, ["tag", "baseClass", "baseClassActive", "className", "cssModule", "children", "innerRef"]);
  5598. var transitionProps = pick(otherProps, TransitionPropTypeKeys);
  5599. var childProps = omit(otherProps, TransitionPropTypeKeys);
  5600. return React__default.createElement(reactTransitionGroup_1, transitionProps, function (status) {
  5601. var isActive = status === 'entered';
  5602. var classes = mapToCssModules(classnames(className, baseClass, isActive && baseClassActive), cssModule);
  5603. return React__default.createElement(Tag, _extends({
  5604. className: classes
  5605. }, childProps, {
  5606. ref: innerRef
  5607. }), children);
  5608. });
  5609. }
  5610. Fade.propTypes = propTypes$k;
  5611. Fade.defaultProps = defaultProps$i;
  5612. var propTypes$l = {
  5613. color: propTypes.string,
  5614. pill: propTypes.bool,
  5615. tag: tagPropType,
  5616. innerRef: propTypes.oneOfType([propTypes.object, propTypes.func, propTypes.string]),
  5617. children: propTypes.node,
  5618. className: propTypes.string,
  5619. cssModule: propTypes.object
  5620. };
  5621. var defaultProps$j = {
  5622. color: 'secondary',
  5623. pill: false,
  5624. tag: 'span'
  5625. };
  5626. var Badge = function Badge(props) {
  5627. var className = props.className,
  5628. cssModule = props.cssModule,
  5629. color = props.color,
  5630. innerRef = props.innerRef,
  5631. pill = props.pill,
  5632. Tag = props.tag,
  5633. attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "color", "innerRef", "pill", "tag"]);
  5634. var classes = mapToCssModules(classnames(className, 'badge', 'badge-' + color, pill ? 'badge-pill' : false), cssModule);
  5635. if (attributes.href && Tag === 'span') {
  5636. Tag = 'a';
  5637. }
  5638. return React__default.createElement(Tag, _extends({}, attributes, {
  5639. className: classes,
  5640. ref: innerRef
  5641. }));
  5642. };
  5643. Badge.propTypes = propTypes$l;
  5644. Badge.defaultProps = defaultProps$j;
  5645. var propTypes$m = {
  5646. tag: tagPropType,
  5647. inverse: propTypes.bool,
  5648. color: propTypes.string,
  5649. block: deprecated(propTypes.bool, 'Please use the props "body"'),
  5650. body: propTypes.bool,
  5651. outline: propTypes.bool,
  5652. className: propTypes.string,
  5653. cssModule: propTypes.object,
  5654. innerRef: propTypes.oneOfType([propTypes.object, propTypes.string, propTypes.func])
  5655. };
  5656. var defaultProps$k = {
  5657. tag: 'div'
  5658. };
  5659. var Card = function Card(props) {
  5660. var className = props.className,
  5661. cssModule = props.cssModule,
  5662. color = props.color,
  5663. block = props.block,
  5664. body = props.body,
  5665. inverse = props.inverse,
  5666. outline = props.outline,
  5667. Tag = props.tag,
  5668. innerRef = props.innerRef,
  5669. attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "color", "block", "body", "inverse", "outline", "tag", "innerRef"]);
  5670. var classes = mapToCssModules(classnames(className, 'card', inverse ? 'text-white' : false, block || body ? 'card-body' : false, color ? (outline ? 'border' : 'bg') + "-" + color : false), cssModule);
  5671. return React__default.createElement(Tag, _extends({}, attributes, {
  5672. className: classes,
  5673. ref: innerRef
  5674. }));
  5675. };
  5676. Card.propTypes = propTypes$m;
  5677. Card.defaultProps = defaultProps$k;
  5678. var propTypes$n = {
  5679. tag: tagPropType,
  5680. className: propTypes.string,
  5681. cssModule: propTypes.object
  5682. };
  5683. var defaultProps$l = {
  5684. tag: 'div'
  5685. };
  5686. var CardGroup = function CardGroup(props) {
  5687. var className = props.className,
  5688. cssModule = props.cssModule,
  5689. Tag = props.tag,
  5690. attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
  5691. var classes = mapToCssModules(classnames(className, 'card-group'), cssModule);
  5692. return React__default.createElement(Tag, _extends({}, attributes, {
  5693. className: classes
  5694. }));
  5695. };
  5696. CardGroup.propTypes = propTypes$n;
  5697. CardGroup.defaultProps = defaultProps$l;
  5698. var propTypes$o = {
  5699. tag: tagPropType,
  5700. className: propTypes.string,
  5701. cssModule: propTypes.object
  5702. };
  5703. var defaultProps$m = {
  5704. tag: 'div'
  5705. };
  5706. var CardDeck = function CardDeck(props) {
  5707. var className = props.className,
  5708. cssModule = props.cssModule,
  5709. Tag = props.tag,
  5710. attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
  5711. var classes = mapToCssModules(classnames(className, 'card-deck'), cssModule);
  5712. return React__default.createElement(Tag, _extends({}, attributes, {
  5713. className: classes
  5714. }));
  5715. };
  5716. CardDeck.propTypes = propTypes$o;
  5717. CardDeck.defaultProps = defaultProps$m;
  5718. var propTypes$p = {
  5719. tag: tagPropType,
  5720. className: propTypes.string,
  5721. cssModule: propTypes.object
  5722. };
  5723. var defaultProps$n = {
  5724. tag: 'div'
  5725. };
  5726. var CardColumns = function CardColumns(props) {
  5727. var className = props.className,
  5728. cssModule = props.cssModule,
  5729. Tag = props.tag,
  5730. attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
  5731. var classes = mapToCssModules(classnames(className, 'card-columns'), cssModule);
  5732. return React__default.createElement(Tag, _extends({}, attributes, {
  5733. className: classes
  5734. }));
  5735. };
  5736. CardColumns.propTypes = propTypes$p;
  5737. CardColumns.defaultProps = defaultProps$n;
  5738. var propTypes$q = {
  5739. tag: tagPropType,
  5740. className: propTypes.string,
  5741. cssModule: propTypes.object,
  5742. innerRef: propTypes.oneOfType([propTypes.object, propTypes.string, propTypes.func])
  5743. };
  5744. var defaultProps$o = {
  5745. tag: 'div'
  5746. };
  5747. var CardBody = function CardBody(props) {
  5748. var className = props.className,
  5749. cssModule = props.cssModule,
  5750. innerRef = props.innerRef,
  5751. Tag = props.tag,
  5752. attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "innerRef", "tag"]);
  5753. var classes = mapToCssModules(classnames(className, 'card-body'), cssModule);
  5754. return React__default.createElement(Tag, _extends({}, attributes, {
  5755. className: classes,
  5756. ref: innerRef
  5757. }));
  5758. };
  5759. CardBody.propTypes = propTypes$q;
  5760. CardBody.defaultProps = defaultProps$o;
  5761. function CardBlock(props) {
  5762. warnOnce('The "CardBlock" component has been deprecated.\nPlease use component "CardBody".');
  5763. return React__default.createElement(CardBody, props);
  5764. }
  5765. var propTypes$r = {
  5766. tag: tagPropType,
  5767. innerRef: propTypes.oneOfType([propTypes.object, propTypes.func, propTypes.string]),
  5768. className: propTypes.string,
  5769. cssModule: propTypes.object
  5770. };
  5771. var defaultProps$p = {
  5772. tag: 'a'
  5773. };
  5774. var CardLink = function CardLink(props) {
  5775. var className = props.className,
  5776. cssModule = props.cssModule,
  5777. Tag = props.tag,
  5778. innerRef = props.innerRef,
  5779. attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag", "innerRef"]);
  5780. var classes = mapToCssModules(classnames(className, 'card-link'), cssModule);
  5781. return React__default.createElement(Tag, _extends({}, attributes, {
  5782. ref: innerRef,
  5783. className: classes
  5784. }));
  5785. };
  5786. CardLink.propTypes = propTypes$r;
  5787. CardLink.defaultProps = defaultProps$p;
  5788. var propTypes$s = {
  5789. tag: tagPropType,
  5790. className: propTypes.string,
  5791. cssModule: propTypes.object
  5792. };
  5793. var defaultProps$q = {
  5794. tag: 'div'
  5795. };
  5796. var CardFooter = function CardFooter(props) {
  5797. var className = props.className,
  5798. cssModule = props.cssModule,
  5799. Tag = props.tag,
  5800. attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
  5801. var classes = mapToCssModules(classnames(className, 'card-footer'), cssModule);
  5802. return React__default.createElement(Tag, _extends({}, attributes, {
  5803. className: classes
  5804. }));
  5805. };
  5806. CardFooter.propTypes = propTypes$s;
  5807. CardFooter.defaultProps = defaultProps$q;
  5808. var propTypes$t = {
  5809. tag: tagPropType,
  5810. className: propTypes.string,
  5811. cssModule: propTypes.object
  5812. };
  5813. var defaultProps$r = {
  5814. tag: 'div'
  5815. };
  5816. var CardHeader = function CardHeader(props) {
  5817. var className = props.className,
  5818. cssModule = props.cssModule,
  5819. Tag = props.tag,
  5820. attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
  5821. var classes = mapToCssModules(classnames(className, 'card-header'), cssModule);
  5822. return React__default.createElement(Tag, _extends({}, attributes, {
  5823. className: classes
  5824. }));
  5825. };
  5826. CardHeader.propTypes = propTypes$t;
  5827. CardHeader.defaultProps = defaultProps$r;
  5828. var propTypes$u = {
  5829. tag: tagPropType,
  5830. top: propTypes.bool,
  5831. bottom: propTypes.bool,
  5832. className: propTypes.string,
  5833. cssModule: propTypes.object
  5834. };
  5835. var defaultProps$s = {
  5836. tag: 'img'
  5837. };
  5838. var CardImg = function CardImg(props) {
  5839. var className = props.className,
  5840. cssModule = props.cssModule,
  5841. top = props.top,
  5842. bottom = props.bottom,
  5843. Tag = props.tag,
  5844. attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "top", "bottom", "tag"]);
  5845. var cardImgClassName = 'card-img';
  5846. if (top) {
  5847. cardImgClassName = 'card-img-top';
  5848. }
  5849. if (bottom) {
  5850. cardImgClassName = 'card-img-bottom';
  5851. }
  5852. var classes = mapToCssModules(classnames(className, cardImgClassName), cssModule);
  5853. return React__default.createElement(Tag, _extends({}, attributes, {
  5854. className: classes
  5855. }));
  5856. };
  5857. CardImg.propTypes = propTypes$u;
  5858. CardImg.defaultProps = defaultProps$s;
  5859. var propTypes$v = {
  5860. tag: tagPropType,
  5861. className: propTypes.string,
  5862. cssModule: propTypes.object
  5863. };
  5864. var defaultProps$t = {
  5865. tag: 'div'
  5866. };
  5867. var CardImgOverlay = function CardImgOverlay(props) {
  5868. var className = props.className,
  5869. cssModule = props.cssModule,
  5870. Tag = props.tag,
  5871. attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
  5872. var classes = mapToCssModules(classnames(className, 'card-img-overlay'), cssModule);
  5873. return React__default.createElement(Tag, _extends({}, attributes, {
  5874. className: classes
  5875. }));
  5876. };
  5877. CardImgOverlay.propTypes = propTypes$v;
  5878. CardImgOverlay.defaultProps = defaultProps$t;
  5879. var CarouselItem =
  5880. /*#__PURE__*/
  5881. function (_React$Component) {
  5882. _inheritsLoose(CarouselItem, _React$Component);
  5883. function CarouselItem(props) {
  5884. var _this;
  5885. _this = _React$Component.call(this, props) || this;
  5886. _this.state = {
  5887. startAnimation: false
  5888. };
  5889. _this.onEnter = _this.onEnter.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  5890. _this.onEntering = _this.onEntering.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  5891. _this.onExit = _this.onExit.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  5892. _this.onExiting = _this.onExiting.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  5893. _this.onExited = _this.onExited.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  5894. return _this;
  5895. }
  5896. var _proto = CarouselItem.prototype;
  5897. _proto.onEnter = function onEnter(node, isAppearing) {
  5898. this.setState({
  5899. startAnimation: false
  5900. });
  5901. this.props.onEnter(node, isAppearing);
  5902. };
  5903. _proto.onEntering = function onEntering(node, isAppearing) {
  5904. // getting this variable triggers a reflow
  5905. var offsetHeight = node.offsetHeight;
  5906. this.setState({
  5907. startAnimation: true
  5908. });
  5909. this.props.onEntering(node, isAppearing);
  5910. return offsetHeight;
  5911. };
  5912. _proto.onExit = function onExit(node) {
  5913. this.setState({
  5914. startAnimation: false
  5915. });
  5916. this.props.onExit(node);
  5917. };
  5918. _proto.onExiting = function onExiting(node) {
  5919. this.setState({
  5920. startAnimation: true
  5921. });
  5922. node.dispatchEvent(new CustomEvent('slide.bs.carousel'));
  5923. this.props.onExiting(node);
  5924. };
  5925. _proto.onExited = function onExited(node) {
  5926. node.dispatchEvent(new CustomEvent('slid.bs.carousel'));
  5927. this.props.onExited(node);
  5928. };
  5929. _proto.render = function render() {
  5930. var _this2 = this;
  5931. var _this$props = this.props,
  5932. isIn = _this$props.in,
  5933. children = _this$props.children,
  5934. cssModule = _this$props.cssModule,
  5935. slide = _this$props.slide,
  5936. Tag = _this$props.tag,
  5937. className = _this$props.className,
  5938. transitionProps = _objectWithoutPropertiesLoose(_this$props, ["in", "children", "cssModule", "slide", "tag", "className"]);
  5939. return React__default.createElement(reactTransitionGroup_1, _extends({}, transitionProps, {
  5940. enter: slide,
  5941. exit: slide,
  5942. in: isIn,
  5943. onEnter: this.onEnter,
  5944. onEntering: this.onEntering,
  5945. onExit: this.onExit,
  5946. onExiting: this.onExiting,
  5947. onExited: this.onExited
  5948. }), function (status) {
  5949. var direction = _this2.context.direction;
  5950. var isActive = status === TransitionStatuses.ENTERED || status === TransitionStatuses.EXITING;
  5951. var directionClassName = (status === TransitionStatuses.ENTERING || status === TransitionStatuses.EXITING) && _this2.state.startAnimation && (direction === 'right' ? 'carousel-item-left' : 'carousel-item-right');
  5952. var orderClassName = status === TransitionStatuses.ENTERING && (direction === 'right' ? 'carousel-item-next' : 'carousel-item-prev');
  5953. var itemClasses = mapToCssModules(classnames(className, 'carousel-item', isActive && 'active', directionClassName, orderClassName), cssModule);
  5954. return React__default.createElement(Tag, {
  5955. className: itemClasses
  5956. }, children);
  5957. });
  5958. };
  5959. return CarouselItem;
  5960. }(React__default.Component);
  5961. CarouselItem.propTypes = _extends({}, reactTransitionGroup_1.propTypes, {
  5962. tag: tagPropType,
  5963. in: propTypes.bool,
  5964. cssModule: propTypes.object,
  5965. children: propTypes.node,
  5966. slide: propTypes.bool,
  5967. className: propTypes.string
  5968. });
  5969. CarouselItem.defaultProps = _extends({}, reactTransitionGroup_1.defaultProps, {
  5970. tag: 'div',
  5971. timeout: TransitionTimeouts.Carousel,
  5972. slide: true
  5973. });
  5974. CarouselItem.contextTypes = {
  5975. direction: propTypes.string
  5976. };
  5977. var Carousel =
  5978. /*#__PURE__*/
  5979. function (_React$Component) {
  5980. _inheritsLoose(Carousel, _React$Component);
  5981. function Carousel(props) {
  5982. var _this;
  5983. _this = _React$Component.call(this, props) || this;
  5984. _this.handleKeyPress = _this.handleKeyPress.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  5985. _this.renderItems = _this.renderItems.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  5986. _this.hoverStart = _this.hoverStart.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  5987. _this.hoverEnd = _this.hoverEnd.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  5988. _this.state = {
  5989. direction: 'right',
  5990. indicatorClicked: false
  5991. };
  5992. return _this;
  5993. }
  5994. var _proto = Carousel.prototype;
  5995. _proto.getChildContext = function getChildContext() {
  5996. return {
  5997. direction: this.state.direction
  5998. };
  5999. };
  6000. _proto.componentDidMount = function componentDidMount() {
  6001. // Set up the cycle
  6002. if (this.props.ride === 'carousel') {
  6003. this.setInterval();
  6004. } // TODO: move this to the specific carousel like bootstrap. Currently it will trigger ALL carousels on the page.
  6005. document.addEventListener('keyup', this.handleKeyPress);
  6006. };
  6007. _proto.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
  6008. this.setInterval(nextProps); // Calculate the direction to turn
  6009. if (this.props.activeIndex + 1 === nextProps.activeIndex) {
  6010. this.setState({
  6011. direction: 'right'
  6012. });
  6013. } else if (this.props.activeIndex - 1 === nextProps.activeIndex) {
  6014. this.setState({
  6015. direction: 'left'
  6016. });
  6017. } else if (this.props.activeIndex > nextProps.activeIndex) {
  6018. this.setState({
  6019. direction: this.state.indicatorClicked ? 'left' : 'right'
  6020. });
  6021. } else if (this.props.activeIndex !== nextProps.activeIndex) {
  6022. this.setState({
  6023. direction: this.state.indicatorClicked ? 'right' : 'left'
  6024. });
  6025. }
  6026. this.setState({
  6027. indicatorClicked: false
  6028. });
  6029. };
  6030. _proto.componentWillUnmount = function componentWillUnmount() {
  6031. this.clearInterval();
  6032. document.removeEventListener('keyup', this.handleKeyPress);
  6033. };
  6034. _proto.setInterval = function (_setInterval) {
  6035. function setInterval() {
  6036. return _setInterval.apply(this, arguments);
  6037. }
  6038. setInterval.toString = function () {
  6039. return _setInterval.toString();
  6040. };
  6041. return setInterval;
  6042. }(function (props) {
  6043. if (props === void 0) {
  6044. props = this.props;
  6045. }
  6046. // make sure not to have multiple intervals going...
  6047. this.clearInterval();
  6048. if (props.interval) {
  6049. this.cycleInterval = setInterval(function () {
  6050. props.next();
  6051. }, parseInt(props.interval, 10));
  6052. }
  6053. });
  6054. _proto.clearInterval = function (_clearInterval) {
  6055. function clearInterval() {
  6056. return _clearInterval.apply(this, arguments);
  6057. }
  6058. clearInterval.toString = function () {
  6059. return _clearInterval.toString();
  6060. };
  6061. return clearInterval;
  6062. }(function () {
  6063. clearInterval(this.cycleInterval);
  6064. });
  6065. _proto.hoverStart = function hoverStart() {
  6066. if (this.props.pause === 'hover') {
  6067. this.clearInterval();
  6068. }
  6069. if (this.props.mouseEnter) {
  6070. var _this$props;
  6071. (_this$props = this.props).mouseEnter.apply(_this$props, arguments);
  6072. }
  6073. };
  6074. _proto.hoverEnd = function hoverEnd() {
  6075. if (this.props.pause === 'hover') {
  6076. this.setInterval();
  6077. }
  6078. if (this.props.mouseLeave) {
  6079. var _this$props2;
  6080. (_this$props2 = this.props).mouseLeave.apply(_this$props2, arguments);
  6081. }
  6082. };
  6083. _proto.handleKeyPress = function handleKeyPress(evt) {
  6084. if (this.props.keyboard) {
  6085. if (evt.keyCode === 37) {
  6086. this.props.previous();
  6087. } else if (evt.keyCode === 39) {
  6088. this.props.next();
  6089. }
  6090. }
  6091. };
  6092. _proto.renderItems = function renderItems(carouselItems, className) {
  6093. var _this2 = this;
  6094. var slide = this.props.slide;
  6095. return React__default.createElement("div", {
  6096. role: "listbox",
  6097. className: className
  6098. }, carouselItems.map(function (item, index) {
  6099. var isIn = index === _this2.props.activeIndex;
  6100. return React__default.cloneElement(item, {
  6101. in: isIn,
  6102. slide: slide
  6103. });
  6104. }));
  6105. };
  6106. _proto.render = function render() {
  6107. var _this3 = this;
  6108. var _this$props3 = this.props,
  6109. cssModule = _this$props3.cssModule,
  6110. slide = _this$props3.slide,
  6111. className = _this$props3.className;
  6112. var outerClasses = mapToCssModules(classnames(className, 'carousel', slide && 'slide'), cssModule);
  6113. var innerClasses = mapToCssModules(classnames('carousel-inner'), cssModule); // filter out booleans, null, or undefined
  6114. var children = this.props.children.filter(function (child) {
  6115. return child !== null && child !== undefined && typeof child !== 'boolean';
  6116. });
  6117. var slidesOnly = children.every(function (child) {
  6118. return child.type === CarouselItem;
  6119. }); // Rendering only slides
  6120. if (slidesOnly) {
  6121. return React__default.createElement("div", {
  6122. className: outerClasses,
  6123. onMouseEnter: this.hoverStart,
  6124. onMouseLeave: this.hoverEnd
  6125. }, this.renderItems(children, innerClasses));
  6126. } // Rendering slides and controls
  6127. if (children[0] instanceof Array) {
  6128. var _carouselItems = children[0];
  6129. var _controlLeft = children[1];
  6130. var _controlRight = children[2];
  6131. return React__default.createElement("div", {
  6132. className: outerClasses,
  6133. onMouseEnter: this.hoverStart,
  6134. onMouseLeave: this.hoverEnd
  6135. }, this.renderItems(_carouselItems, innerClasses), _controlLeft, _controlRight);
  6136. } // Rendering indicators, slides and controls
  6137. var indicators = children[0];
  6138. var wrappedOnClick = function wrappedOnClick(e) {
  6139. if (typeof indicators.props.onClickHandler === 'function') {
  6140. _this3.setState({
  6141. indicatorClicked: true
  6142. }, function () {
  6143. return indicators.props.onClickHandler(e);
  6144. });
  6145. }
  6146. };
  6147. var wrappedIndicators = React__default.cloneElement(indicators, {
  6148. onClickHandler: wrappedOnClick
  6149. });
  6150. var carouselItems = children[1];
  6151. var controlLeft = children[2];
  6152. var controlRight = children[3];
  6153. return React__default.createElement("div", {
  6154. className: outerClasses,
  6155. onMouseEnter: this.hoverStart,
  6156. onMouseLeave: this.hoverEnd
  6157. }, wrappedIndicators, this.renderItems(carouselItems, innerClasses), controlLeft, controlRight);
  6158. };
  6159. return Carousel;
  6160. }(React__default.Component);
  6161. Carousel.propTypes = {
  6162. // the current active slide of the carousel
  6163. activeIndex: propTypes.number,
  6164. // a function which should advance the carousel to the next slide (via activeIndex)
  6165. next: propTypes.func.isRequired,
  6166. // a function which should advance the carousel to the previous slide (via activeIndex)
  6167. previous: propTypes.func.isRequired,
  6168. // controls if the left and right arrow keys should control the carousel
  6169. keyboard: propTypes.bool,
  6170. /* If set to "hover", pauses the cycling of the carousel on mouseenter and resumes the cycling of the carousel on
  6171. * mouseleave. If set to false, hovering over the carousel won't pause it. (default: "hover")
  6172. */
  6173. pause: propTypes.oneOf(['hover', false]),
  6174. // Autoplays the carousel after the user manually cycles the first item. If "carousel", autoplays the carousel on load.
  6175. // This is how bootstrap defines it... I would prefer a bool named autoplay or something...
  6176. ride: propTypes.oneOf(['carousel']),
  6177. // the interval at which the carousel automatically cycles (default: 5000)
  6178. // eslint-disable-next-line react/no-unused-prop-types
  6179. interval: propTypes.oneOfType([propTypes.number, propTypes.string, propTypes.bool]),
  6180. children: propTypes.array,
  6181. // called when the mouse enters the Carousel
  6182. mouseEnter: propTypes.func,
  6183. // called when the mouse exits the Carousel
  6184. mouseLeave: propTypes.func,
  6185. // controls whether the slide animation on the Carousel works or not
  6186. slide: propTypes.bool,
  6187. cssModule: propTypes.object,
  6188. className: propTypes.string
  6189. };
  6190. Carousel.defaultProps = {
  6191. interval: 5000,
  6192. pause: 'hover',
  6193. keyboard: true,
  6194. slide: true
  6195. };
  6196. Carousel.childContextTypes = {
  6197. direction: propTypes.string
  6198. };
  6199. var CarouselControl = function CarouselControl(props) {
  6200. var direction = props.direction,
  6201. onClickHandler = props.onClickHandler,
  6202. cssModule = props.cssModule,
  6203. directionText = props.directionText,
  6204. className = props.className;
  6205. var anchorClasses = mapToCssModules(classnames(className, "carousel-control-" + direction), cssModule);
  6206. var iconClasses = mapToCssModules(classnames("carousel-control-" + direction + "-icon"), cssModule);
  6207. var screenReaderClasses = mapToCssModules(classnames('sr-only'), cssModule);
  6208. return React__default.createElement("a", {
  6209. className: anchorClasses,
  6210. role: "button",
  6211. tabIndex: "0",
  6212. onClick: function onClick(e) {
  6213. e.preventDefault();
  6214. onClickHandler();
  6215. }
  6216. }, React__default.createElement("span", {
  6217. className: iconClasses,
  6218. "aria-hidden": "true"
  6219. }), React__default.createElement("span", {
  6220. className: screenReaderClasses
  6221. }, directionText || direction));
  6222. };
  6223. CarouselControl.propTypes = {
  6224. direction: propTypes.oneOf(['prev', 'next']).isRequired,
  6225. onClickHandler: propTypes.func.isRequired,
  6226. cssModule: propTypes.object,
  6227. directionText: propTypes.string,
  6228. className: propTypes.string
  6229. };
  6230. var CarouselIndicators = function CarouselIndicators(props) {
  6231. var items = props.items,
  6232. activeIndex = props.activeIndex,
  6233. cssModule = props.cssModule,
  6234. onClickHandler = props.onClickHandler,
  6235. className = props.className;
  6236. var listClasses = mapToCssModules(classnames(className, 'carousel-indicators'), cssModule);
  6237. var indicators = items.map(function (item, idx) {
  6238. var indicatorClasses = mapToCssModules(classnames({
  6239. active: activeIndex === idx
  6240. }), cssModule);
  6241. return React__default.createElement("li", {
  6242. key: "" + (item.key || Object.values(item).join('')),
  6243. onClick: function onClick(e) {
  6244. e.preventDefault();
  6245. onClickHandler(idx);
  6246. },
  6247. className: indicatorClasses
  6248. });
  6249. });
  6250. return React__default.createElement("ol", {
  6251. className: listClasses
  6252. }, indicators);
  6253. };
  6254. CarouselIndicators.propTypes = {
  6255. items: propTypes.array.isRequired,
  6256. activeIndex: propTypes.number.isRequired,
  6257. cssModule: propTypes.object,
  6258. onClickHandler: propTypes.func.isRequired,
  6259. className: propTypes.string
  6260. };
  6261. var CarouselCaption = function CarouselCaption(props) {
  6262. var captionHeader = props.captionHeader,
  6263. captionText = props.captionText,
  6264. cssModule = props.cssModule,
  6265. className = props.className;
  6266. var classes = mapToCssModules(classnames(className, 'carousel-caption', 'd-none', 'd-md-block'), cssModule);
  6267. return React__default.createElement("div", {
  6268. className: classes
  6269. }, React__default.createElement("h3", null, captionHeader), React__default.createElement("p", null, captionText));
  6270. };
  6271. CarouselCaption.propTypes = {
  6272. captionHeader: propTypes.string,
  6273. captionText: propTypes.string.isRequired,
  6274. cssModule: propTypes.object,
  6275. className: propTypes.string
  6276. };
  6277. var propTypes$w = {
  6278. items: propTypes.array.isRequired,
  6279. indicators: propTypes.bool,
  6280. controls: propTypes.bool,
  6281. autoPlay: propTypes.bool,
  6282. defaultActiveIndex: propTypes.number,
  6283. activeIndex: propTypes.number,
  6284. next: propTypes.func,
  6285. previous: propTypes.func,
  6286. goToIndex: propTypes.func
  6287. };
  6288. var UncontrolledCarousel =
  6289. /*#__PURE__*/
  6290. function (_Component) {
  6291. _inheritsLoose(UncontrolledCarousel, _Component);
  6292. function UncontrolledCarousel(props) {
  6293. var _this;
  6294. _this = _Component.call(this, props) || this;
  6295. _this.animating = false;
  6296. _this.state = {
  6297. activeIndex: props.defaultActiveIndex || 0
  6298. };
  6299. _this.next = _this.next.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  6300. _this.previous = _this.previous.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  6301. _this.goToIndex = _this.goToIndex.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  6302. _this.onExiting = _this.onExiting.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  6303. _this.onExited = _this.onExited.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  6304. return _this;
  6305. }
  6306. var _proto = UncontrolledCarousel.prototype;
  6307. _proto.onExiting = function onExiting() {
  6308. this.animating = true;
  6309. };
  6310. _proto.onExited = function onExited() {
  6311. this.animating = false;
  6312. };
  6313. _proto.next = function next() {
  6314. if (this.animating) return;
  6315. var nextIndex = this.state.activeIndex === this.props.items.length - 1 ? 0 : this.state.activeIndex + 1;
  6316. this.setState({
  6317. activeIndex: nextIndex
  6318. });
  6319. };
  6320. _proto.previous = function previous() {
  6321. if (this.animating) return;
  6322. var nextIndex = this.state.activeIndex === 0 ? this.props.items.length - 1 : this.state.activeIndex - 1;
  6323. this.setState({
  6324. activeIndex: nextIndex
  6325. });
  6326. };
  6327. _proto.goToIndex = function goToIndex(newIndex) {
  6328. if (this.animating) return;
  6329. this.setState({
  6330. activeIndex: newIndex
  6331. });
  6332. };
  6333. _proto.render = function render() {
  6334. var _this2 = this;
  6335. var _this$props = this.props,
  6336. defaultActiveIndex = _this$props.defaultActiveIndex,
  6337. autoPlay = _this$props.autoPlay,
  6338. indicators = _this$props.indicators,
  6339. controls = _this$props.controls,
  6340. items = _this$props.items,
  6341. goToIndex = _this$props.goToIndex,
  6342. props = _objectWithoutPropertiesLoose(_this$props, ["defaultActiveIndex", "autoPlay", "indicators", "controls", "items", "goToIndex"]);
  6343. var activeIndex = this.state.activeIndex;
  6344. var slides = items.map(function (item) {
  6345. return React__default.createElement(CarouselItem, {
  6346. onExiting: _this2.onExiting,
  6347. onExited: _this2.onExited,
  6348. key: item.src
  6349. }, React__default.createElement("img", {
  6350. className: "d-block w-100",
  6351. src: item.src,
  6352. alt: item.altText
  6353. }), React__default.createElement(CarouselCaption, {
  6354. captionText: item.caption,
  6355. captionHeader: item.header || item.caption
  6356. }));
  6357. });
  6358. return React__default.createElement(Carousel, _extends({
  6359. activeIndex: activeIndex,
  6360. next: this.next,
  6361. previous: this.previous,
  6362. ride: autoPlay ? 'carousel' : undefined
  6363. }, props), indicators && React__default.createElement(CarouselIndicators, {
  6364. items: items,
  6365. activeIndex: props.activeIndex || activeIndex,
  6366. onClickHandler: goToIndex || this.goToIndex
  6367. }), slides, controls && React__default.createElement(CarouselControl, {
  6368. direction: "prev",
  6369. directionText: "Previous",
  6370. onClickHandler: props.previous || this.previous
  6371. }), controls && React__default.createElement(CarouselControl, {
  6372. direction: "next",
  6373. directionText: "Next",
  6374. onClickHandler: props.next || this.next
  6375. }));
  6376. };
  6377. return UncontrolledCarousel;
  6378. }(React.Component);
  6379. UncontrolledCarousel.propTypes = propTypes$w;
  6380. UncontrolledCarousel.defaultProps = {
  6381. controls: true,
  6382. indicators: true,
  6383. autoPlay: true
  6384. };
  6385. var propTypes$x = {
  6386. tag: tagPropType,
  6387. className: propTypes.string,
  6388. cssModule: propTypes.object
  6389. };
  6390. var defaultProps$u = {
  6391. tag: 'div'
  6392. };
  6393. var CardSubtitle = function CardSubtitle(props) {
  6394. var className = props.className,
  6395. cssModule = props.cssModule,
  6396. Tag = props.tag,
  6397. attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
  6398. var classes = mapToCssModules(classnames(className, 'card-subtitle'), cssModule);
  6399. return React__default.createElement(Tag, _extends({}, attributes, {
  6400. className: classes
  6401. }));
  6402. };
  6403. CardSubtitle.propTypes = propTypes$x;
  6404. CardSubtitle.defaultProps = defaultProps$u;
  6405. var propTypes$y = {
  6406. tag: tagPropType,
  6407. className: propTypes.string,
  6408. cssModule: propTypes.object
  6409. };
  6410. var defaultProps$v = {
  6411. tag: 'p'
  6412. };
  6413. var CardText = function CardText(props) {
  6414. var className = props.className,
  6415. cssModule = props.cssModule,
  6416. Tag = props.tag,
  6417. attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
  6418. var classes = mapToCssModules(classnames(className, 'card-text'), cssModule);
  6419. return React__default.createElement(Tag, _extends({}, attributes, {
  6420. className: classes
  6421. }));
  6422. };
  6423. CardText.propTypes = propTypes$y;
  6424. CardText.defaultProps = defaultProps$v;
  6425. var propTypes$z = {
  6426. tag: tagPropType,
  6427. className: propTypes.string,
  6428. cssModule: propTypes.object
  6429. };
  6430. var defaultProps$w = {
  6431. tag: 'div'
  6432. };
  6433. var CardTitle = function CardTitle(props) {
  6434. var className = props.className,
  6435. cssModule = props.cssModule,
  6436. Tag = props.tag,
  6437. attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
  6438. var classes = mapToCssModules(classnames(className, 'card-title'), cssModule);
  6439. return React__default.createElement(Tag, _extends({}, attributes, {
  6440. className: classes
  6441. }));
  6442. };
  6443. CardTitle.propTypes = propTypes$z;
  6444. CardTitle.defaultProps = defaultProps$w;
  6445. var propTypes$A = {
  6446. className: propTypes.string,
  6447. id: propTypes.oneOfType([propTypes.string, propTypes.number]).isRequired,
  6448. type: propTypes.string.isRequired,
  6449. label: propTypes.node,
  6450. inline: propTypes.bool,
  6451. valid: propTypes.bool,
  6452. invalid: propTypes.bool,
  6453. bsSize: propTypes.string,
  6454. cssModule: propTypes.object,
  6455. children: propTypes.oneOfType([propTypes.node, propTypes.array, propTypes.func]),
  6456. innerRef: propTypes.oneOfType([propTypes.object, propTypes.string, propTypes.func])
  6457. };
  6458. function CustomInput(props) {
  6459. var className = props.className,
  6460. label = props.label,
  6461. inline = props.inline,
  6462. valid = props.valid,
  6463. invalid = props.invalid,
  6464. cssModule = props.cssModule,
  6465. children = props.children,
  6466. bsSize = props.bsSize,
  6467. innerRef = props.innerRef,
  6468. attributes = _objectWithoutPropertiesLoose(props, ["className", "label", "inline", "valid", "invalid", "cssModule", "children", "bsSize", "innerRef"]);
  6469. var type = attributes.type;
  6470. var customClass = mapToCssModules(classnames(className, "custom-" + type, bsSize ? "custom-" + type + "-" + bsSize : false), cssModule);
  6471. var validationClassNames = mapToCssModules(classnames(invalid && 'is-invalid', valid && 'is-valid'), cssModule);
  6472. if (type === 'select') {
  6473. return React__default.createElement("select", _extends({}, attributes, {
  6474. ref: innerRef,
  6475. className: classnames(validationClassNames, customClass)
  6476. }), children);
  6477. }
  6478. if (type === 'file') {
  6479. return React__default.createElement("div", {
  6480. className: customClass
  6481. }, React__default.createElement("input", _extends({}, attributes, {
  6482. ref: innerRef,
  6483. className: classnames(validationClassNames, mapToCssModules('custom-file-input', cssModule))
  6484. })), React__default.createElement("label", {
  6485. className: mapToCssModules('custom-file-label', cssModule),
  6486. htmlFor: attributes.id
  6487. }, label || 'Choose file'));
  6488. }
  6489. if (type !== 'checkbox' && type !== 'radio' && type !== 'switch') {
  6490. return React__default.createElement("input", _extends({}, attributes, {
  6491. ref: innerRef,
  6492. className: classnames(validationClassNames, customClass)
  6493. }));
  6494. }
  6495. var wrapperClasses = classnames(customClass, mapToCssModules(classnames('custom-control', {
  6496. 'custom-control-inline': inline
  6497. }), cssModule));
  6498. return React__default.createElement("div", {
  6499. className: wrapperClasses
  6500. }, React__default.createElement("input", _extends({}, attributes, {
  6501. type: type === 'switch' ? 'checkbox' : type,
  6502. ref: innerRef,
  6503. className: classnames(validationClassNames, mapToCssModules('custom-control-input', cssModule))
  6504. })), React__default.createElement("label", {
  6505. className: mapToCssModules('custom-control-label', cssModule),
  6506. htmlFor: attributes.id
  6507. }, label), children);
  6508. }
  6509. CustomInput.propTypes = propTypes$A;
  6510. var propTypes$B = {
  6511. children: propTypes.node.isRequired,
  6512. className: propTypes.string,
  6513. placement: propTypes.string,
  6514. placementPrefix: propTypes.string,
  6515. arrowClassName: propTypes.string,
  6516. hideArrow: propTypes.bool,
  6517. tag: tagPropType,
  6518. isOpen: propTypes.bool.isRequired,
  6519. cssModule: propTypes.object,
  6520. offset: propTypes.oneOfType([propTypes.string, propTypes.number]),
  6521. fallbackPlacement: propTypes.oneOfType([propTypes.string, propTypes.array]),
  6522. flip: propTypes.bool,
  6523. container: targetPropType,
  6524. target: targetPropType.isRequired,
  6525. modifiers: propTypes.object,
  6526. boundariesElement: propTypes.oneOfType([propTypes.string, DOMElement])
  6527. };
  6528. var defaultProps$x = {
  6529. boundariesElement: 'scrollParent',
  6530. placement: 'auto',
  6531. hideArrow: false,
  6532. isOpen: false,
  6533. offset: 0,
  6534. fallbackPlacement: 'flip',
  6535. flip: true,
  6536. container: 'body',
  6537. modifiers: {}
  6538. };
  6539. var childContextTypes$1 = {
  6540. popperManager: propTypes.object.isRequired
  6541. };
  6542. var PopperContent =
  6543. /*#__PURE__*/
  6544. function (_React$Component) {
  6545. _inheritsLoose(PopperContent, _React$Component);
  6546. function PopperContent(props) {
  6547. var _this;
  6548. _this = _React$Component.call(this, props) || this;
  6549. _this.handlePlacementChange = _this.handlePlacementChange.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  6550. _this.setTargetNode = _this.setTargetNode.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  6551. _this.getTargetNode = _this.getTargetNode.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  6552. _this.getRef = _this.getRef.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  6553. _this.state = {};
  6554. return _this;
  6555. }
  6556. var _proto = PopperContent.prototype;
  6557. _proto.getChildContext = function getChildContext() {
  6558. return {
  6559. popperManager: {
  6560. setTargetNode: this.setTargetNode,
  6561. getTargetNode: this.getTargetNode
  6562. }
  6563. };
  6564. };
  6565. _proto.componentDidUpdate = function componentDidUpdate() {
  6566. if (this._element && this._element.childNodes && this._element.childNodes[0] && this._element.childNodes[0].focus) {
  6567. this._element.childNodes[0].focus();
  6568. }
  6569. };
  6570. _proto.setTargetNode = function setTargetNode(node) {
  6571. this.targetNode = node;
  6572. };
  6573. _proto.getTargetNode = function getTargetNode() {
  6574. return this.targetNode;
  6575. };
  6576. _proto.getContainerNode = function getContainerNode() {
  6577. return getTarget(this.props.container);
  6578. };
  6579. _proto.getRef = function getRef(ref) {
  6580. this._element = ref;
  6581. };
  6582. _proto.handlePlacementChange = function handlePlacementChange(data) {
  6583. if (this.state.placement !== data.placement) {
  6584. this.setState({
  6585. placement: data.placement
  6586. });
  6587. }
  6588. return data;
  6589. };
  6590. _proto.renderChildren = function renderChildren() {
  6591. var _this$props = this.props,
  6592. cssModule = _this$props.cssModule,
  6593. children = _this$props.children,
  6594. isOpen = _this$props.isOpen,
  6595. flip = _this$props.flip,
  6596. target = _this$props.target,
  6597. offset = _this$props.offset,
  6598. fallbackPlacement = _this$props.fallbackPlacement,
  6599. placementPrefix = _this$props.placementPrefix,
  6600. _arrowClassName = _this$props.arrowClassName,
  6601. hideArrow = _this$props.hideArrow,
  6602. className = _this$props.className,
  6603. tag = _this$props.tag,
  6604. container = _this$props.container,
  6605. modifiers = _this$props.modifiers,
  6606. boundariesElement = _this$props.boundariesElement,
  6607. attrs = _objectWithoutPropertiesLoose(_this$props, ["cssModule", "children", "isOpen", "flip", "target", "offset", "fallbackPlacement", "placementPrefix", "arrowClassName", "hideArrow", "className", "tag", "container", "modifiers", "boundariesElement"]);
  6608. var arrowClassName = mapToCssModules(classnames('arrow', _arrowClassName), cssModule);
  6609. var placement = (this.state.placement || attrs.placement).split('-')[0];
  6610. var popperClassName = mapToCssModules(classnames(className, placementPrefix ? placementPrefix + "-" + placement : placement), this.props.cssModule);
  6611. var extendedModifiers = _extends({
  6612. offset: {
  6613. offset: offset
  6614. },
  6615. flip: {
  6616. enabled: flip,
  6617. behavior: fallbackPlacement
  6618. },
  6619. preventOverflow: {
  6620. boundariesElement: boundariesElement
  6621. },
  6622. update: {
  6623. enabled: true,
  6624. order: 950,
  6625. fn: this.handlePlacementChange
  6626. }
  6627. }, modifiers);
  6628. return React__default.createElement(Popper$1, _extends({
  6629. modifiers: extendedModifiers
  6630. }, attrs, {
  6631. component: tag,
  6632. className: popperClassName,
  6633. "x-placement": this.state.placement || attrs.placement
  6634. }), children, !hideArrow && React__default.createElement(Arrow, {
  6635. className: arrowClassName
  6636. }));
  6637. };
  6638. _proto.render = function render() {
  6639. this.setTargetNode(getTarget(this.props.target));
  6640. if (this.props.isOpen) {
  6641. return this.props.container === 'inline' ? this.renderChildren() : ReactDOM.createPortal(React__default.createElement("div", {
  6642. ref: this.getRef
  6643. }, this.renderChildren()), this.getContainerNode());
  6644. }
  6645. return null;
  6646. };
  6647. return PopperContent;
  6648. }(React__default.Component);
  6649. PopperContent.propTypes = propTypes$B;
  6650. PopperContent.defaultProps = defaultProps$x;
  6651. PopperContent.childContextTypes = childContextTypes$1;
  6652. var PopperTargetHelper = function PopperTargetHelper(props, context) {
  6653. context.popperManager.setTargetNode(getTarget(props.target));
  6654. return null;
  6655. };
  6656. PopperTargetHelper.contextTypes = {
  6657. popperManager: propTypes.object.isRequired
  6658. };
  6659. PopperTargetHelper.propTypes = {
  6660. target: targetPropType.isRequired
  6661. };
  6662. var propTypes$C = {
  6663. placement: propTypes.oneOf(PopperPlacements),
  6664. target: targetPropType.isRequired,
  6665. container: targetPropType,
  6666. isOpen: propTypes.bool,
  6667. disabled: propTypes.bool,
  6668. hideArrow: propTypes.bool,
  6669. boundariesElement: propTypes.oneOfType([propTypes.string, DOMElement]),
  6670. className: propTypes.string,
  6671. innerClassName: propTypes.string,
  6672. arrowClassName: propTypes.string,
  6673. cssModule: propTypes.object,
  6674. toggle: propTypes.func,
  6675. autohide: propTypes.bool,
  6676. placementPrefix: propTypes.string,
  6677. delay: propTypes.oneOfType([propTypes.shape({
  6678. show: propTypes.number,
  6679. hide: propTypes.number
  6680. }), propTypes.number]),
  6681. modifiers: propTypes.object,
  6682. offset: propTypes.oneOfType([propTypes.string, propTypes.number]),
  6683. innerRef: propTypes.oneOfType([propTypes.func, propTypes.string, propTypes.object]),
  6684. trigger: propTypes.string
  6685. };
  6686. var DEFAULT_DELAYS = {
  6687. show: 0,
  6688. hide: 250
  6689. };
  6690. var defaultProps$y = {
  6691. isOpen: false,
  6692. hideArrow: false,
  6693. autohide: false,
  6694. delay: DEFAULT_DELAYS,
  6695. toggle: function toggle() {},
  6696. trigger: 'click'
  6697. };
  6698. function isInDOMSubtree(element, subtreeRoot) {
  6699. return subtreeRoot && (element === subtreeRoot || subtreeRoot.contains(element));
  6700. }
  6701. var TooltipPopoverWrapper =
  6702. /*#__PURE__*/
  6703. function (_React$Component) {
  6704. _inheritsLoose(TooltipPopoverWrapper, _React$Component);
  6705. function TooltipPopoverWrapper(props) {
  6706. var _this;
  6707. _this = _React$Component.call(this, props) || this;
  6708. _this._target = null;
  6709. _this.addTargetEvents = _this.addTargetEvents.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  6710. _this.handleDocumentClick = _this.handleDocumentClick.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  6711. _this.removeTargetEvents = _this.removeTargetEvents.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  6712. _this.toggle = _this.toggle.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  6713. _this.showWithDelay = _this.showWithDelay.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  6714. _this.hideWithDelay = _this.hideWithDelay.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  6715. _this.onMouseOverTooltipContent = _this.onMouseOverTooltipContent.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  6716. _this.onMouseLeaveTooltipContent = _this.onMouseLeaveTooltipContent.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  6717. _this.show = _this.show.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  6718. _this.hide = _this.hide.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  6719. _this.onEscKeyDown = _this.onEscKeyDown.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  6720. _this.getRef = _this.getRef.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  6721. return _this;
  6722. }
  6723. var _proto = TooltipPopoverWrapper.prototype;
  6724. _proto.componentDidMount = function componentDidMount() {
  6725. this.updateTarget();
  6726. };
  6727. _proto.componentWillUnmount = function componentWillUnmount() {
  6728. this.removeTargetEvents();
  6729. };
  6730. _proto.onMouseOverTooltipContent = function onMouseOverTooltipContent() {
  6731. if (this.props.trigger.indexOf('hover') > -1 && !this.props.autohide) {
  6732. if (this._hideTimeout) {
  6733. this.clearHideTimeout();
  6734. }
  6735. }
  6736. };
  6737. _proto.onMouseLeaveTooltipContent = function onMouseLeaveTooltipContent(e) {
  6738. if (this.props.trigger.indexOf('hover') > -1 && !this.props.autohide) {
  6739. if (this._showTimeout) {
  6740. this.clearShowTimeout();
  6741. }
  6742. e.persist();
  6743. this._hideTimeout = setTimeout(this.hide.bind(this, e), this.getDelay('hide'));
  6744. }
  6745. };
  6746. _proto.onEscKeyDown = function onEscKeyDown(e) {
  6747. if (e.key === 'Escape') {
  6748. this.hide(e);
  6749. }
  6750. };
  6751. _proto.getRef = function getRef(ref) {
  6752. var innerRef = this.props.innerRef;
  6753. if (innerRef) {
  6754. if (typeof innerRef === 'function') {
  6755. innerRef(ref);
  6756. } else if (typeof innerRef === 'object') {
  6757. innerRef.current = ref;
  6758. }
  6759. }
  6760. this._popover = ref;
  6761. };
  6762. _proto.getDelay = function getDelay(key) {
  6763. var delay = this.props.delay;
  6764. if (typeof delay === 'object') {
  6765. return isNaN(delay[key]) ? DEFAULT_DELAYS[key] : delay[key];
  6766. }
  6767. return delay;
  6768. };
  6769. _proto.show = function show(e) {
  6770. if (!this.props.isOpen) {
  6771. this.clearShowTimeout();
  6772. this.toggle(e);
  6773. }
  6774. };
  6775. _proto.showWithDelay = function showWithDelay(e) {
  6776. if (this._hideTimeout) {
  6777. this.clearHideTimeout();
  6778. }
  6779. this._showTimeout = setTimeout(this.show.bind(this, e), this.getDelay('show'));
  6780. };
  6781. _proto.hide = function hide(e) {
  6782. if (this.props.isOpen) {
  6783. this.clearHideTimeout();
  6784. this.toggle(e);
  6785. }
  6786. };
  6787. _proto.hideWithDelay = function hideWithDelay(e) {
  6788. if (this._showTimeout) {
  6789. this.clearShowTimeout();
  6790. }
  6791. this._hideTimeout = setTimeout(this.hide.bind(this, e), this.getDelay('hide'));
  6792. };
  6793. _proto.clearShowTimeout = function clearShowTimeout() {
  6794. clearTimeout(this._showTimeout);
  6795. this._showTimeout = undefined;
  6796. };
  6797. _proto.clearHideTimeout = function clearHideTimeout() {
  6798. clearTimeout(this._hideTimeout);
  6799. this._hideTimeout = undefined;
  6800. };
  6801. _proto.handleDocumentClick = function handleDocumentClick(e) {
  6802. var triggers = this.props.trigger.split(' ');
  6803. if (triggers.indexOf('legacy') > -1 && (this.props.isOpen || isInDOMSubtree(e.target, this._target))) {
  6804. if (this._hideTimeout) {
  6805. this.clearHideTimeout();
  6806. }
  6807. if (this.props.isOpen && !isInDOMSubtree(e.target, this._popover)) {
  6808. this.hideWithDelay(e);
  6809. } else {
  6810. this.showWithDelay(e);
  6811. }
  6812. } else if (triggers.indexOf('click') > -1 && isInDOMSubtree(e.target, this._target)) {
  6813. if (this._hideTimeout) {
  6814. this.clearHideTimeout();
  6815. }
  6816. if (!this.props.isOpen) {
  6817. this.showWithDelay(e);
  6818. } else {
  6819. this.hideWithDelay(e);
  6820. }
  6821. }
  6822. };
  6823. _proto.addTargetEvents = function addTargetEvents() {
  6824. var _this2 = this;
  6825. if (this.props.trigger) {
  6826. var triggers = this.props.trigger.split(' ');
  6827. if (triggers.indexOf('manual') === -1) {
  6828. if (triggers.indexOf('click') > -1 || triggers.indexOf('legacy') > -1) {
  6829. ['click', 'touchstart'].forEach(function (event) {
  6830. return document.addEventListener(event, _this2.handleDocumentClick, true);
  6831. });
  6832. }
  6833. if (this._target) {
  6834. if (triggers.indexOf('hover') > -1) {
  6835. this._target.addEventListener('mouseover', this.showWithDelay, true);
  6836. this._target.addEventListener('mouseout', this.hideWithDelay, true);
  6837. }
  6838. if (triggers.indexOf('focus') > -1) {
  6839. this._target.addEventListener('focusin', this.show, true);
  6840. this._target.addEventListener('focusout', this.hide, true);
  6841. }
  6842. this._target.addEventListener('keydown', this.onEscKeyDown, true);
  6843. }
  6844. }
  6845. }
  6846. };
  6847. _proto.removeTargetEvents = function removeTargetEvents() {
  6848. var _this3 = this;
  6849. if (this._target) {
  6850. this._target.removeEventListener('mouseover', this.showWithDelay, true);
  6851. this._target.removeEventListener('mouseout', this.hideWithDelay, true);
  6852. this._target.removeEventListener('keydown', this.onEscKeyDown, true);
  6853. this._target.removeEventListener('focusin', this.show, true);
  6854. this._target.removeEventListener('focusout', this.hide, true);
  6855. }
  6856. ['click', 'touchstart'].forEach(function (event) {
  6857. return document.removeEventListener(event, _this3.handleDocumentClick, true);
  6858. });
  6859. };
  6860. _proto.updateTarget = function updateTarget() {
  6861. var newTarget = getTarget(this.props.target);
  6862. if (newTarget !== this._target) {
  6863. this.removeTargetEvents();
  6864. this._target = newTarget;
  6865. this.addTargetEvents();
  6866. }
  6867. };
  6868. _proto.toggle = function toggle(e) {
  6869. if (this.props.disabled) {
  6870. return e && e.preventDefault();
  6871. }
  6872. return this.props.toggle(e);
  6873. };
  6874. _proto.render = function render() {
  6875. if (!this.props.isOpen) {
  6876. return null;
  6877. }
  6878. this.updateTarget();
  6879. var _this$props = this.props,
  6880. className = _this$props.className,
  6881. cssModule = _this$props.cssModule,
  6882. innerClassName = _this$props.innerClassName,
  6883. target = _this$props.target,
  6884. isOpen = _this$props.isOpen,
  6885. hideArrow = _this$props.hideArrow,
  6886. boundariesElement = _this$props.boundariesElement,
  6887. placement = _this$props.placement,
  6888. placementPrefix = _this$props.placementPrefix,
  6889. arrowClassName = _this$props.arrowClassName,
  6890. container = _this$props.container,
  6891. modifiers = _this$props.modifiers,
  6892. offset = _this$props.offset;
  6893. var attributes = omit(this.props, Object.keys(propTypes$C));
  6894. var popperClasses = mapToCssModules(className, cssModule);
  6895. var classes = mapToCssModules(innerClassName, cssModule);
  6896. return React__default.createElement(PopperContent, {
  6897. className: popperClasses,
  6898. target: target,
  6899. isOpen: isOpen,
  6900. hideArrow: hideArrow,
  6901. boundariesElement: boundariesElement,
  6902. placement: placement,
  6903. placementPrefix: placementPrefix,
  6904. arrowClassName: arrowClassName,
  6905. container: container,
  6906. modifiers: modifiers,
  6907. offset: offset,
  6908. cssModule: cssModule
  6909. }, React__default.createElement("div", _extends({}, attributes, {
  6910. ref: this.getRef,
  6911. className: classes,
  6912. role: "tooltip",
  6913. "aria-hidden": isOpen,
  6914. onMouseOver: this.onMouseOverTooltipContent,
  6915. onMouseLeave: this.onMouseLeaveTooltipContent,
  6916. onKeyDown: this.onEscKeyDown
  6917. })));
  6918. };
  6919. return TooltipPopoverWrapper;
  6920. }(React__default.Component);
  6921. TooltipPopoverWrapper.propTypes = propTypes$C;
  6922. TooltipPopoverWrapper.defaultProps = defaultProps$y;
  6923. var defaultProps$z = {
  6924. placement: 'right',
  6925. placementPrefix: 'bs-popover',
  6926. trigger: 'click'
  6927. };
  6928. var Popover = function Popover(props) {
  6929. var popperClasses = classnames('popover', 'show', props.className);
  6930. var classes = classnames('popover-inner', props.innerClassName);
  6931. return React__default.createElement(TooltipPopoverWrapper, _extends({}, props, {
  6932. className: popperClasses,
  6933. innerClassName: classes
  6934. }));
  6935. };
  6936. Popover.propTypes = propTypes$C;
  6937. Popover.defaultProps = defaultProps$z;
  6938. var omitKeys = ['defaultOpen'];
  6939. var UncontrolledPopover =
  6940. /*#__PURE__*/
  6941. function (_Component) {
  6942. _inheritsLoose(UncontrolledPopover, _Component);
  6943. function UncontrolledPopover(props) {
  6944. var _this;
  6945. _this = _Component.call(this, props) || this;
  6946. _this.state = {
  6947. isOpen: props.defaultOpen || false
  6948. };
  6949. _this.toggle = _this.toggle.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  6950. return _this;
  6951. }
  6952. var _proto = UncontrolledPopover.prototype;
  6953. _proto.toggle = function toggle() {
  6954. this.setState({
  6955. isOpen: !this.state.isOpen
  6956. });
  6957. };
  6958. _proto.render = function render() {
  6959. return React__default.createElement(Popover, _extends({
  6960. isOpen: this.state.isOpen,
  6961. toggle: this.toggle
  6962. }, omit(this.props, omitKeys)));
  6963. };
  6964. return UncontrolledPopover;
  6965. }(React.Component);
  6966. UncontrolledPopover.propTypes = _extends({
  6967. defaultOpen: propTypes.bool
  6968. }, Popover.propTypes);
  6969. var propTypes$D = {
  6970. tag: tagPropType,
  6971. className: propTypes.string,
  6972. cssModule: propTypes.object
  6973. };
  6974. var defaultProps$A = {
  6975. tag: 'h3'
  6976. };
  6977. var PopoverHeader = function PopoverHeader(props) {
  6978. var className = props.className,
  6979. cssModule = props.cssModule,
  6980. Tag = props.tag,
  6981. attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
  6982. var classes = mapToCssModules(classnames(className, 'popover-header'), cssModule);
  6983. return React__default.createElement(Tag, _extends({}, attributes, {
  6984. className: classes
  6985. }));
  6986. };
  6987. PopoverHeader.propTypes = propTypes$D;
  6988. PopoverHeader.defaultProps = defaultProps$A;
  6989. function PopoverTitle(props) {
  6990. warnOnce('The "PopoverTitle" component has been deprecated.\nPlease use component "PopoverHeader".');
  6991. return React__default.createElement(PopoverHeader, props);
  6992. }
  6993. var propTypes$E = {
  6994. tag: tagPropType,
  6995. className: propTypes.string,
  6996. cssModule: propTypes.object
  6997. };
  6998. var defaultProps$B = {
  6999. tag: 'div'
  7000. };
  7001. var PopoverBody = function PopoverBody(props) {
  7002. var className = props.className,
  7003. cssModule = props.cssModule,
  7004. Tag = props.tag,
  7005. attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
  7006. var classes = mapToCssModules(classnames(className, 'popover-body'), cssModule);
  7007. return React__default.createElement(Tag, _extends({}, attributes, {
  7008. className: classes
  7009. }));
  7010. };
  7011. PopoverBody.propTypes = propTypes$E;
  7012. PopoverBody.defaultProps = defaultProps$B;
  7013. function PopoverContent(props) {
  7014. warnOnce('The "PopoverContent" component has been deprecated.\nPlease use component "PopoverBody".');
  7015. return React__default.createElement(PopoverBody, props);
  7016. }
  7017. /**
  7018. * lodash (Custom Build) <https://lodash.com/>
  7019. * Build: `lodash modularize exports="npm" -o ./`
  7020. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  7021. * Released under MIT license <https://lodash.com/license>
  7022. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  7023. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  7024. */
  7025. /** Used as references for various `Number` constants. */
  7026. var NAN = 0 / 0;
  7027. /** `Object#toString` result references. */
  7028. var symbolTag = '[object Symbol]';
  7029. /** Used to match leading and trailing whitespace. */
  7030. var reTrim = /^\s+|\s+$/g;
  7031. /** Used to detect bad signed hexadecimal string values. */
  7032. var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
  7033. /** Used to detect binary string values. */
  7034. var reIsBinary = /^0b[01]+$/i;
  7035. /** Used to detect octal string values. */
  7036. var reIsOctal = /^0o[0-7]+$/i;
  7037. /** Built-in method references without a dependency on `root`. */
  7038. var freeParseInt = parseInt;
  7039. /** Used for built-in method references. */
  7040. var objectProto$1 = Object.prototype;
  7041. /**
  7042. * Used to resolve the
  7043. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  7044. * of values.
  7045. */
  7046. var objectToString$1 = objectProto$1.toString;
  7047. /**
  7048. * Checks if `value` is the
  7049. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  7050. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  7051. *
  7052. * @static
  7053. * @memberOf _
  7054. * @since 0.1.0
  7055. * @category Lang
  7056. * @param {*} value The value to check.
  7057. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  7058. * @example
  7059. *
  7060. * _.isObject({});
  7061. * // => true
  7062. *
  7063. * _.isObject([1, 2, 3]);
  7064. * // => true
  7065. *
  7066. * _.isObject(_.noop);
  7067. * // => true
  7068. *
  7069. * _.isObject(null);
  7070. * // => false
  7071. */
  7072. function isObject$2(value) {
  7073. var type = typeof value;
  7074. return !!value && (type == 'object' || type == 'function');
  7075. }
  7076. /**
  7077. * Checks if `value` is object-like. A value is object-like if it's not `null`
  7078. * and has a `typeof` result of "object".
  7079. *
  7080. * @static
  7081. * @memberOf _
  7082. * @since 4.0.0
  7083. * @category Lang
  7084. * @param {*} value The value to check.
  7085. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  7086. * @example
  7087. *
  7088. * _.isObjectLike({});
  7089. * // => true
  7090. *
  7091. * _.isObjectLike([1, 2, 3]);
  7092. * // => true
  7093. *
  7094. * _.isObjectLike(_.noop);
  7095. * // => false
  7096. *
  7097. * _.isObjectLike(null);
  7098. * // => false
  7099. */
  7100. function isObjectLike(value) {
  7101. return !!value && typeof value == 'object';
  7102. }
  7103. /**
  7104. * Checks if `value` is classified as a `Symbol` primitive or object.
  7105. *
  7106. * @static
  7107. * @memberOf _
  7108. * @since 4.0.0
  7109. * @category Lang
  7110. * @param {*} value The value to check.
  7111. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  7112. * @example
  7113. *
  7114. * _.isSymbol(Symbol.iterator);
  7115. * // => true
  7116. *
  7117. * _.isSymbol('abc');
  7118. * // => false
  7119. */
  7120. function isSymbol(value) {
  7121. return typeof value == 'symbol' || isObjectLike(value) && objectToString$1.call(value) == symbolTag;
  7122. }
  7123. /**
  7124. * Converts `value` to a number.
  7125. *
  7126. * @static
  7127. * @memberOf _
  7128. * @since 4.0.0
  7129. * @category Lang
  7130. * @param {*} value The value to process.
  7131. * @returns {number} Returns the number.
  7132. * @example
  7133. *
  7134. * _.toNumber(3.2);
  7135. * // => 3.2
  7136. *
  7137. * _.toNumber(Number.MIN_VALUE);
  7138. * // => 5e-324
  7139. *
  7140. * _.toNumber(Infinity);
  7141. * // => Infinity
  7142. *
  7143. * _.toNumber('3.2');
  7144. * // => 3.2
  7145. */
  7146. function toNumber(value) {
  7147. if (typeof value == 'number') {
  7148. return value;
  7149. }
  7150. if (isSymbol(value)) {
  7151. return NAN;
  7152. }
  7153. if (isObject$2(value)) {
  7154. var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
  7155. value = isObject$2(other) ? other + '' : other;
  7156. }
  7157. if (typeof value != 'string') {
  7158. return value === 0 ? value : +value;
  7159. }
  7160. value = value.replace(reTrim, '');
  7161. var isBinary = reIsBinary.test(value);
  7162. return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value;
  7163. }
  7164. var lodash_tonumber = toNumber;
  7165. var propTypes$F = {
  7166. children: propTypes.node,
  7167. bar: propTypes.bool,
  7168. multi: propTypes.bool,
  7169. tag: tagPropType,
  7170. value: propTypes.oneOfType([propTypes.string, propTypes.number]),
  7171. max: propTypes.oneOfType([propTypes.string, propTypes.number]),
  7172. animated: propTypes.bool,
  7173. striped: propTypes.bool,
  7174. color: propTypes.string,
  7175. className: propTypes.string,
  7176. barClassName: propTypes.string,
  7177. cssModule: propTypes.object
  7178. };
  7179. var defaultProps$C = {
  7180. tag: 'div',
  7181. value: 0,
  7182. max: 100
  7183. };
  7184. var Progress = function Progress(props) {
  7185. var children = props.children,
  7186. className = props.className,
  7187. barClassName = props.barClassName,
  7188. cssModule = props.cssModule,
  7189. value = props.value,
  7190. max = props.max,
  7191. animated = props.animated,
  7192. striped = props.striped,
  7193. color = props.color,
  7194. bar = props.bar,
  7195. multi = props.multi,
  7196. Tag = props.tag,
  7197. attributes = _objectWithoutPropertiesLoose(props, ["children", "className", "barClassName", "cssModule", "value", "max", "animated", "striped", "color", "bar", "multi", "tag"]);
  7198. var percent = lodash_tonumber(value) / lodash_tonumber(max) * 100;
  7199. var progressClasses = mapToCssModules(classnames(className, 'progress'), cssModule);
  7200. var progressBarClasses = mapToCssModules(classnames('progress-bar', bar ? className || barClassName : barClassName, animated ? 'progress-bar-animated' : null, color ? "bg-" + color : null, striped || animated ? 'progress-bar-striped' : null), cssModule);
  7201. var ProgressBar = multi ? children : React__default.createElement("div", {
  7202. className: progressBarClasses,
  7203. style: {
  7204. width: percent + "%"
  7205. },
  7206. role: "progressbar",
  7207. "aria-valuenow": value,
  7208. "aria-valuemin": "0",
  7209. "aria-valuemax": max,
  7210. children: children
  7211. });
  7212. if (bar) {
  7213. return ProgressBar;
  7214. }
  7215. return React__default.createElement(Tag, _extends({}, attributes, {
  7216. className: progressClasses,
  7217. children: ProgressBar
  7218. }));
  7219. };
  7220. Progress.propTypes = propTypes$F;
  7221. Progress.defaultProps = defaultProps$C;
  7222. var propTypes$G = {
  7223. children: propTypes.node.isRequired,
  7224. node: propTypes.any
  7225. };
  7226. var Portal =
  7227. /*#__PURE__*/
  7228. function (_React$Component) {
  7229. _inheritsLoose(Portal, _React$Component);
  7230. function Portal() {
  7231. return _React$Component.apply(this, arguments) || this;
  7232. }
  7233. var _proto = Portal.prototype;
  7234. _proto.componentWillUnmount = function componentWillUnmount() {
  7235. if (this.defaultNode) {
  7236. document.body.removeChild(this.defaultNode);
  7237. }
  7238. this.defaultNode = null;
  7239. };
  7240. _proto.render = function render() {
  7241. if (!canUseDOM) {
  7242. return null;
  7243. }
  7244. if (!this.props.node && !this.defaultNode) {
  7245. this.defaultNode = document.createElement('div');
  7246. document.body.appendChild(this.defaultNode);
  7247. }
  7248. return ReactDOM.createPortal(this.props.children, this.props.node || this.defaultNode);
  7249. };
  7250. return Portal;
  7251. }(React__default.Component);
  7252. Portal.propTypes = propTypes$G;
  7253. function noop() {}
  7254. var FadePropTypes = propTypes.shape(Fade.propTypes);
  7255. var propTypes$H = {
  7256. isOpen: propTypes.bool,
  7257. autoFocus: propTypes.bool,
  7258. centered: propTypes.bool,
  7259. size: propTypes.string,
  7260. toggle: propTypes.func,
  7261. keyboard: propTypes.bool,
  7262. role: propTypes.string,
  7263. labelledBy: propTypes.string,
  7264. backdrop: propTypes.oneOfType([propTypes.bool, propTypes.oneOf(['static'])]),
  7265. onEnter: propTypes.func,
  7266. onExit: propTypes.func,
  7267. onOpened: propTypes.func,
  7268. onClosed: propTypes.func,
  7269. children: propTypes.node,
  7270. className: propTypes.string,
  7271. wrapClassName: propTypes.string,
  7272. modalClassName: propTypes.string,
  7273. backdropClassName: propTypes.string,
  7274. contentClassName: propTypes.string,
  7275. external: propTypes.node,
  7276. fade: propTypes.bool,
  7277. cssModule: propTypes.object,
  7278. zIndex: propTypes.oneOfType([propTypes.number, propTypes.string]),
  7279. backdropTransition: FadePropTypes,
  7280. modalTransition: FadePropTypes,
  7281. innerRef: propTypes.oneOfType([propTypes.object, propTypes.string, propTypes.func])
  7282. };
  7283. var propsToOmit = Object.keys(propTypes$H);
  7284. var defaultProps$D = {
  7285. isOpen: false,
  7286. autoFocus: true,
  7287. centered: false,
  7288. role: 'dialog',
  7289. backdrop: true,
  7290. keyboard: true,
  7291. zIndex: 1050,
  7292. fade: true,
  7293. onOpened: noop,
  7294. onClosed: noop,
  7295. modalTransition: {
  7296. timeout: TransitionTimeouts.Modal
  7297. },
  7298. backdropTransition: {
  7299. mountOnEnter: true,
  7300. timeout: TransitionTimeouts.Fade // uses standard fade transition
  7301. }
  7302. };
  7303. var Modal =
  7304. /*#__PURE__*/
  7305. function (_React$Component) {
  7306. _inheritsLoose(Modal, _React$Component);
  7307. function Modal(props) {
  7308. var _this;
  7309. _this = _React$Component.call(this, props) || this;
  7310. _this._element = null;
  7311. _this._originalBodyPadding = null;
  7312. _this.getFocusableChildren = _this.getFocusableChildren.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  7313. _this.handleBackdropClick = _this.handleBackdropClick.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  7314. _this.handleBackdropMouseDown = _this.handleBackdropMouseDown.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  7315. _this.handleEscape = _this.handleEscape.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  7316. _this.handleTab = _this.handleTab.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  7317. _this.onOpened = _this.onOpened.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  7318. _this.onClosed = _this.onClosed.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  7319. _this.state = {
  7320. isOpen: props.isOpen
  7321. };
  7322. if (props.isOpen) {
  7323. _this.init();
  7324. }
  7325. return _this;
  7326. }
  7327. var _proto = Modal.prototype;
  7328. _proto.componentDidMount = function componentDidMount() {
  7329. if (this.props.onEnter) {
  7330. this.props.onEnter();
  7331. }
  7332. if (this.state.isOpen && this.props.autoFocus) {
  7333. this.setFocus();
  7334. }
  7335. this._isMounted = true;
  7336. };
  7337. _proto.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
  7338. if (nextProps.isOpen && !this.props.isOpen) {
  7339. this.setState({
  7340. isOpen: nextProps.isOpen
  7341. });
  7342. }
  7343. };
  7344. _proto.componentWillUpdate = function componentWillUpdate(nextProps, nextState) {
  7345. if (nextState.isOpen && !this.state.isOpen) {
  7346. this.init();
  7347. }
  7348. };
  7349. _proto.componentDidUpdate = function componentDidUpdate(prevProps, prevState) {
  7350. if (this.props.autoFocus && this.state.isOpen && !prevState.isOpen) {
  7351. this.setFocus();
  7352. }
  7353. if (this._element && prevProps.zIndex !== this.props.zIndex) {
  7354. this._element.style.zIndex = this.props.zIndex;
  7355. }
  7356. };
  7357. _proto.componentWillUnmount = function componentWillUnmount() {
  7358. if (this.props.onExit) {
  7359. this.props.onExit();
  7360. }
  7361. if (this.state.isOpen) {
  7362. this.destroy();
  7363. }
  7364. this._isMounted = false;
  7365. };
  7366. _proto.onOpened = function onOpened(node, isAppearing) {
  7367. this.props.onOpened();
  7368. (this.props.modalTransition.onEntered || noop)(node, isAppearing);
  7369. };
  7370. _proto.onClosed = function onClosed(node) {
  7371. // so all methods get called before it is unmounted
  7372. this.props.onClosed();
  7373. (this.props.modalTransition.onExited || noop)(node);
  7374. this.destroy();
  7375. if (this._isMounted) {
  7376. this.setState({
  7377. isOpen: false
  7378. });
  7379. }
  7380. };
  7381. _proto.setFocus = function setFocus() {
  7382. if (this._dialog && this._dialog.parentNode && typeof this._dialog.parentNode.focus === 'function') {
  7383. this._dialog.parentNode.focus();
  7384. }
  7385. };
  7386. _proto.getFocusableChildren = function getFocusableChildren() {
  7387. return this._element.querySelectorAll(focusableElements.join(', '));
  7388. };
  7389. _proto.getFocusedChild = function getFocusedChild() {
  7390. var currentFocus;
  7391. var focusableChildren = this.getFocusableChildren();
  7392. try {
  7393. currentFocus = document.activeElement;
  7394. } catch (err) {
  7395. currentFocus = focusableChildren[0];
  7396. }
  7397. return currentFocus;
  7398. } // not mouseUp because scrollbar fires it, shouldn't close when user scrolls
  7399. ;
  7400. _proto.handleBackdropClick = function handleBackdropClick(e) {
  7401. if (e.target === this._mouseDownElement) {
  7402. e.stopPropagation();
  7403. if (!this.props.isOpen || this.props.backdrop !== true) return;
  7404. var backdrop = this._dialog ? this._dialog.parentNode : null;
  7405. if (backdrop && e.target === backdrop && this.props.toggle) {
  7406. this.props.toggle(e);
  7407. }
  7408. }
  7409. };
  7410. _proto.handleTab = function handleTab(e) {
  7411. if (e.which !== 9) return;
  7412. var focusableChildren = this.getFocusableChildren();
  7413. var totalFocusable = focusableChildren.length;
  7414. var currentFocus = this.getFocusedChild();
  7415. var focusedIndex = 0;
  7416. for (var i = 0; i < totalFocusable; i += 1) {
  7417. if (focusableChildren[i] === currentFocus) {
  7418. focusedIndex = i;
  7419. break;
  7420. }
  7421. }
  7422. if (e.shiftKey && focusedIndex === 0) {
  7423. e.preventDefault();
  7424. focusableChildren[totalFocusable - 1].focus();
  7425. } else if (!e.shiftKey && focusedIndex === totalFocusable - 1) {
  7426. e.preventDefault();
  7427. focusableChildren[0].focus();
  7428. }
  7429. };
  7430. _proto.handleBackdropMouseDown = function handleBackdropMouseDown(e) {
  7431. this._mouseDownElement = e.target;
  7432. };
  7433. _proto.handleEscape = function handleEscape(e) {
  7434. if (this.props.isOpen && this.props.keyboard && e.keyCode === 27 && this.props.toggle) {
  7435. e.preventDefault();
  7436. e.stopPropagation();
  7437. this.props.toggle(e);
  7438. }
  7439. };
  7440. _proto.init = function init() {
  7441. try {
  7442. this._triggeringElement = document.activeElement;
  7443. } catch (err) {
  7444. this._triggeringElement = null;
  7445. }
  7446. this._element = document.createElement('div');
  7447. this._element.setAttribute('tabindex', '-1');
  7448. this._element.style.position = 'relative';
  7449. this._element.style.zIndex = this.props.zIndex;
  7450. this._originalBodyPadding = getOriginalBodyPadding();
  7451. conditionallyUpdateScrollbar();
  7452. document.body.appendChild(this._element);
  7453. if (Modal.openCount === 0) {
  7454. document.body.className = classnames(document.body.className, mapToCssModules('modal-open', this.props.cssModule));
  7455. }
  7456. Modal.openCount += 1;
  7457. };
  7458. _proto.destroy = function destroy() {
  7459. if (this._element) {
  7460. document.body.removeChild(this._element);
  7461. this._element = null;
  7462. }
  7463. if (this._triggeringElement) {
  7464. if (this._triggeringElement.focus) this._triggeringElement.focus();
  7465. this._triggeringElement = null;
  7466. }
  7467. if (Modal.openCount <= 1) {
  7468. var modalOpenClassName = mapToCssModules('modal-open', this.props.cssModule); // Use regex to prevent matching `modal-open` as part of a different class, e.g. `my-modal-opened`
  7469. var modalOpenClassNameRegex = new RegExp("(^| )" + modalOpenClassName + "( |$)");
  7470. document.body.className = document.body.className.replace(modalOpenClassNameRegex, ' ').trim();
  7471. }
  7472. Modal.openCount -= 1;
  7473. setScrollbarWidth(this._originalBodyPadding);
  7474. };
  7475. _proto.renderModalDialog = function renderModalDialog() {
  7476. var _classNames,
  7477. _this2 = this;
  7478. var attributes = omit(this.props, propsToOmit);
  7479. var dialogBaseClass = 'modal-dialog';
  7480. return React__default.createElement("div", _extends({}, attributes, {
  7481. className: mapToCssModules(classnames(dialogBaseClass, this.props.className, (_classNames = {}, _classNames["modal-" + this.props.size] = this.props.size, _classNames[dialogBaseClass + "-centered"] = this.props.centered, _classNames)), this.props.cssModule),
  7482. role: "document",
  7483. ref: function ref(c) {
  7484. _this2._dialog = c;
  7485. }
  7486. }), React__default.createElement("div", {
  7487. className: mapToCssModules(classnames('modal-content', this.props.contentClassName), this.props.cssModule)
  7488. }, this.props.children));
  7489. };
  7490. _proto.render = function render() {
  7491. if (this.state.isOpen) {
  7492. var _this$props = this.props,
  7493. wrapClassName = _this$props.wrapClassName,
  7494. modalClassName = _this$props.modalClassName,
  7495. backdropClassName = _this$props.backdropClassName,
  7496. cssModule = _this$props.cssModule,
  7497. isOpen = _this$props.isOpen,
  7498. backdrop = _this$props.backdrop,
  7499. role = _this$props.role,
  7500. labelledBy = _this$props.labelledBy,
  7501. external = _this$props.external,
  7502. innerRef = _this$props.innerRef;
  7503. var modalAttributes = {
  7504. onClick: this.handleBackdropClick,
  7505. onMouseDown: this.handleBackdropMouseDown,
  7506. onKeyUp: this.handleEscape,
  7507. onKeyDown: this.handleTab,
  7508. style: {
  7509. display: 'block'
  7510. },
  7511. 'aria-labelledby': labelledBy,
  7512. role: role,
  7513. tabIndex: '-1'
  7514. };
  7515. var hasTransition = this.props.fade;
  7516. var modalTransition = _extends({}, Fade.defaultProps, this.props.modalTransition, {
  7517. baseClass: hasTransition ? this.props.modalTransition.baseClass : '',
  7518. timeout: hasTransition ? this.props.modalTransition.timeout : 0
  7519. });
  7520. var backdropTransition = _extends({}, Fade.defaultProps, this.props.backdropTransition, {
  7521. baseClass: hasTransition ? this.props.backdropTransition.baseClass : '',
  7522. timeout: hasTransition ? this.props.backdropTransition.timeout : 0
  7523. });
  7524. var Backdrop = backdrop && (hasTransition ? React__default.createElement(Fade, _extends({}, backdropTransition, {
  7525. in: isOpen && !!backdrop,
  7526. cssModule: cssModule,
  7527. className: mapToCssModules(classnames('modal-backdrop', backdropClassName), cssModule)
  7528. })) : React__default.createElement("div", {
  7529. className: mapToCssModules(classnames('modal-backdrop', 'show', backdropClassName), cssModule)
  7530. }));
  7531. return React__default.createElement(Portal, {
  7532. node: this._element
  7533. }, React__default.createElement("div", {
  7534. className: mapToCssModules(wrapClassName)
  7535. }, React__default.createElement(Fade, _extends({}, modalAttributes, modalTransition, {
  7536. in: isOpen,
  7537. onEntered: this.onOpened,
  7538. onExited: this.onClosed,
  7539. cssModule: cssModule,
  7540. className: mapToCssModules(classnames('modal', modalClassName), cssModule),
  7541. innerRef: innerRef
  7542. }), external, this.renderModalDialog()), Backdrop));
  7543. }
  7544. return null;
  7545. };
  7546. return Modal;
  7547. }(React__default.Component);
  7548. Modal.propTypes = propTypes$H;
  7549. Modal.defaultProps = defaultProps$D;
  7550. Modal.openCount = 0;
  7551. var propTypes$I = {
  7552. tag: tagPropType,
  7553. wrapTag: tagPropType,
  7554. toggle: propTypes.func,
  7555. className: propTypes.string,
  7556. cssModule: propTypes.object,
  7557. children: propTypes.node,
  7558. closeAriaLabel: propTypes.string,
  7559. charCode: propTypes.oneOfType([propTypes.string, propTypes.number]),
  7560. close: propTypes.object
  7561. };
  7562. var defaultProps$E = {
  7563. tag: 'h5',
  7564. wrapTag: 'div',
  7565. closeAriaLabel: 'Close',
  7566. charCode: 215
  7567. };
  7568. var ModalHeader = function ModalHeader(props) {
  7569. var closeButton;
  7570. var className = props.className,
  7571. cssModule = props.cssModule,
  7572. children = props.children,
  7573. toggle = props.toggle,
  7574. Tag = props.tag,
  7575. WrapTag = props.wrapTag,
  7576. closeAriaLabel = props.closeAriaLabel,
  7577. charCode = props.charCode,
  7578. close = props.close,
  7579. attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "children", "toggle", "tag", "wrapTag", "closeAriaLabel", "charCode", "close"]);
  7580. var classes = mapToCssModules(classnames(className, 'modal-header'), cssModule);
  7581. if (!close && toggle) {
  7582. var closeIcon = typeof charCode === 'number' ? String.fromCharCode(charCode) : charCode;
  7583. closeButton = React__default.createElement("button", {
  7584. type: "button",
  7585. onClick: toggle,
  7586. className: mapToCssModules('close', cssModule),
  7587. "aria-label": closeAriaLabel
  7588. }, React__default.createElement("span", {
  7589. "aria-hidden": "true"
  7590. }, closeIcon));
  7591. }
  7592. return React__default.createElement(WrapTag, _extends({}, attributes, {
  7593. className: classes
  7594. }), React__default.createElement(Tag, {
  7595. className: mapToCssModules('modal-title', cssModule)
  7596. }, children), close || closeButton);
  7597. };
  7598. ModalHeader.propTypes = propTypes$I;
  7599. ModalHeader.defaultProps = defaultProps$E;
  7600. var propTypes$J = {
  7601. tag: tagPropType,
  7602. className: propTypes.string,
  7603. cssModule: propTypes.object
  7604. };
  7605. var defaultProps$F = {
  7606. tag: 'div'
  7607. };
  7608. var ModalBody = function ModalBody(props) {
  7609. var className = props.className,
  7610. cssModule = props.cssModule,
  7611. Tag = props.tag,
  7612. attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
  7613. var classes = mapToCssModules(classnames(className, 'modal-body'), cssModule);
  7614. return React__default.createElement(Tag, _extends({}, attributes, {
  7615. className: classes
  7616. }));
  7617. };
  7618. ModalBody.propTypes = propTypes$J;
  7619. ModalBody.defaultProps = defaultProps$F;
  7620. var propTypes$K = {
  7621. tag: tagPropType,
  7622. className: propTypes.string,
  7623. cssModule: propTypes.object
  7624. };
  7625. var defaultProps$G = {
  7626. tag: 'div'
  7627. };
  7628. var ModalFooter = function ModalFooter(props) {
  7629. var className = props.className,
  7630. cssModule = props.cssModule,
  7631. Tag = props.tag,
  7632. attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
  7633. var classes = mapToCssModules(classnames(className, 'modal-footer'), cssModule);
  7634. return React__default.createElement(Tag, _extends({}, attributes, {
  7635. className: classes
  7636. }));
  7637. };
  7638. ModalFooter.propTypes = propTypes$K;
  7639. ModalFooter.defaultProps = defaultProps$G;
  7640. var defaultProps$H = {
  7641. placement: 'top',
  7642. autohide: true,
  7643. placementPrefix: 'bs-tooltip',
  7644. trigger: 'click hover focus'
  7645. };
  7646. var Tooltip = function Tooltip(props) {
  7647. var popperClasses = classnames('tooltip', 'show', props.className);
  7648. var classes = classnames('tooltip-inner', props.innerClassName);
  7649. return React__default.createElement(TooltipPopoverWrapper, _extends({}, props, {
  7650. className: popperClasses,
  7651. innerClassName: classes
  7652. }));
  7653. };
  7654. Tooltip.propTypes = propTypes$C;
  7655. Tooltip.defaultProps = defaultProps$H;
  7656. var propTypes$L = {
  7657. className: propTypes.string,
  7658. cssModule: propTypes.object,
  7659. size: propTypes.string,
  7660. bordered: propTypes.bool,
  7661. borderless: propTypes.bool,
  7662. striped: propTypes.bool,
  7663. inverse: deprecated(propTypes.bool, 'Please use the prop "dark"'),
  7664. dark: propTypes.bool,
  7665. hover: propTypes.bool,
  7666. responsive: propTypes.oneOfType([propTypes.bool, propTypes.string]),
  7667. tag: tagPropType,
  7668. responsiveTag: tagPropType,
  7669. innerRef: propTypes.oneOfType([propTypes.func, propTypes.string, propTypes.object])
  7670. };
  7671. var defaultProps$I = {
  7672. tag: 'table',
  7673. responsiveTag: 'div'
  7674. };
  7675. var Table = function Table(props) {
  7676. var className = props.className,
  7677. cssModule = props.cssModule,
  7678. size = props.size,
  7679. bordered = props.bordered,
  7680. borderless = props.borderless,
  7681. striped = props.striped,
  7682. inverse = props.inverse,
  7683. dark = props.dark,
  7684. hover = props.hover,
  7685. responsive = props.responsive,
  7686. Tag = props.tag,
  7687. ResponsiveTag = props.responsiveTag,
  7688. innerRef = props.innerRef,
  7689. attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "size", "bordered", "borderless", "striped", "inverse", "dark", "hover", "responsive", "tag", "responsiveTag", "innerRef"]);
  7690. var classes = mapToCssModules(classnames(className, 'table', size ? 'table-' + size : false, bordered ? 'table-bordered' : false, borderless ? 'table-borderless' : false, striped ? 'table-striped' : false, dark || inverse ? 'table-dark' : false, hover ? 'table-hover' : false), cssModule);
  7691. var table = React__default.createElement(Tag, _extends({}, attributes, {
  7692. ref: innerRef,
  7693. className: classes
  7694. }));
  7695. if (responsive) {
  7696. var responsiveClassName = responsive === true ? 'table-responsive' : "table-responsive-" + responsive;
  7697. return React__default.createElement(ResponsiveTag, {
  7698. className: responsiveClassName
  7699. }, table);
  7700. }
  7701. return table;
  7702. };
  7703. Table.propTypes = propTypes$L;
  7704. Table.defaultProps = defaultProps$I;
  7705. var propTypes$M = {
  7706. tag: tagPropType,
  7707. flush: propTypes.bool,
  7708. className: propTypes.string,
  7709. cssModule: propTypes.object
  7710. };
  7711. var defaultProps$J = {
  7712. tag: 'ul'
  7713. };
  7714. var ListGroup = function ListGroup(props) {
  7715. var className = props.className,
  7716. cssModule = props.cssModule,
  7717. Tag = props.tag,
  7718. flush = props.flush,
  7719. attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag", "flush"]);
  7720. var classes = mapToCssModules(classnames(className, 'list-group', flush ? 'list-group-flush' : false), cssModule);
  7721. return React__default.createElement(Tag, _extends({}, attributes, {
  7722. className: classes
  7723. }));
  7724. };
  7725. ListGroup.propTypes = propTypes$M;
  7726. ListGroup.defaultProps = defaultProps$J;
  7727. var propTypes$N = {
  7728. children: propTypes.node,
  7729. inline: propTypes.bool,
  7730. tag: tagPropType,
  7731. innerRef: propTypes.oneOfType([propTypes.object, propTypes.func, propTypes.string]),
  7732. className: propTypes.string,
  7733. cssModule: propTypes.object
  7734. };
  7735. var defaultProps$K = {
  7736. tag: 'form'
  7737. };
  7738. var Form =
  7739. /*#__PURE__*/
  7740. function (_Component) {
  7741. _inheritsLoose(Form, _Component);
  7742. function Form(props) {
  7743. var _this;
  7744. _this = _Component.call(this, props) || this;
  7745. _this.getRef = _this.getRef.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  7746. _this.submit = _this.submit.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  7747. return _this;
  7748. }
  7749. var _proto = Form.prototype;
  7750. _proto.getRef = function getRef(ref) {
  7751. if (this.props.innerRef) {
  7752. this.props.innerRef(ref);
  7753. }
  7754. this.ref = ref;
  7755. };
  7756. _proto.submit = function submit() {
  7757. if (this.ref) {
  7758. this.ref.submit();
  7759. }
  7760. };
  7761. _proto.render = function render() {
  7762. var _this$props = this.props,
  7763. className = _this$props.className,
  7764. cssModule = _this$props.cssModule,
  7765. inline = _this$props.inline,
  7766. Tag = _this$props.tag,
  7767. innerRef = _this$props.innerRef,
  7768. attributes = _objectWithoutPropertiesLoose(_this$props, ["className", "cssModule", "inline", "tag", "innerRef"]);
  7769. var classes = mapToCssModules(classnames(className, inline ? 'form-inline' : false), cssModule);
  7770. return React__default.createElement(Tag, _extends({}, attributes, {
  7771. ref: innerRef,
  7772. className: classes
  7773. }));
  7774. };
  7775. return Form;
  7776. }(React.Component);
  7777. Form.propTypes = propTypes$N;
  7778. Form.defaultProps = defaultProps$K;
  7779. var propTypes$O = {
  7780. children: propTypes.node,
  7781. tag: tagPropType,
  7782. className: propTypes.string,
  7783. cssModule: propTypes.object,
  7784. valid: propTypes.bool,
  7785. tooltip: propTypes.bool
  7786. };
  7787. var defaultProps$L = {
  7788. tag: 'div',
  7789. valid: undefined
  7790. };
  7791. var FormFeedback = function FormFeedback(props) {
  7792. var className = props.className,
  7793. cssModule = props.cssModule,
  7794. valid = props.valid,
  7795. tooltip = props.tooltip,
  7796. Tag = props.tag,
  7797. attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "valid", "tooltip", "tag"]);
  7798. var validMode = tooltip ? 'tooltip' : 'feedback';
  7799. var classes = mapToCssModules(classnames(className, valid ? "valid-" + validMode : "invalid-" + validMode), cssModule);
  7800. return React__default.createElement(Tag, _extends({}, attributes, {
  7801. className: classes
  7802. }));
  7803. };
  7804. FormFeedback.propTypes = propTypes$O;
  7805. FormFeedback.defaultProps = defaultProps$L;
  7806. var propTypes$P = {
  7807. children: propTypes.node,
  7808. row: propTypes.bool,
  7809. check: propTypes.bool,
  7810. inline: propTypes.bool,
  7811. disabled: propTypes.bool,
  7812. tag: tagPropType,
  7813. className: propTypes.string,
  7814. cssModule: propTypes.object
  7815. };
  7816. var defaultProps$M = {
  7817. tag: 'div'
  7818. };
  7819. var FormGroup = function FormGroup(props) {
  7820. var className = props.className,
  7821. cssModule = props.cssModule,
  7822. row = props.row,
  7823. disabled = props.disabled,
  7824. check = props.check,
  7825. inline = props.inline,
  7826. Tag = props.tag,
  7827. attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "row", "disabled", "check", "inline", "tag"]);
  7828. var classes = mapToCssModules(classnames(className, row ? 'row' : false, check ? 'form-check' : 'form-group', check && inline ? 'form-check-inline' : false, check && disabled ? 'disabled' : false), cssModule);
  7829. return React__default.createElement(Tag, _extends({}, attributes, {
  7830. className: classes
  7831. }));
  7832. };
  7833. FormGroup.propTypes = propTypes$P;
  7834. FormGroup.defaultProps = defaultProps$M;
  7835. var propTypes$Q = {
  7836. children: propTypes.node,
  7837. inline: propTypes.bool,
  7838. tag: tagPropType,
  7839. color: propTypes.string,
  7840. className: propTypes.string,
  7841. cssModule: propTypes.object
  7842. };
  7843. var defaultProps$N = {
  7844. tag: 'small',
  7845. color: 'muted'
  7846. };
  7847. var FormText = function FormText(props) {
  7848. var className = props.className,
  7849. cssModule = props.cssModule,
  7850. inline = props.inline,
  7851. color = props.color,
  7852. Tag = props.tag,
  7853. attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "inline", "color", "tag"]);
  7854. var classes = mapToCssModules(classnames(className, !inline ? 'form-text' : false, color ? "text-" + color : false), cssModule);
  7855. return React__default.createElement(Tag, _extends({}, attributes, {
  7856. className: classes
  7857. }));
  7858. };
  7859. FormText.propTypes = propTypes$Q;
  7860. FormText.defaultProps = defaultProps$N;
  7861. var propTypes$R = {
  7862. children: propTypes.node,
  7863. type: propTypes.string,
  7864. size: propTypes.string,
  7865. bsSize: propTypes.string,
  7866. state: deprecated(propTypes.string, 'Please use the props "valid" and "invalid" to indicate the state.'),
  7867. valid: propTypes.bool,
  7868. invalid: propTypes.bool,
  7869. tag: tagPropType,
  7870. innerRef: propTypes.oneOfType([propTypes.object, propTypes.func, propTypes.string]),
  7871. static: deprecated(propTypes.bool, 'Please use the prop "plaintext"'),
  7872. plaintext: propTypes.bool,
  7873. addon: propTypes.bool,
  7874. className: propTypes.string,
  7875. cssModule: propTypes.object
  7876. };
  7877. var defaultProps$O = {
  7878. type: 'text'
  7879. };
  7880. var Input =
  7881. /*#__PURE__*/
  7882. function (_React$Component) {
  7883. _inheritsLoose(Input, _React$Component);
  7884. function Input(props) {
  7885. var _this;
  7886. _this = _React$Component.call(this, props) || this;
  7887. _this.getRef = _this.getRef.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  7888. _this.focus = _this.focus.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  7889. return _this;
  7890. }
  7891. var _proto = Input.prototype;
  7892. _proto.getRef = function getRef(ref) {
  7893. if (this.props.innerRef) {
  7894. this.props.innerRef(ref);
  7895. }
  7896. this.ref = ref;
  7897. };
  7898. _proto.focus = function focus() {
  7899. if (this.ref) {
  7900. this.ref.focus();
  7901. }
  7902. };
  7903. _proto.render = function render() {
  7904. var _this$props = this.props,
  7905. className = _this$props.className,
  7906. cssModule = _this$props.cssModule,
  7907. type = _this$props.type,
  7908. bsSize = _this$props.bsSize,
  7909. state = _this$props.state,
  7910. valid = _this$props.valid,
  7911. invalid = _this$props.invalid,
  7912. tag = _this$props.tag,
  7913. addon = _this$props.addon,
  7914. staticInput = _this$props.static,
  7915. plaintext = _this$props.plaintext,
  7916. innerRef = _this$props.innerRef,
  7917. attributes = _objectWithoutPropertiesLoose(_this$props, ["className", "cssModule", "type", "bsSize", "state", "valid", "invalid", "tag", "addon", "static", "plaintext", "innerRef"]);
  7918. var checkInput = ['radio', 'checkbox'].indexOf(type) > -1;
  7919. var isNotaNumber = new RegExp('\\D', 'g');
  7920. var fileInput = type === 'file';
  7921. var textareaInput = type === 'textarea';
  7922. var selectInput = type === 'select';
  7923. var Tag = tag || (selectInput || textareaInput ? type : 'input');
  7924. var formControlClass = 'form-control';
  7925. if (plaintext || staticInput) {
  7926. formControlClass = formControlClass + "-plaintext";
  7927. Tag = tag || 'input';
  7928. } else if (fileInput) {
  7929. formControlClass = formControlClass + "-file";
  7930. } else if (checkInput) {
  7931. if (addon) {
  7932. formControlClass = null;
  7933. } else {
  7934. formControlClass = 'form-check-input';
  7935. }
  7936. }
  7937. if (state && typeof valid === 'undefined' && typeof invalid === 'undefined') {
  7938. if (state === 'danger') {
  7939. invalid = true;
  7940. } else if (state === 'success') {
  7941. valid = true;
  7942. }
  7943. }
  7944. if (attributes.size && isNotaNumber.test(attributes.size)) {
  7945. warnOnce('Please use the prop "bsSize" instead of the "size" to bootstrap\'s input sizing.');
  7946. bsSize = attributes.size;
  7947. delete attributes.size;
  7948. }
  7949. var classes = mapToCssModules(classnames(className, invalid && 'is-invalid', valid && 'is-valid', bsSize ? "form-control-" + bsSize : false, formControlClass), cssModule);
  7950. if (Tag === 'input' || tag && typeof tag === 'function') {
  7951. attributes.type = type;
  7952. }
  7953. if (attributes.children && !(plaintext || staticInput || type === 'select' || typeof Tag !== 'string' || Tag === 'select')) {
  7954. warnOnce("Input with a type of \"" + type + "\" cannot have children. Please use \"value\"/\"defaultValue\" instead.");
  7955. delete attributes.children;
  7956. }
  7957. return React__default.createElement(Tag, _extends({}, attributes, {
  7958. ref: innerRef,
  7959. className: classes
  7960. }));
  7961. };
  7962. return Input;
  7963. }(React__default.Component);
  7964. Input.propTypes = propTypes$R;
  7965. Input.defaultProps = defaultProps$O;
  7966. var propTypes$S = {
  7967. tag: tagPropType,
  7968. size: propTypes.string,
  7969. className: propTypes.string,
  7970. cssModule: propTypes.object
  7971. };
  7972. var defaultProps$P = {
  7973. tag: 'div'
  7974. };
  7975. var InputGroup = function InputGroup(props) {
  7976. var className = props.className,
  7977. cssModule = props.cssModule,
  7978. Tag = props.tag,
  7979. size = props.size,
  7980. attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag", "size"]);
  7981. var classes = mapToCssModules(classnames(className, 'input-group', size ? "input-group-" + size : null), cssModule);
  7982. return React__default.createElement(Tag, _extends({}, attributes, {
  7983. className: classes
  7984. }));
  7985. };
  7986. InputGroup.propTypes = propTypes$S;
  7987. InputGroup.defaultProps = defaultProps$P;
  7988. var propTypes$T = {
  7989. tag: tagPropType,
  7990. className: propTypes.string,
  7991. cssModule: propTypes.object
  7992. };
  7993. var defaultProps$Q = {
  7994. tag: 'span'
  7995. };
  7996. var InputGroupText = function InputGroupText(props) {
  7997. var className = props.className,
  7998. cssModule = props.cssModule,
  7999. Tag = props.tag,
  8000. attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
  8001. var classes = mapToCssModules(classnames(className, 'input-group-text'), cssModule);
  8002. return React__default.createElement(Tag, _extends({}, attributes, {
  8003. className: classes
  8004. }));
  8005. };
  8006. InputGroupText.propTypes = propTypes$T;
  8007. InputGroupText.defaultProps = defaultProps$Q;
  8008. var propTypes$U = {
  8009. tag: tagPropType,
  8010. addonType: propTypes.oneOf(['prepend', 'append']).isRequired,
  8011. children: propTypes.node,
  8012. className: propTypes.string,
  8013. cssModule: propTypes.object
  8014. };
  8015. var defaultProps$R = {
  8016. tag: 'div'
  8017. };
  8018. var InputGroupAddon = function InputGroupAddon(props) {
  8019. var className = props.className,
  8020. cssModule = props.cssModule,
  8021. Tag = props.tag,
  8022. addonType = props.addonType,
  8023. children = props.children,
  8024. attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag", "addonType", "children"]);
  8025. var classes = mapToCssModules(classnames(className, 'input-group-' + addonType), cssModule); // Convenience to assist with transition
  8026. if (typeof children === 'string') {
  8027. return React__default.createElement(Tag, _extends({}, attributes, {
  8028. className: classes
  8029. }), React__default.createElement(InputGroupText, {
  8030. children: children
  8031. }));
  8032. }
  8033. return React__default.createElement(Tag, _extends({}, attributes, {
  8034. className: classes,
  8035. children: children
  8036. }));
  8037. };
  8038. InputGroupAddon.propTypes = propTypes$U;
  8039. InputGroupAddon.defaultProps = defaultProps$R;
  8040. var propTypes$V = {
  8041. tag: tagPropType,
  8042. addonType: propTypes.oneOf(['prepend', 'append']).isRequired,
  8043. children: propTypes.node,
  8044. groupClassName: propTypes.string,
  8045. groupAttributes: propTypes.object,
  8046. className: propTypes.string,
  8047. cssModule: propTypes.object
  8048. };
  8049. var InputGroupButton = function InputGroupButton(props) {
  8050. warnOnce('The "InputGroupButton" component has been deprecated.\nPlease use component "InputGroupAddon".');
  8051. var children = props.children,
  8052. groupClassName = props.groupClassName,
  8053. groupAttributes = props.groupAttributes,
  8054. propsWithoutGroup = _objectWithoutPropertiesLoose(props, ["children", "groupClassName", "groupAttributes"]);
  8055. if (typeof children === 'string') {
  8056. var cssModule = propsWithoutGroup.cssModule,
  8057. tag = propsWithoutGroup.tag,
  8058. addonType = propsWithoutGroup.addonType,
  8059. attributes = _objectWithoutPropertiesLoose(propsWithoutGroup, ["cssModule", "tag", "addonType"]);
  8060. var allGroupAttributes = _extends({}, groupAttributes, {
  8061. cssModule: cssModule,
  8062. tag: tag,
  8063. addonType: addonType
  8064. });
  8065. return React__default.createElement(InputGroupAddon, _extends({}, allGroupAttributes, {
  8066. className: groupClassName
  8067. }), React__default.createElement(Button, _extends({}, attributes, {
  8068. children: children
  8069. })));
  8070. }
  8071. return React__default.createElement(InputGroupAddon, _extends({}, props, {
  8072. children: children
  8073. }));
  8074. };
  8075. InputGroupButton.propTypes = propTypes$V;
  8076. var propTypes$W = {
  8077. addonType: propTypes.oneOf(['prepend', 'append']).isRequired,
  8078. children: propTypes.node
  8079. };
  8080. var InputGroupButtonDropdown = function InputGroupButtonDropdown(props) {
  8081. return React__default.createElement(Dropdown, props);
  8082. };
  8083. InputGroupButtonDropdown.propTypes = propTypes$W;
  8084. var colWidths$1 = ['xs', 'sm', 'md', 'lg', 'xl'];
  8085. var stringOrNumberProp$1 = propTypes.oneOfType([propTypes.number, propTypes.string]);
  8086. var columnProps$1 = propTypes.oneOfType([propTypes.string, propTypes.number, propTypes.shape({
  8087. size: stringOrNumberProp$1,
  8088. push: deprecated(stringOrNumberProp$1, 'Please use the prop "order"'),
  8089. pull: deprecated(stringOrNumberProp$1, 'Please use the prop "order"'),
  8090. order: stringOrNumberProp$1,
  8091. offset: stringOrNumberProp$1
  8092. })]);
  8093. var propTypes$X = {
  8094. children: propTypes.node,
  8095. hidden: propTypes.bool,
  8096. check: propTypes.bool,
  8097. size: propTypes.string,
  8098. for: propTypes.string,
  8099. tag: tagPropType,
  8100. className: propTypes.string,
  8101. cssModule: propTypes.object,
  8102. xs: columnProps$1,
  8103. sm: columnProps$1,
  8104. md: columnProps$1,
  8105. lg: columnProps$1,
  8106. xl: columnProps$1,
  8107. widths: propTypes.array
  8108. };
  8109. var defaultProps$S = {
  8110. tag: 'label',
  8111. widths: colWidths$1
  8112. };
  8113. var getColumnSizeClass$1 = function getColumnSizeClass(isXs, colWidth, colSize) {
  8114. if (colSize === true || colSize === '') {
  8115. return isXs ? 'col' : "col-" + colWidth;
  8116. } else if (colSize === 'auto') {
  8117. return isXs ? 'col-auto' : "col-" + colWidth + "-auto";
  8118. }
  8119. return isXs ? "col-" + colSize : "col-" + colWidth + "-" + colSize;
  8120. };
  8121. var Label = function Label(props) {
  8122. var className = props.className,
  8123. cssModule = props.cssModule,
  8124. hidden = props.hidden,
  8125. widths = props.widths,
  8126. Tag = props.tag,
  8127. check = props.check,
  8128. size = props.size,
  8129. htmlFor = props.for,
  8130. attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "hidden", "widths", "tag", "check", "size", "for"]);
  8131. var colClasses = [];
  8132. widths.forEach(function (colWidth, i) {
  8133. var columnProp = props[colWidth];
  8134. delete attributes[colWidth];
  8135. if (!columnProp && columnProp !== '') {
  8136. return;
  8137. }
  8138. var isXs = !i;
  8139. var colClass;
  8140. if (lodash_isobject(columnProp)) {
  8141. var _classNames;
  8142. var colSizeInterfix = isXs ? '-' : "-" + colWidth + "-";
  8143. colClass = getColumnSizeClass$1(isXs, colWidth, columnProp.size);
  8144. colClasses.push(mapToCssModules(classnames((_classNames = {}, _classNames[colClass] = columnProp.size || columnProp.size === '', _classNames["order" + colSizeInterfix + columnProp.order] = columnProp.order || columnProp.order === 0, _classNames["offset" + colSizeInterfix + columnProp.offset] = columnProp.offset || columnProp.offset === 0, _classNames))), cssModule);
  8145. } else {
  8146. colClass = getColumnSizeClass$1(isXs, colWidth, columnProp);
  8147. colClasses.push(colClass);
  8148. }
  8149. });
  8150. var classes = mapToCssModules(classnames(className, hidden ? 'sr-only' : false, check ? 'form-check-label' : false, size ? "col-form-label-" + size : false, colClasses, colClasses.length ? 'col-form-label' : false), cssModule);
  8151. return React__default.createElement(Tag, _extends({
  8152. htmlFor: htmlFor
  8153. }, attributes, {
  8154. className: classes
  8155. }));
  8156. };
  8157. Label.propTypes = propTypes$X;
  8158. Label.defaultProps = defaultProps$S;
  8159. var propTypes$Y = {
  8160. body: propTypes.bool,
  8161. bottom: propTypes.bool,
  8162. children: propTypes.node,
  8163. className: propTypes.string,
  8164. cssModule: propTypes.object,
  8165. heading: propTypes.bool,
  8166. left: propTypes.bool,
  8167. list: propTypes.bool,
  8168. middle: propTypes.bool,
  8169. object: propTypes.bool,
  8170. right: propTypes.bool,
  8171. tag: tagPropType,
  8172. top: propTypes.bool
  8173. };
  8174. var Media = function Media(props) {
  8175. var body = props.body,
  8176. bottom = props.bottom,
  8177. className = props.className,
  8178. cssModule = props.cssModule,
  8179. heading = props.heading,
  8180. left = props.left,
  8181. list = props.list,
  8182. middle = props.middle,
  8183. object = props.object,
  8184. right = props.right,
  8185. tag = props.tag,
  8186. top = props.top,
  8187. attributes = _objectWithoutPropertiesLoose(props, ["body", "bottom", "className", "cssModule", "heading", "left", "list", "middle", "object", "right", "tag", "top"]);
  8188. var defaultTag;
  8189. if (heading) {
  8190. defaultTag = 'h4';
  8191. } else if (attributes.href) {
  8192. defaultTag = 'a';
  8193. } else if (attributes.src || object) {
  8194. defaultTag = 'img';
  8195. } else if (list) {
  8196. defaultTag = 'ul';
  8197. } else {
  8198. defaultTag = 'div';
  8199. }
  8200. var Tag = tag || defaultTag;
  8201. var classes = mapToCssModules(classnames(className, {
  8202. 'media-body': body,
  8203. 'media-heading': heading,
  8204. 'media-left': left,
  8205. 'media-right': right,
  8206. 'media-top': top,
  8207. 'media-bottom': bottom,
  8208. 'media-middle': middle,
  8209. 'media-object': object,
  8210. 'media-list': list,
  8211. media: !body && !heading && !left && !right && !top && !bottom && !middle && !object && !list
  8212. }), cssModule);
  8213. return React__default.createElement(Tag, _extends({}, attributes, {
  8214. className: classes
  8215. }));
  8216. };
  8217. Media.propTypes = propTypes$Y;
  8218. var propTypes$Z = {
  8219. children: propTypes.node,
  8220. className: propTypes.string,
  8221. listClassName: propTypes.string,
  8222. cssModule: propTypes.object,
  8223. size: propTypes.string,
  8224. tag: tagPropType,
  8225. listTag: tagPropType,
  8226. 'aria-label': propTypes.string
  8227. };
  8228. var defaultProps$T = {
  8229. tag: 'nav',
  8230. listTag: 'ul',
  8231. 'aria-label': 'pagination'
  8232. };
  8233. var Pagination = function Pagination(props) {
  8234. var _classNames;
  8235. var className = props.className,
  8236. listClassName = props.listClassName,
  8237. cssModule = props.cssModule,
  8238. size = props.size,
  8239. Tag = props.tag,
  8240. ListTag = props.listTag,
  8241. label = props['aria-label'],
  8242. attributes = _objectWithoutPropertiesLoose(props, ["className", "listClassName", "cssModule", "size", "tag", "listTag", "aria-label"]);
  8243. var classes = mapToCssModules(classnames(className), cssModule);
  8244. var listClasses = mapToCssModules(classnames(listClassName, 'pagination', (_classNames = {}, _classNames["pagination-" + size] = !!size, _classNames)), cssModule);
  8245. return React__default.createElement(Tag, {
  8246. className: classes,
  8247. "aria-label": label
  8248. }, React__default.createElement(ListTag, _extends({}, attributes, {
  8249. className: listClasses
  8250. })));
  8251. };
  8252. Pagination.propTypes = propTypes$Z;
  8253. Pagination.defaultProps = defaultProps$T;
  8254. var propTypes$_ = {
  8255. active: propTypes.bool,
  8256. children: propTypes.node,
  8257. className: propTypes.string,
  8258. cssModule: propTypes.object,
  8259. disabled: propTypes.bool,
  8260. tag: tagPropType
  8261. };
  8262. var defaultProps$U = {
  8263. tag: 'li'
  8264. };
  8265. var PaginationItem = function PaginationItem(props) {
  8266. var active = props.active,
  8267. className = props.className,
  8268. cssModule = props.cssModule,
  8269. disabled = props.disabled,
  8270. Tag = props.tag,
  8271. attributes = _objectWithoutPropertiesLoose(props, ["active", "className", "cssModule", "disabled", "tag"]);
  8272. var classes = mapToCssModules(classnames(className, 'page-item', {
  8273. active: active,
  8274. disabled: disabled
  8275. }), cssModule);
  8276. return React__default.createElement(Tag, _extends({}, attributes, {
  8277. className: classes
  8278. }));
  8279. };
  8280. PaginationItem.propTypes = propTypes$_;
  8281. PaginationItem.defaultProps = defaultProps$U;
  8282. var propTypes$10 = {
  8283. 'aria-label': propTypes.string,
  8284. children: propTypes.node,
  8285. className: propTypes.string,
  8286. cssModule: propTypes.object,
  8287. next: propTypes.bool,
  8288. previous: propTypes.bool,
  8289. tag: tagPropType
  8290. };
  8291. var defaultProps$V = {
  8292. tag: 'a'
  8293. };
  8294. var PaginationLink = function PaginationLink(props) {
  8295. var className = props.className,
  8296. cssModule = props.cssModule,
  8297. next = props.next,
  8298. previous = props.previous,
  8299. Tag = props.tag,
  8300. attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "next", "previous", "tag"]);
  8301. var classes = mapToCssModules(classnames(className, 'page-link'), cssModule);
  8302. var defaultAriaLabel;
  8303. if (previous) {
  8304. defaultAriaLabel = 'Previous';
  8305. } else if (next) {
  8306. defaultAriaLabel = 'Next';
  8307. }
  8308. var ariaLabel = props['aria-label'] || defaultAriaLabel;
  8309. var defaultCaret;
  8310. if (previous) {
  8311. defaultCaret = "\xAB";
  8312. } else if (next) {
  8313. defaultCaret = "\xBB";
  8314. }
  8315. var children = props.children;
  8316. if (children && Array.isArray(children) && children.length === 0) {
  8317. children = null;
  8318. }
  8319. if (!attributes.href && Tag === 'a') {
  8320. Tag = 'button';
  8321. }
  8322. if (previous || next) {
  8323. children = [React__default.createElement("span", {
  8324. "aria-hidden": "true",
  8325. key: "caret"
  8326. }, children || defaultCaret), React__default.createElement("span", {
  8327. className: "sr-only",
  8328. key: "sr"
  8329. }, ariaLabel)];
  8330. }
  8331. return React__default.createElement(Tag, _extends({}, attributes, {
  8332. className: classes,
  8333. "aria-label": ariaLabel
  8334. }), children);
  8335. };
  8336. PaginationLink.propTypes = propTypes$10;
  8337. PaginationLink.defaultProps = defaultProps$V;
  8338. var propTypes$11 = {
  8339. tag: tagPropType,
  8340. activeTab: propTypes.any,
  8341. className: propTypes.string,
  8342. cssModule: propTypes.object
  8343. };
  8344. var defaultProps$W = {
  8345. tag: 'div'
  8346. };
  8347. var childContextTypes$2 = {
  8348. activeTabId: propTypes.any
  8349. };
  8350. var TabContent =
  8351. /*#__PURE__*/
  8352. function (_Component) {
  8353. _inheritsLoose(TabContent, _Component);
  8354. TabContent.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, prevState) {
  8355. if (prevState.activeTab !== nextProps.activeTab) {
  8356. return {
  8357. activeTab: nextProps.activeTab
  8358. };
  8359. }
  8360. return null;
  8361. };
  8362. function TabContent(props) {
  8363. var _this;
  8364. _this = _Component.call(this, props) || this;
  8365. _this.state = {
  8366. activeTab: _this.props.activeTab
  8367. };
  8368. return _this;
  8369. }
  8370. var _proto = TabContent.prototype;
  8371. _proto.getChildContext = function getChildContext() {
  8372. return {
  8373. activeTabId: this.state.activeTab
  8374. };
  8375. };
  8376. _proto.render = function render() {
  8377. var _this$props = this.props,
  8378. className = _this$props.className,
  8379. cssModule = _this$props.cssModule,
  8380. Tag = _this$props.tag;
  8381. var attributes = omit(this.props, Object.keys(propTypes$11));
  8382. var classes = mapToCssModules(classnames('tab-content', className), cssModule);
  8383. return React__default.createElement(Tag, _extends({}, attributes, {
  8384. className: classes
  8385. }));
  8386. };
  8387. return TabContent;
  8388. }(React.Component);
  8389. polyfill(TabContent);
  8390. TabContent.propTypes = propTypes$11;
  8391. TabContent.defaultProps = defaultProps$W;
  8392. TabContent.childContextTypes = childContextTypes$2;
  8393. var propTypes$12 = {
  8394. tag: tagPropType,
  8395. className: propTypes.string,
  8396. cssModule: propTypes.object,
  8397. tabId: propTypes.any
  8398. };
  8399. var defaultProps$X = {
  8400. tag: 'div'
  8401. };
  8402. var contextTypes$3 = {
  8403. activeTabId: propTypes.any
  8404. };
  8405. function TabPane(props, context) {
  8406. var className = props.className,
  8407. cssModule = props.cssModule,
  8408. tabId = props.tabId,
  8409. Tag = props.tag,
  8410. attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tabId", "tag"]);
  8411. var classes = mapToCssModules(classnames('tab-pane', className, {
  8412. active: tabId === context.activeTabId
  8413. }), cssModule);
  8414. return React__default.createElement(Tag, _extends({}, attributes, {
  8415. className: classes
  8416. }));
  8417. }
  8418. TabPane.propTypes = propTypes$12;
  8419. TabPane.defaultProps = defaultProps$X;
  8420. TabPane.contextTypes = contextTypes$3;
  8421. var propTypes$13 = {
  8422. tag: tagPropType,
  8423. fluid: propTypes.bool,
  8424. className: propTypes.string,
  8425. cssModule: propTypes.object
  8426. };
  8427. var defaultProps$Y = {
  8428. tag: 'div'
  8429. };
  8430. var Jumbotron = function Jumbotron(props) {
  8431. var className = props.className,
  8432. cssModule = props.cssModule,
  8433. Tag = props.tag,
  8434. fluid = props.fluid,
  8435. attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag", "fluid"]);
  8436. var classes = mapToCssModules(classnames(className, 'jumbotron', fluid ? 'jumbotron-fluid' : false), cssModule);
  8437. return React__default.createElement(Tag, _extends({}, attributes, {
  8438. className: classes
  8439. }));
  8440. };
  8441. Jumbotron.propTypes = propTypes$13;
  8442. Jumbotron.defaultProps = defaultProps$Y;
  8443. var propTypes$14 = {
  8444. children: propTypes.node,
  8445. className: propTypes.string,
  8446. closeClassName: propTypes.string,
  8447. closeAriaLabel: propTypes.string,
  8448. cssModule: propTypes.object,
  8449. color: propTypes.string,
  8450. fade: propTypes.bool,
  8451. isOpen: propTypes.bool,
  8452. toggle: propTypes.func,
  8453. tag: tagPropType,
  8454. transition: propTypes.shape(Fade.propTypes),
  8455. innerRef: propTypes.oneOfType([propTypes.object, propTypes.string, propTypes.func])
  8456. };
  8457. var defaultProps$Z = {
  8458. color: 'success',
  8459. isOpen: true,
  8460. tag: 'div',
  8461. closeAriaLabel: 'Close',
  8462. fade: true,
  8463. transition: _extends({}, Fade.defaultProps, {
  8464. unmountOnExit: true
  8465. })
  8466. };
  8467. function Alert(props) {
  8468. var className = props.className,
  8469. closeClassName = props.closeClassName,
  8470. closeAriaLabel = props.closeAriaLabel,
  8471. cssModule = props.cssModule,
  8472. Tag = props.tag,
  8473. color = props.color,
  8474. isOpen = props.isOpen,
  8475. toggle = props.toggle,
  8476. children = props.children,
  8477. transition = props.transition,
  8478. fade = props.fade,
  8479. innerRef = props.innerRef,
  8480. attributes = _objectWithoutPropertiesLoose(props, ["className", "closeClassName", "closeAriaLabel", "cssModule", "tag", "color", "isOpen", "toggle", "children", "transition", "fade", "innerRef"]);
  8481. var classes = mapToCssModules(classnames(className, 'alert', "alert-" + color, {
  8482. 'alert-dismissible': toggle
  8483. }), cssModule);
  8484. var closeClasses = mapToCssModules(classnames('close', closeClassName), cssModule);
  8485. var alertTransition = _extends({}, Fade.defaultProps, transition, {
  8486. baseClass: fade ? transition.baseClass : '',
  8487. timeout: fade ? transition.timeout : 0
  8488. });
  8489. return React__default.createElement(Fade, _extends({}, attributes, alertTransition, {
  8490. tag: Tag,
  8491. className: classes,
  8492. in: isOpen,
  8493. role: "alert",
  8494. innerRef: innerRef
  8495. }), toggle ? React__default.createElement("button", {
  8496. type: "button",
  8497. className: closeClasses,
  8498. "aria-label": closeAriaLabel,
  8499. onClick: toggle
  8500. }, React__default.createElement("span", {
  8501. "aria-hidden": "true"
  8502. }, "\xD7")) : null, children);
  8503. }
  8504. Alert.propTypes = propTypes$14;
  8505. Alert.defaultProps = defaultProps$Z;
  8506. var _transitionStatusToCl;
  8507. var propTypes$15 = _extends({}, reactTransitionGroup_1.propTypes, {
  8508. isOpen: propTypes.bool,
  8509. children: propTypes.oneOfType([propTypes.arrayOf(propTypes.node), propTypes.node]),
  8510. tag: tagPropType,
  8511. className: propTypes.node,
  8512. navbar: propTypes.bool,
  8513. cssModule: propTypes.object,
  8514. innerRef: propTypes.oneOfType([propTypes.func, propTypes.string, propTypes.object])
  8515. });
  8516. var defaultProps$_ = _extends({}, reactTransitionGroup_1.defaultProps, {
  8517. isOpen: false,
  8518. appear: false,
  8519. enter: true,
  8520. exit: true,
  8521. tag: 'div',
  8522. timeout: TransitionTimeouts.Collapse
  8523. });
  8524. var transitionStatusToClassHash = (_transitionStatusToCl = {}, _transitionStatusToCl[TransitionStatuses.ENTERING] = 'collapsing', _transitionStatusToCl[TransitionStatuses.ENTERED] = 'collapse show', _transitionStatusToCl[TransitionStatuses.EXITING] = 'collapsing', _transitionStatusToCl[TransitionStatuses.EXITED] = 'collapse', _transitionStatusToCl);
  8525. function getTransitionClass(status) {
  8526. return transitionStatusToClassHash[status] || 'collapse';
  8527. }
  8528. function getHeight(node) {
  8529. return node.scrollHeight;
  8530. }
  8531. var Collapse =
  8532. /*#__PURE__*/
  8533. function (_Component) {
  8534. _inheritsLoose(Collapse, _Component);
  8535. function Collapse(props) {
  8536. var _this;
  8537. _this = _Component.call(this, props) || this;
  8538. _this.state = {
  8539. height: null
  8540. };
  8541. ['onEntering', 'onEntered', 'onExit', 'onExiting', 'onExited'].forEach(function (name) {
  8542. _this[name] = _this[name].bind(_assertThisInitialized(_assertThisInitialized(_this)));
  8543. });
  8544. return _this;
  8545. }
  8546. var _proto = Collapse.prototype;
  8547. _proto.onEntering = function onEntering(node, isAppearing) {
  8548. this.setState({
  8549. height: getHeight(node)
  8550. });
  8551. this.props.onEntering(node, isAppearing);
  8552. };
  8553. _proto.onEntered = function onEntered(node, isAppearing) {
  8554. this.setState({
  8555. height: null
  8556. });
  8557. this.props.onEntered(node, isAppearing);
  8558. };
  8559. _proto.onExit = function onExit(node) {
  8560. this.setState({
  8561. height: getHeight(node)
  8562. });
  8563. this.props.onExit(node);
  8564. };
  8565. _proto.onExiting = function onExiting(node) {
  8566. // getting this variable triggers a reflow
  8567. var _unused = node.offsetHeight; // eslint-disable-line no-unused-vars
  8568. this.setState({
  8569. height: 0
  8570. });
  8571. this.props.onExiting(node);
  8572. };
  8573. _proto.onExited = function onExited(node) {
  8574. this.setState({
  8575. height: null
  8576. });
  8577. this.props.onExited(node);
  8578. };
  8579. _proto.render = function render() {
  8580. var _this2 = this;
  8581. var _this$props = this.props,
  8582. Tag = _this$props.tag,
  8583. isOpen = _this$props.isOpen,
  8584. className = _this$props.className,
  8585. navbar = _this$props.navbar,
  8586. cssModule = _this$props.cssModule,
  8587. children = _this$props.children,
  8588. innerRef = _this$props.innerRef,
  8589. otherProps = _objectWithoutPropertiesLoose(_this$props, ["tag", "isOpen", "className", "navbar", "cssModule", "children", "innerRef"]);
  8590. var height = this.state.height;
  8591. var transitionProps = pick(otherProps, TransitionPropTypeKeys);
  8592. var childProps = omit(otherProps, TransitionPropTypeKeys);
  8593. return React__default.createElement(reactTransitionGroup_1, _extends({}, transitionProps, {
  8594. in: isOpen,
  8595. onEntering: this.onEntering,
  8596. onEntered: this.onEntered,
  8597. onExit: this.onExit,
  8598. onExiting: this.onExiting,
  8599. onExited: this.onExited
  8600. }), function (status) {
  8601. var collapseClass = getTransitionClass(status);
  8602. var classes = mapToCssModules(classnames(className, collapseClass, navbar && 'navbar-collapse'), cssModule);
  8603. var style = height === null ? null : {
  8604. height: height
  8605. };
  8606. return React__default.createElement(Tag, _extends({}, childProps, {
  8607. style: _extends({}, childProps.style, style),
  8608. className: classes,
  8609. ref: _this2.props.innerRef
  8610. }), children);
  8611. });
  8612. };
  8613. return Collapse;
  8614. }(React.Component);
  8615. Collapse.propTypes = propTypes$15;
  8616. Collapse.defaultProps = defaultProps$_;
  8617. var propTypes$16 = {
  8618. tag: tagPropType,
  8619. active: propTypes.bool,
  8620. disabled: propTypes.bool,
  8621. color: propTypes.string,
  8622. action: propTypes.bool,
  8623. className: propTypes.any,
  8624. cssModule: propTypes.object
  8625. };
  8626. var defaultProps$10 = {
  8627. tag: 'li'
  8628. };
  8629. var handleDisabledOnClick = function handleDisabledOnClick(e) {
  8630. e.preventDefault();
  8631. };
  8632. var ListGroupItem = function ListGroupItem(props) {
  8633. var className = props.className,
  8634. cssModule = props.cssModule,
  8635. Tag = props.tag,
  8636. active = props.active,
  8637. disabled = props.disabled,
  8638. action = props.action,
  8639. color = props.color,
  8640. attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag", "active", "disabled", "action", "color"]);
  8641. var classes = mapToCssModules(classnames(className, active ? 'active' : false, disabled ? 'disabled' : false, action ? 'list-group-item-action' : false, color ? "list-group-item-" + color : false, 'list-group-item'), cssModule); // Prevent click event when disabled.
  8642. if (disabled) {
  8643. attributes.onClick = handleDisabledOnClick;
  8644. }
  8645. return React__default.createElement(Tag, _extends({}, attributes, {
  8646. className: classes
  8647. }));
  8648. };
  8649. ListGroupItem.propTypes = propTypes$16;
  8650. ListGroupItem.defaultProps = defaultProps$10;
  8651. var propTypes$17 = {
  8652. tag: tagPropType,
  8653. className: propTypes.any,
  8654. cssModule: propTypes.object
  8655. };
  8656. var defaultProps$11 = {
  8657. tag: 'h5'
  8658. };
  8659. var ListGroupItemHeading = function ListGroupItemHeading(props) {
  8660. var className = props.className,
  8661. cssModule = props.cssModule,
  8662. Tag = props.tag,
  8663. attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
  8664. var classes = mapToCssModules(classnames(className, 'list-group-item-heading'), cssModule);
  8665. return React__default.createElement(Tag, _extends({}, attributes, {
  8666. className: classes
  8667. }));
  8668. };
  8669. ListGroupItemHeading.propTypes = propTypes$17;
  8670. ListGroupItemHeading.defaultProps = defaultProps$11;
  8671. var propTypes$18 = {
  8672. tag: tagPropType,
  8673. className: propTypes.any,
  8674. cssModule: propTypes.object
  8675. };
  8676. var defaultProps$12 = {
  8677. tag: 'p'
  8678. };
  8679. var ListGroupItemText = function ListGroupItemText(props) {
  8680. var className = props.className,
  8681. cssModule = props.cssModule,
  8682. Tag = props.tag,
  8683. attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
  8684. var classes = mapToCssModules(classnames(className, 'list-group-item-text'), cssModule);
  8685. return React__default.createElement(Tag, _extends({}, attributes, {
  8686. className: classes
  8687. }));
  8688. };
  8689. ListGroupItemText.propTypes = propTypes$18;
  8690. ListGroupItemText.defaultProps = defaultProps$12;
  8691. var UncontrolledAlert =
  8692. /*#__PURE__*/
  8693. function (_Component) {
  8694. _inheritsLoose(UncontrolledAlert, _Component);
  8695. function UncontrolledAlert(props) {
  8696. var _this;
  8697. _this = _Component.call(this, props) || this;
  8698. _this.state = {
  8699. isOpen: true
  8700. };
  8701. _this.toggle = _this.toggle.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  8702. return _this;
  8703. }
  8704. var _proto = UncontrolledAlert.prototype;
  8705. _proto.toggle = function toggle() {
  8706. this.setState({
  8707. isOpen: !this.state.isOpen
  8708. });
  8709. };
  8710. _proto.render = function render() {
  8711. return React__default.createElement(Alert, _extends({
  8712. isOpen: this.state.isOpen,
  8713. toggle: this.toggle
  8714. }, this.props));
  8715. };
  8716. return UncontrolledAlert;
  8717. }(React.Component);
  8718. var omitKeys$1 = ['defaultOpen'];
  8719. var UncontrolledButtonDropdown =
  8720. /*#__PURE__*/
  8721. function (_Component) {
  8722. _inheritsLoose(UncontrolledButtonDropdown, _Component);
  8723. function UncontrolledButtonDropdown(props) {
  8724. var _this;
  8725. _this = _Component.call(this, props) || this;
  8726. _this.state = {
  8727. isOpen: props.defaultOpen || false
  8728. };
  8729. _this.toggle = _this.toggle.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  8730. return _this;
  8731. }
  8732. var _proto = UncontrolledButtonDropdown.prototype;
  8733. _proto.toggle = function toggle() {
  8734. this.setState({
  8735. isOpen: !this.state.isOpen
  8736. });
  8737. };
  8738. _proto.render = function render() {
  8739. return React__default.createElement(ButtonDropdown, _extends({
  8740. isOpen: this.state.isOpen,
  8741. toggle: this.toggle
  8742. }, omit(this.props, omitKeys$1)));
  8743. };
  8744. return UncontrolledButtonDropdown;
  8745. }(React.Component);
  8746. UncontrolledButtonDropdown.propTypes = _extends({
  8747. defaultOpen: propTypes.bool
  8748. }, ButtonDropdown.propTypes);
  8749. var omitKeys$2 = ['toggleEvents', 'defaultOpen'];
  8750. var propTypes$19 = {
  8751. defaultOpen: propTypes.bool,
  8752. toggler: propTypes.string.isRequired,
  8753. toggleEvents: propTypes.arrayOf(propTypes.string)
  8754. };
  8755. var defaultProps$13 = {
  8756. toggleEvents: defaultToggleEvents
  8757. };
  8758. var UncontrolledCollapse =
  8759. /*#__PURE__*/
  8760. function (_Component) {
  8761. _inheritsLoose(UncontrolledCollapse, _Component);
  8762. function UncontrolledCollapse(props) {
  8763. var _this;
  8764. _this = _Component.call(this, props) || this;
  8765. _this.togglers = null;
  8766. _this.removeEventListeners = null;
  8767. _this.toggle = _this.toggle.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  8768. _this.state = {
  8769. isOpen: props.defaultOpen || false
  8770. };
  8771. return _this;
  8772. }
  8773. var _proto = UncontrolledCollapse.prototype;
  8774. _proto.componentDidMount = function componentDidMount() {
  8775. this.togglers = findDOMElements(this.props.toggler);
  8776. if (this.togglers.length) {
  8777. this.removeEventListeners = addMultipleEventListeners(this.togglers, this.toggle, this.props.toggleEvents);
  8778. }
  8779. };
  8780. _proto.componentWillUnmount = function componentWillUnmount() {
  8781. if (this.togglers.length && this.removeEventListeners) {
  8782. this.removeEventListeners();
  8783. }
  8784. };
  8785. _proto.toggle = function toggle(e) {
  8786. this.setState(function (_ref) {
  8787. var isOpen = _ref.isOpen;
  8788. return {
  8789. isOpen: !isOpen
  8790. };
  8791. });
  8792. e.preventDefault();
  8793. };
  8794. _proto.render = function render() {
  8795. return React__default.createElement(Collapse, _extends({
  8796. isOpen: this.state.isOpen
  8797. }, omit(this.props, omitKeys$2)));
  8798. };
  8799. return UncontrolledCollapse;
  8800. }(React.Component);
  8801. UncontrolledCollapse.propTypes = propTypes$19;
  8802. UncontrolledCollapse.defaultProps = defaultProps$13;
  8803. var omitKeys$3 = ['defaultOpen'];
  8804. var UncontrolledDropdown =
  8805. /*#__PURE__*/
  8806. function (_Component) {
  8807. _inheritsLoose(UncontrolledDropdown, _Component);
  8808. function UncontrolledDropdown(props) {
  8809. var _this;
  8810. _this = _Component.call(this, props) || this;
  8811. _this.state = {
  8812. isOpen: props.defaultOpen || false
  8813. };
  8814. _this.toggle = _this.toggle.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  8815. return _this;
  8816. }
  8817. var _proto = UncontrolledDropdown.prototype;
  8818. _proto.toggle = function toggle() {
  8819. this.setState({
  8820. isOpen: !this.state.isOpen
  8821. });
  8822. };
  8823. _proto.render = function render() {
  8824. return React__default.createElement(Dropdown, _extends({
  8825. isOpen: this.state.isOpen,
  8826. toggle: this.toggle
  8827. }, omit(this.props, omitKeys$3)));
  8828. };
  8829. return UncontrolledDropdown;
  8830. }(React.Component);
  8831. UncontrolledDropdown.propTypes = _extends({
  8832. defaultOpen: propTypes.bool
  8833. }, Dropdown.propTypes);
  8834. var UncontrolledNavDropdown = function UncontrolledNavDropdown(props) {
  8835. warnOnce('The "UncontrolledNavDropdown" component has been deprecated.\nPlease use component "UncontrolledDropdown" with nav prop.');
  8836. return React__default.createElement(UncontrolledDropdown, _extends({
  8837. nav: true
  8838. }, props));
  8839. };
  8840. var omitKeys$4 = ['defaultOpen'];
  8841. var UncontrolledTooltip =
  8842. /*#__PURE__*/
  8843. function (_Component) {
  8844. _inheritsLoose(UncontrolledTooltip, _Component);
  8845. function UncontrolledTooltip(props) {
  8846. var _this;
  8847. _this = _Component.call(this, props) || this;
  8848. _this.state = {
  8849. isOpen: props.defaultOpen || false
  8850. };
  8851. _this.toggle = _this.toggle.bind(_assertThisInitialized(_assertThisInitialized(_this)));
  8852. return _this;
  8853. }
  8854. var _proto = UncontrolledTooltip.prototype;
  8855. _proto.toggle = function toggle() {
  8856. this.setState({
  8857. isOpen: !this.state.isOpen
  8858. });
  8859. };
  8860. _proto.render = function render() {
  8861. return React__default.createElement(Tooltip, _extends({
  8862. isOpen: this.state.isOpen,
  8863. toggle: this.toggle
  8864. }, omit(this.props, omitKeys$4)));
  8865. };
  8866. return UncontrolledTooltip;
  8867. }(React.Component);
  8868. UncontrolledTooltip.propTypes = _extends({
  8869. defaultOpen: propTypes.bool
  8870. }, Tooltip.propTypes);
  8871. var propTypes$1a = {
  8872. tag: tagPropType,
  8873. type: propTypes.string,
  8874. size: propTypes.string,
  8875. color: propTypes.string,
  8876. className: propTypes.string,
  8877. cssModule: propTypes.object,
  8878. children: propTypes.string
  8879. };
  8880. var defaultProps$14 = {
  8881. tag: 'div',
  8882. type: 'border',
  8883. children: 'Loading...'
  8884. };
  8885. var Spinner = function Spinner(props) {
  8886. var className = props.className,
  8887. cssModule = props.cssModule,
  8888. type = props.type,
  8889. size = props.size,
  8890. color = props.color,
  8891. children = props.children,
  8892. Tag = props.tag,
  8893. attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "type", "size", "color", "children", "tag"]);
  8894. var classes = mapToCssModules(classnames(className, size ? "spinner-" + type + "-" + size : false, "spinner-" + type, color ? "text-" + color : false), cssModule);
  8895. return React__default.createElement(Tag, _extends({
  8896. role: "status"
  8897. }, attributes, {
  8898. className: classes
  8899. }), children && React__default.createElement("span", {
  8900. className: mapToCssModules('sr-only', cssModule)
  8901. }, children));
  8902. };
  8903. Spinner.propTypes = propTypes$1a;
  8904. Spinner.defaultProps = defaultProps$14;
  8905. exports.Container = Container;
  8906. exports.Row = Row;
  8907. exports.Col = Col;
  8908. exports.Navbar = Navbar;
  8909. exports.NavbarBrand = NavbarBrand;
  8910. exports.NavbarToggler = NavbarToggler;
  8911. exports.Nav = Nav;
  8912. exports.NavItem = NavItem;
  8913. exports.NavDropdown = NavDropdown;
  8914. exports.NavLink = NavLink;
  8915. exports.Breadcrumb = Breadcrumb;
  8916. exports.BreadcrumbItem = BreadcrumbItem;
  8917. exports.Button = Button;
  8918. exports.ButtonDropdown = ButtonDropdown;
  8919. exports.ButtonGroup = ButtonGroup;
  8920. exports.ButtonToolbar = ButtonToolbar;
  8921. exports.Dropdown = Dropdown;
  8922. exports.DropdownItem = DropdownItem;
  8923. exports.DropdownMenu = DropdownMenu;
  8924. exports.DropdownToggle = DropdownToggle;
  8925. exports.Fade = Fade;
  8926. exports.Badge = Badge;
  8927. exports.Card = Card;
  8928. exports.CardGroup = CardGroup;
  8929. exports.CardDeck = CardDeck;
  8930. exports.CardColumns = CardColumns;
  8931. exports.CardBody = CardBody;
  8932. exports.CardBlock = CardBlock;
  8933. exports.CardLink = CardLink;
  8934. exports.CardFooter = CardFooter;
  8935. exports.CardHeader = CardHeader;
  8936. exports.CardImg = CardImg;
  8937. exports.CardImgOverlay = CardImgOverlay;
  8938. exports.Carousel = Carousel;
  8939. exports.UncontrolledCarousel = UncontrolledCarousel;
  8940. exports.CarouselControl = CarouselControl;
  8941. exports.CarouselItem = CarouselItem;
  8942. exports.CarouselIndicators = CarouselIndicators;
  8943. exports.CarouselCaption = CarouselCaption;
  8944. exports.CardSubtitle = CardSubtitle;
  8945. exports.CardText = CardText;
  8946. exports.CardTitle = CardTitle;
  8947. exports.CustomInput = CustomInput;
  8948. exports.PopperContent = PopperContent;
  8949. exports.PopperTargetHelper = PopperTargetHelper;
  8950. exports.Popover = Popover;
  8951. exports.UncontrolledPopover = UncontrolledPopover;
  8952. exports.PopoverHeader = PopoverHeader;
  8953. exports.PopoverTitle = PopoverTitle;
  8954. exports.PopoverBody = PopoverBody;
  8955. exports.PopoverContent = PopoverContent;
  8956. exports.Progress = Progress;
  8957. exports.Modal = Modal;
  8958. exports.ModalHeader = ModalHeader;
  8959. exports.ModalBody = ModalBody;
  8960. exports.ModalFooter = ModalFooter;
  8961. exports.Tooltip = Tooltip;
  8962. exports.Table = Table;
  8963. exports.ListGroup = ListGroup;
  8964. exports.Form = Form;
  8965. exports.FormFeedback = FormFeedback;
  8966. exports.FormGroup = FormGroup;
  8967. exports.FormText = FormText;
  8968. exports.Input = Input;
  8969. exports.InputGroup = InputGroup;
  8970. exports.InputGroupAddon = InputGroupAddon;
  8971. exports.InputGroupButton = InputGroupButton;
  8972. exports.InputGroupButtonDropdown = InputGroupButtonDropdown;
  8973. exports.InputGroupText = InputGroupText;
  8974. exports.Label = Label;
  8975. exports.Media = Media;
  8976. exports.Pagination = Pagination;
  8977. exports.PaginationItem = PaginationItem;
  8978. exports.PaginationLink = PaginationLink;
  8979. exports.TabContent = TabContent;
  8980. exports.TabPane = TabPane;
  8981. exports.Jumbotron = Jumbotron;
  8982. exports.Alert = Alert;
  8983. exports.Collapse = Collapse;
  8984. exports.ListGroupItem = ListGroupItem;
  8985. exports.ListGroupItemHeading = ListGroupItemHeading;
  8986. exports.ListGroupItemText = ListGroupItemText;
  8987. exports.UncontrolledAlert = UncontrolledAlert;
  8988. exports.UncontrolledButtonDropdown = UncontrolledButtonDropdown;
  8989. exports.UncontrolledCollapse = UncontrolledCollapse;
  8990. exports.UncontrolledDropdown = UncontrolledDropdown;
  8991. exports.UncontrolledNavDropdown = UncontrolledNavDropdown;
  8992. exports.UncontrolledTooltip = UncontrolledTooltip;
  8993. exports.Spinner = Spinner;
  8994. exports.Util = utils;
  8995. Object.defineProperty(exports, '__esModule', { value: true });
  8996. }));
  8997. //# sourceMappingURL=reactstrap.full.js.map