Epitech's Blih Repository Manager

application.js 658KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942199431994419945
  1. /******/ (function(modules) { // webpackBootstrap
  2. /******/ // The module cache
  3. /******/ var installedModules = {};
  4. /******/ // The require function
  5. /******/ function __webpack_require__(moduleId) {
  6. /******/ // Check if module is in cache
  7. /******/ if(installedModules[moduleId])
  8. /******/ return installedModules[moduleId].exports;
  9. /******/ // Create a new module (and put it into the cache)
  10. /******/ var module = installedModules[moduleId] = {
  11. /******/ exports: {},
  12. /******/ id: moduleId,
  13. /******/ loaded: false
  14. /******/ };
  15. /******/ // Execute the module function
  16. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  17. /******/ // Flag the module as loaded
  18. /******/ module.loaded = true;
  19. /******/ // Return the exports of the module
  20. /******/ return module.exports;
  21. /******/ }
  22. /******/ // expose the modules object (__webpack_modules__)
  23. /******/ __webpack_require__.m = modules;
  24. /******/ // expose the module cache
  25. /******/ __webpack_require__.c = installedModules;
  26. /******/ // __webpack_public_path__
  27. /******/ __webpack_require__.p = "";
  28. /******/ // Load entry module and return exports
  29. /******/ return __webpack_require__(0);
  30. /******/ })
  31. /************************************************************************/
  32. /******/ ([
  33. /* 0 */
  34. /***/ function(module, exports, __webpack_require__) {
  35. 'use strict';
  36. var _react = __webpack_require__(1);
  37. var _react2 = _interopRequireDefault(_react);
  38. var _reactDom = __webpack_require__(34);
  39. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  40. window.addEventListener('load', function () {
  41. (0, _reactDom.render)(_react2.default.createElement(
  42. 'h2',
  43. null,
  44. 'Welcome to React!'
  45. ), document.getElementById('App'));
  46. });
  47. /***/ },
  48. /* 1 */
  49. /***/ function(module, exports, __webpack_require__) {
  50. 'use strict';
  51. module.exports = __webpack_require__(2);
  52. /***/ },
  53. /* 2 */
  54. /***/ function(module, exports, __webpack_require__) {
  55. /**
  56. * Copyright 2013-present, Facebook, Inc.
  57. * All rights reserved.
  58. *
  59. * This source code is licensed under the BSD-style license found in the
  60. * LICENSE file in the root directory of this source tree. An additional grant
  61. * of patent rights can be found in the PATENTS file in the same directory.
  62. *
  63. * @providesModule React
  64. */
  65. 'use strict';
  66. var _assign = __webpack_require__(3);
  67. var ReactChildren = __webpack_require__(4);
  68. var ReactComponent = __webpack_require__(15);
  69. var ReactClass = __webpack_require__(23);
  70. var ReactDOMFactories = __webpack_require__(28);
  71. var ReactElement = __webpack_require__(7);
  72. var ReactElementValidator = __webpack_require__(29);
  73. var ReactPropTypes = __webpack_require__(31);
  74. var ReactVersion = __webpack_require__(32);
  75. var onlyChild = __webpack_require__(33);
  76. var warning = __webpack_require__(9);
  77. var createElement = ReactElement.createElement;
  78. var createFactory = ReactElement.createFactory;
  79. var cloneElement = ReactElement.cloneElement;
  80. if (false) {
  81. createElement = ReactElementValidator.createElement;
  82. createFactory = ReactElementValidator.createFactory;
  83. cloneElement = ReactElementValidator.cloneElement;
  84. }
  85. var __spread = _assign;
  86. if (false) {
  87. var warned = false;
  88. __spread = function () {
  89. process.env.NODE_ENV !== 'production' ? warning(warned, 'React.__spread is deprecated and should not be used. Use ' + 'Object.assign directly or another helper function with similar ' + 'semantics. You may be seeing this warning due to your compiler. ' + 'See https://fb.me/react-spread-deprecation for more details.') : void 0;
  90. warned = true;
  91. return _assign.apply(null, arguments);
  92. };
  93. }
  94. var React = {
  95. // Modern
  96. Children: {
  97. map: ReactChildren.map,
  98. forEach: ReactChildren.forEach,
  99. count: ReactChildren.count,
  100. toArray: ReactChildren.toArray,
  101. only: onlyChild
  102. },
  103. Component: ReactComponent,
  104. createElement: createElement,
  105. cloneElement: cloneElement,
  106. isValidElement: ReactElement.isValidElement,
  107. // Classic
  108. PropTypes: ReactPropTypes,
  109. createClass: ReactClass.createClass,
  110. createFactory: createFactory,
  111. createMixin: function (mixin) {
  112. // Currently a noop. Will be used to validate and trace mixins.
  113. return mixin;
  114. },
  115. // This looks DOM specific but these are actually isomorphic helpers
  116. // since they are just generating DOM strings.
  117. DOM: ReactDOMFactories,
  118. version: ReactVersion,
  119. // Deprecated hook for JSX spread, don't use this for anything.
  120. __spread: __spread
  121. };
  122. module.exports = React;
  123. /***/ },
  124. /* 3 */
  125. /***/ function(module, exports) {
  126. 'use strict';
  127. /* eslint-disable no-unused-vars */
  128. var hasOwnProperty = Object.prototype.hasOwnProperty;
  129. var propIsEnumerable = Object.prototype.propertyIsEnumerable;
  130. function toObject(val) {
  131. if (val === null || val === undefined) {
  132. throw new TypeError('Object.assign cannot be called with null or undefined');
  133. }
  134. return Object(val);
  135. }
  136. function shouldUseNative() {
  137. try {
  138. if (!Object.assign) {
  139. return false;
  140. }
  141. // Detect buggy property enumeration order in older V8 versions.
  142. // https://bugs.chromium.org/p/v8/issues/detail?id=4118
  143. var test1 = new String('abc'); // eslint-disable-line
  144. test1[5] = 'de';
  145. if (Object.getOwnPropertyNames(test1)[0] === '5') {
  146. return false;
  147. }
  148. // https://bugs.chromium.org/p/v8/issues/detail?id=3056
  149. var test2 = {};
  150. for (var i = 0; i < 10; i++) {
  151. test2['_' + String.fromCharCode(i)] = i;
  152. }
  153. var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
  154. return test2[n];
  155. });
  156. if (order2.join('') !== '0123456789') {
  157. return false;
  158. }
  159. // https://bugs.chromium.org/p/v8/issues/detail?id=3056
  160. var test3 = {};
  161. 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
  162. test3[letter] = letter;
  163. });
  164. if (Object.keys(Object.assign({}, test3)).join('') !==
  165. 'abcdefghijklmnopqrst') {
  166. return false;
  167. }
  168. return true;
  169. } catch (e) {
  170. // We don't expect any of the above to throw, but better to be safe.
  171. return false;
  172. }
  173. }
  174. module.exports = shouldUseNative() ? Object.assign : function (target, source) {
  175. var from;
  176. var to = toObject(target);
  177. var symbols;
  178. for (var s = 1; s < arguments.length; s++) {
  179. from = Object(arguments[s]);
  180. for (var key in from) {
  181. if (hasOwnProperty.call(from, key)) {
  182. to[key] = from[key];
  183. }
  184. }
  185. if (Object.getOwnPropertySymbols) {
  186. symbols = Object.getOwnPropertySymbols(from);
  187. for (var i = 0; i < symbols.length; i++) {
  188. if (propIsEnumerable.call(from, symbols[i])) {
  189. to[symbols[i]] = from[symbols[i]];
  190. }
  191. }
  192. }
  193. }
  194. return to;
  195. };
  196. /***/ },
  197. /* 4 */
  198. /***/ function(module, exports, __webpack_require__) {
  199. /**
  200. * Copyright 2013-present, Facebook, Inc.
  201. * All rights reserved.
  202. *
  203. * This source code is licensed under the BSD-style license found in the
  204. * LICENSE file in the root directory of this source tree. An additional grant
  205. * of patent rights can be found in the PATENTS file in the same directory.
  206. *
  207. * @providesModule ReactChildren
  208. */
  209. 'use strict';
  210. var PooledClass = __webpack_require__(5);
  211. var ReactElement = __webpack_require__(7);
  212. var emptyFunction = __webpack_require__(10);
  213. var traverseAllChildren = __webpack_require__(12);
  214. var twoArgumentPooler = PooledClass.twoArgumentPooler;
  215. var fourArgumentPooler = PooledClass.fourArgumentPooler;
  216. var userProvidedKeyEscapeRegex = /\/+/g;
  217. function escapeUserProvidedKey(text) {
  218. return ('' + text).replace(userProvidedKeyEscapeRegex, '$&/');
  219. }
  220. /**
  221. * PooledClass representing the bookkeeping associated with performing a child
  222. * traversal. Allows avoiding binding callbacks.
  223. *
  224. * @constructor ForEachBookKeeping
  225. * @param {!function} forEachFunction Function to perform traversal with.
  226. * @param {?*} forEachContext Context to perform context with.
  227. */
  228. function ForEachBookKeeping(forEachFunction, forEachContext) {
  229. this.func = forEachFunction;
  230. this.context = forEachContext;
  231. this.count = 0;
  232. }
  233. ForEachBookKeeping.prototype.destructor = function () {
  234. this.func = null;
  235. this.context = null;
  236. this.count = 0;
  237. };
  238. PooledClass.addPoolingTo(ForEachBookKeeping, twoArgumentPooler);
  239. function forEachSingleChild(bookKeeping, child, name) {
  240. var func = bookKeeping.func;
  241. var context = bookKeeping.context;
  242. func.call(context, child, bookKeeping.count++);
  243. }
  244. /**
  245. * Iterates through children that are typically specified as `props.children`.
  246. *
  247. * See https://facebook.github.io/react/docs/top-level-api.html#react.children.foreach
  248. *
  249. * The provided forEachFunc(child, index) will be called for each
  250. * leaf child.
  251. *
  252. * @param {?*} children Children tree container.
  253. * @param {function(*, int)} forEachFunc
  254. * @param {*} forEachContext Context for forEachContext.
  255. */
  256. function forEachChildren(children, forEachFunc, forEachContext) {
  257. if (children == null) {
  258. return children;
  259. }
  260. var traverseContext = ForEachBookKeeping.getPooled(forEachFunc, forEachContext);
  261. traverseAllChildren(children, forEachSingleChild, traverseContext);
  262. ForEachBookKeeping.release(traverseContext);
  263. }
  264. /**
  265. * PooledClass representing the bookkeeping associated with performing a child
  266. * mapping. Allows avoiding binding callbacks.
  267. *
  268. * @constructor MapBookKeeping
  269. * @param {!*} mapResult Object containing the ordered map of results.
  270. * @param {!function} mapFunction Function to perform mapping with.
  271. * @param {?*} mapContext Context to perform mapping with.
  272. */
  273. function MapBookKeeping(mapResult, keyPrefix, mapFunction, mapContext) {
  274. this.result = mapResult;
  275. this.keyPrefix = keyPrefix;
  276. this.func = mapFunction;
  277. this.context = mapContext;
  278. this.count = 0;
  279. }
  280. MapBookKeeping.prototype.destructor = function () {
  281. this.result = null;
  282. this.keyPrefix = null;
  283. this.func = null;
  284. this.context = null;
  285. this.count = 0;
  286. };
  287. PooledClass.addPoolingTo(MapBookKeeping, fourArgumentPooler);
  288. function mapSingleChildIntoContext(bookKeeping, child, childKey) {
  289. var result = bookKeeping.result;
  290. var keyPrefix = bookKeeping.keyPrefix;
  291. var func = bookKeeping.func;
  292. var context = bookKeeping.context;
  293. var mappedChild = func.call(context, child, bookKeeping.count++);
  294. if (Array.isArray(mappedChild)) {
  295. mapIntoWithKeyPrefixInternal(mappedChild, result, childKey, emptyFunction.thatReturnsArgument);
  296. } else if (mappedChild != null) {
  297. if (ReactElement.isValidElement(mappedChild)) {
  298. mappedChild = ReactElement.cloneAndReplaceKey(mappedChild,
  299. // Keep both the (mapped) and old keys if they differ, just as
  300. // traverseAllChildren used to do for objects as children
  301. keyPrefix + (mappedChild.key && (!child || child.key !== mappedChild.key) ? escapeUserProvidedKey(mappedChild.key) + '/' : '') + childKey);
  302. }
  303. result.push(mappedChild);
  304. }
  305. }
  306. function mapIntoWithKeyPrefixInternal(children, array, prefix, func, context) {
  307. var escapedPrefix = '';
  308. if (prefix != null) {
  309. escapedPrefix = escapeUserProvidedKey(prefix) + '/';
  310. }
  311. var traverseContext = MapBookKeeping.getPooled(array, escapedPrefix, func, context);
  312. traverseAllChildren(children, mapSingleChildIntoContext, traverseContext);
  313. MapBookKeeping.release(traverseContext);
  314. }
  315. /**
  316. * Maps children that are typically specified as `props.children`.
  317. *
  318. * See https://facebook.github.io/react/docs/top-level-api.html#react.children.map
  319. *
  320. * The provided mapFunction(child, key, index) will be called for each
  321. * leaf child.
  322. *
  323. * @param {?*} children Children tree container.
  324. * @param {function(*, int)} func The map function.
  325. * @param {*} context Context for mapFunction.
  326. * @return {object} Object containing the ordered map of results.
  327. */
  328. function mapChildren(children, func, context) {
  329. if (children == null) {
  330. return children;
  331. }
  332. var result = [];
  333. mapIntoWithKeyPrefixInternal(children, result, null, func, context);
  334. return result;
  335. }
  336. function forEachSingleChildDummy(traverseContext, child, name) {
  337. return null;
  338. }
  339. /**
  340. * Count the number of children that are typically specified as
  341. * `props.children`.
  342. *
  343. * See https://facebook.github.io/react/docs/top-level-api.html#react.children.count
  344. *
  345. * @param {?*} children Children tree container.
  346. * @return {number} The number of children.
  347. */
  348. function countChildren(children, context) {
  349. return traverseAllChildren(children, forEachSingleChildDummy, null);
  350. }
  351. /**
  352. * Flatten a children object (typically specified as `props.children`) and
  353. * return an array with appropriately re-keyed children.
  354. *
  355. * See https://facebook.github.io/react/docs/top-level-api.html#react.children.toarray
  356. */
  357. function toArray(children) {
  358. var result = [];
  359. mapIntoWithKeyPrefixInternal(children, result, null, emptyFunction.thatReturnsArgument);
  360. return result;
  361. }
  362. var ReactChildren = {
  363. forEach: forEachChildren,
  364. map: mapChildren,
  365. mapIntoWithKeyPrefixInternal: mapIntoWithKeyPrefixInternal,
  366. count: countChildren,
  367. toArray: toArray
  368. };
  369. module.exports = ReactChildren;
  370. /***/ },
  371. /* 5 */
  372. /***/ function(module, exports, __webpack_require__) {
  373. /**
  374. * Copyright 2013-present, Facebook, Inc.
  375. * All rights reserved.
  376. *
  377. * This source code is licensed under the BSD-style license found in the
  378. * LICENSE file in the root directory of this source tree. An additional grant
  379. * of patent rights can be found in the PATENTS file in the same directory.
  380. *
  381. * @providesModule PooledClass
  382. */
  383. 'use strict';
  384. var invariant = __webpack_require__(6);
  385. /**
  386. * Static poolers. Several custom versions for each potential number of
  387. * arguments. A completely generic pooler is easy to implement, but would
  388. * require accessing the `arguments` object. In each of these, `this` refers to
  389. * the Class itself, not an instance. If any others are needed, simply add them
  390. * here, or in their own files.
  391. */
  392. var oneArgumentPooler = function (copyFieldsFrom) {
  393. var Klass = this;
  394. if (Klass.instancePool.length) {
  395. var instance = Klass.instancePool.pop();
  396. Klass.call(instance, copyFieldsFrom);
  397. return instance;
  398. } else {
  399. return new Klass(copyFieldsFrom);
  400. }
  401. };
  402. var twoArgumentPooler = function (a1, a2) {
  403. var Klass = this;
  404. if (Klass.instancePool.length) {
  405. var instance = Klass.instancePool.pop();
  406. Klass.call(instance, a1, a2);
  407. return instance;
  408. } else {
  409. return new Klass(a1, a2);
  410. }
  411. };
  412. var threeArgumentPooler = function (a1, a2, a3) {
  413. var Klass = this;
  414. if (Klass.instancePool.length) {
  415. var instance = Klass.instancePool.pop();
  416. Klass.call(instance, a1, a2, a3);
  417. return instance;
  418. } else {
  419. return new Klass(a1, a2, a3);
  420. }
  421. };
  422. var fourArgumentPooler = function (a1, a2, a3, a4) {
  423. var Klass = this;
  424. if (Klass.instancePool.length) {
  425. var instance = Klass.instancePool.pop();
  426. Klass.call(instance, a1, a2, a3, a4);
  427. return instance;
  428. } else {
  429. return new Klass(a1, a2, a3, a4);
  430. }
  431. };
  432. var fiveArgumentPooler = function (a1, a2, a3, a4, a5) {
  433. var Klass = this;
  434. if (Klass.instancePool.length) {
  435. var instance = Klass.instancePool.pop();
  436. Klass.call(instance, a1, a2, a3, a4, a5);
  437. return instance;
  438. } else {
  439. return new Klass(a1, a2, a3, a4, a5);
  440. }
  441. };
  442. var standardReleaser = function (instance) {
  443. var Klass = this;
  444. !(instance instanceof Klass) ? false ? invariant(false, 'Trying to release an instance into a pool of a different type.') : invariant(false) : void 0;
  445. instance.destructor();
  446. if (Klass.instancePool.length < Klass.poolSize) {
  447. Klass.instancePool.push(instance);
  448. }
  449. };
  450. var DEFAULT_POOL_SIZE = 10;
  451. var DEFAULT_POOLER = oneArgumentPooler;
  452. /**
  453. * Augments `CopyConstructor` to be a poolable class, augmenting only the class
  454. * itself (statically) not adding any prototypical fields. Any CopyConstructor
  455. * you give this may have a `poolSize` property, and will look for a
  456. * prototypical `destructor` on instances (optional).
  457. *
  458. * @param {Function} CopyConstructor Constructor that can be used to reset.
  459. * @param {Function} pooler Customizable pooler.
  460. */
  461. var addPoolingTo = function (CopyConstructor, pooler) {
  462. var NewKlass = CopyConstructor;
  463. NewKlass.instancePool = [];
  464. NewKlass.getPooled = pooler || DEFAULT_POOLER;
  465. if (!NewKlass.poolSize) {
  466. NewKlass.poolSize = DEFAULT_POOL_SIZE;
  467. }
  468. NewKlass.release = standardReleaser;
  469. return NewKlass;
  470. };
  471. var PooledClass = {
  472. addPoolingTo: addPoolingTo,
  473. oneArgumentPooler: oneArgumentPooler,
  474. twoArgumentPooler: twoArgumentPooler,
  475. threeArgumentPooler: threeArgumentPooler,
  476. fourArgumentPooler: fourArgumentPooler,
  477. fiveArgumentPooler: fiveArgumentPooler
  478. };
  479. module.exports = PooledClass;
  480. /***/ },
  481. /* 6 */
  482. /***/ function(module, exports, __webpack_require__) {
  483. /**
  484. * Copyright (c) 2013-present, Facebook, Inc.
  485. * All rights reserved.
  486. *
  487. * This source code is licensed under the BSD-style license found in the
  488. * LICENSE file in the root directory of this source tree. An additional grant
  489. * of patent rights can be found in the PATENTS file in the same directory.
  490. *
  491. */
  492. 'use strict';
  493. /**
  494. * Use invariant() to assert state which your program assumes to be true.
  495. *
  496. * Provide sprintf-style format (only %s is supported) and arguments
  497. * to provide information about what broke and what you were
  498. * expecting.
  499. *
  500. * The invariant message will be stripped in production, but the invariant
  501. * will remain to ensure logic does not differ in production.
  502. */
  503. function invariant(condition, format, a, b, c, d, e, f) {
  504. if (false) {
  505. if (format === undefined) {
  506. throw new Error('invariant requires an error message argument');
  507. }
  508. }
  509. if (!condition) {
  510. var error;
  511. if (format === undefined) {
  512. error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');
  513. } else {
  514. var args = [a, b, c, d, e, f];
  515. var argIndex = 0;
  516. error = new Error(format.replace(/%s/g, function () {
  517. return args[argIndex++];
  518. }));
  519. error.name = 'Invariant Violation';
  520. }
  521. error.framesToPop = 1; // we don't care about invariant's own frame
  522. throw error;
  523. }
  524. }
  525. module.exports = invariant;
  526. /***/ },
  527. /* 7 */
  528. /***/ function(module, exports, __webpack_require__) {
  529. /**
  530. * Copyright 2014-present, Facebook, Inc.
  531. * All rights reserved.
  532. *
  533. * This source code is licensed under the BSD-style license found in the
  534. * LICENSE file in the root directory of this source tree. An additional grant
  535. * of patent rights can be found in the PATENTS file in the same directory.
  536. *
  537. * @providesModule ReactElement
  538. */
  539. 'use strict';
  540. var _assign = __webpack_require__(3);
  541. var ReactCurrentOwner = __webpack_require__(8);
  542. var warning = __webpack_require__(9);
  543. var canDefineProperty = __webpack_require__(11);
  544. // The Symbol used to tag the ReactElement type. If there is no native Symbol
  545. // nor polyfill, then a plain number is used for performance.
  546. var REACT_ELEMENT_TYPE = typeof Symbol === 'function' && Symbol['for'] && Symbol['for']('react.element') || 0xeac7;
  547. var RESERVED_PROPS = {
  548. key: true,
  549. ref: true,
  550. __self: true,
  551. __source: true
  552. };
  553. var specialPropKeyWarningShown, specialPropRefWarningShown;
  554. /**
  555. * Factory method to create a new React element. This no longer adheres to
  556. * the class pattern, so do not use new to call it. Also, no instanceof check
  557. * will work. Instead test $$typeof field against Symbol.for('react.element') to check
  558. * if something is a React Element.
  559. *
  560. * @param {*} type
  561. * @param {*} key
  562. * @param {string|object} ref
  563. * @param {*} self A *temporary* helper to detect places where `this` is
  564. * different from the `owner` when React.createElement is called, so that we
  565. * can warn. We want to get rid of owner and replace string `ref`s with arrow
  566. * functions, and as long as `this` and owner are the same, there will be no
  567. * change in behavior.
  568. * @param {*} source An annotation object (added by a transpiler or otherwise)
  569. * indicating filename, line number, and/or other information.
  570. * @param {*} owner
  571. * @param {*} props
  572. * @internal
  573. */
  574. var ReactElement = function (type, key, ref, self, source, owner, props) {
  575. var element = {
  576. // This tag allow us to uniquely identify this as a React Element
  577. $$typeof: REACT_ELEMENT_TYPE,
  578. // Built-in properties that belong on the element
  579. type: type,
  580. key: key,
  581. ref: ref,
  582. props: props,
  583. // Record the component responsible for creating this element.
  584. _owner: owner
  585. };
  586. if (false) {
  587. // The validation flag is currently mutative. We put it on
  588. // an external backing store so that we can freeze the whole object.
  589. // This can be replaced with a WeakMap once they are implemented in
  590. // commonly used development environments.
  591. element._store = {};
  592. // To make comparing ReactElements easier for testing purposes, we make
  593. // the validation flag non-enumerable (where possible, which should
  594. // include every environment we run tests in), so the test framework
  595. // ignores it.
  596. if (canDefineProperty) {
  597. Object.defineProperty(element._store, 'validated', {
  598. configurable: false,
  599. enumerable: false,
  600. writable: true,
  601. value: false
  602. });
  603. // self and source are DEV only properties.
  604. Object.defineProperty(element, '_self', {
  605. configurable: false,
  606. enumerable: false,
  607. writable: false,
  608. value: self
  609. });
  610. // Two elements created in two different places should be considered
  611. // equal for testing purposes and therefore we hide it from enumeration.
  612. Object.defineProperty(element, '_source', {
  613. configurable: false,
  614. enumerable: false,
  615. writable: false,
  616. value: source
  617. });
  618. } else {
  619. element._store.validated = false;
  620. element._self = self;
  621. element._source = source;
  622. }
  623. if (Object.freeze) {
  624. Object.freeze(element.props);
  625. Object.freeze(element);
  626. }
  627. }
  628. return element;
  629. };
  630. /**
  631. * Create and return a new ReactElement of the given type.
  632. * See https://facebook.github.io/react/docs/top-level-api.html#react.createelement
  633. */
  634. ReactElement.createElement = function (type, config, children) {
  635. var propName;
  636. // Reserved names are extracted
  637. var props = {};
  638. var key = null;
  639. var ref = null;
  640. var self = null;
  641. var source = null;
  642. if (config != null) {
  643. if (false) {
  644. process.env.NODE_ENV !== 'production' ? warning(
  645. /* eslint-disable no-proto */
  646. config.__proto__ == null || config.__proto__ === Object.prototype,
  647. /* eslint-enable no-proto */
  648. 'React.createElement(...): Expected props argument to be a plain object. ' + 'Properties defined in its prototype chain will be ignored.') : void 0;
  649. ref = !config.hasOwnProperty('ref') || Object.getOwnPropertyDescriptor(config, 'ref').get ? null : config.ref;
  650. key = !config.hasOwnProperty('key') || Object.getOwnPropertyDescriptor(config, 'key').get ? null : '' + config.key;
  651. } else {
  652. ref = config.ref === undefined ? null : config.ref;
  653. key = config.key === undefined ? null : '' + config.key;
  654. }
  655. self = config.__self === undefined ? null : config.__self;
  656. source = config.__source === undefined ? null : config.__source;
  657. // Remaining properties are added to a new props object
  658. for (propName in config) {
  659. if (config.hasOwnProperty(propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
  660. props[propName] = config[propName];
  661. }
  662. }
  663. }
  664. // Children can be more than one argument, and those are transferred onto
  665. // the newly allocated props object.
  666. var childrenLength = arguments.length - 2;
  667. if (childrenLength === 1) {
  668. props.children = children;
  669. } else if (childrenLength > 1) {
  670. var childArray = Array(childrenLength);
  671. for (var i = 0; i < childrenLength; i++) {
  672. childArray[i] = arguments[i + 2];
  673. }
  674. props.children = childArray;
  675. }
  676. // Resolve default props
  677. if (type && type.defaultProps) {
  678. var defaultProps = type.defaultProps;
  679. for (propName in defaultProps) {
  680. if (props[propName] === undefined) {
  681. props[propName] = defaultProps[propName];
  682. }
  683. }
  684. }
  685. if (false) {
  686. // Create dummy `key` and `ref` property to `props` to warn users
  687. // against its use
  688. if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {
  689. if (!props.hasOwnProperty('key')) {
  690. Object.defineProperty(props, 'key', {
  691. get: function () {
  692. if (!specialPropKeyWarningShown) {
  693. specialPropKeyWarningShown = true;
  694. process.env.NODE_ENV !== 'production' ? warning(false, '%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', typeof type === 'function' && 'displayName' in type ? type.displayName : 'Element') : void 0;
  695. }
  696. return undefined;
  697. },
  698. configurable: true
  699. });
  700. }
  701. if (!props.hasOwnProperty('ref')) {
  702. Object.defineProperty(props, 'ref', {
  703. get: function () {
  704. if (!specialPropRefWarningShown) {
  705. specialPropRefWarningShown = true;
  706. process.env.NODE_ENV !== 'production' ? warning(false, '%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', typeof type === 'function' && 'displayName' in type ? type.displayName : 'Element') : void 0;
  707. }
  708. return undefined;
  709. },
  710. configurable: true
  711. });
  712. }
  713. }
  714. }
  715. return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
  716. };
  717. /**
  718. * Return a function that produces ReactElements of a given type.
  719. * See https://facebook.github.io/react/docs/top-level-api.html#react.createfactory
  720. */
  721. ReactElement.createFactory = function (type) {
  722. var factory = ReactElement.createElement.bind(null, type);
  723. // Expose the type on the factory and the prototype so that it can be
  724. // easily accessed on elements. E.g. `<Foo />.type === Foo`.
  725. // This should not be named `constructor` since this may not be the function
  726. // that created the element, and it may not even be a constructor.
  727. // Legacy hook TODO: Warn if this is accessed
  728. factory.type = type;
  729. return factory;
  730. };
  731. ReactElement.cloneAndReplaceKey = function (oldElement, newKey) {
  732. var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);
  733. return newElement;
  734. };
  735. /**
  736. * Clone and return a new ReactElement using element as the starting point.
  737. * See https://facebook.github.io/react/docs/top-level-api.html#react.cloneelement
  738. */
  739. ReactElement.cloneElement = function (element, config, children) {
  740. var propName;
  741. // Original props are copied
  742. var props = _assign({}, element.props);
  743. // Reserved names are extracted
  744. var key = element.key;
  745. var ref = element.ref;
  746. // Self is preserved since the owner is preserved.
  747. var self = element._self;
  748. // Source is preserved since cloneElement is unlikely to be targeted by a
  749. // transpiler, and the original source is probably a better indicator of the
  750. // true owner.
  751. var source = element._source;
  752. // Owner will be preserved, unless ref is overridden
  753. var owner = element._owner;
  754. if (config != null) {
  755. if (false) {
  756. process.env.NODE_ENV !== 'production' ? warning(
  757. /* eslint-disable no-proto */
  758. config.__proto__ == null || config.__proto__ === Object.prototype,
  759. /* eslint-enable no-proto */
  760. 'React.cloneElement(...): Expected props argument to be a plain object. ' + 'Properties defined in its prototype chain will be ignored.') : void 0;
  761. }
  762. if (config.ref !== undefined) {
  763. // Silently steal the ref from the parent.
  764. ref = config.ref;
  765. owner = ReactCurrentOwner.current;
  766. }
  767. if (config.key !== undefined) {
  768. key = '' + config.key;
  769. }
  770. // Remaining properties override existing props
  771. var defaultProps;
  772. if (element.type && element.type.defaultProps) {
  773. defaultProps = element.type.defaultProps;
  774. }
  775. for (propName in config) {
  776. if (config.hasOwnProperty(propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
  777. if (config[propName] === undefined && defaultProps !== undefined) {
  778. // Resolve default props
  779. props[propName] = defaultProps[propName];
  780. } else {
  781. props[propName] = config[propName];
  782. }
  783. }
  784. }
  785. }
  786. // Children can be more than one argument, and those are transferred onto
  787. // the newly allocated props object.
  788. var childrenLength = arguments.length - 2;
  789. if (childrenLength === 1) {
  790. props.children = children;
  791. } else if (childrenLength > 1) {
  792. var childArray = Array(childrenLength);
  793. for (var i = 0; i < childrenLength; i++) {
  794. childArray[i] = arguments[i + 2];
  795. }
  796. props.children = childArray;
  797. }
  798. return ReactElement(element.type, key, ref, self, source, owner, props);
  799. };
  800. /**
  801. * Verifies the object is a ReactElement.
  802. * See https://facebook.github.io/react/docs/top-level-api.html#react.isvalidelement
  803. * @param {?object} object
  804. * @return {boolean} True if `object` is a valid component.
  805. * @final
  806. */
  807. ReactElement.isValidElement = function (object) {
  808. return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
  809. };
  810. module.exports = ReactElement;
  811. /***/ },
  812. /* 8 */
  813. /***/ function(module, exports) {
  814. /**
  815. * Copyright 2013-present, Facebook, Inc.
  816. * All rights reserved.
  817. *
  818. * This source code is licensed under the BSD-style license found in the
  819. * LICENSE file in the root directory of this source tree. An additional grant
  820. * of patent rights can be found in the PATENTS file in the same directory.
  821. *
  822. * @providesModule ReactCurrentOwner
  823. */
  824. 'use strict';
  825. /**
  826. * Keeps track of the current owner.
  827. *
  828. * The current owner is the component who should own any components that are
  829. * currently being constructed.
  830. */
  831. var ReactCurrentOwner = {
  832. /**
  833. * @internal
  834. * @type {ReactComponent}
  835. */
  836. current: null
  837. };
  838. module.exports = ReactCurrentOwner;
  839. /***/ },
  840. /* 9 */
  841. /***/ function(module, exports, __webpack_require__) {
  842. /**
  843. * Copyright 2014-2015, Facebook, Inc.
  844. * All rights reserved.
  845. *
  846. * This source code is licensed under the BSD-style license found in the
  847. * LICENSE file in the root directory of this source tree. An additional grant
  848. * of patent rights can be found in the PATENTS file in the same directory.
  849. *
  850. */
  851. 'use strict';
  852. var emptyFunction = __webpack_require__(10);
  853. /**
  854. * Similar to invariant but only logs a warning if the condition is not met.
  855. * This can be used to log issues in development environments in critical
  856. * paths. Removing the logging code for production environments will keep the
  857. * same logic and follow the same code paths.
  858. */
  859. var warning = emptyFunction;
  860. if (false) {
  861. (function () {
  862. var printWarning = function printWarning(format) {
  863. for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
  864. args[_key - 1] = arguments[_key];
  865. }
  866. var argIndex = 0;
  867. var message = 'Warning: ' + format.replace(/%s/g, function () {
  868. return args[argIndex++];
  869. });
  870. if (typeof console !== 'undefined') {
  871. console.error(message);
  872. }
  873. try {
  874. // --- Welcome to debugging React ---
  875. // This error was thrown as a convenience so that you can use this stack
  876. // to find the callsite that caused this warning to fire.
  877. throw new Error(message);
  878. } catch (x) {}
  879. };
  880. warning = function warning(condition, format) {
  881. if (format === undefined) {
  882. throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');
  883. }
  884. if (format.indexOf('Failed Composite propType: ') === 0) {
  885. return; // Ignore CompositeComponent proptype check.
  886. }
  887. if (!condition) {
  888. for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
  889. args[_key2 - 2] = arguments[_key2];
  890. }
  891. printWarning.apply(undefined, [format].concat(args));
  892. }
  893. };
  894. })();
  895. }
  896. module.exports = warning;
  897. /***/ },
  898. /* 10 */
  899. /***/ function(module, exports) {
  900. "use strict";
  901. /**
  902. * Copyright (c) 2013-present, Facebook, Inc.
  903. * All rights reserved.
  904. *
  905. * This source code is licensed under the BSD-style license found in the
  906. * LICENSE file in the root directory of this source tree. An additional grant
  907. * of patent rights can be found in the PATENTS file in the same directory.
  908. *
  909. *
  910. */
  911. function makeEmptyFunction(arg) {
  912. return function () {
  913. return arg;
  914. };
  915. }
  916. /**
  917. * This function accepts and discards inputs; it has no side effects. This is
  918. * primarily useful idiomatically for overridable function endpoints which
  919. * always need to be callable, since JS lacks a null-call idiom ala Cocoa.
  920. */
  921. var emptyFunction = function emptyFunction() {};
  922. emptyFunction.thatReturns = makeEmptyFunction;
  923. emptyFunction.thatReturnsFalse = makeEmptyFunction(false);
  924. emptyFunction.thatReturnsTrue = makeEmptyFunction(true);
  925. emptyFunction.thatReturnsNull = makeEmptyFunction(null);
  926. emptyFunction.thatReturnsThis = function () {
  927. return this;
  928. };
  929. emptyFunction.thatReturnsArgument = function (arg) {
  930. return arg;
  931. };
  932. module.exports = emptyFunction;
  933. /***/ },
  934. /* 11 */
  935. /***/ function(module, exports, __webpack_require__) {
  936. /**
  937. * Copyright 2013-present, Facebook, Inc.
  938. * All rights reserved.
  939. *
  940. * This source code is licensed under the BSD-style license found in the
  941. * LICENSE file in the root directory of this source tree. An additional grant
  942. * of patent rights can be found in the PATENTS file in the same directory.
  943. *
  944. * @providesModule canDefineProperty
  945. */
  946. 'use strict';
  947. var canDefineProperty = false;
  948. if (false) {
  949. try {
  950. Object.defineProperty({}, 'x', { get: function () {} });
  951. canDefineProperty = true;
  952. } catch (x) {
  953. // IE will fail on defineProperty
  954. }
  955. }
  956. module.exports = canDefineProperty;
  957. /***/ },
  958. /* 12 */
  959. /***/ function(module, exports, __webpack_require__) {
  960. /**
  961. * Copyright 2013-present, Facebook, Inc.
  962. * All rights reserved.
  963. *
  964. * This source code is licensed under the BSD-style license found in the
  965. * LICENSE file in the root directory of this source tree. An additional grant
  966. * of patent rights can be found in the PATENTS file in the same directory.
  967. *
  968. * @providesModule traverseAllChildren
  969. */
  970. 'use strict';
  971. var ReactCurrentOwner = __webpack_require__(8);
  972. var ReactElement = __webpack_require__(7);
  973. var getIteratorFn = __webpack_require__(13);
  974. var invariant = __webpack_require__(6);
  975. var KeyEscapeUtils = __webpack_require__(14);
  976. var warning = __webpack_require__(9);
  977. var SEPARATOR = '.';
  978. var SUBSEPARATOR = ':';
  979. /**
  980. * TODO: Test that a single child and an array with one item have the same key
  981. * pattern.
  982. */
  983. var didWarnAboutMaps = false;
  984. /**
  985. * Generate a key string that identifies a component within a set.
  986. *
  987. * @param {*} component A component that could contain a manual key.
  988. * @param {number} index Index that is used if a manual key is not provided.
  989. * @return {string}
  990. */
  991. function getComponentKey(component, index) {
  992. // Do some typechecking here since we call this blindly. We want to ensure
  993. // that we don't block potential future ES APIs.
  994. if (component && typeof component === 'object' && component.key != null) {
  995. // Explicit key
  996. return KeyEscapeUtils.escape(component.key);
  997. }
  998. // Implicit key determined by the index in the set
  999. return index.toString(36);
  1000. }
  1001. /**
  1002. * @param {?*} children Children tree container.
  1003. * @param {!string} nameSoFar Name of the key path so far.
  1004. * @param {!function} callback Callback to invoke with each child found.
  1005. * @param {?*} traverseContext Used to pass information throughout the traversal
  1006. * process.
  1007. * @return {!number} The number of children in this subtree.
  1008. */
  1009. function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext) {
  1010. var type = typeof children;
  1011. if (type === 'undefined' || type === 'boolean') {
  1012. // All of the above are perceived as null.
  1013. children = null;
  1014. }
  1015. if (children === null || type === 'string' || type === 'number' || ReactElement.isValidElement(children)) {
  1016. callback(traverseContext, children,
  1017. // If it's the only child, treat the name as if it was wrapped in an array
  1018. // so that it's consistent if the number of children grows.
  1019. nameSoFar === '' ? SEPARATOR + getComponentKey(children, 0) : nameSoFar);
  1020. return 1;
  1021. }
  1022. var child;
  1023. var nextName;
  1024. var subtreeCount = 0; // Count of children found in the current subtree.
  1025. var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;
  1026. if (Array.isArray(children)) {
  1027. for (var i = 0; i < children.length; i++) {
  1028. child = children[i];
  1029. nextName = nextNamePrefix + getComponentKey(child, i);
  1030. subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
  1031. }
  1032. } else {
  1033. var iteratorFn = getIteratorFn(children);
  1034. if (iteratorFn) {
  1035. var iterator = iteratorFn.call(children);
  1036. var step;
  1037. if (iteratorFn !== children.entries) {
  1038. var ii = 0;
  1039. while (!(step = iterator.next()).done) {
  1040. child = step.value;
  1041. nextName = nextNamePrefix + getComponentKey(child, ii++);
  1042. subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
  1043. }
  1044. } else {
  1045. if (false) {
  1046. process.env.NODE_ENV !== 'production' ? warning(didWarnAboutMaps, 'Using Maps as children is not yet fully supported. It is an ' + 'experimental feature that might be removed. Convert it to a ' + 'sequence / iterable of keyed ReactElements instead.') : void 0;
  1047. didWarnAboutMaps = true;
  1048. }
  1049. // Iterator will provide entry [k,v] tuples rather than values.
  1050. while (!(step = iterator.next()).done) {
  1051. var entry = step.value;
  1052. if (entry) {
  1053. child = entry[1];
  1054. nextName = nextNamePrefix + KeyEscapeUtils.escape(entry[0]) + SUBSEPARATOR + getComponentKey(child, 0);
  1055. subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
  1056. }
  1057. }
  1058. }
  1059. } else if (type === 'object') {
  1060. var addendum = '';
  1061. if (false) {
  1062. addendum = ' If you meant to render a collection of children, use an array ' + 'instead or wrap the object using createFragment(object) from the ' + 'React add-ons.';
  1063. if (children._isReactElement) {
  1064. addendum = ' It looks like you\'re using an element created by a different ' + 'version of React. Make sure to use only one copy of React.';
  1065. }
  1066. if (ReactCurrentOwner.current) {
  1067. var name = ReactCurrentOwner.current.getName();
  1068. if (name) {
  1069. addendum += ' Check the render method of `' + name + '`.';
  1070. }
  1071. }
  1072. }
  1073. var childrenString = String(children);
  1074. true ? false ? invariant(false, 'Objects are not valid as a React child (found: %s).%s', childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString, addendum) : invariant(false) : void 0;
  1075. }
  1076. }
  1077. return subtreeCount;
  1078. }
  1079. /**
  1080. * Traverses children that are typically specified as `props.children`, but
  1081. * might also be specified through attributes:
  1082. *
  1083. * - `traverseAllChildren(this.props.children, ...)`
  1084. * - `traverseAllChildren(this.props.leftPanelChildren, ...)`
  1085. *
  1086. * The `traverseContext` is an optional argument that is passed through the
  1087. * entire traversal. It can be used to store accumulations or anything else that
  1088. * the callback might find relevant.
  1089. *
  1090. * @param {?*} children Children tree object.
  1091. * @param {!function} callback To invoke upon traversing each child.
  1092. * @param {?*} traverseContext Context for traversal.
  1093. * @return {!number} The number of children in this subtree.
  1094. */
  1095. function traverseAllChildren(children, callback, traverseContext) {
  1096. if (children == null) {
  1097. return 0;
  1098. }
  1099. return traverseAllChildrenImpl(children, '', callback, traverseContext);
  1100. }
  1101. module.exports = traverseAllChildren;
  1102. /***/ },
  1103. /* 13 */
  1104. /***/ function(module, exports) {
  1105. /**
  1106. * Copyright 2013-present, Facebook, Inc.
  1107. * All rights reserved.
  1108. *
  1109. * This source code is licensed under the BSD-style license found in the
  1110. * LICENSE file in the root directory of this source tree. An additional grant
  1111. * of patent rights can be found in the PATENTS file in the same directory.
  1112. *
  1113. * @providesModule getIteratorFn
  1114. */
  1115. 'use strict';
  1116. /* global Symbol */
  1117. var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
  1118. var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
  1119. /**
  1120. * Returns the iterator method function contained on the iterable object.
  1121. *
  1122. * Be sure to invoke the function with the iterable as context:
  1123. *
  1124. * var iteratorFn = getIteratorFn(myIterable);
  1125. * if (iteratorFn) {
  1126. * var iterator = iteratorFn.call(myIterable);
  1127. * ...
  1128. * }
  1129. *
  1130. * @param {?object} maybeIterable
  1131. * @return {?function}
  1132. */
  1133. function getIteratorFn(maybeIterable) {
  1134. var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
  1135. if (typeof iteratorFn === 'function') {
  1136. return iteratorFn;
  1137. }
  1138. }
  1139. module.exports = getIteratorFn;
  1140. /***/ },
  1141. /* 14 */
  1142. /***/ function(module, exports) {
  1143. /**
  1144. * Copyright 2013-present, Facebook, Inc.
  1145. * All rights reserved.
  1146. *
  1147. * This source code is licensed under the BSD-style license found in the
  1148. * LICENSE file in the root directory of this source tree. An additional grant
  1149. * of patent rights can be found in the PATENTS file in the same directory.
  1150. *
  1151. * @providesModule KeyEscapeUtils
  1152. */
  1153. 'use strict';
  1154. /**
  1155. * Escape and wrap key so it is safe to use as a reactid
  1156. *
  1157. * @param {*} key to be escaped.
  1158. * @return {string} the escaped key.
  1159. */
  1160. function escape(key) {
  1161. var escapeRegex = /[=:]/g;
  1162. var escaperLookup = {
  1163. '=': '=0',
  1164. ':': '=2'
  1165. };
  1166. var escapedString = ('' + key).replace(escapeRegex, function (match) {
  1167. return escaperLookup[match];
  1168. });
  1169. return '$' + escapedString;
  1170. }
  1171. /**
  1172. * Unescape and unwrap key for human-readable display
  1173. *
  1174. * @param {string} key to unescape.
  1175. * @return {string} the unescaped key.
  1176. */
  1177. function unescape(key) {
  1178. var unescapeRegex = /(=0|=2)/g;
  1179. var unescaperLookup = {
  1180. '=0': '=',
  1181. '=2': ':'
  1182. };
  1183. var keySubstring = key[0] === '.' && key[1] === '$' ? key.substring(2) : key.substring(1);
  1184. return ('' + keySubstring).replace(unescapeRegex, function (match) {
  1185. return unescaperLookup[match];
  1186. });
  1187. }
  1188. var KeyEscapeUtils = {
  1189. escape: escape,
  1190. unescape: unescape
  1191. };
  1192. module.exports = KeyEscapeUtils;
  1193. /***/ },
  1194. /* 15 */
  1195. /***/ function(module, exports, __webpack_require__) {
  1196. /**
  1197. * Copyright 2013-present, Facebook, Inc.
  1198. * All rights reserved.
  1199. *
  1200. * This source code is licensed under the BSD-style license found in the
  1201. * LICENSE file in the root directory of this source tree. An additional grant
  1202. * of patent rights can be found in the PATENTS file in the same directory.
  1203. *
  1204. * @providesModule ReactComponent
  1205. */
  1206. 'use strict';
  1207. var ReactNoopUpdateQueue = __webpack_require__(16);
  1208. var ReactInstrumentation = __webpack_require__(17);
  1209. var canDefineProperty = __webpack_require__(11);
  1210. var emptyObject = __webpack_require__(22);
  1211. var invariant = __webpack_require__(6);
  1212. var warning = __webpack_require__(9);
  1213. /**
  1214. * Base class helpers for the updating state of a component.
  1215. */
  1216. function ReactComponent(props, context, updater) {
  1217. this.props = props;
  1218. this.context = context;
  1219. this.refs = emptyObject;
  1220. // We initialize the default updater but the real one gets injected by the
  1221. // renderer.
  1222. this.updater = updater || ReactNoopUpdateQueue;
  1223. }
  1224. ReactComponent.prototype.isReactComponent = {};
  1225. /**
  1226. * Sets a subset of the state. Always use this to mutate
  1227. * state. You should treat `this.state` as immutable.
  1228. *
  1229. * There is no guarantee that `this.state` will be immediately updated, so
  1230. * accessing `this.state` after calling this method may return the old value.
  1231. *
  1232. * There is no guarantee that calls to `setState` will run synchronously,
  1233. * as they may eventually be batched together. You can provide an optional
  1234. * callback that will be executed when the call to setState is actually
  1235. * completed.
  1236. *
  1237. * When a function is provided to setState, it will be called at some point in
  1238. * the future (not synchronously). It will be called with the up to date
  1239. * component arguments (state, props, context). These values can be different
  1240. * from this.* because your function may be called after receiveProps but before
  1241. * shouldComponentUpdate, and this new state, props, and context will not yet be
  1242. * assigned to this.
  1243. *
  1244. * @param {object|function} partialState Next partial state or function to
  1245. * produce next partial state to be merged with current state.
  1246. * @param {?function} callback Called after state is updated.
  1247. * @final
  1248. * @protected
  1249. */
  1250. ReactComponent.prototype.setState = function (partialState, callback) {
  1251. !(typeof partialState === 'object' || typeof partialState === 'function' || partialState == null) ? false ? invariant(false, 'setState(...): takes an object of state variables to update or a ' + 'function which returns an object of state variables.') : invariant(false) : void 0;
  1252. if (false) {
  1253. ReactInstrumentation.debugTool.onSetState();
  1254. process.env.NODE_ENV !== 'production' ? warning(partialState != null, 'setState(...): You passed an undefined or null state object; ' + 'instead, use forceUpdate().') : void 0;
  1255. }
  1256. this.updater.enqueueSetState(this, partialState);
  1257. if (callback) {
  1258. this.updater.enqueueCallback(this, callback, 'setState');
  1259. }
  1260. };
  1261. /**
  1262. * Forces an update. This should only be invoked when it is known with
  1263. * certainty that we are **not** in a DOM transaction.
  1264. *
  1265. * You may want to call this when you know that some deeper aspect of the
  1266. * component's state has changed but `setState` was not called.
  1267. *
  1268. * This will not invoke `shouldComponentUpdate`, but it will invoke
  1269. * `componentWillUpdate` and `componentDidUpdate`.
  1270. *
  1271. * @param {?function} callback Called after update is complete.
  1272. * @final
  1273. * @protected
  1274. */
  1275. ReactComponent.prototype.forceUpdate = function (callback) {
  1276. this.updater.enqueueForceUpdate(this);
  1277. if (callback) {
  1278. this.updater.enqueueCallback(this, callback, 'forceUpdate');
  1279. }
  1280. };
  1281. /**
  1282. * Deprecated APIs. These APIs used to exist on classic React classes but since
  1283. * we would like to deprecate them, we're not going to move them over to this
  1284. * modern base class. Instead, we define a getter that warns if it's accessed.
  1285. */
  1286. if (false) {
  1287. var deprecatedAPIs = {
  1288. isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'],
  1289. replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).']
  1290. };
  1291. var defineDeprecationWarning = function (methodName, info) {
  1292. if (canDefineProperty) {
  1293. Object.defineProperty(ReactComponent.prototype, methodName, {
  1294. get: function () {
  1295. process.env.NODE_ENV !== 'production' ? warning(false, '%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]) : void 0;
  1296. return undefined;
  1297. }
  1298. });
  1299. }
  1300. };
  1301. for (var fnName in deprecatedAPIs) {
  1302. if (deprecatedAPIs.hasOwnProperty(fnName)) {
  1303. defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
  1304. }
  1305. }
  1306. }
  1307. module.exports = ReactComponent;
  1308. /***/ },
  1309. /* 16 */
  1310. /***/ function(module, exports, __webpack_require__) {
  1311. /**
  1312. * Copyright 2015-present, Facebook, Inc.
  1313. * All rights reserved.
  1314. *
  1315. * This source code is licensed under the BSD-style license found in the
  1316. * LICENSE file in the root directory of this source tree. An additional grant
  1317. * of patent rights can be found in the PATENTS file in the same directory.
  1318. *
  1319. * @providesModule ReactNoopUpdateQueue
  1320. */
  1321. 'use strict';
  1322. var warning = __webpack_require__(9);
  1323. function warnTDZ(publicInstance, callerName) {
  1324. if (false) {
  1325. process.env.NODE_ENV !== 'production' ? warning(false, '%s(...): Can only update a mounted or mounting component. ' + 'This usually means you called %s() on an unmounted component. ' + 'This is a no-op. Please check the code for the %s component.', callerName, callerName, publicInstance.constructor && publicInstance.constructor.displayName || '') : void 0;
  1326. }
  1327. }
  1328. /**
  1329. * This is the abstract API for an update queue.
  1330. */
  1331. var ReactNoopUpdateQueue = {
  1332. /**
  1333. * Checks whether or not this composite component is mounted.
  1334. * @param {ReactClass} publicInstance The instance we want to test.
  1335. * @return {boolean} True if mounted, false otherwise.
  1336. * @protected
  1337. * @final
  1338. */
  1339. isMounted: function (publicInstance) {
  1340. return false;
  1341. },
  1342. /**
  1343. * Enqueue a callback that will be executed after all the pending updates
  1344. * have processed.
  1345. *
  1346. * @param {ReactClass} publicInstance The instance to use as `this` context.
  1347. * @param {?function} callback Called after state is updated.
  1348. * @internal
  1349. */
  1350. enqueueCallback: function (publicInstance, callback) {},
  1351. /**
  1352. * Forces an update. This should only be invoked when it is known with
  1353. * certainty that we are **not** in a DOM transaction.
  1354. *
  1355. * You may want to call this when you know that some deeper aspect of the
  1356. * component's state has changed but `setState` was not called.
  1357. *
  1358. * This will not invoke `shouldComponentUpdate`, but it will invoke
  1359. * `componentWillUpdate` and `componentDidUpdate`.
  1360. *
  1361. * @param {ReactClass} publicInstance The instance that should rerender.
  1362. * @internal
  1363. */
  1364. enqueueForceUpdate: function (publicInstance) {
  1365. warnTDZ(publicInstance, 'forceUpdate');
  1366. },
  1367. /**
  1368. * Replaces all of the state. Always use this or `setState` to mutate state.
  1369. * You should treat `this.state` as immutable.
  1370. *
  1371. * There is no guarantee that `this.state` will be immediately updated, so
  1372. * accessing `this.state` after calling this method may return the old value.
  1373. *
  1374. * @param {ReactClass} publicInstance The instance that should rerender.
  1375. * @param {object} completeState Next state.
  1376. * @internal
  1377. */
  1378. enqueueReplaceState: function (publicInstance, completeState) {
  1379. warnTDZ(publicInstance, 'replaceState');
  1380. },
  1381. /**
  1382. * Sets a subset of the state. This only exists because _pendingState is
  1383. * internal. This provides a merging strategy that is not available to deep
  1384. * properties which is confusing. TODO: Expose pendingState or don't use it
  1385. * during the merge.
  1386. *
  1387. * @param {ReactClass} publicInstance The instance that should rerender.
  1388. * @param {object} partialState Next partial state to be merged with state.
  1389. * @internal
  1390. */
  1391. enqueueSetState: function (publicInstance, partialState) {
  1392. warnTDZ(publicInstance, 'setState');
  1393. }
  1394. };
  1395. module.exports = ReactNoopUpdateQueue;
  1396. /***/ },
  1397. /* 17 */
  1398. /***/ function(module, exports, __webpack_require__) {
  1399. /**
  1400. * Copyright 2016-present, Facebook, Inc.
  1401. * All rights reserved.
  1402. *
  1403. * This source code is licensed under the BSD-style license found in the
  1404. * LICENSE file in the root directory of this source tree. An additional grant
  1405. * of patent rights can be found in the PATENTS file in the same directory.
  1406. *
  1407. * @providesModule ReactInstrumentation
  1408. */
  1409. 'use strict';
  1410. var ReactDebugTool = __webpack_require__(18);
  1411. module.exports = { debugTool: ReactDebugTool };
  1412. /***/ },
  1413. /* 18 */
  1414. /***/ function(module, exports, __webpack_require__) {
  1415. /**
  1416. * Copyright 2016-present, Facebook, Inc.
  1417. * All rights reserved.
  1418. *
  1419. * This source code is licensed under the BSD-style license found in the
  1420. * LICENSE file in the root directory of this source tree. An additional grant
  1421. * of patent rights can be found in the PATENTS file in the same directory.
  1422. *
  1423. * @providesModule ReactDebugTool
  1424. */
  1425. 'use strict';
  1426. var ExecutionEnvironment = __webpack_require__(19);
  1427. var performanceNow = __webpack_require__(20);
  1428. var warning = __webpack_require__(9);
  1429. var eventHandlers = [];
  1430. var handlerDoesThrowForEvent = {};
  1431. function emitEvent(handlerFunctionName, arg1, arg2, arg3, arg4, arg5) {
  1432. if (false) {
  1433. eventHandlers.forEach(function (handler) {
  1434. try {
  1435. if (handler[handlerFunctionName]) {
  1436. handler[handlerFunctionName](arg1, arg2, arg3, arg4, arg5);
  1437. }
  1438. } catch (e) {
  1439. process.env.NODE_ENV !== 'production' ? warning(!handlerDoesThrowForEvent[handlerFunctionName], 'exception thrown by devtool while handling %s: %s', handlerFunctionName, e.message) : void 0;
  1440. handlerDoesThrowForEvent[handlerFunctionName] = true;
  1441. }
  1442. });
  1443. }
  1444. }
  1445. var isProfiling = false;
  1446. var flushHistory = [];
  1447. var currentFlushNesting = 0;
  1448. var currentFlushMeasurements = null;
  1449. var currentFlushStartTime = null;
  1450. var currentTimerDebugID = null;
  1451. var currentTimerStartTime = null;
  1452. var currentTimerType = null;
  1453. function clearHistory() {
  1454. ReactComponentTreeDevtool.purgeUnmountedComponents();
  1455. ReactNativeOperationHistoryDevtool.clearHistory();
  1456. }
  1457. function getTreeSnapshot(registeredIDs) {
  1458. return registeredIDs.reduce(function (tree, id) {
  1459. var ownerID = ReactComponentTreeDevtool.getOwnerID(id);
  1460. var parentID = ReactComponentTreeDevtool.getParentID(id);
  1461. tree[id] = {
  1462. displayName: ReactComponentTreeDevtool.getDisplayName(id),
  1463. text: ReactComponentTreeDevtool.getText(id),
  1464. updateCount: ReactComponentTreeDevtool.getUpdateCount(id),
  1465. childIDs: ReactComponentTreeDevtool.getChildIDs(id),
  1466. // Text nodes don't have owners but this is close enough.
  1467. ownerID: ownerID || ReactComponentTreeDevtool.getOwnerID(parentID),
  1468. parentID: parentID
  1469. };
  1470. return tree;
  1471. }, {});
  1472. }
  1473. function resetMeasurements() {
  1474. if (false) {
  1475. var previousStartTime = currentFlushStartTime;
  1476. var previousMeasurements = currentFlushMeasurements || [];
  1477. var previousOperations = ReactNativeOperationHistoryDevtool.getHistory();
  1478. if (!isProfiling || currentFlushNesting === 0) {
  1479. currentFlushStartTime = null;
  1480. currentFlushMeasurements = null;
  1481. clearHistory();
  1482. return;
  1483. }
  1484. if (previousMeasurements.length || previousOperations.length) {
  1485. var registeredIDs = ReactComponentTreeDevtool.getRegisteredIDs();
  1486. flushHistory.push({
  1487. duration: performanceNow() - previousStartTime,
  1488. measurements: previousMeasurements || [],
  1489. operations: previousOperations || [],
  1490. treeSnapshot: getTreeSnapshot(registeredIDs)
  1491. });
  1492. }
  1493. clearHistory();
  1494. currentFlushStartTime = performanceNow();
  1495. currentFlushMeasurements = [];
  1496. }
  1497. }
  1498. function checkDebugID(debugID) {
  1499. false ? warning(debugID, 'ReactDebugTool: debugID may not be empty.') : void 0;
  1500. }
  1501. var ReactDebugTool = {
  1502. addDevtool: function (devtool) {
  1503. eventHandlers.push(devtool);
  1504. },
  1505. removeDevtool: function (devtool) {
  1506. for (var i = 0; i < eventHandlers.length; i++) {
  1507. if (eventHandlers[i] === devtool) {
  1508. eventHandlers.splice(i, 1);
  1509. i--;
  1510. }
  1511. }
  1512. },
  1513. beginProfiling: function () {
  1514. if (false) {
  1515. if (isProfiling) {
  1516. return;
  1517. }
  1518. isProfiling = true;
  1519. flushHistory.length = 0;
  1520. resetMeasurements();
  1521. }
  1522. },
  1523. endProfiling: function () {
  1524. if (false) {
  1525. if (!isProfiling) {
  1526. return;
  1527. }
  1528. isProfiling = false;
  1529. resetMeasurements();
  1530. }
  1531. },
  1532. getFlushHistory: function () {
  1533. if (false) {
  1534. return flushHistory;
  1535. }
  1536. },
  1537. onBeginFlush: function () {
  1538. if (false) {
  1539. currentFlushNesting++;
  1540. resetMeasurements();
  1541. }
  1542. emitEvent('onBeginFlush');
  1543. },
  1544. onEndFlush: function () {
  1545. if (false) {
  1546. resetMeasurements();
  1547. currentFlushNesting--;
  1548. }
  1549. emitEvent('onEndFlush');
  1550. },
  1551. onBeginLifeCycleTimer: function (debugID, timerType) {
  1552. checkDebugID(debugID);
  1553. emitEvent('onBeginLifeCycleTimer', debugID, timerType);
  1554. if (false) {
  1555. if (isProfiling && currentFlushNesting > 0) {
  1556. process.env.NODE_ENV !== 'production' ? warning(!currentTimerType, 'There is an internal error in the React performance measurement code. ' + 'Did not expect %s timer to start while %s timer is still in ' + 'progress for %s instance.', timerType, currentTimerType || 'no', debugID === currentTimerDebugID ? 'the same' : 'another') : void 0;
  1557. currentTimerStartTime = performanceNow();
  1558. currentTimerDebugID = debugID;
  1559. currentTimerType = timerType;
  1560. }
  1561. }
  1562. },
  1563. onEndLifeCycleTimer: function (debugID, timerType) {
  1564. checkDebugID(debugID);
  1565. if (false) {
  1566. if (isProfiling && currentFlushNesting > 0) {
  1567. process.env.NODE_ENV !== 'production' ? warning(currentTimerType === timerType, 'There is an internal error in the React performance measurement code. ' + 'We did not expect %s timer to stop while %s timer is still in ' + 'progress for %s instance. Please report this as a bug in React.', timerType, currentTimerType || 'no', debugID === currentTimerDebugID ? 'the same' : 'another') : void 0;
  1568. currentFlushMeasurements.push({
  1569. timerType: timerType,
  1570. instanceID: debugID,
  1571. duration: performanceNow() - currentTimerStartTime
  1572. });
  1573. currentTimerStartTime = null;
  1574. currentTimerDebugID = null;
  1575. currentTimerType = null;
  1576. }
  1577. }
  1578. emitEvent('onEndLifeCycleTimer', debugID, timerType);
  1579. },
  1580. onBeginReconcilerTimer: function (debugID, timerType) {
  1581. checkDebugID(debugID);
  1582. emitEvent('onBeginReconcilerTimer', debugID, timerType);
  1583. },
  1584. onEndReconcilerTimer: function (debugID, timerType) {
  1585. checkDebugID(debugID);
  1586. emitEvent('onEndReconcilerTimer', debugID, timerType);
  1587. },
  1588. onBeginProcessingChildContext: function () {
  1589. emitEvent('onBeginProcessingChildContext');
  1590. },
  1591. onEndProcessingChildContext: function () {
  1592. emitEvent('onEndProcessingChildContext');
  1593. },
  1594. onNativeOperation: function (debugID, type, payload) {
  1595. checkDebugID(debugID);
  1596. emitEvent('onNativeOperation', debugID, type, payload);
  1597. },
  1598. onSetState: function () {
  1599. emitEvent('onSetState');
  1600. },
  1601. onSetDisplayName: function (debugID, displayName) {
  1602. checkDebugID(debugID);
  1603. emitEvent('onSetDisplayName', debugID, displayName);
  1604. },
  1605. onSetChildren: function (debugID, childDebugIDs) {
  1606. checkDebugID(debugID);
  1607. emitEvent('onSetChildren', debugID, childDebugIDs);
  1608. },
  1609. onSetOwner: function (debugID, ownerDebugID) {
  1610. checkDebugID(debugID);
  1611. emitEvent('onSetOwner', debugID, ownerDebugID);
  1612. },
  1613. onSetText: function (debugID, text) {
  1614. checkDebugID(debugID);
  1615. emitEvent('onSetText', debugID, text);
  1616. },
  1617. onMountRootComponent: function (debugID) {
  1618. checkDebugID(debugID);
  1619. emitEvent('onMountRootComponent', debugID);
  1620. },
  1621. onMountComponent: function (debugID) {
  1622. checkDebugID(debugID);
  1623. emitEvent('onMountComponent', debugID);
  1624. },
  1625. onUpdateComponent: function (debugID) {
  1626. checkDebugID(debugID);
  1627. emitEvent('onUpdateComponent', debugID);
  1628. },
  1629. onUnmountComponent: function (debugID) {
  1630. checkDebugID(debugID);
  1631. emitEvent('onUnmountComponent', debugID);
  1632. }
  1633. };
  1634. if (false) {
  1635. var ReactInvalidSetStateWarningDevTool = require('./ReactInvalidSetStateWarningDevTool');
  1636. var ReactNativeOperationHistoryDevtool = require('./ReactNativeOperationHistoryDevtool');
  1637. var ReactComponentTreeDevtool = require('./ReactComponentTreeDevtool');
  1638. ReactDebugTool.addDevtool(ReactInvalidSetStateWarningDevTool);
  1639. ReactDebugTool.addDevtool(ReactComponentTreeDevtool);
  1640. ReactDebugTool.addDevtool(ReactNativeOperationHistoryDevtool);
  1641. var url = ExecutionEnvironment.canUseDOM && window.location.href || '';
  1642. if (/[?&]react_perf\b/.test(url)) {
  1643. ReactDebugTool.beginProfiling();
  1644. }
  1645. }
  1646. module.exports = ReactDebugTool;
  1647. /***/ },
  1648. /* 19 */
  1649. /***/ function(module, exports) {
  1650. /**
  1651. * Copyright (c) 2013-present, Facebook, Inc.
  1652. * All rights reserved.
  1653. *
  1654. * This source code is licensed under the BSD-style license found in the
  1655. * LICENSE file in the root directory of this source tree. An additional grant
  1656. * of patent rights can be found in the PATENTS file in the same directory.
  1657. *
  1658. */
  1659. 'use strict';
  1660. var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
  1661. /**
  1662. * Simple, lightweight module assisting with the detection and context of
  1663. * Worker. Helps avoid circular dependencies and allows code to reason about
  1664. * whether or not they are in a Worker, even if they never include the main
  1665. * `ReactWorker` dependency.
  1666. */
  1667. var ExecutionEnvironment = {
  1668. canUseDOM: canUseDOM,
  1669. canUseWorkers: typeof Worker !== 'undefined',
  1670. canUseEventListeners: canUseDOM && !!(window.addEventListener || window.attachEvent),
  1671. canUseViewport: canUseDOM && !!window.screen,
  1672. isInWorker: !canUseDOM // For now, this is true - might change in the future.
  1673. };
  1674. module.exports = ExecutionEnvironment;
  1675. /***/ },
  1676. /* 20 */
  1677. /***/ function(module, exports, __webpack_require__) {
  1678. 'use strict';
  1679. /**
  1680. * Copyright (c) 2013-present, Facebook, Inc.
  1681. * All rights reserved.
  1682. *
  1683. * This source code is licensed under the BSD-style license found in the
  1684. * LICENSE file in the root directory of this source tree. An additional grant
  1685. * of patent rights can be found in the PATENTS file in the same directory.
  1686. *
  1687. * @typechecks
  1688. */
  1689. var performance = __webpack_require__(21);
  1690. var performanceNow;
  1691. /**
  1692. * Detect if we can use `window.performance.now()` and gracefully fallback to
  1693. * `Date.now()` if it doesn't exist. We need to support Firefox < 15 for now
  1694. * because of Facebook's testing infrastructure.
  1695. */
  1696. if (performance.now) {
  1697. performanceNow = function performanceNow() {
  1698. return performance.now();
  1699. };
  1700. } else {
  1701. performanceNow = function performanceNow() {
  1702. return Date.now();
  1703. };
  1704. }
  1705. module.exports = performanceNow;
  1706. /***/ },
  1707. /* 21 */
  1708. /***/ function(module, exports, __webpack_require__) {
  1709. /**
  1710. * Copyright (c) 2013-present, Facebook, Inc.
  1711. * All rights reserved.
  1712. *
  1713. * This source code is licensed under the BSD-style license found in the
  1714. * LICENSE file in the root directory of this source tree. An additional grant
  1715. * of patent rights can be found in the PATENTS file in the same directory.
  1716. *
  1717. * @typechecks
  1718. */
  1719. 'use strict';
  1720. var ExecutionEnvironment = __webpack_require__(19);
  1721. var performance;
  1722. if (ExecutionEnvironment.canUseDOM) {
  1723. performance = window.performance || window.msPerformance || window.webkitPerformance;
  1724. }
  1725. module.exports = performance || {};
  1726. /***/ },
  1727. /* 22 */
  1728. /***/ function(module, exports, __webpack_require__) {
  1729. /**
  1730. * Copyright (c) 2013-present, Facebook, Inc.
  1731. * All rights reserved.
  1732. *
  1733. * This source code is licensed under the BSD-style license found in the
  1734. * LICENSE file in the root directory of this source tree. An additional grant
  1735. * of patent rights can be found in the PATENTS file in the same directory.
  1736. *
  1737. */
  1738. 'use strict';
  1739. var emptyObject = {};
  1740. if (false) {
  1741. Object.freeze(emptyObject);
  1742. }
  1743. module.exports = emptyObject;
  1744. /***/ },
  1745. /* 23 */
  1746. /***/ function(module, exports, __webpack_require__) {
  1747. /**
  1748. * Copyright 2013-present, Facebook, Inc.
  1749. * All rights reserved.
  1750. *
  1751. * This source code is licensed under the BSD-style license found in the
  1752. * LICENSE file in the root directory of this source tree. An additional grant
  1753. * of patent rights can be found in the PATENTS file in the same directory.
  1754. *
  1755. * @providesModule ReactClass
  1756. */
  1757. 'use strict';
  1758. var _assign = __webpack_require__(3);
  1759. var ReactComponent = __webpack_require__(15);
  1760. var ReactElement = __webpack_require__(7);
  1761. var ReactPropTypeLocations = __webpack_require__(24);
  1762. var ReactPropTypeLocationNames = __webpack_require__(26);
  1763. var ReactNoopUpdateQueue = __webpack_require__(16);
  1764. var emptyObject = __webpack_require__(22);
  1765. var invariant = __webpack_require__(6);
  1766. var keyMirror = __webpack_require__(25);
  1767. var keyOf = __webpack_require__(27);
  1768. var warning = __webpack_require__(9);
  1769. var MIXINS_KEY = keyOf({ mixins: null });
  1770. /**
  1771. * Policies that describe methods in `ReactClassInterface`.
  1772. */
  1773. var SpecPolicy = keyMirror({
  1774. /**
  1775. * These methods may be defined only once by the class specification or mixin.
  1776. */
  1777. DEFINE_ONCE: null,
  1778. /**
  1779. * These methods may be defined by both the class specification and mixins.
  1780. * Subsequent definitions will be chained. These methods must return void.
  1781. */
  1782. DEFINE_MANY: null,
  1783. /**
  1784. * These methods are overriding the base class.
  1785. */
  1786. OVERRIDE_BASE: null,
  1787. /**
  1788. * These methods are similar to DEFINE_MANY, except we assume they return
  1789. * objects. We try to merge the keys of the return values of all the mixed in
  1790. * functions. If there is a key conflict we throw.
  1791. */
  1792. DEFINE_MANY_MERGED: null
  1793. });
  1794. var injectedMixins = [];
  1795. /**
  1796. * Composite components are higher-level components that compose other composite
  1797. * or native components.
  1798. *
  1799. * To create a new type of `ReactClass`, pass a specification of
  1800. * your new class to `React.createClass`. The only requirement of your class
  1801. * specification is that you implement a `render` method.
  1802. *
  1803. * var MyComponent = React.createClass({
  1804. * render: function() {
  1805. * return <div>Hello World</div>;
  1806. * }
  1807. * });
  1808. *
  1809. * The class specification supports a specific protocol of methods that have
  1810. * special meaning (e.g. `render`). See `ReactClassInterface` for
  1811. * more the comprehensive protocol. Any other properties and methods in the
  1812. * class specification will be available on the prototype.
  1813. *
  1814. * @interface ReactClassInterface
  1815. * @internal
  1816. */
  1817. var ReactClassInterface = {
  1818. /**
  1819. * An array of Mixin objects to include when defining your component.
  1820. *
  1821. * @type {array}
  1822. * @optional
  1823. */
  1824. mixins: SpecPolicy.DEFINE_MANY,
  1825. /**
  1826. * An object containing properties and methods that should be defined on
  1827. * the component's constructor instead of its prototype (static methods).
  1828. *
  1829. * @type {object}
  1830. * @optional
  1831. */
  1832. statics: SpecPolicy.DEFINE_MANY,
  1833. /**
  1834. * Definition of prop types for this component.
  1835. *
  1836. * @type {object}
  1837. * @optional
  1838. */
  1839. propTypes: SpecPolicy.DEFINE_MANY,
  1840. /**
  1841. * Definition of context types for this component.
  1842. *
  1843. * @type {object}
  1844. * @optional
  1845. */
  1846. contextTypes: SpecPolicy.DEFINE_MANY,
  1847. /**
  1848. * Definition of context types this component sets for its children.
  1849. *
  1850. * @type {object}
  1851. * @optional
  1852. */
  1853. childContextTypes: SpecPolicy.DEFINE_MANY,
  1854. // ==== Definition methods ====
  1855. /**
  1856. * Invoked when the component is mounted. Values in the mapping will be set on
  1857. * `this.props` if that prop is not specified (i.e. using an `in` check).
  1858. *
  1859. * This method is invoked before `getInitialState` and therefore cannot rely
  1860. * on `this.state` or use `this.setState`.
  1861. *
  1862. * @return {object}
  1863. * @optional
  1864. */
  1865. getDefaultProps: SpecPolicy.DEFINE_MANY_MERGED,
  1866. /**
  1867. * Invoked once before the component is mounted. The return value will be used
  1868. * as the initial value of `this.state`.
  1869. *
  1870. * getInitialState: function() {
  1871. * return {
  1872. * isOn: false,
  1873. * fooBaz: new BazFoo()
  1874. * }
  1875. * }
  1876. *
  1877. * @return {object}
  1878. * @optional
  1879. */
  1880. getInitialState: SpecPolicy.DEFINE_MANY_MERGED,
  1881. /**
  1882. * @return {object}
  1883. * @optional
  1884. */
  1885. getChildContext: SpecPolicy.DEFINE_MANY_MERGED,
  1886. /**
  1887. * Uses props from `this.props` and state from `this.state` to render the
  1888. * structure of the component.
  1889. *
  1890. * No guarantees are made about when or how often this method is invoked, so
  1891. * it must not have side effects.
  1892. *
  1893. * render: function() {
  1894. * var name = this.props.name;
  1895. * return <div>Hello, {name}!</div>;
  1896. * }
  1897. *
  1898. * @return {ReactComponent}
  1899. * @nosideeffects
  1900. * @required
  1901. */
  1902. render: SpecPolicy.DEFINE_ONCE,
  1903. // ==== Delegate methods ====
  1904. /**
  1905. * Invoked when the component is initially created and about to be mounted.
  1906. * This may have side effects, but any external subscriptions or data created
  1907. * by this method must be cleaned up in `componentWillUnmount`.
  1908. *
  1909. * @optional
  1910. */
  1911. componentWillMount: SpecPolicy.DEFINE_MANY,
  1912. /**
  1913. * Invoked when the component has been mounted and has a DOM representation.
  1914. * However, there is no guarantee that the DOM node is in the document.
  1915. *
  1916. * Use this as an opportunity to operate on the DOM when the component has
  1917. * been mounted (initialized and rendered) for the first time.
  1918. *
  1919. * @param {DOMElement} rootNode DOM element representing the component.
  1920. * @optional
  1921. */
  1922. componentDidMount: SpecPolicy.DEFINE_MANY,
  1923. /**
  1924. * Invoked before the component receives new props.
  1925. *
  1926. * Use this as an opportunity to react to a prop transition by updating the
  1927. * state using `this.setState`. Current props are accessed via `this.props`.
  1928. *
  1929. * componentWillReceiveProps: function(nextProps, nextContext) {
  1930. * this.setState({
  1931. * likesIncreasing: nextProps.likeCount > this.props.likeCount
  1932. * });
  1933. * }
  1934. *
  1935. * NOTE: There is no equivalent `componentWillReceiveState`. An incoming prop
  1936. * transition may cause a state change, but the opposite is not true. If you
  1937. * need it, you are probably looking for `componentWillUpdate`.
  1938. *
  1939. * @param {object} nextProps
  1940. * @optional
  1941. */
  1942. componentWillReceiveProps: SpecPolicy.DEFINE_MANY,
  1943. /**
  1944. * Invoked while deciding if the component should be updated as a result of
  1945. * receiving new props, state and/or context.
  1946. *
  1947. * Use this as an opportunity to `return false` when you're certain that the
  1948. * transition to the new props/state/context will not require a component
  1949. * update.
  1950. *
  1951. * shouldComponentUpdate: function(nextProps, nextState, nextContext) {
  1952. * return !equal(nextProps, this.props) ||
  1953. * !equal(nextState, this.state) ||
  1954. * !equal(nextContext, this.context);
  1955. * }
  1956. *
  1957. * @param {object} nextProps
  1958. * @param {?object} nextState
  1959. * @param {?object} nextContext
  1960. * @return {boolean} True if the component should update.
  1961. * @optional
  1962. */
  1963. shouldComponentUpdate: SpecPolicy.DEFINE_ONCE,
  1964. /**
  1965. * Invoked when the component is about to update due to a transition from
  1966. * `this.props`, `this.state` and `this.context` to `nextProps`, `nextState`
  1967. * and `nextContext`.
  1968. *
  1969. * Use this as an opportunity to perform preparation before an update occurs.
  1970. *
  1971. * NOTE: You **cannot** use `this.setState()` in this method.
  1972. *
  1973. * @param {object} nextProps
  1974. * @param {?object} nextState
  1975. * @param {?object} nextContext
  1976. * @param {ReactReconcileTransaction} transaction
  1977. * @optional
  1978. */
  1979. componentWillUpdate: SpecPolicy.DEFINE_MANY,
  1980. /**
  1981. * Invoked when the component's DOM representation has been updated.
  1982. *
  1983. * Use this as an opportunity to operate on the DOM when the component has
  1984. * been updated.
  1985. *
  1986. * @param {object} prevProps
  1987. * @param {?object} prevState
  1988. * @param {?object} prevContext
  1989. * @param {DOMElement} rootNode DOM element representing the component.
  1990. * @optional
  1991. */
  1992. componentDidUpdate: SpecPolicy.DEFINE_MANY,
  1993. /**
  1994. * Invoked when the component is about to be removed from its parent and have
  1995. * its DOM representation destroyed.
  1996. *
  1997. * Use this as an opportunity to deallocate any external resources.
  1998. *
  1999. * NOTE: There is no `componentDidUnmount` since your component will have been
  2000. * destroyed by that point.
  2001. *
  2002. * @optional
  2003. */
  2004. componentWillUnmount: SpecPolicy.DEFINE_MANY,
  2005. // ==== Advanced methods ====
  2006. /**
  2007. * Updates the component's currently mounted DOM representation.
  2008. *
  2009. * By default, this implements React's rendering and reconciliation algorithm.
  2010. * Sophisticated clients may wish to override this.
  2011. *
  2012. * @param {ReactReconcileTransaction} transaction
  2013. * @internal
  2014. * @overridable
  2015. */
  2016. updateComponent: SpecPolicy.OVERRIDE_BASE
  2017. };
  2018. /**
  2019. * Mapping from class specification keys to special processing functions.
  2020. *
  2021. * Although these are declared like instance properties in the specification
  2022. * when defining classes using `React.createClass`, they are actually static
  2023. * and are accessible on the constructor instead of the prototype. Despite
  2024. * being static, they must be defined outside of the "statics" key under
  2025. * which all other static methods are defined.
  2026. */
  2027. var RESERVED_SPEC_KEYS = {
  2028. displayName: function (Constructor, displayName) {
  2029. Constructor.displayName = displayName;
  2030. },
  2031. mixins: function (Constructor, mixins) {
  2032. if (mixins) {
  2033. for (var i = 0; i < mixins.length; i++) {
  2034. mixSpecIntoComponent(Constructor, mixins[i]);
  2035. }
  2036. }
  2037. },
  2038. childContextTypes: function (Constructor, childContextTypes) {
  2039. if (false) {
  2040. validateTypeDef(Constructor, childContextTypes, ReactPropTypeLocations.childContext);
  2041. }
  2042. Constructor.childContextTypes = _assign({}, Constructor.childContextTypes, childContextTypes);
  2043. },
  2044. contextTypes: function (Constructor, contextTypes) {
  2045. if (false) {
  2046. validateTypeDef(Constructor, contextTypes, ReactPropTypeLocations.context);
  2047. }
  2048. Constructor.contextTypes = _assign({}, Constructor.contextTypes, contextTypes);
  2049. },
  2050. /**
  2051. * Special case getDefaultProps which should move into statics but requires
  2052. * automatic merging.
  2053. */
  2054. getDefaultProps: function (Constructor, getDefaultProps) {
  2055. if (Constructor.getDefaultProps) {
  2056. Constructor.getDefaultProps = createMergedResultFunction(Constructor.getDefaultProps, getDefaultProps);
  2057. } else {
  2058. Constructor.getDefaultProps = getDefaultProps;
  2059. }
  2060. },
  2061. propTypes: function (Constructor, propTypes) {
  2062. if (false) {
  2063. validateTypeDef(Constructor, propTypes, ReactPropTypeLocations.prop);
  2064. }
  2065. Constructor.propTypes = _assign({}, Constructor.propTypes, propTypes);
  2066. },
  2067. statics: function (Constructor, statics) {
  2068. mixStaticSpecIntoComponent(Constructor, statics);
  2069. },
  2070. autobind: function () {} };
  2071. // noop
  2072. function validateTypeDef(Constructor, typeDef, location) {
  2073. for (var propName in typeDef) {
  2074. if (typeDef.hasOwnProperty(propName)) {
  2075. // use a warning instead of an invariant so components
  2076. // don't show up in prod but only in __DEV__
  2077. false ? warning(typeof typeDef[propName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'React.PropTypes.', Constructor.displayName || 'ReactClass', ReactPropTypeLocationNames[location], propName) : void 0;
  2078. }
  2079. }
  2080. }
  2081. function validateMethodOverride(isAlreadyDefined, name) {
  2082. var specPolicy = ReactClassInterface.hasOwnProperty(name) ? ReactClassInterface[name] : null;
  2083. // Disallow overriding of base class methods unless explicitly allowed.
  2084. if (ReactClassMixin.hasOwnProperty(name)) {
  2085. !(specPolicy === SpecPolicy.OVERRIDE_BASE) ? false ? invariant(false, 'ReactClassInterface: You are attempting to override ' + '`%s` from your class specification. Ensure that your method names ' + 'do not overlap with React methods.', name) : invariant(false) : void 0;
  2086. }
  2087. // Disallow defining methods more than once unless explicitly allowed.
  2088. if (isAlreadyDefined) {
  2089. !(specPolicy === SpecPolicy.DEFINE_MANY || specPolicy === SpecPolicy.DEFINE_MANY_MERGED) ? false ? invariant(false, 'ReactClassInterface: You are attempting to define ' + '`%s` on your component more than once. This conflict may be due ' + 'to a mixin.', name) : invariant(false) : void 0;
  2090. }
  2091. }
  2092. /**
  2093. * Mixin helper which handles policy validation and reserved
  2094. * specification keys when building React classes.
  2095. */
  2096. function mixSpecIntoComponent(Constructor, spec) {
  2097. if (!spec) {
  2098. return;
  2099. }
  2100. !(typeof spec !== 'function') ? false ? invariant(false, 'ReactClass: You\'re attempting to ' + 'use a component class or function as a mixin. Instead, just use a ' + 'regular object.') : invariant(false) : void 0;
  2101. !!ReactElement.isValidElement(spec) ? false ? invariant(false, 'ReactClass: You\'re attempting to ' + 'use a component as a mixin. Instead, just use a regular object.') : invariant(false) : void 0;
  2102. var proto = Constructor.prototype;
  2103. var autoBindPairs = proto.__reactAutoBindPairs;
  2104. // By handling mixins before any other properties, we ensure the same
  2105. // chaining order is applied to methods with DEFINE_MANY policy, whether
  2106. // mixins are listed before or after these methods in the spec.
  2107. if (spec.hasOwnProperty(MIXINS_KEY)) {
  2108. RESERVED_SPEC_KEYS.mixins(Constructor, spec.mixins);
  2109. }
  2110. for (var name in spec) {
  2111. if (!spec.hasOwnProperty(name)) {
  2112. continue;
  2113. }
  2114. if (name === MIXINS_KEY) {
  2115. // We have already handled mixins in a special case above.
  2116. continue;
  2117. }
  2118. var property = spec[name];
  2119. var isAlreadyDefined = proto.hasOwnProperty(name);
  2120. validateMethodOverride(isAlreadyDefined, name);
  2121. if (RESERVED_SPEC_KEYS.hasOwnProperty(name)) {
  2122. RESERVED_SPEC_KEYS[name](Constructor, property);
  2123. } else {
  2124. // Setup methods on prototype:
  2125. // The following member methods should not be automatically bound:
  2126. // 1. Expected ReactClass methods (in the "interface").
  2127. // 2. Overridden methods (that were mixed in).
  2128. var isReactClassMethod = ReactClassInterface.hasOwnProperty(name);
  2129. var isFunction = typeof property === 'function';
  2130. var shouldAutoBind = isFunction && !isReactClassMethod && !isAlreadyDefined && spec.autobind !== false;
  2131. if (shouldAutoBind) {
  2132. autoBindPairs.push(name, property);
  2133. proto[name] = property;
  2134. } else {
  2135. if (isAlreadyDefined) {
  2136. var specPolicy = ReactClassInterface[name];
  2137. // These cases should already be caught by validateMethodOverride.
  2138. !(isReactClassMethod && (specPolicy === SpecPolicy.DEFINE_MANY_MERGED || specPolicy === SpecPolicy.DEFINE_MANY)) ? false ? invariant(false, 'ReactClass: Unexpected spec policy %s for key %s ' + 'when mixing in component specs.', specPolicy, name) : invariant(false) : void 0;
  2139. // For methods which are defined more than once, call the existing
  2140. // methods before calling the new property, merging if appropriate.
  2141. if (specPolicy === SpecPolicy.DEFINE_MANY_MERGED) {
  2142. proto[name] = createMergedResultFunction(proto[name], property);
  2143. } else if (specPolicy === SpecPolicy.DEFINE_MANY) {
  2144. proto[name] = createChainedFunction(proto[name], property);
  2145. }
  2146. } else {
  2147. proto[name] = property;
  2148. if (false) {
  2149. // Add verbose displayName to the function, which helps when looking
  2150. // at profiling tools.
  2151. if (typeof property === 'function' && spec.displayName) {
  2152. proto[name].displayName = spec.displayName + '_' + name;
  2153. }
  2154. }
  2155. }
  2156. }
  2157. }
  2158. }
  2159. }
  2160. function mixStaticSpecIntoComponent(Constructor, statics) {
  2161. if (!statics) {
  2162. return;
  2163. }
  2164. for (var name in statics) {
  2165. var property = statics[name];
  2166. if (!statics.hasOwnProperty(name)) {
  2167. continue;
  2168. }
  2169. var isReserved = name in RESERVED_SPEC_KEYS;
  2170. !!isReserved ? false ? invariant(false, 'ReactClass: You are attempting to define a reserved ' + 'property, `%s`, that shouldn\'t be on the "statics" key. Define it ' + 'as an instance property instead; it will still be accessible on the ' + 'constructor.', name) : invariant(false) : void 0;
  2171. var isInherited = name in Constructor;
  2172. !!isInherited ? false ? invariant(false, 'ReactClass: You are attempting to define ' + '`%s` on your component more than once. This conflict may be ' + 'due to a mixin.', name) : invariant(false) : void 0;
  2173. Constructor[name] = property;
  2174. }
  2175. }
  2176. /**
  2177. * Merge two objects, but throw if both contain the same key.
  2178. *
  2179. * @param {object} one The first object, which is mutated.
  2180. * @param {object} two The second object
  2181. * @return {object} one after it has been mutated to contain everything in two.
  2182. */
  2183. function mergeIntoWithNoDuplicateKeys(one, two) {
  2184. !(one && two && typeof one === 'object' && typeof two === 'object') ? false ? invariant(false, 'mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.') : invariant(false) : void 0;
  2185. for (var key in two) {
  2186. if (two.hasOwnProperty(key)) {
  2187. !(one[key] === undefined) ? false ? invariant(false, 'mergeIntoWithNoDuplicateKeys(): ' + 'Tried to merge two objects with the same key: `%s`. This conflict ' + 'may be due to a mixin; in particular, this may be caused by two ' + 'getInitialState() or getDefaultProps() methods returning objects ' + 'with clashing keys.', key) : invariant(false) : void 0;
  2188. one[key] = two[key];
  2189. }
  2190. }
  2191. return one;
  2192. }
  2193. /**
  2194. * Creates a function that invokes two functions and merges their return values.
  2195. *
  2196. * @param {function} one Function to invoke first.
  2197. * @param {function} two Function to invoke second.
  2198. * @return {function} Function that invokes the two argument functions.
  2199. * @private
  2200. */
  2201. function createMergedResultFunction(one, two) {
  2202. return function mergedResult() {
  2203. var a = one.apply(this, arguments);
  2204. var b = two.apply(this, arguments);
  2205. if (a == null) {
  2206. return b;
  2207. } else if (b == null) {
  2208. return a;
  2209. }
  2210. var c = {};
  2211. mergeIntoWithNoDuplicateKeys(c, a);
  2212. mergeIntoWithNoDuplicateKeys(c, b);
  2213. return c;
  2214. };
  2215. }
  2216. /**
  2217. * Creates a function that invokes two functions and ignores their return vales.
  2218. *
  2219. * @param {function} one Function to invoke first.
  2220. * @param {function} two Function to invoke second.
  2221. * @return {function} Function that invokes the two argument functions.
  2222. * @private
  2223. */
  2224. function createChainedFunction(one, two) {
  2225. return function chainedFunction() {
  2226. one.apply(this, arguments);
  2227. two.apply(this, arguments);
  2228. };
  2229. }
  2230. /**
  2231. * Binds a method to the component.
  2232. *
  2233. * @param {object} component Component whose method is going to be bound.
  2234. * @param {function} method Method to be bound.
  2235. * @return {function} The bound method.
  2236. */
  2237. function bindAutoBindMethod(component, method) {
  2238. var boundMethod = method.bind(component);
  2239. if (false) {
  2240. boundMethod.__reactBoundContext = component;
  2241. boundMethod.__reactBoundMethod = method;
  2242. boundMethod.__reactBoundArguments = null;
  2243. var componentName = component.constructor.displayName;
  2244. var _bind = boundMethod.bind;
  2245. boundMethod.bind = function (newThis) {
  2246. for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
  2247. args[_key - 1] = arguments[_key];
  2248. }
  2249. // User is trying to bind() an autobound method; we effectively will
  2250. // ignore the value of "this" that the user is trying to use, so
  2251. // let's warn.
  2252. if (newThis !== component && newThis !== null) {
  2253. process.env.NODE_ENV !== 'production' ? warning(false, 'bind(): React component methods may only be bound to the ' + 'component instance. See %s', componentName) : void 0;
  2254. } else if (!args.length) {
  2255. process.env.NODE_ENV !== 'production' ? warning(false, 'bind(): You are binding a component method to the component. ' + 'React does this for you automatically in a high-performance ' + 'way, so you can safely remove this call. See %s', componentName) : void 0;
  2256. return boundMethod;
  2257. }
  2258. var reboundMethod = _bind.apply(boundMethod, arguments);
  2259. reboundMethod.__reactBoundContext = component;
  2260. reboundMethod.__reactBoundMethod = method;
  2261. reboundMethod.__reactBoundArguments = args;
  2262. return reboundMethod;
  2263. };
  2264. }
  2265. return boundMethod;
  2266. }
  2267. /**
  2268. * Binds all auto-bound methods in a component.
  2269. *
  2270. * @param {object} component Component whose method is going to be bound.
  2271. */
  2272. function bindAutoBindMethods(component) {
  2273. var pairs = component.__reactAutoBindPairs;
  2274. for (var i = 0; i < pairs.length; i += 2) {
  2275. var autoBindKey = pairs[i];
  2276. var method = pairs[i + 1];
  2277. component[autoBindKey] = bindAutoBindMethod(component, method);
  2278. }
  2279. }
  2280. /**
  2281. * Add more to the ReactClass base class. These are all legacy features and
  2282. * therefore not already part of the modern ReactComponent.
  2283. */
  2284. var ReactClassMixin = {
  2285. /**
  2286. * TODO: This will be deprecated because state should always keep a consistent
  2287. * type signature and the only use case for this, is to avoid that.
  2288. */
  2289. replaceState: function (newState, callback) {
  2290. this.updater.enqueueReplaceState(this, newState);
  2291. if (callback) {
  2292. this.updater.enqueueCallback(this, callback, 'replaceState');
  2293. }
  2294. },
  2295. /**
  2296. * Checks whether or not this composite component is mounted.
  2297. * @return {boolean} True if mounted, false otherwise.
  2298. * @protected
  2299. * @final
  2300. */
  2301. isMounted: function () {
  2302. return this.updater.isMounted(this);
  2303. }
  2304. };
  2305. var ReactClassComponent = function () {};
  2306. _assign(ReactClassComponent.prototype, ReactComponent.prototype, ReactClassMixin);
  2307. /**
  2308. * Module for creating composite components.
  2309. *
  2310. * @class ReactClass
  2311. */
  2312. var ReactClass = {
  2313. /**
  2314. * Creates a composite component class given a class specification.
  2315. * See https://facebook.github.io/react/docs/top-level-api.html#react.createclass
  2316. *
  2317. * @param {object} spec Class specification (which must define `render`).
  2318. * @return {function} Component constructor function.
  2319. * @public
  2320. */
  2321. createClass: function (spec) {
  2322. var Constructor = function (props, context, updater) {
  2323. // This constructor gets overridden by mocks. The argument is used
  2324. // by mocks to assert on what gets mounted.
  2325. if (false) {
  2326. process.env.NODE_ENV !== 'production' ? warning(this instanceof Constructor, 'Something is calling a React component directly. Use a factory or ' + 'JSX instead. See: https://fb.me/react-legacyfactory') : void 0;
  2327. }
  2328. // Wire up auto-binding
  2329. if (this.__reactAutoBindPairs.length) {
  2330. bindAutoBindMethods(this);
  2331. }
  2332. this.props = props;
  2333. this.context = context;
  2334. this.refs = emptyObject;
  2335. this.updater = updater || ReactNoopUpdateQueue;
  2336. this.state = null;
  2337. // ReactClasses doesn't have constructors. Instead, they use the
  2338. // getInitialState and componentWillMount methods for initialization.
  2339. var initialState = this.getInitialState ? this.getInitialState() : null;
  2340. if (false) {
  2341. // We allow auto-mocks to proceed as if they're returning null.
  2342. if (initialState === undefined && this.getInitialState._isMockFunction) {
  2343. // This is probably bad practice. Consider warning here and
  2344. // deprecating this convenience.
  2345. initialState = null;
  2346. }
  2347. }
  2348. !(typeof initialState === 'object' && !Array.isArray(initialState)) ? false ? invariant(false, '%s.getInitialState(): must return an object or null', Constructor.displayName || 'ReactCompositeComponent') : invariant(false) : void 0;
  2349. this.state = initialState;
  2350. };
  2351. Constructor.prototype = new ReactClassComponent();
  2352. Constructor.prototype.constructor = Constructor;
  2353. Constructor.prototype.__reactAutoBindPairs = [];
  2354. injectedMixins.forEach(mixSpecIntoComponent.bind(null, Constructor));
  2355. mixSpecIntoComponent(Constructor, spec);
  2356. // Initialize the defaultProps property after all mixins have been merged.
  2357. if (Constructor.getDefaultProps) {
  2358. Constructor.defaultProps = Constructor.getDefaultProps();
  2359. }
  2360. if (false) {
  2361. // This is a tag to indicate that the use of these method names is ok,
  2362. // since it's used with createClass. If it's not, then it's likely a
  2363. // mistake so we'll warn you to use the static property, property
  2364. // initializer or constructor respectively.
  2365. if (Constructor.getDefaultProps) {
  2366. Constructor.getDefaultProps.isReactClassApproved = {};
  2367. }
  2368. if (Constructor.prototype.getInitialState) {
  2369. Constructor.prototype.getInitialState.isReactClassApproved = {};
  2370. }
  2371. }
  2372. !Constructor.prototype.render ? false ? invariant(false, 'createClass(...): Class specification must implement a `render` method.') : invariant(false) : void 0;
  2373. if (false) {
  2374. process.env.NODE_ENV !== 'production' ? warning(!Constructor.prototype.componentShouldUpdate, '%s has a method called ' + 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' + 'The name is phrased as a question because the function is ' + 'expected to return a value.', spec.displayName || 'A component') : void 0;
  2375. process.env.NODE_ENV !== 'production' ? warning(!Constructor.prototype.componentWillRecieveProps, '%s has a method called ' + 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', spec.displayName || 'A component') : void 0;
  2376. }
  2377. // Reduce time spent doing lookups by setting these on the prototype.
  2378. for (var methodName in ReactClassInterface) {
  2379. if (!Constructor.prototype[methodName]) {
  2380. Constructor.prototype[methodName] = null;
  2381. }
  2382. }
  2383. return Constructor;
  2384. },
  2385. injection: {
  2386. injectMixin: function (mixin) {
  2387. injectedMixins.push(mixin);
  2388. }
  2389. }
  2390. };
  2391. module.exports = ReactClass;
  2392. /***/ },
  2393. /* 24 */
  2394. /***/ function(module, exports, __webpack_require__) {
  2395. /**
  2396. * Copyright 2013-present, Facebook, Inc.
  2397. * All rights reserved.
  2398. *
  2399. * This source code is licensed under the BSD-style license found in the
  2400. * LICENSE file in the root directory of this source tree. An additional grant
  2401. * of patent rights can be found in the PATENTS file in the same directory.
  2402. *
  2403. * @providesModule ReactPropTypeLocations
  2404. */
  2405. 'use strict';
  2406. var keyMirror = __webpack_require__(25);
  2407. var ReactPropTypeLocations = keyMirror({
  2408. prop: null,
  2409. context: null,
  2410. childContext: null
  2411. });
  2412. module.exports = ReactPropTypeLocations;
  2413. /***/ },
  2414. /* 25 */
  2415. /***/ function(module, exports, __webpack_require__) {
  2416. /**
  2417. * Copyright (c) 2013-present, Facebook, Inc.
  2418. * All rights reserved.
  2419. *
  2420. * This source code is licensed under the BSD-style license found in the
  2421. * LICENSE file in the root directory of this source tree. An additional grant
  2422. * of patent rights can be found in the PATENTS file in the same directory.
  2423. *
  2424. * @typechecks static-only
  2425. */
  2426. 'use strict';
  2427. var invariant = __webpack_require__(6);
  2428. /**
  2429. * Constructs an enumeration with keys equal to their value.
  2430. *
  2431. * For example:
  2432. *
  2433. * var COLORS = keyMirror({blue: null, red: null});
  2434. * var myColor = COLORS.blue;
  2435. * var isColorValid = !!COLORS[myColor];
  2436. *
  2437. * The last line could not be performed if the values of the generated enum were
  2438. * not equal to their keys.
  2439. *
  2440. * Input: {key1: val1, key2: val2}
  2441. * Output: {key1: key1, key2: key2}
  2442. *
  2443. * @param {object} obj
  2444. * @return {object}
  2445. */
  2446. var keyMirror = function keyMirror(obj) {
  2447. var ret = {};
  2448. var key;
  2449. !(obj instanceof Object && !Array.isArray(obj)) ? false ? invariant(false, 'keyMirror(...): Argument must be an object.') : invariant(false) : void 0;
  2450. for (key in obj) {
  2451. if (!obj.hasOwnProperty(key)) {
  2452. continue;
  2453. }
  2454. ret[key] = key;
  2455. }
  2456. return ret;
  2457. };
  2458. module.exports = keyMirror;
  2459. /***/ },
  2460. /* 26 */
  2461. /***/ function(module, exports, __webpack_require__) {
  2462. /**
  2463. * Copyright 2013-present, Facebook, Inc.
  2464. * All rights reserved.
  2465. *
  2466. * This source code is licensed under the BSD-style license found in the
  2467. * LICENSE file in the root directory of this source tree. An additional grant
  2468. * of patent rights can be found in the PATENTS file in the same directory.
  2469. *
  2470. * @providesModule ReactPropTypeLocationNames
  2471. */
  2472. 'use strict';
  2473. var ReactPropTypeLocationNames = {};
  2474. if (false) {
  2475. ReactPropTypeLocationNames = {
  2476. prop: 'prop',
  2477. context: 'context',
  2478. childContext: 'child context'
  2479. };
  2480. }
  2481. module.exports = ReactPropTypeLocationNames;
  2482. /***/ },
  2483. /* 27 */
  2484. /***/ function(module, exports) {
  2485. "use strict";
  2486. /**
  2487. * Copyright (c) 2013-present, Facebook, Inc.
  2488. * All rights reserved.
  2489. *
  2490. * This source code is licensed under the BSD-style license found in the
  2491. * LICENSE file in the root directory of this source tree. An additional grant
  2492. * of patent rights can be found in the PATENTS file in the same directory.
  2493. *
  2494. */
  2495. /**
  2496. * Allows extraction of a minified key. Let's the build system minify keys
  2497. * without losing the ability to dynamically use key strings as values
  2498. * themselves. Pass in an object with a single key/val pair and it will return
  2499. * you the string key of that single record. Suppose you want to grab the
  2500. * value for a key 'className' inside of an object. Key/val minification may
  2501. * have aliased that key to be 'xa12'. keyOf({className: null}) will return
  2502. * 'xa12' in that case. Resolve keys you want to use once at startup time, then
  2503. * reuse those resolutions.
  2504. */
  2505. var keyOf = function keyOf(oneKeyObj) {
  2506. var key;
  2507. for (key in oneKeyObj) {
  2508. if (!oneKeyObj.hasOwnProperty(key)) {
  2509. continue;
  2510. }
  2511. return key;
  2512. }
  2513. return null;
  2514. };
  2515. module.exports = keyOf;
  2516. /***/ },
  2517. /* 28 */
  2518. /***/ function(module, exports, __webpack_require__) {
  2519. /**
  2520. * Copyright 2013-present, Facebook, Inc.
  2521. * All rights reserved.
  2522. *
  2523. * This source code is licensed under the BSD-style license found in the
  2524. * LICENSE file in the root directory of this source tree. An additional grant
  2525. * of patent rights can be found in the PATENTS file in the same directory.
  2526. *
  2527. * @providesModule ReactDOMFactories
  2528. */
  2529. 'use strict';
  2530. var ReactElement = __webpack_require__(7);
  2531. var ReactElementValidator = __webpack_require__(29);
  2532. var mapObject = __webpack_require__(30);
  2533. /**
  2534. * Create a factory that creates HTML tag elements.
  2535. *
  2536. * @param {string} tag Tag name (e.g. `div`).
  2537. * @private
  2538. */
  2539. function createDOMFactory(tag) {
  2540. if (false) {
  2541. return ReactElementValidator.createFactory(tag);
  2542. }
  2543. return ReactElement.createFactory(tag);
  2544. }
  2545. /**
  2546. * Creates a mapping from supported HTML tags to `ReactDOMComponent` classes.
  2547. * This is also accessible via `React.DOM`.
  2548. *
  2549. * @public
  2550. */
  2551. var ReactDOMFactories = mapObject({
  2552. a: 'a',
  2553. abbr: 'abbr',
  2554. address: 'address',
  2555. area: 'area',
  2556. article: 'article',
  2557. aside: 'aside',
  2558. audio: 'audio',
  2559. b: 'b',
  2560. base: 'base',
  2561. bdi: 'bdi',
  2562. bdo: 'bdo',
  2563. big: 'big',
  2564. blockquote: 'blockquote',
  2565. body: 'body',
  2566. br: 'br',
  2567. button: 'button',
  2568. canvas: 'canvas',
  2569. caption: 'caption',
  2570. cite: 'cite',
  2571. code: 'code',
  2572. col: 'col',
  2573. colgroup: 'colgroup',
  2574. data: 'data',
  2575. datalist: 'datalist',
  2576. dd: 'dd',
  2577. del: 'del',
  2578. details: 'details',
  2579. dfn: 'dfn',
  2580. dialog: 'dialog',
  2581. div: 'div',
  2582. dl: 'dl',
  2583. dt: 'dt',
  2584. em: 'em',
  2585. embed: 'embed',
  2586. fieldset: 'fieldset',
  2587. figcaption: 'figcaption',
  2588. figure: 'figure',
  2589. footer: 'footer',
  2590. form: 'form',
  2591. h1: 'h1',
  2592. h2: 'h2',
  2593. h3: 'h3',
  2594. h4: 'h4',
  2595. h5: 'h5',
  2596. h6: 'h6',
  2597. head: 'head',
  2598. header: 'header',
  2599. hgroup: 'hgroup',
  2600. hr: 'hr',
  2601. html: 'html',
  2602. i: 'i',
  2603. iframe: 'iframe',
  2604. img: 'img',
  2605. input: 'input',
  2606. ins: 'ins',
  2607. kbd: 'kbd',
  2608. keygen: 'keygen',
  2609. label: 'label',
  2610. legend: 'legend',
  2611. li: 'li',
  2612. link: 'link',
  2613. main: 'main',
  2614. map: 'map',
  2615. mark: 'mark',
  2616. menu: 'menu',
  2617. menuitem: 'menuitem',
  2618. meta: 'meta',
  2619. meter: 'meter',
  2620. nav: 'nav',
  2621. noscript: 'noscript',
  2622. object: 'object',
  2623. ol: 'ol',
  2624. optgroup: 'optgroup',
  2625. option: 'option',
  2626. output: 'output',
  2627. p: 'p',
  2628. param: 'param',
  2629. picture: 'picture',
  2630. pre: 'pre',
  2631. progress: 'progress',
  2632. q: 'q',
  2633. rp: 'rp',
  2634. rt: 'rt',
  2635. ruby: 'ruby',
  2636. s: 's',
  2637. samp: 'samp',
  2638. script: 'script',
  2639. section: 'section',
  2640. select: 'select',
  2641. small: 'small',
  2642. source: 'source',
  2643. span: 'span',
  2644. strong: 'strong',
  2645. style: 'style',
  2646. sub: 'sub',
  2647. summary: 'summary',
  2648. sup: 'sup',
  2649. table: 'table',
  2650. tbody: 'tbody',
  2651. td: 'td',
  2652. textarea: 'textarea',
  2653. tfoot: 'tfoot',
  2654. th: 'th',
  2655. thead: 'thead',
  2656. time: 'time',
  2657. title: 'title',
  2658. tr: 'tr',
  2659. track: 'track',
  2660. u: 'u',
  2661. ul: 'ul',
  2662. 'var': 'var',
  2663. video: 'video',
  2664. wbr: 'wbr',
  2665. // SVG
  2666. circle: 'circle',
  2667. clipPath: 'clipPath',
  2668. defs: 'defs',
  2669. ellipse: 'ellipse',
  2670. g: 'g',
  2671. image: 'image',
  2672. line: 'line',
  2673. linearGradient: 'linearGradient',
  2674. mask: 'mask',
  2675. path: 'path',
  2676. pattern: 'pattern',
  2677. polygon: 'polygon',
  2678. polyline: 'polyline',
  2679. radialGradient: 'radialGradient',
  2680. rect: 'rect',
  2681. stop: 'stop',
  2682. svg: 'svg',
  2683. text: 'text',
  2684. tspan: 'tspan'
  2685. }, createDOMFactory);
  2686. module.exports = ReactDOMFactories;
  2687. /***/ },
  2688. /* 29 */
  2689. /***/ function(module, exports, __webpack_require__) {
  2690. /**
  2691. * Copyright 2014-present, Facebook, Inc.
  2692. * All rights reserved.
  2693. *
  2694. * This source code is licensed under the BSD-style license found in the
  2695. * LICENSE file in the root directory of this source tree. An additional grant
  2696. * of patent rights can be found in the PATENTS file in the same directory.
  2697. *
  2698. * @providesModule ReactElementValidator
  2699. */
  2700. /**
  2701. * ReactElementValidator provides a wrapper around a element factory
  2702. * which validates the props passed to the element. This is intended to be
  2703. * used only in DEV and could be replaced by a static type checker for languages
  2704. * that support it.
  2705. */
  2706. 'use strict';
  2707. var ReactElement = __webpack_require__(7);
  2708. var ReactPropTypeLocations = __webpack_require__(24);
  2709. var ReactPropTypeLocationNames = __webpack_require__(26);
  2710. var ReactCurrentOwner = __webpack_require__(8);
  2711. var canDefineProperty = __webpack_require__(11);
  2712. var getIteratorFn = __webpack_require__(13);
  2713. var invariant = __webpack_require__(6);
  2714. var warning = __webpack_require__(9);
  2715. function getDeclarationErrorAddendum() {
  2716. if (ReactCurrentOwner.current) {
  2717. var name = ReactCurrentOwner.current.getName();
  2718. if (name) {
  2719. return ' Check the render method of `' + name + '`.';
  2720. }
  2721. }
  2722. return '';
  2723. }
  2724. /**
  2725. * Warn if there's no key explicitly set on dynamic arrays of children or
  2726. * object keys are not valid. This allows us to keep track of children between
  2727. * updates.
  2728. */
  2729. var ownerHasKeyUseWarning = {};
  2730. var loggedTypeFailures = {};
  2731. /**
  2732. * Warn if the element doesn't have an explicit key assigned to it.
  2733. * This element is in an array. The array could grow and shrink or be
  2734. * reordered. All children that haven't already been validated are required to
  2735. * have a "key" property assigned to it.
  2736. *
  2737. * @internal
  2738. * @param {ReactElement} element Element that requires a key.
  2739. * @param {*} parentType element's parent's type.
  2740. */
  2741. function validateExplicitKey(element, parentType) {
  2742. if (!element._store || element._store.validated || element.key != null) {
  2743. return;
  2744. }
  2745. element._store.validated = true;
  2746. var addenda = getAddendaForKeyUse('uniqueKey', element, parentType);
  2747. if (addenda === null) {
  2748. // we already showed the warning
  2749. return;
  2750. }
  2751. false ? warning(false, 'Each child in an array or iterator should have a unique "key" prop.' + '%s%s%s', addenda.parentOrOwner || '', addenda.childOwner || '', addenda.url || '') : void 0;
  2752. }
  2753. /**
  2754. * Shared warning and monitoring code for the key warnings.
  2755. *
  2756. * @internal
  2757. * @param {string} messageType A key used for de-duping warnings.
  2758. * @param {ReactElement} element Component that requires a key.
  2759. * @param {*} parentType element's parent's type.
  2760. * @returns {?object} A set of addenda to use in the warning message, or null
  2761. * if the warning has already been shown before (and shouldn't be shown again).
  2762. */
  2763. function getAddendaForKeyUse(messageType, element, parentType) {
  2764. var addendum = getDeclarationErrorAddendum();
  2765. if (!addendum) {
  2766. var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;
  2767. if (parentName) {
  2768. addendum = ' Check the top-level render call using <' + parentName + '>.';
  2769. }
  2770. }
  2771. var memoizer = ownerHasKeyUseWarning[messageType] || (ownerHasKeyUseWarning[messageType] = {});
  2772. if (memoizer[addendum]) {
  2773. return null;
  2774. }
  2775. memoizer[addendum] = true;
  2776. var addenda = {
  2777. parentOrOwner: addendum,
  2778. url: ' See https://fb.me/react-warning-keys for more information.',
  2779. childOwner: null
  2780. };
  2781. // Usually the current owner is the offender, but if it accepts children as a
  2782. // property, it may be the creator of the child that's responsible for
  2783. // assigning it a key.
  2784. if (element && element._owner && element._owner !== ReactCurrentOwner.current) {
  2785. // Give the component that originally created this child.
  2786. addenda.childOwner = ' It was passed a child from ' + element._owner.getName() + '.';
  2787. }
  2788. return addenda;
  2789. }
  2790. /**
  2791. * Ensure that every element either is passed in a static location, in an
  2792. * array with an explicit keys property defined, or in an object literal
  2793. * with valid key property.
  2794. *
  2795. * @internal
  2796. * @param {ReactNode} node Statically passed child of any type.
  2797. * @param {*} parentType node's parent's type.
  2798. */
  2799. function validateChildKeys(node, parentType) {
  2800. if (typeof node !== 'object') {
  2801. return;
  2802. }
  2803. if (Array.isArray(node)) {
  2804. for (var i = 0; i < node.length; i++) {
  2805. var child = node[i];
  2806. if (ReactElement.isValidElement(child)) {
  2807. validateExplicitKey(child, parentType);
  2808. }
  2809. }
  2810. } else if (ReactElement.isValidElement(node)) {
  2811. // This element was passed in a valid location.
  2812. if (node._store) {
  2813. node._store.validated = true;
  2814. }
  2815. } else if (node) {
  2816. var iteratorFn = getIteratorFn(node);
  2817. // Entry iterators provide implicit keys.
  2818. if (iteratorFn) {
  2819. if (iteratorFn !== node.entries) {
  2820. var iterator = iteratorFn.call(node);
  2821. var step;
  2822. while (!(step = iterator.next()).done) {
  2823. if (ReactElement.isValidElement(step.value)) {
  2824. validateExplicitKey(step.value, parentType);
  2825. }
  2826. }
  2827. }
  2828. }
  2829. }
  2830. }
  2831. /**
  2832. * Assert that the props are valid
  2833. *
  2834. * @param {string} componentName Name of the component for error messages.
  2835. * @param {object} propTypes Map of prop name to a ReactPropType
  2836. * @param {object} props
  2837. * @param {string} location e.g. "prop", "context", "child context"
  2838. * @private
  2839. */
  2840. function checkPropTypes(componentName, propTypes, props, location) {
  2841. for (var propName in propTypes) {
  2842. if (propTypes.hasOwnProperty(propName)) {
  2843. var error;
  2844. // Prop type validation may throw. In case they do, we don't want to
  2845. // fail the render phase where it didn't fail before. So we log it.
  2846. // After these have been cleaned up, we'll let them throw.
  2847. try {
  2848. // This is intentionally an invariant that gets caught. It's the same
  2849. // behavior as without this statement except with a better message.
  2850. !(typeof propTypes[propName] === 'function') ? false ? invariant(false, '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'React.PropTypes.', componentName || 'React class', ReactPropTypeLocationNames[location], propName) : invariant(false) : void 0;
  2851. error = propTypes[propName](props, propName, componentName, location);
  2852. } catch (ex) {
  2853. error = ex;
  2854. }
  2855. false ? warning(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', ReactPropTypeLocationNames[location], propName, typeof error) : void 0;
  2856. if (error instanceof Error && !(error.message in loggedTypeFailures)) {
  2857. // Only monitor this failure once because there tends to be a lot of the
  2858. // same error.
  2859. loggedTypeFailures[error.message] = true;
  2860. var addendum = getDeclarationErrorAddendum();
  2861. false ? warning(false, 'Failed propType: %s%s', error.message, addendum) : void 0;
  2862. }
  2863. }
  2864. }
  2865. }
  2866. /**
  2867. * Given an element, validate that its props follow the propTypes definition,
  2868. * provided by the type.
  2869. *
  2870. * @param {ReactElement} element
  2871. */
  2872. function validatePropTypes(element) {
  2873. var componentClass = element.type;
  2874. if (typeof componentClass !== 'function') {
  2875. return;
  2876. }
  2877. var name = componentClass.displayName || componentClass.name;
  2878. if (componentClass.propTypes) {
  2879. checkPropTypes(name, componentClass.propTypes, element.props, ReactPropTypeLocations.prop);
  2880. }
  2881. if (typeof componentClass.getDefaultProps === 'function') {
  2882. false ? warning(componentClass.getDefaultProps.isReactClassApproved, 'getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.') : void 0;
  2883. }
  2884. }
  2885. var ReactElementValidator = {
  2886. createElement: function (type, props, children) {
  2887. var validType = typeof type === 'string' || typeof type === 'function';
  2888. // We warn in this case but don't throw. We expect the element creation to
  2889. // succeed and there will likely be errors in render.
  2890. false ? warning(validType, 'React.createElement: type should not be null, undefined, boolean, or ' + 'number. It should be a string (for DOM elements) or a ReactClass ' + '(for composite components).%s', getDeclarationErrorAddendum()) : void 0;
  2891. var element = ReactElement.createElement.apply(this, arguments);
  2892. // The result can be nullish if a mock or a custom function is used.
  2893. // TODO: Drop this when these are no longer allowed as the type argument.
  2894. if (element == null) {
  2895. return element;
  2896. }
  2897. // Skip key warning if the type isn't valid since our key validation logic
  2898. // doesn't expect a non-string/function type and can throw confusing errors.
  2899. // We don't want exception behavior to differ between dev and prod.
  2900. // (Rendering will throw with a helpful message and as soon as the type is
  2901. // fixed, the key warnings will appear.)
  2902. if (validType) {
  2903. for (var i = 2; i < arguments.length; i++) {
  2904. validateChildKeys(arguments[i], type);
  2905. }
  2906. }
  2907. validatePropTypes(element);
  2908. return element;
  2909. },
  2910. createFactory: function (type) {
  2911. var validatedFactory = ReactElementValidator.createElement.bind(null, type);
  2912. // Legacy hook TODO: Warn if this is accessed
  2913. validatedFactory.type = type;
  2914. if (false) {
  2915. if (canDefineProperty) {
  2916. Object.defineProperty(validatedFactory, 'type', {
  2917. enumerable: false,
  2918. get: function () {
  2919. process.env.NODE_ENV !== 'production' ? warning(false, 'Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.') : void 0;
  2920. Object.defineProperty(this, 'type', {
  2921. value: type
  2922. });
  2923. return type;
  2924. }
  2925. });
  2926. }
  2927. }
  2928. return validatedFactory;
  2929. },
  2930. cloneElement: function (element, props, children) {
  2931. var newElement = ReactElement.cloneElement.apply(this, arguments);
  2932. for (var i = 2; i < arguments.length; i++) {
  2933. validateChildKeys(arguments[i], newElement.type);
  2934. }
  2935. validatePropTypes(newElement);
  2936. return newElement;
  2937. }
  2938. };
  2939. module.exports = ReactElementValidator;
  2940. /***/ },
  2941. /* 30 */
  2942. /***/ function(module, exports) {
  2943. /**
  2944. * Copyright (c) 2013-present, Facebook, Inc.
  2945. * All rights reserved.
  2946. *
  2947. * This source code is licensed under the BSD-style license found in the
  2948. * LICENSE file in the root directory of this source tree. An additional grant
  2949. * of patent rights can be found in the PATENTS file in the same directory.
  2950. *
  2951. */
  2952. 'use strict';
  2953. var hasOwnProperty = Object.prototype.hasOwnProperty;
  2954. /**
  2955. * Executes the provided `callback` once for each enumerable own property in the
  2956. * object and constructs a new object from the results. The `callback` is
  2957. * invoked with three arguments:
  2958. *
  2959. * - the property value
  2960. * - the property name
  2961. * - the object being traversed
  2962. *
  2963. * Properties that are added after the call to `mapObject` will not be visited
  2964. * by `callback`. If the values of existing properties are changed, the value
  2965. * passed to `callback` will be the value at the time `mapObject` visits them.
  2966. * Properties that are deleted before being visited are not visited.
  2967. *
  2968. * @grep function objectMap()
  2969. * @grep function objMap()
  2970. *
  2971. * @param {?object} object
  2972. * @param {function} callback
  2973. * @param {*} context
  2974. * @return {?object}
  2975. */
  2976. function mapObject(object, callback, context) {
  2977. if (!object) {
  2978. return null;
  2979. }
  2980. var result = {};
  2981. for (var name in object) {
  2982. if (hasOwnProperty.call(object, name)) {
  2983. result[name] = callback.call(context, object[name], name, object);
  2984. }
  2985. }
  2986. return result;
  2987. }
  2988. module.exports = mapObject;
  2989. /***/ },
  2990. /* 31 */
  2991. /***/ function(module, exports, __webpack_require__) {
  2992. /**
  2993. * Copyright 2013-present, Facebook, Inc.
  2994. * All rights reserved.
  2995. *
  2996. * This source code is licensed under the BSD-style license found in the
  2997. * LICENSE file in the root directory of this source tree. An additional grant
  2998. * of patent rights can be found in the PATENTS file in the same directory.
  2999. *
  3000. * @providesModule ReactPropTypes
  3001. */
  3002. 'use strict';
  3003. var ReactElement = __webpack_require__(7);
  3004. var ReactPropTypeLocationNames = __webpack_require__(26);
  3005. var emptyFunction = __webpack_require__(10);
  3006. var getIteratorFn = __webpack_require__(13);
  3007. /**
  3008. * Collection of methods that allow declaration and validation of props that are
  3009. * supplied to React components. Example usage:
  3010. *
  3011. * var Props = require('ReactPropTypes');
  3012. * var MyArticle = React.createClass({
  3013. * propTypes: {
  3014. * // An optional string prop named "description".
  3015. * description: Props.string,
  3016. *
  3017. * // A required enum prop named "category".
  3018. * category: Props.oneOf(['News','Photos']).isRequired,
  3019. *
  3020. * // A prop named "dialog" that requires an instance of Dialog.
  3021. * dialog: Props.instanceOf(Dialog).isRequired
  3022. * },
  3023. * render: function() { ... }
  3024. * });
  3025. *
  3026. * A more formal specification of how these methods are used:
  3027. *
  3028. * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
  3029. * decl := ReactPropTypes.{type}(.isRequired)?
  3030. *
  3031. * Each and every declaration produces a function with the same signature. This
  3032. * allows the creation of custom validation functions. For example:
  3033. *
  3034. * var MyLink = React.createClass({
  3035. * propTypes: {
  3036. * // An optional string or URI prop named "href".
  3037. * href: function(props, propName, componentName) {
  3038. * var propValue = props[propName];
  3039. * if (propValue != null && typeof propValue !== 'string' &&
  3040. * !(propValue instanceof URI)) {
  3041. * return new Error(
  3042. * 'Expected a string or an URI for ' + propName + ' in ' +
  3043. * componentName
  3044. * );
  3045. * }
  3046. * }
  3047. * },
  3048. * render: function() {...}
  3049. * });
  3050. *
  3051. * @internal
  3052. */
  3053. var ANONYMOUS = '<<anonymous>>';
  3054. var ReactPropTypes = {
  3055. array: createPrimitiveTypeChecker('array'),
  3056. bool: createPrimitiveTypeChecker('boolean'),
  3057. func: createPrimitiveTypeChecker('function'),
  3058. number: createPrimitiveTypeChecker('number'),
  3059. object: createPrimitiveTypeChecker('object'),
  3060. string: createPrimitiveTypeChecker('string'),
  3061. any: createAnyTypeChecker(),
  3062. arrayOf: createArrayOfTypeChecker,
  3063. element: createElementTypeChecker(),
  3064. instanceOf: createInstanceTypeChecker,
  3065. node: createNodeChecker(),
  3066. objectOf: createObjectOfTypeChecker,
  3067. oneOf: createEnumTypeChecker,
  3068. oneOfType: createUnionTypeChecker,
  3069. shape: createShapeTypeChecker
  3070. };
  3071. /**
  3072. * inlined Object.is polyfill to avoid requiring consumers ship their own
  3073. * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
  3074. */
  3075. /*eslint-disable no-self-compare*/
  3076. function is(x, y) {
  3077. // SameValue algorithm
  3078. if (x === y) {
  3079. // Steps 1-5, 7-10
  3080. // Steps 6.b-6.e: +0 != -0
  3081. return x !== 0 || 1 / x === 1 / y;
  3082. } else {
  3083. // Step 6.a: NaN == NaN
  3084. return x !== x && y !== y;
  3085. }
  3086. }
  3087. /*eslint-enable no-self-compare*/
  3088. function createChainableTypeChecker(validate) {
  3089. function checkType(isRequired, props, propName, componentName, location, propFullName) {
  3090. componentName = componentName || ANONYMOUS;
  3091. propFullName = propFullName || propName;
  3092. if (props[propName] == null) {
  3093. var locationName = ReactPropTypeLocationNames[location];
  3094. if (isRequired) {
  3095. return new Error('Required ' + locationName + ' `' + propFullName + '` was not specified in ' + ('`' + componentName + '`.'));
  3096. }
  3097. return null;
  3098. } else {
  3099. return validate(props, propName, componentName, location, propFullName);
  3100. }
  3101. }
  3102. var chainedCheckType = checkType.bind(null, false);
  3103. chainedCheckType.isRequired = checkType.bind(null, true);
  3104. return chainedCheckType;
  3105. }
  3106. function createPrimitiveTypeChecker(expectedType) {
  3107. function validate(props, propName, componentName, location, propFullName) {
  3108. var propValue = props[propName];
  3109. var propType = getPropType(propValue);
  3110. if (propType !== expectedType) {
  3111. var locationName = ReactPropTypeLocationNames[location];
  3112. // `propValue` being instance of, say, date/regexp, pass the 'object'
  3113. // check, but we can offer a more precise error message here rather than
  3114. // 'of type `object`'.
  3115. var preciseType = getPreciseType(propValue);
  3116. return new Error('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'));
  3117. }
  3118. return null;
  3119. }
  3120. return createChainableTypeChecker(validate);
  3121. }
  3122. function createAnyTypeChecker() {
  3123. return createChainableTypeChecker(emptyFunction.thatReturns(null));
  3124. }
  3125. function createArrayOfTypeChecker(typeChecker) {
  3126. function validate(props, propName, componentName, location, propFullName) {
  3127. if (typeof typeChecker !== 'function') {
  3128. return new Error('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
  3129. }
  3130. var propValue = props[propName];
  3131. if (!Array.isArray(propValue)) {
  3132. var locationName = ReactPropTypeLocationNames[location];
  3133. var propType = getPropType(propValue);
  3134. return new Error('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
  3135. }
  3136. for (var i = 0; i < propValue.length; i++) {
  3137. var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']');
  3138. if (error instanceof Error) {
  3139. return error;
  3140. }
  3141. }
  3142. return null;
  3143. }
  3144. return createChainableTypeChecker(validate);
  3145. }
  3146. function createElementTypeChecker() {
  3147. function validate(props, propName, componentName, location, propFullName) {
  3148. if (!ReactElement.isValidElement(props[propName])) {
  3149. var locationName = ReactPropTypeLocationNames[location];
  3150. return new Error('Invalid ' + locationName + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a single ReactElement.'));
  3151. }
  3152. return null;
  3153. }
  3154. return createChainableTypeChecker(validate);
  3155. }
  3156. function createInstanceTypeChecker(expectedClass) {
  3157. function validate(props, propName, componentName, location, propFullName) {
  3158. if (!(props[propName] instanceof expectedClass)) {
  3159. var locationName = ReactPropTypeLocationNames[location];
  3160. var expectedClassName = expectedClass.name || ANONYMOUS;
  3161. var actualClassName = getClassName(props[propName]);
  3162. return new Error('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
  3163. }
  3164. return null;
  3165. }
  3166. return createChainableTypeChecker(validate);
  3167. }
  3168. function createEnumTypeChecker(expectedValues) {
  3169. if (!Array.isArray(expectedValues)) {
  3170. return createChainableTypeChecker(function () {
  3171. return new Error('Invalid argument supplied to oneOf, expected an instance of array.');
  3172. });
  3173. }
  3174. function validate(props, propName, componentName, location, propFullName) {
  3175. var propValue = props[propName];
  3176. for (var i = 0; i < expectedValues.length; i++) {
  3177. if (is(propValue, expectedValues[i])) {
  3178. return null;
  3179. }
  3180. }
  3181. var locationName = ReactPropTypeLocationNames[location];
  3182. var valuesString = JSON.stringify(expectedValues);
  3183. return new Error('Invalid ' + locationName + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
  3184. }
  3185. return createChainableTypeChecker(validate);
  3186. }
  3187. function createObjectOfTypeChecker(typeChecker) {
  3188. function validate(props, propName, componentName, location, propFullName) {
  3189. if (typeof typeChecker !== 'function') {
  3190. return new Error('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
  3191. }
  3192. var propValue = props[propName];
  3193. var propType = getPropType(propValue);
  3194. if (propType !== 'object') {
  3195. var locationName = ReactPropTypeLocationNames[location];
  3196. return new Error('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
  3197. }
  3198. for (var key in propValue) {
  3199. if (propValue.hasOwnProperty(key)) {
  3200. var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key);
  3201. if (error instanceof Error) {
  3202. return error;
  3203. }
  3204. }
  3205. }
  3206. return null;
  3207. }
  3208. return createChainableTypeChecker(validate);
  3209. }
  3210. function createUnionTypeChecker(arrayOfTypeCheckers) {
  3211. if (!Array.isArray(arrayOfTypeCheckers)) {
  3212. return createChainableTypeChecker(function () {
  3213. return new Error('Invalid argument supplied to oneOfType, expected an instance of array.');
  3214. });
  3215. }
  3216. function validate(props, propName, componentName, location, propFullName) {
  3217. for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
  3218. var checker = arrayOfTypeCheckers[i];
  3219. if (checker(props, propName, componentName, location, propFullName) == null) {
  3220. return null;
  3221. }
  3222. }
  3223. var locationName = ReactPropTypeLocationNames[location];
  3224. return new Error('Invalid ' + locationName + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.'));
  3225. }
  3226. return createChainableTypeChecker(validate);
  3227. }
  3228. function createNodeChecker() {
  3229. function validate(props, propName, componentName, location, propFullName) {
  3230. if (!isNode(props[propName])) {
  3231. var locationName = ReactPropTypeLocationNames[location];
  3232. return new Error('Invalid ' + locationName + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
  3233. }
  3234. return null;
  3235. }
  3236. return createChainableTypeChecker(validate);
  3237. }
  3238. function createShapeTypeChecker(shapeTypes) {
  3239. function validate(props, propName, componentName, location, propFullName) {
  3240. var propValue = props[propName];
  3241. var propType = getPropType(propValue);
  3242. if (propType !== 'object') {
  3243. var locationName = ReactPropTypeLocationNames[location];
  3244. return new Error('Invalid ' + locationName + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
  3245. }
  3246. for (var key in shapeTypes) {
  3247. var checker = shapeTypes[key];
  3248. if (!checker) {
  3249. continue;
  3250. }
  3251. var error = checker(propValue, key, componentName, location, propFullName + '.' + key);
  3252. if (error) {
  3253. return error;
  3254. }
  3255. }
  3256. return null;
  3257. }
  3258. return createChainableTypeChecker(validate);
  3259. }
  3260. function isNode(propValue) {
  3261. switch (typeof propValue) {
  3262. case 'number':
  3263. case 'string':
  3264. case 'undefined':
  3265. return true;
  3266. case 'boolean':
  3267. return !propValue;
  3268. case 'object':
  3269. if (Array.isArray(propValue)) {
  3270. return propValue.every(isNode);
  3271. }
  3272. if (propValue === null || ReactElement.isValidElement(propValue)) {
  3273. return true;
  3274. }
  3275. var iteratorFn = getIteratorFn(propValue);
  3276. if (iteratorFn) {
  3277. var iterator = iteratorFn.call(propValue);
  3278. var step;
  3279. if (iteratorFn !== propValue.entries) {
  3280. while (!(step = iterator.next()).done) {
  3281. if (!isNode(step.value)) {
  3282. return false;
  3283. }
  3284. }
  3285. } else {
  3286. // Iterator will provide entry [k,v] tuples rather than values.
  3287. while (!(step = iterator.next()).done) {
  3288. var entry = step.value;
  3289. if (entry) {
  3290. if (!isNode(entry[1])) {
  3291. return false;
  3292. }
  3293. }
  3294. }
  3295. }
  3296. } else {
  3297. return false;
  3298. }
  3299. return true;
  3300. default:
  3301. return false;
  3302. }
  3303. }
  3304. // Equivalent of `typeof` but with special handling for array and regexp.
  3305. function getPropType(propValue) {
  3306. var propType = typeof propValue;
  3307. if (Array.isArray(propValue)) {
  3308. return 'array';
  3309. }
  3310. if (propValue instanceof RegExp) {
  3311. // Old webkits (at least until Android 4.0) return 'function' rather than
  3312. // 'object' for typeof a RegExp. We'll normalize this here so that /bla/
  3313. // passes PropTypes.object.
  3314. return 'object';
  3315. }
  3316. return propType;
  3317. }
  3318. // This handles more types than `getPropType`. Only used for error messages.
  3319. // See `createPrimitiveTypeChecker`.
  3320. function getPreciseType(propValue) {
  3321. var propType = getPropType(propValue);
  3322. if (propType === 'object') {
  3323. if (propValue instanceof Date) {
  3324. return 'date';
  3325. } else if (propValue instanceof RegExp) {
  3326. return 'regexp';
  3327. }
  3328. }
  3329. return propType;
  3330. }
  3331. // Returns class name of the object, if any.
  3332. function getClassName(propValue) {
  3333. if (!propValue.constructor || !propValue.constructor.name) {
  3334. return ANONYMOUS;
  3335. }
  3336. return propValue.constructor.name;
  3337. }
  3338. module.exports = ReactPropTypes;
  3339. /***/ },
  3340. /* 32 */
  3341. /***/ function(module, exports) {
  3342. /**
  3343. * Copyright 2013-present, Facebook, Inc.
  3344. * All rights reserved.
  3345. *
  3346. * This source code is licensed under the BSD-style license found in the
  3347. * LICENSE file in the root directory of this source tree. An additional grant
  3348. * of patent rights can be found in the PATENTS file in the same directory.
  3349. *
  3350. * @providesModule ReactVersion
  3351. */
  3352. 'use strict';
  3353. module.exports = '15.1.0';
  3354. /***/ },
  3355. /* 33 */
  3356. /***/ function(module, exports, __webpack_require__) {
  3357. /**
  3358. * Copyright 2013-present, Facebook, Inc.
  3359. * All rights reserved.
  3360. *
  3361. * This source code is licensed under the BSD-style license found in the
  3362. * LICENSE file in the root directory of this source tree. An additional grant
  3363. * of patent rights can be found in the PATENTS file in the same directory.
  3364. *
  3365. * @providesModule onlyChild
  3366. */
  3367. 'use strict';
  3368. var ReactElement = __webpack_require__(7);
  3369. var invariant = __webpack_require__(6);
  3370. /**
  3371. * Returns the first child in a collection of children and verifies that there
  3372. * is only one child in the collection.
  3373. *
  3374. * See https://facebook.github.io/react/docs/top-level-api.html#react.children.only
  3375. *
  3376. * The current implementation of this function assumes that a single child gets
  3377. * passed without a wrapper, but the purpose of this helper function is to
  3378. * abstract away the particular structure of children.
  3379. *
  3380. * @param {?object} children Child collection structure.
  3381. * @return {ReactElement} The first and only `ReactElement` contained in the
  3382. * structure.
  3383. */
  3384. function onlyChild(children) {
  3385. !ReactElement.isValidElement(children) ? false ? invariant(false, 'onlyChild must be passed a children with exactly one child.') : invariant(false) : void 0;
  3386. return children;
  3387. }
  3388. module.exports = onlyChild;
  3389. /***/ },
  3390. /* 34 */
  3391. /***/ function(module, exports, __webpack_require__) {
  3392. 'use strict';
  3393. module.exports = __webpack_require__(35);
  3394. /***/ },
  3395. /* 35 */
  3396. /***/ function(module, exports, __webpack_require__) {
  3397. /**
  3398. * Copyright 2013-present, Facebook, Inc.
  3399. * All rights reserved.
  3400. *
  3401. * This source code is licensed under the BSD-style license found in the
  3402. * LICENSE file in the root directory of this source tree. An additional grant
  3403. * of patent rights can be found in the PATENTS file in the same directory.
  3404. *
  3405. * @providesModule ReactDOM
  3406. */
  3407. /* globals __REACT_DEVTOOLS_GLOBAL_HOOK__*/
  3408. 'use strict';
  3409. var ReactDOMComponentTree = __webpack_require__(36);
  3410. var ReactDefaultInjection = __webpack_require__(39);
  3411. var ReactMount = __webpack_require__(156);
  3412. var ReactReconciler = __webpack_require__(58);
  3413. var ReactUpdates = __webpack_require__(55);
  3414. var ReactVersion = __webpack_require__(32);
  3415. var findDOMNode = __webpack_require__(161);
  3416. var getNativeComponentFromComposite = __webpack_require__(162);
  3417. var renderSubtreeIntoContainer = __webpack_require__(163);
  3418. var warning = __webpack_require__(9);
  3419. ReactDefaultInjection.inject();
  3420. var React = {
  3421. findDOMNode: findDOMNode,
  3422. render: ReactMount.render,
  3423. unmountComponentAtNode: ReactMount.unmountComponentAtNode,
  3424. version: ReactVersion,
  3425. /* eslint-disable camelcase */
  3426. unstable_batchedUpdates: ReactUpdates.batchedUpdates,
  3427. unstable_renderSubtreeIntoContainer: renderSubtreeIntoContainer
  3428. };
  3429. // Inject the runtime into a devtools global hook regardless of browser.
  3430. // Allows for debugging when the hook is injected on the page.
  3431. /* eslint-enable camelcase */
  3432. if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.inject === 'function') {
  3433. __REACT_DEVTOOLS_GLOBAL_HOOK__.inject({
  3434. ComponentTree: {
  3435. getClosestInstanceFromNode: ReactDOMComponentTree.getClosestInstanceFromNode,
  3436. getNodeFromInstance: function (inst) {
  3437. // inst is an internal instance (but could be a composite)
  3438. if (inst._renderedComponent) {
  3439. inst = getNativeComponentFromComposite(inst);
  3440. }
  3441. if (inst) {
  3442. return ReactDOMComponentTree.getNodeFromInstance(inst);
  3443. } else {
  3444. return null;
  3445. }
  3446. }
  3447. },
  3448. Mount: ReactMount,
  3449. Reconciler: ReactReconciler
  3450. });
  3451. }
  3452. if (false) {
  3453. var ExecutionEnvironment = require('fbjs/lib/ExecutionEnvironment');
  3454. if (ExecutionEnvironment.canUseDOM && window.top === window.self) {
  3455. // First check if devtools is not installed
  3456. if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined') {
  3457. // If we're in Chrome or Firefox, provide a download link if not installed.
  3458. if (navigator.userAgent.indexOf('Chrome') > -1 && navigator.userAgent.indexOf('Edge') === -1 || navigator.userAgent.indexOf('Firefox') > -1) {
  3459. // Firefox does not have the issue with devtools loaded over file://
  3460. var showFileUrlMessage = window.location.protocol.indexOf('http') === -1 && navigator.userAgent.indexOf('Firefox') === -1;
  3461. console.debug('Download the React DevTools ' + (showFileUrlMessage ? 'and use an HTTP server (instead of a file: URL) ' : '') + 'for a better development experience: ' + 'https://fb.me/react-devtools');
  3462. }
  3463. }
  3464. var testFunc = function testFn() {};
  3465. process.env.NODE_ENV !== 'production' ? warning((testFunc.name || testFunc.toString()).indexOf('testFn') !== -1, 'It looks like you\'re using a minified copy of the development build ' + 'of React. When deploying React apps to production, make sure to use ' + 'the production build which skips development warnings and is faster. ' + 'See https://fb.me/react-minification for more details.') : void 0;
  3466. // If we're in IE8, check to see if we are in compatibility mode and provide
  3467. // information on preventing compatibility mode
  3468. var ieCompatibilityMode = document.documentMode && document.documentMode < 8;
  3469. process.env.NODE_ENV !== 'production' ? warning(!ieCompatibilityMode, 'Internet Explorer is running in compatibility mode; please add the ' + 'following tag to your HTML to prevent this from happening: ' + '<meta http-equiv="X-UA-Compatible" content="IE=edge" />') : void 0;
  3470. var expectedFeatures = [
  3471. // shims
  3472. Array.isArray, Array.prototype.every, Array.prototype.forEach, Array.prototype.indexOf, Array.prototype.map, Date.now, Function.prototype.bind, Object.keys, String.prototype.split, String.prototype.trim];
  3473. for (var i = 0; i < expectedFeatures.length; i++) {
  3474. if (!expectedFeatures[i]) {
  3475. process.env.NODE_ENV !== 'production' ? warning(false, 'One or more ES5 shims expected by React are not available: ' + 'https://fb.me/react-warning-polyfills') : void 0;
  3476. break;
  3477. }
  3478. }
  3479. }
  3480. }
  3481. module.exports = React;
  3482. /***/ },
  3483. /* 36 */
  3484. /***/ function(module, exports, __webpack_require__) {
  3485. /**
  3486. * Copyright 2013-present, Facebook, Inc.
  3487. * All rights reserved.
  3488. *
  3489. * This source code is licensed under the BSD-style license found in the
  3490. * LICENSE file in the root directory of this source tree. An additional grant
  3491. * of patent rights can be found in the PATENTS file in the same directory.
  3492. *
  3493. * @providesModule ReactDOMComponentTree
  3494. */
  3495. 'use strict';
  3496. var DOMProperty = __webpack_require__(37);
  3497. var ReactDOMComponentFlags = __webpack_require__(38);
  3498. var invariant = __webpack_require__(6);
  3499. var ATTR_NAME = DOMProperty.ID_ATTRIBUTE_NAME;
  3500. var Flags = ReactDOMComponentFlags;
  3501. var internalInstanceKey = '__reactInternalInstance$' + Math.random().toString(36).slice(2);
  3502. /**
  3503. * Drill down (through composites and empty components) until we get a native or
  3504. * native text component.
  3505. *
  3506. * This is pretty polymorphic but unavoidable with the current structure we have
  3507. * for `_renderedChildren`.
  3508. */
  3509. function getRenderedNativeOrTextFromComponent(component) {
  3510. var rendered;
  3511. while (rendered = component._renderedComponent) {
  3512. component = rendered;
  3513. }
  3514. return component;
  3515. }
  3516. /**
  3517. * Populate `_nativeNode` on the rendered native/text component with the given
  3518. * DOM node. The passed `inst` can be a composite.
  3519. */
  3520. function precacheNode(inst, node) {
  3521. var nativeInst = getRenderedNativeOrTextFromComponent(inst);
  3522. nativeInst._nativeNode = node;
  3523. node[internalInstanceKey] = nativeInst;
  3524. }
  3525. function uncacheNode(inst) {
  3526. var node = inst._nativeNode;
  3527. if (node) {
  3528. delete node[internalInstanceKey];
  3529. inst._nativeNode = null;
  3530. }
  3531. }
  3532. /**
  3533. * Populate `_nativeNode` on each child of `inst`, assuming that the children
  3534. * match up with the DOM (element) children of `node`.
  3535. *
  3536. * We cache entire levels at once to avoid an n^2 problem where we access the
  3537. * children of a node sequentially and have to walk from the start to our target
  3538. * node every time.
  3539. *
  3540. * Since we update `_renderedChildren` and the actual DOM at (slightly)
  3541. * different times, we could race here and see a newer `_renderedChildren` than
  3542. * the DOM nodes we see. To avoid this, ReactMultiChild calls
  3543. * `prepareToManageChildren` before we change `_renderedChildren`, at which
  3544. * time the container's child nodes are always cached (until it unmounts).
  3545. */
  3546. function precacheChildNodes(inst, node) {
  3547. if (inst._flags & Flags.hasCachedChildNodes) {
  3548. return;
  3549. }
  3550. var children = inst._renderedChildren;
  3551. var childNode = node.firstChild;
  3552. outer: for (var name in children) {
  3553. if (!children.hasOwnProperty(name)) {
  3554. continue;
  3555. }
  3556. var childInst = children[name];
  3557. var childID = getRenderedNativeOrTextFromComponent(childInst)._domID;
  3558. if (childID == null) {
  3559. // We're currently unmounting this child in ReactMultiChild; skip it.
  3560. continue;
  3561. }
  3562. // We assume the child nodes are in the same order as the child instances.
  3563. for (; childNode !== null; childNode = childNode.nextSibling) {
  3564. if (childNode.nodeType === 1 && childNode.getAttribute(ATTR_NAME) === String(childID) || childNode.nodeType === 8 && childNode.nodeValue === ' react-text: ' + childID + ' ' || childNode.nodeType === 8 && childNode.nodeValue === ' react-empty: ' + childID + ' ') {
  3565. precacheNode(childInst, childNode);
  3566. continue outer;
  3567. }
  3568. }
  3569. // We reached the end of the DOM children without finding an ID match.
  3570. true ? false ? invariant(false, 'Unable to find element with ID %s.', childID) : invariant(false) : void 0;
  3571. }
  3572. inst._flags |= Flags.hasCachedChildNodes;
  3573. }
  3574. /**
  3575. * Given a DOM node, return the closest ReactDOMComponent or
  3576. * ReactDOMTextComponent instance ancestor.
  3577. */
  3578. function getClosestInstanceFromNode(node) {
  3579. if (node[internalInstanceKey]) {
  3580. return node[internalInstanceKey];
  3581. }
  3582. // Walk up the tree until we find an ancestor whose instance we have cached.
  3583. var parents = [];
  3584. while (!node[internalInstanceKey]) {
  3585. parents.push(node);
  3586. if (node.parentNode) {
  3587. node = node.parentNode;
  3588. } else {
  3589. // Top of the tree. This node must not be part of a React tree (or is
  3590. // unmounted, potentially).
  3591. return null;
  3592. }
  3593. }
  3594. var closest;
  3595. var inst;
  3596. for (; node && (inst = node[internalInstanceKey]); node = parents.pop()) {
  3597. closest = inst;
  3598. if (parents.length) {
  3599. precacheChildNodes(inst, node);
  3600. }
  3601. }
  3602. return closest;
  3603. }
  3604. /**
  3605. * Given a DOM node, return the ReactDOMComponent or ReactDOMTextComponent
  3606. * instance, or null if the node was not rendered by this React.
  3607. */
  3608. function getInstanceFromNode(node) {
  3609. var inst = getClosestInstanceFromNode(node);
  3610. if (inst != null && inst._nativeNode === node) {
  3611. return inst;
  3612. } else {
  3613. return null;
  3614. }
  3615. }
  3616. /**
  3617. * Given a ReactDOMComponent or ReactDOMTextComponent, return the corresponding
  3618. * DOM node.
  3619. */
  3620. function getNodeFromInstance(inst) {
  3621. // Without this first invariant, passing a non-DOM-component triggers the next
  3622. // invariant for a missing parent, which is super confusing.
  3623. !(inst._nativeNode !== undefined) ? false ? invariant(false, 'getNodeFromInstance: Invalid argument.') : invariant(false) : void 0;
  3624. if (inst._nativeNode) {
  3625. return inst._nativeNode;
  3626. }
  3627. // Walk up the tree until we find an ancestor whose DOM node we have cached.
  3628. var parents = [];
  3629. while (!inst._nativeNode) {
  3630. parents.push(inst);
  3631. !inst._nativeParent ? false ? invariant(false, 'React DOM tree root should always have a node reference.') : invariant(false) : void 0;
  3632. inst = inst._nativeParent;
  3633. }
  3634. // Now parents contains each ancestor that does *not* have a cached native
  3635. // node, and `inst` is the deepest ancestor that does.
  3636. for (; parents.length; inst = parents.pop()) {
  3637. precacheChildNodes(inst, inst._nativeNode);
  3638. }
  3639. return inst._nativeNode;
  3640. }
  3641. var ReactDOMComponentTree = {
  3642. getClosestInstanceFromNode: getClosestInstanceFromNode,
  3643. getInstanceFromNode: getInstanceFromNode,
  3644. getNodeFromInstance: getNodeFromInstance,
  3645. precacheChildNodes: precacheChildNodes,
  3646. precacheNode: precacheNode,
  3647. uncacheNode: uncacheNode
  3648. };
  3649. module.exports = ReactDOMComponentTree;
  3650. /***/ },
  3651. /* 37 */
  3652. /***/ function(module, exports, __webpack_require__) {
  3653. /**
  3654. * Copyright 2013-present, Facebook, Inc.
  3655. * All rights reserved.
  3656. *
  3657. * This source code is licensed under the BSD-style license found in the
  3658. * LICENSE file in the root directory of this source tree. An additional grant
  3659. * of patent rights can be found in the PATENTS file in the same directory.
  3660. *
  3661. * @providesModule DOMProperty
  3662. */
  3663. 'use strict';
  3664. var invariant = __webpack_require__(6);
  3665. function checkMask(value, bitmask) {
  3666. return (value & bitmask) === bitmask;
  3667. }
  3668. var DOMPropertyInjection = {
  3669. /**
  3670. * Mapping from normalized, camelcased property names to a configuration that
  3671. * specifies how the associated DOM property should be accessed or rendered.
  3672. */
  3673. MUST_USE_PROPERTY: 0x1,
  3674. HAS_SIDE_EFFECTS: 0x2,
  3675. HAS_BOOLEAN_VALUE: 0x4,
  3676. HAS_NUMERIC_VALUE: 0x8,
  3677. HAS_POSITIVE_NUMERIC_VALUE: 0x10 | 0x8,
  3678. HAS_OVERLOADED_BOOLEAN_VALUE: 0x20,
  3679. /**
  3680. * Inject some specialized knowledge about the DOM. This takes a config object
  3681. * with the following properties:
  3682. *
  3683. * isCustomAttribute: function that given an attribute name will return true
  3684. * if it can be inserted into the DOM verbatim. Useful for data-* or aria-*
  3685. * attributes where it's impossible to enumerate all of the possible
  3686. * attribute names,
  3687. *
  3688. * Properties: object mapping DOM property name to one of the
  3689. * DOMPropertyInjection constants or null. If your attribute isn't in here,
  3690. * it won't get written to the DOM.
  3691. *
  3692. * DOMAttributeNames: object mapping React attribute name to the DOM
  3693. * attribute name. Attribute names not specified use the **lowercase**
  3694. * normalized name.
  3695. *
  3696. * DOMAttributeNamespaces: object mapping React attribute name to the DOM
  3697. * attribute namespace URL. (Attribute names not specified use no namespace.)
  3698. *
  3699. * DOMPropertyNames: similar to DOMAttributeNames but for DOM properties.
  3700. * Property names not specified use the normalized name.
  3701. *
  3702. * DOMMutationMethods: Properties that require special mutation methods. If
  3703. * `value` is undefined, the mutation method should unset the property.
  3704. *
  3705. * @param {object} domPropertyConfig the config as described above.
  3706. */
  3707. injectDOMPropertyConfig: function (domPropertyConfig) {
  3708. var Injection = DOMPropertyInjection;
  3709. var Properties = domPropertyConfig.Properties || {};
  3710. var DOMAttributeNamespaces = domPropertyConfig.DOMAttributeNamespaces || {};
  3711. var DOMAttributeNames = domPropertyConfig.DOMAttributeNames || {};
  3712. var DOMPropertyNames = domPropertyConfig.DOMPropertyNames || {};
  3713. var DOMMutationMethods = domPropertyConfig.DOMMutationMethods || {};
  3714. if (domPropertyConfig.isCustomAttribute) {
  3715. DOMProperty._isCustomAttributeFunctions.push(domPropertyConfig.isCustomAttribute);
  3716. }
  3717. for (var propName in Properties) {
  3718. !!DOMProperty.properties.hasOwnProperty(propName) ? false ? invariant(false, 'injectDOMPropertyConfig(...): You\'re trying to inject DOM property ' + '\'%s\' which has already been injected. You may be accidentally ' + 'injecting the same DOM property config twice, or you may be ' + 'injecting two configs that have conflicting property names.', propName) : invariant(false) : void 0;
  3719. var lowerCased = propName.toLowerCase();
  3720. var propConfig = Properties[propName];
  3721. var propertyInfo = {
  3722. attributeName: lowerCased,
  3723. attributeNamespace: null,
  3724. propertyName: propName,
  3725. mutationMethod: null,
  3726. mustUseProperty: checkMask(propConfig, Injection.MUST_USE_PROPERTY),
  3727. hasSideEffects: checkMask(propConfig, Injection.HAS_SIDE_EFFECTS),
  3728. hasBooleanValue: checkMask(propConfig, Injection.HAS_BOOLEAN_VALUE),
  3729. hasNumericValue: checkMask(propConfig, Injection.HAS_NUMERIC_VALUE),
  3730. hasPositiveNumericValue: checkMask(propConfig, Injection.HAS_POSITIVE_NUMERIC_VALUE),
  3731. hasOverloadedBooleanValue: checkMask(propConfig, Injection.HAS_OVERLOADED_BOOLEAN_VALUE)
  3732. };
  3733. !(propertyInfo.mustUseProperty || !propertyInfo.hasSideEffects) ? false ? invariant(false, 'DOMProperty: Properties that have side effects must use property: %s', propName) : invariant(false) : void 0;
  3734. !(propertyInfo.hasBooleanValue + propertyInfo.hasNumericValue + propertyInfo.hasOverloadedBooleanValue <= 1) ? false ? invariant(false, 'DOMProperty: Value can be one of boolean, overloaded boolean, or ' + 'numeric value, but not a combination: %s', propName) : invariant(false) : void 0;
  3735. if (false) {
  3736. DOMProperty.getPossibleStandardName[lowerCased] = propName;
  3737. }
  3738. if (DOMAttributeNames.hasOwnProperty(propName)) {
  3739. var attributeName = DOMAttributeNames[propName];
  3740. propertyInfo.attributeName = attributeName;
  3741. if (false) {
  3742. DOMProperty.getPossibleStandardName[attributeName] = propName;
  3743. }
  3744. }
  3745. if (DOMAttributeNamespaces.hasOwnProperty(propName)) {
  3746. propertyInfo.attributeNamespace = DOMAttributeNamespaces[propName];
  3747. }
  3748. if (DOMPropertyNames.hasOwnProperty(propName)) {
  3749. propertyInfo.propertyName = DOMPropertyNames[propName];
  3750. }
  3751. if (DOMMutationMethods.hasOwnProperty(propName)) {
  3752. propertyInfo.mutationMethod = DOMMutationMethods[propName];
  3753. }
  3754. DOMProperty.properties[propName] = propertyInfo;
  3755. }
  3756. }
  3757. };
  3758. /* eslint-disable max-len */
  3759. var ATTRIBUTE_NAME_START_CHAR = ':A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD';
  3760. /* eslint-enable max-len */
  3761. /**
  3762. * DOMProperty exports lookup objects that can be used like functions:
  3763. *
  3764. * > DOMProperty.isValid['id']
  3765. * true
  3766. * > DOMProperty.isValid['foobar']
  3767. * undefined
  3768. *
  3769. * Although this may be confusing, it performs better in general.
  3770. *
  3771. * @see http://jsperf.com/key-exists
  3772. * @see http://jsperf.com/key-missing
  3773. */
  3774. var DOMProperty = {
  3775. ID_ATTRIBUTE_NAME: 'data-reactid',
  3776. ROOT_ATTRIBUTE_NAME: 'data-reactroot',
  3777. ATTRIBUTE_NAME_START_CHAR: ATTRIBUTE_NAME_START_CHAR,
  3778. ATTRIBUTE_NAME_CHAR: ATTRIBUTE_NAME_START_CHAR + '\\-.0-9\\uB7\\u0300-\\u036F\\u203F-\\u2040',
  3779. /**
  3780. * Map from property "standard name" to an object with info about how to set
  3781. * the property in the DOM. Each object contains:
  3782. *
  3783. * attributeName:
  3784. * Used when rendering markup or with `*Attribute()`.
  3785. * attributeNamespace
  3786. * propertyName:
  3787. * Used on DOM node instances. (This includes properties that mutate due to
  3788. * external factors.)
  3789. * mutationMethod:
  3790. * If non-null, used instead of the property or `setAttribute()` after
  3791. * initial render.
  3792. * mustUseProperty:
  3793. * Whether the property must be accessed and mutated as an object property.
  3794. * hasSideEffects:
  3795. * Whether or not setting a value causes side effects such as triggering
  3796. * resources to be loaded or text selection changes. If true, we read from
  3797. * the DOM before updating to ensure that the value is only set if it has
  3798. * changed.
  3799. * hasBooleanValue:
  3800. * Whether the property should be removed when set to a falsey value.
  3801. * hasNumericValue:
  3802. * Whether the property must be numeric or parse as a numeric and should be
  3803. * removed when set to a falsey value.
  3804. * hasPositiveNumericValue:
  3805. * Whether the property must be positive numeric or parse as a positive
  3806. * numeric and should be removed when set to a falsey value.
  3807. * hasOverloadedBooleanValue:
  3808. * Whether the property can be used as a flag as well as with a value.
  3809. * Removed when strictly equal to false; present without a value when
  3810. * strictly equal to true; present with a value otherwise.
  3811. */
  3812. properties: {},
  3813. /**
  3814. * Mapping from lowercase property names to the properly cased version, used
  3815. * to warn in the case of missing properties. Available only in __DEV__.
  3816. * @type {Object}
  3817. */
  3818. getPossibleStandardName: false ? {} : null,
  3819. /**
  3820. * All of the isCustomAttribute() functions that have been injected.
  3821. */
  3822. _isCustomAttributeFunctions: [],
  3823. /**
  3824. * Checks whether a property name is a custom attribute.
  3825. * @method
  3826. */
  3827. isCustomAttribute: function (attributeName) {
  3828. for (var i = 0; i < DOMProperty._isCustomAttributeFunctions.length; i++) {
  3829. var isCustomAttributeFn = DOMProperty._isCustomAttributeFunctions[i];
  3830. if (isCustomAttributeFn(attributeName)) {
  3831. return true;
  3832. }
  3833. }
  3834. return false;
  3835. },
  3836. injection: DOMPropertyInjection
  3837. };
  3838. module.exports = DOMProperty;
  3839. /***/ },
  3840. /* 38 */
  3841. /***/ function(module, exports) {
  3842. /**
  3843. * Copyright 2015-present, Facebook, Inc.
  3844. * All rights reserved.
  3845. *
  3846. * This source code is licensed under the BSD-style license found in the
  3847. * LICENSE file in the root directory of this source tree. An additional grant
  3848. * of patent rights can be found in the PATENTS file in the same directory.
  3849. *
  3850. * @providesModule ReactDOMComponentFlags
  3851. */
  3852. 'use strict';
  3853. var ReactDOMComponentFlags = {
  3854. hasCachedChildNodes: 1 << 0
  3855. };
  3856. module.exports = ReactDOMComponentFlags;
  3857. /***/ },
  3858. /* 39 */
  3859. /***/ function(module, exports, __webpack_require__) {
  3860. /**
  3861. * Copyright 2013-present, Facebook, Inc.
  3862. * All rights reserved.
  3863. *
  3864. * This source code is licensed under the BSD-style license found in the
  3865. * LICENSE file in the root directory of this source tree. An additional grant
  3866. * of patent rights can be found in the PATENTS file in the same directory.
  3867. *
  3868. * @providesModule ReactDefaultInjection
  3869. */
  3870. 'use strict';
  3871. var BeforeInputEventPlugin = __webpack_require__(40);
  3872. var ChangeEventPlugin = __webpack_require__(54);
  3873. var DefaultEventPluginOrder = __webpack_require__(65);
  3874. var EnterLeaveEventPlugin = __webpack_require__(66);
  3875. var HTMLDOMPropertyConfig = __webpack_require__(71);
  3876. var ReactComponentBrowserEnvironment = __webpack_require__(72);
  3877. var ReactDOMComponent = __webpack_require__(86);
  3878. var ReactDOMComponentTree = __webpack_require__(36);
  3879. var ReactDOMEmptyComponent = __webpack_require__(127);
  3880. var ReactDOMTreeTraversal = __webpack_require__(128);
  3881. var ReactDOMTextComponent = __webpack_require__(129);
  3882. var ReactDefaultBatchingStrategy = __webpack_require__(130);
  3883. var ReactEventListener = __webpack_require__(131);
  3884. var ReactInjection = __webpack_require__(134);
  3885. var ReactReconcileTransaction = __webpack_require__(135);
  3886. var SVGDOMPropertyConfig = __webpack_require__(143);
  3887. var SelectEventPlugin = __webpack_require__(144);
  3888. var SimpleEventPlugin = __webpack_require__(145);
  3889. var alreadyInjected = false;
  3890. function inject() {
  3891. if (alreadyInjected) {
  3892. // TODO: This is currently true because these injections are shared between
  3893. // the client and the server package. They should be built independently
  3894. // and not share any injection state. Then this problem will be solved.
  3895. return;
  3896. }
  3897. alreadyInjected = true;
  3898. ReactInjection.EventEmitter.injectReactEventListener(ReactEventListener);
  3899. /**
  3900. * Inject modules for resolving DOM hierarchy and plugin ordering.
  3901. */
  3902. ReactInjection.EventPluginHub.injectEventPluginOrder(DefaultEventPluginOrder);
  3903. ReactInjection.EventPluginUtils.injectComponentTree(ReactDOMComponentTree);
  3904. ReactInjection.EventPluginUtils.injectTreeTraversal(ReactDOMTreeTraversal);
  3905. /**
  3906. * Some important event plugins included by default (without having to require
  3907. * them).
  3908. */
  3909. ReactInjection.EventPluginHub.injectEventPluginsByName({
  3910. SimpleEventPlugin: SimpleEventPlugin,
  3911. EnterLeaveEventPlugin: EnterLeaveEventPlugin,
  3912. ChangeEventPlugin: ChangeEventPlugin,
  3913. SelectEventPlugin: SelectEventPlugin,
  3914. BeforeInputEventPlugin: BeforeInputEventPlugin
  3915. });
  3916. ReactInjection.NativeComponent.injectGenericComponentClass(ReactDOMComponent);
  3917. ReactInjection.NativeComponent.injectTextComponentClass(ReactDOMTextComponent);
  3918. ReactInjection.DOMProperty.injectDOMPropertyConfig(HTMLDOMPropertyConfig);
  3919. ReactInjection.DOMProperty.injectDOMPropertyConfig(SVGDOMPropertyConfig);
  3920. ReactInjection.EmptyComponent.injectEmptyComponentFactory(function (instantiate) {
  3921. return new ReactDOMEmptyComponent(instantiate);
  3922. });
  3923. ReactInjection.Updates.injectReconcileTransaction(ReactReconcileTransaction);
  3924. ReactInjection.Updates.injectBatchingStrategy(ReactDefaultBatchingStrategy);
  3925. ReactInjection.Component.injectEnvironment(ReactComponentBrowserEnvironment);
  3926. }
  3927. module.exports = {
  3928. inject: inject
  3929. };
  3930. /***/ },
  3931. /* 40 */
  3932. /***/ function(module, exports, __webpack_require__) {
  3933. /**
  3934. * Copyright 2013-present Facebook, Inc.
  3935. * All rights reserved.
  3936. *
  3937. * This source code is licensed under the BSD-style license found in the
  3938. * LICENSE file in the root directory of this source tree. An additional grant
  3939. * of patent rights can be found in the PATENTS file in the same directory.
  3940. *
  3941. * @providesModule BeforeInputEventPlugin
  3942. */
  3943. 'use strict';
  3944. var EventConstants = __webpack_require__(41);
  3945. var EventPropagators = __webpack_require__(42);
  3946. var ExecutionEnvironment = __webpack_require__(19);
  3947. var FallbackCompositionState = __webpack_require__(49);
  3948. var SyntheticCompositionEvent = __webpack_require__(51);
  3949. var SyntheticInputEvent = __webpack_require__(53);
  3950. var keyOf = __webpack_require__(27);
  3951. var END_KEYCODES = [9, 13, 27, 32]; // Tab, Return, Esc, Space
  3952. var START_KEYCODE = 229;
  3953. var canUseCompositionEvent = ExecutionEnvironment.canUseDOM && 'CompositionEvent' in window;
  3954. var documentMode = null;
  3955. if (ExecutionEnvironment.canUseDOM && 'documentMode' in document) {
  3956. documentMode = document.documentMode;
  3957. }
  3958. // Webkit offers a very useful `textInput` event that can be used to
  3959. // directly represent `beforeInput`. The IE `textinput` event is not as
  3960. // useful, so we don't use it.
  3961. var canUseTextInputEvent = ExecutionEnvironment.canUseDOM && 'TextEvent' in window && !documentMode && !isPresto();
  3962. // In IE9+, we have access to composition events, but the data supplied
  3963. // by the native compositionend event may be incorrect. Japanese ideographic
  3964. // spaces, for instance (\u3000) are not recorded correctly.
  3965. var useFallbackCompositionData = ExecutionEnvironment.canUseDOM && (!canUseCompositionEvent || documentMode && documentMode > 8 && documentMode <= 11);
  3966. /**
  3967. * Opera <= 12 includes TextEvent in window, but does not fire
  3968. * text input events. Rely on keypress instead.
  3969. */
  3970. function isPresto() {
  3971. var opera = window.opera;
  3972. return typeof opera === 'object' && typeof opera.version === 'function' && parseInt(opera.version(), 10) <= 12;
  3973. }
  3974. var SPACEBAR_CODE = 32;
  3975. var SPACEBAR_CHAR = String.fromCharCode(SPACEBAR_CODE);
  3976. var topLevelTypes = EventConstants.topLevelTypes;
  3977. // Events and their corresponding property names.
  3978. var eventTypes = {
  3979. beforeInput: {
  3980. phasedRegistrationNames: {
  3981. bubbled: keyOf({ onBeforeInput: null }),
  3982. captured: keyOf({ onBeforeInputCapture: null })
  3983. },
  3984. dependencies: [topLevelTypes.topCompositionEnd, topLevelTypes.topKeyPress, topLevelTypes.topTextInput, topLevelTypes.topPaste]
  3985. },
  3986. compositionEnd: {
  3987. phasedRegistrationNames: {
  3988. bubbled: keyOf({ onCompositionEnd: null }),
  3989. captured: keyOf({ onCompositionEndCapture: null })
  3990. },
  3991. dependencies: [topLevelTypes.topBlur, topLevelTypes.topCompositionEnd, topLevelTypes.topKeyDown, topLevelTypes.topKeyPress, topLevelTypes.topKeyUp, topLevelTypes.topMouseDown]
  3992. },
  3993. compositionStart: {
  3994. phasedRegistrationNames: {
  3995. bubbled: keyOf({ onCompositionStart: null }),
  3996. captured: keyOf({ onCompositionStartCapture: null })
  3997. },
  3998. dependencies: [topLevelTypes.topBlur, topLevelTypes.topCompositionStart, topLevelTypes.topKeyDown, topLevelTypes.topKeyPress, topLevelTypes.topKeyUp, topLevelTypes.topMouseDown]
  3999. },
  4000. compositionUpdate: {
  4001. phasedRegistrationNames: {
  4002. bubbled: keyOf({ onCompositionUpdate: null }),
  4003. captured: keyOf({ onCompositionUpdateCapture: null })
  4004. },
  4005. dependencies: [topLevelTypes.topBlur, topLevelTypes.topCompositionUpdate, topLevelTypes.topKeyDown, topLevelTypes.topKeyPress, topLevelTypes.topKeyUp, topLevelTypes.topMouseDown]
  4006. }
  4007. };
  4008. // Track whether we've ever handled a keypress on the space key.
  4009. var hasSpaceKeypress = false;
  4010. /**
  4011. * Return whether a native keypress event is assumed to be a command.
  4012. * This is required because Firefox fires `keypress` events for key commands
  4013. * (cut, copy, select-all, etc.) even though no character is inserted.
  4014. */
  4015. function isKeypressCommand(nativeEvent) {
  4016. return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&
  4017. // ctrlKey && altKey is equivalent to AltGr, and is not a command.
  4018. !(nativeEvent.ctrlKey && nativeEvent.altKey);
  4019. }
  4020. /**
  4021. * Translate native top level events into event types.
  4022. *
  4023. * @param {string} topLevelType
  4024. * @return {object}
  4025. */
  4026. function getCompositionEventType(topLevelType) {
  4027. switch (topLevelType) {
  4028. case topLevelTypes.topCompositionStart:
  4029. return eventTypes.compositionStart;
  4030. case topLevelTypes.topCompositionEnd:
  4031. return eventTypes.compositionEnd;
  4032. case topLevelTypes.topCompositionUpdate:
  4033. return eventTypes.compositionUpdate;
  4034. }
  4035. }
  4036. /**
  4037. * Does our fallback best-guess model think this event signifies that
  4038. * composition has begun?
  4039. *
  4040. * @param {string} topLevelType
  4041. * @param {object} nativeEvent
  4042. * @return {boolean}
  4043. */
  4044. function isFallbackCompositionStart(topLevelType, nativeEvent) {
  4045. return topLevelType === topLevelTypes.topKeyDown && nativeEvent.keyCode === START_KEYCODE;
  4046. }
  4047. /**
  4048. * Does our fallback mode think that this event is the end of composition?
  4049. *
  4050. * @param {string} topLevelType
  4051. * @param {object} nativeEvent
  4052. * @return {boolean}
  4053. */
  4054. function isFallbackCompositionEnd(topLevelType, nativeEvent) {
  4055. switch (topLevelType) {
  4056. case topLevelTypes.topKeyUp:
  4057. // Command keys insert or clear IME input.
  4058. return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1;
  4059. case topLevelTypes.topKeyDown:
  4060. // Expect IME keyCode on each keydown. If we get any other
  4061. // code we must have exited earlier.
  4062. return nativeEvent.keyCode !== START_KEYCODE;
  4063. case topLevelTypes.topKeyPress:
  4064. case topLevelTypes.topMouseDown:
  4065. case topLevelTypes.topBlur:
  4066. // Events are not possible without cancelling IME.
  4067. return true;
  4068. default:
  4069. return false;
  4070. }
  4071. }
  4072. /**
  4073. * Google Input Tools provides composition data via a CustomEvent,
  4074. * with the `data` property populated in the `detail` object. If this
  4075. * is available on the event object, use it. If not, this is a plain
  4076. * composition event and we have nothing special to extract.
  4077. *
  4078. * @param {object} nativeEvent
  4079. * @return {?string}
  4080. */
  4081. function getDataFromCustomEvent(nativeEvent) {
  4082. var detail = nativeEvent.detail;
  4083. if (typeof detail === 'object' && 'data' in detail) {
  4084. return detail.data;
  4085. }
  4086. return null;
  4087. }
  4088. // Track the current IME composition fallback object, if any.
  4089. var currentComposition = null;
  4090. /**
  4091. * @return {?object} A SyntheticCompositionEvent.
  4092. */
  4093. function extractCompositionEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget) {
  4094. var eventType;
  4095. var fallbackData;
  4096. if (canUseCompositionEvent) {
  4097. eventType = getCompositionEventType(topLevelType);
  4098. } else if (!currentComposition) {
  4099. if (isFallbackCompositionStart(topLevelType, nativeEvent)) {
  4100. eventType = eventTypes.compositionStart;
  4101. }
  4102. } else if (isFallbackCompositionEnd(topLevelType, nativeEvent)) {
  4103. eventType = eventTypes.compositionEnd;
  4104. }
  4105. if (!eventType) {
  4106. return null;
  4107. }
  4108. if (useFallbackCompositionData) {
  4109. // The current composition is stored statically and must not be
  4110. // overwritten while composition continues.
  4111. if (!currentComposition && eventType === eventTypes.compositionStart) {
  4112. currentComposition = FallbackCompositionState.getPooled(nativeEventTarget);
  4113. } else if (eventType === eventTypes.compositionEnd) {
  4114. if (currentComposition) {
  4115. fallbackData = currentComposition.getData();
  4116. }
  4117. }
  4118. }
  4119. var event = SyntheticCompositionEvent.getPooled(eventType, targetInst, nativeEvent, nativeEventTarget);
  4120. if (fallbackData) {
  4121. // Inject data generated from fallback path into the synthetic event.
  4122. // This matches the property of native CompositionEventInterface.
  4123. event.data = fallbackData;
  4124. } else {
  4125. var customData = getDataFromCustomEvent(nativeEvent);
  4126. if (customData !== null) {
  4127. event.data = customData;
  4128. }
  4129. }
  4130. EventPropagators.accumulateTwoPhaseDispatches(event);
  4131. return event;
  4132. }
  4133. /**
  4134. * @param {string} topLevelType Record from `EventConstants`.
  4135. * @param {object} nativeEvent Native browser event.
  4136. * @return {?string} The string corresponding to this `beforeInput` event.
  4137. */
  4138. function getNativeBeforeInputChars(topLevelType, nativeEvent) {
  4139. switch (topLevelType) {
  4140. case topLevelTypes.topCompositionEnd:
  4141. return getDataFromCustomEvent(nativeEvent);
  4142. case topLevelTypes.topKeyPress:
  4143. /**
  4144. * If native `textInput` events are available, our goal is to make
  4145. * use of them. However, there is a special case: the spacebar key.
  4146. * In Webkit, preventing default on a spacebar `textInput` event
  4147. * cancels character insertion, but it *also* causes the browser
  4148. * to fall back to its default spacebar behavior of scrolling the
  4149. * page.
  4150. *
  4151. * Tracking at:
  4152. * https://code.google.com/p/chromium/issues/detail?id=355103
  4153. *
  4154. * To avoid this issue, use the keypress event as if no `textInput`
  4155. * event is available.
  4156. */
  4157. var which = nativeEvent.which;
  4158. if (which !== SPACEBAR_CODE) {
  4159. return null;
  4160. }
  4161. hasSpaceKeypress = true;
  4162. return SPACEBAR_CHAR;
  4163. case topLevelTypes.topTextInput:
  4164. // Record the characters to be added to the DOM.
  4165. var chars = nativeEvent.data;
  4166. // If it's a spacebar character, assume that we have already handled
  4167. // it at the keypress level and bail immediately. Android Chrome
  4168. // doesn't give us keycodes, so we need to blacklist it.
  4169. if (chars === SPACEBAR_CHAR && hasSpaceKeypress) {
  4170. return null;
  4171. }
  4172. return chars;
  4173. default:
  4174. // For other native event types, do nothing.
  4175. return null;
  4176. }
  4177. }
  4178. /**
  4179. * For browsers that do not provide the `textInput` event, extract the
  4180. * appropriate string to use for SyntheticInputEvent.
  4181. *
  4182. * @param {string} topLevelType Record from `EventConstants`.
  4183. * @param {object} nativeEvent Native browser event.
  4184. * @return {?string} The fallback string for this `beforeInput` event.
  4185. */
  4186. function getFallbackBeforeInputChars(topLevelType, nativeEvent) {
  4187. // If we are currently composing (IME) and using a fallback to do so,
  4188. // try to extract the composed characters from the fallback object.
  4189. if (currentComposition) {
  4190. if (topLevelType === topLevelTypes.topCompositionEnd || isFallbackCompositionEnd(topLevelType, nativeEvent)) {
  4191. var chars = currentComposition.getData();
  4192. FallbackCompositionState.release(currentComposition);
  4193. currentComposition = null;
  4194. return chars;
  4195. }
  4196. return null;
  4197. }
  4198. switch (topLevelType) {
  4199. case topLevelTypes.topPaste:
  4200. // If a paste event occurs after a keypress, throw out the input
  4201. // chars. Paste events should not lead to BeforeInput events.
  4202. return null;
  4203. case topLevelTypes.topKeyPress:
  4204. /**
  4205. * As of v27, Firefox may fire keypress events even when no character
  4206. * will be inserted. A few possibilities:
  4207. *
  4208. * - `which` is `0`. Arrow keys, Esc key, etc.
  4209. *
  4210. * - `which` is the pressed key code, but no char is available.
  4211. * Ex: 'AltGr + d` in Polish. There is no modified character for
  4212. * this key combination and no character is inserted into the
  4213. * document, but FF fires the keypress for char code `100` anyway.
  4214. * No `input` event will occur.
  4215. *
  4216. * - `which` is the pressed key code, but a command combination is
  4217. * being used. Ex: `Cmd+C`. No character is inserted, and no
  4218. * `input` event will occur.
  4219. */
  4220. if (nativeEvent.which && !isKeypressCommand(nativeEvent)) {
  4221. return String.fromCharCode(nativeEvent.which);
  4222. }
  4223. return null;
  4224. case topLevelTypes.topCompositionEnd:
  4225. return useFallbackCompositionData ? null : nativeEvent.data;
  4226. default:
  4227. return null;
  4228. }
  4229. }
  4230. /**
  4231. * Extract a SyntheticInputEvent for `beforeInput`, based on either native
  4232. * `textInput` or fallback behavior.
  4233. *
  4234. * @return {?object} A SyntheticInputEvent.
  4235. */
  4236. function extractBeforeInputEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget) {
  4237. var chars;
  4238. if (canUseTextInputEvent) {
  4239. chars = getNativeBeforeInputChars(topLevelType, nativeEvent);
  4240. } else {
  4241. chars = getFallbackBeforeInputChars(topLevelType, nativeEvent);
  4242. }
  4243. // If no characters are being inserted, no BeforeInput event should
  4244. // be fired.
  4245. if (!chars) {
  4246. return null;
  4247. }
  4248. var event = SyntheticInputEvent.getPooled(eventTypes.beforeInput, targetInst, nativeEvent, nativeEventTarget);
  4249. event.data = chars;
  4250. EventPropagators.accumulateTwoPhaseDispatches(event);
  4251. return event;
  4252. }
  4253. /**
  4254. * Create an `onBeforeInput` event to match
  4255. * http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105/#events-inputevents.
  4256. *
  4257. * This event plugin is based on the native `textInput` event
  4258. * available in Chrome, Safari, Opera, and IE. This event fires after
  4259. * `onKeyPress` and `onCompositionEnd`, but before `onInput`.
  4260. *
  4261. * `beforeInput` is spec'd but not implemented in any browsers, and
  4262. * the `input` event does not provide any useful information about what has
  4263. * actually been added, contrary to the spec. Thus, `textInput` is the best
  4264. * available event to identify the characters that have actually been inserted
  4265. * into the target node.
  4266. *
  4267. * This plugin is also responsible for emitting `composition` events, thus
  4268. * allowing us to share composition fallback code for both `beforeInput` and
  4269. * `composition` event types.
  4270. */
  4271. var BeforeInputEventPlugin = {
  4272. eventTypes: eventTypes,
  4273. extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
  4274. return [extractCompositionEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget), extractBeforeInputEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget)];
  4275. }
  4276. };
  4277. module.exports = BeforeInputEventPlugin;
  4278. /***/ },
  4279. /* 41 */
  4280. /***/ function(module, exports, __webpack_require__) {
  4281. /**
  4282. * Copyright 2013-present, Facebook, Inc.
  4283. * All rights reserved.
  4284. *
  4285. * This source code is licensed under the BSD-style license found in the
  4286. * LICENSE file in the root directory of this source tree. An additional grant
  4287. * of patent rights can be found in the PATENTS file in the same directory.
  4288. *
  4289. * @providesModule EventConstants
  4290. */
  4291. 'use strict';
  4292. var keyMirror = __webpack_require__(25);
  4293. var PropagationPhases = keyMirror({ bubbled: null, captured: null });
  4294. /**
  4295. * Types of raw signals from the browser caught at the top level.
  4296. */
  4297. var topLevelTypes = keyMirror({
  4298. topAbort: null,
  4299. topAnimationEnd: null,
  4300. topAnimationIteration: null,
  4301. topAnimationStart: null,
  4302. topBlur: null,
  4303. topCanPlay: null,
  4304. topCanPlayThrough: null,
  4305. topChange: null,
  4306. topClick: null,
  4307. topCompositionEnd: null,
  4308. topCompositionStart: null,
  4309. topCompositionUpdate: null,
  4310. topContextMenu: null,
  4311. topCopy: null,
  4312. topCut: null,
  4313. topDoubleClick: null,
  4314. topDrag: null,
  4315. topDragEnd: null,
  4316. topDragEnter: null,
  4317. topDragExit: null,
  4318. topDragLeave: null,
  4319. topDragOver: null,
  4320. topDragStart: null,
  4321. topDrop: null,
  4322. topDurationChange: null,
  4323. topEmptied: null,
  4324. topEncrypted: null,
  4325. topEnded: null,
  4326. topError: null,
  4327. topFocus: null,
  4328. topInput: null,
  4329. topInvalid: null,
  4330. topKeyDown: null,
  4331. topKeyPress: null,
  4332. topKeyUp: null,
  4333. topLoad: null,
  4334. topLoadedData: null,
  4335. topLoadedMetadata: null,
  4336. topLoadStart: null,
  4337. topMouseDown: null,
  4338. topMouseMove: null,
  4339. topMouseOut: null,
  4340. topMouseOver: null,
  4341. topMouseUp: null,
  4342. topPaste: null,
  4343. topPause: null,
  4344. topPlay: null,
  4345. topPlaying: null,
  4346. topProgress: null,
  4347. topRateChange: null,
  4348. topReset: null,
  4349. topScroll: null,
  4350. topSeeked: null,
  4351. topSeeking: null,
  4352. topSelectionChange: null,
  4353. topStalled: null,
  4354. topSubmit: null,
  4355. topSuspend: null,
  4356. topTextInput: null,
  4357. topTimeUpdate: null,
  4358. topTouchCancel: null,
  4359. topTouchEnd: null,
  4360. topTouchMove: null,
  4361. topTouchStart: null,
  4362. topTransitionEnd: null,
  4363. topVolumeChange: null,
  4364. topWaiting: null,
  4365. topWheel: null
  4366. });
  4367. var EventConstants = {
  4368. topLevelTypes: topLevelTypes,
  4369. PropagationPhases: PropagationPhases
  4370. };
  4371. module.exports = EventConstants;
  4372. /***/ },
  4373. /* 42 */
  4374. /***/ function(module, exports, __webpack_require__) {
  4375. /**
  4376. * Copyright 2013-present, Facebook, Inc.
  4377. * All rights reserved.
  4378. *
  4379. * This source code is licensed under the BSD-style license found in the
  4380. * LICENSE file in the root directory of this source tree. An additional grant
  4381. * of patent rights can be found in the PATENTS file in the same directory.
  4382. *
  4383. * @providesModule EventPropagators
  4384. */
  4385. 'use strict';
  4386. var EventConstants = __webpack_require__(41);
  4387. var EventPluginHub = __webpack_require__(43);
  4388. var EventPluginUtils = __webpack_require__(45);
  4389. var accumulateInto = __webpack_require__(47);
  4390. var forEachAccumulated = __webpack_require__(48);
  4391. var warning = __webpack_require__(9);
  4392. var PropagationPhases = EventConstants.PropagationPhases;
  4393. var getListener = EventPluginHub.getListener;
  4394. /**
  4395. * Some event types have a notion of different registration names for different
  4396. * "phases" of propagation. This finds listeners by a given phase.
  4397. */
  4398. function listenerAtPhase(inst, event, propagationPhase) {
  4399. var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];
  4400. return getListener(inst, registrationName);
  4401. }
  4402. /**
  4403. * Tags a `SyntheticEvent` with dispatched listeners. Creating this function
  4404. * here, allows us to not have to bind or create functions for each event.
  4405. * Mutating the event's members allows us to not have to create a wrapping
  4406. * "dispatch" object that pairs the event with the listener.
  4407. */
  4408. function accumulateDirectionalDispatches(inst, upwards, event) {
  4409. if (false) {
  4410. process.env.NODE_ENV !== 'production' ? warning(inst, 'Dispatching inst must not be null') : void 0;
  4411. }
  4412. var phase = upwards ? PropagationPhases.bubbled : PropagationPhases.captured;
  4413. var listener = listenerAtPhase(inst, event, phase);
  4414. if (listener) {
  4415. event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);
  4416. event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);
  4417. }
  4418. }
  4419. /**
  4420. * Collect dispatches (must be entirely collected before dispatching - see unit
  4421. * tests). Lazily allocate the array to conserve memory. We must loop through
  4422. * each event and perform the traversal for each one. We cannot perform a
  4423. * single traversal for the entire collection of events because each event may
  4424. * have a different target.
  4425. */
  4426. function accumulateTwoPhaseDispatchesSingle(event) {
  4427. if (event && event.dispatchConfig.phasedRegistrationNames) {
  4428. EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);
  4429. }
  4430. }
  4431. /**
  4432. * Same as `accumulateTwoPhaseDispatchesSingle`, but skips over the targetID.
  4433. */
  4434. function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {
  4435. if (event && event.dispatchConfig.phasedRegistrationNames) {
  4436. var targetInst = event._targetInst;
  4437. var parentInst = targetInst ? EventPluginUtils.getParentInstance(targetInst) : null;
  4438. EventPluginUtils.traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);
  4439. }
  4440. }
  4441. /**
  4442. * Accumulates without regard to direction, does not look for phased
  4443. * registration names. Same as `accumulateDirectDispatchesSingle` but without
  4444. * requiring that the `dispatchMarker` be the same as the dispatched ID.
  4445. */
  4446. function accumulateDispatches(inst, ignoredDirection, event) {
  4447. if (event && event.dispatchConfig.registrationName) {
  4448. var registrationName = event.dispatchConfig.registrationName;
  4449. var listener = getListener(inst, registrationName);
  4450. if (listener) {
  4451. event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);
  4452. event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);
  4453. }
  4454. }
  4455. }
  4456. /**
  4457. * Accumulates dispatches on an `SyntheticEvent`, but only for the
  4458. * `dispatchMarker`.
  4459. * @param {SyntheticEvent} event
  4460. */
  4461. function accumulateDirectDispatchesSingle(event) {
  4462. if (event && event.dispatchConfig.registrationName) {
  4463. accumulateDispatches(event._targetInst, null, event);
  4464. }
  4465. }
  4466. function accumulateTwoPhaseDispatches(events) {
  4467. forEachAccumulated(events, accumulateTwoPhaseDispatchesSingle);
  4468. }
  4469. function accumulateTwoPhaseDispatchesSkipTarget(events) {
  4470. forEachAccumulated(events, accumulateTwoPhaseDispatchesSingleSkipTarget);
  4471. }
  4472. function accumulateEnterLeaveDispatches(leave, enter, from, to) {
  4473. EventPluginUtils.traverseEnterLeave(from, to, accumulateDispatches, leave, enter);
  4474. }
  4475. function accumulateDirectDispatches(events) {
  4476. forEachAccumulated(events, accumulateDirectDispatchesSingle);
  4477. }
  4478. /**
  4479. * A small set of propagation patterns, each of which will accept a small amount
  4480. * of information, and generate a set of "dispatch ready event objects" - which
  4481. * are sets of events that have already been annotated with a set of dispatched
  4482. * listener functions/ids. The API is designed this way to discourage these
  4483. * propagation strategies from actually executing the dispatches, since we
  4484. * always want to collect the entire set of dispatches before executing event a
  4485. * single one.
  4486. *
  4487. * @constructor EventPropagators
  4488. */
  4489. var EventPropagators = {
  4490. accumulateTwoPhaseDispatches: accumulateTwoPhaseDispatches,
  4491. accumulateTwoPhaseDispatchesSkipTarget: accumulateTwoPhaseDispatchesSkipTarget,
  4492. accumulateDirectDispatches: accumulateDirectDispatches,
  4493. accumulateEnterLeaveDispatches: accumulateEnterLeaveDispatches
  4494. };
  4495. module.exports = EventPropagators;
  4496. /***/ },
  4497. /* 43 */
  4498. /***/ function(module, exports, __webpack_require__) {
  4499. /**
  4500. * Copyright 2013-present, Facebook, Inc.
  4501. * All rights reserved.
  4502. *
  4503. * This source code is licensed under the BSD-style license found in the
  4504. * LICENSE file in the root directory of this source tree. An additional grant
  4505. * of patent rights can be found in the PATENTS file in the same directory.
  4506. *
  4507. * @providesModule EventPluginHub
  4508. */
  4509. 'use strict';
  4510. var EventPluginRegistry = __webpack_require__(44);
  4511. var EventPluginUtils = __webpack_require__(45);
  4512. var ReactErrorUtils = __webpack_require__(46);
  4513. var accumulateInto = __webpack_require__(47);
  4514. var forEachAccumulated = __webpack_require__(48);
  4515. var invariant = __webpack_require__(6);
  4516. /**
  4517. * Internal store for event listeners
  4518. */
  4519. var listenerBank = {};
  4520. /**
  4521. * Internal queue of events that have accumulated their dispatches and are
  4522. * waiting to have their dispatches executed.
  4523. */
  4524. var eventQueue = null;
  4525. /**
  4526. * Dispatches an event and releases it back into the pool, unless persistent.
  4527. *
  4528. * @param {?object} event Synthetic event to be dispatched.
  4529. * @param {boolean} simulated If the event is simulated (changes exn behavior)
  4530. * @private
  4531. */
  4532. var executeDispatchesAndRelease = function (event, simulated) {
  4533. if (event) {
  4534. EventPluginUtils.executeDispatchesInOrder(event, simulated);
  4535. if (!event.isPersistent()) {
  4536. event.constructor.release(event);
  4537. }
  4538. }
  4539. };
  4540. var executeDispatchesAndReleaseSimulated = function (e) {
  4541. return executeDispatchesAndRelease(e, true);
  4542. };
  4543. var executeDispatchesAndReleaseTopLevel = function (e) {
  4544. return executeDispatchesAndRelease(e, false);
  4545. };
  4546. /**
  4547. * This is a unified interface for event plugins to be installed and configured.
  4548. *
  4549. * Event plugins can implement the following properties:
  4550. *
  4551. * `extractEvents` {function(string, DOMEventTarget, string, object): *}
  4552. * Required. When a top-level event is fired, this method is expected to
  4553. * extract synthetic events that will in turn be queued and dispatched.
  4554. *
  4555. * `eventTypes` {object}
  4556. * Optional, plugins that fire events must publish a mapping of registration
  4557. * names that are used to register listeners. Values of this mapping must
  4558. * be objects that contain `registrationName` or `phasedRegistrationNames`.
  4559. *
  4560. * `executeDispatch` {function(object, function, string)}
  4561. * Optional, allows plugins to override how an event gets dispatched. By
  4562. * default, the listener is simply invoked.
  4563. *
  4564. * Each plugin that is injected into `EventsPluginHub` is immediately operable.
  4565. *
  4566. * @public
  4567. */
  4568. var EventPluginHub = {
  4569. /**
  4570. * Methods for injecting dependencies.
  4571. */
  4572. injection: {
  4573. /**
  4574. * @param {array} InjectedEventPluginOrder
  4575. * @public
  4576. */
  4577. injectEventPluginOrder: EventPluginRegistry.injectEventPluginOrder,
  4578. /**
  4579. * @param {object} injectedNamesToPlugins Map from names to plugin modules.
  4580. */
  4581. injectEventPluginsByName: EventPluginRegistry.injectEventPluginsByName
  4582. },
  4583. /**
  4584. * Stores `listener` at `listenerBank[registrationName][id]`. Is idempotent.
  4585. *
  4586. * @param {object} inst The instance, which is the source of events.
  4587. * @param {string} registrationName Name of listener (e.g. `onClick`).
  4588. * @param {function} listener The callback to store.
  4589. */
  4590. putListener: function (inst, registrationName, listener) {
  4591. !(typeof listener === 'function') ? false ? invariant(false, 'Expected %s listener to be a function, instead got type %s', registrationName, typeof listener) : invariant(false) : void 0;
  4592. var bankForRegistrationName = listenerBank[registrationName] || (listenerBank[registrationName] = {});
  4593. bankForRegistrationName[inst._rootNodeID] = listener;
  4594. var PluginModule = EventPluginRegistry.registrationNameModules[registrationName];
  4595. if (PluginModule && PluginModule.didPutListener) {
  4596. PluginModule.didPutListener(inst, registrationName, listener);
  4597. }
  4598. },
  4599. /**
  4600. * @param {object} inst The instance, which is the source of events.
  4601. * @param {string} registrationName Name of listener (e.g. `onClick`).
  4602. * @return {?function} The stored callback.
  4603. */
  4604. getListener: function (inst, registrationName) {
  4605. var bankForRegistrationName = listenerBank[registrationName];
  4606. return bankForRegistrationName && bankForRegistrationName[inst._rootNodeID];
  4607. },
  4608. /**
  4609. * Deletes a listener from the registration bank.
  4610. *
  4611. * @param {object} inst The instance, which is the source of events.
  4612. * @param {string} registrationName Name of listener (e.g. `onClick`).
  4613. */
  4614. deleteListener: function (inst, registrationName) {
  4615. var PluginModule = EventPluginRegistry.registrationNameModules[registrationName];
  4616. if (PluginModule && PluginModule.willDeleteListener) {
  4617. PluginModule.willDeleteListener(inst, registrationName);
  4618. }
  4619. var bankForRegistrationName = listenerBank[registrationName];
  4620. // TODO: This should never be null -- when is it?
  4621. if (bankForRegistrationName) {
  4622. delete bankForRegistrationName[inst._rootNodeID];
  4623. }
  4624. },
  4625. /**
  4626. * Deletes all listeners for the DOM element with the supplied ID.
  4627. *
  4628. * @param {object} inst The instance, which is the source of events.
  4629. */
  4630. deleteAllListeners: function (inst) {
  4631. for (var registrationName in listenerBank) {
  4632. if (!listenerBank[registrationName][inst._rootNodeID]) {
  4633. continue;
  4634. }
  4635. var PluginModule = EventPluginRegistry.registrationNameModules[registrationName];
  4636. if (PluginModule && PluginModule.willDeleteListener) {
  4637. PluginModule.willDeleteListener(inst, registrationName);
  4638. }
  4639. delete listenerBank[registrationName][inst._rootNodeID];
  4640. }
  4641. },
  4642. /**
  4643. * Allows registered plugins an opportunity to extract events from top-level
  4644. * native browser events.
  4645. *
  4646. * @return {*} An accumulation of synthetic events.
  4647. * @internal
  4648. */
  4649. extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
  4650. var events;
  4651. var plugins = EventPluginRegistry.plugins;
  4652. for (var i = 0; i < plugins.length; i++) {
  4653. // Not every plugin in the ordering may be loaded at runtime.
  4654. var possiblePlugin = plugins[i];
  4655. if (possiblePlugin) {
  4656. var extractedEvents = possiblePlugin.extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget);
  4657. if (extractedEvents) {
  4658. events = accumulateInto(events, extractedEvents);
  4659. }
  4660. }
  4661. }
  4662. return events;
  4663. },
  4664. /**
  4665. * Enqueues a synthetic event that should be dispatched when
  4666. * `processEventQueue` is invoked.
  4667. *
  4668. * @param {*} events An accumulation of synthetic events.
  4669. * @internal
  4670. */
  4671. enqueueEvents: function (events) {
  4672. if (events) {
  4673. eventQueue = accumulateInto(eventQueue, events);
  4674. }
  4675. },
  4676. /**
  4677. * Dispatches all synthetic events on the event queue.
  4678. *
  4679. * @internal
  4680. */
  4681. processEventQueue: function (simulated) {
  4682. // Set `eventQueue` to null before processing it so that we can tell if more
  4683. // events get enqueued while processing.
  4684. var processingEventQueue = eventQueue;
  4685. eventQueue = null;
  4686. if (simulated) {
  4687. forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseSimulated);
  4688. } else {
  4689. forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseTopLevel);
  4690. }
  4691. !!eventQueue ? false ? invariant(false, 'processEventQueue(): Additional events were enqueued while processing ' + 'an event queue. Support for this has not yet been implemented.') : invariant(false) : void 0;
  4692. // This would be a good time to rethrow if any of the event handlers threw.
  4693. ReactErrorUtils.rethrowCaughtError();
  4694. },
  4695. /**
  4696. * These are needed for tests only. Do not use!
  4697. */
  4698. __purge: function () {
  4699. listenerBank = {};
  4700. },
  4701. __getListenerBank: function () {
  4702. return listenerBank;
  4703. }
  4704. };
  4705. module.exports = EventPluginHub;
  4706. /***/ },
  4707. /* 44 */
  4708. /***/ function(module, exports, __webpack_require__) {
  4709. /**
  4710. * Copyright 2013-present, Facebook, Inc.
  4711. * All rights reserved.
  4712. *
  4713. * This source code is licensed under the BSD-style license found in the
  4714. * LICENSE file in the root directory of this source tree. An additional grant
  4715. * of patent rights can be found in the PATENTS file in the same directory.
  4716. *
  4717. * @providesModule EventPluginRegistry
  4718. */
  4719. 'use strict';
  4720. var invariant = __webpack_require__(6);
  4721. /**
  4722. * Injectable ordering of event plugins.
  4723. */
  4724. var EventPluginOrder = null;
  4725. /**
  4726. * Injectable mapping from names to event plugin modules.
  4727. */
  4728. var namesToPlugins = {};
  4729. /**
  4730. * Recomputes the plugin list using the injected plugins and plugin ordering.
  4731. *
  4732. * @private
  4733. */
  4734. function recomputePluginOrdering() {
  4735. if (!EventPluginOrder) {
  4736. // Wait until an `EventPluginOrder` is injected.
  4737. return;
  4738. }
  4739. for (var pluginName in namesToPlugins) {
  4740. var PluginModule = namesToPlugins[pluginName];
  4741. var pluginIndex = EventPluginOrder.indexOf(pluginName);
  4742. !(pluginIndex > -1) ? false ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in ' + 'the plugin ordering, `%s`.', pluginName) : invariant(false) : void 0;
  4743. if (EventPluginRegistry.plugins[pluginIndex]) {
  4744. continue;
  4745. }
  4746. !PluginModule.extractEvents ? false ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` ' + 'method, but `%s` does not.', pluginName) : invariant(false) : void 0;
  4747. EventPluginRegistry.plugins[pluginIndex] = PluginModule;
  4748. var publishedEvents = PluginModule.eventTypes;
  4749. for (var eventName in publishedEvents) {
  4750. !publishEventForPlugin(publishedEvents[eventName], PluginModule, eventName) ? false ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : invariant(false) : void 0;
  4751. }
  4752. }
  4753. }
  4754. /**
  4755. * Publishes an event so that it can be dispatched by the supplied plugin.
  4756. *
  4757. * @param {object} dispatchConfig Dispatch configuration for the event.
  4758. * @param {object} PluginModule Plugin publishing the event.
  4759. * @return {boolean} True if the event was successfully published.
  4760. * @private
  4761. */
  4762. function publishEventForPlugin(dispatchConfig, PluginModule, eventName) {
  4763. !!EventPluginRegistry.eventNameDispatchConfigs.hasOwnProperty(eventName) ? false ? invariant(false, 'EventPluginHub: More than one plugin attempted to publish the same ' + 'event name, `%s`.', eventName) : invariant(false) : void 0;
  4764. EventPluginRegistry.eventNameDispatchConfigs[eventName] = dispatchConfig;
  4765. var phasedRegistrationNames = dispatchConfig.phasedRegistrationNames;
  4766. if (phasedRegistrationNames) {
  4767. for (var phaseName in phasedRegistrationNames) {
  4768. if (phasedRegistrationNames.hasOwnProperty(phaseName)) {
  4769. var phasedRegistrationName = phasedRegistrationNames[phaseName];
  4770. publishRegistrationName(phasedRegistrationName, PluginModule, eventName);
  4771. }
  4772. }
  4773. return true;
  4774. } else if (dispatchConfig.registrationName) {
  4775. publishRegistrationName(dispatchConfig.registrationName, PluginModule, eventName);
  4776. return true;
  4777. }
  4778. return false;
  4779. }
  4780. /**
  4781. * Publishes a registration name that is used to identify dispatched events and
  4782. * can be used with `EventPluginHub.putListener` to register listeners.
  4783. *
  4784. * @param {string} registrationName Registration name to add.
  4785. * @param {object} PluginModule Plugin publishing the event.
  4786. * @private
  4787. */
  4788. function publishRegistrationName(registrationName, PluginModule, eventName) {
  4789. !!EventPluginRegistry.registrationNameModules[registrationName] ? false ? invariant(false, 'EventPluginHub: More than one plugin attempted to publish the same ' + 'registration name, `%s`.', registrationName) : invariant(false) : void 0;
  4790. EventPluginRegistry.registrationNameModules[registrationName] = PluginModule;
  4791. EventPluginRegistry.registrationNameDependencies[registrationName] = PluginModule.eventTypes[eventName].dependencies;
  4792. if (false) {
  4793. var lowerCasedName = registrationName.toLowerCase();
  4794. EventPluginRegistry.possibleRegistrationNames[lowerCasedName] = registrationName;
  4795. }
  4796. }
  4797. /**
  4798. * Registers plugins so that they can extract and dispatch events.
  4799. *
  4800. * @see {EventPluginHub}
  4801. */
  4802. var EventPluginRegistry = {
  4803. /**
  4804. * Ordered list of injected plugins.
  4805. */
  4806. plugins: [],
  4807. /**
  4808. * Mapping from event name to dispatch config
  4809. */
  4810. eventNameDispatchConfigs: {},
  4811. /**
  4812. * Mapping from registration name to plugin module
  4813. */
  4814. registrationNameModules: {},
  4815. /**
  4816. * Mapping from registration name to event name
  4817. */
  4818. registrationNameDependencies: {},
  4819. /**
  4820. * Mapping from lowercase registration names to the properly cased version,
  4821. * used to warn in the case of missing event handlers. Available
  4822. * only in __DEV__.
  4823. * @type {Object}
  4824. */
  4825. possibleRegistrationNames: false ? {} : null,
  4826. /**
  4827. * Injects an ordering of plugins (by plugin name). This allows the ordering
  4828. * to be decoupled from injection of the actual plugins so that ordering is
  4829. * always deterministic regardless of packaging, on-the-fly injection, etc.
  4830. *
  4831. * @param {array} InjectedEventPluginOrder
  4832. * @internal
  4833. * @see {EventPluginHub.injection.injectEventPluginOrder}
  4834. */
  4835. injectEventPluginOrder: function (InjectedEventPluginOrder) {
  4836. !!EventPluginOrder ? false ? invariant(false, 'EventPluginRegistry: Cannot inject event plugin ordering more than ' + 'once. You are likely trying to load more than one copy of React.') : invariant(false) : void 0;
  4837. // Clone the ordering so it cannot be dynamically mutated.
  4838. EventPluginOrder = Array.prototype.slice.call(InjectedEventPluginOrder);
  4839. recomputePluginOrdering();
  4840. },
  4841. /**
  4842. * Injects plugins to be used by `EventPluginHub`. The plugin names must be
  4843. * in the ordering injected by `injectEventPluginOrder`.
  4844. *
  4845. * Plugins can be injected as part of page initialization or on-the-fly.
  4846. *
  4847. * @param {object} injectedNamesToPlugins Map from names to plugin modules.
  4848. * @internal
  4849. * @see {EventPluginHub.injection.injectEventPluginsByName}
  4850. */
  4851. injectEventPluginsByName: function (injectedNamesToPlugins) {
  4852. var isOrderingDirty = false;
  4853. for (var pluginName in injectedNamesToPlugins) {
  4854. if (!injectedNamesToPlugins.hasOwnProperty(pluginName)) {
  4855. continue;
  4856. }
  4857. var PluginModule = injectedNamesToPlugins[pluginName];
  4858. if (!namesToPlugins.hasOwnProperty(pluginName) || namesToPlugins[pluginName] !== PluginModule) {
  4859. !!namesToPlugins[pluginName] ? false ? invariant(false, 'EventPluginRegistry: Cannot inject two different event plugins ' + 'using the same name, `%s`.', pluginName) : invariant(false) : void 0;
  4860. namesToPlugins[pluginName] = PluginModule;
  4861. isOrderingDirty = true;
  4862. }
  4863. }
  4864. if (isOrderingDirty) {
  4865. recomputePluginOrdering();
  4866. }
  4867. },
  4868. /**
  4869. * Looks up the plugin for the supplied event.
  4870. *
  4871. * @param {object} event A synthetic event.
  4872. * @return {?object} The plugin that created the supplied event.
  4873. * @internal
  4874. */
  4875. getPluginModuleForEvent: function (event) {
  4876. var dispatchConfig = event.dispatchConfig;
  4877. if (dispatchConfig.registrationName) {
  4878. return EventPluginRegistry.registrationNameModules[dispatchConfig.registrationName] || null;
  4879. }
  4880. for (var phase in dispatchConfig.phasedRegistrationNames) {
  4881. if (!dispatchConfig.phasedRegistrationNames.hasOwnProperty(phase)) {
  4882. continue;
  4883. }
  4884. var PluginModule = EventPluginRegistry.registrationNameModules[dispatchConfig.phasedRegistrationNames[phase]];
  4885. if (PluginModule) {
  4886. return PluginModule;
  4887. }
  4888. }
  4889. return null;
  4890. },
  4891. /**
  4892. * Exposed for unit testing.
  4893. * @private
  4894. */
  4895. _resetEventPlugins: function () {
  4896. EventPluginOrder = null;
  4897. for (var pluginName in namesToPlugins) {
  4898. if (namesToPlugins.hasOwnProperty(pluginName)) {
  4899. delete namesToPlugins[pluginName];
  4900. }
  4901. }
  4902. EventPluginRegistry.plugins.length = 0;
  4903. var eventNameDispatchConfigs = EventPluginRegistry.eventNameDispatchConfigs;
  4904. for (var eventName in eventNameDispatchConfigs) {
  4905. if (eventNameDispatchConfigs.hasOwnProperty(eventName)) {
  4906. delete eventNameDispatchConfigs[eventName];
  4907. }
  4908. }
  4909. var registrationNameModules = EventPluginRegistry.registrationNameModules;
  4910. for (var registrationName in registrationNameModules) {
  4911. if (registrationNameModules.hasOwnProperty(registrationName)) {
  4912. delete registrationNameModules[registrationName];
  4913. }
  4914. }
  4915. if (false) {
  4916. var possibleRegistrationNames = EventPluginRegistry.possibleRegistrationNames;
  4917. for (var lowerCasedName in possibleRegistrationNames) {
  4918. if (possibleRegistrationNames.hasOwnProperty(lowerCasedName)) {
  4919. delete possibleRegistrationNames[lowerCasedName];
  4920. }
  4921. }
  4922. }
  4923. }
  4924. };
  4925. module.exports = EventPluginRegistry;
  4926. /***/ },
  4927. /* 45 */
  4928. /***/ function(module, exports, __webpack_require__) {
  4929. /**
  4930. * Copyright 2013-present, Facebook, Inc.
  4931. * All rights reserved.
  4932. *
  4933. * This source code is licensed under the BSD-style license found in the
  4934. * LICENSE file in the root directory of this source tree. An additional grant
  4935. * of patent rights can be found in the PATENTS file in the same directory.
  4936. *
  4937. * @providesModule EventPluginUtils
  4938. */
  4939. 'use strict';
  4940. var EventConstants = __webpack_require__(41);
  4941. var ReactErrorUtils = __webpack_require__(46);
  4942. var invariant = __webpack_require__(6);
  4943. var warning = __webpack_require__(9);
  4944. /**
  4945. * Injected dependencies:
  4946. */
  4947. /**
  4948. * - `ComponentTree`: [required] Module that can convert between React instances
  4949. * and actual node references.
  4950. */
  4951. var ComponentTree;
  4952. var TreeTraversal;
  4953. var injection = {
  4954. injectComponentTree: function (Injected) {
  4955. ComponentTree = Injected;
  4956. if (false) {
  4957. process.env.NODE_ENV !== 'production' ? warning(Injected && Injected.getNodeFromInstance && Injected.getInstanceFromNode, 'EventPluginUtils.injection.injectComponentTree(...): Injected ' + 'module is missing getNodeFromInstance or getInstanceFromNode.') : void 0;
  4958. }
  4959. },
  4960. injectTreeTraversal: function (Injected) {
  4961. TreeTraversal = Injected;
  4962. if (false) {
  4963. process.env.NODE_ENV !== 'production' ? warning(Injected && Injected.isAncestor && Injected.getLowestCommonAncestor, 'EventPluginUtils.injection.injectTreeTraversal(...): Injected ' + 'module is missing isAncestor or getLowestCommonAncestor.') : void 0;
  4964. }
  4965. }
  4966. };
  4967. var topLevelTypes = EventConstants.topLevelTypes;
  4968. function isEndish(topLevelType) {
  4969. return topLevelType === topLevelTypes.topMouseUp || topLevelType === topLevelTypes.topTouchEnd || topLevelType === topLevelTypes.topTouchCancel;
  4970. }
  4971. function isMoveish(topLevelType) {
  4972. return topLevelType === topLevelTypes.topMouseMove || topLevelType === topLevelTypes.topTouchMove;
  4973. }
  4974. function isStartish(topLevelType) {
  4975. return topLevelType === topLevelTypes.topMouseDown || topLevelType === topLevelTypes.topTouchStart;
  4976. }
  4977. var validateEventDispatches;
  4978. if (false) {
  4979. validateEventDispatches = function (event) {
  4980. var dispatchListeners = event._dispatchListeners;
  4981. var dispatchInstances = event._dispatchInstances;
  4982. var listenersIsArr = Array.isArray(dispatchListeners);
  4983. var listenersLen = listenersIsArr ? dispatchListeners.length : dispatchListeners ? 1 : 0;
  4984. var instancesIsArr = Array.isArray(dispatchInstances);
  4985. var instancesLen = instancesIsArr ? dispatchInstances.length : dispatchInstances ? 1 : 0;
  4986. process.env.NODE_ENV !== 'production' ? warning(instancesIsArr === listenersIsArr && instancesLen === listenersLen, 'EventPluginUtils: Invalid `event`.') : void 0;
  4987. };
  4988. }
  4989. /**
  4990. * Dispatch the event to the listener.
  4991. * @param {SyntheticEvent} event SyntheticEvent to handle
  4992. * @param {boolean} simulated If the event is simulated (changes exn behavior)
  4993. * @param {function} listener Application-level callback
  4994. * @param {*} inst Internal component instance
  4995. */
  4996. function executeDispatch(event, simulated, listener, inst) {
  4997. var type = event.type || 'unknown-event';
  4998. event.currentTarget = EventPluginUtils.getNodeFromInstance(inst);
  4999. if (simulated) {
  5000. ReactErrorUtils.invokeGuardedCallbackWithCatch(type, listener, event);
  5001. } else {
  5002. ReactErrorUtils.invokeGuardedCallback(type, listener, event);
  5003. }
  5004. event.currentTarget = null;
  5005. }
  5006. /**
  5007. * Standard/simple iteration through an event's collected dispatches.
  5008. */
  5009. function executeDispatchesInOrder(event, simulated) {
  5010. var dispatchListeners = event._dispatchListeners;
  5011. var dispatchInstances = event._dispatchInstances;
  5012. if (false) {
  5013. validateEventDispatches(event);
  5014. }
  5015. if (Array.isArray(dispatchListeners)) {
  5016. for (var i = 0; i < dispatchListeners.length; i++) {
  5017. if (event.isPropagationStopped()) {
  5018. break;
  5019. }
  5020. // Listeners and Instances are two parallel arrays that are always in sync.
  5021. executeDispatch(event, simulated, dispatchListeners[i], dispatchInstances[i]);
  5022. }
  5023. } else if (dispatchListeners) {
  5024. executeDispatch(event, simulated, dispatchListeners, dispatchInstances);
  5025. }
  5026. event._dispatchListeners = null;
  5027. event._dispatchInstances = null;
  5028. }
  5029. /**
  5030. * Standard/simple iteration through an event's collected dispatches, but stops
  5031. * at the first dispatch execution returning true, and returns that id.
  5032. *
  5033. * @return {?string} id of the first dispatch execution who's listener returns
  5034. * true, or null if no listener returned true.
  5035. */
  5036. function executeDispatchesInOrderStopAtTrueImpl(event) {
  5037. var dispatchListeners = event._dispatchListeners;
  5038. var dispatchInstances = event._dispatchInstances;
  5039. if (false) {
  5040. validateEventDispatches(event);
  5041. }
  5042. if (Array.isArray(dispatchListeners)) {
  5043. for (var i = 0; i < dispatchListeners.length; i++) {
  5044. if (event.isPropagationStopped()) {
  5045. break;
  5046. }
  5047. // Listeners and Instances are two parallel arrays that are always in sync.
  5048. if (dispatchListeners[i](event, dispatchInstances[i])) {
  5049. return dispatchInstances[i];
  5050. }
  5051. }
  5052. } else if (dispatchListeners) {
  5053. if (dispatchListeners(event, dispatchInstances)) {
  5054. return dispatchInstances;
  5055. }
  5056. }
  5057. return null;
  5058. }
  5059. /**
  5060. * @see executeDispatchesInOrderStopAtTrueImpl
  5061. */
  5062. function executeDispatchesInOrderStopAtTrue(event) {
  5063. var ret = executeDispatchesInOrderStopAtTrueImpl(event);
  5064. event._dispatchInstances = null;
  5065. event._dispatchListeners = null;
  5066. return ret;
  5067. }
  5068. /**
  5069. * Execution of a "direct" dispatch - there must be at most one dispatch
  5070. * accumulated on the event or it is considered an error. It doesn't really make
  5071. * sense for an event with multiple dispatches (bubbled) to keep track of the
  5072. * return values at each dispatch execution, but it does tend to make sense when
  5073. * dealing with "direct" dispatches.
  5074. *
  5075. * @return {*} The return value of executing the single dispatch.
  5076. */
  5077. function executeDirectDispatch(event) {
  5078. if (false) {
  5079. validateEventDispatches(event);
  5080. }
  5081. var dispatchListener = event._dispatchListeners;
  5082. var dispatchInstance = event._dispatchInstances;
  5083. !!Array.isArray(dispatchListener) ? false ? invariant(false, 'executeDirectDispatch(...): Invalid `event`.') : invariant(false) : void 0;
  5084. event.currentTarget = dispatchListener ? EventPluginUtils.getNodeFromInstance(dispatchInstance) : null;
  5085. var res = dispatchListener ? dispatchListener(event) : null;
  5086. event.currentTarget = null;
  5087. event._dispatchListeners = null;
  5088. event._dispatchInstances = null;
  5089. return res;
  5090. }
  5091. /**
  5092. * @param {SyntheticEvent} event
  5093. * @return {boolean} True iff number of dispatches accumulated is greater than 0.
  5094. */
  5095. function hasDispatches(event) {
  5096. return !!event._dispatchListeners;
  5097. }
  5098. /**
  5099. * General utilities that are useful in creating custom Event Plugins.
  5100. */
  5101. var EventPluginUtils = {
  5102. isEndish: isEndish,
  5103. isMoveish: isMoveish,
  5104. isStartish: isStartish,
  5105. executeDirectDispatch: executeDirectDispatch,
  5106. executeDispatchesInOrder: executeDispatchesInOrder,
  5107. executeDispatchesInOrderStopAtTrue: executeDispatchesInOrderStopAtTrue,
  5108. hasDispatches: hasDispatches,
  5109. getInstanceFromNode: function (node) {
  5110. return ComponentTree.getInstanceFromNode(node);
  5111. },
  5112. getNodeFromInstance: function (node) {
  5113. return ComponentTree.getNodeFromInstance(node);
  5114. },
  5115. isAncestor: function (a, b) {
  5116. return TreeTraversal.isAncestor(a, b);
  5117. },
  5118. getLowestCommonAncestor: function (a, b) {
  5119. return TreeTraversal.getLowestCommonAncestor(a, b);
  5120. },
  5121. getParentInstance: function (inst) {
  5122. return TreeTraversal.getParentInstance(inst);
  5123. },
  5124. traverseTwoPhase: function (target, fn, arg) {
  5125. return TreeTraversal.traverseTwoPhase(target, fn, arg);
  5126. },
  5127. traverseEnterLeave: function (from, to, fn, argFrom, argTo) {
  5128. return TreeTraversal.traverseEnterLeave(from, to, fn, argFrom, argTo);
  5129. },
  5130. injection: injection
  5131. };
  5132. module.exports = EventPluginUtils;
  5133. /***/ },
  5134. /* 46 */
  5135. /***/ function(module, exports, __webpack_require__) {
  5136. /**
  5137. * Copyright 2013-present, Facebook, Inc.
  5138. * All rights reserved.
  5139. *
  5140. * This source code is licensed under the BSD-style license found in the
  5141. * LICENSE file in the root directory of this source tree. An additional grant
  5142. * of patent rights can be found in the PATENTS file in the same directory.
  5143. *
  5144. * @providesModule ReactErrorUtils
  5145. */
  5146. 'use strict';
  5147. var caughtError = null;
  5148. /**
  5149. * Call a function while guarding against errors that happens within it.
  5150. *
  5151. * @param {?String} name of the guard to use for logging or debugging
  5152. * @param {Function} func The function to invoke
  5153. * @param {*} a First argument
  5154. * @param {*} b Second argument
  5155. */
  5156. function invokeGuardedCallback(name, func, a, b) {
  5157. try {
  5158. return func(a, b);
  5159. } catch (x) {
  5160. if (caughtError === null) {
  5161. caughtError = x;
  5162. }
  5163. return undefined;
  5164. }
  5165. }
  5166. var ReactErrorUtils = {
  5167. invokeGuardedCallback: invokeGuardedCallback,
  5168. /**
  5169. * Invoked by ReactTestUtils.Simulate so that any errors thrown by the event
  5170. * handler are sure to be rethrown by rethrowCaughtError.
  5171. */
  5172. invokeGuardedCallbackWithCatch: invokeGuardedCallback,
  5173. /**
  5174. * During execution of guarded functions we will capture the first error which
  5175. * we will rethrow to be handled by the top level error handler.
  5176. */
  5177. rethrowCaughtError: function () {
  5178. if (caughtError) {
  5179. var error = caughtError;
  5180. caughtError = null;
  5181. throw error;
  5182. }
  5183. }
  5184. };
  5185. if (false) {
  5186. /**
  5187. * To help development we can get better devtools integration by simulating a
  5188. * real browser event.
  5189. */
  5190. if (typeof window !== 'undefined' && typeof window.dispatchEvent === 'function' && typeof document !== 'undefined' && typeof document.createEvent === 'function') {
  5191. var fakeNode = document.createElement('react');
  5192. ReactErrorUtils.invokeGuardedCallback = function (name, func, a, b) {
  5193. var boundFunc = func.bind(null, a, b);
  5194. var evtType = 'react-' + name;
  5195. fakeNode.addEventListener(evtType, boundFunc, false);
  5196. var evt = document.createEvent('Event');
  5197. evt.initEvent(evtType, false, false);
  5198. fakeNode.dispatchEvent(evt);
  5199. fakeNode.removeEventListener(evtType, boundFunc, false);
  5200. };
  5201. }
  5202. }
  5203. module.exports = ReactErrorUtils;
  5204. /***/ },
  5205. /* 47 */
  5206. /***/ function(module, exports, __webpack_require__) {
  5207. /**
  5208. * Copyright 2014-present, Facebook, Inc.
  5209. * All rights reserved.
  5210. *
  5211. * This source code is licensed under the BSD-style license found in the
  5212. * LICENSE file in the root directory of this source tree. An additional grant
  5213. * of patent rights can be found in the PATENTS file in the same directory.
  5214. *
  5215. * @providesModule accumulateInto
  5216. */
  5217. 'use strict';
  5218. var invariant = __webpack_require__(6);
  5219. /**
  5220. *
  5221. * Accumulates items that must not be null or undefined into the first one. This
  5222. * is used to conserve memory by avoiding array allocations, and thus sacrifices
  5223. * API cleanness. Since `current` can be null before being passed in and not
  5224. * null after this function, make sure to assign it back to `current`:
  5225. *
  5226. * `a = accumulateInto(a, b);`
  5227. *
  5228. * This API should be sparingly used. Try `accumulate` for something cleaner.
  5229. *
  5230. * @return {*|array<*>} An accumulation of items.
  5231. */
  5232. function accumulateInto(current, next) {
  5233. !(next != null) ? false ? invariant(false, 'accumulateInto(...): Accumulated items must not be null or undefined.') : invariant(false) : void 0;
  5234. if (current == null) {
  5235. return next;
  5236. }
  5237. // Both are not empty. Warning: Never call x.concat(y) when you are not
  5238. // certain that x is an Array (x could be a string with concat method).
  5239. var currentIsArray = Array.isArray(current);
  5240. var nextIsArray = Array.isArray(next);
  5241. if (currentIsArray && nextIsArray) {
  5242. current.push.apply(current, next);
  5243. return current;
  5244. }
  5245. if (currentIsArray) {
  5246. current.push(next);
  5247. return current;
  5248. }
  5249. if (nextIsArray) {
  5250. // A bit too dangerous to mutate `next`.
  5251. return [current].concat(next);
  5252. }
  5253. return [current, next];
  5254. }
  5255. module.exports = accumulateInto;
  5256. /***/ },
  5257. /* 48 */
  5258. /***/ function(module, exports) {
  5259. /**
  5260. * Copyright 2013-present, Facebook, Inc.
  5261. * All rights reserved.
  5262. *
  5263. * This source code is licensed under the BSD-style license found in the
  5264. * LICENSE file in the root directory of this source tree. An additional grant
  5265. * of patent rights can be found in the PATENTS file in the same directory.
  5266. *
  5267. * @providesModule forEachAccumulated
  5268. */
  5269. 'use strict';
  5270. /**
  5271. * @param {array} arr an "accumulation" of items which is either an Array or
  5272. * a single item. Useful when paired with the `accumulate` module. This is a
  5273. * simple utility that allows us to reason about a collection of items, but
  5274. * handling the case when there is exactly one item (and we do not need to
  5275. * allocate an array).
  5276. */
  5277. var forEachAccumulated = function (arr, cb, scope) {
  5278. if (Array.isArray(arr)) {
  5279. arr.forEach(cb, scope);
  5280. } else if (arr) {
  5281. cb.call(scope, arr);
  5282. }
  5283. };
  5284. module.exports = forEachAccumulated;
  5285. /***/ },
  5286. /* 49 */
  5287. /***/ function(module, exports, __webpack_require__) {
  5288. /**
  5289. * Copyright 2013-present, Facebook, Inc.
  5290. * All rights reserved.
  5291. *
  5292. * This source code is licensed under the BSD-style license found in the
  5293. * LICENSE file in the root directory of this source tree. An additional grant
  5294. * of patent rights can be found in the PATENTS file in the same directory.
  5295. *
  5296. * @providesModule FallbackCompositionState
  5297. */
  5298. 'use strict';
  5299. var _assign = __webpack_require__(3);
  5300. var PooledClass = __webpack_require__(5);
  5301. var getTextContentAccessor = __webpack_require__(50);
  5302. /**
  5303. * This helper class stores information about text content of a target node,
  5304. * allowing comparison of content before and after a given event.
  5305. *
  5306. * Identify the node where selection currently begins, then observe
  5307. * both its text content and its current position in the DOM. Since the
  5308. * browser may natively replace the target node during composition, we can
  5309. * use its position to find its replacement.
  5310. *
  5311. * @param {DOMEventTarget} root
  5312. */
  5313. function FallbackCompositionState(root) {
  5314. this._root = root;
  5315. this._startText = this.getText();
  5316. this._fallbackText = null;
  5317. }
  5318. _assign(FallbackCompositionState.prototype, {
  5319. destructor: function () {
  5320. this._root = null;
  5321. this._startText = null;
  5322. this._fallbackText = null;
  5323. },
  5324. /**
  5325. * Get current text of input.
  5326. *
  5327. * @return {string}
  5328. */
  5329. getText: function () {
  5330. if ('value' in this._root) {
  5331. return this._root.value;
  5332. }
  5333. return this._root[getTextContentAccessor()];
  5334. },
  5335. /**
  5336. * Determine the differing substring between the initially stored
  5337. * text content and the current content.
  5338. *
  5339. * @return {string}
  5340. */
  5341. getData: function () {
  5342. if (this._fallbackText) {
  5343. return this._fallbackText;
  5344. }
  5345. var start;
  5346. var startValue = this._startText;
  5347. var startLength = startValue.length;
  5348. var end;
  5349. var endValue = this.getText();
  5350. var endLength = endValue.length;
  5351. for (start = 0; start < startLength; start++) {
  5352. if (startValue[start] !== endValue[start]) {
  5353. break;
  5354. }
  5355. }
  5356. var minEnd = startLength - start;
  5357. for (end = 1; end <= minEnd; end++) {
  5358. if (startValue[startLength - end] !== endValue[endLength - end]) {
  5359. break;
  5360. }
  5361. }
  5362. var sliceTail = end > 1 ? 1 - end : undefined;
  5363. this._fallbackText = endValue.slice(start, sliceTail);
  5364. return this._fallbackText;
  5365. }
  5366. });
  5367. PooledClass.addPoolingTo(FallbackCompositionState);
  5368. module.exports = FallbackCompositionState;
  5369. /***/ },
  5370. /* 50 */
  5371. /***/ function(module, exports, __webpack_require__) {
  5372. /**
  5373. * Copyright 2013-present, Facebook, Inc.
  5374. * All rights reserved.
  5375. *
  5376. * This source code is licensed under the BSD-style license found in the
  5377. * LICENSE file in the root directory of this source tree. An additional grant
  5378. * of patent rights can be found in the PATENTS file in the same directory.
  5379. *
  5380. * @providesModule getTextContentAccessor
  5381. */
  5382. 'use strict';
  5383. var ExecutionEnvironment = __webpack_require__(19);
  5384. var contentKey = null;
  5385. /**
  5386. * Gets the key used to access text content on a DOM node.
  5387. *
  5388. * @return {?string} Key used to access text content.
  5389. * @internal
  5390. */
  5391. function getTextContentAccessor() {
  5392. if (!contentKey && ExecutionEnvironment.canUseDOM) {
  5393. // Prefer textContent to innerText because many browsers support both but
  5394. // SVG <text> elements don't support innerText even when <div> does.
  5395. contentKey = 'textContent' in document.documentElement ? 'textContent' : 'innerText';
  5396. }
  5397. return contentKey;
  5398. }
  5399. module.exports = getTextContentAccessor;
  5400. /***/ },
  5401. /* 51 */
  5402. /***/ function(module, exports, __webpack_require__) {
  5403. /**
  5404. * Copyright 2013-present, Facebook, Inc.
  5405. * All rights reserved.
  5406. *
  5407. * This source code is licensed under the BSD-style license found in the
  5408. * LICENSE file in the root directory of this source tree. An additional grant
  5409. * of patent rights can be found in the PATENTS file in the same directory.
  5410. *
  5411. * @providesModule SyntheticCompositionEvent
  5412. */
  5413. 'use strict';
  5414. var SyntheticEvent = __webpack_require__(52);
  5415. /**
  5416. * @interface Event
  5417. * @see http://www.w3.org/TR/DOM-Level-3-Events/#events-compositionevents
  5418. */
  5419. var CompositionEventInterface = {
  5420. data: null
  5421. };
  5422. /**
  5423. * @param {object} dispatchConfig Configuration used to dispatch this event.
  5424. * @param {string} dispatchMarker Marker identifying the event target.
  5425. * @param {object} nativeEvent Native browser event.
  5426. * @extends {SyntheticUIEvent}
  5427. */
  5428. function SyntheticCompositionEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
  5429. return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
  5430. }
  5431. SyntheticEvent.augmentClass(SyntheticCompositionEvent, CompositionEventInterface);
  5432. module.exports = SyntheticCompositionEvent;
  5433. /***/ },
  5434. /* 52 */
  5435. /***/ function(module, exports, __webpack_require__) {
  5436. /**
  5437. * Copyright 2013-present, Facebook, Inc.
  5438. * All rights reserved.
  5439. *
  5440. * This source code is licensed under the BSD-style license found in the
  5441. * LICENSE file in the root directory of this source tree. An additional grant
  5442. * of patent rights can be found in the PATENTS file in the same directory.
  5443. *
  5444. * @providesModule SyntheticEvent
  5445. */
  5446. 'use strict';
  5447. var _assign = __webpack_require__(3);
  5448. var PooledClass = __webpack_require__(5);
  5449. var emptyFunction = __webpack_require__(10);
  5450. var warning = __webpack_require__(9);
  5451. var didWarnForAddedNewProperty = false;
  5452. var isProxySupported = typeof Proxy === 'function';
  5453. var shouldBeReleasedProperties = ['dispatchConfig', '_targetInst', 'nativeEvent', 'isDefaultPrevented', 'isPropagationStopped', '_dispatchListeners', '_dispatchInstances'];
  5454. /**
  5455. * @interface Event
  5456. * @see http://www.w3.org/TR/DOM-Level-3-Events/
  5457. */
  5458. var EventInterface = {
  5459. type: null,
  5460. target: null,
  5461. // currentTarget is set when dispatching; no use in copying it here
  5462. currentTarget: emptyFunction.thatReturnsNull,
  5463. eventPhase: null,
  5464. bubbles: null,
  5465. cancelable: null,
  5466. timeStamp: function (event) {
  5467. return event.timeStamp || Date.now();
  5468. },
  5469. defaultPrevented: null,
  5470. isTrusted: null
  5471. };
  5472. /**
  5473. * Synthetic events are dispatched by event plugins, typically in response to a
  5474. * top-level event delegation handler.
  5475. *
  5476. * These systems should generally use pooling to reduce the frequency of garbage
  5477. * collection. The system should check `isPersistent` to determine whether the
  5478. * event should be released into the pool after being dispatched. Users that
  5479. * need a persisted event should invoke `persist`.
  5480. *
  5481. * Synthetic events (and subclasses) implement the DOM Level 3 Events API by
  5482. * normalizing browser quirks. Subclasses do not necessarily have to implement a
  5483. * DOM interface; custom application-specific events can also subclass this.
  5484. *
  5485. * @param {object} dispatchConfig Configuration used to dispatch this event.
  5486. * @param {*} targetInst Marker identifying the event target.
  5487. * @param {object} nativeEvent Native browser event.
  5488. * @param {DOMEventTarget} nativeEventTarget Target node.
  5489. */
  5490. function SyntheticEvent(dispatchConfig, targetInst, nativeEvent, nativeEventTarget) {
  5491. if (false) {
  5492. // these have a getter/setter for warnings
  5493. delete this.nativeEvent;
  5494. delete this.preventDefault;
  5495. delete this.stopPropagation;
  5496. }
  5497. this.dispatchConfig = dispatchConfig;
  5498. this._targetInst = targetInst;
  5499. this.nativeEvent = nativeEvent;
  5500. var Interface = this.constructor.Interface;
  5501. for (var propName in Interface) {
  5502. if (!Interface.hasOwnProperty(propName)) {
  5503. continue;
  5504. }
  5505. if (false) {
  5506. delete this[propName]; // this has a getter/setter for warnings
  5507. }
  5508. var normalize = Interface[propName];
  5509. if (normalize) {
  5510. this[propName] = normalize(nativeEvent);
  5511. } else {
  5512. if (propName === 'target') {
  5513. this.target = nativeEventTarget;
  5514. } else {
  5515. this[propName] = nativeEvent[propName];
  5516. }
  5517. }
  5518. }
  5519. var defaultPrevented = nativeEvent.defaultPrevented != null ? nativeEvent.defaultPrevented : nativeEvent.returnValue === false;
  5520. if (defaultPrevented) {
  5521. this.isDefaultPrevented = emptyFunction.thatReturnsTrue;
  5522. } else {
  5523. this.isDefaultPrevented = emptyFunction.thatReturnsFalse;
  5524. }
  5525. this.isPropagationStopped = emptyFunction.thatReturnsFalse;
  5526. return this;
  5527. }
  5528. _assign(SyntheticEvent.prototype, {
  5529. preventDefault: function () {
  5530. this.defaultPrevented = true;
  5531. var event = this.nativeEvent;
  5532. if (!event) {
  5533. return;
  5534. }
  5535. if (event.preventDefault) {
  5536. event.preventDefault();
  5537. } else {
  5538. event.returnValue = false;
  5539. }
  5540. this.isDefaultPrevented = emptyFunction.thatReturnsTrue;
  5541. },
  5542. stopPropagation: function () {
  5543. var event = this.nativeEvent;
  5544. if (!event) {
  5545. return;
  5546. }
  5547. if (event.stopPropagation) {
  5548. event.stopPropagation();
  5549. } else {
  5550. event.cancelBubble = true;
  5551. }
  5552. this.isPropagationStopped = emptyFunction.thatReturnsTrue;
  5553. },
  5554. /**
  5555. * We release all dispatched `SyntheticEvent`s after each event loop, adding
  5556. * them back into the pool. This allows a way to hold onto a reference that
  5557. * won't be added back into the pool.
  5558. */
  5559. persist: function () {
  5560. this.isPersistent = emptyFunction.thatReturnsTrue;
  5561. },
  5562. /**
  5563. * Checks if this event should be released back into the pool.
  5564. *
  5565. * @return {boolean} True if this should not be released, false otherwise.
  5566. */
  5567. isPersistent: emptyFunction.thatReturnsFalse,
  5568. /**
  5569. * `PooledClass` looks for `destructor` on each instance it releases.
  5570. */
  5571. destructor: function () {
  5572. var Interface = this.constructor.Interface;
  5573. for (var propName in Interface) {
  5574. if (false) {
  5575. Object.defineProperty(this, propName, getPooledWarningPropertyDefinition(propName, Interface[propName]));
  5576. } else {
  5577. this[propName] = null;
  5578. }
  5579. }
  5580. for (var i = 0; i < shouldBeReleasedProperties.length; i++) {
  5581. this[shouldBeReleasedProperties[i]] = null;
  5582. }
  5583. if (false) {
  5584. var noop = require('fbjs/lib/emptyFunction');
  5585. Object.defineProperty(this, 'nativeEvent', getPooledWarningPropertyDefinition('nativeEvent', null));
  5586. Object.defineProperty(this, 'preventDefault', getPooledWarningPropertyDefinition('preventDefault', noop));
  5587. Object.defineProperty(this, 'stopPropagation', getPooledWarningPropertyDefinition('stopPropagation', noop));
  5588. }
  5589. }
  5590. });
  5591. SyntheticEvent.Interface = EventInterface;
  5592. if (false) {
  5593. if (isProxySupported) {
  5594. /*eslint-disable no-func-assign */
  5595. SyntheticEvent = new Proxy(SyntheticEvent, {
  5596. construct: function (target, args) {
  5597. return this.apply(target, Object.create(target.prototype), args);
  5598. },
  5599. apply: function (constructor, that, args) {
  5600. return new Proxy(constructor.apply(that, args), {
  5601. set: function (target, prop, value) {
  5602. if (prop !== 'isPersistent' && !target.constructor.Interface.hasOwnProperty(prop) && shouldBeReleasedProperties.indexOf(prop) === -1) {
  5603. process.env.NODE_ENV !== 'production' ? warning(didWarnForAddedNewProperty || target.isPersistent(), 'This synthetic event is reused for performance reasons. If you\'re ' + 'seeing this, you\'re adding a new property in the synthetic event object. ' + 'The property is never released. See ' + 'https://fb.me/react-event-pooling for more information.') : void 0;
  5604. didWarnForAddedNewProperty = true;
  5605. }
  5606. target[prop] = value;
  5607. return true;
  5608. }
  5609. });
  5610. }
  5611. });
  5612. /*eslint-enable no-func-assign */
  5613. }
  5614. }
  5615. /**
  5616. * Helper to reduce boilerplate when creating subclasses.
  5617. *
  5618. * @param {function} Class
  5619. * @param {?object} Interface
  5620. */
  5621. SyntheticEvent.augmentClass = function (Class, Interface) {
  5622. var Super = this;
  5623. var E = function () {};
  5624. E.prototype = Super.prototype;
  5625. var prototype = new E();
  5626. _assign(prototype, Class.prototype);
  5627. Class.prototype = prototype;
  5628. Class.prototype.constructor = Class;
  5629. Class.Interface = _assign({}, Super.Interface, Interface);
  5630. Class.augmentClass = Super.augmentClass;
  5631. PooledClass.addPoolingTo(Class, PooledClass.fourArgumentPooler);
  5632. };
  5633. PooledClass.addPoolingTo(SyntheticEvent, PooledClass.fourArgumentPooler);
  5634. module.exports = SyntheticEvent;
  5635. /**
  5636. * Helper to nullify syntheticEvent instance properties when destructing
  5637. *
  5638. * @param {object} SyntheticEvent
  5639. * @param {String} propName
  5640. * @return {object} defineProperty object
  5641. */
  5642. function getPooledWarningPropertyDefinition(propName, getVal) {
  5643. var isFunction = typeof getVal === 'function';
  5644. return {
  5645. configurable: true,
  5646. set: set,
  5647. get: get
  5648. };
  5649. function set(val) {
  5650. var action = isFunction ? 'setting the method' : 'setting the property';
  5651. warn(action, 'This is effectively a no-op');
  5652. return val;
  5653. }
  5654. function get() {
  5655. var action = isFunction ? 'accessing the method' : 'accessing the property';
  5656. var result = isFunction ? 'This is a no-op function' : 'This is set to null';
  5657. warn(action, result);
  5658. return getVal;
  5659. }
  5660. function warn(action, result) {
  5661. var warningCondition = false;
  5662. false ? warning(warningCondition, 'This synthetic event is reused for performance reasons. If you\'re seeing this, ' + 'you\'re %s `%s` on a released/nullified synthetic event. %s. ' + 'If you must keep the original synthetic event around, use event.persist(). ' + 'See https://fb.me/react-event-pooling for more information.', action, propName, result) : void 0;
  5663. }
  5664. }
  5665. /***/ },
  5666. /* 53 */
  5667. /***/ function(module, exports, __webpack_require__) {
  5668. /**
  5669. * Copyright 2013-present, Facebook, Inc.
  5670. * All rights reserved.
  5671. *
  5672. * This source code is licensed under the BSD-style license found in the
  5673. * LICENSE file in the root directory of this source tree. An additional grant
  5674. * of patent rights can be found in the PATENTS file in the same directory.
  5675. *
  5676. * @providesModule SyntheticInputEvent
  5677. */
  5678. 'use strict';
  5679. var SyntheticEvent = __webpack_require__(52);
  5680. /**
  5681. * @interface Event
  5682. * @see http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105
  5683. * /#events-inputevents
  5684. */
  5685. var InputEventInterface = {
  5686. data: null
  5687. };
  5688. /**
  5689. * @param {object} dispatchConfig Configuration used to dispatch this event.
  5690. * @param {string} dispatchMarker Marker identifying the event target.
  5691. * @param {object} nativeEvent Native browser event.
  5692. * @extends {SyntheticUIEvent}
  5693. */
  5694. function SyntheticInputEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
  5695. return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
  5696. }
  5697. SyntheticEvent.augmentClass(SyntheticInputEvent, InputEventInterface);
  5698. module.exports = SyntheticInputEvent;
  5699. /***/ },
  5700. /* 54 */
  5701. /***/ function(module, exports, __webpack_require__) {
  5702. /**
  5703. * Copyright 2013-present, Facebook, Inc.
  5704. * All rights reserved.
  5705. *
  5706. * This source code is licensed under the BSD-style license found in the
  5707. * LICENSE file in the root directory of this source tree. An additional grant
  5708. * of patent rights can be found in the PATENTS file in the same directory.
  5709. *
  5710. * @providesModule ChangeEventPlugin
  5711. */
  5712. 'use strict';
  5713. var EventConstants = __webpack_require__(41);
  5714. var EventPluginHub = __webpack_require__(43);
  5715. var EventPropagators = __webpack_require__(42);
  5716. var ExecutionEnvironment = __webpack_require__(19);
  5717. var ReactDOMComponentTree = __webpack_require__(36);
  5718. var ReactUpdates = __webpack_require__(55);
  5719. var SyntheticEvent = __webpack_require__(52);
  5720. var getEventTarget = __webpack_require__(62);
  5721. var isEventSupported = __webpack_require__(63);
  5722. var isTextInputElement = __webpack_require__(64);
  5723. var keyOf = __webpack_require__(27);
  5724. var topLevelTypes = EventConstants.topLevelTypes;
  5725. var eventTypes = {
  5726. change: {
  5727. phasedRegistrationNames: {
  5728. bubbled: keyOf({ onChange: null }),
  5729. captured: keyOf({ onChangeCapture: null })
  5730. },
  5731. dependencies: [topLevelTypes.topBlur, topLevelTypes.topChange, topLevelTypes.topClick, topLevelTypes.topFocus, topLevelTypes.topInput, topLevelTypes.topKeyDown, topLevelTypes.topKeyUp, topLevelTypes.topSelectionChange]
  5732. }
  5733. };
  5734. /**
  5735. * For IE shims
  5736. */
  5737. var activeElement = null;
  5738. var activeElementInst = null;
  5739. var activeElementValue = null;
  5740. var activeElementValueProp = null;
  5741. /**
  5742. * SECTION: handle `change` event
  5743. */
  5744. function shouldUseChangeEvent(elem) {
  5745. var nodeName = elem.nodeName && elem.nodeName.toLowerCase();
  5746. return nodeName === 'select' || nodeName === 'input' && elem.type === 'file';
  5747. }
  5748. var doesChangeEventBubble = false;
  5749. if (ExecutionEnvironment.canUseDOM) {
  5750. // See `handleChange` comment below
  5751. doesChangeEventBubble = isEventSupported('change') && (!('documentMode' in document) || document.documentMode > 8);
  5752. }
  5753. function manualDispatchChangeEvent(nativeEvent) {
  5754. var event = SyntheticEvent.getPooled(eventTypes.change, activeElementInst, nativeEvent, getEventTarget(nativeEvent));
  5755. EventPropagators.accumulateTwoPhaseDispatches(event);
  5756. // If change and propertychange bubbled, we'd just bind to it like all the
  5757. // other events and have it go through ReactBrowserEventEmitter. Since it
  5758. // doesn't, we manually listen for the events and so we have to enqueue and
  5759. // process the abstract event manually.
  5760. //
  5761. // Batching is necessary here in order to ensure that all event handlers run
  5762. // before the next rerender (including event handlers attached to ancestor
  5763. // elements instead of directly on the input). Without this, controlled
  5764. // components don't work properly in conjunction with event bubbling because
  5765. // the component is rerendered and the value reverted before all the event
  5766. // handlers can run. See https://github.com/facebook/react/issues/708.
  5767. ReactUpdates.batchedUpdates(runEventInBatch, event);
  5768. }
  5769. function runEventInBatch(event) {
  5770. EventPluginHub.enqueueEvents(event);
  5771. EventPluginHub.processEventQueue(false);
  5772. }
  5773. function startWatchingForChangeEventIE8(target, targetInst) {
  5774. activeElement = target;
  5775. activeElementInst = targetInst;
  5776. activeElement.attachEvent('onchange', manualDispatchChangeEvent);
  5777. }
  5778. function stopWatchingForChangeEventIE8() {
  5779. if (!activeElement) {
  5780. return;
  5781. }
  5782. activeElement.detachEvent('onchange', manualDispatchChangeEvent);
  5783. activeElement = null;
  5784. activeElementInst = null;
  5785. }
  5786. function getTargetInstForChangeEvent(topLevelType, targetInst) {
  5787. if (topLevelType === topLevelTypes.topChange) {
  5788. return targetInst;
  5789. }
  5790. }
  5791. function handleEventsForChangeEventIE8(topLevelType, target, targetInst) {
  5792. if (topLevelType === topLevelTypes.topFocus) {
  5793. // stopWatching() should be a noop here but we call it just in case we
  5794. // missed a blur event somehow.
  5795. stopWatchingForChangeEventIE8();
  5796. startWatchingForChangeEventIE8(target, targetInst);
  5797. } else if (topLevelType === topLevelTypes.topBlur) {
  5798. stopWatchingForChangeEventIE8();
  5799. }
  5800. }
  5801. /**
  5802. * SECTION: handle `input` event
  5803. */
  5804. var isInputEventSupported = false;
  5805. if (ExecutionEnvironment.canUseDOM) {
  5806. // IE9 claims to support the input event but fails to trigger it when
  5807. // deleting text, so we ignore its input events.
  5808. // IE10+ fire input events to often, such when a placeholder
  5809. // changes or when an input with a placeholder is focused.
  5810. isInputEventSupported = isEventSupported('input') && (!('documentMode' in document) || document.documentMode > 11);
  5811. }
  5812. /**
  5813. * (For IE <=11) Replacement getter/setter for the `value` property that gets
  5814. * set on the active element.
  5815. */
  5816. var newValueProp = {
  5817. get: function () {
  5818. return activeElementValueProp.get.call(this);
  5819. },
  5820. set: function (val) {
  5821. // Cast to a string so we can do equality checks.
  5822. activeElementValue = '' + val;
  5823. activeElementValueProp.set.call(this, val);
  5824. }
  5825. };
  5826. /**
  5827. * (For IE <=11) Starts tracking propertychange events on the passed-in element
  5828. * and override the value property so that we can distinguish user events from
  5829. * value changes in JS.
  5830. */
  5831. function startWatchingForValueChange(target, targetInst) {
  5832. activeElement = target;
  5833. activeElementInst = targetInst;
  5834. activeElementValue = target.value;
  5835. activeElementValueProp = Object.getOwnPropertyDescriptor(target.constructor.prototype, 'value');
  5836. // Not guarded in a canDefineProperty check: IE8 supports defineProperty only
  5837. // on DOM elements
  5838. Object.defineProperty(activeElement, 'value', newValueProp);
  5839. if (activeElement.attachEvent) {
  5840. activeElement.attachEvent('onpropertychange', handlePropertyChange);
  5841. } else {
  5842. activeElement.addEventListener('propertychange', handlePropertyChange, false);
  5843. }
  5844. }
  5845. /**
  5846. * (For IE <=11) Removes the event listeners from the currently-tracked element,
  5847. * if any exists.
  5848. */
  5849. function stopWatchingForValueChange() {
  5850. if (!activeElement) {
  5851. return;
  5852. }
  5853. // delete restores the original property definition
  5854. delete activeElement.value;
  5855. if (activeElement.detachEvent) {
  5856. activeElement.detachEvent('onpropertychange', handlePropertyChange);
  5857. } else {
  5858. activeElement.removeEventListener('propertychange', handlePropertyChange, false);
  5859. }
  5860. activeElement = null;
  5861. activeElementInst = null;
  5862. activeElementValue = null;
  5863. activeElementValueProp = null;
  5864. }
  5865. /**
  5866. * (For IE <=11) Handles a propertychange event, sending a `change` event if
  5867. * the value of the active element has changed.
  5868. */
  5869. function handlePropertyChange(nativeEvent) {
  5870. if (nativeEvent.propertyName !== 'value') {
  5871. return;
  5872. }
  5873. var value = nativeEvent.srcElement.value;
  5874. if (value === activeElementValue) {
  5875. return;
  5876. }
  5877. activeElementValue = value;
  5878. manualDispatchChangeEvent(nativeEvent);
  5879. }
  5880. /**
  5881. * If a `change` event should be fired, returns the target's ID.
  5882. */
  5883. function getTargetInstForInputEvent(topLevelType, targetInst) {
  5884. if (topLevelType === topLevelTypes.topInput) {
  5885. // In modern browsers (i.e., not IE8 or IE9), the input event is exactly
  5886. // what we want so fall through here and trigger an abstract event
  5887. return targetInst;
  5888. }
  5889. }
  5890. function handleEventsForInputEventIE(topLevelType, target, targetInst) {
  5891. if (topLevelType === topLevelTypes.topFocus) {
  5892. // In IE8, we can capture almost all .value changes by adding a
  5893. // propertychange handler and looking for events with propertyName
  5894. // equal to 'value'
  5895. // In IE9-11, propertychange fires for most input events but is buggy and
  5896. // doesn't fire when text is deleted, but conveniently, selectionchange
  5897. // appears to fire in all of the remaining cases so we catch those and
  5898. // forward the event if the value has changed
  5899. // In either case, we don't want to call the event handler if the value
  5900. // is changed from JS so we redefine a setter for `.value` that updates
  5901. // our activeElementValue variable, allowing us to ignore those changes
  5902. //
  5903. // stopWatching() should be a noop here but we call it just in case we
  5904. // missed a blur event somehow.
  5905. stopWatchingForValueChange();
  5906. startWatchingForValueChange(target, targetInst);
  5907. } else if (topLevelType === topLevelTypes.topBlur) {
  5908. stopWatchingForValueChange();
  5909. }
  5910. }
  5911. // For IE8 and IE9.
  5912. function getTargetInstForInputEventIE(topLevelType, targetInst) {
  5913. if (topLevelType === topLevelTypes.topSelectionChange || topLevelType === topLevelTypes.topKeyUp || topLevelType === topLevelTypes.topKeyDown) {
  5914. // On the selectionchange event, the target is just document which isn't
  5915. // helpful for us so just check activeElement instead.
  5916. //
  5917. // 99% of the time, keydown and keyup aren't necessary. IE8 fails to fire
  5918. // propertychange on the first input event after setting `value` from a
  5919. // script and fires only keydown, keypress, keyup. Catching keyup usually
  5920. // gets it and catching keydown lets us fire an event for the first
  5921. // keystroke if user does a key repeat (it'll be a little delayed: right
  5922. // before the second keystroke). Other input methods (e.g., paste) seem to
  5923. // fire selectionchange normally.
  5924. if (activeElement && activeElement.value !== activeElementValue) {
  5925. activeElementValue = activeElement.value;
  5926. return activeElementInst;
  5927. }
  5928. }
  5929. }
  5930. /**
  5931. * SECTION: handle `click` event
  5932. */
  5933. function shouldUseClickEvent(elem) {
  5934. // Use the `click` event to detect changes to checkbox and radio inputs.
  5935. // This approach works across all browsers, whereas `change` does not fire
  5936. // until `blur` in IE8.
  5937. return elem.nodeName && elem.nodeName.toLowerCase() === 'input' && (elem.type === 'checkbox' || elem.type === 'radio');
  5938. }
  5939. function getTargetInstForClickEvent(topLevelType, targetInst) {
  5940. if (topLevelType === topLevelTypes.topClick) {
  5941. return targetInst;
  5942. }
  5943. }
  5944. /**
  5945. * This plugin creates an `onChange` event that normalizes change events
  5946. * across form elements. This event fires at a time when it's possible to
  5947. * change the element's value without seeing a flicker.
  5948. *
  5949. * Supported elements are:
  5950. * - input (see `isTextInputElement`)
  5951. * - textarea
  5952. * - select
  5953. */
  5954. var ChangeEventPlugin = {
  5955. eventTypes: eventTypes,
  5956. extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
  5957. var targetNode = targetInst ? ReactDOMComponentTree.getNodeFromInstance(targetInst) : window;
  5958. var getTargetInstFunc, handleEventFunc;
  5959. if (shouldUseChangeEvent(targetNode)) {
  5960. if (doesChangeEventBubble) {
  5961. getTargetInstFunc = getTargetInstForChangeEvent;
  5962. } else {
  5963. handleEventFunc = handleEventsForChangeEventIE8;
  5964. }
  5965. } else if (isTextInputElement(targetNode)) {
  5966. if (isInputEventSupported) {
  5967. getTargetInstFunc = getTargetInstForInputEvent;
  5968. } else {
  5969. getTargetInstFunc = getTargetInstForInputEventIE;
  5970. handleEventFunc = handleEventsForInputEventIE;
  5971. }
  5972. } else if (shouldUseClickEvent(targetNode)) {
  5973. getTargetInstFunc = getTargetInstForClickEvent;
  5974. }
  5975. if (getTargetInstFunc) {
  5976. var inst = getTargetInstFunc(topLevelType, targetInst);
  5977. if (inst) {
  5978. var event = SyntheticEvent.getPooled(eventTypes.change, inst, nativeEvent, nativeEventTarget);
  5979. event.type = 'change';
  5980. EventPropagators.accumulateTwoPhaseDispatches(event);
  5981. return event;
  5982. }
  5983. }
  5984. if (handleEventFunc) {
  5985. handleEventFunc(topLevelType, targetNode, targetInst);
  5986. }
  5987. }
  5988. };
  5989. module.exports = ChangeEventPlugin;
  5990. /***/ },
  5991. /* 55 */
  5992. /***/ function(module, exports, __webpack_require__) {
  5993. /**
  5994. * Copyright 2013-present, Facebook, Inc.
  5995. * All rights reserved.
  5996. *
  5997. * This source code is licensed under the BSD-style license found in the
  5998. * LICENSE file in the root directory of this source tree. An additional grant
  5999. * of patent rights can be found in the PATENTS file in the same directory.
  6000. *
  6001. * @providesModule ReactUpdates
  6002. */
  6003. 'use strict';
  6004. var _assign = __webpack_require__(3);
  6005. var CallbackQueue = __webpack_require__(56);
  6006. var PooledClass = __webpack_require__(5);
  6007. var ReactFeatureFlags = __webpack_require__(57);
  6008. var ReactInstrumentation = __webpack_require__(17);
  6009. var ReactReconciler = __webpack_require__(58);
  6010. var Transaction = __webpack_require__(61);
  6011. var invariant = __webpack_require__(6);
  6012. var dirtyComponents = [];
  6013. var updateBatchNumber = 0;
  6014. var asapCallbackQueue = CallbackQueue.getPooled();
  6015. var asapEnqueued = false;
  6016. var batchingStrategy = null;
  6017. function ensureInjected() {
  6018. !(ReactUpdates.ReactReconcileTransaction && batchingStrategy) ? false ? invariant(false, 'ReactUpdates: must inject a reconcile transaction class and batching ' + 'strategy') : invariant(false) : void 0;
  6019. }
  6020. var NESTED_UPDATES = {
  6021. initialize: function () {
  6022. this.dirtyComponentsLength = dirtyComponents.length;
  6023. },
  6024. close: function () {
  6025. if (this.dirtyComponentsLength !== dirtyComponents.length) {
  6026. // Additional updates were enqueued by componentDidUpdate handlers or
  6027. // similar; before our own UPDATE_QUEUEING wrapper closes, we want to run
  6028. // these new updates so that if A's componentDidUpdate calls setState on
  6029. // B, B will update before the callback A's updater provided when calling
  6030. // setState.
  6031. dirtyComponents.splice(0, this.dirtyComponentsLength);
  6032. flushBatchedUpdates();
  6033. } else {
  6034. dirtyComponents.length = 0;
  6035. }
  6036. }
  6037. };
  6038. var UPDATE_QUEUEING = {
  6039. initialize: function () {
  6040. this.callbackQueue.reset();
  6041. },
  6042. close: function () {
  6043. this.callbackQueue.notifyAll();
  6044. }
  6045. };
  6046. var TRANSACTION_WRAPPERS = [NESTED_UPDATES, UPDATE_QUEUEING];
  6047. function ReactUpdatesFlushTransaction() {
  6048. this.reinitializeTransaction();
  6049. this.dirtyComponentsLength = null;
  6050. this.callbackQueue = CallbackQueue.getPooled();
  6051. this.reconcileTransaction = ReactUpdates.ReactReconcileTransaction.getPooled(
  6052. /* useCreateElement */true);
  6053. }
  6054. _assign(ReactUpdatesFlushTransaction.prototype, Transaction.Mixin, {
  6055. getTransactionWrappers: function () {
  6056. return TRANSACTION_WRAPPERS;
  6057. },
  6058. destructor: function () {
  6059. this.dirtyComponentsLength = null;
  6060. CallbackQueue.release(this.callbackQueue);
  6061. this.callbackQueue = null;
  6062. ReactUpdates.ReactReconcileTransaction.release(this.reconcileTransaction);
  6063. this.reconcileTransaction = null;
  6064. },
  6065. perform: function (method, scope, a) {
  6066. // Essentially calls `this.reconcileTransaction.perform(method, scope, a)`
  6067. // with this transaction's wrappers around it.
  6068. return Transaction.Mixin.perform.call(this, this.reconcileTransaction.perform, this.reconcileTransaction, method, scope, a);
  6069. }
  6070. });
  6071. PooledClass.addPoolingTo(ReactUpdatesFlushTransaction);
  6072. function batchedUpdates(callback, a, b, c, d, e) {
  6073. ensureInjected();
  6074. batchingStrategy.batchedUpdates(callback, a, b, c, d, e);
  6075. }
  6076. /**
  6077. * Array comparator for ReactComponents by mount ordering.
  6078. *
  6079. * @param {ReactComponent} c1 first component you're comparing
  6080. * @param {ReactComponent} c2 second component you're comparing
  6081. * @return {number} Return value usable by Array.prototype.sort().
  6082. */
  6083. function mountOrderComparator(c1, c2) {
  6084. return c1._mountOrder - c2._mountOrder;
  6085. }
  6086. function runBatchedUpdates(transaction) {
  6087. var len = transaction.dirtyComponentsLength;
  6088. !(len === dirtyComponents.length) ? false ? invariant(false, 'Expected flush transaction\'s stored dirty-components length (%s) to ' + 'match dirty-components array length (%s).', len, dirtyComponents.length) : invariant(false) : void 0;
  6089. // Since reconciling a component higher in the owner hierarchy usually (not
  6090. // always -- see shouldComponentUpdate()) will reconcile children, reconcile
  6091. // them before their children by sorting the array.
  6092. dirtyComponents.sort(mountOrderComparator);
  6093. // Any updates enqueued while reconciling must be performed after this entire
  6094. // batch. Otherwise, if dirtyComponents is [A, B] where A has children B and
  6095. // C, B could update twice in a single batch if C's render enqueues an update
  6096. // to B (since B would have already updated, we should skip it, and the only
  6097. // way we can know to do so is by checking the batch counter).
  6098. updateBatchNumber++;
  6099. for (var i = 0; i < len; i++) {
  6100. // If a component is unmounted before pending changes apply, it will still
  6101. // be here, but we assume that it has cleared its _pendingCallbacks and
  6102. // that performUpdateIfNecessary is a noop.
  6103. var component = dirtyComponents[i];
  6104. // If performUpdateIfNecessary happens to enqueue any new updates, we
  6105. // shouldn't execute the callbacks until the next render happens, so
  6106. // stash the callbacks first
  6107. var callbacks = component._pendingCallbacks;
  6108. component._pendingCallbacks = null;
  6109. var markerName;
  6110. if (ReactFeatureFlags.logTopLevelRenders) {
  6111. var namedComponent = component;
  6112. // Duck type TopLevelWrapper. This is probably always true.
  6113. if (component._currentElement.props === component._renderedComponent._currentElement) {
  6114. namedComponent = component._renderedComponent;
  6115. }
  6116. markerName = 'React update: ' + namedComponent.getName();
  6117. console.time(markerName);
  6118. }
  6119. ReactReconciler.performUpdateIfNecessary(component, transaction.reconcileTransaction, updateBatchNumber);
  6120. if (markerName) {
  6121. console.timeEnd(markerName);
  6122. }
  6123. if (callbacks) {
  6124. for (var j = 0; j < callbacks.length; j++) {
  6125. transaction.callbackQueue.enqueue(callbacks[j], component.getPublicInstance());
  6126. }
  6127. }
  6128. }
  6129. }
  6130. var flushBatchedUpdates = function () {
  6131. if (false) {
  6132. ReactInstrumentation.debugTool.onBeginFlush();
  6133. }
  6134. // ReactUpdatesFlushTransaction's wrappers will clear the dirtyComponents
  6135. // array and perform any updates enqueued by mount-ready handlers (i.e.,
  6136. // componentDidUpdate) but we need to check here too in order to catch
  6137. // updates enqueued by setState callbacks and asap calls.
  6138. while (dirtyComponents.length || asapEnqueued) {
  6139. if (dirtyComponents.length) {
  6140. var transaction = ReactUpdatesFlushTransaction.getPooled();
  6141. transaction.perform(runBatchedUpdates, null, transaction);
  6142. ReactUpdatesFlushTransaction.release(transaction);
  6143. }
  6144. if (asapEnqueued) {
  6145. asapEnqueued = false;
  6146. var queue = asapCallbackQueue;
  6147. asapCallbackQueue = CallbackQueue.getPooled();
  6148. queue.notifyAll();
  6149. CallbackQueue.release(queue);
  6150. }
  6151. }
  6152. if (false) {
  6153. ReactInstrumentation.debugTool.onEndFlush();
  6154. }
  6155. };
  6156. /**
  6157. * Mark a component as needing a rerender, adding an optional callback to a
  6158. * list of functions which will be executed once the rerender occurs.
  6159. */
  6160. function enqueueUpdate(component) {
  6161. ensureInjected();
  6162. // Various parts of our code (such as ReactCompositeComponent's
  6163. // _renderValidatedComponent) assume that calls to render aren't nested;
  6164. // verify that that's the case. (This is called by each top-level update
  6165. // function, like setProps, setState, forceUpdate, etc.; creation and
  6166. // destruction of top-level components is guarded in ReactMount.)
  6167. if (!batchingStrategy.isBatchingUpdates) {
  6168. batchingStrategy.batchedUpdates(enqueueUpdate, component);
  6169. return;
  6170. }
  6171. dirtyComponents.push(component);
  6172. if (component._updateBatchNumber == null) {
  6173. component._updateBatchNumber = updateBatchNumber + 1;
  6174. }
  6175. }
  6176. /**
  6177. * Enqueue a callback to be run at the end of the current batching cycle. Throws
  6178. * if no updates are currently being performed.
  6179. */
  6180. function asap(callback, context) {
  6181. !batchingStrategy.isBatchingUpdates ? false ? invariant(false, 'ReactUpdates.asap: Can\'t enqueue an asap callback in a context where' + 'updates are not being batched.') : invariant(false) : void 0;
  6182. asapCallbackQueue.enqueue(callback, context);
  6183. asapEnqueued = true;
  6184. }
  6185. var ReactUpdatesInjection = {
  6186. injectReconcileTransaction: function (ReconcileTransaction) {
  6187. !ReconcileTransaction ? false ? invariant(false, 'ReactUpdates: must provide a reconcile transaction class') : invariant(false) : void 0;
  6188. ReactUpdates.ReactReconcileTransaction = ReconcileTransaction;
  6189. },
  6190. injectBatchingStrategy: function (_batchingStrategy) {
  6191. !_batchingStrategy ? false ? invariant(false, 'ReactUpdates: must provide a batching strategy') : invariant(false) : void 0;
  6192. !(typeof _batchingStrategy.batchedUpdates === 'function') ? false ? invariant(false, 'ReactUpdates: must provide a batchedUpdates() function') : invariant(false) : void 0;
  6193. !(typeof _batchingStrategy.isBatchingUpdates === 'boolean') ? false ? invariant(false, 'ReactUpdates: must provide an isBatchingUpdates boolean attribute') : invariant(false) : void 0;
  6194. batchingStrategy = _batchingStrategy;
  6195. }
  6196. };
  6197. var ReactUpdates = {
  6198. /**
  6199. * React references `ReactReconcileTransaction` using this property in order
  6200. * to allow dependency injection.
  6201. *
  6202. * @internal
  6203. */
  6204. ReactReconcileTransaction: null,
  6205. batchedUpdates: batchedUpdates,
  6206. enqueueUpdate: enqueueUpdate,
  6207. flushBatchedUpdates: flushBatchedUpdates,
  6208. injection: ReactUpdatesInjection,
  6209. asap: asap
  6210. };
  6211. module.exports = ReactUpdates;
  6212. /***/ },
  6213. /* 56 */
  6214. /***/ function(module, exports, __webpack_require__) {
  6215. /**
  6216. * Copyright 2013-present, Facebook, Inc.
  6217. * All rights reserved.
  6218. *
  6219. * This source code is licensed under the BSD-style license found in the
  6220. * LICENSE file in the root directory of this source tree. An additional grant
  6221. * of patent rights can be found in the PATENTS file in the same directory.
  6222. *
  6223. * @providesModule CallbackQueue
  6224. */
  6225. 'use strict';
  6226. var _assign = __webpack_require__(3);
  6227. var PooledClass = __webpack_require__(5);
  6228. var invariant = __webpack_require__(6);
  6229. /**
  6230. * A specialized pseudo-event module to help keep track of components waiting to
  6231. * be notified when their DOM representations are available for use.
  6232. *
  6233. * This implements `PooledClass`, so you should never need to instantiate this.
  6234. * Instead, use `CallbackQueue.getPooled()`.
  6235. *
  6236. * @class ReactMountReady
  6237. * @implements PooledClass
  6238. * @internal
  6239. */
  6240. function CallbackQueue() {
  6241. this._callbacks = null;
  6242. this._contexts = null;
  6243. }
  6244. _assign(CallbackQueue.prototype, {
  6245. /**
  6246. * Enqueues a callback to be invoked when `notifyAll` is invoked.
  6247. *
  6248. * @param {function} callback Invoked when `notifyAll` is invoked.
  6249. * @param {?object} context Context to call `callback` with.
  6250. * @internal
  6251. */
  6252. enqueue: function (callback, context) {
  6253. this._callbacks = this._callbacks || [];
  6254. this._contexts = this._contexts || [];
  6255. this._callbacks.push(callback);
  6256. this._contexts.push(context);
  6257. },
  6258. /**
  6259. * Invokes all enqueued callbacks and clears the queue. This is invoked after
  6260. * the DOM representation of a component has been created or updated.
  6261. *
  6262. * @internal
  6263. */
  6264. notifyAll: function () {
  6265. var callbacks = this._callbacks;
  6266. var contexts = this._contexts;
  6267. if (callbacks) {
  6268. !(callbacks.length === contexts.length) ? false ? invariant(false, 'Mismatched list of contexts in callback queue') : invariant(false) : void 0;
  6269. this._callbacks = null;
  6270. this._contexts = null;
  6271. for (var i = 0; i < callbacks.length; i++) {
  6272. callbacks[i].call(contexts[i]);
  6273. }
  6274. callbacks.length = 0;
  6275. contexts.length = 0;
  6276. }
  6277. },
  6278. checkpoint: function () {
  6279. return this._callbacks ? this._callbacks.length : 0;
  6280. },
  6281. rollback: function (len) {
  6282. if (this._callbacks) {
  6283. this._callbacks.length = len;
  6284. this._contexts.length = len;
  6285. }
  6286. },
  6287. /**
  6288. * Resets the internal queue.
  6289. *
  6290. * @internal
  6291. */
  6292. reset: function () {
  6293. this._callbacks = null;
  6294. this._contexts = null;
  6295. },
  6296. /**
  6297. * `PooledClass` looks for this.
  6298. */
  6299. destructor: function () {
  6300. this.reset();
  6301. }
  6302. });
  6303. PooledClass.addPoolingTo(CallbackQueue);
  6304. module.exports = CallbackQueue;
  6305. /***/ },
  6306. /* 57 */
  6307. /***/ function(module, exports) {
  6308. /**
  6309. * Copyright 2013-present, Facebook, Inc.
  6310. * All rights reserved.
  6311. *
  6312. * This source code is licensed under the BSD-style license found in the
  6313. * LICENSE file in the root directory of this source tree. An additional grant
  6314. * of patent rights can be found in the PATENTS file in the same directory.
  6315. *
  6316. * @providesModule ReactFeatureFlags
  6317. */
  6318. 'use strict';
  6319. var ReactFeatureFlags = {
  6320. // When true, call console.time() before and .timeEnd() after each top-level
  6321. // render (both initial renders and updates). Useful when looking at prod-mode
  6322. // timeline profiles in Chrome, for example.
  6323. logTopLevelRenders: false
  6324. };
  6325. module.exports = ReactFeatureFlags;
  6326. /***/ },
  6327. /* 58 */
  6328. /***/ function(module, exports, __webpack_require__) {
  6329. /**
  6330. * Copyright 2013-present, Facebook, Inc.
  6331. * All rights reserved.
  6332. *
  6333. * This source code is licensed under the BSD-style license found in the
  6334. * LICENSE file in the root directory of this source tree. An additional grant
  6335. * of patent rights can be found in the PATENTS file in the same directory.
  6336. *
  6337. * @providesModule ReactReconciler
  6338. */
  6339. 'use strict';
  6340. var ReactRef = __webpack_require__(59);
  6341. var ReactInstrumentation = __webpack_require__(17);
  6342. var invariant = __webpack_require__(6);
  6343. /**
  6344. * Helper to call ReactRef.attachRefs with this composite component, split out
  6345. * to avoid allocations in the transaction mount-ready queue.
  6346. */
  6347. function attachRefs() {
  6348. ReactRef.attachRefs(this, this._currentElement);
  6349. }
  6350. var ReactReconciler = {
  6351. /**
  6352. * Initializes the component, renders markup, and registers event listeners.
  6353. *
  6354. * @param {ReactComponent} internalInstance
  6355. * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
  6356. * @param {?object} the containing native component instance
  6357. * @param {?object} info about the native container
  6358. * @return {?string} Rendered markup to be inserted into the DOM.
  6359. * @final
  6360. * @internal
  6361. */
  6362. mountComponent: function (internalInstance, transaction, nativeParent, nativeContainerInfo, context) {
  6363. if (false) {
  6364. if (internalInstance._debugID !== 0) {
  6365. ReactInstrumentation.debugTool.onBeginReconcilerTimer(internalInstance._debugID, 'mountComponent');
  6366. }
  6367. }
  6368. var markup = internalInstance.mountComponent(transaction, nativeParent, nativeContainerInfo, context);
  6369. if (internalInstance._currentElement && internalInstance._currentElement.ref != null) {
  6370. transaction.getReactMountReady().enqueue(attachRefs, internalInstance);
  6371. }
  6372. if (false) {
  6373. if (internalInstance._debugID !== 0) {
  6374. ReactInstrumentation.debugTool.onEndReconcilerTimer(internalInstance._debugID, 'mountComponent');
  6375. ReactInstrumentation.debugTool.onMountComponent(internalInstance._debugID);
  6376. }
  6377. }
  6378. return markup;
  6379. },
  6380. /**
  6381. * Returns a value that can be passed to
  6382. * ReactComponentEnvironment.replaceNodeWithMarkup.
  6383. */
  6384. getNativeNode: function (internalInstance) {
  6385. return internalInstance.getNativeNode();
  6386. },
  6387. /**
  6388. * Releases any resources allocated by `mountComponent`.
  6389. *
  6390. * @final
  6391. * @internal
  6392. */
  6393. unmountComponent: function (internalInstance, safely) {
  6394. if (false) {
  6395. if (internalInstance._debugID !== 0) {
  6396. ReactInstrumentation.debugTool.onBeginReconcilerTimer(internalInstance._debugID, 'unmountComponent');
  6397. }
  6398. }
  6399. ReactRef.detachRefs(internalInstance, internalInstance._currentElement);
  6400. internalInstance.unmountComponent(safely);
  6401. if (false) {
  6402. if (internalInstance._debugID !== 0) {
  6403. ReactInstrumentation.debugTool.onEndReconcilerTimer(internalInstance._debugID, 'unmountComponent');
  6404. ReactInstrumentation.debugTool.onUnmountComponent(internalInstance._debugID);
  6405. }
  6406. }
  6407. },
  6408. /**
  6409. * Update a component using a new element.
  6410. *
  6411. * @param {ReactComponent} internalInstance
  6412. * @param {ReactElement} nextElement
  6413. * @param {ReactReconcileTransaction} transaction
  6414. * @param {object} context
  6415. * @internal
  6416. */
  6417. receiveComponent: function (internalInstance, nextElement, transaction, context) {
  6418. var prevElement = internalInstance._currentElement;
  6419. if (nextElement === prevElement && context === internalInstance._context) {
  6420. // Since elements are immutable after the owner is rendered,
  6421. // we can do a cheap identity compare here to determine if this is a
  6422. // superfluous reconcile. It's possible for state to be mutable but such
  6423. // change should trigger an update of the owner which would recreate
  6424. // the element. We explicitly check for the existence of an owner since
  6425. // it's possible for an element created outside a composite to be
  6426. // deeply mutated and reused.
  6427. // TODO: Bailing out early is just a perf optimization right?
  6428. // TODO: Removing the return statement should affect correctness?
  6429. return;
  6430. }
  6431. if (false) {
  6432. if (internalInstance._debugID !== 0) {
  6433. ReactInstrumentation.debugTool.onBeginReconcilerTimer(internalInstance._debugID, 'receiveComponent');
  6434. }
  6435. }
  6436. var refsChanged = ReactRef.shouldUpdateRefs(prevElement, nextElement);
  6437. if (refsChanged) {
  6438. ReactRef.detachRefs(internalInstance, prevElement);
  6439. }
  6440. internalInstance.receiveComponent(nextElement, transaction, context);
  6441. if (refsChanged && internalInstance._currentElement && internalInstance._currentElement.ref != null) {
  6442. transaction.getReactMountReady().enqueue(attachRefs, internalInstance);
  6443. }
  6444. if (false) {
  6445. if (internalInstance._debugID !== 0) {
  6446. ReactInstrumentation.debugTool.onEndReconcilerTimer(internalInstance._debugID, 'receiveComponent');
  6447. ReactInstrumentation.debugTool.onUpdateComponent(internalInstance._debugID);
  6448. }
  6449. }
  6450. },
  6451. /**
  6452. * Flush any dirty changes in a component.
  6453. *
  6454. * @param {ReactComponent} internalInstance
  6455. * @param {ReactReconcileTransaction} transaction
  6456. * @internal
  6457. */
  6458. performUpdateIfNecessary: function (internalInstance, transaction, updateBatchNumber) {
  6459. if (internalInstance._updateBatchNumber !== updateBatchNumber) {
  6460. // The component's enqueued batch number should always be the current
  6461. // batch or the following one.
  6462. !(internalInstance._updateBatchNumber == null || internalInstance._updateBatchNumber === updateBatchNumber + 1) ? false ? invariant(false, 'performUpdateIfNecessary: Unexpected batch number (current %s, ' + 'pending %s)', updateBatchNumber, internalInstance._updateBatchNumber) : invariant(false) : void 0;
  6463. return;
  6464. }
  6465. if (false) {
  6466. if (internalInstance._debugID !== 0) {
  6467. ReactInstrumentation.debugTool.onBeginReconcilerTimer(internalInstance._debugID, 'performUpdateIfNecessary');
  6468. }
  6469. }
  6470. internalInstance.performUpdateIfNecessary(transaction);
  6471. if (false) {
  6472. if (internalInstance._debugID !== 0) {
  6473. ReactInstrumentation.debugTool.onEndReconcilerTimer(internalInstance._debugID, 'performUpdateIfNecessary');
  6474. ReactInstrumentation.debugTool.onUpdateComponent(internalInstance._debugID);
  6475. }
  6476. }
  6477. }
  6478. };
  6479. module.exports = ReactReconciler;
  6480. /***/ },
  6481. /* 59 */
  6482. /***/ function(module, exports, __webpack_require__) {
  6483. /**
  6484. * Copyright 2013-present, Facebook, Inc.
  6485. * All rights reserved.
  6486. *
  6487. * This source code is licensed under the BSD-style license found in the
  6488. * LICENSE file in the root directory of this source tree. An additional grant
  6489. * of patent rights can be found in the PATENTS file in the same directory.
  6490. *
  6491. * @providesModule ReactRef
  6492. */
  6493. 'use strict';
  6494. var ReactOwner = __webpack_require__(60);
  6495. var ReactRef = {};
  6496. function attachRef(ref, component, owner) {
  6497. if (typeof ref === 'function') {
  6498. ref(component.getPublicInstance());
  6499. } else {
  6500. // Legacy ref
  6501. ReactOwner.addComponentAsRefTo(component, ref, owner);
  6502. }
  6503. }
  6504. function detachRef(ref, component, owner) {
  6505. if (typeof ref === 'function') {
  6506. ref(null);
  6507. } else {
  6508. // Legacy ref
  6509. ReactOwner.removeComponentAsRefFrom(component, ref, owner);
  6510. }
  6511. }
  6512. ReactRef.attachRefs = function (instance, element) {
  6513. if (element === null || element === false) {
  6514. return;
  6515. }
  6516. var ref = element.ref;
  6517. if (ref != null) {
  6518. attachRef(ref, instance, element._owner);
  6519. }
  6520. };
  6521. ReactRef.shouldUpdateRefs = function (prevElement, nextElement) {
  6522. // If either the owner or a `ref` has changed, make sure the newest owner
  6523. // has stored a reference to `this`, and the previous owner (if different)
  6524. // has forgotten the reference to `this`. We use the element instead
  6525. // of the public this.props because the post processing cannot determine
  6526. // a ref. The ref conceptually lives on the element.
  6527. // TODO: Should this even be possible? The owner cannot change because
  6528. // it's forbidden by shouldUpdateReactComponent. The ref can change
  6529. // if you swap the keys of but not the refs. Reconsider where this check
  6530. // is made. It probably belongs where the key checking and
  6531. // instantiateReactComponent is done.
  6532. var prevEmpty = prevElement === null || prevElement === false;
  6533. var nextEmpty = nextElement === null || nextElement === false;
  6534. return(
  6535. // This has a few false positives w/r/t empty components.
  6536. prevEmpty || nextEmpty || nextElement._owner !== prevElement._owner || nextElement.ref !== prevElement.ref
  6537. );
  6538. };
  6539. ReactRef.detachRefs = function (instance, element) {
  6540. if (element === null || element === false) {
  6541. return;
  6542. }
  6543. var ref = element.ref;
  6544. if (ref != null) {
  6545. detachRef(ref, instance, element._owner);
  6546. }
  6547. };
  6548. module.exports = ReactRef;
  6549. /***/ },
  6550. /* 60 */
  6551. /***/ function(module, exports, __webpack_require__) {
  6552. /**
  6553. * Copyright 2013-present, Facebook, Inc.
  6554. * All rights reserved.
  6555. *
  6556. * This source code is licensed under the BSD-style license found in the
  6557. * LICENSE file in the root directory of this source tree. An additional grant
  6558. * of patent rights can be found in the PATENTS file in the same directory.
  6559. *
  6560. * @providesModule ReactOwner
  6561. */
  6562. 'use strict';
  6563. var invariant = __webpack_require__(6);
  6564. /**
  6565. * ReactOwners are capable of storing references to owned components.
  6566. *
  6567. * All components are capable of //being// referenced by owner components, but
  6568. * only ReactOwner components are capable of //referencing// owned components.
  6569. * The named reference is known as a "ref".
  6570. *
  6571. * Refs are available when mounted and updated during reconciliation.
  6572. *
  6573. * var MyComponent = React.createClass({
  6574. * render: function() {
  6575. * return (
  6576. * <div onClick={this.handleClick}>
  6577. * <CustomComponent ref="custom" />
  6578. * </div>
  6579. * );
  6580. * },
  6581. * handleClick: function() {
  6582. * this.refs.custom.handleClick();
  6583. * },
  6584. * componentDidMount: function() {
  6585. * this.refs.custom.initialize();
  6586. * }
  6587. * });
  6588. *
  6589. * Refs should rarely be used. When refs are used, they should only be done to
  6590. * control data that is not handled by React's data flow.
  6591. *
  6592. * @class ReactOwner
  6593. */
  6594. var ReactOwner = {
  6595. /**
  6596. * @param {?object} object
  6597. * @return {boolean} True if `object` is a valid owner.
  6598. * @final
  6599. */
  6600. isValidOwner: function (object) {
  6601. return !!(object && typeof object.attachRef === 'function' && typeof object.detachRef === 'function');
  6602. },
  6603. /**
  6604. * Adds a component by ref to an owner component.
  6605. *
  6606. * @param {ReactComponent} component Component to reference.
  6607. * @param {string} ref Name by which to refer to the component.
  6608. * @param {ReactOwner} owner Component on which to record the ref.
  6609. * @final
  6610. * @internal
  6611. */
  6612. addComponentAsRefTo: function (component, ref, owner) {
  6613. !ReactOwner.isValidOwner(owner) ? false ? invariant(false, 'addComponentAsRefTo(...): Only a ReactOwner can have refs. You might ' + 'be adding a ref to a component that was not created inside a component\'s ' + '`render` method, or you have multiple copies of React loaded ' + '(details: https://fb.me/react-refs-must-have-owner).') : invariant(false) : void 0;
  6614. owner.attachRef(ref, component);
  6615. },
  6616. /**
  6617. * Removes a component by ref from an owner component.
  6618. *
  6619. * @param {ReactComponent} component Component to dereference.
  6620. * @param {string} ref Name of the ref to remove.
  6621. * @param {ReactOwner} owner Component on which the ref is recorded.
  6622. * @final
  6623. * @internal
  6624. */
  6625. removeComponentAsRefFrom: function (component, ref, owner) {
  6626. !ReactOwner.isValidOwner(owner) ? false ? invariant(false, 'removeComponentAsRefFrom(...): Only a ReactOwner can have refs. You might ' + 'be removing a ref to a component that was not created inside a component\'s ' + '`render` method, or you have multiple copies of React loaded ' + '(details: https://fb.me/react-refs-must-have-owner).') : invariant(false) : void 0;
  6627. var ownerPublicInstance = owner.getPublicInstance();
  6628. // Check that `component`'s owner is still alive and that `component` is still the current ref
  6629. // because we do not want to detach the ref if another component stole it.
  6630. if (ownerPublicInstance && ownerPublicInstance.refs[ref] === component.getPublicInstance()) {
  6631. owner.detachRef(ref);
  6632. }
  6633. }
  6634. };
  6635. module.exports = ReactOwner;
  6636. /***/ },
  6637. /* 61 */
  6638. /***/ function(module, exports, __webpack_require__) {
  6639. /**
  6640. * Copyright 2013-present, Facebook, Inc.
  6641. * All rights reserved.
  6642. *
  6643. * This source code is licensed under the BSD-style license found in the
  6644. * LICENSE file in the root directory of this source tree. An additional grant
  6645. * of patent rights can be found in the PATENTS file in the same directory.
  6646. *
  6647. * @providesModule Transaction
  6648. */
  6649. 'use strict';
  6650. var invariant = __webpack_require__(6);
  6651. /**
  6652. * `Transaction` creates a black box that is able to wrap any method such that
  6653. * certain invariants are maintained before and after the method is invoked
  6654. * (Even if an exception is thrown while invoking the wrapped method). Whoever
  6655. * instantiates a transaction can provide enforcers of the invariants at
  6656. * creation time. The `Transaction` class itself will supply one additional
  6657. * automatic invariant for you - the invariant that any transaction instance
  6658. * should not be run while it is already being run. You would typically create a
  6659. * single instance of a `Transaction` for reuse multiple times, that potentially
  6660. * is used to wrap several different methods. Wrappers are extremely simple -
  6661. * they only require implementing two methods.
  6662. *
  6663. * <pre>
  6664. * wrappers (injected at creation time)
  6665. * + +
  6666. * | |
  6667. * +-----------------|--------|--------------+
  6668. * | v | |
  6669. * | +---------------+ | |
  6670. * | +--| wrapper1 |---|----+ |
  6671. * | | +---------------+ v | |
  6672. * | | +-------------+ | |
  6673. * | | +----| wrapper2 |--------+ |
  6674. * | | | +-------------+ | | |
  6675. * | | | | | |
  6676. * | v v v v | wrapper
  6677. * | +---+ +---+ +---------+ +---+ +---+ | invariants
  6678. * perform(anyMethod) | | | | | | | | | | | | maintained
  6679. * +----------------->|-|---|-|---|-->|anyMethod|---|---|-|---|-|-------->
  6680. * | | | | | | | | | | | |
  6681. * | | | | | | | | | | | |
  6682. * | | | | | | | | | | | |
  6683. * | +---+ +---+ +---------+ +---+ +---+ |
  6684. * | initialize close |
  6685. * +-----------------------------------------+
  6686. * </pre>
  6687. *
  6688. * Use cases:
  6689. * - Preserving the input selection ranges before/after reconciliation.
  6690. * Restoring selection even in the event of an unexpected error.
  6691. * - Deactivating events while rearranging the DOM, preventing blurs/focuses,
  6692. * while guaranteeing that afterwards, the event system is reactivated.
  6693. * - Flushing a queue of collected DOM mutations to the main UI thread after a
  6694. * reconciliation takes place in a worker thread.
  6695. * - Invoking any collected `componentDidUpdate` callbacks after rendering new
  6696. * content.
  6697. * - (Future use case): Wrapping particular flushes of the `ReactWorker` queue
  6698. * to preserve the `scrollTop` (an automatic scroll aware DOM).
  6699. * - (Future use case): Layout calculations before and after DOM updates.
  6700. *
  6701. * Transactional plugin API:
  6702. * - A module that has an `initialize` method that returns any precomputation.
  6703. * - and a `close` method that accepts the precomputation. `close` is invoked
  6704. * when the wrapped process is completed, or has failed.
  6705. *
  6706. * @param {Array<TransactionalWrapper>} transactionWrapper Wrapper modules
  6707. * that implement `initialize` and `close`.
  6708. * @return {Transaction} Single transaction for reuse in thread.
  6709. *
  6710. * @class Transaction
  6711. */
  6712. var Mixin = {
  6713. /**
  6714. * Sets up this instance so that it is prepared for collecting metrics. Does
  6715. * so such that this setup method may be used on an instance that is already
  6716. * initialized, in a way that does not consume additional memory upon reuse.
  6717. * That can be useful if you decide to make your subclass of this mixin a
  6718. * "PooledClass".
  6719. */
  6720. reinitializeTransaction: function () {
  6721. this.transactionWrappers = this.getTransactionWrappers();
  6722. if (this.wrapperInitData) {
  6723. this.wrapperInitData.length = 0;
  6724. } else {
  6725. this.wrapperInitData = [];
  6726. }
  6727. this._isInTransaction = false;
  6728. },
  6729. _isInTransaction: false,
  6730. /**
  6731. * @abstract
  6732. * @return {Array<TransactionWrapper>} Array of transaction wrappers.
  6733. */
  6734. getTransactionWrappers: null,
  6735. isInTransaction: function () {
  6736. return !!this._isInTransaction;
  6737. },
  6738. /**
  6739. * Executes the function within a safety window. Use this for the top level
  6740. * methods that result in large amounts of computation/mutations that would
  6741. * need to be safety checked. The optional arguments helps prevent the need
  6742. * to bind in many cases.
  6743. *
  6744. * @param {function} method Member of scope to call.
  6745. * @param {Object} scope Scope to invoke from.
  6746. * @param {Object?=} a Argument to pass to the method.
  6747. * @param {Object?=} b Argument to pass to the method.
  6748. * @param {Object?=} c Argument to pass to the method.
  6749. * @param {Object?=} d Argument to pass to the method.
  6750. * @param {Object?=} e Argument to pass to the method.
  6751. * @param {Object?=} f Argument to pass to the method.
  6752. *
  6753. * @return {*} Return value from `method`.
  6754. */
  6755. perform: function (method, scope, a, b, c, d, e, f) {
  6756. !!this.isInTransaction() ? false ? invariant(false, 'Transaction.perform(...): Cannot initialize a transaction when there ' + 'is already an outstanding transaction.') : invariant(false) : void 0;
  6757. var errorThrown;
  6758. var ret;
  6759. try {
  6760. this._isInTransaction = true;
  6761. // Catching errors makes debugging more difficult, so we start with
  6762. // errorThrown set to true before setting it to false after calling
  6763. // close -- if it's still set to true in the finally block, it means
  6764. // one of these calls threw.
  6765. errorThrown = true;
  6766. this.initializeAll(0);
  6767. ret = method.call(scope, a, b, c, d, e, f);
  6768. errorThrown = false;
  6769. } finally {
  6770. try {
  6771. if (errorThrown) {
  6772. // If `method` throws, prefer to show that stack trace over any thrown
  6773. // by invoking `closeAll`.
  6774. try {
  6775. this.closeAll(0);
  6776. } catch (err) {}
  6777. } else {
  6778. // Since `method` didn't throw, we don't want to silence the exception
  6779. // here.
  6780. this.closeAll(0);
  6781. }
  6782. } finally {
  6783. this._isInTransaction = false;
  6784. }
  6785. }
  6786. return ret;
  6787. },
  6788. initializeAll: function (startIndex) {
  6789. var transactionWrappers = this.transactionWrappers;
  6790. for (var i = startIndex; i < transactionWrappers.length; i++) {
  6791. var wrapper = transactionWrappers[i];
  6792. try {
  6793. // Catching errors makes debugging more difficult, so we start with the
  6794. // OBSERVED_ERROR state before overwriting it with the real return value
  6795. // of initialize -- if it's still set to OBSERVED_ERROR in the finally
  6796. // block, it means wrapper.initialize threw.
  6797. this.wrapperInitData[i] = Transaction.OBSERVED_ERROR;
  6798. this.wrapperInitData[i] = wrapper.initialize ? wrapper.initialize.call(this) : null;
  6799. } finally {
  6800. if (this.wrapperInitData[i] === Transaction.OBSERVED_ERROR) {
  6801. // The initializer for wrapper i threw an error; initialize the
  6802. // remaining wrappers but silence any exceptions from them to ensure
  6803. // that the first error is the one to bubble up.
  6804. try {
  6805. this.initializeAll(i + 1);
  6806. } catch (err) {}
  6807. }
  6808. }
  6809. }
  6810. },
  6811. /**
  6812. * Invokes each of `this.transactionWrappers.close[i]` functions, passing into
  6813. * them the respective return values of `this.transactionWrappers.init[i]`
  6814. * (`close`rs that correspond to initializers that failed will not be
  6815. * invoked).
  6816. */
  6817. closeAll: function (startIndex) {
  6818. !this.isInTransaction() ? false ? invariant(false, 'Transaction.closeAll(): Cannot close transaction when none are open.') : invariant(false) : void 0;
  6819. var transactionWrappers = this.transactionWrappers;
  6820. for (var i = startIndex; i < transactionWrappers.length; i++) {
  6821. var wrapper = transactionWrappers[i];
  6822. var initData = this.wrapperInitData[i];
  6823. var errorThrown;
  6824. try {
  6825. // Catching errors makes debugging more difficult, so we start with
  6826. // errorThrown set to true before setting it to false after calling
  6827. // close -- if it's still set to true in the finally block, it means
  6828. // wrapper.close threw.
  6829. errorThrown = true;
  6830. if (initData !== Transaction.OBSERVED_ERROR && wrapper.close) {
  6831. wrapper.close.call(this, initData);
  6832. }
  6833. errorThrown = false;
  6834. } finally {
  6835. if (errorThrown) {
  6836. // The closer for wrapper i threw an error; close the remaining
  6837. // wrappers but silence any exceptions from them to ensure that the
  6838. // first error is the one to bubble up.
  6839. try {
  6840. this.closeAll(i + 1);
  6841. } catch (e) {}
  6842. }
  6843. }
  6844. }
  6845. this.wrapperInitData.length = 0;
  6846. }
  6847. };
  6848. var Transaction = {
  6849. Mixin: Mixin,
  6850. /**
  6851. * Token to look for to determine if an error occurred.
  6852. */
  6853. OBSERVED_ERROR: {}
  6854. };
  6855. module.exports = Transaction;
  6856. /***/ },
  6857. /* 62 */
  6858. /***/ function(module, exports) {
  6859. /**
  6860. * Copyright 2013-present, Facebook, Inc.
  6861. * All rights reserved.
  6862. *
  6863. * This source code is licensed under the BSD-style license found in the
  6864. * LICENSE file in the root directory of this source tree. An additional grant
  6865. * of patent rights can be found in the PATENTS file in the same directory.
  6866. *
  6867. * @providesModule getEventTarget
  6868. */
  6869. 'use strict';
  6870. /**
  6871. * Gets the target node from a native browser event by accounting for
  6872. * inconsistencies in browser DOM APIs.
  6873. *
  6874. * @param {object} nativeEvent Native browser event.
  6875. * @return {DOMEventTarget} Target node.
  6876. */
  6877. function getEventTarget(nativeEvent) {
  6878. var target = nativeEvent.target || nativeEvent.srcElement || window;
  6879. // Normalize SVG <use> element events #4963
  6880. if (target.correspondingUseElement) {
  6881. target = target.correspondingUseElement;
  6882. }
  6883. // Safari may fire events on text nodes (Node.TEXT_NODE is 3).
  6884. // @see http://www.quirksmode.org/js/events_properties.html
  6885. return target.nodeType === 3 ? target.parentNode : target;
  6886. }
  6887. module.exports = getEventTarget;
  6888. /***/ },
  6889. /* 63 */
  6890. /***/ function(module, exports, __webpack_require__) {
  6891. /**
  6892. * Copyright 2013-present, Facebook, Inc.
  6893. * All rights reserved.
  6894. *
  6895. * This source code is licensed under the BSD-style license found in the
  6896. * LICENSE file in the root directory of this source tree. An additional grant
  6897. * of patent rights can be found in the PATENTS file in the same directory.
  6898. *
  6899. * @providesModule isEventSupported
  6900. */
  6901. 'use strict';
  6902. var ExecutionEnvironment = __webpack_require__(19);
  6903. var useHasFeature;
  6904. if (ExecutionEnvironment.canUseDOM) {
  6905. useHasFeature = document.implementation && document.implementation.hasFeature &&
  6906. // always returns true in newer browsers as per the standard.
  6907. // @see http://dom.spec.whatwg.org/#dom-domimplementation-hasfeature
  6908. document.implementation.hasFeature('', '') !== true;
  6909. }
  6910. /**
  6911. * Checks if an event is supported in the current execution environment.
  6912. *
  6913. * NOTE: This will not work correctly for non-generic events such as `change`,
  6914. * `reset`, `load`, `error`, and `select`.
  6915. *
  6916. * Borrows from Modernizr.
  6917. *
  6918. * @param {string} eventNameSuffix Event name, e.g. "click".
  6919. * @param {?boolean} capture Check if the capture phase is supported.
  6920. * @return {boolean} True if the event is supported.
  6921. * @internal
  6922. * @license Modernizr 3.0.0pre (Custom Build) | MIT
  6923. */
  6924. function isEventSupported(eventNameSuffix, capture) {
  6925. if (!ExecutionEnvironment.canUseDOM || capture && !('addEventListener' in document)) {
  6926. return false;
  6927. }
  6928. var eventName = 'on' + eventNameSuffix;
  6929. var isSupported = eventName in document;
  6930. if (!isSupported) {
  6931. var element = document.createElement('div');
  6932. element.setAttribute(eventName, 'return;');
  6933. isSupported = typeof element[eventName] === 'function';
  6934. }
  6935. if (!isSupported && useHasFeature && eventNameSuffix === 'wheel') {
  6936. // This is the only way to test support for the `wheel` event in IE9+.
  6937. isSupported = document.implementation.hasFeature('Events.wheel', '3.0');
  6938. }
  6939. return isSupported;
  6940. }
  6941. module.exports = isEventSupported;
  6942. /***/ },
  6943. /* 64 */
  6944. /***/ function(module, exports) {
  6945. /**
  6946. * Copyright 2013-present, Facebook, Inc.
  6947. * All rights reserved.
  6948. *
  6949. * This source code is licensed under the BSD-style license found in the
  6950. * LICENSE file in the root directory of this source tree. An additional grant
  6951. * of patent rights can be found in the PATENTS file in the same directory.
  6952. *
  6953. * @providesModule isTextInputElement
  6954. */
  6955. 'use strict';
  6956. /**
  6957. * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#input-type-attr-summary
  6958. */
  6959. var supportedInputTypes = {
  6960. 'color': true,
  6961. 'date': true,
  6962. 'datetime': true,
  6963. 'datetime-local': true,
  6964. 'email': true,
  6965. 'month': true,
  6966. 'number': true,
  6967. 'password': true,
  6968. 'range': true,
  6969. 'search': true,
  6970. 'tel': true,
  6971. 'text': true,
  6972. 'time': true,
  6973. 'url': true,
  6974. 'week': true
  6975. };
  6976. function isTextInputElement(elem) {
  6977. var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();
  6978. return nodeName && (nodeName === 'input' && supportedInputTypes[elem.type] || nodeName === 'textarea');
  6979. }
  6980. module.exports = isTextInputElement;
  6981. /***/ },
  6982. /* 65 */
  6983. /***/ function(module, exports, __webpack_require__) {
  6984. /**
  6985. * Copyright 2013-present, Facebook, Inc.
  6986. * All rights reserved.
  6987. *
  6988. * This source code is licensed under the BSD-style license found in the
  6989. * LICENSE file in the root directory of this source tree. An additional grant
  6990. * of patent rights can be found in the PATENTS file in the same directory.
  6991. *
  6992. * @providesModule DefaultEventPluginOrder
  6993. */
  6994. 'use strict';
  6995. var keyOf = __webpack_require__(27);
  6996. /**
  6997. * Module that is injectable into `EventPluginHub`, that specifies a
  6998. * deterministic ordering of `EventPlugin`s. A convenient way to reason about
  6999. * plugins, without having to package every one of them. This is better than
  7000. * having plugins be ordered in the same order that they are injected because
  7001. * that ordering would be influenced by the packaging order.
  7002. * `ResponderEventPlugin` must occur before `SimpleEventPlugin` so that
  7003. * preventing default on events is convenient in `SimpleEventPlugin` handlers.
  7004. */
  7005. var DefaultEventPluginOrder = [keyOf({ ResponderEventPlugin: null }), keyOf({ SimpleEventPlugin: null }), keyOf({ TapEventPlugin: null }), keyOf({ EnterLeaveEventPlugin: null }), keyOf({ ChangeEventPlugin: null }), keyOf({ SelectEventPlugin: null }), keyOf({ BeforeInputEventPlugin: null })];
  7006. module.exports = DefaultEventPluginOrder;
  7007. /***/ },
  7008. /* 66 */
  7009. /***/ function(module, exports, __webpack_require__) {
  7010. /**
  7011. * Copyright 2013-present, Facebook, Inc.
  7012. * All rights reserved.
  7013. *
  7014. * This source code is licensed under the BSD-style license found in the
  7015. * LICENSE file in the root directory of this source tree. An additional grant
  7016. * of patent rights can be found in the PATENTS file in the same directory.
  7017. *
  7018. * @providesModule EnterLeaveEventPlugin
  7019. */
  7020. 'use strict';
  7021. var EventConstants = __webpack_require__(41);
  7022. var EventPropagators = __webpack_require__(42);
  7023. var ReactDOMComponentTree = __webpack_require__(36);
  7024. var SyntheticMouseEvent = __webpack_require__(67);
  7025. var keyOf = __webpack_require__(27);
  7026. var topLevelTypes = EventConstants.topLevelTypes;
  7027. var eventTypes = {
  7028. mouseEnter: {
  7029. registrationName: keyOf({ onMouseEnter: null }),
  7030. dependencies: [topLevelTypes.topMouseOut, topLevelTypes.topMouseOver]
  7031. },
  7032. mouseLeave: {
  7033. registrationName: keyOf({ onMouseLeave: null }),
  7034. dependencies: [topLevelTypes.topMouseOut, topLevelTypes.topMouseOver]
  7035. }
  7036. };
  7037. var EnterLeaveEventPlugin = {
  7038. eventTypes: eventTypes,
  7039. /**
  7040. * For almost every interaction we care about, there will be both a top-level
  7041. * `mouseover` and `mouseout` event that occurs. Only use `mouseout` so that
  7042. * we do not extract duplicate events. However, moving the mouse into the
  7043. * browser from outside will not fire a `mouseout` event. In this case, we use
  7044. * the `mouseover` top-level event.
  7045. */
  7046. extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
  7047. if (topLevelType === topLevelTypes.topMouseOver && (nativeEvent.relatedTarget || nativeEvent.fromElement)) {
  7048. return null;
  7049. }
  7050. if (topLevelType !== topLevelTypes.topMouseOut && topLevelType !== topLevelTypes.topMouseOver) {
  7051. // Must not be a mouse in or mouse out - ignoring.
  7052. return null;
  7053. }
  7054. var win;
  7055. if (nativeEventTarget.window === nativeEventTarget) {
  7056. // `nativeEventTarget` is probably a window object.
  7057. win = nativeEventTarget;
  7058. } else {
  7059. // TODO: Figure out why `ownerDocument` is sometimes undefined in IE8.
  7060. var doc = nativeEventTarget.ownerDocument;
  7061. if (doc) {
  7062. win = doc.defaultView || doc.parentWindow;
  7063. } else {
  7064. win = window;
  7065. }
  7066. }
  7067. var from;
  7068. var to;
  7069. if (topLevelType === topLevelTypes.topMouseOut) {
  7070. from = targetInst;
  7071. var related = nativeEvent.relatedTarget || nativeEvent.toElement;
  7072. to = related ? ReactDOMComponentTree.getClosestInstanceFromNode(related) : null;
  7073. } else {
  7074. // Moving to a node from outside the window.
  7075. from = null;
  7076. to = targetInst;
  7077. }
  7078. if (from === to) {
  7079. // Nothing pertains to our managed components.
  7080. return null;
  7081. }
  7082. var fromNode = from == null ? win : ReactDOMComponentTree.getNodeFromInstance(from);
  7083. var toNode = to == null ? win : ReactDOMComponentTree.getNodeFromInstance(to);
  7084. var leave = SyntheticMouseEvent.getPooled(eventTypes.mouseLeave, from, nativeEvent, nativeEventTarget);
  7085. leave.type = 'mouseleave';
  7086. leave.target = fromNode;
  7087. leave.relatedTarget = toNode;
  7088. var enter = SyntheticMouseEvent.getPooled(eventTypes.mouseEnter, to, nativeEvent, nativeEventTarget);
  7089. enter.type = 'mouseenter';
  7090. enter.target = toNode;
  7091. enter.relatedTarget = fromNode;
  7092. EventPropagators.accumulateEnterLeaveDispatches(leave, enter, from, to);
  7093. return [leave, enter];
  7094. }
  7095. };
  7096. module.exports = EnterLeaveEventPlugin;
  7097. /***/ },
  7098. /* 67 */
  7099. /***/ function(module, exports, __webpack_require__) {
  7100. /**
  7101. * Copyright 2013-present, Facebook, Inc.
  7102. * All rights reserved.
  7103. *
  7104. * This source code is licensed under the BSD-style license found in the
  7105. * LICENSE file in the root directory of this source tree. An additional grant
  7106. * of patent rights can be found in the PATENTS file in the same directory.
  7107. *
  7108. * @providesModule SyntheticMouseEvent
  7109. */
  7110. 'use strict';
  7111. var SyntheticUIEvent = __webpack_require__(68);
  7112. var ViewportMetrics = __webpack_require__(69);
  7113. var getEventModifierState = __webpack_require__(70);
  7114. /**
  7115. * @interface MouseEvent
  7116. * @see http://www.w3.org/TR/DOM-Level-3-Events/
  7117. */
  7118. var MouseEventInterface = {
  7119. screenX: null,
  7120. screenY: null,
  7121. clientX: null,
  7122. clientY: null,
  7123. ctrlKey: null,
  7124. shiftKey: null,
  7125. altKey: null,
  7126. metaKey: null,
  7127. getModifierState: getEventModifierState,
  7128. button: function (event) {
  7129. // Webkit, Firefox, IE9+
  7130. // which: 1 2 3
  7131. // button: 0 1 2 (standard)
  7132. var button = event.button;
  7133. if ('which' in event) {
  7134. return button;
  7135. }
  7136. // IE<9
  7137. // which: undefined
  7138. // button: 0 0 0
  7139. // button: 1 4 2 (onmouseup)
  7140. return button === 2 ? 2 : button === 4 ? 1 : 0;
  7141. },
  7142. buttons: null,
  7143. relatedTarget: function (event) {
  7144. return event.relatedTarget || (event.fromElement === event.srcElement ? event.toElement : event.fromElement);
  7145. },
  7146. // "Proprietary" Interface.
  7147. pageX: function (event) {
  7148. return 'pageX' in event ? event.pageX : event.clientX + ViewportMetrics.currentScrollLeft;
  7149. },
  7150. pageY: function (event) {
  7151. return 'pageY' in event ? event.pageY : event.clientY + ViewportMetrics.currentScrollTop;
  7152. }
  7153. };
  7154. /**
  7155. * @param {object} dispatchConfig Configuration used to dispatch this event.
  7156. * @param {string} dispatchMarker Marker identifying the event target.
  7157. * @param {object} nativeEvent Native browser event.
  7158. * @extends {SyntheticUIEvent}
  7159. */
  7160. function SyntheticMouseEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
  7161. return SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
  7162. }
  7163. SyntheticUIEvent.augmentClass(SyntheticMouseEvent, MouseEventInterface);
  7164. module.exports = SyntheticMouseEvent;
  7165. /***/ },
  7166. /* 68 */
  7167. /***/ function(module, exports, __webpack_require__) {
  7168. /**
  7169. * Copyright 2013-present, Facebook, Inc.
  7170. * All rights reserved.
  7171. *
  7172. * This source code is licensed under the BSD-style license found in the
  7173. * LICENSE file in the root directory of this source tree. An additional grant
  7174. * of patent rights can be found in the PATENTS file in the same directory.
  7175. *
  7176. * @providesModule SyntheticUIEvent
  7177. */
  7178. 'use strict';
  7179. var SyntheticEvent = __webpack_require__(52);
  7180. var getEventTarget = __webpack_require__(62);
  7181. /**
  7182. * @interface UIEvent
  7183. * @see http://www.w3.org/TR/DOM-Level-3-Events/
  7184. */
  7185. var UIEventInterface = {
  7186. view: function (event) {
  7187. if (event.view) {
  7188. return event.view;
  7189. }
  7190. var target = getEventTarget(event);
  7191. if (target != null && target.window === target) {
  7192. // target is a window object
  7193. return target;
  7194. }
  7195. var doc = target.ownerDocument;
  7196. // TODO: Figure out why `ownerDocument` is sometimes undefined in IE8.
  7197. if (doc) {
  7198. return doc.defaultView || doc.parentWindow;
  7199. } else {
  7200. return window;
  7201. }
  7202. },
  7203. detail: function (event) {
  7204. return event.detail || 0;
  7205. }
  7206. };
  7207. /**
  7208. * @param {object} dispatchConfig Configuration used to dispatch this event.
  7209. * @param {string} dispatchMarker Marker identifying the event target.
  7210. * @param {object} nativeEvent Native browser event.
  7211. * @extends {SyntheticEvent}
  7212. */
  7213. function SyntheticUIEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
  7214. return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
  7215. }
  7216. SyntheticEvent.augmentClass(SyntheticUIEvent, UIEventInterface);
  7217. module.exports = SyntheticUIEvent;
  7218. /***/ },
  7219. /* 69 */
  7220. /***/ function(module, exports) {
  7221. /**
  7222. * Copyright 2013-present, Facebook, Inc.
  7223. * All rights reserved.
  7224. *
  7225. * This source code is licensed under the BSD-style license found in the
  7226. * LICENSE file in the root directory of this source tree. An additional grant
  7227. * of patent rights can be found in the PATENTS file in the same directory.
  7228. *
  7229. * @providesModule ViewportMetrics
  7230. */
  7231. 'use strict';
  7232. var ViewportMetrics = {
  7233. currentScrollLeft: 0,
  7234. currentScrollTop: 0,
  7235. refreshScrollValues: function (scrollPosition) {
  7236. ViewportMetrics.currentScrollLeft = scrollPosition.x;
  7237. ViewportMetrics.currentScrollTop = scrollPosition.y;
  7238. }
  7239. };
  7240. module.exports = ViewportMetrics;
  7241. /***/ },
  7242. /* 70 */
  7243. /***/ function(module, exports) {
  7244. /**
  7245. * Copyright 2013-present, Facebook, Inc.
  7246. * All rights reserved.
  7247. *
  7248. * This source code is licensed under the BSD-style license found in the
  7249. * LICENSE file in the root directory of this source tree. An additional grant
  7250. * of patent rights can be found in the PATENTS file in the same directory.
  7251. *
  7252. * @providesModule getEventModifierState
  7253. */
  7254. 'use strict';
  7255. /**
  7256. * Translation from modifier key to the associated property in the event.
  7257. * @see http://www.w3.org/TR/DOM-Level-3-Events/#keys-Modifiers
  7258. */
  7259. var modifierKeyToProp = {
  7260. 'Alt': 'altKey',
  7261. 'Control': 'ctrlKey',
  7262. 'Meta': 'metaKey',
  7263. 'Shift': 'shiftKey'
  7264. };
  7265. // IE8 does not implement getModifierState so we simply map it to the only
  7266. // modifier keys exposed by the event itself, does not support Lock-keys.
  7267. // Currently, all major browsers except Chrome seems to support Lock-keys.
  7268. function modifierStateGetter(keyArg) {
  7269. var syntheticEvent = this;
  7270. var nativeEvent = syntheticEvent.nativeEvent;
  7271. if (nativeEvent.getModifierState) {
  7272. return nativeEvent.getModifierState(keyArg);
  7273. }
  7274. var keyProp = modifierKeyToProp[keyArg];
  7275. return keyProp ? !!nativeEvent[keyProp] : false;
  7276. }
  7277. function getEventModifierState(nativeEvent) {
  7278. return modifierStateGetter;
  7279. }
  7280. module.exports = getEventModifierState;
  7281. /***/ },
  7282. /* 71 */
  7283. /***/ function(module, exports, __webpack_require__) {
  7284. /**
  7285. * Copyright 2013-present, Facebook, Inc.
  7286. * All rights reserved.
  7287. *
  7288. * This source code is licensed under the BSD-style license found in the
  7289. * LICENSE file in the root directory of this source tree. An additional grant
  7290. * of patent rights can be found in the PATENTS file in the same directory.
  7291. *
  7292. * @providesModule HTMLDOMPropertyConfig
  7293. */
  7294. 'use strict';
  7295. var DOMProperty = __webpack_require__(37);
  7296. var MUST_USE_PROPERTY = DOMProperty.injection.MUST_USE_PROPERTY;
  7297. var HAS_BOOLEAN_VALUE = DOMProperty.injection.HAS_BOOLEAN_VALUE;
  7298. var HAS_SIDE_EFFECTS = DOMProperty.injection.HAS_SIDE_EFFECTS;
  7299. var HAS_NUMERIC_VALUE = DOMProperty.injection.HAS_NUMERIC_VALUE;
  7300. var HAS_POSITIVE_NUMERIC_VALUE = DOMProperty.injection.HAS_POSITIVE_NUMERIC_VALUE;
  7301. var HAS_OVERLOADED_BOOLEAN_VALUE = DOMProperty.injection.HAS_OVERLOADED_BOOLEAN_VALUE;
  7302. var HTMLDOMPropertyConfig = {
  7303. isCustomAttribute: RegExp.prototype.test.bind(new RegExp('^(data|aria)-[' + DOMProperty.ATTRIBUTE_NAME_CHAR + ']*$')),
  7304. Properties: {
  7305. /**
  7306. * Standard Properties
  7307. */
  7308. accept: 0,
  7309. acceptCharset: 0,
  7310. accessKey: 0,
  7311. action: 0,
  7312. allowFullScreen: HAS_BOOLEAN_VALUE,
  7313. allowTransparency: 0,
  7314. alt: 0,
  7315. async: HAS_BOOLEAN_VALUE,
  7316. autoComplete: 0,
  7317. // autoFocus is polyfilled/normalized by AutoFocusUtils
  7318. // autoFocus: HAS_BOOLEAN_VALUE,
  7319. autoPlay: HAS_BOOLEAN_VALUE,
  7320. capture: HAS_BOOLEAN_VALUE,
  7321. cellPadding: 0,
  7322. cellSpacing: 0,
  7323. charSet: 0,
  7324. challenge: 0,
  7325. checked: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
  7326. cite: 0,
  7327. classID: 0,
  7328. className: 0,
  7329. cols: HAS_POSITIVE_NUMERIC_VALUE,
  7330. colSpan: 0,
  7331. content: 0,
  7332. contentEditable: 0,
  7333. contextMenu: 0,
  7334. controls: HAS_BOOLEAN_VALUE,
  7335. coords: 0,
  7336. crossOrigin: 0,
  7337. data: 0, // For `<object />` acts as `src`.
  7338. dateTime: 0,
  7339. 'default': HAS_BOOLEAN_VALUE,
  7340. defer: HAS_BOOLEAN_VALUE,
  7341. dir: 0,
  7342. disabled: HAS_BOOLEAN_VALUE,
  7343. download: HAS_OVERLOADED_BOOLEAN_VALUE,
  7344. draggable: 0,
  7345. encType: 0,
  7346. form: 0,
  7347. formAction: 0,
  7348. formEncType: 0,
  7349. formMethod: 0,
  7350. formNoValidate: HAS_BOOLEAN_VALUE,
  7351. formTarget: 0,
  7352. frameBorder: 0,
  7353. headers: 0,
  7354. height: 0,
  7355. hidden: HAS_BOOLEAN_VALUE,
  7356. high: 0,
  7357. href: 0,
  7358. hrefLang: 0,
  7359. htmlFor: 0,
  7360. httpEquiv: 0,
  7361. icon: 0,
  7362. id: 0,
  7363. inputMode: 0,
  7364. integrity: 0,
  7365. is: 0,
  7366. keyParams: 0,
  7367. keyType: 0,
  7368. kind: 0,
  7369. label: 0,
  7370. lang: 0,
  7371. list: 0,
  7372. loop: HAS_BOOLEAN_VALUE,
  7373. low: 0,
  7374. manifest: 0,
  7375. marginHeight: 0,
  7376. marginWidth: 0,
  7377. max: 0,
  7378. maxLength: 0,
  7379. media: 0,
  7380. mediaGroup: 0,
  7381. method: 0,
  7382. min: 0,
  7383. minLength: 0,
  7384. // Caution; `option.selected` is not updated if `select.multiple` is
  7385. // disabled with `removeAttribute`.
  7386. multiple: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
  7387. muted: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
  7388. name: 0,
  7389. nonce: 0,
  7390. noValidate: HAS_BOOLEAN_VALUE,
  7391. open: HAS_BOOLEAN_VALUE,
  7392. optimum: 0,
  7393. pattern: 0,
  7394. placeholder: 0,
  7395. poster: 0,
  7396. preload: 0,
  7397. profile: 0,
  7398. radioGroup: 0,
  7399. readOnly: HAS_BOOLEAN_VALUE,
  7400. rel: 0,
  7401. required: HAS_BOOLEAN_VALUE,
  7402. reversed: HAS_BOOLEAN_VALUE,
  7403. role: 0,
  7404. rows: HAS_POSITIVE_NUMERIC_VALUE,
  7405. rowSpan: HAS_NUMERIC_VALUE,
  7406. sandbox: 0,
  7407. scope: 0,
  7408. scoped: HAS_BOOLEAN_VALUE,
  7409. scrolling: 0,
  7410. seamless: HAS_BOOLEAN_VALUE,
  7411. selected: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
  7412. shape: 0,
  7413. size: HAS_POSITIVE_NUMERIC_VALUE,
  7414. sizes: 0,
  7415. span: HAS_POSITIVE_NUMERIC_VALUE,
  7416. spellCheck: 0,
  7417. src: 0,
  7418. srcDoc: 0,
  7419. srcLang: 0,
  7420. srcSet: 0,
  7421. start: HAS_NUMERIC_VALUE,
  7422. step: 0,
  7423. style: 0,
  7424. summary: 0,
  7425. tabIndex: 0,
  7426. target: 0,
  7427. title: 0,
  7428. // Setting .type throws on non-<input> tags
  7429. type: 0,
  7430. useMap: 0,
  7431. value: MUST_USE_PROPERTY | HAS_SIDE_EFFECTS,
  7432. width: 0,
  7433. wmode: 0,
  7434. wrap: 0,
  7435. /**
  7436. * RDFa Properties
  7437. */
  7438. about: 0,
  7439. datatype: 0,
  7440. inlist: 0,
  7441. prefix: 0,
  7442. // property is also supported for OpenGraph in meta tags.
  7443. property: 0,
  7444. resource: 0,
  7445. 'typeof': 0,
  7446. vocab: 0,
  7447. /**
  7448. * Non-standard Properties
  7449. */
  7450. // autoCapitalize and autoCorrect are supported in Mobile Safari for
  7451. // keyboard hints.
  7452. autoCapitalize: 0,
  7453. autoCorrect: 0,
  7454. // autoSave allows WebKit/Blink to persist values of input fields on page reloads
  7455. autoSave: 0,
  7456. // color is for Safari mask-icon link
  7457. color: 0,
  7458. // itemProp, itemScope, itemType are for
  7459. // Microdata support. See http://schema.org/docs/gs.html
  7460. itemProp: 0,
  7461. itemScope: HAS_BOOLEAN_VALUE,
  7462. itemType: 0,
  7463. // itemID and itemRef are for Microdata support as well but
  7464. // only specified in the WHATWG spec document. See
  7465. // https://html.spec.whatwg.org/multipage/microdata.html#microdata-dom-api
  7466. itemID: 0,
  7467. itemRef: 0,
  7468. // results show looking glass icon and recent searches on input
  7469. // search fields in WebKit/Blink
  7470. results: 0,
  7471. // IE-only attribute that specifies security restrictions on an iframe
  7472. // as an alternative to the sandbox attribute on IE<10
  7473. security: 0,
  7474. // IE-only attribute that controls focus behavior
  7475. unselectable: 0
  7476. },
  7477. DOMAttributeNames: {
  7478. acceptCharset: 'accept-charset',
  7479. className: 'class',
  7480. htmlFor: 'for',
  7481. httpEquiv: 'http-equiv'
  7482. },
  7483. DOMPropertyNames: {}
  7484. };
  7485. module.exports = HTMLDOMPropertyConfig;
  7486. /***/ },
  7487. /* 72 */
  7488. /***/ function(module, exports, __webpack_require__) {
  7489. /**
  7490. * Copyright 2013-present, Facebook, Inc.
  7491. * All rights reserved.
  7492. *
  7493. * This source code is licensed under the BSD-style license found in the
  7494. * LICENSE file in the root directory of this source tree. An additional grant
  7495. * of patent rights can be found in the PATENTS file in the same directory.
  7496. *
  7497. * @providesModule ReactComponentBrowserEnvironment
  7498. */
  7499. 'use strict';
  7500. var DOMChildrenOperations = __webpack_require__(73);
  7501. var ReactDOMIDOperations = __webpack_require__(85);
  7502. /**
  7503. * Abstracts away all functionality of the reconciler that requires knowledge of
  7504. * the browser context. TODO: These callers should be refactored to avoid the
  7505. * need for this injection.
  7506. */
  7507. var ReactComponentBrowserEnvironment = {
  7508. processChildrenUpdates: ReactDOMIDOperations.dangerouslyProcessChildrenUpdates,
  7509. replaceNodeWithMarkup: DOMChildrenOperations.dangerouslyReplaceNodeWithMarkup,
  7510. /**
  7511. * If a particular environment requires that some resources be cleaned up,
  7512. * specify this in the injected Mixin. In the DOM, we would likely want to
  7513. * purge any cached node ID lookups.
  7514. *
  7515. * @private
  7516. */
  7517. unmountIDFromEnvironment: function (rootNodeID) {}
  7518. };
  7519. module.exports = ReactComponentBrowserEnvironment;
  7520. /***/ },
  7521. /* 73 */
  7522. /***/ function(module, exports, __webpack_require__) {
  7523. /**
  7524. * Copyright 2013-present, Facebook, Inc.
  7525. * All rights reserved.
  7526. *
  7527. * This source code is licensed under the BSD-style license found in the
  7528. * LICENSE file in the root directory of this source tree. An additional grant
  7529. * of patent rights can be found in the PATENTS file in the same directory.
  7530. *
  7531. * @providesModule DOMChildrenOperations
  7532. */
  7533. 'use strict';
  7534. var DOMLazyTree = __webpack_require__(74);
  7535. var Danger = __webpack_require__(80);
  7536. var ReactMultiChildUpdateTypes = __webpack_require__(84);
  7537. var ReactDOMComponentTree = __webpack_require__(36);
  7538. var ReactInstrumentation = __webpack_require__(17);
  7539. var createMicrosoftUnsafeLocalFunction = __webpack_require__(76);
  7540. var setInnerHTML = __webpack_require__(79);
  7541. var setTextContent = __webpack_require__(77);
  7542. function getNodeAfter(parentNode, node) {
  7543. // Special case for text components, which return [open, close] comments
  7544. // from getNativeNode.
  7545. if (Array.isArray(node)) {
  7546. node = node[1];
  7547. }
  7548. return node ? node.nextSibling : parentNode.firstChild;
  7549. }
  7550. /**
  7551. * Inserts `childNode` as a child of `parentNode` at the `index`.
  7552. *
  7553. * @param {DOMElement} parentNode Parent node in which to insert.
  7554. * @param {DOMElement} childNode Child node to insert.
  7555. * @param {number} index Index at which to insert the child.
  7556. * @internal
  7557. */
  7558. var insertChildAt = createMicrosoftUnsafeLocalFunction(function (parentNode, childNode, referenceNode) {
  7559. // We rely exclusively on `insertBefore(node, null)` instead of also using
  7560. // `appendChild(node)`. (Using `undefined` is not allowed by all browsers so
  7561. // we are careful to use `null`.)
  7562. parentNode.insertBefore(childNode, referenceNode);
  7563. });
  7564. function insertLazyTreeChildAt(parentNode, childTree, referenceNode) {
  7565. DOMLazyTree.insertTreeBefore(parentNode, childTree, referenceNode);
  7566. }
  7567. function moveChild(parentNode, childNode, referenceNode) {
  7568. if (Array.isArray(childNode)) {
  7569. moveDelimitedText(parentNode, childNode[0], childNode[1], referenceNode);
  7570. } else {
  7571. insertChildAt(parentNode, childNode, referenceNode);
  7572. }
  7573. }
  7574. function removeChild(parentNode, childNode) {
  7575. if (Array.isArray(childNode)) {
  7576. var closingComment = childNode[1];
  7577. childNode = childNode[0];
  7578. removeDelimitedText(parentNode, childNode, closingComment);
  7579. parentNode.removeChild(closingComment);
  7580. }
  7581. parentNode.removeChild(childNode);
  7582. }
  7583. function moveDelimitedText(parentNode, openingComment, closingComment, referenceNode) {
  7584. var node = openingComment;
  7585. while (true) {
  7586. var nextNode = node.nextSibling;
  7587. insertChildAt(parentNode, node, referenceNode);
  7588. if (node === closingComment) {
  7589. break;
  7590. }
  7591. node = nextNode;
  7592. }
  7593. }
  7594. function removeDelimitedText(parentNode, startNode, closingComment) {
  7595. while (true) {
  7596. var node = startNode.nextSibling;
  7597. if (node === closingComment) {
  7598. // The closing comment is removed by ReactMultiChild.
  7599. break;
  7600. } else {
  7601. parentNode.removeChild(node);
  7602. }
  7603. }
  7604. }
  7605. function replaceDelimitedText(openingComment, closingComment, stringText) {
  7606. var parentNode = openingComment.parentNode;
  7607. var nodeAfterComment = openingComment.nextSibling;
  7608. if (nodeAfterComment === closingComment) {
  7609. // There are no text nodes between the opening and closing comments; insert
  7610. // a new one if stringText isn't empty.
  7611. if (stringText) {
  7612. insertChildAt(parentNode, document.createTextNode(stringText), nodeAfterComment);
  7613. }
  7614. } else {
  7615. if (stringText) {
  7616. // Set the text content of the first node after the opening comment, and
  7617. // remove all following nodes up until the closing comment.
  7618. setTextContent(nodeAfterComment, stringText);
  7619. removeDelimitedText(parentNode, nodeAfterComment, closingComment);
  7620. } else {
  7621. removeDelimitedText(parentNode, openingComment, closingComment);
  7622. }
  7623. }
  7624. if (false) {
  7625. ReactInstrumentation.debugTool.onNativeOperation(ReactDOMComponentTree.getInstanceFromNode(openingComment)._debugID, 'replace text', stringText);
  7626. }
  7627. }
  7628. var dangerouslyReplaceNodeWithMarkup = Danger.dangerouslyReplaceNodeWithMarkup;
  7629. if (false) {
  7630. dangerouslyReplaceNodeWithMarkup = function (oldChild, markup, prevInstance) {
  7631. Danger.dangerouslyReplaceNodeWithMarkup(oldChild, markup);
  7632. if (prevInstance._debugID !== 0) {
  7633. ReactInstrumentation.debugTool.onNativeOperation(prevInstance._debugID, 'replace with', markup.toString());
  7634. } else {
  7635. var nextInstance = ReactDOMComponentTree.getInstanceFromNode(markup.node);
  7636. if (nextInstance._debugID !== 0) {
  7637. ReactInstrumentation.debugTool.onNativeOperation(nextInstance._debugID, 'mount', markup.toString());
  7638. }
  7639. }
  7640. };
  7641. }
  7642. /**
  7643. * Operations for updating with DOM children.
  7644. */
  7645. var DOMChildrenOperations = {
  7646. dangerouslyReplaceNodeWithMarkup: dangerouslyReplaceNodeWithMarkup,
  7647. replaceDelimitedText: replaceDelimitedText,
  7648. /**
  7649. * Updates a component's children by processing a series of updates. The
  7650. * update configurations are each expected to have a `parentNode` property.
  7651. *
  7652. * @param {array<object>} updates List of update configurations.
  7653. * @internal
  7654. */
  7655. processUpdates: function (parentNode, updates) {
  7656. if (false) {
  7657. var parentNodeDebugID = ReactDOMComponentTree.getInstanceFromNode(parentNode)._debugID;
  7658. }
  7659. for (var k = 0; k < updates.length; k++) {
  7660. var update = updates[k];
  7661. switch (update.type) {
  7662. case ReactMultiChildUpdateTypes.INSERT_MARKUP:
  7663. insertLazyTreeChildAt(parentNode, update.content, getNodeAfter(parentNode, update.afterNode));
  7664. if (false) {
  7665. ReactInstrumentation.debugTool.onNativeOperation(parentNodeDebugID, 'insert child', { toIndex: update.toIndex, content: update.content.toString() });
  7666. }
  7667. break;
  7668. case ReactMultiChildUpdateTypes.MOVE_EXISTING:
  7669. moveChild(parentNode, update.fromNode, getNodeAfter(parentNode, update.afterNode));
  7670. if (false) {
  7671. ReactInstrumentation.debugTool.onNativeOperation(parentNodeDebugID, 'move child', { fromIndex: update.fromIndex, toIndex: update.toIndex });
  7672. }
  7673. break;
  7674. case ReactMultiChildUpdateTypes.SET_MARKUP:
  7675. setInnerHTML(parentNode, update.content);
  7676. if (false) {
  7677. ReactInstrumentation.debugTool.onNativeOperation(parentNodeDebugID, 'replace children', update.content.toString());
  7678. }
  7679. break;
  7680. case ReactMultiChildUpdateTypes.TEXT_CONTENT:
  7681. setTextContent(parentNode, update.content);
  7682. if (false) {
  7683. ReactInstrumentation.debugTool.onNativeOperation(parentNodeDebugID, 'replace text', update.content.toString());
  7684. }
  7685. break;
  7686. case ReactMultiChildUpdateTypes.REMOVE_NODE:
  7687. removeChild(parentNode, update.fromNode);
  7688. if (false) {
  7689. ReactInstrumentation.debugTool.onNativeOperation(parentNodeDebugID, 'remove child', { fromIndex: update.fromIndex });
  7690. }
  7691. break;
  7692. }
  7693. }
  7694. }
  7695. };
  7696. module.exports = DOMChildrenOperations;
  7697. /***/ },
  7698. /* 74 */
  7699. /***/ function(module, exports, __webpack_require__) {
  7700. /**
  7701. * Copyright 2015-present, Facebook, Inc.
  7702. * All rights reserved.
  7703. *
  7704. * This source code is licensed under the BSD-style license found in the
  7705. * LICENSE file in the root directory of this source tree. An additional grant
  7706. * of patent rights can be found in the PATENTS file in the same directory.
  7707. *
  7708. * @providesModule DOMLazyTree
  7709. */
  7710. 'use strict';
  7711. var DOMNamespaces = __webpack_require__(75);
  7712. var createMicrosoftUnsafeLocalFunction = __webpack_require__(76);
  7713. var setTextContent = __webpack_require__(77);
  7714. var ELEMENT_NODE_TYPE = 1;
  7715. var DOCUMENT_FRAGMENT_NODE_TYPE = 11;
  7716. /**
  7717. * In IE (8-11) and Edge, appending nodes with no children is dramatically
  7718. * faster than appending a full subtree, so we essentially queue up the
  7719. * .appendChild calls here and apply them so each node is added to its parent
  7720. * before any children are added.
  7721. *
  7722. * In other browsers, doing so is slower or neutral compared to the other order
  7723. * (in Firefox, twice as slow) so we only do this inversion in IE.
  7724. *
  7725. * See https://github.com/spicyj/innerhtml-vs-createelement-vs-clonenode.
  7726. */
  7727. var enableLazy = typeof document !== 'undefined' && typeof document.documentMode === 'number' || typeof navigator !== 'undefined' && typeof navigator.userAgent === 'string' && /\bEdge\/\d/.test(navigator.userAgent);
  7728. function insertTreeChildren(tree) {
  7729. if (!enableLazy) {
  7730. return;
  7731. }
  7732. var node = tree.node;
  7733. var children = tree.children;
  7734. if (children.length) {
  7735. for (var i = 0; i < children.length; i++) {
  7736. insertTreeBefore(node, children[i], null);
  7737. }
  7738. } else if (tree.html != null) {
  7739. node.innerHTML = tree.html;
  7740. } else if (tree.text != null) {
  7741. setTextContent(node, tree.text);
  7742. }
  7743. }
  7744. var insertTreeBefore = createMicrosoftUnsafeLocalFunction(function (parentNode, tree, referenceNode) {
  7745. // DocumentFragments aren't actually part of the DOM after insertion so
  7746. // appending children won't update the DOM. We need to ensure the fragment
  7747. // is properly populated first, breaking out of our lazy approach for just
  7748. // this level. Also, some <object> plugins (like Flash Player) will read
  7749. // <param> nodes immediately upon insertion into the DOM, so <object>
  7750. // must also be populated prior to insertion into the DOM.
  7751. if (tree.node.nodeType === DOCUMENT_FRAGMENT_NODE_TYPE || tree.node.nodeType === ELEMENT_NODE_TYPE && tree.node.nodeName.toLowerCase() === 'object' && (tree.node.namespaceURI == null || tree.node.namespaceURI === DOMNamespaces.html)) {
  7752. insertTreeChildren(tree);
  7753. parentNode.insertBefore(tree.node, referenceNode);
  7754. } else {
  7755. parentNode.insertBefore(tree.node, referenceNode);
  7756. insertTreeChildren(tree);
  7757. }
  7758. });
  7759. function replaceChildWithTree(oldNode, newTree) {
  7760. oldNode.parentNode.replaceChild(newTree.node, oldNode);
  7761. insertTreeChildren(newTree);
  7762. }
  7763. function queueChild(parentTree, childTree) {
  7764. if (enableLazy) {
  7765. parentTree.children.push(childTree);
  7766. } else {
  7767. parentTree.node.appendChild(childTree.node);
  7768. }
  7769. }
  7770. function queueHTML(tree, html) {
  7771. if (enableLazy) {
  7772. tree.html = html;
  7773. } else {
  7774. tree.node.innerHTML = html;
  7775. }
  7776. }
  7777. function queueText(tree, text) {
  7778. if (enableLazy) {
  7779. tree.text = text;
  7780. } else {
  7781. setTextContent(tree.node, text);
  7782. }
  7783. }
  7784. function toString() {
  7785. return this.node.nodeName;
  7786. }
  7787. function DOMLazyTree(node) {
  7788. return {
  7789. node: node,
  7790. children: [],
  7791. html: null,
  7792. text: null,
  7793. toString: toString
  7794. };
  7795. }
  7796. DOMLazyTree.insertTreeBefore = insertTreeBefore;
  7797. DOMLazyTree.replaceChildWithTree = replaceChildWithTree;
  7798. DOMLazyTree.queueChild = queueChild;
  7799. DOMLazyTree.queueHTML = queueHTML;
  7800. DOMLazyTree.queueText = queueText;
  7801. module.exports = DOMLazyTree;
  7802. /***/ },
  7803. /* 75 */
  7804. /***/ function(module, exports) {
  7805. /**
  7806. * Copyright 2013-present, Facebook, Inc.
  7807. * All rights reserved.
  7808. *
  7809. * This source code is licensed under the BSD-style license found in the
  7810. * LICENSE file in the root directory of this source tree. An additional grant
  7811. * of patent rights can be found in the PATENTS file in the same directory.
  7812. *
  7813. * @providesModule DOMNamespaces
  7814. */
  7815. 'use strict';
  7816. var DOMNamespaces = {
  7817. html: 'http://www.w3.org/1999/xhtml',
  7818. mathml: 'http://www.w3.org/1998/Math/MathML',
  7819. svg: 'http://www.w3.org/2000/svg'
  7820. };
  7821. module.exports = DOMNamespaces;
  7822. /***/ },
  7823. /* 76 */
  7824. /***/ function(module, exports) {
  7825. /**
  7826. * Copyright 2013-present, Facebook, Inc.
  7827. * All rights reserved.
  7828. *
  7829. * This source code is licensed under the BSD-style license found in the
  7830. * LICENSE file in the root directory of this source tree. An additional grant
  7831. * of patent rights can be found in the PATENTS file in the same directory.
  7832. *
  7833. * @providesModule createMicrosoftUnsafeLocalFunction
  7834. */
  7835. /* globals MSApp */
  7836. 'use strict';
  7837. /**
  7838. * Create a function which has 'unsafe' privileges (required by windows8 apps)
  7839. */
  7840. var createMicrosoftUnsafeLocalFunction = function (func) {
  7841. if (typeof MSApp !== 'undefined' && MSApp.execUnsafeLocalFunction) {
  7842. return function (arg0, arg1, arg2, arg3) {
  7843. MSApp.execUnsafeLocalFunction(function () {
  7844. return func(arg0, arg1, arg2, arg3);
  7845. });
  7846. };
  7847. } else {
  7848. return func;
  7849. }
  7850. };
  7851. module.exports = createMicrosoftUnsafeLocalFunction;
  7852. /***/ },
  7853. /* 77 */
  7854. /***/ function(module, exports, __webpack_require__) {
  7855. /**
  7856. * Copyright 2013-present, Facebook, Inc.
  7857. * All rights reserved.
  7858. *
  7859. * This source code is licensed under the BSD-style license found in the
  7860. * LICENSE file in the root directory of this source tree. An additional grant
  7861. * of patent rights can be found in the PATENTS file in the same directory.
  7862. *
  7863. * @providesModule setTextContent
  7864. */
  7865. 'use strict';
  7866. var ExecutionEnvironment = __webpack_require__(19);
  7867. var escapeTextContentForBrowser = __webpack_require__(78);
  7868. var setInnerHTML = __webpack_require__(79);
  7869. /**
  7870. * Set the textContent property of a node, ensuring that whitespace is preserved
  7871. * even in IE8. innerText is a poor substitute for textContent and, among many
  7872. * issues, inserts <br> instead of the literal newline chars. innerHTML behaves
  7873. * as it should.
  7874. *
  7875. * @param {DOMElement} node
  7876. * @param {string} text
  7877. * @internal
  7878. */
  7879. var setTextContent = function (node, text) {
  7880. node.textContent = text;
  7881. };
  7882. if (ExecutionEnvironment.canUseDOM) {
  7883. if (!('textContent' in document.documentElement)) {
  7884. setTextContent = function (node, text) {
  7885. setInnerHTML(node, escapeTextContentForBrowser(text));
  7886. };
  7887. }
  7888. }
  7889. module.exports = setTextContent;
  7890. /***/ },
  7891. /* 78 */
  7892. /***/ function(module, exports) {
  7893. /**
  7894. * Copyright 2013-present, Facebook, Inc.
  7895. * All rights reserved.
  7896. *
  7897. * This source code is licensed under the BSD-style license found in the
  7898. * LICENSE file in the root directory of this source tree. An additional grant
  7899. * of patent rights can be found in the PATENTS file in the same directory.
  7900. *
  7901. * @providesModule escapeTextContentForBrowser
  7902. */
  7903. 'use strict';
  7904. var ESCAPE_LOOKUP = {
  7905. '&': '&amp;',
  7906. '>': '&gt;',
  7907. '<': '&lt;',
  7908. '"': '&quot;',
  7909. '\'': '&#x27;'
  7910. };
  7911. var ESCAPE_REGEX = /[&><"']/g;
  7912. function escaper(match) {
  7913. return ESCAPE_LOOKUP[match];
  7914. }
  7915. /**
  7916. * Escapes text to prevent scripting attacks.
  7917. *
  7918. * @param {*} text Text value to escape.
  7919. * @return {string} An escaped string.
  7920. */
  7921. function escapeTextContentForBrowser(text) {
  7922. return ('' + text).replace(ESCAPE_REGEX, escaper);
  7923. }
  7924. module.exports = escapeTextContentForBrowser;
  7925. /***/ },
  7926. /* 79 */
  7927. /***/ function(module, exports, __webpack_require__) {
  7928. /**
  7929. * Copyright 2013-present, Facebook, Inc.
  7930. * All rights reserved.
  7931. *
  7932. * This source code is licensed under the BSD-style license found in the
  7933. * LICENSE file in the root directory of this source tree. An additional grant
  7934. * of patent rights can be found in the PATENTS file in the same directory.
  7935. *
  7936. * @providesModule setInnerHTML
  7937. */
  7938. 'use strict';
  7939. var ExecutionEnvironment = __webpack_require__(19);
  7940. var WHITESPACE_TEST = /^[ \r\n\t\f]/;
  7941. var NONVISIBLE_TEST = /<(!--|link|noscript|meta|script|style)[ \r\n\t\f\/>]/;
  7942. var createMicrosoftUnsafeLocalFunction = __webpack_require__(76);
  7943. /**
  7944. * Set the innerHTML property of a node, ensuring that whitespace is preserved
  7945. * even in IE8.
  7946. *
  7947. * @param {DOMElement} node
  7948. * @param {string} html
  7949. * @internal
  7950. */
  7951. var setInnerHTML = createMicrosoftUnsafeLocalFunction(function (node, html) {
  7952. node.innerHTML = html;
  7953. });
  7954. if (ExecutionEnvironment.canUseDOM) {
  7955. // IE8: When updating a just created node with innerHTML only leading
  7956. // whitespace is removed. When updating an existing node with innerHTML
  7957. // whitespace in root TextNodes is also collapsed.
  7958. // @see quirksmode.org/bugreports/archives/2004/11/innerhtml_and_t.html
  7959. // Feature detection; only IE8 is known to behave improperly like this.
  7960. var testElement = document.createElement('div');
  7961. testElement.innerHTML = ' ';
  7962. if (testElement.innerHTML === '') {
  7963. setInnerHTML = function (node, html) {
  7964. // Magic theory: IE8 supposedly differentiates between added and updated
  7965. // nodes when processing innerHTML, innerHTML on updated nodes suffers
  7966. // from worse whitespace behavior. Re-adding a node like this triggers
  7967. // the initial and more favorable whitespace behavior.
  7968. // TODO: What to do on a detached node?
  7969. if (node.parentNode) {
  7970. node.parentNode.replaceChild(node, node);
  7971. }
  7972. // We also implement a workaround for non-visible tags disappearing into
  7973. // thin air on IE8, this only happens if there is no visible text
  7974. // in-front of the non-visible tags. Piggyback on the whitespace fix
  7975. // and simply check if any non-visible tags appear in the source.
  7976. if (WHITESPACE_TEST.test(html) || html[0] === '<' && NONVISIBLE_TEST.test(html)) {
  7977. // Recover leading whitespace by temporarily prepending any character.
  7978. // \uFEFF has the potential advantage of being zero-width/invisible.
  7979. // UglifyJS drops U+FEFF chars when parsing, so use String.fromCharCode
  7980. // in hopes that this is preserved even if "\uFEFF" is transformed to
  7981. // the actual Unicode character (by Babel, for example).
  7982. // https://github.com/mishoo/UglifyJS2/blob/v2.4.20/lib/parse.js#L216
  7983. node.innerHTML = String.fromCharCode(0xFEFF) + html;
  7984. // deleteData leaves an empty `TextNode` which offsets the index of all
  7985. // children. Definitely want to avoid this.
  7986. var textNode = node.firstChild;
  7987. if (textNode.data.length === 1) {
  7988. node.removeChild(textNode);
  7989. } else {
  7990. textNode.deleteData(0, 1);
  7991. }
  7992. } else {
  7993. node.innerHTML = html;
  7994. }
  7995. };
  7996. }
  7997. testElement = null;
  7998. }
  7999. module.exports = setInnerHTML;
  8000. /***/ },
  8001. /* 80 */
  8002. /***/ function(module, exports, __webpack_require__) {
  8003. /**
  8004. * Copyright 2013-present, Facebook, Inc.
  8005. * All rights reserved.
  8006. *
  8007. * This source code is licensed under the BSD-style license found in the
  8008. * LICENSE file in the root directory of this source tree. An additional grant
  8009. * of patent rights can be found in the PATENTS file in the same directory.
  8010. *
  8011. * @providesModule Danger
  8012. */
  8013. 'use strict';
  8014. var DOMLazyTree = __webpack_require__(74);
  8015. var ExecutionEnvironment = __webpack_require__(19);
  8016. var createNodesFromMarkup = __webpack_require__(81);
  8017. var emptyFunction = __webpack_require__(10);
  8018. var getMarkupWrap = __webpack_require__(83);
  8019. var invariant = __webpack_require__(6);
  8020. var OPEN_TAG_NAME_EXP = /^(<[^ \/>]+)/;
  8021. var RESULT_INDEX_ATTR = 'data-danger-index';
  8022. /**
  8023. * Extracts the `nodeName` from a string of markup.
  8024. *
  8025. * NOTE: Extracting the `nodeName` does not require a regular expression match
  8026. * because we make assumptions about React-generated markup (i.e. there are no
  8027. * spaces surrounding the opening tag and there is at least one attribute).
  8028. *
  8029. * @param {string} markup String of markup.
  8030. * @return {string} Node name of the supplied markup.
  8031. * @see http://jsperf.com/extract-nodename
  8032. */
  8033. function getNodeName(markup) {
  8034. return markup.substring(1, markup.indexOf(' '));
  8035. }
  8036. var Danger = {
  8037. /**
  8038. * Renders markup into an array of nodes. The markup is expected to render
  8039. * into a list of root nodes. Also, the length of `resultList` and
  8040. * `markupList` should be the same.
  8041. *
  8042. * @param {array<string>} markupList List of markup strings to render.
  8043. * @return {array<DOMElement>} List of rendered nodes.
  8044. * @internal
  8045. */
  8046. dangerouslyRenderMarkup: function (markupList) {
  8047. !ExecutionEnvironment.canUseDOM ? false ? invariant(false, 'dangerouslyRenderMarkup(...): Cannot render markup in a worker ' + 'thread. Make sure `window` and `document` are available globally ' + 'before requiring React when unit testing or use ' + 'ReactDOMServer.renderToString for server rendering.') : invariant(false) : void 0;
  8048. var nodeName;
  8049. var markupByNodeName = {};
  8050. // Group markup by `nodeName` if a wrap is necessary, else by '*'.
  8051. for (var i = 0; i < markupList.length; i++) {
  8052. !markupList[i] ? false ? invariant(false, 'dangerouslyRenderMarkup(...): Missing markup.') : invariant(false) : void 0;
  8053. nodeName = getNodeName(markupList[i]);
  8054. nodeName = getMarkupWrap(nodeName) ? nodeName : '*';
  8055. markupByNodeName[nodeName] = markupByNodeName[nodeName] || [];
  8056. markupByNodeName[nodeName][i] = markupList[i];
  8057. }
  8058. var resultList = [];
  8059. var resultListAssignmentCount = 0;
  8060. for (nodeName in markupByNodeName) {
  8061. if (!markupByNodeName.hasOwnProperty(nodeName)) {
  8062. continue;
  8063. }
  8064. var markupListByNodeName = markupByNodeName[nodeName];
  8065. // This for-in loop skips the holes of the sparse array. The order of
  8066. // iteration should follow the order of assignment, which happens to match
  8067. // numerical index order, but we don't rely on that.
  8068. var resultIndex;
  8069. for (resultIndex in markupListByNodeName) {
  8070. if (markupListByNodeName.hasOwnProperty(resultIndex)) {
  8071. var markup = markupListByNodeName[resultIndex];
  8072. // Push the requested markup with an additional RESULT_INDEX_ATTR
  8073. // attribute. If the markup does not start with a < character, it
  8074. // will be discarded below (with an appropriate console.error).
  8075. markupListByNodeName[resultIndex] = markup.replace(OPEN_TAG_NAME_EXP,
  8076. // This index will be parsed back out below.
  8077. '$1 ' + RESULT_INDEX_ATTR + '="' + resultIndex + '" ');
  8078. }
  8079. }
  8080. // Render each group of markup with similar wrapping `nodeName`.
  8081. var renderNodes = createNodesFromMarkup(markupListByNodeName.join(''), emptyFunction // Do nothing special with <script> tags.
  8082. );
  8083. for (var j = 0; j < renderNodes.length; ++j) {
  8084. var renderNode = renderNodes[j];
  8085. if (renderNode.hasAttribute && renderNode.hasAttribute(RESULT_INDEX_ATTR)) {
  8086. resultIndex = +renderNode.getAttribute(RESULT_INDEX_ATTR);
  8087. renderNode.removeAttribute(RESULT_INDEX_ATTR);
  8088. !!resultList.hasOwnProperty(resultIndex) ? false ? invariant(false, 'Danger: Assigning to an already-occupied result index.') : invariant(false) : void 0;
  8089. resultList[resultIndex] = renderNode;
  8090. // This should match resultList.length and markupList.length when
  8091. // we're done.
  8092. resultListAssignmentCount += 1;
  8093. } else if (false) {
  8094. console.error('Danger: Discarding unexpected node:', renderNode);
  8095. }
  8096. }
  8097. }
  8098. // Although resultList was populated out of order, it should now be a dense
  8099. // array.
  8100. !(resultListAssignmentCount === resultList.length) ? false ? invariant(false, 'Danger: Did not assign to every index of resultList.') : invariant(false) : void 0;
  8101. !(resultList.length === markupList.length) ? false ? invariant(false, 'Danger: Expected markup to render %s nodes, but rendered %s.', markupList.length, resultList.length) : invariant(false) : void 0;
  8102. return resultList;
  8103. },
  8104. /**
  8105. * Replaces a node with a string of markup at its current position within its
  8106. * parent. The markup must render into a single root node.
  8107. *
  8108. * @param {DOMElement} oldChild Child node to replace.
  8109. * @param {string} markup Markup to render in place of the child node.
  8110. * @internal
  8111. */
  8112. dangerouslyReplaceNodeWithMarkup: function (oldChild, markup) {
  8113. !ExecutionEnvironment.canUseDOM ? false ? invariant(false, 'dangerouslyReplaceNodeWithMarkup(...): Cannot render markup in a ' + 'worker thread. Make sure `window` and `document` are available ' + 'globally before requiring React when unit testing or use ' + 'ReactDOMServer.renderToString() for server rendering.') : invariant(false) : void 0;
  8114. !markup ? false ? invariant(false, 'dangerouslyReplaceNodeWithMarkup(...): Missing markup.') : invariant(false) : void 0;
  8115. !(oldChild.nodeName !== 'HTML') ? false ? invariant(false, 'dangerouslyReplaceNodeWithMarkup(...): Cannot replace markup of the ' + '<html> node. This is because browser quirks make this unreliable ' + 'and/or slow. If you want to render to the root you must use ' + 'server rendering. See ReactDOMServer.renderToString().') : invariant(false) : void 0;
  8116. if (typeof markup === 'string') {
  8117. var newChild = createNodesFromMarkup(markup, emptyFunction)[0];
  8118. oldChild.parentNode.replaceChild(newChild, oldChild);
  8119. } else {
  8120. DOMLazyTree.replaceChildWithTree(oldChild, markup);
  8121. }
  8122. }
  8123. };
  8124. module.exports = Danger;
  8125. /***/ },
  8126. /* 81 */
  8127. /***/ function(module, exports, __webpack_require__) {
  8128. 'use strict';
  8129. /**
  8130. * Copyright (c) 2013-present, Facebook, Inc.
  8131. * All rights reserved.
  8132. *
  8133. * This source code is licensed under the BSD-style license found in the
  8134. * LICENSE file in the root directory of this source tree. An additional grant
  8135. * of patent rights can be found in the PATENTS file in the same directory.
  8136. *
  8137. * @typechecks
  8138. */
  8139. /*eslint-disable fb-www/unsafe-html*/
  8140. var ExecutionEnvironment = __webpack_require__(19);
  8141. var createArrayFromMixed = __webpack_require__(82);
  8142. var getMarkupWrap = __webpack_require__(83);
  8143. var invariant = __webpack_require__(6);
  8144. /**
  8145. * Dummy container used to render all markup.
  8146. */
  8147. var dummyNode = ExecutionEnvironment.canUseDOM ? document.createElement('div') : null;
  8148. /**
  8149. * Pattern used by `getNodeName`.
  8150. */
  8151. var nodeNamePattern = /^\s*<(\w+)/;
  8152. /**
  8153. * Extracts the `nodeName` of the first element in a string of markup.
  8154. *
  8155. * @param {string} markup String of markup.
  8156. * @return {?string} Node name of the supplied markup.
  8157. */
  8158. function getNodeName(markup) {
  8159. var nodeNameMatch = markup.match(nodeNamePattern);
  8160. return nodeNameMatch && nodeNameMatch[1].toLowerCase();
  8161. }
  8162. /**
  8163. * Creates an array containing the nodes rendered from the supplied markup. The
  8164. * optionally supplied `handleScript` function will be invoked once for each
  8165. * <script> element that is rendered. If no `handleScript` function is supplied,
  8166. * an exception is thrown if any <script> elements are rendered.
  8167. *
  8168. * @param {string} markup A string of valid HTML markup.
  8169. * @param {?function} handleScript Invoked once for each rendered <script>.
  8170. * @return {array<DOMElement|DOMTextNode>} An array of rendered nodes.
  8171. */
  8172. function createNodesFromMarkup(markup, handleScript) {
  8173. var node = dummyNode;
  8174. !!!dummyNode ? false ? invariant(false, 'createNodesFromMarkup dummy not initialized') : invariant(false) : void 0;
  8175. var nodeName = getNodeName(markup);
  8176. var wrap = nodeName && getMarkupWrap(nodeName);
  8177. if (wrap) {
  8178. node.innerHTML = wrap[1] + markup + wrap[2];
  8179. var wrapDepth = wrap[0];
  8180. while (wrapDepth--) {
  8181. node = node.lastChild;
  8182. }
  8183. } else {
  8184. node.innerHTML = markup;
  8185. }
  8186. var scripts = node.getElementsByTagName('script');
  8187. if (scripts.length) {
  8188. !handleScript ? false ? invariant(false, 'createNodesFromMarkup(...): Unexpected <script> element rendered.') : invariant(false) : void 0;
  8189. createArrayFromMixed(scripts).forEach(handleScript);
  8190. }
  8191. var nodes = Array.from(node.childNodes);
  8192. while (node.lastChild) {
  8193. node.removeChild(node.lastChild);
  8194. }
  8195. return nodes;
  8196. }
  8197. module.exports = createNodesFromMarkup;
  8198. /***/ },
  8199. /* 82 */
  8200. /***/ function(module, exports, __webpack_require__) {
  8201. 'use strict';
  8202. /**
  8203. * Copyright (c) 2013-present, Facebook, Inc.
  8204. * All rights reserved.
  8205. *
  8206. * This source code is licensed under the BSD-style license found in the
  8207. * LICENSE file in the root directory of this source tree. An additional grant
  8208. * of patent rights can be found in the PATENTS file in the same directory.
  8209. *
  8210. * @typechecks
  8211. */
  8212. var invariant = __webpack_require__(6);
  8213. /**
  8214. * Convert array-like objects to arrays.
  8215. *
  8216. * This API assumes the caller knows the contents of the data type. For less
  8217. * well defined inputs use createArrayFromMixed.
  8218. *
  8219. * @param {object|function|filelist} obj
  8220. * @return {array}
  8221. */
  8222. function toArray(obj) {
  8223. var length = obj.length;
  8224. // Some browsers builtin objects can report typeof 'function' (e.g. NodeList
  8225. // in old versions of Safari).
  8226. !(!Array.isArray(obj) && (typeof obj === 'object' || typeof obj === 'function')) ? false ? invariant(false, 'toArray: Array-like object expected') : invariant(false) : void 0;
  8227. !(typeof length === 'number') ? false ? invariant(false, 'toArray: Object needs a length property') : invariant(false) : void 0;
  8228. !(length === 0 || length - 1 in obj) ? false ? invariant(false, 'toArray: Object should have keys for indices') : invariant(false) : void 0;
  8229. !(typeof obj.callee !== 'function') ? false ? invariant(false, 'toArray: Object can\'t be `arguments`. Use rest params ' + '(function(...args) {}) or Array.from() instead.') : invariant(false) : void 0;
  8230. // Old IE doesn't give collections access to hasOwnProperty. Assume inputs
  8231. // without method will throw during the slice call and skip straight to the
  8232. // fallback.
  8233. if (obj.hasOwnProperty) {
  8234. try {
  8235. return Array.prototype.slice.call(obj);
  8236. } catch (e) {
  8237. // IE < 9 does not support Array#slice on collections objects
  8238. }
  8239. }
  8240. // Fall back to copying key by key. This assumes all keys have a value,
  8241. // so will not preserve sparsely populated inputs.
  8242. var ret = Array(length);
  8243. for (var ii = 0; ii < length; ii++) {
  8244. ret[ii] = obj[ii];
  8245. }
  8246. return ret;
  8247. }
  8248. /**
  8249. * Perform a heuristic test to determine if an object is "array-like".
  8250. *
  8251. * A monk asked Joshu, a Zen master, "Has a dog Buddha nature?"
  8252. * Joshu replied: "Mu."
  8253. *
  8254. * This function determines if its argument has "array nature": it returns
  8255. * true if the argument is an actual array, an `arguments' object, or an
  8256. * HTMLCollection (e.g. node.childNodes or node.getElementsByTagName()).
  8257. *
  8258. * It will return false for other array-like objects like Filelist.
  8259. *
  8260. * @param {*} obj
  8261. * @return {boolean}
  8262. */
  8263. function hasArrayNature(obj) {
  8264. return (
  8265. // not null/false
  8266. !!obj && (
  8267. // arrays are objects, NodeLists are functions in Safari
  8268. typeof obj == 'object' || typeof obj == 'function') &&
  8269. // quacks like an array
  8270. 'length' in obj &&
  8271. // not window
  8272. !('setInterval' in obj) &&
  8273. // no DOM node should be considered an array-like
  8274. // a 'select' element has 'length' and 'item' properties on IE8
  8275. typeof obj.nodeType != 'number' && (
  8276. // a real array
  8277. Array.isArray(obj) ||
  8278. // arguments
  8279. 'callee' in obj ||
  8280. // HTMLCollection/NodeList
  8281. 'item' in obj)
  8282. );
  8283. }
  8284. /**
  8285. * Ensure that the argument is an array by wrapping it in an array if it is not.
  8286. * Creates a copy of the argument if it is already an array.
  8287. *
  8288. * This is mostly useful idiomatically:
  8289. *
  8290. * var createArrayFromMixed = require('createArrayFromMixed');
  8291. *
  8292. * function takesOneOrMoreThings(things) {
  8293. * things = createArrayFromMixed(things);
  8294. * ...
  8295. * }
  8296. *
  8297. * This allows you to treat `things' as an array, but accept scalars in the API.
  8298. *
  8299. * If you need to convert an array-like object, like `arguments`, into an array
  8300. * use toArray instead.
  8301. *
  8302. * @param {*} obj
  8303. * @return {array}
  8304. */
  8305. function createArrayFromMixed(obj) {
  8306. if (!hasArrayNature(obj)) {
  8307. return [obj];
  8308. } else if (Array.isArray(obj)) {
  8309. return obj.slice();
  8310. } else {
  8311. return toArray(obj);
  8312. }
  8313. }
  8314. module.exports = createArrayFromMixed;
  8315. /***/ },
  8316. /* 83 */
  8317. /***/ function(module, exports, __webpack_require__) {
  8318. 'use strict';
  8319. /**
  8320. * Copyright (c) 2013-present, Facebook, Inc.
  8321. * All rights reserved.
  8322. *
  8323. * This source code is licensed under the BSD-style license found in the
  8324. * LICENSE file in the root directory of this source tree. An additional grant
  8325. * of patent rights can be found in the PATENTS file in the same directory.
  8326. *
  8327. */
  8328. /*eslint-disable fb-www/unsafe-html */
  8329. var ExecutionEnvironment = __webpack_require__(19);
  8330. var invariant = __webpack_require__(6);
  8331. /**
  8332. * Dummy container used to detect which wraps are necessary.
  8333. */
  8334. var dummyNode = ExecutionEnvironment.canUseDOM ? document.createElement('div') : null;
  8335. /**
  8336. * Some browsers cannot use `innerHTML` to render certain elements standalone,
  8337. * so we wrap them, render the wrapped nodes, then extract the desired node.
  8338. *
  8339. * In IE8, certain elements cannot render alone, so wrap all elements ('*').
  8340. */
  8341. var shouldWrap = {};
  8342. var selectWrap = [1, '<select multiple="true">', '</select>'];
  8343. var tableWrap = [1, '<table>', '</table>'];
  8344. var trWrap = [3, '<table><tbody><tr>', '</tr></tbody></table>'];
  8345. var svgWrap = [1, '<svg xmlns="http://www.w3.org/2000/svg">', '</svg>'];
  8346. var markupWrap = {
  8347. '*': [1, '?<div>', '</div>'],
  8348. 'area': [1, '<map>', '</map>'],
  8349. 'col': [2, '<table><tbody></tbody><colgroup>', '</colgroup></table>'],
  8350. 'legend': [1, '<fieldset>', '</fieldset>'],
  8351. 'param': [1, '<object>', '</object>'],
  8352. 'tr': [2, '<table><tbody>', '</tbody></table>'],
  8353. 'optgroup': selectWrap,
  8354. 'option': selectWrap,
  8355. 'caption': tableWrap,
  8356. 'colgroup': tableWrap,
  8357. 'tbody': tableWrap,
  8358. 'tfoot': tableWrap,
  8359. 'thead': tableWrap,
  8360. 'td': trWrap,
  8361. 'th': trWrap
  8362. };
  8363. // Initialize the SVG elements since we know they'll always need to be wrapped
  8364. // consistently. If they are created inside a <div> they will be initialized in
  8365. // the wrong namespace (and will not display).
  8366. var svgElements = ['circle', 'clipPath', 'defs', 'ellipse', 'g', 'image', 'line', 'linearGradient', 'mask', 'path', 'pattern', 'polygon', 'polyline', 'radialGradient', 'rect', 'stop', 'text', 'tspan'];
  8367. svgElements.forEach(function (nodeName) {
  8368. markupWrap[nodeName] = svgWrap;
  8369. shouldWrap[nodeName] = true;
  8370. });
  8371. /**
  8372. * Gets the markup wrap configuration for the supplied `nodeName`.
  8373. *
  8374. * NOTE: This lazily detects which wraps are necessary for the current browser.
  8375. *
  8376. * @param {string} nodeName Lowercase `nodeName`.
  8377. * @return {?array} Markup wrap configuration, if applicable.
  8378. */
  8379. function getMarkupWrap(nodeName) {
  8380. !!!dummyNode ? false ? invariant(false, 'Markup wrapping node not initialized') : invariant(false) : void 0;
  8381. if (!markupWrap.hasOwnProperty(nodeName)) {
  8382. nodeName = '*';
  8383. }
  8384. if (!shouldWrap.hasOwnProperty(nodeName)) {
  8385. if (nodeName === '*') {
  8386. dummyNode.innerHTML = '<link />';
  8387. } else {
  8388. dummyNode.innerHTML = '<' + nodeName + '></' + nodeName + '>';
  8389. }
  8390. shouldWrap[nodeName] = !dummyNode.firstChild;
  8391. }
  8392. return shouldWrap[nodeName] ? markupWrap[nodeName] : null;
  8393. }
  8394. module.exports = getMarkupWrap;
  8395. /***/ },
  8396. /* 84 */
  8397. /***/ function(module, exports, __webpack_require__) {
  8398. /**
  8399. * Copyright 2013-present, Facebook, Inc.
  8400. * All rights reserved.
  8401. *
  8402. * This source code is licensed under the BSD-style license found in the
  8403. * LICENSE file in the root directory of this source tree. An additional grant
  8404. * of patent rights can be found in the PATENTS file in the same directory.
  8405. *
  8406. * @providesModule ReactMultiChildUpdateTypes
  8407. */
  8408. 'use strict';
  8409. var keyMirror = __webpack_require__(25);
  8410. /**
  8411. * When a component's children are updated, a series of update configuration
  8412. * objects are created in order to batch and serialize the required changes.
  8413. *
  8414. * Enumerates all the possible types of update configurations.
  8415. *
  8416. * @internal
  8417. */
  8418. var ReactMultiChildUpdateTypes = keyMirror({
  8419. INSERT_MARKUP: null,
  8420. MOVE_EXISTING: null,
  8421. REMOVE_NODE: null,
  8422. SET_MARKUP: null,
  8423. TEXT_CONTENT: null
  8424. });
  8425. module.exports = ReactMultiChildUpdateTypes;
  8426. /***/ },
  8427. /* 85 */
  8428. /***/ function(module, exports, __webpack_require__) {
  8429. /**
  8430. * Copyright 2013-present, Facebook, Inc.
  8431. * All rights reserved.
  8432. *
  8433. * This source code is licensed under the BSD-style license found in the
  8434. * LICENSE file in the root directory of this source tree. An additional grant
  8435. * of patent rights can be found in the PATENTS file in the same directory.
  8436. *
  8437. * @providesModule ReactDOMIDOperations
  8438. */
  8439. 'use strict';
  8440. var DOMChildrenOperations = __webpack_require__(73);
  8441. var ReactDOMComponentTree = __webpack_require__(36);
  8442. /**
  8443. * Operations used to process updates to DOM nodes.
  8444. */
  8445. var ReactDOMIDOperations = {
  8446. /**
  8447. * Updates a component's children by processing a series of updates.
  8448. *
  8449. * @param {array<object>} updates List of update configurations.
  8450. * @internal
  8451. */
  8452. dangerouslyProcessChildrenUpdates: function (parentInst, updates) {
  8453. var node = ReactDOMComponentTree.getNodeFromInstance(parentInst);
  8454. DOMChildrenOperations.processUpdates(node, updates);
  8455. }
  8456. };
  8457. module.exports = ReactDOMIDOperations;
  8458. /***/ },
  8459. /* 86 */
  8460. /***/ function(module, exports, __webpack_require__) {
  8461. /**
  8462. * Copyright 2013-present, Facebook, Inc.
  8463. * All rights reserved.
  8464. *
  8465. * This source code is licensed under the BSD-style license found in the
  8466. * LICENSE file in the root directory of this source tree. An additional grant
  8467. * of patent rights can be found in the PATENTS file in the same directory.
  8468. *
  8469. * @providesModule ReactDOMComponent
  8470. */
  8471. /* global hasOwnProperty:true */
  8472. 'use strict';
  8473. var _assign = __webpack_require__(3);
  8474. var AutoFocusUtils = __webpack_require__(87);
  8475. var CSSPropertyOperations = __webpack_require__(89);
  8476. var DOMLazyTree = __webpack_require__(74);
  8477. var DOMNamespaces = __webpack_require__(75);
  8478. var DOMProperty = __webpack_require__(37);
  8479. var DOMPropertyOperations = __webpack_require__(97);
  8480. var EventConstants = __webpack_require__(41);
  8481. var EventPluginHub = __webpack_require__(43);
  8482. var EventPluginRegistry = __webpack_require__(44);
  8483. var ReactBrowserEventEmitter = __webpack_require__(102);
  8484. var ReactComponentBrowserEnvironment = __webpack_require__(72);
  8485. var ReactDOMButton = __webpack_require__(105);
  8486. var ReactDOMComponentFlags = __webpack_require__(38);
  8487. var ReactDOMComponentTree = __webpack_require__(36);
  8488. var ReactDOMInput = __webpack_require__(107);
  8489. var ReactDOMOption = __webpack_require__(109);
  8490. var ReactDOMSelect = __webpack_require__(110);
  8491. var ReactDOMTextarea = __webpack_require__(111);
  8492. var ReactInstrumentation = __webpack_require__(17);
  8493. var ReactMultiChild = __webpack_require__(112);
  8494. var ReactServerRenderingTransaction = __webpack_require__(124);
  8495. var emptyFunction = __webpack_require__(10);
  8496. var escapeTextContentForBrowser = __webpack_require__(78);
  8497. var invariant = __webpack_require__(6);
  8498. var isEventSupported = __webpack_require__(63);
  8499. var keyOf = __webpack_require__(27);
  8500. var shallowEqual = __webpack_require__(125);
  8501. var validateDOMNesting = __webpack_require__(126);
  8502. var warning = __webpack_require__(9);
  8503. var Flags = ReactDOMComponentFlags;
  8504. var deleteListener = EventPluginHub.deleteListener;
  8505. var getNode = ReactDOMComponentTree.getNodeFromInstance;
  8506. var listenTo = ReactBrowserEventEmitter.listenTo;
  8507. var registrationNameModules = EventPluginRegistry.registrationNameModules;
  8508. // For quickly matching children type, to test if can be treated as content.
  8509. var CONTENT_TYPES = { 'string': true, 'number': true };
  8510. var STYLE = keyOf({ style: null });
  8511. var HTML = keyOf({ __html: null });
  8512. var RESERVED_PROPS = {
  8513. children: null,
  8514. dangerouslySetInnerHTML: null,
  8515. suppressContentEditableWarning: null
  8516. };
  8517. // Node type for document fragments (Node.DOCUMENT_FRAGMENT_NODE).
  8518. var DOC_FRAGMENT_TYPE = 11;
  8519. function getDeclarationErrorAddendum(internalInstance) {
  8520. if (internalInstance) {
  8521. var owner = internalInstance._currentElement._owner || null;
  8522. if (owner) {
  8523. var name = owner.getName();
  8524. if (name) {
  8525. return ' This DOM node was rendered by `' + name + '`.';
  8526. }
  8527. }
  8528. }
  8529. return '';
  8530. }
  8531. function friendlyStringify(obj) {
  8532. if (typeof obj === 'object') {
  8533. if (Array.isArray(obj)) {
  8534. return '[' + obj.map(friendlyStringify).join(', ') + ']';
  8535. } else {
  8536. var pairs = [];
  8537. for (var key in obj) {
  8538. if (Object.prototype.hasOwnProperty.call(obj, key)) {
  8539. var keyEscaped = /^[a-z$_][\w$_]*$/i.test(key) ? key : JSON.stringify(key);
  8540. pairs.push(keyEscaped + ': ' + friendlyStringify(obj[key]));
  8541. }
  8542. }
  8543. return '{' + pairs.join(', ') + '}';
  8544. }
  8545. } else if (typeof obj === 'string') {
  8546. return JSON.stringify(obj);
  8547. } else if (typeof obj === 'function') {
  8548. return '[function object]';
  8549. }
  8550. // Differs from JSON.stringify in that undefined because undefined and that
  8551. // inf and nan don't become null
  8552. return String(obj);
  8553. }
  8554. var styleMutationWarning = {};
  8555. function checkAndWarnForMutatedStyle(style1, style2, component) {
  8556. if (style1 == null || style2 == null) {
  8557. return;
  8558. }
  8559. if (shallowEqual(style1, style2)) {
  8560. return;
  8561. }
  8562. var componentName = component._tag;
  8563. var owner = component._currentElement._owner;
  8564. var ownerName;
  8565. if (owner) {
  8566. ownerName = owner.getName();
  8567. }
  8568. var hash = ownerName + '|' + componentName;
  8569. if (styleMutationWarning.hasOwnProperty(hash)) {
  8570. return;
  8571. }
  8572. styleMutationWarning[hash] = true;
  8573. false ? warning(false, '`%s` was passed a style object that has previously been mutated. ' + 'Mutating `style` is deprecated. Consider cloning it beforehand. Check ' + 'the `render` %s. Previous style: %s. Mutated style: %s.', componentName, owner ? 'of `' + ownerName + '`' : 'using <' + componentName + '>', friendlyStringify(style1), friendlyStringify(style2)) : void 0;
  8574. }
  8575. /**
  8576. * @param {object} component
  8577. * @param {?object} props
  8578. */
  8579. function assertValidProps(component, props) {
  8580. if (!props) {
  8581. return;
  8582. }
  8583. // Note the use of `==` which checks for null or undefined.
  8584. if (voidElementTags[component._tag]) {
  8585. !(props.children == null && props.dangerouslySetInnerHTML == null) ? false ? invariant(false, '%s is a void element tag and must not have `children` or ' + 'use `props.dangerouslySetInnerHTML`.%s', component._tag, component._currentElement._owner ? ' Check the render method of ' + component._currentElement._owner.getName() + '.' : '') : invariant(false) : void 0;
  8586. }
  8587. if (props.dangerouslySetInnerHTML != null) {
  8588. !(props.children == null) ? false ? invariant(false, 'Can only set one of `children` or `props.dangerouslySetInnerHTML`.') : invariant(false) : void 0;
  8589. !(typeof props.dangerouslySetInnerHTML === 'object' && HTML in props.dangerouslySetInnerHTML) ? false ? invariant(false, '`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. ' + 'Please visit https://fb.me/react-invariant-dangerously-set-inner-html ' + 'for more information.') : invariant(false) : void 0;
  8590. }
  8591. if (false) {
  8592. process.env.NODE_ENV !== 'production' ? warning(props.innerHTML == null, 'Directly setting property `innerHTML` is not permitted. ' + 'For more information, lookup documentation on `dangerouslySetInnerHTML`.') : void 0;
  8593. process.env.NODE_ENV !== 'production' ? warning(props.suppressContentEditableWarning || !props.contentEditable || props.children == null, 'A component is `contentEditable` and contains `children` managed by ' + 'React. It is now your responsibility to guarantee that none of ' + 'those nodes are unexpectedly modified or duplicated. This is ' + 'probably not intentional.') : void 0;
  8594. process.env.NODE_ENV !== 'production' ? warning(props.onFocusIn == null && props.onFocusOut == null, 'React uses onFocus and onBlur instead of onFocusIn and onFocusOut. ' + 'All React events are normalized to bubble, so onFocusIn and onFocusOut ' + 'are not needed/supported by React.') : void 0;
  8595. }
  8596. !(props.style == null || typeof props.style === 'object') ? false ? invariant(false, 'The `style` prop expects a mapping from style properties to values, ' + 'not a string. For example, style={{marginRight: spacing + \'em\'}} when ' + 'using JSX.%s', getDeclarationErrorAddendum(component)) : invariant(false) : void 0;
  8597. }
  8598. function enqueuePutListener(inst, registrationName, listener, transaction) {
  8599. if (transaction instanceof ReactServerRenderingTransaction) {
  8600. return;
  8601. }
  8602. if (false) {
  8603. // IE8 has no API for event capturing and the `onScroll` event doesn't
  8604. // bubble.
  8605. process.env.NODE_ENV !== 'production' ? warning(registrationName !== 'onScroll' || isEventSupported('scroll', true), 'This browser doesn\'t support the `onScroll` event') : void 0;
  8606. }
  8607. var containerInfo = inst._nativeContainerInfo;
  8608. var isDocumentFragment = containerInfo._node && containerInfo._node.nodeType === DOC_FRAGMENT_TYPE;
  8609. var doc = isDocumentFragment ? containerInfo._node : containerInfo._ownerDocument;
  8610. listenTo(registrationName, doc);
  8611. transaction.getReactMountReady().enqueue(putListener, {
  8612. inst: inst,
  8613. registrationName: registrationName,
  8614. listener: listener
  8615. });
  8616. }
  8617. function putListener() {
  8618. var listenerToPut = this;
  8619. EventPluginHub.putListener(listenerToPut.inst, listenerToPut.registrationName, listenerToPut.listener);
  8620. }
  8621. function optionPostMount() {
  8622. var inst = this;
  8623. ReactDOMOption.postMountWrapper(inst);
  8624. }
  8625. var setContentChildForInstrumentation = emptyFunction;
  8626. if (false) {
  8627. setContentChildForInstrumentation = function (contentToUse) {
  8628. var debugID = this._debugID;
  8629. var contentDebugID = debugID + '#text';
  8630. this._contentDebugID = contentDebugID;
  8631. ReactInstrumentation.debugTool.onSetDisplayName(contentDebugID, '#text');
  8632. ReactInstrumentation.debugTool.onSetText(contentDebugID, '' + contentToUse);
  8633. ReactInstrumentation.debugTool.onMountComponent(contentDebugID);
  8634. ReactInstrumentation.debugTool.onSetChildren(debugID, [contentDebugID]);
  8635. };
  8636. }
  8637. // There are so many media events, it makes sense to just
  8638. // maintain a list rather than create a `trapBubbledEvent` for each
  8639. var mediaEvents = {
  8640. topAbort: 'abort',
  8641. topCanPlay: 'canplay',
  8642. topCanPlayThrough: 'canplaythrough',
  8643. topDurationChange: 'durationchange',
  8644. topEmptied: 'emptied',
  8645. topEncrypted: 'encrypted',
  8646. topEnded: 'ended',
  8647. topError: 'error',
  8648. topLoadedData: 'loadeddata',
  8649. topLoadedMetadata: 'loadedmetadata',
  8650. topLoadStart: 'loadstart',
  8651. topPause: 'pause',
  8652. topPlay: 'play',
  8653. topPlaying: 'playing',
  8654. topProgress: 'progress',
  8655. topRateChange: 'ratechange',
  8656. topSeeked: 'seeked',
  8657. topSeeking: 'seeking',
  8658. topStalled: 'stalled',
  8659. topSuspend: 'suspend',
  8660. topTimeUpdate: 'timeupdate',
  8661. topVolumeChange: 'volumechange',
  8662. topWaiting: 'waiting'
  8663. };
  8664. function trapBubbledEventsLocal() {
  8665. var inst = this;
  8666. // If a component renders to null or if another component fatals and causes
  8667. // the state of the tree to be corrupted, `node` here can be null.
  8668. !inst._rootNodeID ? false ? invariant(false, 'Must be mounted to trap events') : invariant(false) : void 0;
  8669. var node = getNode(inst);
  8670. !node ? false ? invariant(false, 'trapBubbledEvent(...): Requires node to be rendered.') : invariant(false) : void 0;
  8671. switch (inst._tag) {
  8672. case 'iframe':
  8673. case 'object':
  8674. inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topLoad, 'load', node)];
  8675. break;
  8676. case 'video':
  8677. case 'audio':
  8678. inst._wrapperState.listeners = [];
  8679. // Create listener for each media event
  8680. for (var event in mediaEvents) {
  8681. if (mediaEvents.hasOwnProperty(event)) {
  8682. inst._wrapperState.listeners.push(ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes[event], mediaEvents[event], node));
  8683. }
  8684. }
  8685. break;
  8686. case 'img':
  8687. inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topError, 'error', node), ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topLoad, 'load', node)];
  8688. break;
  8689. case 'form':
  8690. inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topReset, 'reset', node), ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topSubmit, 'submit', node)];
  8691. break;
  8692. case 'input':
  8693. case 'select':
  8694. case 'textarea':
  8695. inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topInvalid, 'invalid', node)];
  8696. break;
  8697. }
  8698. }
  8699. function postUpdateSelectWrapper() {
  8700. ReactDOMSelect.postUpdateWrapper(this);
  8701. }
  8702. // For HTML, certain tags should omit their close tag. We keep a whitelist for
  8703. // those special-case tags.
  8704. var omittedCloseTags = {
  8705. 'area': true,
  8706. 'base': true,
  8707. 'br': true,
  8708. 'col': true,
  8709. 'embed': true,
  8710. 'hr': true,
  8711. 'img': true,
  8712. 'input': true,
  8713. 'keygen': true,
  8714. 'link': true,
  8715. 'meta': true,
  8716. 'param': true,
  8717. 'source': true,
  8718. 'track': true,
  8719. 'wbr': true
  8720. };
  8721. // NOTE: menuitem's close tag should be omitted, but that causes problems.
  8722. var newlineEatingTags = {
  8723. 'listing': true,
  8724. 'pre': true,
  8725. 'textarea': true
  8726. };
  8727. // For HTML, certain tags cannot have children. This has the same purpose as
  8728. // `omittedCloseTags` except that `menuitem` should still have its closing tag.
  8729. var voidElementTags = _assign({
  8730. 'menuitem': true
  8731. }, omittedCloseTags);
  8732. // We accept any tag to be rendered but since this gets injected into arbitrary
  8733. // HTML, we want to make sure that it's a safe tag.
  8734. // http://www.w3.org/TR/REC-xml/#NT-Name
  8735. var VALID_TAG_REGEX = /^[a-zA-Z][a-zA-Z:_\.\-\d]*$/; // Simplified subset
  8736. var validatedTagCache = {};
  8737. var hasOwnProperty = {}.hasOwnProperty;
  8738. function validateDangerousTag(tag) {
  8739. if (!hasOwnProperty.call(validatedTagCache, tag)) {
  8740. !VALID_TAG_REGEX.test(tag) ? false ? invariant(false, 'Invalid tag: %s', tag) : invariant(false) : void 0;
  8741. validatedTagCache[tag] = true;
  8742. }
  8743. }
  8744. function isCustomComponent(tagName, props) {
  8745. return tagName.indexOf('-') >= 0 || props.is != null;
  8746. }
  8747. var globalIdCounter = 1;
  8748. /**
  8749. * Creates a new React class that is idempotent and capable of containing other
  8750. * React components. It accepts event listeners and DOM properties that are
  8751. * valid according to `DOMProperty`.
  8752. *
  8753. * - Event listeners: `onClick`, `onMouseDown`, etc.
  8754. * - DOM properties: `className`, `name`, `title`, etc.
  8755. *
  8756. * The `style` property functions differently from the DOM API. It accepts an
  8757. * object mapping of style properties to values.
  8758. *
  8759. * @constructor ReactDOMComponent
  8760. * @extends ReactMultiChild
  8761. */
  8762. function ReactDOMComponent(element) {
  8763. var tag = element.type;
  8764. validateDangerousTag(tag);
  8765. this._currentElement = element;
  8766. this._tag = tag.toLowerCase();
  8767. this._namespaceURI = null;
  8768. this._renderedChildren = null;
  8769. this._previousStyle = null;
  8770. this._previousStyleCopy = null;
  8771. this._nativeNode = null;
  8772. this._nativeParent = null;
  8773. this._rootNodeID = null;
  8774. this._domID = null;
  8775. this._nativeContainerInfo = null;
  8776. this._wrapperState = null;
  8777. this._topLevelWrapper = null;
  8778. this._flags = 0;
  8779. if (false) {
  8780. this._ancestorInfo = null;
  8781. this._contentDebugID = null;
  8782. }
  8783. }
  8784. ReactDOMComponent.displayName = 'ReactDOMComponent';
  8785. ReactDOMComponent.Mixin = {
  8786. /**
  8787. * Generates root tag markup then recurses. This method has side effects and
  8788. * is not idempotent.
  8789. *
  8790. * @internal
  8791. * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
  8792. * @param {?ReactDOMComponent} the containing DOM component instance
  8793. * @param {?object} info about the native container
  8794. * @param {object} context
  8795. * @return {string} The computed markup.
  8796. */
  8797. mountComponent: function (transaction, nativeParent, nativeContainerInfo, context) {
  8798. this._rootNodeID = globalIdCounter++;
  8799. this._domID = nativeContainerInfo._idCounter++;
  8800. this._nativeParent = nativeParent;
  8801. this._nativeContainerInfo = nativeContainerInfo;
  8802. var props = this._currentElement.props;
  8803. switch (this._tag) {
  8804. case 'iframe':
  8805. case 'object':
  8806. case 'img':
  8807. case 'form':
  8808. case 'video':
  8809. case 'audio':
  8810. this._wrapperState = {
  8811. listeners: null
  8812. };
  8813. transaction.getReactMountReady().enqueue(trapBubbledEventsLocal, this);
  8814. break;
  8815. case 'button':
  8816. props = ReactDOMButton.getNativeProps(this, props, nativeParent);
  8817. break;
  8818. case 'input':
  8819. ReactDOMInput.mountWrapper(this, props, nativeParent);
  8820. props = ReactDOMInput.getNativeProps(this, props);
  8821. transaction.getReactMountReady().enqueue(trapBubbledEventsLocal, this);
  8822. break;
  8823. case 'option':
  8824. ReactDOMOption.mountWrapper(this, props, nativeParent);
  8825. props = ReactDOMOption.getNativeProps(this, props);
  8826. break;
  8827. case 'select':
  8828. ReactDOMSelect.mountWrapper(this, props, nativeParent);
  8829. props = ReactDOMSelect.getNativeProps(this, props);
  8830. transaction.getReactMountReady().enqueue(trapBubbledEventsLocal, this);
  8831. break;
  8832. case 'textarea':
  8833. ReactDOMTextarea.mountWrapper(this, props, nativeParent);
  8834. props = ReactDOMTextarea.getNativeProps(this, props);
  8835. transaction.getReactMountReady().enqueue(trapBubbledEventsLocal, this);
  8836. break;
  8837. }
  8838. assertValidProps(this, props);
  8839. // We create tags in the namespace of their parent container, except HTML
  8840. // tags get no namespace.
  8841. var namespaceURI;
  8842. var parentTag;
  8843. if (nativeParent != null) {
  8844. namespaceURI = nativeParent._namespaceURI;
  8845. parentTag = nativeParent._tag;
  8846. } else if (nativeContainerInfo._tag) {
  8847. namespaceURI = nativeContainerInfo._namespaceURI;
  8848. parentTag = nativeContainerInfo._tag;
  8849. }
  8850. if (namespaceURI == null || namespaceURI === DOMNamespaces.svg && parentTag === 'foreignobject') {
  8851. namespaceURI = DOMNamespaces.html;
  8852. }
  8853. if (namespaceURI === DOMNamespaces.html) {
  8854. if (this._tag === 'svg') {
  8855. namespaceURI = DOMNamespaces.svg;
  8856. } else if (this._tag === 'math') {
  8857. namespaceURI = DOMNamespaces.mathml;
  8858. }
  8859. }
  8860. this._namespaceURI = namespaceURI;
  8861. if (false) {
  8862. var parentInfo;
  8863. if (nativeParent != null) {
  8864. parentInfo = nativeParent._ancestorInfo;
  8865. } else if (nativeContainerInfo._tag) {
  8866. parentInfo = nativeContainerInfo._ancestorInfo;
  8867. }
  8868. if (parentInfo) {
  8869. // parentInfo should always be present except for the top-level
  8870. // component when server rendering
  8871. validateDOMNesting(this._tag, this, parentInfo);
  8872. }
  8873. this._ancestorInfo = validateDOMNesting.updatedAncestorInfo(parentInfo, this._tag, this);
  8874. }
  8875. var mountImage;
  8876. if (transaction.useCreateElement) {
  8877. var ownerDocument = nativeContainerInfo._ownerDocument;
  8878. var el;
  8879. if (namespaceURI === DOMNamespaces.html) {
  8880. if (this._tag === 'script') {
  8881. // Create the script via .innerHTML so its "parser-inserted" flag is
  8882. // set to true and it does not execute
  8883. var div = ownerDocument.createElement('div');
  8884. var type = this._currentElement.type;
  8885. div.innerHTML = '<' + type + '></' + type + '>';
  8886. el = div.removeChild(div.firstChild);
  8887. } else {
  8888. el = ownerDocument.createElement(this._currentElement.type, props.is || null);
  8889. }
  8890. } else {
  8891. el = ownerDocument.createElementNS(namespaceURI, this._currentElement.type);
  8892. }
  8893. ReactDOMComponentTree.precacheNode(this, el);
  8894. this._flags |= Flags.hasCachedChildNodes;
  8895. if (!this._nativeParent) {
  8896. DOMPropertyOperations.setAttributeForRoot(el);
  8897. }
  8898. this._updateDOMProperties(null, props, transaction);
  8899. var lazyTree = DOMLazyTree(el);
  8900. this._createInitialChildren(transaction, props, context, lazyTree);
  8901. mountImage = lazyTree;
  8902. } else {
  8903. var tagOpen = this._createOpenTagMarkupAndPutListeners(transaction, props);
  8904. var tagContent = this._createContentMarkup(transaction, props, context);
  8905. if (!tagContent && omittedCloseTags[this._tag]) {
  8906. mountImage = tagOpen + '/>';
  8907. } else {
  8908. mountImage = tagOpen + '>' + tagContent + '</' + this._currentElement.type + '>';
  8909. }
  8910. }
  8911. switch (this._tag) {
  8912. case 'button':
  8913. case 'input':
  8914. case 'select':
  8915. case 'textarea':
  8916. if (props.autoFocus) {
  8917. transaction.getReactMountReady().enqueue(AutoFocusUtils.focusDOMComponent, this);
  8918. }
  8919. break;
  8920. case 'option':
  8921. transaction.getReactMountReady().enqueue(optionPostMount, this);
  8922. }
  8923. return mountImage;
  8924. },
  8925. /**
  8926. * Creates markup for the open tag and all attributes.
  8927. *
  8928. * This method has side effects because events get registered.
  8929. *
  8930. * Iterating over object properties is faster than iterating over arrays.
  8931. * @see http://jsperf.com/obj-vs-arr-iteration
  8932. *
  8933. * @private
  8934. * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
  8935. * @param {object} props
  8936. * @return {string} Markup of opening tag.
  8937. */
  8938. _createOpenTagMarkupAndPutListeners: function (transaction, props) {
  8939. var ret = '<' + this._currentElement.type;
  8940. for (var propKey in props) {
  8941. if (!props.hasOwnProperty(propKey)) {
  8942. continue;
  8943. }
  8944. var propValue = props[propKey];
  8945. if (propValue == null) {
  8946. continue;
  8947. }
  8948. if (registrationNameModules.hasOwnProperty(propKey)) {
  8949. if (propValue) {
  8950. enqueuePutListener(this, propKey, propValue, transaction);
  8951. }
  8952. } else {
  8953. if (propKey === STYLE) {
  8954. if (propValue) {
  8955. if (false) {
  8956. // See `_updateDOMProperties`. style block
  8957. this._previousStyle = propValue;
  8958. }
  8959. propValue = this._previousStyleCopy = _assign({}, props.style);
  8960. }
  8961. propValue = CSSPropertyOperations.createMarkupForStyles(propValue, this);
  8962. }
  8963. var markup = null;
  8964. if (this._tag != null && isCustomComponent(this._tag, props)) {
  8965. if (!RESERVED_PROPS.hasOwnProperty(propKey)) {
  8966. markup = DOMPropertyOperations.createMarkupForCustomAttribute(propKey, propValue);
  8967. }
  8968. } else {
  8969. markup = DOMPropertyOperations.createMarkupForProperty(propKey, propValue);
  8970. }
  8971. if (markup) {
  8972. ret += ' ' + markup;
  8973. }
  8974. }
  8975. }
  8976. // For static pages, no need to put React ID and checksum. Saves lots of
  8977. // bytes.
  8978. if (transaction.renderToStaticMarkup) {
  8979. return ret;
  8980. }
  8981. if (!this._nativeParent) {
  8982. ret += ' ' + DOMPropertyOperations.createMarkupForRoot();
  8983. }
  8984. ret += ' ' + DOMPropertyOperations.createMarkupForID(this._domID);
  8985. return ret;
  8986. },
  8987. /**
  8988. * Creates markup for the content between the tags.
  8989. *
  8990. * @private
  8991. * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
  8992. * @param {object} props
  8993. * @param {object} context
  8994. * @return {string} Content markup.
  8995. */
  8996. _createContentMarkup: function (transaction, props, context) {
  8997. var ret = '';
  8998. // Intentional use of != to avoid catching zero/false.
  8999. var innerHTML = props.dangerouslySetInnerHTML;
  9000. if (innerHTML != null) {
  9001. if (innerHTML.__html != null) {
  9002. ret = innerHTML.__html;
  9003. }
  9004. } else {
  9005. var contentToUse = CONTENT_TYPES[typeof props.children] ? props.children : null;
  9006. var childrenToUse = contentToUse != null ? null : props.children;
  9007. if (contentToUse != null) {
  9008. // TODO: Validate that text is allowed as a child of this node
  9009. ret = escapeTextContentForBrowser(contentToUse);
  9010. if (false) {
  9011. setContentChildForInstrumentation.call(this, contentToUse);
  9012. }
  9013. } else if (childrenToUse != null) {
  9014. var mountImages = this.mountChildren(childrenToUse, transaction, context);
  9015. ret = mountImages.join('');
  9016. }
  9017. }
  9018. if (newlineEatingTags[this._tag] && ret.charAt(0) === '\n') {
  9019. // text/html ignores the first character in these tags if it's a newline
  9020. // Prefer to break application/xml over text/html (for now) by adding
  9021. // a newline specifically to get eaten by the parser. (Alternately for
  9022. // textareas, replacing "^\n" with "\r\n" doesn't get eaten, and the first
  9023. // \r is normalized out by HTMLTextAreaElement#value.)
  9024. // See: <http://www.w3.org/TR/html-polyglot/#newlines-in-textarea-and-pre>
  9025. // See: <http://www.w3.org/TR/html5/syntax.html#element-restrictions>
  9026. // See: <http://www.w3.org/TR/html5/syntax.html#newlines>
  9027. // See: Parsing of "textarea" "listing" and "pre" elements
  9028. // from <http://www.w3.org/TR/html5/syntax.html#parsing-main-inbody>
  9029. return '\n' + ret;
  9030. } else {
  9031. return ret;
  9032. }
  9033. },
  9034. _createInitialChildren: function (transaction, props, context, lazyTree) {
  9035. // Intentional use of != to avoid catching zero/false.
  9036. var innerHTML = props.dangerouslySetInnerHTML;
  9037. if (innerHTML != null) {
  9038. if (innerHTML.__html != null) {
  9039. DOMLazyTree.queueHTML(lazyTree, innerHTML.__html);
  9040. }
  9041. } else {
  9042. var contentToUse = CONTENT_TYPES[typeof props.children] ? props.children : null;
  9043. var childrenToUse = contentToUse != null ? null : props.children;
  9044. if (contentToUse != null) {
  9045. // TODO: Validate that text is allowed as a child of this node
  9046. if (false) {
  9047. setContentChildForInstrumentation.call(this, contentToUse);
  9048. }
  9049. DOMLazyTree.queueText(lazyTree, contentToUse);
  9050. } else if (childrenToUse != null) {
  9051. var mountImages = this.mountChildren(childrenToUse, transaction, context);
  9052. for (var i = 0; i < mountImages.length; i++) {
  9053. DOMLazyTree.queueChild(lazyTree, mountImages[i]);
  9054. }
  9055. }
  9056. }
  9057. },
  9058. /**
  9059. * Receives a next element and updates the component.
  9060. *
  9061. * @internal
  9062. * @param {ReactElement} nextElement
  9063. * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
  9064. * @param {object} context
  9065. */
  9066. receiveComponent: function (nextElement, transaction, context) {
  9067. var prevElement = this._currentElement;
  9068. this._currentElement = nextElement;
  9069. this.updateComponent(transaction, prevElement, nextElement, context);
  9070. },
  9071. /**
  9072. * Updates a native DOM component after it has already been allocated and
  9073. * attached to the DOM. Reconciles the root DOM node, then recurses.
  9074. *
  9075. * @param {ReactReconcileTransaction} transaction
  9076. * @param {ReactElement} prevElement
  9077. * @param {ReactElement} nextElement
  9078. * @internal
  9079. * @overridable
  9080. */
  9081. updateComponent: function (transaction, prevElement, nextElement, context) {
  9082. var lastProps = prevElement.props;
  9083. var nextProps = this._currentElement.props;
  9084. switch (this._tag) {
  9085. case 'button':
  9086. lastProps = ReactDOMButton.getNativeProps(this, lastProps);
  9087. nextProps = ReactDOMButton.getNativeProps(this, nextProps);
  9088. break;
  9089. case 'input':
  9090. ReactDOMInput.updateWrapper(this);
  9091. lastProps = ReactDOMInput.getNativeProps(this, lastProps);
  9092. nextProps = ReactDOMInput.getNativeProps(this, nextProps);
  9093. break;
  9094. case 'option':
  9095. lastProps = ReactDOMOption.getNativeProps(this, lastProps);
  9096. nextProps = ReactDOMOption.getNativeProps(this, nextProps);
  9097. break;
  9098. case 'select':
  9099. lastProps = ReactDOMSelect.getNativeProps(this, lastProps);
  9100. nextProps = ReactDOMSelect.getNativeProps(this, nextProps);
  9101. break;
  9102. case 'textarea':
  9103. ReactDOMTextarea.updateWrapper(this);
  9104. lastProps = ReactDOMTextarea.getNativeProps(this, lastProps);
  9105. nextProps = ReactDOMTextarea.getNativeProps(this, nextProps);
  9106. break;
  9107. }
  9108. assertValidProps(this, nextProps);
  9109. this._updateDOMProperties(lastProps, nextProps, transaction);
  9110. this._updateDOMChildren(lastProps, nextProps, transaction, context);
  9111. if (this._tag === 'select') {
  9112. // <select> value update needs to occur after <option> children
  9113. // reconciliation
  9114. transaction.getReactMountReady().enqueue(postUpdateSelectWrapper, this);
  9115. }
  9116. },
  9117. /**
  9118. * Reconciles the properties by detecting differences in property values and
  9119. * updating the DOM as necessary. This function is probably the single most
  9120. * critical path for performance optimization.
  9121. *
  9122. * TODO: Benchmark whether checking for changed values in memory actually
  9123. * improves performance (especially statically positioned elements).
  9124. * TODO: Benchmark the effects of putting this at the top since 99% of props
  9125. * do not change for a given reconciliation.
  9126. * TODO: Benchmark areas that can be improved with caching.
  9127. *
  9128. * @private
  9129. * @param {object} lastProps
  9130. * @param {object} nextProps
  9131. * @param {?DOMElement} node
  9132. */
  9133. _updateDOMProperties: function (lastProps, nextProps, transaction) {
  9134. var propKey;
  9135. var styleName;
  9136. var styleUpdates;
  9137. for (propKey in lastProps) {
  9138. if (nextProps.hasOwnProperty(propKey) || !lastProps.hasOwnProperty(propKey) || lastProps[propKey] == null) {
  9139. continue;
  9140. }
  9141. if (propKey === STYLE) {
  9142. var lastStyle = this._previousStyleCopy;
  9143. for (styleName in lastStyle) {
  9144. if (lastStyle.hasOwnProperty(styleName)) {
  9145. styleUpdates = styleUpdates || {};
  9146. styleUpdates[styleName] = '';
  9147. }
  9148. }
  9149. this._previousStyleCopy = null;
  9150. } else if (registrationNameModules.hasOwnProperty(propKey)) {
  9151. if (lastProps[propKey]) {
  9152. // Only call deleteListener if there was a listener previously or
  9153. // else willDeleteListener gets called when there wasn't actually a
  9154. // listener (e.g., onClick={null})
  9155. deleteListener(this, propKey);
  9156. }
  9157. } else if (DOMProperty.properties[propKey] || DOMProperty.isCustomAttribute(propKey)) {
  9158. DOMPropertyOperations.deleteValueForProperty(getNode(this), propKey);
  9159. }
  9160. }
  9161. for (propKey in nextProps) {
  9162. var nextProp = nextProps[propKey];
  9163. var lastProp = propKey === STYLE ? this._previousStyleCopy : lastProps != null ? lastProps[propKey] : undefined;
  9164. if (!nextProps.hasOwnProperty(propKey) || nextProp === lastProp || nextProp == null && lastProp == null) {
  9165. continue;
  9166. }
  9167. if (propKey === STYLE) {
  9168. if (nextProp) {
  9169. if (false) {
  9170. checkAndWarnForMutatedStyle(this._previousStyleCopy, this._previousStyle, this);
  9171. this._previousStyle = nextProp;
  9172. }
  9173. nextProp = this._previousStyleCopy = _assign({}, nextProp);
  9174. } else {
  9175. this._previousStyleCopy = null;
  9176. }
  9177. if (lastProp) {
  9178. // Unset styles on `lastProp` but not on `nextProp`.
  9179. for (styleName in lastProp) {
  9180. if (lastProp.hasOwnProperty(styleName) && (!nextProp || !nextProp.hasOwnProperty(styleName))) {
  9181. styleUpdates = styleUpdates || {};
  9182. styleUpdates[styleName] = '';
  9183. }
  9184. }
  9185. // Update styles that changed since `lastProp`.
  9186. for (styleName in nextProp) {
  9187. if (nextProp.hasOwnProperty(styleName) && lastProp[styleName] !== nextProp[styleName]) {
  9188. styleUpdates = styleUpdates || {};
  9189. styleUpdates[styleName] = nextProp[styleName];
  9190. }
  9191. }
  9192. } else {
  9193. // Relies on `updateStylesByID` not mutating `styleUpdates`.
  9194. styleUpdates = nextProp;
  9195. }
  9196. } else if (registrationNameModules.hasOwnProperty(propKey)) {
  9197. if (nextProp) {
  9198. enqueuePutListener(this, propKey, nextProp, transaction);
  9199. } else if (lastProp) {
  9200. deleteListener(this, propKey);
  9201. }
  9202. } else if (isCustomComponent(this._tag, nextProps)) {
  9203. if (!RESERVED_PROPS.hasOwnProperty(propKey)) {
  9204. DOMPropertyOperations.setValueForAttribute(getNode(this), propKey, nextProp);
  9205. }
  9206. } else if (DOMProperty.properties[propKey] || DOMProperty.isCustomAttribute(propKey)) {
  9207. var node = getNode(this);
  9208. // If we're updating to null or undefined, we should remove the property
  9209. // from the DOM node instead of inadvertently setting to a string. This
  9210. // brings us in line with the same behavior we have on initial render.
  9211. if (nextProp != null) {
  9212. DOMPropertyOperations.setValueForProperty(node, propKey, nextProp);
  9213. } else {
  9214. DOMPropertyOperations.deleteValueForProperty(node, propKey);
  9215. }
  9216. }
  9217. }
  9218. if (styleUpdates) {
  9219. CSSPropertyOperations.setValueForStyles(getNode(this), styleUpdates, this);
  9220. }
  9221. },
  9222. /**
  9223. * Reconciles the children with the various properties that affect the
  9224. * children content.
  9225. *
  9226. * @param {object} lastProps
  9227. * @param {object} nextProps
  9228. * @param {ReactReconcileTransaction} transaction
  9229. * @param {object} context
  9230. */
  9231. _updateDOMChildren: function (lastProps, nextProps, transaction, context) {
  9232. var lastContent = CONTENT_TYPES[typeof lastProps.children] ? lastProps.children : null;
  9233. var nextContent = CONTENT_TYPES[typeof nextProps.children] ? nextProps.children : null;
  9234. var lastHtml = lastProps.dangerouslySetInnerHTML && lastProps.dangerouslySetInnerHTML.__html;
  9235. var nextHtml = nextProps.dangerouslySetInnerHTML && nextProps.dangerouslySetInnerHTML.__html;
  9236. // Note the use of `!=` which checks for null or undefined.
  9237. var lastChildren = lastContent != null ? null : lastProps.children;
  9238. var nextChildren = nextContent != null ? null : nextProps.children;
  9239. // If we're switching from children to content/html or vice versa, remove
  9240. // the old content
  9241. var lastHasContentOrHtml = lastContent != null || lastHtml != null;
  9242. var nextHasContentOrHtml = nextContent != null || nextHtml != null;
  9243. if (lastChildren != null && nextChildren == null) {
  9244. this.updateChildren(null, transaction, context);
  9245. } else if (lastHasContentOrHtml && !nextHasContentOrHtml) {
  9246. this.updateTextContent('');
  9247. if (false) {
  9248. ReactInstrumentation.debugTool.onSetChildren(this._debugID, []);
  9249. }
  9250. }
  9251. if (nextContent != null) {
  9252. if (lastContent !== nextContent) {
  9253. this.updateTextContent('' + nextContent);
  9254. if (false) {
  9255. this._contentDebugID = this._debugID + '#text';
  9256. setContentChildForInstrumentation.call(this, nextContent);
  9257. }
  9258. }
  9259. } else if (nextHtml != null) {
  9260. if (lastHtml !== nextHtml) {
  9261. this.updateMarkup('' + nextHtml);
  9262. }
  9263. if (false) {
  9264. ReactInstrumentation.debugTool.onSetChildren(this._debugID, []);
  9265. }
  9266. } else if (nextChildren != null) {
  9267. if (false) {
  9268. if (this._contentDebugID) {
  9269. ReactInstrumentation.debugTool.onUnmountComponent(this._contentDebugID);
  9270. this._contentDebugID = null;
  9271. }
  9272. }
  9273. this.updateChildren(nextChildren, transaction, context);
  9274. }
  9275. },
  9276. getNativeNode: function () {
  9277. return getNode(this);
  9278. },
  9279. /**
  9280. * Destroys all event registrations for this instance. Does not remove from
  9281. * the DOM. That must be done by the parent.
  9282. *
  9283. * @internal
  9284. */
  9285. unmountComponent: function (safely) {
  9286. switch (this._tag) {
  9287. case 'iframe':
  9288. case 'object':
  9289. case 'img':
  9290. case 'form':
  9291. case 'video':
  9292. case 'audio':
  9293. var listeners = this._wrapperState.listeners;
  9294. if (listeners) {
  9295. for (var i = 0; i < listeners.length; i++) {
  9296. listeners[i].remove();
  9297. }
  9298. }
  9299. break;
  9300. case 'html':
  9301. case 'head':
  9302. case 'body':
  9303. /**
  9304. * Components like <html> <head> and <body> can't be removed or added
  9305. * easily in a cross-browser way, however it's valuable to be able to
  9306. * take advantage of React's reconciliation for styling and <title>
  9307. * management. So we just document it and throw in dangerous cases.
  9308. */
  9309. true ? false ? invariant(false, '<%s> tried to unmount. Because of cross-browser quirks it is ' + 'impossible to unmount some top-level components (eg <html>, ' + '<head>, and <body>) reliably and efficiently. To fix this, have a ' + 'single top-level component that never unmounts render these ' + 'elements.', this._tag) : invariant(false) : void 0;
  9310. break;
  9311. }
  9312. this.unmountChildren(safely);
  9313. ReactDOMComponentTree.uncacheNode(this);
  9314. EventPluginHub.deleteAllListeners(this);
  9315. ReactComponentBrowserEnvironment.unmountIDFromEnvironment(this._rootNodeID);
  9316. this._rootNodeID = null;
  9317. this._domID = null;
  9318. this._wrapperState = null;
  9319. if (false) {
  9320. if (this._contentDebugID) {
  9321. ReactInstrumentation.debugTool.onUnmountComponent(this._contentDebugID);
  9322. this._contentDebugID = null;
  9323. }
  9324. }
  9325. },
  9326. getPublicInstance: function () {
  9327. return getNode(this);
  9328. }
  9329. };
  9330. _assign(ReactDOMComponent.prototype, ReactDOMComponent.Mixin, ReactMultiChild.Mixin);
  9331. module.exports = ReactDOMComponent;
  9332. /***/ },
  9333. /* 87 */
  9334. /***/ function(module, exports, __webpack_require__) {
  9335. /**
  9336. * Copyright 2013-present, Facebook, Inc.
  9337. * All rights reserved.
  9338. *
  9339. * This source code is licensed under the BSD-style license found in the
  9340. * LICENSE file in the root directory of this source tree. An additional grant
  9341. * of patent rights can be found in the PATENTS file in the same directory.
  9342. *
  9343. * @providesModule AutoFocusUtils
  9344. */
  9345. 'use strict';
  9346. var ReactDOMComponentTree = __webpack_require__(36);
  9347. var focusNode = __webpack_require__(88);
  9348. var AutoFocusUtils = {
  9349. focusDOMComponent: function () {
  9350. focusNode(ReactDOMComponentTree.getNodeFromInstance(this));
  9351. }
  9352. };
  9353. module.exports = AutoFocusUtils;
  9354. /***/ },
  9355. /* 88 */
  9356. /***/ function(module, exports) {
  9357. /**
  9358. * Copyright (c) 2013-present, Facebook, Inc.
  9359. * All rights reserved.
  9360. *
  9361. * This source code is licensed under the BSD-style license found in the
  9362. * LICENSE file in the root directory of this source tree. An additional grant
  9363. * of patent rights can be found in the PATENTS file in the same directory.
  9364. *
  9365. */
  9366. 'use strict';
  9367. /**
  9368. * @param {DOMElement} node input/textarea to focus
  9369. */
  9370. function focusNode(node) {
  9371. // IE8 can throw "Can't move focus to the control because it is invisible,
  9372. // not enabled, or of a type that does not accept the focus." for all kinds of
  9373. // reasons that are too expensive and fragile to test.
  9374. try {
  9375. node.focus();
  9376. } catch (e) {}
  9377. }
  9378. module.exports = focusNode;
  9379. /***/ },
  9380. /* 89 */
  9381. /***/ function(module, exports, __webpack_require__) {
  9382. /**
  9383. * Copyright 2013-present, Facebook, Inc.
  9384. * All rights reserved.
  9385. *
  9386. * This source code is licensed under the BSD-style license found in the
  9387. * LICENSE file in the root directory of this source tree. An additional grant
  9388. * of patent rights can be found in the PATENTS file in the same directory.
  9389. *
  9390. * @providesModule CSSPropertyOperations
  9391. */
  9392. 'use strict';
  9393. var CSSProperty = __webpack_require__(90);
  9394. var ExecutionEnvironment = __webpack_require__(19);
  9395. var ReactInstrumentation = __webpack_require__(17);
  9396. var camelizeStyleName = __webpack_require__(91);
  9397. var dangerousStyleValue = __webpack_require__(93);
  9398. var hyphenateStyleName = __webpack_require__(94);
  9399. var memoizeStringOnly = __webpack_require__(96);
  9400. var warning = __webpack_require__(9);
  9401. var processStyleName = memoizeStringOnly(function (styleName) {
  9402. return hyphenateStyleName(styleName);
  9403. });
  9404. var hasShorthandPropertyBug = false;
  9405. var styleFloatAccessor = 'cssFloat';
  9406. if (ExecutionEnvironment.canUseDOM) {
  9407. var tempStyle = document.createElement('div').style;
  9408. try {
  9409. // IE8 throws "Invalid argument." if resetting shorthand style properties.
  9410. tempStyle.font = '';
  9411. } catch (e) {
  9412. hasShorthandPropertyBug = true;
  9413. }
  9414. // IE8 only supports accessing cssFloat (standard) as styleFloat
  9415. if (document.documentElement.style.cssFloat === undefined) {
  9416. styleFloatAccessor = 'styleFloat';
  9417. }
  9418. }
  9419. if (false) {
  9420. // 'msTransform' is correct, but the other prefixes should be capitalized
  9421. var badVendoredStyleNamePattern = /^(?:webkit|moz|o)[A-Z]/;
  9422. // style values shouldn't contain a semicolon
  9423. var badStyleValueWithSemicolonPattern = /;\s*$/;
  9424. var warnedStyleNames = {};
  9425. var warnedStyleValues = {};
  9426. var warnedForNaNValue = false;
  9427. var warnHyphenatedStyleName = function (name, owner) {
  9428. if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {
  9429. return;
  9430. }
  9431. warnedStyleNames[name] = true;
  9432. process.env.NODE_ENV !== 'production' ? warning(false, 'Unsupported style property %s. Did you mean %s?%s', name, camelizeStyleName(name), checkRenderMessage(owner)) : void 0;
  9433. };
  9434. var warnBadVendoredStyleName = function (name, owner) {
  9435. if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {
  9436. return;
  9437. }
  9438. warnedStyleNames[name] = true;
  9439. process.env.NODE_ENV !== 'production' ? warning(false, 'Unsupported vendor-prefixed style property %s. Did you mean %s?%s', name, name.charAt(0).toUpperCase() + name.slice(1), checkRenderMessage(owner)) : void 0;
  9440. };
  9441. var warnStyleValueWithSemicolon = function (name, value, owner) {
  9442. if (warnedStyleValues.hasOwnProperty(value) && warnedStyleValues[value]) {
  9443. return;
  9444. }
  9445. warnedStyleValues[value] = true;
  9446. process.env.NODE_ENV !== 'production' ? warning(false, 'Style property values shouldn\'t contain a semicolon.%s ' + 'Try "%s: %s" instead.', checkRenderMessage(owner), name, value.replace(badStyleValueWithSemicolonPattern, '')) : void 0;
  9447. };
  9448. var warnStyleValueIsNaN = function (name, value, owner) {
  9449. if (warnedForNaNValue) {
  9450. return;
  9451. }
  9452. warnedForNaNValue = true;
  9453. process.env.NODE_ENV !== 'production' ? warning(false, '`NaN` is an invalid value for the `%s` css style property.%s', name, checkRenderMessage(owner)) : void 0;
  9454. };
  9455. var checkRenderMessage = function (owner) {
  9456. if (owner) {
  9457. var name = owner.getName();
  9458. if (name) {
  9459. return ' Check the render method of `' + name + '`.';
  9460. }
  9461. }
  9462. return '';
  9463. };
  9464. /**
  9465. * @param {string} name
  9466. * @param {*} value
  9467. * @param {ReactDOMComponent} component
  9468. */
  9469. var warnValidStyle = function (name, value, component) {
  9470. var owner;
  9471. if (component) {
  9472. owner = component._currentElement._owner;
  9473. }
  9474. if (name.indexOf('-') > -1) {
  9475. warnHyphenatedStyleName(name, owner);
  9476. } else if (badVendoredStyleNamePattern.test(name)) {
  9477. warnBadVendoredStyleName(name, owner);
  9478. } else if (badStyleValueWithSemicolonPattern.test(value)) {
  9479. warnStyleValueWithSemicolon(name, value, owner);
  9480. }
  9481. if (typeof value === 'number' && isNaN(value)) {
  9482. warnStyleValueIsNaN(name, value, owner);
  9483. }
  9484. };
  9485. }
  9486. /**
  9487. * Operations for dealing with CSS properties.
  9488. */
  9489. var CSSPropertyOperations = {
  9490. /**
  9491. * Serializes a mapping of style properties for use as inline styles:
  9492. *
  9493. * > createMarkupForStyles({width: '200px', height: 0})
  9494. * "width:200px;height:0;"
  9495. *
  9496. * Undefined values are ignored so that declarative programming is easier.
  9497. * The result should be HTML-escaped before insertion into the DOM.
  9498. *
  9499. * @param {object} styles
  9500. * @param {ReactDOMComponent} component
  9501. * @return {?string}
  9502. */
  9503. createMarkupForStyles: function (styles, component) {
  9504. var serialized = '';
  9505. for (var styleName in styles) {
  9506. if (!styles.hasOwnProperty(styleName)) {
  9507. continue;
  9508. }
  9509. var styleValue = styles[styleName];
  9510. if (false) {
  9511. warnValidStyle(styleName, styleValue, component);
  9512. }
  9513. if (styleValue != null) {
  9514. serialized += processStyleName(styleName) + ':';
  9515. serialized += dangerousStyleValue(styleName, styleValue, component) + ';';
  9516. }
  9517. }
  9518. return serialized || null;
  9519. },
  9520. /**
  9521. * Sets the value for multiple styles on a node. If a value is specified as
  9522. * '' (empty string), the corresponding style property will be unset.
  9523. *
  9524. * @param {DOMElement} node
  9525. * @param {object} styles
  9526. * @param {ReactDOMComponent} component
  9527. */
  9528. setValueForStyles: function (node, styles, component) {
  9529. if (false) {
  9530. ReactInstrumentation.debugTool.onNativeOperation(component._debugID, 'update styles', styles);
  9531. }
  9532. var style = node.style;
  9533. for (var styleName in styles) {
  9534. if (!styles.hasOwnProperty(styleName)) {
  9535. continue;
  9536. }
  9537. if (false) {
  9538. warnValidStyle(styleName, styles[styleName], component);
  9539. }
  9540. var styleValue = dangerousStyleValue(styleName, styles[styleName], component);
  9541. if (styleName === 'float' || styleName === 'cssFloat') {
  9542. styleName = styleFloatAccessor;
  9543. }
  9544. if (styleValue) {
  9545. style[styleName] = styleValue;
  9546. } else {
  9547. var expansion = hasShorthandPropertyBug && CSSProperty.shorthandPropertyExpansions[styleName];
  9548. if (expansion) {
  9549. // Shorthand property that IE8 won't like unsetting, so unset each
  9550. // component to placate it
  9551. for (var individualStyleName in expansion) {
  9552. style[individualStyleName] = '';
  9553. }
  9554. } else {
  9555. style[styleName] = '';
  9556. }
  9557. }
  9558. }
  9559. }
  9560. };
  9561. module.exports = CSSPropertyOperations;
  9562. /***/ },
  9563. /* 90 */
  9564. /***/ function(module, exports) {
  9565. /**
  9566. * Copyright 2013-present, Facebook, Inc.
  9567. * All rights reserved.
  9568. *
  9569. * This source code is licensed under the BSD-style license found in the
  9570. * LICENSE file in the root directory of this source tree. An additional grant
  9571. * of patent rights can be found in the PATENTS file in the same directory.
  9572. *
  9573. * @providesModule CSSProperty
  9574. */
  9575. 'use strict';
  9576. /**
  9577. * CSS properties which accept numbers but are not in units of "px".
  9578. */
  9579. var isUnitlessNumber = {
  9580. animationIterationCount: true,
  9581. borderImageOutset: true,
  9582. borderImageSlice: true,
  9583. borderImageWidth: true,
  9584. boxFlex: true,
  9585. boxFlexGroup: true,
  9586. boxOrdinalGroup: true,
  9587. columnCount: true,
  9588. flex: true,
  9589. flexGrow: true,
  9590. flexPositive: true,
  9591. flexShrink: true,
  9592. flexNegative: true,
  9593. flexOrder: true,
  9594. gridRow: true,
  9595. gridColumn: true,
  9596. fontWeight: true,
  9597. lineClamp: true,
  9598. lineHeight: true,
  9599. opacity: true,
  9600. order: true,
  9601. orphans: true,
  9602. tabSize: true,
  9603. widows: true,
  9604. zIndex: true,
  9605. zoom: true,
  9606. // SVG-related properties
  9607. fillOpacity: true,
  9608. floodOpacity: true,
  9609. stopOpacity: true,
  9610. strokeDasharray: true,
  9611. strokeDashoffset: true,
  9612. strokeMiterlimit: true,
  9613. strokeOpacity: true,
  9614. strokeWidth: true
  9615. };
  9616. /**
  9617. * @param {string} prefix vendor-specific prefix, eg: Webkit
  9618. * @param {string} key style name, eg: transitionDuration
  9619. * @return {string} style name prefixed with `prefix`, properly camelCased, eg:
  9620. * WebkitTransitionDuration
  9621. */
  9622. function prefixKey(prefix, key) {
  9623. return prefix + key.charAt(0).toUpperCase() + key.substring(1);
  9624. }
  9625. /**
  9626. * Support style names that may come passed in prefixed by adding permutations
  9627. * of vendor prefixes.
  9628. */
  9629. var prefixes = ['Webkit', 'ms', 'Moz', 'O'];
  9630. // Using Object.keys here, or else the vanilla for-in loop makes IE8 go into an
  9631. // infinite loop, because it iterates over the newly added props too.
  9632. Object.keys(isUnitlessNumber).forEach(function (prop) {
  9633. prefixes.forEach(function (prefix) {
  9634. isUnitlessNumber[prefixKey(prefix, prop)] = isUnitlessNumber[prop];
  9635. });
  9636. });
  9637. /**
  9638. * Most style properties can be unset by doing .style[prop] = '' but IE8
  9639. * doesn't like doing that with shorthand properties so for the properties that
  9640. * IE8 breaks on, which are listed here, we instead unset each of the
  9641. * individual properties. See http://bugs.jquery.com/ticket/12385.
  9642. * The 4-value 'clock' properties like margin, padding, border-width seem to
  9643. * behave without any problems. Curiously, list-style works too without any
  9644. * special prodding.
  9645. */
  9646. var shorthandPropertyExpansions = {
  9647. background: {
  9648. backgroundAttachment: true,
  9649. backgroundColor: true,
  9650. backgroundImage: true,
  9651. backgroundPositionX: true,
  9652. backgroundPositionY: true,
  9653. backgroundRepeat: true
  9654. },
  9655. backgroundPosition: {
  9656. backgroundPositionX: true,
  9657. backgroundPositionY: true
  9658. },
  9659. border: {
  9660. borderWidth: true,
  9661. borderStyle: true,
  9662. borderColor: true
  9663. },
  9664. borderBottom: {
  9665. borderBottomWidth: true,
  9666. borderBottomStyle: true,
  9667. borderBottomColor: true
  9668. },
  9669. borderLeft: {
  9670. borderLeftWidth: true,
  9671. borderLeftStyle: true,
  9672. borderLeftColor: true
  9673. },
  9674. borderRight: {
  9675. borderRightWidth: true,
  9676. borderRightStyle: true,
  9677. borderRightColor: true
  9678. },
  9679. borderTop: {
  9680. borderTopWidth: true,
  9681. borderTopStyle: true,
  9682. borderTopColor: true
  9683. },
  9684. font: {
  9685. fontStyle: true,
  9686. fontVariant: true,
  9687. fontWeight: true,
  9688. fontSize: true,
  9689. lineHeight: true,
  9690. fontFamily: true
  9691. },
  9692. outline: {
  9693. outlineWidth: true,
  9694. outlineStyle: true,
  9695. outlineColor: true
  9696. }
  9697. };
  9698. var CSSProperty = {
  9699. isUnitlessNumber: isUnitlessNumber,
  9700. shorthandPropertyExpansions: shorthandPropertyExpansions
  9701. };
  9702. module.exports = CSSProperty;
  9703. /***/ },
  9704. /* 91 */
  9705. /***/ function(module, exports, __webpack_require__) {
  9706. /**
  9707. * Copyright (c) 2013-present, Facebook, Inc.
  9708. * All rights reserved.
  9709. *
  9710. * This source code is licensed under the BSD-style license found in the
  9711. * LICENSE file in the root directory of this source tree. An additional grant
  9712. * of patent rights can be found in the PATENTS file in the same directory.
  9713. *
  9714. * @typechecks
  9715. */
  9716. 'use strict';
  9717. var camelize = __webpack_require__(92);
  9718. var msPattern = /^-ms-/;
  9719. /**
  9720. * Camelcases a hyphenated CSS property name, for example:
  9721. *
  9722. * > camelizeStyleName('background-color')
  9723. * < "backgroundColor"
  9724. * > camelizeStyleName('-moz-transition')
  9725. * < "MozTransition"
  9726. * > camelizeStyleName('-ms-transition')
  9727. * < "msTransition"
  9728. *
  9729. * As Andi Smith suggests
  9730. * (http://www.andismith.com/blog/2012/02/modernizr-prefixed/), an `-ms` prefix
  9731. * is converted to lowercase `ms`.
  9732. *
  9733. * @param {string} string
  9734. * @return {string}
  9735. */
  9736. function camelizeStyleName(string) {
  9737. return camelize(string.replace(msPattern, 'ms-'));
  9738. }
  9739. module.exports = camelizeStyleName;
  9740. /***/ },
  9741. /* 92 */
  9742. /***/ function(module, exports) {
  9743. "use strict";
  9744. /**
  9745. * Copyright (c) 2013-present, Facebook, Inc.
  9746. * All rights reserved.
  9747. *
  9748. * This source code is licensed under the BSD-style license found in the
  9749. * LICENSE file in the root directory of this source tree. An additional grant
  9750. * of patent rights can be found in the PATENTS file in the same directory.
  9751. *
  9752. * @typechecks
  9753. */
  9754. var _hyphenPattern = /-(.)/g;
  9755. /**
  9756. * Camelcases a hyphenated string, for example:
  9757. *
  9758. * > camelize('background-color')
  9759. * < "backgroundColor"
  9760. *
  9761. * @param {string} string
  9762. * @return {string}
  9763. */
  9764. function camelize(string) {
  9765. return string.replace(_hyphenPattern, function (_, character) {
  9766. return character.toUpperCase();
  9767. });
  9768. }
  9769. module.exports = camelize;
  9770. /***/ },
  9771. /* 93 */
  9772. /***/ function(module, exports, __webpack_require__) {
  9773. /**
  9774. * Copyright 2013-present, Facebook, Inc.
  9775. * All rights reserved.
  9776. *
  9777. * This source code is licensed under the BSD-style license found in the
  9778. * LICENSE file in the root directory of this source tree. An additional grant
  9779. * of patent rights can be found in the PATENTS file in the same directory.
  9780. *
  9781. * @providesModule dangerousStyleValue
  9782. */
  9783. 'use strict';
  9784. var CSSProperty = __webpack_require__(90);
  9785. var warning = __webpack_require__(9);
  9786. var isUnitlessNumber = CSSProperty.isUnitlessNumber;
  9787. var styleWarnings = {};
  9788. /**
  9789. * Convert a value into the proper css writable value. The style name `name`
  9790. * should be logical (no hyphens), as specified
  9791. * in `CSSProperty.isUnitlessNumber`.
  9792. *
  9793. * @param {string} name CSS property name such as `topMargin`.
  9794. * @param {*} value CSS property value such as `10px`.
  9795. * @param {ReactDOMComponent} component
  9796. * @return {string} Normalized style value with dimensions applied.
  9797. */
  9798. function dangerousStyleValue(name, value, component) {
  9799. // Note that we've removed escapeTextForBrowser() calls here since the
  9800. // whole string will be escaped when the attribute is injected into
  9801. // the markup. If you provide unsafe user data here they can inject
  9802. // arbitrary CSS which may be problematic (I couldn't repro this):
  9803. // https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet
  9804. // http://www.thespanner.co.uk/2007/11/26/ultimate-xss-css-injection/
  9805. // This is not an XSS hole but instead a potential CSS injection issue
  9806. // which has lead to a greater discussion about how we're going to
  9807. // trust URLs moving forward. See #2115901
  9808. var isEmpty = value == null || typeof value === 'boolean' || value === '';
  9809. if (isEmpty) {
  9810. return '';
  9811. }
  9812. var isNonNumeric = isNaN(value);
  9813. if (isNonNumeric || value === 0 || isUnitlessNumber.hasOwnProperty(name) && isUnitlessNumber[name]) {
  9814. return '' + value; // cast to string
  9815. }
  9816. if (typeof value === 'string') {
  9817. if (false) {
  9818. if (component) {
  9819. var owner = component._currentElement._owner;
  9820. var ownerName = owner ? owner.getName() : null;
  9821. if (ownerName && !styleWarnings[ownerName]) {
  9822. styleWarnings[ownerName] = {};
  9823. }
  9824. var warned = false;
  9825. if (ownerName) {
  9826. var warnings = styleWarnings[ownerName];
  9827. warned = warnings[name];
  9828. if (!warned) {
  9829. warnings[name] = true;
  9830. }
  9831. }
  9832. if (!warned) {
  9833. process.env.NODE_ENV !== 'production' ? warning(false, 'a `%s` tag (owner: `%s`) was passed a numeric string value ' + 'for CSS property `%s` (value: `%s`) which will be treated ' + 'as a unitless number in a future version of React.', component._currentElement.type, ownerName || 'unknown', name, value) : void 0;
  9834. }
  9835. }
  9836. }
  9837. value = value.trim();
  9838. }
  9839. return value + 'px';
  9840. }
  9841. module.exports = dangerousStyleValue;
  9842. /***/ },
  9843. /* 94 */
  9844. /***/ function(module, exports, __webpack_require__) {
  9845. /**
  9846. * Copyright (c) 2013-present, Facebook, Inc.
  9847. * All rights reserved.
  9848. *
  9849. * This source code is licensed under the BSD-style license found in the
  9850. * LICENSE file in the root directory of this source tree. An additional grant
  9851. * of patent rights can be found in the PATENTS file in the same directory.
  9852. *
  9853. * @typechecks
  9854. */
  9855. 'use strict';
  9856. var hyphenate = __webpack_require__(95);
  9857. var msPattern = /^ms-/;
  9858. /**
  9859. * Hyphenates a camelcased CSS property name, for example:
  9860. *
  9861. * > hyphenateStyleName('backgroundColor')
  9862. * < "background-color"
  9863. * > hyphenateStyleName('MozTransition')
  9864. * < "-moz-transition"
  9865. * > hyphenateStyleName('msTransition')
  9866. * < "-ms-transition"
  9867. *
  9868. * As Modernizr suggests (http://modernizr.com/docs/#prefixed), an `ms` prefix
  9869. * is converted to `-ms-`.
  9870. *
  9871. * @param {string} string
  9872. * @return {string}
  9873. */
  9874. function hyphenateStyleName(string) {
  9875. return hyphenate(string).replace(msPattern, '-ms-');
  9876. }
  9877. module.exports = hyphenateStyleName;
  9878. /***/ },
  9879. /* 95 */
  9880. /***/ function(module, exports) {
  9881. 'use strict';
  9882. /**
  9883. * Copyright (c) 2013-present, Facebook, Inc.
  9884. * All rights reserved.
  9885. *
  9886. * This source code is licensed under the BSD-style license found in the
  9887. * LICENSE file in the root directory of this source tree. An additional grant
  9888. * of patent rights can be found in the PATENTS file in the same directory.
  9889. *
  9890. * @typechecks
  9891. */
  9892. var _uppercasePattern = /([A-Z])/g;
  9893. /**
  9894. * Hyphenates a camelcased string, for example:
  9895. *
  9896. * > hyphenate('backgroundColor')
  9897. * < "background-color"
  9898. *
  9899. * For CSS style names, use `hyphenateStyleName` instead which works properly
  9900. * with all vendor prefixes, including `ms`.
  9901. *
  9902. * @param {string} string
  9903. * @return {string}
  9904. */
  9905. function hyphenate(string) {
  9906. return string.replace(_uppercasePattern, '-$1').toLowerCase();
  9907. }
  9908. module.exports = hyphenate;
  9909. /***/ },
  9910. /* 96 */
  9911. /***/ function(module, exports) {
  9912. /**
  9913. * Copyright (c) 2013-present, Facebook, Inc.
  9914. * All rights reserved.
  9915. *
  9916. * This source code is licensed under the BSD-style license found in the
  9917. * LICENSE file in the root directory of this source tree. An additional grant
  9918. * of patent rights can be found in the PATENTS file in the same directory.
  9919. *
  9920. *
  9921. * @typechecks static-only
  9922. */
  9923. 'use strict';
  9924. /**
  9925. * Memoizes the return value of a function that accepts one string argument.
  9926. */
  9927. function memoizeStringOnly(callback) {
  9928. var cache = {};
  9929. return function (string) {
  9930. if (!cache.hasOwnProperty(string)) {
  9931. cache[string] = callback.call(this, string);
  9932. }
  9933. return cache[string];
  9934. };
  9935. }
  9936. module.exports = memoizeStringOnly;
  9937. /***/ },
  9938. /* 97 */
  9939. /***/ function(module, exports, __webpack_require__) {
  9940. /**
  9941. * Copyright 2013-present, Facebook, Inc.
  9942. * All rights reserved.
  9943. *
  9944. * This source code is licensed under the BSD-style license found in the
  9945. * LICENSE file in the root directory of this source tree. An additional grant
  9946. * of patent rights can be found in the PATENTS file in the same directory.
  9947. *
  9948. * @providesModule DOMPropertyOperations
  9949. */
  9950. 'use strict';
  9951. var DOMProperty = __webpack_require__(37);
  9952. var ReactDOMComponentTree = __webpack_require__(36);
  9953. var ReactDOMInstrumentation = __webpack_require__(98);
  9954. var ReactInstrumentation = __webpack_require__(17);
  9955. var quoteAttributeValueForBrowser = __webpack_require__(101);
  9956. var warning = __webpack_require__(9);
  9957. var VALID_ATTRIBUTE_NAME_REGEX = new RegExp('^[' + DOMProperty.ATTRIBUTE_NAME_START_CHAR + '][' + DOMProperty.ATTRIBUTE_NAME_CHAR + ']*$');
  9958. var illegalAttributeNameCache = {};
  9959. var validatedAttributeNameCache = {};
  9960. function isAttributeNameSafe(attributeName) {
  9961. if (validatedAttributeNameCache.hasOwnProperty(attributeName)) {
  9962. return true;
  9963. }
  9964. if (illegalAttributeNameCache.hasOwnProperty(attributeName)) {
  9965. return false;
  9966. }
  9967. if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) {
  9968. validatedAttributeNameCache[attributeName] = true;
  9969. return true;
  9970. }
  9971. illegalAttributeNameCache[attributeName] = true;
  9972. false ? warning(false, 'Invalid attribute name: `%s`', attributeName) : void 0;
  9973. return false;
  9974. }
  9975. function shouldIgnoreValue(propertyInfo, value) {
  9976. return value == null || propertyInfo.hasBooleanValue && !value || propertyInfo.hasNumericValue && isNaN(value) || propertyInfo.hasPositiveNumericValue && value < 1 || propertyInfo.hasOverloadedBooleanValue && value === false;
  9977. }
  9978. /**
  9979. * Operations for dealing with DOM properties.
  9980. */
  9981. var DOMPropertyOperations = {
  9982. /**
  9983. * Creates markup for the ID property.
  9984. *
  9985. * @param {string} id Unescaped ID.
  9986. * @return {string} Markup string.
  9987. */
  9988. createMarkupForID: function (id) {
  9989. return DOMProperty.ID_ATTRIBUTE_NAME + '=' + quoteAttributeValueForBrowser(id);
  9990. },
  9991. setAttributeForID: function (node, id) {
  9992. node.setAttribute(DOMProperty.ID_ATTRIBUTE_NAME, id);
  9993. },
  9994. createMarkupForRoot: function () {
  9995. return DOMProperty.ROOT_ATTRIBUTE_NAME + '=""';
  9996. },
  9997. setAttributeForRoot: function (node) {
  9998. node.setAttribute(DOMProperty.ROOT_ATTRIBUTE_NAME, '');
  9999. },
  10000. /**
  10001. * Creates markup for a property.
  10002. *
  10003. * @param {string} name
  10004. * @param {*} value
  10005. * @return {?string} Markup string, or null if the property was invalid.
  10006. */
  10007. createMarkupForProperty: function (name, value) {
  10008. if (false) {
  10009. ReactDOMInstrumentation.debugTool.onCreateMarkupForProperty(name, value);
  10010. }
  10011. var propertyInfo = DOMProperty.properties.hasOwnProperty(name) ? DOMProperty.properties[name] : null;
  10012. if (propertyInfo) {
  10013. if (shouldIgnoreValue(propertyInfo, value)) {
  10014. return '';
  10015. }
  10016. var attributeName = propertyInfo.attributeName;
  10017. if (propertyInfo.hasBooleanValue || propertyInfo.hasOverloadedBooleanValue && value === true) {
  10018. return attributeName + '=""';
  10019. }
  10020. return attributeName + '=' + quoteAttributeValueForBrowser(value);
  10021. } else if (DOMProperty.isCustomAttribute(name)) {
  10022. if (value == null) {
  10023. return '';
  10024. }
  10025. return name + '=' + quoteAttributeValueForBrowser(value);
  10026. }
  10027. return null;
  10028. },
  10029. /**
  10030. * Creates markup for a custom property.
  10031. *
  10032. * @param {string} name
  10033. * @param {*} value
  10034. * @return {string} Markup string, or empty string if the property was invalid.
  10035. */
  10036. createMarkupForCustomAttribute: function (name, value) {
  10037. if (!isAttributeNameSafe(name) || value == null) {
  10038. return '';
  10039. }
  10040. return name + '=' + quoteAttributeValueForBrowser(value);
  10041. },
  10042. /**
  10043. * Sets the value for a property on a node.
  10044. *
  10045. * @param {DOMElement} node
  10046. * @param {string} name
  10047. * @param {*} value
  10048. */
  10049. setValueForProperty: function (node, name, value) {
  10050. var propertyInfo = DOMProperty.properties.hasOwnProperty(name) ? DOMProperty.properties[name] : null;
  10051. if (propertyInfo) {
  10052. var mutationMethod = propertyInfo.mutationMethod;
  10053. if (mutationMethod) {
  10054. mutationMethod(node, value);
  10055. } else if (shouldIgnoreValue(propertyInfo, value)) {
  10056. this.deleteValueForProperty(node, name);
  10057. return;
  10058. } else if (propertyInfo.mustUseProperty) {
  10059. var propName = propertyInfo.propertyName;
  10060. // Must explicitly cast values for HAS_SIDE_EFFECTS-properties to the
  10061. // property type before comparing; only `value` does and is string.
  10062. if (!propertyInfo.hasSideEffects || '' + node[propName] !== '' + value) {
  10063. // Contrary to `setAttribute`, object properties are properly
  10064. // `toString`ed by IE8/9.
  10065. node[propName] = value;
  10066. }
  10067. } else {
  10068. var attributeName = propertyInfo.attributeName;
  10069. var namespace = propertyInfo.attributeNamespace;
  10070. // `setAttribute` with objects becomes only `[object]` in IE8/9,
  10071. // ('' + value) makes it output the correct toString()-value.
  10072. if (namespace) {
  10073. node.setAttributeNS(namespace, attributeName, '' + value);
  10074. } else if (propertyInfo.hasBooleanValue || propertyInfo.hasOverloadedBooleanValue && value === true) {
  10075. node.setAttribute(attributeName, '');
  10076. } else {
  10077. node.setAttribute(attributeName, '' + value);
  10078. }
  10079. }
  10080. } else if (DOMProperty.isCustomAttribute(name)) {
  10081. DOMPropertyOperations.setValueForAttribute(node, name, value);
  10082. return;
  10083. }
  10084. if (false) {
  10085. ReactDOMInstrumentation.debugTool.onSetValueForProperty(node, name, value);
  10086. var payload = {};
  10087. payload[name] = value;
  10088. ReactInstrumentation.debugTool.onNativeOperation(ReactDOMComponentTree.getInstanceFromNode(node)._debugID, 'update attribute', payload);
  10089. }
  10090. },
  10091. setValueForAttribute: function (node, name, value) {
  10092. if (!isAttributeNameSafe(name)) {
  10093. return;
  10094. }
  10095. if (value == null) {
  10096. node.removeAttribute(name);
  10097. } else {
  10098. node.setAttribute(name, '' + value);
  10099. }
  10100. if (false) {
  10101. var payload = {};
  10102. payload[name] = value;
  10103. ReactInstrumentation.debugTool.onNativeOperation(ReactDOMComponentTree.getInstanceFromNode(node)._debugID, 'update attribute', payload);
  10104. }
  10105. },
  10106. /**
  10107. * Deletes the value for a property on a node.
  10108. *
  10109. * @param {DOMElement} node
  10110. * @param {string} name
  10111. */
  10112. deleteValueForProperty: function (node, name) {
  10113. var propertyInfo = DOMProperty.properties.hasOwnProperty(name) ? DOMProperty.properties[name] : null;
  10114. if (propertyInfo) {
  10115. var mutationMethod = propertyInfo.mutationMethod;
  10116. if (mutationMethod) {
  10117. mutationMethod(node, undefined);
  10118. } else if (propertyInfo.mustUseProperty) {
  10119. var propName = propertyInfo.propertyName;
  10120. if (propertyInfo.hasBooleanValue) {
  10121. // No HAS_SIDE_EFFECTS logic here, only `value` has it and is string.
  10122. node[propName] = false;
  10123. } else {
  10124. if (!propertyInfo.hasSideEffects || '' + node[propName] !== '') {
  10125. node[propName] = '';
  10126. }
  10127. }
  10128. } else {
  10129. node.removeAttribute(propertyInfo.attributeName);
  10130. }
  10131. } else if (DOMProperty.isCustomAttribute(name)) {
  10132. node.removeAttribute(name);
  10133. }
  10134. if (false) {
  10135. ReactDOMInstrumentation.debugTool.onDeleteValueForProperty(node, name);
  10136. ReactInstrumentation.debugTool.onNativeOperation(ReactDOMComponentTree.getInstanceFromNode(node)._debugID, 'remove attribute', name);
  10137. }
  10138. }
  10139. };
  10140. module.exports = DOMPropertyOperations;
  10141. /***/ },
  10142. /* 98 */
  10143. /***/ function(module, exports, __webpack_require__) {
  10144. /**
  10145. * Copyright 2013-present, Facebook, Inc.
  10146. * All rights reserved.
  10147. *
  10148. * This source code is licensed under the BSD-style license found in the
  10149. * LICENSE file in the root directory of this source tree. An additional grant
  10150. * of patent rights can be found in the PATENTS file in the same directory.
  10151. *
  10152. * @providesModule ReactDOMInstrumentation
  10153. */
  10154. 'use strict';
  10155. var ReactDOMDebugTool = __webpack_require__(99);
  10156. module.exports = { debugTool: ReactDOMDebugTool };
  10157. /***/ },
  10158. /* 99 */
  10159. /***/ function(module, exports, __webpack_require__) {
  10160. /**
  10161. * Copyright 2013-present, Facebook, Inc.
  10162. * All rights reserved.
  10163. *
  10164. * This source code is licensed under the BSD-style license found in the
  10165. * LICENSE file in the root directory of this source tree. An additional grant
  10166. * of patent rights can be found in the PATENTS file in the same directory.
  10167. *
  10168. * @providesModule ReactDOMDebugTool
  10169. */
  10170. 'use strict';
  10171. var ReactDOMUnknownPropertyDevtool = __webpack_require__(100);
  10172. var warning = __webpack_require__(9);
  10173. var eventHandlers = [];
  10174. var handlerDoesThrowForEvent = {};
  10175. function emitEvent(handlerFunctionName, arg1, arg2, arg3, arg4, arg5) {
  10176. if (false) {
  10177. eventHandlers.forEach(function (handler) {
  10178. try {
  10179. if (handler[handlerFunctionName]) {
  10180. handler[handlerFunctionName](arg1, arg2, arg3, arg4, arg5);
  10181. }
  10182. } catch (e) {
  10183. process.env.NODE_ENV !== 'production' ? warning(!handlerDoesThrowForEvent[handlerFunctionName], 'exception thrown by devtool while handling %s: %s', handlerFunctionName, e.message) : void 0;
  10184. handlerDoesThrowForEvent[handlerFunctionName] = true;
  10185. }
  10186. });
  10187. }
  10188. }
  10189. var ReactDOMDebugTool = {
  10190. addDevtool: function (devtool) {
  10191. eventHandlers.push(devtool);
  10192. },
  10193. removeDevtool: function (devtool) {
  10194. for (var i = 0; i < eventHandlers.length; i++) {
  10195. if (eventHandlers[i] === devtool) {
  10196. eventHandlers.splice(i, 1);
  10197. i--;
  10198. }
  10199. }
  10200. },
  10201. onCreateMarkupForProperty: function (name, value) {
  10202. emitEvent('onCreateMarkupForProperty', name, value);
  10203. },
  10204. onSetValueForProperty: function (node, name, value) {
  10205. emitEvent('onSetValueForProperty', node, name, value);
  10206. },
  10207. onDeleteValueForProperty: function (node, name) {
  10208. emitEvent('onDeleteValueForProperty', node, name);
  10209. }
  10210. };
  10211. ReactDOMDebugTool.addDevtool(ReactDOMUnknownPropertyDevtool);
  10212. module.exports = ReactDOMDebugTool;
  10213. /***/ },
  10214. /* 100 */
  10215. /***/ function(module, exports, __webpack_require__) {
  10216. /**
  10217. * Copyright 2013-present, Facebook, Inc.
  10218. * All rights reserved.
  10219. *
  10220. * This source code is licensed under the BSD-style license found in the
  10221. * LICENSE file in the root directory of this source tree. An additional grant
  10222. * of patent rights can be found in the PATENTS file in the same directory.
  10223. *
  10224. * @providesModule ReactDOMUnknownPropertyDevtool
  10225. */
  10226. 'use strict';
  10227. var DOMProperty = __webpack_require__(37);
  10228. var EventPluginRegistry = __webpack_require__(44);
  10229. var warning = __webpack_require__(9);
  10230. if (false) {
  10231. var reactProps = {
  10232. children: true,
  10233. dangerouslySetInnerHTML: true,
  10234. key: true,
  10235. ref: true
  10236. };
  10237. var warnedProperties = {};
  10238. var warnUnknownProperty = function (name) {
  10239. if (DOMProperty.properties.hasOwnProperty(name) || DOMProperty.isCustomAttribute(name)) {
  10240. return;
  10241. }
  10242. if (reactProps.hasOwnProperty(name) && reactProps[name] || warnedProperties.hasOwnProperty(name) && warnedProperties[name]) {
  10243. return;
  10244. }
  10245. warnedProperties[name] = true;
  10246. var lowerCasedName = name.toLowerCase();
  10247. // data-* attributes should be lowercase; suggest the lowercase version
  10248. var standardName = DOMProperty.isCustomAttribute(lowerCasedName) ? lowerCasedName : DOMProperty.getPossibleStandardName.hasOwnProperty(lowerCasedName) ? DOMProperty.getPossibleStandardName[lowerCasedName] : null;
  10249. // For now, only warn when we have a suggested correction. This prevents
  10250. // logging too much when using transferPropsTo.
  10251. process.env.NODE_ENV !== 'production' ? warning(standardName == null, 'Unknown DOM property %s. Did you mean %s?', name, standardName) : void 0;
  10252. var registrationName = EventPluginRegistry.possibleRegistrationNames.hasOwnProperty(lowerCasedName) ? EventPluginRegistry.possibleRegistrationNames[lowerCasedName] : null;
  10253. process.env.NODE_ENV !== 'production' ? warning(registrationName == null, 'Unknown event handler property %s. Did you mean `%s`?', name, registrationName) : void 0;
  10254. };
  10255. }
  10256. var ReactDOMUnknownPropertyDevtool = {
  10257. onCreateMarkupForProperty: function (name, value) {
  10258. warnUnknownProperty(name);
  10259. },
  10260. onSetValueForProperty: function (node, name, value) {
  10261. warnUnknownProperty(name);
  10262. },
  10263. onDeleteValueForProperty: function (node, name) {
  10264. warnUnknownProperty(name);
  10265. }
  10266. };
  10267. module.exports = ReactDOMUnknownPropertyDevtool;
  10268. /***/ },
  10269. /* 101 */
  10270. /***/ function(module, exports, __webpack_require__) {
  10271. /**
  10272. * Copyright 2013-present, Facebook, Inc.
  10273. * All rights reserved.
  10274. *
  10275. * This source code is licensed under the BSD-style license found in the
  10276. * LICENSE file in the root directory of this source tree. An additional grant
  10277. * of patent rights can be found in the PATENTS file in the same directory.
  10278. *
  10279. * @providesModule quoteAttributeValueForBrowser
  10280. */
  10281. 'use strict';
  10282. var escapeTextContentForBrowser = __webpack_require__(78);
  10283. /**
  10284. * Escapes attribute value to prevent scripting attacks.
  10285. *
  10286. * @param {*} value Value to escape.
  10287. * @return {string} An escaped string.
  10288. */
  10289. function quoteAttributeValueForBrowser(value) {
  10290. return '"' + escapeTextContentForBrowser(value) + '"';
  10291. }
  10292. module.exports = quoteAttributeValueForBrowser;
  10293. /***/ },
  10294. /* 102 */
  10295. /***/ function(module, exports, __webpack_require__) {
  10296. /**
  10297. * Copyright 2013-present, Facebook, Inc.
  10298. * All rights reserved.
  10299. *
  10300. * This source code is licensed under the BSD-style license found in the
  10301. * LICENSE file in the root directory of this source tree. An additional grant
  10302. * of patent rights can be found in the PATENTS file in the same directory.
  10303. *
  10304. * @providesModule ReactBrowserEventEmitter
  10305. */
  10306. 'use strict';
  10307. var _assign = __webpack_require__(3);
  10308. var EventConstants = __webpack_require__(41);
  10309. var EventPluginRegistry = __webpack_require__(44);
  10310. var ReactEventEmitterMixin = __webpack_require__(103);
  10311. var ViewportMetrics = __webpack_require__(69);
  10312. var getVendorPrefixedEventName = __webpack_require__(104);
  10313. var isEventSupported = __webpack_require__(63);
  10314. /**
  10315. * Summary of `ReactBrowserEventEmitter` event handling:
  10316. *
  10317. * - Top-level delegation is used to trap most native browser events. This
  10318. * may only occur in the main thread and is the responsibility of
  10319. * ReactEventListener, which is injected and can therefore support pluggable
  10320. * event sources. This is the only work that occurs in the main thread.
  10321. *
  10322. * - We normalize and de-duplicate events to account for browser quirks. This
  10323. * may be done in the worker thread.
  10324. *
  10325. * - Forward these native events (with the associated top-level type used to
  10326. * trap it) to `EventPluginHub`, which in turn will ask plugins if they want
  10327. * to extract any synthetic events.
  10328. *
  10329. * - The `EventPluginHub` will then process each event by annotating them with
  10330. * "dispatches", a sequence of listeners and IDs that care about that event.
  10331. *
  10332. * - The `EventPluginHub` then dispatches the events.
  10333. *
  10334. * Overview of React and the event system:
  10335. *
  10336. * +------------+ .
  10337. * | DOM | .
  10338. * +------------+ .
  10339. * | .
  10340. * v .
  10341. * +------------+ .
  10342. * | ReactEvent | .
  10343. * | Listener | .
  10344. * +------------+ . +-----------+
  10345. * | . +--------+|SimpleEvent|
  10346. * | . | |Plugin |
  10347. * +-----|------+ . v +-----------+
  10348. * | | | . +--------------+ +------------+
  10349. * | +-----------.--->|EventPluginHub| | Event |
  10350. * | | . | | +-----------+ | Propagators|
  10351. * | ReactEvent | . | | |TapEvent | |------------|
  10352. * | Emitter | . | |<---+|Plugin | |other plugin|
  10353. * | | . | | +-----------+ | utilities |
  10354. * | +-----------.--->| | +------------+
  10355. * | | | . +--------------+
  10356. * +-----|------+ . ^ +-----------+
  10357. * | . | |Enter/Leave|
  10358. * + . +-------+|Plugin |
  10359. * +-------------+ . +-----------+
  10360. * | application | .
  10361. * |-------------| .
  10362. * | | .
  10363. * | | .
  10364. * +-------------+ .
  10365. * .
  10366. * React Core . General Purpose Event Plugin System
  10367. */
  10368. var hasEventPageXY;
  10369. var alreadyListeningTo = {};
  10370. var isMonitoringScrollValue = false;
  10371. var reactTopListenersCounter = 0;
  10372. // For events like 'submit' which don't consistently bubble (which we trap at a
  10373. // lower node than `document`), binding at `document` would cause duplicate
  10374. // events so we don't include them here
  10375. var topEventMapping = {
  10376. topAbort: 'abort',
  10377. topAnimationEnd: getVendorPrefixedEventName('animationend') || 'animationend',
  10378. topAnimationIteration: getVendorPrefixedEventName('animationiteration') || 'animationiteration',
  10379. topAnimationStart: getVendorPrefixedEventName('animationstart') || 'animationstart',
  10380. topBlur: 'blur',
  10381. topCanPlay: 'canplay',
  10382. topCanPlayThrough: 'canplaythrough',
  10383. topChange: 'change',
  10384. topClick: 'click',
  10385. topCompositionEnd: 'compositionend',
  10386. topCompositionStart: 'compositionstart',
  10387. topCompositionUpdate: 'compositionupdate',
  10388. topContextMenu: 'contextmenu',
  10389. topCopy: 'copy',
  10390. topCut: 'cut',
  10391. topDoubleClick: 'dblclick',
  10392. topDrag: 'drag',
  10393. topDragEnd: 'dragend',
  10394. topDragEnter: 'dragenter',
  10395. topDragExit: 'dragexit',
  10396. topDragLeave: 'dragleave',
  10397. topDragOver: 'dragover',
  10398. topDragStart: 'dragstart',
  10399. topDrop: 'drop',
  10400. topDurationChange: 'durationchange',
  10401. topEmptied: 'emptied',
  10402. topEncrypted: 'encrypted',
  10403. topEnded: 'ended',
  10404. topError: 'error',
  10405. topFocus: 'focus',
  10406. topInput: 'input',
  10407. topKeyDown: 'keydown',
  10408. topKeyPress: 'keypress',
  10409. topKeyUp: 'keyup',
  10410. topLoadedData: 'loadeddata',
  10411. topLoadedMetadata: 'loadedmetadata',
  10412. topLoadStart: 'loadstart',
  10413. topMouseDown: 'mousedown',
  10414. topMouseMove: 'mousemove',
  10415. topMouseOut: 'mouseout',
  10416. topMouseOver: 'mouseover',
  10417. topMouseUp: 'mouseup',
  10418. topPaste: 'paste',
  10419. topPause: 'pause',
  10420. topPlay: 'play',
  10421. topPlaying: 'playing',
  10422. topProgress: 'progress',
  10423. topRateChange: 'ratechange',
  10424. topScroll: 'scroll',
  10425. topSeeked: 'seeked',
  10426. topSeeking: 'seeking',
  10427. topSelectionChange: 'selectionchange',
  10428. topStalled: 'stalled',
  10429. topSuspend: 'suspend',
  10430. topTextInput: 'textInput',
  10431. topTimeUpdate: 'timeupdate',
  10432. topTouchCancel: 'touchcancel',
  10433. topTouchEnd: 'touchend',
  10434. topTouchMove: 'touchmove',
  10435. topTouchStart: 'touchstart',
  10436. topTransitionEnd: getVendorPrefixedEventName('transitionend') || 'transitionend',
  10437. topVolumeChange: 'volumechange',
  10438. topWaiting: 'waiting',
  10439. topWheel: 'wheel'
  10440. };
  10441. /**
  10442. * To ensure no conflicts with other potential React instances on the page
  10443. */
  10444. var topListenersIDKey = '_reactListenersID' + String(Math.random()).slice(2);
  10445. function getListeningForDocument(mountAt) {
  10446. // In IE8, `mountAt` is a host object and doesn't have `hasOwnProperty`
  10447. // directly.
  10448. if (!Object.prototype.hasOwnProperty.call(mountAt, topListenersIDKey)) {
  10449. mountAt[topListenersIDKey] = reactTopListenersCounter++;
  10450. alreadyListeningTo[mountAt[topListenersIDKey]] = {};
  10451. }
  10452. return alreadyListeningTo[mountAt[topListenersIDKey]];
  10453. }
  10454. /**
  10455. * `ReactBrowserEventEmitter` is used to attach top-level event listeners. For
  10456. * example:
  10457. *
  10458. * EventPluginHub.putListener('myID', 'onClick', myFunction);
  10459. *
  10460. * This would allocate a "registration" of `('onClick', myFunction)` on 'myID'.
  10461. *
  10462. * @internal
  10463. */
  10464. var ReactBrowserEventEmitter = _assign({}, ReactEventEmitterMixin, {
  10465. /**
  10466. * Injectable event backend
  10467. */
  10468. ReactEventListener: null,
  10469. injection: {
  10470. /**
  10471. * @param {object} ReactEventListener
  10472. */
  10473. injectReactEventListener: function (ReactEventListener) {
  10474. ReactEventListener.setHandleTopLevel(ReactBrowserEventEmitter.handleTopLevel);
  10475. ReactBrowserEventEmitter.ReactEventListener = ReactEventListener;
  10476. }
  10477. },
  10478. /**
  10479. * Sets whether or not any created callbacks should be enabled.
  10480. *
  10481. * @param {boolean} enabled True if callbacks should be enabled.
  10482. */
  10483. setEnabled: function (enabled) {
  10484. if (ReactBrowserEventEmitter.ReactEventListener) {
  10485. ReactBrowserEventEmitter.ReactEventListener.setEnabled(enabled);
  10486. }
  10487. },
  10488. /**
  10489. * @return {boolean} True if callbacks are enabled.
  10490. */
  10491. isEnabled: function () {
  10492. return !!(ReactBrowserEventEmitter.ReactEventListener && ReactBrowserEventEmitter.ReactEventListener.isEnabled());
  10493. },
  10494. /**
  10495. * We listen for bubbled touch events on the document object.
  10496. *
  10497. * Firefox v8.01 (and possibly others) exhibited strange behavior when
  10498. * mounting `onmousemove` events at some node that was not the document
  10499. * element. The symptoms were that if your mouse is not moving over something
  10500. * contained within that mount point (for example on the background) the
  10501. * top-level listeners for `onmousemove` won't be called. However, if you
  10502. * register the `mousemove` on the document object, then it will of course
  10503. * catch all `mousemove`s. This along with iOS quirks, justifies restricting
  10504. * top-level listeners to the document object only, at least for these
  10505. * movement types of events and possibly all events.
  10506. *
  10507. * @see http://www.quirksmode.org/blog/archives/2010/09/click_event_del.html
  10508. *
  10509. * Also, `keyup`/`keypress`/`keydown` do not bubble to the window on IE, but
  10510. * they bubble to document.
  10511. *
  10512. * @param {string} registrationName Name of listener (e.g. `onClick`).
  10513. * @param {object} contentDocumentHandle Document which owns the container
  10514. */
  10515. listenTo: function (registrationName, contentDocumentHandle) {
  10516. var mountAt = contentDocumentHandle;
  10517. var isListening = getListeningForDocument(mountAt);
  10518. var dependencies = EventPluginRegistry.registrationNameDependencies[registrationName];
  10519. var topLevelTypes = EventConstants.topLevelTypes;
  10520. for (var i = 0; i < dependencies.length; i++) {
  10521. var dependency = dependencies[i];
  10522. if (!(isListening.hasOwnProperty(dependency) && isListening[dependency])) {
  10523. if (dependency === topLevelTypes.topWheel) {
  10524. if (isEventSupported('wheel')) {
  10525. ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelTypes.topWheel, 'wheel', mountAt);
  10526. } else if (isEventSupported('mousewheel')) {
  10527. ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelTypes.topWheel, 'mousewheel', mountAt);
  10528. } else {
  10529. // Firefox needs to capture a different mouse scroll event.
  10530. // @see http://www.quirksmode.org/dom/events/tests/scroll.html
  10531. ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelTypes.topWheel, 'DOMMouseScroll', mountAt);
  10532. }
  10533. } else if (dependency === topLevelTypes.topScroll) {
  10534. if (isEventSupported('scroll', true)) {
  10535. ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent(topLevelTypes.topScroll, 'scroll', mountAt);
  10536. } else {
  10537. ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelTypes.topScroll, 'scroll', ReactBrowserEventEmitter.ReactEventListener.WINDOW_HANDLE);
  10538. }
  10539. } else if (dependency === topLevelTypes.topFocus || dependency === topLevelTypes.topBlur) {
  10540. if (isEventSupported('focus', true)) {
  10541. ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent(topLevelTypes.topFocus, 'focus', mountAt);
  10542. ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent(topLevelTypes.topBlur, 'blur', mountAt);
  10543. } else if (isEventSupported('focusin')) {
  10544. // IE has `focusin` and `focusout` events which bubble.
  10545. // @see http://www.quirksmode.org/blog/archives/2008/04/delegating_the.html
  10546. ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelTypes.topFocus, 'focusin', mountAt);
  10547. ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelTypes.topBlur, 'focusout', mountAt);
  10548. }
  10549. // to make sure blur and focus event listeners are only attached once
  10550. isListening[topLevelTypes.topBlur] = true;
  10551. isListening[topLevelTypes.topFocus] = true;
  10552. } else if (topEventMapping.hasOwnProperty(dependency)) {
  10553. ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(dependency, topEventMapping[dependency], mountAt);
  10554. }
  10555. isListening[dependency] = true;
  10556. }
  10557. }
  10558. },
  10559. trapBubbledEvent: function (topLevelType, handlerBaseName, handle) {
  10560. return ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelType, handlerBaseName, handle);
  10561. },
  10562. trapCapturedEvent: function (topLevelType, handlerBaseName, handle) {
  10563. return ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent(topLevelType, handlerBaseName, handle);
  10564. },
  10565. /**
  10566. * Listens to window scroll and resize events. We cache scroll values so that
  10567. * application code can access them without triggering reflows.
  10568. *
  10569. * ViewportMetrics is only used by SyntheticMouse/TouchEvent and only when
  10570. * pageX/pageY isn't supported (legacy browsers).
  10571. *
  10572. * NOTE: Scroll events do not bubble.
  10573. *
  10574. * @see http://www.quirksmode.org/dom/events/scroll.html
  10575. */
  10576. ensureScrollValueMonitoring: function () {
  10577. if (hasEventPageXY === undefined) {
  10578. hasEventPageXY = document.createEvent && 'pageX' in document.createEvent('MouseEvent');
  10579. }
  10580. if (!hasEventPageXY && !isMonitoringScrollValue) {
  10581. var refresh = ViewportMetrics.refreshScrollValues;
  10582. ReactBrowserEventEmitter.ReactEventListener.monitorScrollValue(refresh);
  10583. isMonitoringScrollValue = true;
  10584. }
  10585. }
  10586. });
  10587. module.exports = ReactBrowserEventEmitter;
  10588. /***/ },
  10589. /* 103 */
  10590. /***/ function(module, exports, __webpack_require__) {
  10591. /**
  10592. * Copyright 2013-present, Facebook, Inc.
  10593. * All rights reserved.
  10594. *
  10595. * This source code is licensed under the BSD-style license found in the
  10596. * LICENSE file in the root directory of this source tree. An additional grant
  10597. * of patent rights can be found in the PATENTS file in the same directory.
  10598. *
  10599. * @providesModule ReactEventEmitterMixin
  10600. */
  10601. 'use strict';
  10602. var EventPluginHub = __webpack_require__(43);
  10603. function runEventQueueInBatch(events) {
  10604. EventPluginHub.enqueueEvents(events);
  10605. EventPluginHub.processEventQueue(false);
  10606. }
  10607. var ReactEventEmitterMixin = {
  10608. /**
  10609. * Streams a fired top-level event to `EventPluginHub` where plugins have the
  10610. * opportunity to create `ReactEvent`s to be dispatched.
  10611. */
  10612. handleTopLevel: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
  10613. var events = EventPluginHub.extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget);
  10614. runEventQueueInBatch(events);
  10615. }
  10616. };
  10617. module.exports = ReactEventEmitterMixin;
  10618. /***/ },
  10619. /* 104 */
  10620. /***/ function(module, exports, __webpack_require__) {
  10621. /**
  10622. * Copyright 2013-present, Facebook, Inc.
  10623. * All rights reserved.
  10624. *
  10625. * This source code is licensed under the BSD-style license found in the
  10626. * LICENSE file in the root directory of this source tree. An additional grant
  10627. * of patent rights can be found in the PATENTS file in the same directory.
  10628. *
  10629. * @providesModule getVendorPrefixedEventName
  10630. */
  10631. 'use strict';
  10632. var ExecutionEnvironment = __webpack_require__(19);
  10633. /**
  10634. * Generate a mapping of standard vendor prefixes using the defined style property and event name.
  10635. *
  10636. * @param {string} styleProp
  10637. * @param {string} eventName
  10638. * @returns {object}
  10639. */
  10640. function makePrefixMap(styleProp, eventName) {
  10641. var prefixes = {};
  10642. prefixes[styleProp.toLowerCase()] = eventName.toLowerCase();
  10643. prefixes['Webkit' + styleProp] = 'webkit' + eventName;
  10644. prefixes['Moz' + styleProp] = 'moz' + eventName;
  10645. prefixes['ms' + styleProp] = 'MS' + eventName;
  10646. prefixes['O' + styleProp] = 'o' + eventName.toLowerCase();
  10647. return prefixes;
  10648. }
  10649. /**
  10650. * A list of event names to a configurable list of vendor prefixes.
  10651. */
  10652. var vendorPrefixes = {
  10653. animationend: makePrefixMap('Animation', 'AnimationEnd'),
  10654. animationiteration: makePrefixMap('Animation', 'AnimationIteration'),
  10655. animationstart: makePrefixMap('Animation', 'AnimationStart'),
  10656. transitionend: makePrefixMap('Transition', 'TransitionEnd')
  10657. };
  10658. /**
  10659. * Event names that have already been detected and prefixed (if applicable).
  10660. */
  10661. var prefixedEventNames = {};
  10662. /**
  10663. * Element to check for prefixes on.
  10664. */
  10665. var style = {};
  10666. /**
  10667. * Bootstrap if a DOM exists.
  10668. */
  10669. if (ExecutionEnvironment.canUseDOM) {
  10670. style = document.createElement('div').style;
  10671. // On some platforms, in particular some releases of Android 4.x,
  10672. // the un-prefixed "animation" and "transition" properties are defined on the
  10673. // style object but the events that fire will still be prefixed, so we need
  10674. // to check if the un-prefixed events are usable, and if not remove them from the map.
  10675. if (!('AnimationEvent' in window)) {
  10676. delete vendorPrefixes.animationend.animation;
  10677. delete vendorPrefixes.animationiteration.animation;
  10678. delete vendorPrefixes.animationstart.animation;
  10679. }
  10680. // Same as above
  10681. if (!('TransitionEvent' in window)) {
  10682. delete vendorPrefixes.transitionend.transition;
  10683. }
  10684. }
  10685. /**
  10686. * Attempts to determine the correct vendor prefixed event name.
  10687. *
  10688. * @param {string} eventName
  10689. * @returns {string}
  10690. */
  10691. function getVendorPrefixedEventName(eventName) {
  10692. if (prefixedEventNames[eventName]) {
  10693. return prefixedEventNames[eventName];
  10694. } else if (!vendorPrefixes[eventName]) {
  10695. return eventName;
  10696. }
  10697. var prefixMap = vendorPrefixes[eventName];
  10698. for (var styleProp in prefixMap) {
  10699. if (prefixMap.hasOwnProperty(styleProp) && styleProp in style) {
  10700. return prefixedEventNames[eventName] = prefixMap[styleProp];
  10701. }
  10702. }
  10703. return '';
  10704. }
  10705. module.exports = getVendorPrefixedEventName;
  10706. /***/ },
  10707. /* 105 */
  10708. /***/ function(module, exports, __webpack_require__) {
  10709. /**
  10710. * Copyright 2013-present, Facebook, Inc.
  10711. * All rights reserved.
  10712. *
  10713. * This source code is licensed under the BSD-style license found in the
  10714. * LICENSE file in the root directory of this source tree. An additional grant
  10715. * of patent rights can be found in the PATENTS file in the same directory.
  10716. *
  10717. * @providesModule ReactDOMButton
  10718. */
  10719. 'use strict';
  10720. var DisabledInputUtils = __webpack_require__(106);
  10721. /**
  10722. * Implements a <button> native component that does not receive mouse events
  10723. * when `disabled` is set.
  10724. */
  10725. var ReactDOMButton = {
  10726. getNativeProps: DisabledInputUtils.getNativeProps
  10727. };
  10728. module.exports = ReactDOMButton;
  10729. /***/ },
  10730. /* 106 */
  10731. /***/ function(module, exports) {
  10732. /**
  10733. * Copyright 2013-present, Facebook, Inc.
  10734. * All rights reserved.
  10735. *
  10736. * This source code is licensed under the BSD-style license found in the
  10737. * LICENSE file in the root directory of this source tree. An additional grant
  10738. * of patent rights can be found in the PATENTS file in the same directory.
  10739. *
  10740. * @providesModule DisabledInputUtils
  10741. */
  10742. 'use strict';
  10743. var disableableMouseListenerNames = {
  10744. onClick: true,
  10745. onDoubleClick: true,
  10746. onMouseDown: true,
  10747. onMouseMove: true,
  10748. onMouseUp: true,
  10749. onClickCapture: true,
  10750. onDoubleClickCapture: true,
  10751. onMouseDownCapture: true,
  10752. onMouseMoveCapture: true,
  10753. onMouseUpCapture: true
  10754. };
  10755. /**
  10756. * Implements a native component that does not receive mouse events
  10757. * when `disabled` is set.
  10758. */
  10759. var DisabledInputUtils = {
  10760. getNativeProps: function (inst, props) {
  10761. if (!props.disabled) {
  10762. return props;
  10763. }
  10764. // Copy the props, except the mouse listeners
  10765. var nativeProps = {};
  10766. for (var key in props) {
  10767. if (!disableableMouseListenerNames[key] && props.hasOwnProperty(key)) {
  10768. nativeProps[key] = props[key];
  10769. }
  10770. }
  10771. return nativeProps;
  10772. }
  10773. };
  10774. module.exports = DisabledInputUtils;
  10775. /***/ },
  10776. /* 107 */
  10777. /***/ function(module, exports, __webpack_require__) {
  10778. /**
  10779. * Copyright 2013-present, Facebook, Inc.
  10780. * All rights reserved.
  10781. *
  10782. * This source code is licensed under the BSD-style license found in the
  10783. * LICENSE file in the root directory of this source tree. An additional grant
  10784. * of patent rights can be found in the PATENTS file in the same directory.
  10785. *
  10786. * @providesModule ReactDOMInput
  10787. */
  10788. 'use strict';
  10789. var _assign = __webpack_require__(3);
  10790. var DisabledInputUtils = __webpack_require__(106);
  10791. var DOMPropertyOperations = __webpack_require__(97);
  10792. var LinkedValueUtils = __webpack_require__(108);
  10793. var ReactDOMComponentTree = __webpack_require__(36);
  10794. var ReactUpdates = __webpack_require__(55);
  10795. var invariant = __webpack_require__(6);
  10796. var warning = __webpack_require__(9);
  10797. var didWarnValueLink = false;
  10798. var didWarnCheckedLink = false;
  10799. var didWarnValueNull = false;
  10800. var didWarnValueDefaultValue = false;
  10801. var didWarnCheckedDefaultChecked = false;
  10802. var didWarnControlledToUncontrolled = false;
  10803. var didWarnUncontrolledToControlled = false;
  10804. function forceUpdateIfMounted() {
  10805. if (this._rootNodeID) {
  10806. // DOM component is still mounted; update
  10807. ReactDOMInput.updateWrapper(this);
  10808. }
  10809. }
  10810. function warnIfValueIsNull(props) {
  10811. if (props != null && props.value === null && !didWarnValueNull) {
  10812. false ? warning(false, '`value` prop on `input` should not be null. ' + 'Consider using the empty string to clear the component or `undefined` ' + 'for uncontrolled components.') : void 0;
  10813. didWarnValueNull = true;
  10814. }
  10815. }
  10816. /**
  10817. * Implements an <input> native component that allows setting these optional
  10818. * props: `checked`, `value`, `defaultChecked`, and `defaultValue`.
  10819. *
  10820. * If `checked` or `value` are not supplied (or null/undefined), user actions
  10821. * that affect the checked state or value will trigger updates to the element.
  10822. *
  10823. * If they are supplied (and not null/undefined), the rendered element will not
  10824. * trigger updates to the element. Instead, the props must change in order for
  10825. * the rendered element to be updated.
  10826. *
  10827. * The rendered element will be initialized as unchecked (or `defaultChecked`)
  10828. * with an empty value (or `defaultValue`).
  10829. *
  10830. * @see http://www.w3.org/TR/2012/WD-html5-20121025/the-input-element.html
  10831. */
  10832. var ReactDOMInput = {
  10833. getNativeProps: function (inst, props) {
  10834. var value = LinkedValueUtils.getValue(props);
  10835. var checked = LinkedValueUtils.getChecked(props);
  10836. var nativeProps = _assign({
  10837. // Make sure we set .type before any other properties (setting .value
  10838. // before .type means .value is lost in IE11 and below)
  10839. type: undefined
  10840. }, DisabledInputUtils.getNativeProps(inst, props), {
  10841. defaultChecked: undefined,
  10842. defaultValue: undefined,
  10843. value: value != null ? value : inst._wrapperState.initialValue,
  10844. checked: checked != null ? checked : inst._wrapperState.initialChecked,
  10845. onChange: inst._wrapperState.onChange
  10846. });
  10847. return nativeProps;
  10848. },
  10849. mountWrapper: function (inst, props) {
  10850. if (false) {
  10851. LinkedValueUtils.checkPropTypes('input', props, inst._currentElement._owner);
  10852. var owner = inst._currentElement._owner;
  10853. if (props.valueLink !== undefined && !didWarnValueLink) {
  10854. process.env.NODE_ENV !== 'production' ? warning(false, '`valueLink` prop on `input` is deprecated; set `value` and `onChange` instead.') : void 0;
  10855. didWarnValueLink = true;
  10856. }
  10857. if (props.checkedLink !== undefined && !didWarnCheckedLink) {
  10858. process.env.NODE_ENV !== 'production' ? warning(false, '`checkedLink` prop on `input` is deprecated; set `value` and `onChange` instead.') : void 0;
  10859. didWarnCheckedLink = true;
  10860. }
  10861. if (props.checked !== undefined && props.defaultChecked !== undefined && !didWarnCheckedDefaultChecked) {
  10862. process.env.NODE_ENV !== 'production' ? warning(false, '%s contains an input of type %s with both checked and defaultChecked props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the checked prop, or the defaultChecked prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', owner && owner.getName() || 'A component', props.type) : void 0;
  10863. didWarnCheckedDefaultChecked = true;
  10864. }
  10865. if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue) {
  10866. process.env.NODE_ENV !== 'production' ? warning(false, '%s contains an input of type %s with both value and defaultValue props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', owner && owner.getName() || 'A component', props.type) : void 0;
  10867. didWarnValueDefaultValue = true;
  10868. }
  10869. warnIfValueIsNull(props);
  10870. }
  10871. var defaultValue = props.defaultValue;
  10872. inst._wrapperState = {
  10873. initialChecked: props.defaultChecked || false,
  10874. initialValue: defaultValue != null ? defaultValue : null,
  10875. listeners: null,
  10876. onChange: _handleChange.bind(inst)
  10877. };
  10878. if (false) {
  10879. inst._wrapperState.controlled = props.checked !== undefined || props.value !== undefined;
  10880. }
  10881. },
  10882. updateWrapper: function (inst) {
  10883. var props = inst._currentElement.props;
  10884. if (false) {
  10885. warnIfValueIsNull(props);
  10886. var initialValue = inst._wrapperState.initialChecked || inst._wrapperState.initialValue;
  10887. var defaultValue = props.defaultChecked || props.defaultValue;
  10888. var controlled = props.checked !== undefined || props.value !== undefined;
  10889. var owner = inst._currentElement._owner;
  10890. if ((initialValue || !inst._wrapperState.controlled) && controlled && !didWarnUncontrolledToControlled) {
  10891. process.env.NODE_ENV !== 'production' ? warning(false, '%s is changing an uncontrolled input of type %s to be controlled. ' + 'Input elements should not switch from uncontrolled to controlled (or vice versa). ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components', owner && owner.getName() || 'A component', props.type) : void 0;
  10892. didWarnUncontrolledToControlled = true;
  10893. }
  10894. if (inst._wrapperState.controlled && (defaultValue || !controlled) && !didWarnControlledToUncontrolled) {
  10895. process.env.NODE_ENV !== 'production' ? warning(false, '%s is changing a controlled input of type %s to be uncontrolled. ' + 'Input elements should not switch from controlled to uncontrolled (or vice versa). ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components', owner && owner.getName() || 'A component', props.type) : void 0;
  10896. didWarnControlledToUncontrolled = true;
  10897. }
  10898. }
  10899. // TODO: Shouldn't this be getChecked(props)?
  10900. var checked = props.checked;
  10901. if (checked != null) {
  10902. DOMPropertyOperations.setValueForProperty(ReactDOMComponentTree.getNodeFromInstance(inst), 'checked', checked || false);
  10903. }
  10904. var value = LinkedValueUtils.getValue(props);
  10905. if (value != null) {
  10906. // Cast `value` to a string to ensure the value is set correctly. While
  10907. // browsers typically do this as necessary, jsdom doesn't.
  10908. DOMPropertyOperations.setValueForProperty(ReactDOMComponentTree.getNodeFromInstance(inst), 'value', '' + value);
  10909. }
  10910. }
  10911. };
  10912. function _handleChange(event) {
  10913. var props = this._currentElement.props;
  10914. var returnValue = LinkedValueUtils.executeOnChange(props, event);
  10915. // Here we use asap to wait until all updates have propagated, which
  10916. // is important when using controlled components within layers:
  10917. // https://github.com/facebook/react/issues/1698
  10918. ReactUpdates.asap(forceUpdateIfMounted, this);
  10919. var name = props.name;
  10920. if (props.type === 'radio' && name != null) {
  10921. var rootNode = ReactDOMComponentTree.getNodeFromInstance(this);
  10922. var queryRoot = rootNode;
  10923. while (queryRoot.parentNode) {
  10924. queryRoot = queryRoot.parentNode;
  10925. }
  10926. // If `rootNode.form` was non-null, then we could try `form.elements`,
  10927. // but that sometimes behaves strangely in IE8. We could also try using
  10928. // `form.getElementsByName`, but that will only return direct children
  10929. // and won't include inputs that use the HTML5 `form=` attribute. Since
  10930. // the input might not even be in a form, let's just use the global
  10931. // `querySelectorAll` to ensure we don't miss anything.
  10932. var group = queryRoot.querySelectorAll('input[name=' + JSON.stringify('' + name) + '][type="radio"]');
  10933. for (var i = 0; i < group.length; i++) {
  10934. var otherNode = group[i];
  10935. if (otherNode === rootNode || otherNode.form !== rootNode.form) {
  10936. continue;
  10937. }
  10938. // This will throw if radio buttons rendered by different copies of React
  10939. // and the same name are rendered into the same form (same as #1939).
  10940. // That's probably okay; we don't support it just as we don't support
  10941. // mixing React radio buttons with non-React ones.
  10942. var otherInstance = ReactDOMComponentTree.getInstanceFromNode(otherNode);
  10943. !otherInstance ? false ? invariant(false, 'ReactDOMInput: Mixing React and non-React radio inputs with the ' + 'same `name` is not supported.') : invariant(false) : void 0;
  10944. // If this is a controlled radio button group, forcing the input that
  10945. // was previously checked to update will cause it to be come re-checked
  10946. // as appropriate.
  10947. ReactUpdates.asap(forceUpdateIfMounted, otherInstance);
  10948. }
  10949. }
  10950. return returnValue;
  10951. }
  10952. module.exports = ReactDOMInput;
  10953. /***/ },
  10954. /* 108 */
  10955. /***/ function(module, exports, __webpack_require__) {
  10956. /**
  10957. * Copyright 2013-present, Facebook, Inc.
  10958. * All rights reserved.
  10959. *
  10960. * This source code is licensed under the BSD-style license found in the
  10961. * LICENSE file in the root directory of this source tree. An additional grant
  10962. * of patent rights can be found in the PATENTS file in the same directory.
  10963. *
  10964. * @providesModule LinkedValueUtils
  10965. */
  10966. 'use strict';
  10967. var ReactPropTypes = __webpack_require__(31);
  10968. var ReactPropTypeLocations = __webpack_require__(24);
  10969. var invariant = __webpack_require__(6);
  10970. var warning = __webpack_require__(9);
  10971. var hasReadOnlyValue = {
  10972. 'button': true,
  10973. 'checkbox': true,
  10974. 'image': true,
  10975. 'hidden': true,
  10976. 'radio': true,
  10977. 'reset': true,
  10978. 'submit': true
  10979. };
  10980. function _assertSingleLink(inputProps) {
  10981. !(inputProps.checkedLink == null || inputProps.valueLink == null) ? false ? invariant(false, 'Cannot provide a checkedLink and a valueLink. If you want to use ' + 'checkedLink, you probably don\'t want to use valueLink and vice versa.') : invariant(false) : void 0;
  10982. }
  10983. function _assertValueLink(inputProps) {
  10984. _assertSingleLink(inputProps);
  10985. !(inputProps.value == null && inputProps.onChange == null) ? false ? invariant(false, 'Cannot provide a valueLink and a value or onChange event. If you want ' + 'to use value or onChange, you probably don\'t want to use valueLink.') : invariant(false) : void 0;
  10986. }
  10987. function _assertCheckedLink(inputProps) {
  10988. _assertSingleLink(inputProps);
  10989. !(inputProps.checked == null && inputProps.onChange == null) ? false ? invariant(false, 'Cannot provide a checkedLink and a checked property or onChange event. ' + 'If you want to use checked or onChange, you probably don\'t want to ' + 'use checkedLink') : invariant(false) : void 0;
  10990. }
  10991. var propTypes = {
  10992. value: function (props, propName, componentName) {
  10993. if (!props[propName] || hasReadOnlyValue[props.type] || props.onChange || props.readOnly || props.disabled) {
  10994. return null;
  10995. }
  10996. return new Error('You provided a `value` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultValue`. Otherwise, ' + 'set either `onChange` or `readOnly`.');
  10997. },
  10998. checked: function (props, propName, componentName) {
  10999. if (!props[propName] || props.onChange || props.readOnly || props.disabled) {
  11000. return null;
  11001. }
  11002. return new Error('You provided a `checked` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultChecked`. Otherwise, ' + 'set either `onChange` or `readOnly`.');
  11003. },
  11004. onChange: ReactPropTypes.func
  11005. };
  11006. var loggedTypeFailures = {};
  11007. function getDeclarationErrorAddendum(owner) {
  11008. if (owner) {
  11009. var name = owner.getName();
  11010. if (name) {
  11011. return ' Check the render method of `' + name + '`.';
  11012. }
  11013. }
  11014. return '';
  11015. }
  11016. /**
  11017. * Provide a linked `value` attribute for controlled forms. You should not use
  11018. * this outside of the ReactDOM controlled form components.
  11019. */
  11020. var LinkedValueUtils = {
  11021. checkPropTypes: function (tagName, props, owner) {
  11022. for (var propName in propTypes) {
  11023. if (propTypes.hasOwnProperty(propName)) {
  11024. var error = propTypes[propName](props, propName, tagName, ReactPropTypeLocations.prop);
  11025. }
  11026. if (error instanceof Error && !(error.message in loggedTypeFailures)) {
  11027. // Only monitor this failure once because there tends to be a lot of the
  11028. // same error.
  11029. loggedTypeFailures[error.message] = true;
  11030. var addendum = getDeclarationErrorAddendum(owner);
  11031. false ? warning(false, 'Failed form propType: %s%s', error.message, addendum) : void 0;
  11032. }
  11033. }
  11034. },
  11035. /**
  11036. * @param {object} inputProps Props for form component
  11037. * @return {*} current value of the input either from value prop or link.
  11038. */
  11039. getValue: function (inputProps) {
  11040. if (inputProps.valueLink) {
  11041. _assertValueLink(inputProps);
  11042. return inputProps.valueLink.value;
  11043. }
  11044. return inputProps.value;
  11045. },
  11046. /**
  11047. * @param {object} inputProps Props for form component
  11048. * @return {*} current checked status of the input either from checked prop
  11049. * or link.
  11050. */
  11051. getChecked: function (inputProps) {
  11052. if (inputProps.checkedLink) {
  11053. _assertCheckedLink(inputProps);
  11054. return inputProps.checkedLink.value;
  11055. }
  11056. return inputProps.checked;
  11057. },
  11058. /**
  11059. * @param {object} inputProps Props for form component
  11060. * @param {SyntheticEvent} event change event to handle
  11061. */
  11062. executeOnChange: function (inputProps, event) {
  11063. if (inputProps.valueLink) {
  11064. _assertValueLink(inputProps);
  11065. return inputProps.valueLink.requestChange(event.target.value);
  11066. } else if (inputProps.checkedLink) {
  11067. _assertCheckedLink(inputProps);
  11068. return inputProps.checkedLink.requestChange(event.target.checked);
  11069. } else if (inputProps.onChange) {
  11070. return inputProps.onChange.call(undefined, event);
  11071. }
  11072. }
  11073. };
  11074. module.exports = LinkedValueUtils;
  11075. /***/ },
  11076. /* 109 */
  11077. /***/ function(module, exports, __webpack_require__) {
  11078. /**
  11079. * Copyright 2013-present, Facebook, Inc.
  11080. * All rights reserved.
  11081. *
  11082. * This source code is licensed under the BSD-style license found in the
  11083. * LICENSE file in the root directory of this source tree. An additional grant
  11084. * of patent rights can be found in the PATENTS file in the same directory.
  11085. *
  11086. * @providesModule ReactDOMOption
  11087. */
  11088. 'use strict';
  11089. var _assign = __webpack_require__(3);
  11090. var ReactChildren = __webpack_require__(4);
  11091. var ReactDOMComponentTree = __webpack_require__(36);
  11092. var ReactDOMSelect = __webpack_require__(110);
  11093. var warning = __webpack_require__(9);
  11094. /**
  11095. * Implements an <option> native component that warns when `selected` is set.
  11096. */
  11097. var ReactDOMOption = {
  11098. mountWrapper: function (inst, props, nativeParent) {
  11099. // TODO (yungsters): Remove support for `selected` in <option>.
  11100. if (false) {
  11101. process.env.NODE_ENV !== 'production' ? warning(props.selected == null, 'Use the `defaultValue` or `value` props on <select> instead of ' + 'setting `selected` on <option>.') : void 0;
  11102. }
  11103. // Look up whether this option is 'selected'
  11104. var selectValue = null;
  11105. if (nativeParent != null) {
  11106. var selectParent = nativeParent;
  11107. if (selectParent._tag === 'optgroup') {
  11108. selectParent = selectParent._nativeParent;
  11109. }
  11110. if (selectParent != null && selectParent._tag === 'select') {
  11111. selectValue = ReactDOMSelect.getSelectValueContext(selectParent);
  11112. }
  11113. }
  11114. // If the value is null (e.g., no specified value or after initial mount)
  11115. // or missing (e.g., for <datalist>), we don't change props.selected
  11116. var selected = null;
  11117. if (selectValue != null) {
  11118. selected = false;
  11119. if (Array.isArray(selectValue)) {
  11120. // multiple
  11121. for (var i = 0; i < selectValue.length; i++) {
  11122. if ('' + selectValue[i] === '' + props.value) {
  11123. selected = true;
  11124. break;
  11125. }
  11126. }
  11127. } else {
  11128. selected = '' + selectValue === '' + props.value;
  11129. }
  11130. }
  11131. inst._wrapperState = { selected: selected };
  11132. },
  11133. postMountWrapper: function (inst) {
  11134. // value="" should make a value attribute (#6219)
  11135. var props = inst._currentElement.props;
  11136. if (props.value != null) {
  11137. var node = ReactDOMComponentTree.getNodeFromInstance(inst);
  11138. node.setAttribute('value', props.value);
  11139. }
  11140. },
  11141. getNativeProps: function (inst, props) {
  11142. var nativeProps = _assign({ selected: undefined, children: undefined }, props);
  11143. // Read state only from initial mount because <select> updates value
  11144. // manually; we need the initial state only for server rendering
  11145. if (inst._wrapperState.selected != null) {
  11146. nativeProps.selected = inst._wrapperState.selected;
  11147. }
  11148. var content = '';
  11149. // Flatten children and warn if they aren't strings or numbers;
  11150. // invalid types are ignored.
  11151. ReactChildren.forEach(props.children, function (child) {
  11152. if (child == null) {
  11153. return;
  11154. }
  11155. if (typeof child === 'string' || typeof child === 'number') {
  11156. content += child;
  11157. } else {
  11158. false ? warning(false, 'Only strings and numbers are supported as <option> children.') : void 0;
  11159. }
  11160. });
  11161. if (content) {
  11162. nativeProps.children = content;
  11163. }
  11164. return nativeProps;
  11165. }
  11166. };
  11167. module.exports = ReactDOMOption;
  11168. /***/ },
  11169. /* 110 */
  11170. /***/ function(module, exports, __webpack_require__) {
  11171. /**
  11172. * Copyright 2013-present, Facebook, Inc.
  11173. * All rights reserved.
  11174. *
  11175. * This source code is licensed under the BSD-style license found in the
  11176. * LICENSE file in the root directory of this source tree. An additional grant
  11177. * of patent rights can be found in the PATENTS file in the same directory.
  11178. *
  11179. * @providesModule ReactDOMSelect
  11180. */
  11181. 'use strict';
  11182. var _assign = __webpack_require__(3);
  11183. var DisabledInputUtils = __webpack_require__(106);
  11184. var LinkedValueUtils = __webpack_require__(108);
  11185. var ReactDOMComponentTree = __webpack_require__(36);
  11186. var ReactUpdates = __webpack_require__(55);
  11187. var warning = __webpack_require__(9);
  11188. var didWarnValueLink = false;
  11189. var didWarnValueNull = false;
  11190. var didWarnValueDefaultValue = false;
  11191. function updateOptionsIfPendingUpdateAndMounted() {
  11192. if (this._rootNodeID && this._wrapperState.pendingUpdate) {
  11193. this._wrapperState.pendingUpdate = false;
  11194. var props = this._currentElement.props;
  11195. var value = LinkedValueUtils.getValue(props);
  11196. if (value != null) {
  11197. updateOptions(this, Boolean(props.multiple), value);
  11198. }
  11199. }
  11200. }
  11201. function getDeclarationErrorAddendum(owner) {
  11202. if (owner) {
  11203. var name = owner.getName();
  11204. if (name) {
  11205. return ' Check the render method of `' + name + '`.';
  11206. }
  11207. }
  11208. return '';
  11209. }
  11210. function warnIfValueIsNull(props) {
  11211. if (props != null && props.value === null && !didWarnValueNull) {
  11212. false ? warning(false, '`value` prop on `select` should not be null. ' + 'Consider using the empty string to clear the component or `undefined` ' + 'for uncontrolled components.') : void 0;
  11213. didWarnValueNull = true;
  11214. }
  11215. }
  11216. var valuePropNames = ['value', 'defaultValue'];
  11217. /**
  11218. * Validation function for `value` and `defaultValue`.
  11219. * @private
  11220. */
  11221. function checkSelectPropTypes(inst, props) {
  11222. var owner = inst._currentElement._owner;
  11223. LinkedValueUtils.checkPropTypes('select', props, owner);
  11224. if (props.valueLink !== undefined && !didWarnValueLink) {
  11225. false ? warning(false, '`valueLink` prop on `select` is deprecated; set `value` and `onChange` instead.') : void 0;
  11226. didWarnValueLink = true;
  11227. }
  11228. for (var i = 0; i < valuePropNames.length; i++) {
  11229. var propName = valuePropNames[i];
  11230. if (props[propName] == null) {
  11231. continue;
  11232. }
  11233. if (props.multiple) {
  11234. false ? warning(Array.isArray(props[propName]), 'The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;
  11235. } else {
  11236. false ? warning(!Array.isArray(props[propName]), 'The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;
  11237. }
  11238. }
  11239. }
  11240. /**
  11241. * @param {ReactDOMComponent} inst
  11242. * @param {boolean} multiple
  11243. * @param {*} propValue A stringable (with `multiple`, a list of stringables).
  11244. * @private
  11245. */
  11246. function updateOptions(inst, multiple, propValue) {
  11247. var selectedValue, i;
  11248. var options = ReactDOMComponentTree.getNodeFromInstance(inst).options;
  11249. if (multiple) {
  11250. selectedValue = {};
  11251. for (i = 0; i < propValue.length; i++) {
  11252. selectedValue['' + propValue[i]] = true;
  11253. }
  11254. for (i = 0; i < options.length; i++) {
  11255. var selected = selectedValue.hasOwnProperty(options[i].value);
  11256. if (options[i].selected !== selected) {
  11257. options[i].selected = selected;
  11258. }
  11259. }
  11260. } else {
  11261. // Do not set `select.value` as exact behavior isn't consistent across all
  11262. // browsers for all cases.
  11263. selectedValue = '' + propValue;
  11264. for (i = 0; i < options.length; i++) {
  11265. if (options[i].value === selectedValue) {
  11266. options[i].selected = true;
  11267. return;
  11268. }
  11269. }
  11270. if (options.length) {
  11271. options[0].selected = true;
  11272. }
  11273. }
  11274. }
  11275. /**
  11276. * Implements a <select> native component that allows optionally setting the
  11277. * props `value` and `defaultValue`. If `multiple` is false, the prop must be a
  11278. * stringable. If `multiple` is true, the prop must be an array of stringables.
  11279. *
  11280. * If `value` is not supplied (or null/undefined), user actions that change the
  11281. * selected option will trigger updates to the rendered options.
  11282. *
  11283. * If it is supplied (and not null/undefined), the rendered options will not
  11284. * update in response to user actions. Instead, the `value` prop must change in
  11285. * order for the rendered options to update.
  11286. *
  11287. * If `defaultValue` is provided, any options with the supplied values will be
  11288. * selected.
  11289. */
  11290. var ReactDOMSelect = {
  11291. getNativeProps: function (inst, props) {
  11292. return _assign({}, DisabledInputUtils.getNativeProps(inst, props), {
  11293. onChange: inst._wrapperState.onChange,
  11294. value: undefined
  11295. });
  11296. },
  11297. mountWrapper: function (inst, props) {
  11298. if (false) {
  11299. checkSelectPropTypes(inst, props);
  11300. warnIfValueIsNull(props);
  11301. }
  11302. var value = LinkedValueUtils.getValue(props);
  11303. inst._wrapperState = {
  11304. pendingUpdate: false,
  11305. initialValue: value != null ? value : props.defaultValue,
  11306. listeners: null,
  11307. onChange: _handleChange.bind(inst),
  11308. wasMultiple: Boolean(props.multiple)
  11309. };
  11310. if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue) {
  11311. false ? warning(false, 'Select elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled select ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components') : void 0;
  11312. didWarnValueDefaultValue = true;
  11313. }
  11314. },
  11315. getSelectValueContext: function (inst) {
  11316. // ReactDOMOption looks at this initial value so the initial generated
  11317. // markup has correct `selected` attributes
  11318. return inst._wrapperState.initialValue;
  11319. },
  11320. postUpdateWrapper: function (inst) {
  11321. var props = inst._currentElement.props;
  11322. if (false) {
  11323. warnIfValueIsNull(props);
  11324. }
  11325. // After the initial mount, we control selected-ness manually so don't pass
  11326. // this value down
  11327. inst._wrapperState.initialValue = undefined;
  11328. var wasMultiple = inst._wrapperState.wasMultiple;
  11329. inst._wrapperState.wasMultiple = Boolean(props.multiple);
  11330. var value = LinkedValueUtils.getValue(props);
  11331. if (value != null) {
  11332. inst._wrapperState.pendingUpdate = false;
  11333. updateOptions(inst, Boolean(props.multiple), value);
  11334. } else if (wasMultiple !== Boolean(props.multiple)) {
  11335. // For simplicity, reapply `defaultValue` if `multiple` is toggled.
  11336. if (props.defaultValue != null) {
  11337. updateOptions(inst, Boolean(props.multiple), props.defaultValue);
  11338. } else {
  11339. // Revert the select back to its default unselected state.
  11340. updateOptions(inst, Boolean(props.multiple), props.multiple ? [] : '');
  11341. }
  11342. }
  11343. }
  11344. };
  11345. function _handleChange(event) {
  11346. var props = this._currentElement.props;
  11347. var returnValue = LinkedValueUtils.executeOnChange(props, event);
  11348. if (this._rootNodeID) {
  11349. this._wrapperState.pendingUpdate = true;
  11350. }
  11351. ReactUpdates.asap(updateOptionsIfPendingUpdateAndMounted, this);
  11352. return returnValue;
  11353. }
  11354. module.exports = ReactDOMSelect;
  11355. /***/ },
  11356. /* 111 */
  11357. /***/ function(module, exports, __webpack_require__) {
  11358. /**
  11359. * Copyright 2013-present, Facebook, Inc.
  11360. * All rights reserved.
  11361. *
  11362. * This source code is licensed under the BSD-style license found in the
  11363. * LICENSE file in the root directory of this source tree. An additional grant
  11364. * of patent rights can be found in the PATENTS file in the same directory.
  11365. *
  11366. * @providesModule ReactDOMTextarea
  11367. */
  11368. 'use strict';
  11369. var _assign = __webpack_require__(3);
  11370. var DisabledInputUtils = __webpack_require__(106);
  11371. var DOMPropertyOperations = __webpack_require__(97);
  11372. var LinkedValueUtils = __webpack_require__(108);
  11373. var ReactDOMComponentTree = __webpack_require__(36);
  11374. var ReactUpdates = __webpack_require__(55);
  11375. var invariant = __webpack_require__(6);
  11376. var warning = __webpack_require__(9);
  11377. var didWarnValueLink = false;
  11378. var didWarnValueNull = false;
  11379. var didWarnValDefaultVal = false;
  11380. function forceUpdateIfMounted() {
  11381. if (this._rootNodeID) {
  11382. // DOM component is still mounted; update
  11383. ReactDOMTextarea.updateWrapper(this);
  11384. }
  11385. }
  11386. function warnIfValueIsNull(props) {
  11387. if (props != null && props.value === null && !didWarnValueNull) {
  11388. false ? warning(false, '`value` prop on `textarea` should not be null. ' + 'Consider using the empty string to clear the component or `undefined` ' + 'for uncontrolled components.') : void 0;
  11389. didWarnValueNull = true;
  11390. }
  11391. }
  11392. /**
  11393. * Implements a <textarea> native component that allows setting `value`, and
  11394. * `defaultValue`. This differs from the traditional DOM API because value is
  11395. * usually set as PCDATA children.
  11396. *
  11397. * If `value` is not supplied (or null/undefined), user actions that affect the
  11398. * value will trigger updates to the element.
  11399. *
  11400. * If `value` is supplied (and not null/undefined), the rendered element will
  11401. * not trigger updates to the element. Instead, the `value` prop must change in
  11402. * order for the rendered element to be updated.
  11403. *
  11404. * The rendered element will be initialized with an empty value, the prop
  11405. * `defaultValue` if specified, or the children content (deprecated).
  11406. */
  11407. var ReactDOMTextarea = {
  11408. getNativeProps: function (inst, props) {
  11409. !(props.dangerouslySetInnerHTML == null) ? false ? invariant(false, '`dangerouslySetInnerHTML` does not make sense on <textarea>.') : invariant(false) : void 0;
  11410. // Always set children to the same thing. In IE9, the selection range will
  11411. // get reset if `textContent` is mutated.
  11412. var nativeProps = _assign({}, DisabledInputUtils.getNativeProps(inst, props), {
  11413. defaultValue: undefined,
  11414. value: undefined,
  11415. children: inst._wrapperState.initialValue,
  11416. onChange: inst._wrapperState.onChange
  11417. });
  11418. return nativeProps;
  11419. },
  11420. mountWrapper: function (inst, props) {
  11421. if (false) {
  11422. LinkedValueUtils.checkPropTypes('textarea', props, inst._currentElement._owner);
  11423. if (props.valueLink !== undefined && !didWarnValueLink) {
  11424. process.env.NODE_ENV !== 'production' ? warning(false, '`valueLink` prop on `textarea` is deprecated; set `value` and `onChange` instead.') : void 0;
  11425. didWarnValueLink = true;
  11426. }
  11427. if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValDefaultVal) {
  11428. process.env.NODE_ENV !== 'production' ? warning(false, 'Textarea elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled textarea ' + 'and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components') : void 0;
  11429. didWarnValDefaultVal = true;
  11430. }
  11431. warnIfValueIsNull(props);
  11432. }
  11433. var defaultValue = props.defaultValue;
  11434. // TODO (yungsters): Remove support for children content in <textarea>.
  11435. var children = props.children;
  11436. if (children != null) {
  11437. if (false) {
  11438. process.env.NODE_ENV !== 'production' ? warning(false, 'Use the `defaultValue` or `value` props instead of setting ' + 'children on <textarea>.') : void 0;
  11439. }
  11440. !(defaultValue == null) ? false ? invariant(false, 'If you supply `defaultValue` on a <textarea>, do not pass children.') : invariant(false) : void 0;
  11441. if (Array.isArray(children)) {
  11442. !(children.length <= 1) ? false ? invariant(false, '<textarea> can only have at most one child.') : invariant(false) : void 0;
  11443. children = children[0];
  11444. }
  11445. defaultValue = '' + children;
  11446. }
  11447. if (defaultValue == null) {
  11448. defaultValue = '';
  11449. }
  11450. var value = LinkedValueUtils.getValue(props);
  11451. inst._wrapperState = {
  11452. // We save the initial value so that `ReactDOMComponent` doesn't update
  11453. // `textContent` (unnecessary since we update value).
  11454. // The initial value can be a boolean or object so that's why it's
  11455. // forced to be a string.
  11456. initialValue: '' + (value != null ? value : defaultValue),
  11457. listeners: null,
  11458. onChange: _handleChange.bind(inst)
  11459. };
  11460. },
  11461. updateWrapper: function (inst) {
  11462. var props = inst._currentElement.props;
  11463. if (false) {
  11464. warnIfValueIsNull(props);
  11465. }
  11466. var value = LinkedValueUtils.getValue(props);
  11467. if (value != null) {
  11468. // Cast `value` to a string to ensure the value is set correctly. While
  11469. // browsers typically do this as necessary, jsdom doesn't.
  11470. DOMPropertyOperations.setValueForProperty(ReactDOMComponentTree.getNodeFromInstance(inst), 'value', '' + value);
  11471. }
  11472. }
  11473. };
  11474. function _handleChange(event) {
  11475. var props = this._currentElement.props;
  11476. var returnValue = LinkedValueUtils.executeOnChange(props, event);
  11477. ReactUpdates.asap(forceUpdateIfMounted, this);
  11478. return returnValue;
  11479. }
  11480. module.exports = ReactDOMTextarea;
  11481. /***/ },
  11482. /* 112 */
  11483. /***/ function(module, exports, __webpack_require__) {
  11484. /**
  11485. * Copyright 2013-present, Facebook, Inc.
  11486. * All rights reserved.
  11487. *
  11488. * This source code is licensed under the BSD-style license found in the
  11489. * LICENSE file in the root directory of this source tree. An additional grant
  11490. * of patent rights can be found in the PATENTS file in the same directory.
  11491. *
  11492. * @providesModule ReactMultiChild
  11493. */
  11494. 'use strict';
  11495. var ReactComponentEnvironment = __webpack_require__(113);
  11496. var ReactInstrumentation = __webpack_require__(17);
  11497. var ReactMultiChildUpdateTypes = __webpack_require__(84);
  11498. var ReactCurrentOwner = __webpack_require__(8);
  11499. var ReactReconciler = __webpack_require__(58);
  11500. var ReactChildReconciler = __webpack_require__(114);
  11501. var emptyFunction = __webpack_require__(10);
  11502. var flattenChildren = __webpack_require__(123);
  11503. var invariant = __webpack_require__(6);
  11504. /**
  11505. * Make an update for markup to be rendered and inserted at a supplied index.
  11506. *
  11507. * @param {string} markup Markup that renders into an element.
  11508. * @param {number} toIndex Destination index.
  11509. * @private
  11510. */
  11511. function makeInsertMarkup(markup, afterNode, toIndex) {
  11512. // NOTE: Null values reduce hidden classes.
  11513. return {
  11514. type: ReactMultiChildUpdateTypes.INSERT_MARKUP,
  11515. content: markup,
  11516. fromIndex: null,
  11517. fromNode: null,
  11518. toIndex: toIndex,
  11519. afterNode: afterNode
  11520. };
  11521. }
  11522. /**
  11523. * Make an update for moving an existing element to another index.
  11524. *
  11525. * @param {number} fromIndex Source index of the existing element.
  11526. * @param {number} toIndex Destination index of the element.
  11527. * @private
  11528. */
  11529. function makeMove(child, afterNode, toIndex) {
  11530. // NOTE: Null values reduce hidden classes.
  11531. return {
  11532. type: ReactMultiChildUpdateTypes.MOVE_EXISTING,
  11533. content: null,
  11534. fromIndex: child._mountIndex,
  11535. fromNode: ReactReconciler.getNativeNode(child),
  11536. toIndex: toIndex,
  11537. afterNode: afterNode
  11538. };
  11539. }
  11540. /**
  11541. * Make an update for removing an element at an index.
  11542. *
  11543. * @param {number} fromIndex Index of the element to remove.
  11544. * @private
  11545. */
  11546. function makeRemove(child, node) {
  11547. // NOTE: Null values reduce hidden classes.
  11548. return {
  11549. type: ReactMultiChildUpdateTypes.REMOVE_NODE,
  11550. content: null,
  11551. fromIndex: child._mountIndex,
  11552. fromNode: node,
  11553. toIndex: null,
  11554. afterNode: null
  11555. };
  11556. }
  11557. /**
  11558. * Make an update for setting the markup of a node.
  11559. *
  11560. * @param {string} markup Markup that renders into an element.
  11561. * @private
  11562. */
  11563. function makeSetMarkup(markup) {
  11564. // NOTE: Null values reduce hidden classes.
  11565. return {
  11566. type: ReactMultiChildUpdateTypes.SET_MARKUP,
  11567. content: markup,
  11568. fromIndex: null,
  11569. fromNode: null,
  11570. toIndex: null,
  11571. afterNode: null
  11572. };
  11573. }
  11574. /**
  11575. * Make an update for setting the text content.
  11576. *
  11577. * @param {string} textContent Text content to set.
  11578. * @private
  11579. */
  11580. function makeTextContent(textContent) {
  11581. // NOTE: Null values reduce hidden classes.
  11582. return {
  11583. type: ReactMultiChildUpdateTypes.TEXT_CONTENT,
  11584. content: textContent,
  11585. fromIndex: null,
  11586. fromNode: null,
  11587. toIndex: null,
  11588. afterNode: null
  11589. };
  11590. }
  11591. /**
  11592. * Push an update, if any, onto the queue. Creates a new queue if none is
  11593. * passed and always returns the queue. Mutative.
  11594. */
  11595. function enqueue(queue, update) {
  11596. if (update) {
  11597. queue = queue || [];
  11598. queue.push(update);
  11599. }
  11600. return queue;
  11601. }
  11602. /**
  11603. * Processes any enqueued updates.
  11604. *
  11605. * @private
  11606. */
  11607. function processQueue(inst, updateQueue) {
  11608. ReactComponentEnvironment.processChildrenUpdates(inst, updateQueue);
  11609. }
  11610. var setChildrenForInstrumentation = emptyFunction;
  11611. if (false) {
  11612. setChildrenForInstrumentation = function (children) {
  11613. ReactInstrumentation.debugTool.onSetChildren(this._debugID, children ? Object.keys(children).map(function (key) {
  11614. return children[key]._debugID;
  11615. }) : []);
  11616. };
  11617. }
  11618. /**
  11619. * ReactMultiChild are capable of reconciling multiple children.
  11620. *
  11621. * @class ReactMultiChild
  11622. * @internal
  11623. */
  11624. var ReactMultiChild = {
  11625. /**
  11626. * Provides common functionality for components that must reconcile multiple
  11627. * children. This is used by `ReactDOMComponent` to mount, update, and
  11628. * unmount child components.
  11629. *
  11630. * @lends {ReactMultiChild.prototype}
  11631. */
  11632. Mixin: {
  11633. _reconcilerInstantiateChildren: function (nestedChildren, transaction, context) {
  11634. if (false) {
  11635. if (this._currentElement) {
  11636. try {
  11637. ReactCurrentOwner.current = this._currentElement._owner;
  11638. return ReactChildReconciler.instantiateChildren(nestedChildren, transaction, context);
  11639. } finally {
  11640. ReactCurrentOwner.current = null;
  11641. }
  11642. }
  11643. }
  11644. return ReactChildReconciler.instantiateChildren(nestedChildren, transaction, context);
  11645. },
  11646. _reconcilerUpdateChildren: function (prevChildren, nextNestedChildrenElements, removedNodes, transaction, context) {
  11647. var nextChildren;
  11648. if (false) {
  11649. if (this._currentElement) {
  11650. try {
  11651. ReactCurrentOwner.current = this._currentElement._owner;
  11652. nextChildren = flattenChildren(nextNestedChildrenElements);
  11653. } finally {
  11654. ReactCurrentOwner.current = null;
  11655. }
  11656. ReactChildReconciler.updateChildren(prevChildren, nextChildren, removedNodes, transaction, context);
  11657. return nextChildren;
  11658. }
  11659. }
  11660. nextChildren = flattenChildren(nextNestedChildrenElements);
  11661. ReactChildReconciler.updateChildren(prevChildren, nextChildren, removedNodes, transaction, context);
  11662. return nextChildren;
  11663. },
  11664. /**
  11665. * Generates a "mount image" for each of the supplied children. In the case
  11666. * of `ReactDOMComponent`, a mount image is a string of markup.
  11667. *
  11668. * @param {?object} nestedChildren Nested child maps.
  11669. * @return {array} An array of mounted representations.
  11670. * @internal
  11671. */
  11672. mountChildren: function (nestedChildren, transaction, context) {
  11673. var children = this._reconcilerInstantiateChildren(nestedChildren, transaction, context);
  11674. this._renderedChildren = children;
  11675. var mountImages = [];
  11676. var index = 0;
  11677. for (var name in children) {
  11678. if (children.hasOwnProperty(name)) {
  11679. var child = children[name];
  11680. var mountImage = ReactReconciler.mountComponent(child, transaction, this, this._nativeContainerInfo, context);
  11681. child._mountIndex = index++;
  11682. mountImages.push(mountImage);
  11683. }
  11684. }
  11685. if (false) {
  11686. setChildrenForInstrumentation.call(this, children);
  11687. }
  11688. return mountImages;
  11689. },
  11690. /**
  11691. * Replaces any rendered children with a text content string.
  11692. *
  11693. * @param {string} nextContent String of content.
  11694. * @internal
  11695. */
  11696. updateTextContent: function (nextContent) {
  11697. var prevChildren = this._renderedChildren;
  11698. // Remove any rendered children.
  11699. ReactChildReconciler.unmountChildren(prevChildren, false);
  11700. for (var name in prevChildren) {
  11701. if (prevChildren.hasOwnProperty(name)) {
  11702. true ? false ? invariant(false, 'updateTextContent called on non-empty component.') : invariant(false) : void 0;
  11703. }
  11704. }
  11705. // Set new text content.
  11706. var updates = [makeTextContent(nextContent)];
  11707. processQueue(this, updates);
  11708. },
  11709. /**
  11710. * Replaces any rendered children with a markup string.
  11711. *
  11712. * @param {string} nextMarkup String of markup.
  11713. * @internal
  11714. */
  11715. updateMarkup: function (nextMarkup) {
  11716. var prevChildren = this._renderedChildren;
  11717. // Remove any rendered children.
  11718. ReactChildReconciler.unmountChildren(prevChildren, false);
  11719. for (var name in prevChildren) {
  11720. if (prevChildren.hasOwnProperty(name)) {
  11721. true ? false ? invariant(false, 'updateTextContent called on non-empty component.') : invariant(false) : void 0;
  11722. }
  11723. }
  11724. var updates = [makeSetMarkup(nextMarkup)];
  11725. processQueue(this, updates);
  11726. },
  11727. /**
  11728. * Updates the rendered children with new children.
  11729. *
  11730. * @param {?object} nextNestedChildrenElements Nested child element maps.
  11731. * @param {ReactReconcileTransaction} transaction
  11732. * @internal
  11733. */
  11734. updateChildren: function (nextNestedChildrenElements, transaction, context) {
  11735. // Hook used by React ART
  11736. this._updateChildren(nextNestedChildrenElements, transaction, context);
  11737. },
  11738. /**
  11739. * @param {?object} nextNestedChildrenElements Nested child element maps.
  11740. * @param {ReactReconcileTransaction} transaction
  11741. * @final
  11742. * @protected
  11743. */
  11744. _updateChildren: function (nextNestedChildrenElements, transaction, context) {
  11745. var prevChildren = this._renderedChildren;
  11746. var removedNodes = {};
  11747. var nextChildren = this._reconcilerUpdateChildren(prevChildren, nextNestedChildrenElements, removedNodes, transaction, context);
  11748. if (!nextChildren && !prevChildren) {
  11749. return;
  11750. }
  11751. var updates = null;
  11752. var name;
  11753. // `nextIndex` will increment for each child in `nextChildren`, but
  11754. // `lastIndex` will be the last index visited in `prevChildren`.
  11755. var lastIndex = 0;
  11756. var nextIndex = 0;
  11757. var lastPlacedNode = null;
  11758. for (name in nextChildren) {
  11759. if (!nextChildren.hasOwnProperty(name)) {
  11760. continue;
  11761. }
  11762. var prevChild = prevChildren && prevChildren[name];
  11763. var nextChild = nextChildren[name];
  11764. if (prevChild === nextChild) {
  11765. updates = enqueue(updates, this.moveChild(prevChild, lastPlacedNode, nextIndex, lastIndex));
  11766. lastIndex = Math.max(prevChild._mountIndex, lastIndex);
  11767. prevChild._mountIndex = nextIndex;
  11768. } else {
  11769. if (prevChild) {
  11770. // Update `lastIndex` before `_mountIndex` gets unset by unmounting.
  11771. lastIndex = Math.max(prevChild._mountIndex, lastIndex);
  11772. // The `removedNodes` loop below will actually remove the child.
  11773. }
  11774. // The child must be instantiated before it's mounted.
  11775. updates = enqueue(updates, this._mountChildAtIndex(nextChild, lastPlacedNode, nextIndex, transaction, context));
  11776. }
  11777. nextIndex++;
  11778. lastPlacedNode = ReactReconciler.getNativeNode(nextChild);
  11779. }
  11780. // Remove children that are no longer present.
  11781. for (name in removedNodes) {
  11782. if (removedNodes.hasOwnProperty(name)) {
  11783. updates = enqueue(updates, this._unmountChild(prevChildren[name], removedNodes[name]));
  11784. }
  11785. }
  11786. if (updates) {
  11787. processQueue(this, updates);
  11788. }
  11789. this._renderedChildren = nextChildren;
  11790. if (false) {
  11791. setChildrenForInstrumentation.call(this, nextChildren);
  11792. }
  11793. },
  11794. /**
  11795. * Unmounts all rendered children. This should be used to clean up children
  11796. * when this component is unmounted. It does not actually perform any
  11797. * backend operations.
  11798. *
  11799. * @internal
  11800. */
  11801. unmountChildren: function (safely) {
  11802. var renderedChildren = this._renderedChildren;
  11803. ReactChildReconciler.unmountChildren(renderedChildren, safely);
  11804. this._renderedChildren = null;
  11805. },
  11806. /**
  11807. * Moves a child component to the supplied index.
  11808. *
  11809. * @param {ReactComponent} child Component to move.
  11810. * @param {number} toIndex Destination index of the element.
  11811. * @param {number} lastIndex Last index visited of the siblings of `child`.
  11812. * @protected
  11813. */
  11814. moveChild: function (child, afterNode, toIndex, lastIndex) {
  11815. // If the index of `child` is less than `lastIndex`, then it needs to
  11816. // be moved. Otherwise, we do not need to move it because a child will be
  11817. // inserted or moved before `child`.
  11818. if (child._mountIndex < lastIndex) {
  11819. return makeMove(child, afterNode, toIndex);
  11820. }
  11821. },
  11822. /**
  11823. * Creates a child component.
  11824. *
  11825. * @param {ReactComponent} child Component to create.
  11826. * @param {string} mountImage Markup to insert.
  11827. * @protected
  11828. */
  11829. createChild: function (child, afterNode, mountImage) {
  11830. return makeInsertMarkup(mountImage, afterNode, child._mountIndex);
  11831. },
  11832. /**
  11833. * Removes a child component.
  11834. *
  11835. * @param {ReactComponent} child Child to remove.
  11836. * @protected
  11837. */
  11838. removeChild: function (child, node) {
  11839. return makeRemove(child, node);
  11840. },
  11841. /**
  11842. * Mounts a child with the supplied name.
  11843. *
  11844. * NOTE: This is part of `updateChildren` and is here for readability.
  11845. *
  11846. * @param {ReactComponent} child Component to mount.
  11847. * @param {string} name Name of the child.
  11848. * @param {number} index Index at which to insert the child.
  11849. * @param {ReactReconcileTransaction} transaction
  11850. * @private
  11851. */
  11852. _mountChildAtIndex: function (child, afterNode, index, transaction, context) {
  11853. var mountImage = ReactReconciler.mountComponent(child, transaction, this, this._nativeContainerInfo, context);
  11854. child._mountIndex = index;
  11855. return this.createChild(child, afterNode, mountImage);
  11856. },
  11857. /**
  11858. * Unmounts a rendered child.
  11859. *
  11860. * NOTE: This is part of `updateChildren` and is here for readability.
  11861. *
  11862. * @param {ReactComponent} child Component to unmount.
  11863. * @private
  11864. */
  11865. _unmountChild: function (child, node) {
  11866. var update = this.removeChild(child, node);
  11867. child._mountIndex = null;
  11868. return update;
  11869. }
  11870. }
  11871. };
  11872. module.exports = ReactMultiChild;
  11873. /***/ },
  11874. /* 113 */
  11875. /***/ function(module, exports, __webpack_require__) {
  11876. /**
  11877. * Copyright 2014-present, Facebook, Inc.
  11878. * All rights reserved.
  11879. *
  11880. * This source code is licensed under the BSD-style license found in the
  11881. * LICENSE file in the root directory of this source tree. An additional grant
  11882. * of patent rights can be found in the PATENTS file in the same directory.
  11883. *
  11884. * @providesModule ReactComponentEnvironment
  11885. */
  11886. 'use strict';
  11887. var invariant = __webpack_require__(6);
  11888. var injected = false;
  11889. var ReactComponentEnvironment = {
  11890. /**
  11891. * Optionally injectable environment dependent cleanup hook. (server vs.
  11892. * browser etc). Example: A browser system caches DOM nodes based on component
  11893. * ID and must remove that cache entry when this instance is unmounted.
  11894. */
  11895. unmountIDFromEnvironment: null,
  11896. /**
  11897. * Optionally injectable hook for swapping out mount images in the middle of
  11898. * the tree.
  11899. */
  11900. replaceNodeWithMarkup: null,
  11901. /**
  11902. * Optionally injectable hook for processing a queue of child updates. Will
  11903. * later move into MultiChildComponents.
  11904. */
  11905. processChildrenUpdates: null,
  11906. injection: {
  11907. injectEnvironment: function (environment) {
  11908. !!injected ? false ? invariant(false, 'ReactCompositeComponent: injectEnvironment() can only be called once.') : invariant(false) : void 0;
  11909. ReactComponentEnvironment.unmountIDFromEnvironment = environment.unmountIDFromEnvironment;
  11910. ReactComponentEnvironment.replaceNodeWithMarkup = environment.replaceNodeWithMarkup;
  11911. ReactComponentEnvironment.processChildrenUpdates = environment.processChildrenUpdates;
  11912. injected = true;
  11913. }
  11914. }
  11915. };
  11916. module.exports = ReactComponentEnvironment;
  11917. /***/ },
  11918. /* 114 */
  11919. /***/ function(module, exports, __webpack_require__) {
  11920. /**
  11921. * Copyright 2014-present, Facebook, Inc.
  11922. * All rights reserved.
  11923. *
  11924. * This source code is licensed under the BSD-style license found in the
  11925. * LICENSE file in the root directory of this source tree. An additional grant
  11926. * of patent rights can be found in the PATENTS file in the same directory.
  11927. *
  11928. * @providesModule ReactChildReconciler
  11929. */
  11930. 'use strict';
  11931. var ReactReconciler = __webpack_require__(58);
  11932. var instantiateReactComponent = __webpack_require__(115);
  11933. var KeyEscapeUtils = __webpack_require__(14);
  11934. var shouldUpdateReactComponent = __webpack_require__(120);
  11935. var traverseAllChildren = __webpack_require__(12);
  11936. var warning = __webpack_require__(9);
  11937. function instantiateChild(childInstances, child, name) {
  11938. // We found a component instance.
  11939. var keyUnique = childInstances[name] === undefined;
  11940. if (false) {
  11941. process.env.NODE_ENV !== 'production' ? warning(keyUnique, 'flattenChildren(...): Encountered two children with the same key, ' + '`%s`. Child keys must be unique; when two children share a key, only ' + 'the first child will be used.', KeyEscapeUtils.unescape(name)) : void 0;
  11942. }
  11943. if (child != null && keyUnique) {
  11944. childInstances[name] = instantiateReactComponent(child);
  11945. }
  11946. }
  11947. /**
  11948. * ReactChildReconciler provides helpers for initializing or updating a set of
  11949. * children. Its output is suitable for passing it onto ReactMultiChild which
  11950. * does diffed reordering and insertion.
  11951. */
  11952. var ReactChildReconciler = {
  11953. /**
  11954. * Generates a "mount image" for each of the supplied children. In the case
  11955. * of `ReactDOMComponent`, a mount image is a string of markup.
  11956. *
  11957. * @param {?object} nestedChildNodes Nested child maps.
  11958. * @return {?object} A set of child instances.
  11959. * @internal
  11960. */
  11961. instantiateChildren: function (nestedChildNodes, transaction, context) {
  11962. if (nestedChildNodes == null) {
  11963. return null;
  11964. }
  11965. var childInstances = {};
  11966. traverseAllChildren(nestedChildNodes, instantiateChild, childInstances);
  11967. return childInstances;
  11968. },
  11969. /**
  11970. * Updates the rendered children and returns a new set of children.
  11971. *
  11972. * @param {?object} prevChildren Previously initialized set of children.
  11973. * @param {?object} nextChildren Flat child element maps.
  11974. * @param {ReactReconcileTransaction} transaction
  11975. * @param {object} context
  11976. * @return {?object} A new set of child instances.
  11977. * @internal
  11978. */
  11979. updateChildren: function (prevChildren, nextChildren, removedNodes, transaction, context) {
  11980. // We currently don't have a way to track moves here but if we use iterators
  11981. // instead of for..in we can zip the iterators and check if an item has
  11982. // moved.
  11983. // TODO: If nothing has changed, return the prevChildren object so that we
  11984. // can quickly bailout if nothing has changed.
  11985. if (!nextChildren && !prevChildren) {
  11986. return;
  11987. }
  11988. var name;
  11989. var prevChild;
  11990. for (name in nextChildren) {
  11991. if (!nextChildren.hasOwnProperty(name)) {
  11992. continue;
  11993. }
  11994. prevChild = prevChildren && prevChildren[name];
  11995. var prevElement = prevChild && prevChild._currentElement;
  11996. var nextElement = nextChildren[name];
  11997. if (prevChild != null && shouldUpdateReactComponent(prevElement, nextElement)) {
  11998. ReactReconciler.receiveComponent(prevChild, nextElement, transaction, context);
  11999. nextChildren[name] = prevChild;
  12000. } else {
  12001. if (prevChild) {
  12002. removedNodes[name] = ReactReconciler.getNativeNode(prevChild);
  12003. ReactReconciler.unmountComponent(prevChild, false);
  12004. }
  12005. // The child must be instantiated before it's mounted.
  12006. var nextChildInstance = instantiateReactComponent(nextElement);
  12007. nextChildren[name] = nextChildInstance;
  12008. }
  12009. }
  12010. // Unmount children that are no longer present.
  12011. for (name in prevChildren) {
  12012. if (prevChildren.hasOwnProperty(name) && !(nextChildren && nextChildren.hasOwnProperty(name))) {
  12013. prevChild = prevChildren[name];
  12014. removedNodes[name] = ReactReconciler.getNativeNode(prevChild);
  12015. ReactReconciler.unmountComponent(prevChild, false);
  12016. }
  12017. }
  12018. },
  12019. /**
  12020. * Unmounts all rendered children. This should be used to clean up children
  12021. * when this component is unmounted.
  12022. *
  12023. * @param {?object} renderedChildren Previously initialized set of children.
  12024. * @internal
  12025. */
  12026. unmountChildren: function (renderedChildren, safely) {
  12027. for (var name in renderedChildren) {
  12028. if (renderedChildren.hasOwnProperty(name)) {
  12029. var renderedChild = renderedChildren[name];
  12030. ReactReconciler.unmountComponent(renderedChild, safely);
  12031. }
  12032. }
  12033. }
  12034. };
  12035. module.exports = ReactChildReconciler;
  12036. /***/ },
  12037. /* 115 */
  12038. /***/ function(module, exports, __webpack_require__) {
  12039. /**
  12040. * Copyright 2013-present, Facebook, Inc.
  12041. * All rights reserved.
  12042. *
  12043. * This source code is licensed under the BSD-style license found in the
  12044. * LICENSE file in the root directory of this source tree. An additional grant
  12045. * of patent rights can be found in the PATENTS file in the same directory.
  12046. *
  12047. * @providesModule instantiateReactComponent
  12048. */
  12049. 'use strict';
  12050. var _assign = __webpack_require__(3);
  12051. var ReactCompositeComponent = __webpack_require__(116);
  12052. var ReactEmptyComponent = __webpack_require__(121);
  12053. var ReactNativeComponent = __webpack_require__(122);
  12054. var ReactInstrumentation = __webpack_require__(17);
  12055. var invariant = __webpack_require__(6);
  12056. var warning = __webpack_require__(9);
  12057. // To avoid a cyclic dependency, we create the final class in this module
  12058. var ReactCompositeComponentWrapper = function (element) {
  12059. this.construct(element);
  12060. };
  12061. _assign(ReactCompositeComponentWrapper.prototype, ReactCompositeComponent.Mixin, {
  12062. _instantiateReactComponent: instantiateReactComponent
  12063. });
  12064. function getDeclarationErrorAddendum(owner) {
  12065. if (owner) {
  12066. var name = owner.getName();
  12067. if (name) {
  12068. return ' Check the render method of `' + name + '`.';
  12069. }
  12070. }
  12071. return '';
  12072. }
  12073. function getDisplayName(instance) {
  12074. var element = instance._currentElement;
  12075. if (element == null) {
  12076. return '#empty';
  12077. } else if (typeof element === 'string' || typeof element === 'number') {
  12078. return '#text';
  12079. } else if (typeof element.type === 'string') {
  12080. return element.type;
  12081. } else if (instance.getName) {
  12082. return instance.getName() || 'Unknown';
  12083. } else {
  12084. return element.type.displayName || element.type.name || 'Unknown';
  12085. }
  12086. }
  12087. /**
  12088. * Check if the type reference is a known internal type. I.e. not a user
  12089. * provided composite type.
  12090. *
  12091. * @param {function} type
  12092. * @return {boolean} Returns true if this is a valid internal type.
  12093. */
  12094. function isInternalComponentType(type) {
  12095. return typeof type === 'function' && typeof type.prototype !== 'undefined' && typeof type.prototype.mountComponent === 'function' && typeof type.prototype.receiveComponent === 'function';
  12096. }
  12097. var nextDebugID = 1;
  12098. /**
  12099. * Given a ReactNode, create an instance that will actually be mounted.
  12100. *
  12101. * @param {ReactNode} node
  12102. * @return {object} A new instance of the element's constructor.
  12103. * @protected
  12104. */
  12105. function instantiateReactComponent(node) {
  12106. var instance;
  12107. var isEmpty = node === null || node === false;
  12108. if (isEmpty) {
  12109. instance = ReactEmptyComponent.create(instantiateReactComponent);
  12110. } else if (typeof node === 'object') {
  12111. var element = node;
  12112. !(element && (typeof element.type === 'function' || typeof element.type === 'string')) ? false ? invariant(false, 'Element type is invalid: expected a string (for built-in components) ' + 'or a class/function (for composite components) but got: %s.%s', element.type == null ? element.type : typeof element.type, getDeclarationErrorAddendum(element._owner)) : invariant(false) : void 0;
  12113. // Special case string values
  12114. if (typeof element.type === 'string') {
  12115. instance = ReactNativeComponent.createInternalComponent(element);
  12116. } else if (isInternalComponentType(element.type)) {
  12117. // This is temporarily available for custom components that are not string
  12118. // representations. I.e. ART. Once those are updated to use the string
  12119. // representation, we can drop this code path.
  12120. instance = new element.type(element);
  12121. } else {
  12122. instance = new ReactCompositeComponentWrapper(element);
  12123. }
  12124. } else if (typeof node === 'string' || typeof node === 'number') {
  12125. instance = ReactNativeComponent.createInstanceForText(node);
  12126. } else {
  12127. true ? false ? invariant(false, 'Encountered invalid React node of type %s', typeof node) : invariant(false) : void 0;
  12128. }
  12129. if (false) {
  12130. process.env.NODE_ENV !== 'production' ? warning(typeof instance.mountComponent === 'function' && typeof instance.receiveComponent === 'function' && typeof instance.getNativeNode === 'function' && typeof instance.unmountComponent === 'function', 'Only React Components can be mounted.') : void 0;
  12131. }
  12132. // These two fields are used by the DOM and ART diffing algorithms
  12133. // respectively. Instead of using expandos on components, we should be
  12134. // storing the state needed by the diffing algorithms elsewhere.
  12135. instance._mountIndex = 0;
  12136. instance._mountImage = null;
  12137. if (false) {
  12138. instance._isOwnerNecessary = false;
  12139. instance._warnedAboutRefsInRender = false;
  12140. }
  12141. if (false) {
  12142. var debugID = isEmpty ? 0 : nextDebugID++;
  12143. instance._debugID = debugID;
  12144. if (debugID !== 0) {
  12145. var displayName = getDisplayName(instance);
  12146. ReactInstrumentation.debugTool.onSetDisplayName(debugID, displayName);
  12147. var owner = node && node._owner;
  12148. if (owner) {
  12149. ReactInstrumentation.debugTool.onSetOwner(debugID, owner._debugID);
  12150. }
  12151. }
  12152. }
  12153. // Internal instances should fully constructed at this point, so they should
  12154. // not get any new fields added to them at this point.
  12155. if (false) {
  12156. if (Object.preventExtensions) {
  12157. Object.preventExtensions(instance);
  12158. }
  12159. }
  12160. return instance;
  12161. }
  12162. module.exports = instantiateReactComponent;
  12163. /***/ },
  12164. /* 116 */
  12165. /***/ function(module, exports, __webpack_require__) {
  12166. /**
  12167. * Copyright 2013-present, Facebook, Inc.
  12168. * All rights reserved.
  12169. *
  12170. * This source code is licensed under the BSD-style license found in the
  12171. * LICENSE file in the root directory of this source tree. An additional grant
  12172. * of patent rights can be found in the PATENTS file in the same directory.
  12173. *
  12174. * @providesModule ReactCompositeComponent
  12175. */
  12176. 'use strict';
  12177. var _assign = __webpack_require__(3);
  12178. var ReactComponentEnvironment = __webpack_require__(113);
  12179. var ReactCurrentOwner = __webpack_require__(8);
  12180. var ReactElement = __webpack_require__(7);
  12181. var ReactErrorUtils = __webpack_require__(46);
  12182. var ReactInstanceMap = __webpack_require__(117);
  12183. var ReactInstrumentation = __webpack_require__(17);
  12184. var ReactNodeTypes = __webpack_require__(118);
  12185. var ReactPropTypeLocations = __webpack_require__(24);
  12186. var ReactPropTypeLocationNames = __webpack_require__(26);
  12187. var ReactReconciler = __webpack_require__(58);
  12188. var ReactUpdateQueue = __webpack_require__(119);
  12189. var emptyObject = __webpack_require__(22);
  12190. var invariant = __webpack_require__(6);
  12191. var shouldUpdateReactComponent = __webpack_require__(120);
  12192. var warning = __webpack_require__(9);
  12193. function getDeclarationErrorAddendum(component) {
  12194. var owner = component._currentElement._owner || null;
  12195. if (owner) {
  12196. var name = owner.getName();
  12197. if (name) {
  12198. return ' Check the render method of `' + name + '`.';
  12199. }
  12200. }
  12201. return '';
  12202. }
  12203. function StatelessComponent(Component) {}
  12204. StatelessComponent.prototype.render = function () {
  12205. var Component = ReactInstanceMap.get(this)._currentElement.type;
  12206. var element = Component(this.props, this.context, this.updater);
  12207. warnIfInvalidElement(Component, element);
  12208. return element;
  12209. };
  12210. function warnIfInvalidElement(Component, element) {
  12211. if (false) {
  12212. process.env.NODE_ENV !== 'production' ? warning(element === null || element === false || ReactElement.isValidElement(element), '%s(...): A valid React element (or null) must be returned. You may have ' + 'returned undefined, an array or some other invalid object.', Component.displayName || Component.name || 'Component') : void 0;
  12213. }
  12214. }
  12215. function invokeComponentDidMountWithTimer() {
  12216. var publicInstance = this._instance;
  12217. if (this._debugID !== 0) {
  12218. ReactInstrumentation.debugTool.onBeginLifeCycleTimer(this._debugID, 'componentDidMount');
  12219. }
  12220. publicInstance.componentDidMount();
  12221. if (this._debugID !== 0) {
  12222. ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'componentDidMount');
  12223. }
  12224. }
  12225. function invokeComponentDidUpdateWithTimer(prevProps, prevState, prevContext) {
  12226. var publicInstance = this._instance;
  12227. if (this._debugID !== 0) {
  12228. ReactInstrumentation.debugTool.onBeginLifeCycleTimer(this._debugID, 'componentDidUpdate');
  12229. }
  12230. publicInstance.componentDidUpdate(prevProps, prevState, prevContext);
  12231. if (this._debugID !== 0) {
  12232. ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'componentDidUpdate');
  12233. }
  12234. }
  12235. function shouldConstruct(Component) {
  12236. return Component.prototype && Component.prototype.isReactComponent;
  12237. }
  12238. /**
  12239. * ------------------ The Life-Cycle of a Composite Component ------------------
  12240. *
  12241. * - constructor: Initialization of state. The instance is now retained.
  12242. * - componentWillMount
  12243. * - render
  12244. * - [children's constructors]
  12245. * - [children's componentWillMount and render]
  12246. * - [children's componentDidMount]
  12247. * - componentDidMount
  12248. *
  12249. * Update Phases:
  12250. * - componentWillReceiveProps (only called if parent updated)
  12251. * - shouldComponentUpdate
  12252. * - componentWillUpdate
  12253. * - render
  12254. * - [children's constructors or receive props phases]
  12255. * - componentDidUpdate
  12256. *
  12257. * - componentWillUnmount
  12258. * - [children's componentWillUnmount]
  12259. * - [children destroyed]
  12260. * - (destroyed): The instance is now blank, released by React and ready for GC.
  12261. *
  12262. * -----------------------------------------------------------------------------
  12263. */
  12264. /**
  12265. * An incrementing ID assigned to each component when it is mounted. This is
  12266. * used to enforce the order in which `ReactUpdates` updates dirty components.
  12267. *
  12268. * @private
  12269. */
  12270. var nextMountID = 1;
  12271. /**
  12272. * @lends {ReactCompositeComponent.prototype}
  12273. */
  12274. var ReactCompositeComponentMixin = {
  12275. /**
  12276. * Base constructor for all composite component.
  12277. *
  12278. * @param {ReactElement} element
  12279. * @final
  12280. * @internal
  12281. */
  12282. construct: function (element) {
  12283. this._currentElement = element;
  12284. this._rootNodeID = null;
  12285. this._instance = null;
  12286. this._nativeParent = null;
  12287. this._nativeContainerInfo = null;
  12288. // See ReactUpdateQueue
  12289. this._updateBatchNumber = null;
  12290. this._pendingElement = null;
  12291. this._pendingStateQueue = null;
  12292. this._pendingReplaceState = false;
  12293. this._pendingForceUpdate = false;
  12294. this._renderedNodeType = null;
  12295. this._renderedComponent = null;
  12296. this._context = null;
  12297. this._mountOrder = 0;
  12298. this._topLevelWrapper = null;
  12299. // See ReactUpdates and ReactUpdateQueue.
  12300. this._pendingCallbacks = null;
  12301. // ComponentWillUnmount shall only be called once
  12302. this._calledComponentWillUnmount = false;
  12303. },
  12304. /**
  12305. * Initializes the component, renders markup, and registers event listeners.
  12306. *
  12307. * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
  12308. * @param {?object} nativeParent
  12309. * @param {?object} nativeContainerInfo
  12310. * @param {?object} context
  12311. * @return {?string} Rendered markup to be inserted into the DOM.
  12312. * @final
  12313. * @internal
  12314. */
  12315. mountComponent: function (transaction, nativeParent, nativeContainerInfo, context) {
  12316. this._context = context;
  12317. this._mountOrder = nextMountID++;
  12318. this._nativeParent = nativeParent;
  12319. this._nativeContainerInfo = nativeContainerInfo;
  12320. var publicProps = this._processProps(this._currentElement.props);
  12321. var publicContext = this._processContext(context);
  12322. var Component = this._currentElement.type;
  12323. // Initialize the public class
  12324. var inst = this._constructComponent(publicProps, publicContext);
  12325. var renderedElement;
  12326. // Support functional components
  12327. if (!shouldConstruct(Component) && (inst == null || inst.render == null)) {
  12328. renderedElement = inst;
  12329. warnIfInvalidElement(Component, renderedElement);
  12330. !(inst === null || inst === false || ReactElement.isValidElement(inst)) ? false ? invariant(false, '%s(...): A valid React element (or null) must be returned. You may have ' + 'returned undefined, an array or some other invalid object.', Component.displayName || Component.name || 'Component') : invariant(false) : void 0;
  12331. inst = new StatelessComponent(Component);
  12332. }
  12333. if (false) {
  12334. // This will throw later in _renderValidatedComponent, but add an early
  12335. // warning now to help debugging
  12336. if (inst.render == null) {
  12337. process.env.NODE_ENV !== 'production' ? warning(false, '%s(...): No `render` method found on the returned component ' + 'instance: you may have forgotten to define `render`.', Component.displayName || Component.name || 'Component') : void 0;
  12338. }
  12339. var propsMutated = inst.props !== publicProps;
  12340. var componentName = Component.displayName || Component.name || 'Component';
  12341. process.env.NODE_ENV !== 'production' ? warning(inst.props === undefined || !propsMutated, '%s(...): When calling super() in `%s`, make sure to pass ' + 'up the same props that your component\'s constructor was passed.', componentName, componentName) : void 0;
  12342. }
  12343. // These should be set up in the constructor, but as a convenience for
  12344. // simpler class abstractions, we set them up after the fact.
  12345. inst.props = publicProps;
  12346. inst.context = publicContext;
  12347. inst.refs = emptyObject;
  12348. inst.updater = ReactUpdateQueue;
  12349. this._instance = inst;
  12350. // Store a reference from the instance back to the internal representation
  12351. ReactInstanceMap.set(inst, this);
  12352. if (false) {
  12353. // Since plain JS classes are defined without any special initialization
  12354. // logic, we can not catch common errors early. Therefore, we have to
  12355. // catch them here, at initialization time, instead.
  12356. process.env.NODE_ENV !== 'production' ? warning(!inst.getInitialState || inst.getInitialState.isReactClassApproved, 'getInitialState was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Did you mean to define a state property instead?', this.getName() || 'a component') : void 0;
  12357. process.env.NODE_ENV !== 'production' ? warning(!inst.getDefaultProps || inst.getDefaultProps.isReactClassApproved, 'getDefaultProps was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Use a static property to define defaultProps instead.', this.getName() || 'a component') : void 0;
  12358. process.env.NODE_ENV !== 'production' ? warning(!inst.propTypes, 'propTypes was defined as an instance property on %s. Use a static ' + 'property to define propTypes instead.', this.getName() || 'a component') : void 0;
  12359. process.env.NODE_ENV !== 'production' ? warning(!inst.contextTypes, 'contextTypes was defined as an instance property on %s. Use a ' + 'static property to define contextTypes instead.', this.getName() || 'a component') : void 0;
  12360. process.env.NODE_ENV !== 'production' ? warning(typeof inst.componentShouldUpdate !== 'function', '%s has a method called ' + 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' + 'The name is phrased as a question because the function is ' + 'expected to return a value.', this.getName() || 'A component') : void 0;
  12361. process.env.NODE_ENV !== 'production' ? warning(typeof inst.componentDidUnmount !== 'function', '%s has a method called ' + 'componentDidUnmount(). But there is no such lifecycle method. ' + 'Did you mean componentWillUnmount()?', this.getName() || 'A component') : void 0;
  12362. process.env.NODE_ENV !== 'production' ? warning(typeof inst.componentWillRecieveProps !== 'function', '%s has a method called ' + 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', this.getName() || 'A component') : void 0;
  12363. }
  12364. var initialState = inst.state;
  12365. if (initialState === undefined) {
  12366. inst.state = initialState = null;
  12367. }
  12368. !(typeof initialState === 'object' && !Array.isArray(initialState)) ? false ? invariant(false, '%s.state: must be set to an object or null', this.getName() || 'ReactCompositeComponent') : invariant(false) : void 0;
  12369. this._pendingStateQueue = null;
  12370. this._pendingReplaceState = false;
  12371. this._pendingForceUpdate = false;
  12372. var markup;
  12373. if (inst.unstable_handleError) {
  12374. markup = this.performInitialMountWithErrorHandling(renderedElement, nativeParent, nativeContainerInfo, transaction, context);
  12375. } else {
  12376. markup = this.performInitialMount(renderedElement, nativeParent, nativeContainerInfo, transaction, context);
  12377. }
  12378. if (inst.componentDidMount) {
  12379. if (false) {
  12380. transaction.getReactMountReady().enqueue(invokeComponentDidMountWithTimer, this);
  12381. } else {
  12382. transaction.getReactMountReady().enqueue(inst.componentDidMount, inst);
  12383. }
  12384. }
  12385. return markup;
  12386. },
  12387. _constructComponent: function (publicProps, publicContext) {
  12388. if (false) {
  12389. ReactCurrentOwner.current = this;
  12390. try {
  12391. return this._constructComponentWithoutOwner(publicProps, publicContext);
  12392. } finally {
  12393. ReactCurrentOwner.current = null;
  12394. }
  12395. } else {
  12396. return this._constructComponentWithoutOwner(publicProps, publicContext);
  12397. }
  12398. },
  12399. _constructComponentWithoutOwner: function (publicProps, publicContext) {
  12400. var Component = this._currentElement.type;
  12401. var instanceOrElement;
  12402. if (shouldConstruct(Component)) {
  12403. if (false) {
  12404. if (this._debugID !== 0) {
  12405. ReactInstrumentation.debugTool.onBeginLifeCycleTimer(this._debugID, 'ctor');
  12406. }
  12407. }
  12408. instanceOrElement = new Component(publicProps, publicContext, ReactUpdateQueue);
  12409. if (false) {
  12410. if (this._debugID !== 0) {
  12411. ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'ctor');
  12412. }
  12413. }
  12414. } else {
  12415. // This can still be an instance in case of factory components
  12416. // but we'll count this as time spent rendering as the more common case.
  12417. if (false) {
  12418. if (this._debugID !== 0) {
  12419. ReactInstrumentation.debugTool.onBeginLifeCycleTimer(this._debugID, 'render');
  12420. }
  12421. }
  12422. instanceOrElement = Component(publicProps, publicContext, ReactUpdateQueue);
  12423. if (false) {
  12424. if (this._debugID !== 0) {
  12425. ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'render');
  12426. }
  12427. }
  12428. }
  12429. return instanceOrElement;
  12430. },
  12431. performInitialMountWithErrorHandling: function (renderedElement, nativeParent, nativeContainerInfo, transaction, context) {
  12432. var markup;
  12433. var checkpoint = transaction.checkpoint();
  12434. try {
  12435. markup = this.performInitialMount(renderedElement, nativeParent, nativeContainerInfo, transaction, context);
  12436. } catch (e) {
  12437. // Roll back to checkpoint, handle error (which may add items to the transaction), and take a new checkpoint
  12438. transaction.rollback(checkpoint);
  12439. this._instance.unstable_handleError(e);
  12440. if (this._pendingStateQueue) {
  12441. this._instance.state = this._processPendingState(this._instance.props, this._instance.context);
  12442. }
  12443. checkpoint = transaction.checkpoint();
  12444. this._renderedComponent.unmountComponent(true);
  12445. transaction.rollback(checkpoint);
  12446. // Try again - we've informed the component about the error, so they can render an error message this time.
  12447. // If this throws again, the error will bubble up (and can be caught by a higher error boundary).
  12448. markup = this.performInitialMount(renderedElement, nativeParent, nativeContainerInfo, transaction, context);
  12449. }
  12450. return markup;
  12451. },
  12452. performInitialMount: function (renderedElement, nativeParent, nativeContainerInfo, transaction, context) {
  12453. var inst = this._instance;
  12454. if (inst.componentWillMount) {
  12455. if (false) {
  12456. if (this._debugID !== 0) {
  12457. ReactInstrumentation.debugTool.onBeginLifeCycleTimer(this._debugID, 'componentWillMount');
  12458. }
  12459. }
  12460. inst.componentWillMount();
  12461. if (false) {
  12462. if (this._debugID !== 0) {
  12463. ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'componentWillMount');
  12464. }
  12465. }
  12466. // When mounting, calls to `setState` by `componentWillMount` will set
  12467. // `this._pendingStateQueue` without triggering a re-render.
  12468. if (this._pendingStateQueue) {
  12469. inst.state = this._processPendingState(inst.props, inst.context);
  12470. }
  12471. }
  12472. // If not a stateless component, we now render
  12473. if (renderedElement === undefined) {
  12474. renderedElement = this._renderValidatedComponent();
  12475. }
  12476. this._renderedNodeType = ReactNodeTypes.getType(renderedElement);
  12477. this._renderedComponent = this._instantiateReactComponent(renderedElement);
  12478. var markup = ReactReconciler.mountComponent(this._renderedComponent, transaction, nativeParent, nativeContainerInfo, this._processChildContext(context));
  12479. if (false) {
  12480. if (this._debugID !== 0) {
  12481. ReactInstrumentation.debugTool.onSetChildren(this._debugID, this._renderedComponent._debugID !== 0 ? [this._renderedComponent._debugID] : []);
  12482. }
  12483. }
  12484. return markup;
  12485. },
  12486. getNativeNode: function () {
  12487. return ReactReconciler.getNativeNode(this._renderedComponent);
  12488. },
  12489. /**
  12490. * Releases any resources allocated by `mountComponent`.
  12491. *
  12492. * @final
  12493. * @internal
  12494. */
  12495. unmountComponent: function (safely) {
  12496. if (!this._renderedComponent) {
  12497. return;
  12498. }
  12499. var inst = this._instance;
  12500. if (inst.componentWillUnmount && !inst._calledComponentWillUnmount) {
  12501. inst._calledComponentWillUnmount = true;
  12502. if (false) {
  12503. if (this._debugID !== 0) {
  12504. ReactInstrumentation.debugTool.onBeginLifeCycleTimer(this._debugID, 'componentWillUnmount');
  12505. }
  12506. }
  12507. if (safely) {
  12508. var name = this.getName() + '.componentWillUnmount()';
  12509. ReactErrorUtils.invokeGuardedCallback(name, inst.componentWillUnmount.bind(inst));
  12510. } else {
  12511. inst.componentWillUnmount();
  12512. }
  12513. if (false) {
  12514. if (this._debugID !== 0) {
  12515. ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'componentWillUnmount');
  12516. }
  12517. }
  12518. }
  12519. if (this._renderedComponent) {
  12520. ReactReconciler.unmountComponent(this._renderedComponent, safely);
  12521. this._renderedNodeType = null;
  12522. this._renderedComponent = null;
  12523. this._instance = null;
  12524. }
  12525. // Reset pending fields
  12526. // Even if this component is scheduled for another update in ReactUpdates,
  12527. // it would still be ignored because these fields are reset.
  12528. this._pendingStateQueue = null;
  12529. this._pendingReplaceState = false;
  12530. this._pendingForceUpdate = false;
  12531. this._pendingCallbacks = null;
  12532. this._pendingElement = null;
  12533. // These fields do not really need to be reset since this object is no
  12534. // longer accessible.
  12535. this._context = null;
  12536. this._rootNodeID = null;
  12537. this._topLevelWrapper = null;
  12538. // Delete the reference from the instance to this internal representation
  12539. // which allow the internals to be properly cleaned up even if the user
  12540. // leaks a reference to the public instance.
  12541. ReactInstanceMap.remove(inst);
  12542. // Some existing components rely on inst.props even after they've been
  12543. // destroyed (in event handlers).
  12544. // TODO: inst.props = null;
  12545. // TODO: inst.state = null;
  12546. // TODO: inst.context = null;
  12547. },
  12548. /**
  12549. * Filters the context object to only contain keys specified in
  12550. * `contextTypes`
  12551. *
  12552. * @param {object} context
  12553. * @return {?object}
  12554. * @private
  12555. */
  12556. _maskContext: function (context) {
  12557. var Component = this._currentElement.type;
  12558. var contextTypes = Component.contextTypes;
  12559. if (!contextTypes) {
  12560. return emptyObject;
  12561. }
  12562. var maskedContext = {};
  12563. for (var contextName in contextTypes) {
  12564. maskedContext[contextName] = context[contextName];
  12565. }
  12566. return maskedContext;
  12567. },
  12568. /**
  12569. * Filters the context object to only contain keys specified in
  12570. * `contextTypes`, and asserts that they are valid.
  12571. *
  12572. * @param {object} context
  12573. * @return {?object}
  12574. * @private
  12575. */
  12576. _processContext: function (context) {
  12577. var maskedContext = this._maskContext(context);
  12578. if (false) {
  12579. var Component = this._currentElement.type;
  12580. if (Component.contextTypes) {
  12581. this._checkPropTypes(Component.contextTypes, maskedContext, ReactPropTypeLocations.context);
  12582. }
  12583. }
  12584. return maskedContext;
  12585. },
  12586. /**
  12587. * @param {object} currentContext
  12588. * @return {object}
  12589. * @private
  12590. */
  12591. _processChildContext: function (currentContext) {
  12592. var Component = this._currentElement.type;
  12593. var inst = this._instance;
  12594. if (false) {
  12595. ReactInstrumentation.debugTool.onBeginProcessingChildContext();
  12596. }
  12597. var childContext = inst.getChildContext && inst.getChildContext();
  12598. if (false) {
  12599. ReactInstrumentation.debugTool.onEndProcessingChildContext();
  12600. }
  12601. if (childContext) {
  12602. !(typeof Component.childContextTypes === 'object') ? false ? invariant(false, '%s.getChildContext(): childContextTypes must be defined in order to ' + 'use getChildContext().', this.getName() || 'ReactCompositeComponent') : invariant(false) : void 0;
  12603. if (false) {
  12604. this._checkPropTypes(Component.childContextTypes, childContext, ReactPropTypeLocations.childContext);
  12605. }
  12606. for (var name in childContext) {
  12607. !(name in Component.childContextTypes) ? false ? invariant(false, '%s.getChildContext(): key "%s" is not defined in childContextTypes.', this.getName() || 'ReactCompositeComponent', name) : invariant(false) : void 0;
  12608. }
  12609. return _assign({}, currentContext, childContext);
  12610. }
  12611. return currentContext;
  12612. },
  12613. /**
  12614. * Processes props by setting default values for unspecified props and
  12615. * asserting that the props are valid. Does not mutate its argument; returns
  12616. * a new props object with defaults merged in.
  12617. *
  12618. * @param {object} newProps
  12619. * @return {object}
  12620. * @private
  12621. */
  12622. _processProps: function (newProps) {
  12623. if (false) {
  12624. var Component = this._currentElement.type;
  12625. if (Component.propTypes) {
  12626. this._checkPropTypes(Component.propTypes, newProps, ReactPropTypeLocations.prop);
  12627. }
  12628. }
  12629. return newProps;
  12630. },
  12631. /**
  12632. * Assert that the props are valid
  12633. *
  12634. * @param {object} propTypes Map of prop name to a ReactPropType
  12635. * @param {object} props
  12636. * @param {string} location e.g. "prop", "context", "child context"
  12637. * @private
  12638. */
  12639. _checkPropTypes: function (propTypes, props, location) {
  12640. // TODO: Stop validating prop types here and only use the element
  12641. // validation.
  12642. var componentName = this.getName();
  12643. for (var propName in propTypes) {
  12644. if (propTypes.hasOwnProperty(propName)) {
  12645. var error;
  12646. try {
  12647. // This is intentionally an invariant that gets caught. It's the same
  12648. // behavior as without this statement except with a better message.
  12649. !(typeof propTypes[propName] === 'function') ? false ? invariant(false, '%s: %s type `%s` is invalid; it must be a function, usually ' + 'from React.PropTypes.', componentName || 'React class', ReactPropTypeLocationNames[location], propName) : invariant(false) : void 0;
  12650. error = propTypes[propName](props, propName, componentName, location);
  12651. } catch (ex) {
  12652. error = ex;
  12653. }
  12654. if (error instanceof Error) {
  12655. // We may want to extend this logic for similar errors in
  12656. // top-level render calls, so I'm abstracting it away into
  12657. // a function to minimize refactoring in the future
  12658. var addendum = getDeclarationErrorAddendum(this);
  12659. if (location === ReactPropTypeLocations.prop) {
  12660. // Preface gives us something to blacklist in warning module
  12661. false ? warning(false, 'Failed Composite propType: %s%s', error.message, addendum) : void 0;
  12662. } else {
  12663. false ? warning(false, 'Failed Context Types: %s%s', error.message, addendum) : void 0;
  12664. }
  12665. }
  12666. }
  12667. }
  12668. },
  12669. receiveComponent: function (nextElement, transaction, nextContext) {
  12670. var prevElement = this._currentElement;
  12671. var prevContext = this._context;
  12672. this._pendingElement = null;
  12673. this.updateComponent(transaction, prevElement, nextElement, prevContext, nextContext);
  12674. },
  12675. /**
  12676. * If any of `_pendingElement`, `_pendingStateQueue`, or `_pendingForceUpdate`
  12677. * is set, update the component.
  12678. *
  12679. * @param {ReactReconcileTransaction} transaction
  12680. * @internal
  12681. */
  12682. performUpdateIfNecessary: function (transaction) {
  12683. if (this._pendingElement != null) {
  12684. ReactReconciler.receiveComponent(this, this._pendingElement, transaction, this._context);
  12685. } else if (this._pendingStateQueue !== null || this._pendingForceUpdate) {
  12686. this.updateComponent(transaction, this._currentElement, this._currentElement, this._context, this._context);
  12687. } else {
  12688. this._updateBatchNumber = null;
  12689. }
  12690. },
  12691. /**
  12692. * Perform an update to a mounted component. The componentWillReceiveProps and
  12693. * shouldComponentUpdate methods are called, then (assuming the update isn't
  12694. * skipped) the remaining update lifecycle methods are called and the DOM
  12695. * representation is updated.
  12696. *
  12697. * By default, this implements React's rendering and reconciliation algorithm.
  12698. * Sophisticated clients may wish to override this.
  12699. *
  12700. * @param {ReactReconcileTransaction} transaction
  12701. * @param {ReactElement} prevParentElement
  12702. * @param {ReactElement} nextParentElement
  12703. * @internal
  12704. * @overridable
  12705. */
  12706. updateComponent: function (transaction, prevParentElement, nextParentElement, prevUnmaskedContext, nextUnmaskedContext) {
  12707. var inst = this._instance;
  12708. var willReceive = false;
  12709. var nextContext;
  12710. var nextProps;
  12711. // Determine if the context has changed or not
  12712. if (this._context === nextUnmaskedContext) {
  12713. nextContext = inst.context;
  12714. } else {
  12715. nextContext = this._processContext(nextUnmaskedContext);
  12716. willReceive = true;
  12717. }
  12718. // Distinguish between a props update versus a simple state update
  12719. if (prevParentElement === nextParentElement) {
  12720. // Skip checking prop types again -- we don't read inst.props to avoid
  12721. // warning for DOM component props in this upgrade
  12722. nextProps = nextParentElement.props;
  12723. } else {
  12724. nextProps = this._processProps(nextParentElement.props);
  12725. willReceive = true;
  12726. }
  12727. // An update here will schedule an update but immediately set
  12728. // _pendingStateQueue which will ensure that any state updates gets
  12729. // immediately reconciled instead of waiting for the next batch.
  12730. if (willReceive && inst.componentWillReceiveProps) {
  12731. if (false) {
  12732. if (this._debugID !== 0) {
  12733. ReactInstrumentation.debugTool.onBeginLifeCycleTimer(this._debugID, 'componentWillReceiveProps');
  12734. }
  12735. }
  12736. inst.componentWillReceiveProps(nextProps, nextContext);
  12737. if (false) {
  12738. if (this._debugID !== 0) {
  12739. ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'componentWillReceiveProps');
  12740. }
  12741. }
  12742. }
  12743. var nextState = this._processPendingState(nextProps, nextContext);
  12744. var shouldUpdate = true;
  12745. if (!this._pendingForceUpdate && inst.shouldComponentUpdate) {
  12746. if (false) {
  12747. if (this._debugID !== 0) {
  12748. ReactInstrumentation.debugTool.onBeginLifeCycleTimer(this._debugID, 'shouldComponentUpdate');
  12749. }
  12750. }
  12751. shouldUpdate = inst.shouldComponentUpdate(nextProps, nextState, nextContext);
  12752. if (false) {
  12753. if (this._debugID !== 0) {
  12754. ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'shouldComponentUpdate');
  12755. }
  12756. }
  12757. }
  12758. if (false) {
  12759. process.env.NODE_ENV !== 'production' ? warning(shouldUpdate !== undefined, '%s.shouldComponentUpdate(): Returned undefined instead of a ' + 'boolean value. Make sure to return true or false.', this.getName() || 'ReactCompositeComponent') : void 0;
  12760. }
  12761. this._updateBatchNumber = null;
  12762. if (shouldUpdate) {
  12763. this._pendingForceUpdate = false;
  12764. // Will set `this.props`, `this.state` and `this.context`.
  12765. this._performComponentUpdate(nextParentElement, nextProps, nextState, nextContext, transaction, nextUnmaskedContext);
  12766. } else {
  12767. // If it's determined that a component should not update, we still want
  12768. // to set props and state but we shortcut the rest of the update.
  12769. this._currentElement = nextParentElement;
  12770. this._context = nextUnmaskedContext;
  12771. inst.props = nextProps;
  12772. inst.state = nextState;
  12773. inst.context = nextContext;
  12774. }
  12775. },
  12776. _processPendingState: function (props, context) {
  12777. var inst = this._instance;
  12778. var queue = this._pendingStateQueue;
  12779. var replace = this._pendingReplaceState;
  12780. this._pendingReplaceState = false;
  12781. this._pendingStateQueue = null;
  12782. if (!queue) {
  12783. return inst.state;
  12784. }
  12785. if (replace && queue.length === 1) {
  12786. return queue[0];
  12787. }
  12788. var nextState = _assign({}, replace ? queue[0] : inst.state);
  12789. for (var i = replace ? 1 : 0; i < queue.length; i++) {
  12790. var partial = queue[i];
  12791. _assign(nextState, typeof partial === 'function' ? partial.call(inst, nextState, props, context) : partial);
  12792. }
  12793. return nextState;
  12794. },
  12795. /**
  12796. * Merges new props and state, notifies delegate methods of update and
  12797. * performs update.
  12798. *
  12799. * @param {ReactElement} nextElement Next element
  12800. * @param {object} nextProps Next public object to set as properties.
  12801. * @param {?object} nextState Next object to set as state.
  12802. * @param {?object} nextContext Next public object to set as context.
  12803. * @param {ReactReconcileTransaction} transaction
  12804. * @param {?object} unmaskedContext
  12805. * @private
  12806. */
  12807. _performComponentUpdate: function (nextElement, nextProps, nextState, nextContext, transaction, unmaskedContext) {
  12808. var inst = this._instance;
  12809. var hasComponentDidUpdate = Boolean(inst.componentDidUpdate);
  12810. var prevProps;
  12811. var prevState;
  12812. var prevContext;
  12813. if (hasComponentDidUpdate) {
  12814. prevProps = inst.props;
  12815. prevState = inst.state;
  12816. prevContext = inst.context;
  12817. }
  12818. if (inst.componentWillUpdate) {
  12819. if (false) {
  12820. if (this._debugID !== 0) {
  12821. ReactInstrumentation.debugTool.onBeginLifeCycleTimer(this._debugID, 'componentWillUpdate');
  12822. }
  12823. }
  12824. inst.componentWillUpdate(nextProps, nextState, nextContext);
  12825. if (false) {
  12826. if (this._debugID !== 0) {
  12827. ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'componentWillUpdate');
  12828. }
  12829. }
  12830. }
  12831. this._currentElement = nextElement;
  12832. this._context = unmaskedContext;
  12833. inst.props = nextProps;
  12834. inst.state = nextState;
  12835. inst.context = nextContext;
  12836. this._updateRenderedComponent(transaction, unmaskedContext);
  12837. if (hasComponentDidUpdate) {
  12838. if (false) {
  12839. transaction.getReactMountReady().enqueue(invokeComponentDidUpdateWithTimer.bind(this, prevProps, prevState, prevContext), this);
  12840. } else {
  12841. transaction.getReactMountReady().enqueue(inst.componentDidUpdate.bind(inst, prevProps, prevState, prevContext), inst);
  12842. }
  12843. }
  12844. },
  12845. /**
  12846. * Call the component's `render` method and update the DOM accordingly.
  12847. *
  12848. * @param {ReactReconcileTransaction} transaction
  12849. * @internal
  12850. */
  12851. _updateRenderedComponent: function (transaction, context) {
  12852. var prevComponentInstance = this._renderedComponent;
  12853. var prevRenderedElement = prevComponentInstance._currentElement;
  12854. var nextRenderedElement = this._renderValidatedComponent();
  12855. if (shouldUpdateReactComponent(prevRenderedElement, nextRenderedElement)) {
  12856. ReactReconciler.receiveComponent(prevComponentInstance, nextRenderedElement, transaction, this._processChildContext(context));
  12857. } else {
  12858. var oldNativeNode = ReactReconciler.getNativeNode(prevComponentInstance);
  12859. ReactReconciler.unmountComponent(prevComponentInstance, false);
  12860. this._renderedNodeType = ReactNodeTypes.getType(nextRenderedElement);
  12861. this._renderedComponent = this._instantiateReactComponent(nextRenderedElement);
  12862. var nextMarkup = ReactReconciler.mountComponent(this._renderedComponent, transaction, this._nativeParent, this._nativeContainerInfo, this._processChildContext(context));
  12863. if (false) {
  12864. if (this._debugID !== 0) {
  12865. ReactInstrumentation.debugTool.onSetChildren(this._debugID, this._renderedComponent._debugID !== 0 ? [this._renderedComponent._debugID] : []);
  12866. }
  12867. }
  12868. this._replaceNodeWithMarkup(oldNativeNode, nextMarkup, prevComponentInstance);
  12869. }
  12870. },
  12871. /**
  12872. * Overridden in shallow rendering.
  12873. *
  12874. * @protected
  12875. */
  12876. _replaceNodeWithMarkup: function (oldNativeNode, nextMarkup, prevInstance) {
  12877. ReactComponentEnvironment.replaceNodeWithMarkup(oldNativeNode, nextMarkup, prevInstance);
  12878. },
  12879. /**
  12880. * @protected
  12881. */
  12882. _renderValidatedComponentWithoutOwnerOrContext: function () {
  12883. var inst = this._instance;
  12884. if (false) {
  12885. if (this._debugID !== 0) {
  12886. ReactInstrumentation.debugTool.onBeginLifeCycleTimer(this._debugID, 'render');
  12887. }
  12888. }
  12889. var renderedComponent = inst.render();
  12890. if (false) {
  12891. if (this._debugID !== 0) {
  12892. ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'render');
  12893. }
  12894. }
  12895. if (false) {
  12896. // We allow auto-mocks to proceed as if they're returning null.
  12897. if (renderedComponent === undefined && inst.render._isMockFunction) {
  12898. // This is probably bad practice. Consider warning here and
  12899. // deprecating this convenience.
  12900. renderedComponent = null;
  12901. }
  12902. }
  12903. return renderedComponent;
  12904. },
  12905. /**
  12906. * @private
  12907. */
  12908. _renderValidatedComponent: function () {
  12909. var renderedComponent;
  12910. ReactCurrentOwner.current = this;
  12911. try {
  12912. renderedComponent = this._renderValidatedComponentWithoutOwnerOrContext();
  12913. } finally {
  12914. ReactCurrentOwner.current = null;
  12915. }
  12916. !(
  12917. // TODO: An `isValidNode` function would probably be more appropriate
  12918. renderedComponent === null || renderedComponent === false || ReactElement.isValidElement(renderedComponent)) ? false ? invariant(false, '%s.render(): A valid React element (or null) must be returned. You may have ' + 'returned undefined, an array or some other invalid object.', this.getName() || 'ReactCompositeComponent') : invariant(false) : void 0;
  12919. return renderedComponent;
  12920. },
  12921. /**
  12922. * Lazily allocates the refs object and stores `component` as `ref`.
  12923. *
  12924. * @param {string} ref Reference name.
  12925. * @param {component} component Component to store as `ref`.
  12926. * @final
  12927. * @private
  12928. */
  12929. attachRef: function (ref, component) {
  12930. var inst = this.getPublicInstance();
  12931. !(inst != null) ? false ? invariant(false, 'Stateless function components cannot have refs.') : invariant(false) : void 0;
  12932. var publicComponentInstance = component.getPublicInstance();
  12933. if (false) {
  12934. var componentName = component && component.getName ? component.getName() : 'a component';
  12935. process.env.NODE_ENV !== 'production' ? warning(publicComponentInstance != null, 'Stateless function components cannot be given refs ' + '(See ref "%s" in %s created by %s). ' + 'Attempts to access this ref will fail.', ref, componentName, this.getName()) : void 0;
  12936. }
  12937. var refs = inst.refs === emptyObject ? inst.refs = {} : inst.refs;
  12938. refs[ref] = publicComponentInstance;
  12939. },
  12940. /**
  12941. * Detaches a reference name.
  12942. *
  12943. * @param {string} ref Name to dereference.
  12944. * @final
  12945. * @private
  12946. */
  12947. detachRef: function (ref) {
  12948. var refs = this.getPublicInstance().refs;
  12949. delete refs[ref];
  12950. },
  12951. /**
  12952. * Get a text description of the component that can be used to identify it
  12953. * in error messages.
  12954. * @return {string} The name or null.
  12955. * @internal
  12956. */
  12957. getName: function () {
  12958. var type = this._currentElement.type;
  12959. var constructor = this._instance && this._instance.constructor;
  12960. return type.displayName || constructor && constructor.displayName || type.name || constructor && constructor.name || null;
  12961. },
  12962. /**
  12963. * Get the publicly accessible representation of this component - i.e. what
  12964. * is exposed by refs and returned by render. Can be null for stateless
  12965. * components.
  12966. *
  12967. * @return {ReactComponent} the public component instance.
  12968. * @internal
  12969. */
  12970. getPublicInstance: function () {
  12971. var inst = this._instance;
  12972. if (inst instanceof StatelessComponent) {
  12973. return null;
  12974. }
  12975. return inst;
  12976. },
  12977. // Stub
  12978. _instantiateReactComponent: null
  12979. };
  12980. var ReactCompositeComponent = {
  12981. Mixin: ReactCompositeComponentMixin
  12982. };
  12983. module.exports = ReactCompositeComponent;
  12984. /***/ },
  12985. /* 117 */
  12986. /***/ function(module, exports) {
  12987. /**
  12988. * Copyright 2013-present, Facebook, Inc.
  12989. * All rights reserved.
  12990. *
  12991. * This source code is licensed under the BSD-style license found in the
  12992. * LICENSE file in the root directory of this source tree. An additional grant
  12993. * of patent rights can be found in the PATENTS file in the same directory.
  12994. *
  12995. * @providesModule ReactInstanceMap
  12996. */
  12997. 'use strict';
  12998. /**
  12999. * `ReactInstanceMap` maintains a mapping from a public facing stateful
  13000. * instance (key) and the internal representation (value). This allows public
  13001. * methods to accept the user facing instance as an argument and map them back
  13002. * to internal methods.
  13003. */
  13004. // TODO: Replace this with ES6: var ReactInstanceMap = new Map();
  13005. var ReactInstanceMap = {
  13006. /**
  13007. * This API should be called `delete` but we'd have to make sure to always
  13008. * transform these to strings for IE support. When this transform is fully
  13009. * supported we can rename it.
  13010. */
  13011. remove: function (key) {
  13012. key._reactInternalInstance = undefined;
  13013. },
  13014. get: function (key) {
  13015. return key._reactInternalInstance;
  13016. },
  13017. has: function (key) {
  13018. return key._reactInternalInstance !== undefined;
  13019. },
  13020. set: function (key, value) {
  13021. key._reactInternalInstance = value;
  13022. }
  13023. };
  13024. module.exports = ReactInstanceMap;
  13025. /***/ },
  13026. /* 118 */
  13027. /***/ function(module, exports, __webpack_require__) {
  13028. /**
  13029. * Copyright 2013-present, Facebook, Inc.
  13030. * All rights reserved.
  13031. *
  13032. * This source code is licensed under the BSD-style license found in the
  13033. * LICENSE file in the root directory of this source tree. An additional grant
  13034. * of patent rights can be found in the PATENTS file in the same directory.
  13035. *
  13036. * @providesModule ReactNodeTypes
  13037. */
  13038. 'use strict';
  13039. var ReactElement = __webpack_require__(7);
  13040. var invariant = __webpack_require__(6);
  13041. var ReactNodeTypes = {
  13042. NATIVE: 0,
  13043. COMPOSITE: 1,
  13044. EMPTY: 2,
  13045. getType: function (node) {
  13046. if (node === null || node === false) {
  13047. return ReactNodeTypes.EMPTY;
  13048. } else if (ReactElement.isValidElement(node)) {
  13049. if (typeof node.type === 'function') {
  13050. return ReactNodeTypes.COMPOSITE;
  13051. } else {
  13052. return ReactNodeTypes.NATIVE;
  13053. }
  13054. }
  13055. true ? false ? invariant(false, 'Unexpected node: %s', node) : invariant(false) : void 0;
  13056. }
  13057. };
  13058. module.exports = ReactNodeTypes;
  13059. /***/ },
  13060. /* 119 */
  13061. /***/ function(module, exports, __webpack_require__) {
  13062. /**
  13063. * Copyright 2015-present, Facebook, Inc.
  13064. * All rights reserved.
  13065. *
  13066. * This source code is licensed under the BSD-style license found in the
  13067. * LICENSE file in the root directory of this source tree. An additional grant
  13068. * of patent rights can be found in the PATENTS file in the same directory.
  13069. *
  13070. * @providesModule ReactUpdateQueue
  13071. */
  13072. 'use strict';
  13073. var ReactCurrentOwner = __webpack_require__(8);
  13074. var ReactInstanceMap = __webpack_require__(117);
  13075. var ReactUpdates = __webpack_require__(55);
  13076. var invariant = __webpack_require__(6);
  13077. var warning = __webpack_require__(9);
  13078. function enqueueUpdate(internalInstance) {
  13079. ReactUpdates.enqueueUpdate(internalInstance);
  13080. }
  13081. function formatUnexpectedArgument(arg) {
  13082. var type = typeof arg;
  13083. if (type !== 'object') {
  13084. return type;
  13085. }
  13086. var displayName = arg.constructor && arg.constructor.name || type;
  13087. var keys = Object.keys(arg);
  13088. if (keys.length > 0 && keys.length < 20) {
  13089. return displayName + ' (keys: ' + keys.join(', ') + ')';
  13090. }
  13091. return displayName;
  13092. }
  13093. function getInternalInstanceReadyForUpdate(publicInstance, callerName) {
  13094. var internalInstance = ReactInstanceMap.get(publicInstance);
  13095. if (!internalInstance) {
  13096. if (false) {
  13097. // Only warn when we have a callerName. Otherwise we should be silent.
  13098. // We're probably calling from enqueueCallback. We don't want to warn
  13099. // there because we already warned for the corresponding lifecycle method.
  13100. process.env.NODE_ENV !== 'production' ? warning(!callerName, '%s(...): Can only update a mounted or mounting component. ' + 'This usually means you called %s() on an unmounted component. ' + 'This is a no-op. Please check the code for the %s component.', callerName, callerName, publicInstance.constructor.displayName) : void 0;
  13101. }
  13102. return null;
  13103. }
  13104. if (false) {
  13105. process.env.NODE_ENV !== 'production' ? warning(ReactCurrentOwner.current == null, '%s(...): Cannot update during an existing state transition (such as ' + 'within `render` or another component\'s constructor). Render methods ' + 'should be a pure function of props and state; constructor ' + 'side-effects are an anti-pattern, but can be moved to ' + '`componentWillMount`.', callerName) : void 0;
  13106. }
  13107. return internalInstance;
  13108. }
  13109. /**
  13110. * ReactUpdateQueue allows for state updates to be scheduled into a later
  13111. * reconciliation step.
  13112. */
  13113. var ReactUpdateQueue = {
  13114. /**
  13115. * Checks whether or not this composite component is mounted.
  13116. * @param {ReactClass} publicInstance The instance we want to test.
  13117. * @return {boolean} True if mounted, false otherwise.
  13118. * @protected
  13119. * @final
  13120. */
  13121. isMounted: function (publicInstance) {
  13122. if (false) {
  13123. var owner = ReactCurrentOwner.current;
  13124. if (owner !== null) {
  13125. process.env.NODE_ENV !== 'production' ? warning(owner._warnedAboutRefsInRender, '%s is accessing isMounted inside its render() function. ' + 'render() should be a pure function of props and state. It should ' + 'never access something that requires stale data from the previous ' + 'render, such as refs. Move this logic to componentDidMount and ' + 'componentDidUpdate instead.', owner.getName() || 'A component') : void 0;
  13126. owner._warnedAboutRefsInRender = true;
  13127. }
  13128. }
  13129. var internalInstance = ReactInstanceMap.get(publicInstance);
  13130. if (internalInstance) {
  13131. // During componentWillMount and render this will still be null but after
  13132. // that will always render to something. At least for now. So we can use
  13133. // this hack.
  13134. return !!internalInstance._renderedComponent;
  13135. } else {
  13136. return false;
  13137. }
  13138. },
  13139. /**
  13140. * Enqueue a callback that will be executed after all the pending updates
  13141. * have processed.
  13142. *
  13143. * @param {ReactClass} publicInstance The instance to use as `this` context.
  13144. * @param {?function} callback Called after state is updated.
  13145. * @param {string} callerName Name of the calling function in the public API.
  13146. * @internal
  13147. */
  13148. enqueueCallback: function (publicInstance, callback, callerName) {
  13149. ReactUpdateQueue.validateCallback(callback, callerName);
  13150. var internalInstance = getInternalInstanceReadyForUpdate(publicInstance);
  13151. // Previously we would throw an error if we didn't have an internal
  13152. // instance. Since we want to make it a no-op instead, we mirror the same
  13153. // behavior we have in other enqueue* methods.
  13154. // We also need to ignore callbacks in componentWillMount. See
  13155. // enqueueUpdates.
  13156. if (!internalInstance) {
  13157. return null;
  13158. }
  13159. if (internalInstance._pendingCallbacks) {
  13160. internalInstance._pendingCallbacks.push(callback);
  13161. } else {
  13162. internalInstance._pendingCallbacks = [callback];
  13163. }
  13164. // TODO: The callback here is ignored when setState is called from
  13165. // componentWillMount. Either fix it or disallow doing so completely in
  13166. // favor of getInitialState. Alternatively, we can disallow
  13167. // componentWillMount during server-side rendering.
  13168. enqueueUpdate(internalInstance);
  13169. },
  13170. enqueueCallbackInternal: function (internalInstance, callback) {
  13171. if (internalInstance._pendingCallbacks) {
  13172. internalInstance._pendingCallbacks.push(callback);
  13173. } else {
  13174. internalInstance._pendingCallbacks = [callback];
  13175. }
  13176. enqueueUpdate(internalInstance);
  13177. },
  13178. /**
  13179. * Forces an update. This should only be invoked when it is known with
  13180. * certainty that we are **not** in a DOM transaction.
  13181. *
  13182. * You may want to call this when you know that some deeper aspect of the
  13183. * component's state has changed but `setState` was not called.
  13184. *
  13185. * This will not invoke `shouldComponentUpdate`, but it will invoke
  13186. * `componentWillUpdate` and `componentDidUpdate`.
  13187. *
  13188. * @param {ReactClass} publicInstance The instance that should rerender.
  13189. * @internal
  13190. */
  13191. enqueueForceUpdate: function (publicInstance) {
  13192. var internalInstance = getInternalInstanceReadyForUpdate(publicInstance, 'forceUpdate');
  13193. if (!internalInstance) {
  13194. return;
  13195. }
  13196. internalInstance._pendingForceUpdate = true;
  13197. enqueueUpdate(internalInstance);
  13198. },
  13199. /**
  13200. * Replaces all of the state. Always use this or `setState` to mutate state.
  13201. * You should treat `this.state` as immutable.
  13202. *
  13203. * There is no guarantee that `this.state` will be immediately updated, so
  13204. * accessing `this.state` after calling this method may return the old value.
  13205. *
  13206. * @param {ReactClass} publicInstance The instance that should rerender.
  13207. * @param {object} completeState Next state.
  13208. * @internal
  13209. */
  13210. enqueueReplaceState: function (publicInstance, completeState) {
  13211. var internalInstance = getInternalInstanceReadyForUpdate(publicInstance, 'replaceState');
  13212. if (!internalInstance) {
  13213. return;
  13214. }
  13215. internalInstance._pendingStateQueue = [completeState];
  13216. internalInstance._pendingReplaceState = true;
  13217. enqueueUpdate(internalInstance);
  13218. },
  13219. /**
  13220. * Sets a subset of the state. This only exists because _pendingState is
  13221. * internal. This provides a merging strategy that is not available to deep
  13222. * properties which is confusing. TODO: Expose pendingState or don't use it
  13223. * during the merge.
  13224. *
  13225. * @param {ReactClass} publicInstance The instance that should rerender.
  13226. * @param {object} partialState Next partial state to be merged with state.
  13227. * @internal
  13228. */
  13229. enqueueSetState: function (publicInstance, partialState) {
  13230. var internalInstance = getInternalInstanceReadyForUpdate(publicInstance, 'setState');
  13231. if (!internalInstance) {
  13232. return;
  13233. }
  13234. var queue = internalInstance._pendingStateQueue || (internalInstance._pendingStateQueue = []);
  13235. queue.push(partialState);
  13236. enqueueUpdate(internalInstance);
  13237. },
  13238. enqueueElementInternal: function (internalInstance, newElement) {
  13239. internalInstance._pendingElement = newElement;
  13240. enqueueUpdate(internalInstance);
  13241. },
  13242. validateCallback: function (callback, callerName) {
  13243. !(!callback || typeof callback === 'function') ? false ? invariant(false, '%s(...): Expected the last optional `callback` argument to be a ' + 'function. Instead received: %s.', callerName, formatUnexpectedArgument(callback)) : invariant(false) : void 0;
  13244. }
  13245. };
  13246. module.exports = ReactUpdateQueue;
  13247. /***/ },
  13248. /* 120 */
  13249. /***/ function(module, exports) {
  13250. /**
  13251. * Copyright 2013-present, Facebook, Inc.
  13252. * All rights reserved.
  13253. *
  13254. * This source code is licensed under the BSD-style license found in the
  13255. * LICENSE file in the root directory of this source tree. An additional grant
  13256. * of patent rights can be found in the PATENTS file in the same directory.
  13257. *
  13258. * @providesModule shouldUpdateReactComponent
  13259. */
  13260. 'use strict';
  13261. /**
  13262. * Given a `prevElement` and `nextElement`, determines if the existing
  13263. * instance should be updated as opposed to being destroyed or replaced by a new
  13264. * instance. Both arguments are elements. This ensures that this logic can
  13265. * operate on stateless trees without any backing instance.
  13266. *
  13267. * @param {?object} prevElement
  13268. * @param {?object} nextElement
  13269. * @return {boolean} True if the existing instance should be updated.
  13270. * @protected
  13271. */
  13272. function shouldUpdateReactComponent(prevElement, nextElement) {
  13273. var prevEmpty = prevElement === null || prevElement === false;
  13274. var nextEmpty = nextElement === null || nextElement === false;
  13275. if (prevEmpty || nextEmpty) {
  13276. return prevEmpty === nextEmpty;
  13277. }
  13278. var prevType = typeof prevElement;
  13279. var nextType = typeof nextElement;
  13280. if (prevType === 'string' || prevType === 'number') {
  13281. return nextType === 'string' || nextType === 'number';
  13282. } else {
  13283. return nextType === 'object' && prevElement.type === nextElement.type && prevElement.key === nextElement.key;
  13284. }
  13285. }
  13286. module.exports = shouldUpdateReactComponent;
  13287. /***/ },
  13288. /* 121 */
  13289. /***/ function(module, exports) {
  13290. /**
  13291. * Copyright 2014-present, Facebook, Inc.
  13292. * All rights reserved.
  13293. *
  13294. * This source code is licensed under the BSD-style license found in the
  13295. * LICENSE file in the root directory of this source tree. An additional grant
  13296. * of patent rights can be found in the PATENTS file in the same directory.
  13297. *
  13298. * @providesModule ReactEmptyComponent
  13299. */
  13300. 'use strict';
  13301. var emptyComponentFactory;
  13302. var ReactEmptyComponentInjection = {
  13303. injectEmptyComponentFactory: function (factory) {
  13304. emptyComponentFactory = factory;
  13305. }
  13306. };
  13307. var ReactEmptyComponent = {
  13308. create: function (instantiate) {
  13309. return emptyComponentFactory(instantiate);
  13310. }
  13311. };
  13312. ReactEmptyComponent.injection = ReactEmptyComponentInjection;
  13313. module.exports = ReactEmptyComponent;
  13314. /***/ },
  13315. /* 122 */
  13316. /***/ function(module, exports, __webpack_require__) {
  13317. /**
  13318. * Copyright 2014-present, Facebook, Inc.
  13319. * All rights reserved.
  13320. *
  13321. * This source code is licensed under the BSD-style license found in the
  13322. * LICENSE file in the root directory of this source tree. An additional grant
  13323. * of patent rights can be found in the PATENTS file in the same directory.
  13324. *
  13325. * @providesModule ReactNativeComponent
  13326. */
  13327. 'use strict';
  13328. var _assign = __webpack_require__(3);
  13329. var invariant = __webpack_require__(6);
  13330. var autoGenerateWrapperClass = null;
  13331. var genericComponentClass = null;
  13332. // This registry keeps track of wrapper classes around native tags.
  13333. var tagToComponentClass = {};
  13334. var textComponentClass = null;
  13335. var ReactNativeComponentInjection = {
  13336. // This accepts a class that receives the tag string. This is a catch all
  13337. // that can render any kind of tag.
  13338. injectGenericComponentClass: function (componentClass) {
  13339. genericComponentClass = componentClass;
  13340. },
  13341. // This accepts a text component class that takes the text string to be
  13342. // rendered as props.
  13343. injectTextComponentClass: function (componentClass) {
  13344. textComponentClass = componentClass;
  13345. },
  13346. // This accepts a keyed object with classes as values. Each key represents a
  13347. // tag. That particular tag will use this class instead of the generic one.
  13348. injectComponentClasses: function (componentClasses) {
  13349. _assign(tagToComponentClass, componentClasses);
  13350. }
  13351. };
  13352. /**
  13353. * Get a composite component wrapper class for a specific tag.
  13354. *
  13355. * @param {ReactElement} element The tag for which to get the class.
  13356. * @return {function} The React class constructor function.
  13357. */
  13358. function getComponentClassForElement(element) {
  13359. if (typeof element.type === 'function') {
  13360. return element.type;
  13361. }
  13362. var tag = element.type;
  13363. var componentClass = tagToComponentClass[tag];
  13364. if (componentClass == null) {
  13365. tagToComponentClass[tag] = componentClass = autoGenerateWrapperClass(tag);
  13366. }
  13367. return componentClass;
  13368. }
  13369. /**
  13370. * Get a native internal component class for a specific tag.
  13371. *
  13372. * @param {ReactElement} element The element to create.
  13373. * @return {function} The internal class constructor function.
  13374. */
  13375. function createInternalComponent(element) {
  13376. !genericComponentClass ? false ? invariant(false, 'There is no registered component for the tag %s', element.type) : invariant(false) : void 0;
  13377. return new genericComponentClass(element);
  13378. }
  13379. /**
  13380. * @param {ReactText} text
  13381. * @return {ReactComponent}
  13382. */
  13383. function createInstanceForText(text) {
  13384. return new textComponentClass(text);
  13385. }
  13386. /**
  13387. * @param {ReactComponent} component
  13388. * @return {boolean}
  13389. */
  13390. function isTextComponent(component) {
  13391. return component instanceof textComponentClass;
  13392. }
  13393. var ReactNativeComponent = {
  13394. getComponentClassForElement: getComponentClassForElement,
  13395. createInternalComponent: createInternalComponent,
  13396. createInstanceForText: createInstanceForText,
  13397. isTextComponent: isTextComponent,
  13398. injection: ReactNativeComponentInjection
  13399. };
  13400. module.exports = ReactNativeComponent;
  13401. /***/ },
  13402. /* 123 */
  13403. /***/ function(module, exports, __webpack_require__) {
  13404. /**
  13405. * Copyright 2013-present, Facebook, Inc.
  13406. * All rights reserved.
  13407. *
  13408. * This source code is licensed under the BSD-style license found in the
  13409. * LICENSE file in the root directory of this source tree. An additional grant
  13410. * of patent rights can be found in the PATENTS file in the same directory.
  13411. *
  13412. * @providesModule flattenChildren
  13413. */
  13414. 'use strict';
  13415. var KeyEscapeUtils = __webpack_require__(14);
  13416. var traverseAllChildren = __webpack_require__(12);
  13417. var warning = __webpack_require__(9);
  13418. /**
  13419. * @param {function} traverseContext Context passed through traversal.
  13420. * @param {?ReactComponent} child React child component.
  13421. * @param {!string} name String name of key path to child.
  13422. */
  13423. function flattenSingleChildIntoContext(traverseContext, child, name) {
  13424. // We found a component instance.
  13425. var result = traverseContext;
  13426. var keyUnique = result[name] === undefined;
  13427. if (false) {
  13428. process.env.NODE_ENV !== 'production' ? warning(keyUnique, 'flattenChildren(...): Encountered two children with the same key, ' + '`%s`. Child keys must be unique; when two children share a key, only ' + 'the first child will be used.', KeyEscapeUtils.unescape(name)) : void 0;
  13429. }
  13430. if (keyUnique && child != null) {
  13431. result[name] = child;
  13432. }
  13433. }
  13434. /**
  13435. * Flattens children that are typically specified as `props.children`. Any null
  13436. * children will not be included in the resulting object.
  13437. * @return {!object} flattened children keyed by name.
  13438. */
  13439. function flattenChildren(children) {
  13440. if (children == null) {
  13441. return children;
  13442. }
  13443. var result = {};
  13444. traverseAllChildren(children, flattenSingleChildIntoContext, result);
  13445. return result;
  13446. }
  13447. module.exports = flattenChildren;
  13448. /***/ },
  13449. /* 124 */
  13450. /***/ function(module, exports, __webpack_require__) {
  13451. /**
  13452. * Copyright 2014-present, Facebook, Inc.
  13453. * All rights reserved.
  13454. *
  13455. * This source code is licensed under the BSD-style license found in the
  13456. * LICENSE file in the root directory of this source tree. An additional grant
  13457. * of patent rights can be found in the PATENTS file in the same directory.
  13458. *
  13459. * @providesModule ReactServerRenderingTransaction
  13460. */
  13461. 'use strict';
  13462. var _assign = __webpack_require__(3);
  13463. var PooledClass = __webpack_require__(5);
  13464. var Transaction = __webpack_require__(61);
  13465. /**
  13466. * Executed within the scope of the `Transaction` instance. Consider these as
  13467. * being member methods, but with an implied ordering while being isolated from
  13468. * each other.
  13469. */
  13470. var TRANSACTION_WRAPPERS = [];
  13471. var noopCallbackQueue = {
  13472. enqueue: function () {}
  13473. };
  13474. /**
  13475. * @class ReactServerRenderingTransaction
  13476. * @param {boolean} renderToStaticMarkup
  13477. */
  13478. function ReactServerRenderingTransaction(renderToStaticMarkup) {
  13479. this.reinitializeTransaction();
  13480. this.renderToStaticMarkup = renderToStaticMarkup;
  13481. this.useCreateElement = false;
  13482. }
  13483. var Mixin = {
  13484. /**
  13485. * @see Transaction
  13486. * @abstract
  13487. * @final
  13488. * @return {array} Empty list of operation wrap procedures.
  13489. */
  13490. getTransactionWrappers: function () {
  13491. return TRANSACTION_WRAPPERS;
  13492. },
  13493. /**
  13494. * @return {object} The queue to collect `onDOMReady` callbacks with.
  13495. */
  13496. getReactMountReady: function () {
  13497. return noopCallbackQueue;
  13498. },
  13499. /**
  13500. * `PooledClass` looks for this, and will invoke this before allowing this
  13501. * instance to be reused.
  13502. */
  13503. destructor: function () {},
  13504. checkpoint: function () {},
  13505. rollback: function () {}
  13506. };
  13507. _assign(ReactServerRenderingTransaction.prototype, Transaction.Mixin, Mixin);
  13508. PooledClass.addPoolingTo(ReactServerRenderingTransaction);
  13509. module.exports = ReactServerRenderingTransaction;
  13510. /***/ },
  13511. /* 125 */
  13512. /***/ function(module, exports) {
  13513. /**
  13514. * Copyright (c) 2013-present, Facebook, Inc.
  13515. * All rights reserved.
  13516. *
  13517. * This source code is licensed under the BSD-style license found in the
  13518. * LICENSE file in the root directory of this source tree. An additional grant
  13519. * of patent rights can be found in the PATENTS file in the same directory.
  13520. *
  13521. * @typechecks
  13522. *
  13523. */
  13524. /*eslint-disable no-self-compare */
  13525. 'use strict';
  13526. var hasOwnProperty = Object.prototype.hasOwnProperty;
  13527. /**
  13528. * inlined Object.is polyfill to avoid requiring consumers ship their own
  13529. * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
  13530. */
  13531. function is(x, y) {
  13532. // SameValue algorithm
  13533. if (x === y) {
  13534. // Steps 1-5, 7-10
  13535. // Steps 6.b-6.e: +0 != -0
  13536. // Added the nonzero y check to make Flow happy, but it is redundant
  13537. return x !== 0 || y !== 0 || 1 / x === 1 / y;
  13538. } else {
  13539. // Step 6.a: NaN == NaN
  13540. return x !== x && y !== y;
  13541. }
  13542. }
  13543. /**
  13544. * Performs equality by iterating through keys on an object and returning false
  13545. * when any key has values which are not strictly equal between the arguments.
  13546. * Returns true when the values of all keys are strictly equal.
  13547. */
  13548. function shallowEqual(objA, objB) {
  13549. if (is(objA, objB)) {
  13550. return true;
  13551. }
  13552. if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {
  13553. return false;
  13554. }
  13555. var keysA = Object.keys(objA);
  13556. var keysB = Object.keys(objB);
  13557. if (keysA.length !== keysB.length) {
  13558. return false;
  13559. }
  13560. // Test for A's keys different from B.
  13561. for (var i = 0; i < keysA.length; i++) {
  13562. if (!hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {
  13563. return false;
  13564. }
  13565. }
  13566. return true;
  13567. }
  13568. module.exports = shallowEqual;
  13569. /***/ },
  13570. /* 126 */
  13571. /***/ function(module, exports, __webpack_require__) {
  13572. /**
  13573. * Copyright 2015-present, Facebook, Inc.
  13574. * All rights reserved.
  13575. *
  13576. * This source code is licensed under the BSD-style license found in the
  13577. * LICENSE file in the root directory of this source tree. An additional grant
  13578. * of patent rights can be found in the PATENTS file in the same directory.
  13579. *
  13580. * @providesModule validateDOMNesting
  13581. */
  13582. 'use strict';
  13583. var _assign = __webpack_require__(3);
  13584. var emptyFunction = __webpack_require__(10);
  13585. var warning = __webpack_require__(9);
  13586. var validateDOMNesting = emptyFunction;
  13587. if (false) {
  13588. // This validation code was written based on the HTML5 parsing spec:
  13589. // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-scope
  13590. //
  13591. // Note: this does not catch all invalid nesting, nor does it try to (as it's
  13592. // not clear what practical benefit doing so provides); instead, we warn only
  13593. // for cases where the parser will give a parse tree differing from what React
  13594. // intended. For example, <b><div></div></b> is invalid but we don't warn
  13595. // because it still parses correctly; we do warn for other cases like nested
  13596. // <p> tags where the beginning of the second element implicitly closes the
  13597. // first, causing a confusing mess.
  13598. // https://html.spec.whatwg.org/multipage/syntax.html#special
  13599. var specialTags = ['address', 'applet', 'area', 'article', 'aside', 'base', 'basefont', 'bgsound', 'blockquote', 'body', 'br', 'button', 'caption', 'center', 'col', 'colgroup', 'dd', 'details', 'dir', 'div', 'dl', 'dt', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'frame', 'frameset', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'iframe', 'img', 'input', 'isindex', 'li', 'link', 'listing', 'main', 'marquee', 'menu', 'menuitem', 'meta', 'nav', 'noembed', 'noframes', 'noscript', 'object', 'ol', 'p', 'param', 'plaintext', 'pre', 'script', 'section', 'select', 'source', 'style', 'summary', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'title', 'tr', 'track', 'ul', 'wbr', 'xmp'];
  13600. // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-scope
  13601. var inScopeTags = ['applet', 'caption', 'html', 'table', 'td', 'th', 'marquee', 'object', 'template',
  13602. // https://html.spec.whatwg.org/multipage/syntax.html#html-integration-point
  13603. // TODO: Distinguish by namespace here -- for <title>, including it here
  13604. // errs on the side of fewer warnings
  13605. 'foreignObject', 'desc', 'title'];
  13606. // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-button-scope
  13607. var buttonScopeTags = inScopeTags.concat(['button']);
  13608. // https://html.spec.whatwg.org/multipage/syntax.html#generate-implied-end-tags
  13609. var impliedEndTags = ['dd', 'dt', 'li', 'option', 'optgroup', 'p', 'rp', 'rt'];
  13610. var emptyAncestorInfo = {
  13611. current: null,
  13612. formTag: null,
  13613. aTagInScope: null,
  13614. buttonTagInScope: null,
  13615. nobrTagInScope: null,
  13616. pTagInButtonScope: null,
  13617. listItemTagAutoclosing: null,
  13618. dlItemTagAutoclosing: null
  13619. };
  13620. var updatedAncestorInfo = function (oldInfo, tag, instance) {
  13621. var ancestorInfo = _assign({}, oldInfo || emptyAncestorInfo);
  13622. var info = { tag: tag, instance: instance };
  13623. if (inScopeTags.indexOf(tag) !== -1) {
  13624. ancestorInfo.aTagInScope = null;
  13625. ancestorInfo.buttonTagInScope = null;
  13626. ancestorInfo.nobrTagInScope = null;
  13627. }
  13628. if (buttonScopeTags.indexOf(tag) !== -1) {
  13629. ancestorInfo.pTagInButtonScope = null;
  13630. }
  13631. // See rules for 'li', 'dd', 'dt' start tags in
  13632. // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inbody
  13633. if (specialTags.indexOf(tag) !== -1 && tag !== 'address' && tag !== 'div' && tag !== 'p') {
  13634. ancestorInfo.listItemTagAutoclosing = null;
  13635. ancestorInfo.dlItemTagAutoclosing = null;
  13636. }
  13637. ancestorInfo.current = info;
  13638. if (tag === 'form') {
  13639. ancestorInfo.formTag = info;
  13640. }
  13641. if (tag === 'a') {
  13642. ancestorInfo.aTagInScope = info;
  13643. }
  13644. if (tag === 'button') {
  13645. ancestorInfo.buttonTagInScope = info;
  13646. }
  13647. if (tag === 'nobr') {
  13648. ancestorInfo.nobrTagInScope = info;
  13649. }
  13650. if (tag === 'p') {
  13651. ancestorInfo.pTagInButtonScope = info;
  13652. }
  13653. if (tag === 'li') {
  13654. ancestorInfo.listItemTagAutoclosing = info;
  13655. }
  13656. if (tag === 'dd' || tag === 'dt') {
  13657. ancestorInfo.dlItemTagAutoclosing = info;
  13658. }
  13659. return ancestorInfo;
  13660. };
  13661. /**
  13662. * Returns whether
  13663. */
  13664. var isTagValidWithParent = function (tag, parentTag) {
  13665. // First, let's check if we're in an unusual parsing mode...
  13666. switch (parentTag) {
  13667. // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inselect
  13668. case 'select':
  13669. return tag === 'option' || tag === 'optgroup' || tag === '#text';
  13670. case 'optgroup':
  13671. return tag === 'option' || tag === '#text';
  13672. // Strictly speaking, seeing an <option> doesn't mean we're in a <select>
  13673. // but
  13674. case 'option':
  13675. return tag === '#text';
  13676. // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intd
  13677. // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-incaption
  13678. // No special behavior since these rules fall back to "in body" mode for
  13679. // all except special table nodes which cause bad parsing behavior anyway.
  13680. // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intr
  13681. case 'tr':
  13682. return tag === 'th' || tag === 'td' || tag === 'style' || tag === 'script' || tag === 'template';
  13683. // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intbody
  13684. case 'tbody':
  13685. case 'thead':
  13686. case 'tfoot':
  13687. return tag === 'tr' || tag === 'style' || tag === 'script' || tag === 'template';
  13688. // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-incolgroup
  13689. case 'colgroup':
  13690. return tag === 'col' || tag === 'template';
  13691. // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intable
  13692. case 'table':
  13693. return tag === 'caption' || tag === 'colgroup' || tag === 'tbody' || tag === 'tfoot' || tag === 'thead' || tag === 'style' || tag === 'script' || tag === 'template';
  13694. // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inhead
  13695. case 'head':
  13696. return tag === 'base' || tag === 'basefont' || tag === 'bgsound' || tag === 'link' || tag === 'meta' || tag === 'title' || tag === 'noscript' || tag === 'noframes' || tag === 'style' || tag === 'script' || tag === 'template';
  13697. // https://html.spec.whatwg.org/multipage/semantics.html#the-html-element
  13698. case 'html':
  13699. return tag === 'head' || tag === 'body';
  13700. case '#document':
  13701. return tag === 'html';
  13702. }
  13703. // Probably in the "in body" parsing mode, so we outlaw only tag combos
  13704. // where the parsing rules cause implicit opens or closes to be added.
  13705. // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inbody
  13706. switch (tag) {
  13707. case 'h1':
  13708. case 'h2':
  13709. case 'h3':
  13710. case 'h4':
  13711. case 'h5':
  13712. case 'h6':
  13713. return parentTag !== 'h1' && parentTag !== 'h2' && parentTag !== 'h3' && parentTag !== 'h4' && parentTag !== 'h5' && parentTag !== 'h6';
  13714. case 'rp':
  13715. case 'rt':
  13716. return impliedEndTags.indexOf(parentTag) === -1;
  13717. case 'body':
  13718. case 'caption':
  13719. case 'col':
  13720. case 'colgroup':
  13721. case 'frame':
  13722. case 'head':
  13723. case 'html':
  13724. case 'tbody':
  13725. case 'td':
  13726. case 'tfoot':
  13727. case 'th':
  13728. case 'thead':
  13729. case 'tr':
  13730. // These tags are only valid with a few parents that have special child
  13731. // parsing rules -- if we're down here, then none of those matched and
  13732. // so we allow it only if we don't know what the parent is, as all other
  13733. // cases are invalid.
  13734. return parentTag == null;
  13735. }
  13736. return true;
  13737. };
  13738. /**
  13739. * Returns whether
  13740. */
  13741. var findInvalidAncestorForTag = function (tag, ancestorInfo) {
  13742. switch (tag) {
  13743. case 'address':
  13744. case 'article':
  13745. case 'aside':
  13746. case 'blockquote':
  13747. case 'center':
  13748. case 'details':
  13749. case 'dialog':
  13750. case 'dir':
  13751. case 'div':
  13752. case 'dl':
  13753. case 'fieldset':
  13754. case 'figcaption':
  13755. case 'figure':
  13756. case 'footer':
  13757. case 'header':
  13758. case 'hgroup':
  13759. case 'main':
  13760. case 'menu':
  13761. case 'nav':
  13762. case 'ol':
  13763. case 'p':
  13764. case 'section':
  13765. case 'summary':
  13766. case 'ul':
  13767. case 'pre':
  13768. case 'listing':
  13769. case 'table':
  13770. case 'hr':
  13771. case 'xmp':
  13772. case 'h1':
  13773. case 'h2':
  13774. case 'h3':
  13775. case 'h4':
  13776. case 'h5':
  13777. case 'h6':
  13778. return ancestorInfo.pTagInButtonScope;
  13779. case 'form':
  13780. return ancestorInfo.formTag || ancestorInfo.pTagInButtonScope;
  13781. case 'li':
  13782. return ancestorInfo.listItemTagAutoclosing;
  13783. case 'dd':
  13784. case 'dt':
  13785. return ancestorInfo.dlItemTagAutoclosing;
  13786. case 'button':
  13787. return ancestorInfo.buttonTagInScope;
  13788. case 'a':
  13789. // Spec says something about storing a list of markers, but it sounds
  13790. // equivalent to this check.
  13791. return ancestorInfo.aTagInScope;
  13792. case 'nobr':
  13793. return ancestorInfo.nobrTagInScope;
  13794. }
  13795. return null;
  13796. };
  13797. /**
  13798. * Given a ReactCompositeComponent instance, return a list of its recursive
  13799. * owners, starting at the root and ending with the instance itself.
  13800. */
  13801. var findOwnerStack = function (instance) {
  13802. if (!instance) {
  13803. return [];
  13804. }
  13805. var stack = [];
  13806. do {
  13807. stack.push(instance);
  13808. } while (instance = instance._currentElement._owner);
  13809. stack.reverse();
  13810. return stack;
  13811. };
  13812. var didWarn = {};
  13813. validateDOMNesting = function (childTag, childInstance, ancestorInfo) {
  13814. ancestorInfo = ancestorInfo || emptyAncestorInfo;
  13815. var parentInfo = ancestorInfo.current;
  13816. var parentTag = parentInfo && parentInfo.tag;
  13817. var invalidParent = isTagValidWithParent(childTag, parentTag) ? null : parentInfo;
  13818. var invalidAncestor = invalidParent ? null : findInvalidAncestorForTag(childTag, ancestorInfo);
  13819. var problematic = invalidParent || invalidAncestor;
  13820. if (problematic) {
  13821. var ancestorTag = problematic.tag;
  13822. var ancestorInstance = problematic.instance;
  13823. var childOwner = childInstance && childInstance._currentElement._owner;
  13824. var ancestorOwner = ancestorInstance && ancestorInstance._currentElement._owner;
  13825. var childOwners = findOwnerStack(childOwner);
  13826. var ancestorOwners = findOwnerStack(ancestorOwner);
  13827. var minStackLen = Math.min(childOwners.length, ancestorOwners.length);
  13828. var i;
  13829. var deepestCommon = -1;
  13830. for (i = 0; i < minStackLen; i++) {
  13831. if (childOwners[i] === ancestorOwners[i]) {
  13832. deepestCommon = i;
  13833. } else {
  13834. break;
  13835. }
  13836. }
  13837. var UNKNOWN = '(unknown)';
  13838. var childOwnerNames = childOwners.slice(deepestCommon + 1).map(function (inst) {
  13839. return inst.getName() || UNKNOWN;
  13840. });
  13841. var ancestorOwnerNames = ancestorOwners.slice(deepestCommon + 1).map(function (inst) {
  13842. return inst.getName() || UNKNOWN;
  13843. });
  13844. var ownerInfo = [].concat(
  13845. // If the parent and child instances have a common owner ancestor, start
  13846. // with that -- otherwise we just start with the parent's owners.
  13847. deepestCommon !== -1 ? childOwners[deepestCommon].getName() || UNKNOWN : [], ancestorOwnerNames, ancestorTag,
  13848. // If we're warning about an invalid (non-parent) ancestry, add '...'
  13849. invalidAncestor ? ['...'] : [], childOwnerNames, childTag).join(' > ');
  13850. var warnKey = !!invalidParent + '|' + childTag + '|' + ancestorTag + '|' + ownerInfo;
  13851. if (didWarn[warnKey]) {
  13852. return;
  13853. }
  13854. didWarn[warnKey] = true;
  13855. var tagDisplayName = childTag;
  13856. if (childTag !== '#text') {
  13857. tagDisplayName = '<' + childTag + '>';
  13858. }
  13859. if (invalidParent) {
  13860. var info = '';
  13861. if (ancestorTag === 'table' && childTag === 'tr') {
  13862. info += ' Add a <tbody> to your code to match the DOM tree generated by ' + 'the browser.';
  13863. }
  13864. process.env.NODE_ENV !== 'production' ? warning(false, 'validateDOMNesting(...): %s cannot appear as a child of <%s>. ' + 'See %s.%s', tagDisplayName, ancestorTag, ownerInfo, info) : void 0;
  13865. } else {
  13866. process.env.NODE_ENV !== 'production' ? warning(false, 'validateDOMNesting(...): %s cannot appear as a descendant of ' + '<%s>. See %s.', tagDisplayName, ancestorTag, ownerInfo) : void 0;
  13867. }
  13868. }
  13869. };
  13870. validateDOMNesting.updatedAncestorInfo = updatedAncestorInfo;
  13871. // For testing
  13872. validateDOMNesting.isTagValidInContext = function (tag, ancestorInfo) {
  13873. ancestorInfo = ancestorInfo || emptyAncestorInfo;
  13874. var parentInfo = ancestorInfo.current;
  13875. var parentTag = parentInfo && parentInfo.tag;
  13876. return isTagValidWithParent(tag, parentTag) && !findInvalidAncestorForTag(tag, ancestorInfo);
  13877. };
  13878. }
  13879. module.exports = validateDOMNesting;
  13880. /***/ },
  13881. /* 127 */
  13882. /***/ function(module, exports, __webpack_require__) {
  13883. /**
  13884. * Copyright 2014-present, Facebook, Inc.
  13885. * All rights reserved.
  13886. *
  13887. * This source code is licensed under the BSD-style license found in the
  13888. * LICENSE file in the root directory of this source tree. An additional grant
  13889. * of patent rights can be found in the PATENTS file in the same directory.
  13890. *
  13891. * @providesModule ReactDOMEmptyComponent
  13892. */
  13893. 'use strict';
  13894. var _assign = __webpack_require__(3);
  13895. var DOMLazyTree = __webpack_require__(74);
  13896. var ReactDOMComponentTree = __webpack_require__(36);
  13897. var ReactDOMEmptyComponent = function (instantiate) {
  13898. // ReactCompositeComponent uses this:
  13899. this._currentElement = null;
  13900. // ReactDOMComponentTree uses these:
  13901. this._nativeNode = null;
  13902. this._nativeParent = null;
  13903. this._nativeContainerInfo = null;
  13904. this._domID = null;
  13905. };
  13906. _assign(ReactDOMEmptyComponent.prototype, {
  13907. mountComponent: function (transaction, nativeParent, nativeContainerInfo, context) {
  13908. var domID = nativeContainerInfo._idCounter++;
  13909. this._domID = domID;
  13910. this._nativeParent = nativeParent;
  13911. this._nativeContainerInfo = nativeContainerInfo;
  13912. var nodeValue = ' react-empty: ' + this._domID + ' ';
  13913. if (transaction.useCreateElement) {
  13914. var ownerDocument = nativeContainerInfo._ownerDocument;
  13915. var node = ownerDocument.createComment(nodeValue);
  13916. ReactDOMComponentTree.precacheNode(this, node);
  13917. return DOMLazyTree(node);
  13918. } else {
  13919. if (transaction.renderToStaticMarkup) {
  13920. // Normally we'd insert a comment node, but since this is a situation
  13921. // where React won't take over (static pages), we can simply return
  13922. // nothing.
  13923. return '';
  13924. }
  13925. return '<!--' + nodeValue + '-->';
  13926. }
  13927. },
  13928. receiveComponent: function () {},
  13929. getNativeNode: function () {
  13930. return ReactDOMComponentTree.getNodeFromInstance(this);
  13931. },
  13932. unmountComponent: function () {
  13933. ReactDOMComponentTree.uncacheNode(this);
  13934. }
  13935. });
  13936. module.exports = ReactDOMEmptyComponent;
  13937. /***/ },
  13938. /* 128 */
  13939. /***/ function(module, exports, __webpack_require__) {
  13940. /**
  13941. * Copyright 2015-present, Facebook, Inc.
  13942. * All rights reserved.
  13943. *
  13944. * This source code is licensed under the BSD-style license found in the
  13945. * LICENSE file in the root directory of this source tree. An additional grant
  13946. * of patent rights can be found in the PATENTS file in the same directory.
  13947. *
  13948. * @providesModule ReactDOMTreeTraversal
  13949. */
  13950. 'use strict';
  13951. var invariant = __webpack_require__(6);
  13952. /**
  13953. * Return the lowest common ancestor of A and B, or null if they are in
  13954. * different trees.
  13955. */
  13956. function getLowestCommonAncestor(instA, instB) {
  13957. !('_nativeNode' in instA) ? false ? invariant(false, 'getNodeFromInstance: Invalid argument.') : invariant(false) : void 0;
  13958. !('_nativeNode' in instB) ? false ? invariant(false, 'getNodeFromInstance: Invalid argument.') : invariant(false) : void 0;
  13959. var depthA = 0;
  13960. for (var tempA = instA; tempA; tempA = tempA._nativeParent) {
  13961. depthA++;
  13962. }
  13963. var depthB = 0;
  13964. for (var tempB = instB; tempB; tempB = tempB._nativeParent) {
  13965. depthB++;
  13966. }
  13967. // If A is deeper, crawl up.
  13968. while (depthA - depthB > 0) {
  13969. instA = instA._nativeParent;
  13970. depthA--;
  13971. }
  13972. // If B is deeper, crawl up.
  13973. while (depthB - depthA > 0) {
  13974. instB = instB._nativeParent;
  13975. depthB--;
  13976. }
  13977. // Walk in lockstep until we find a match.
  13978. var depth = depthA;
  13979. while (depth--) {
  13980. if (instA === instB) {
  13981. return instA;
  13982. }
  13983. instA = instA._nativeParent;
  13984. instB = instB._nativeParent;
  13985. }
  13986. return null;
  13987. }
  13988. /**
  13989. * Return if A is an ancestor of B.
  13990. */
  13991. function isAncestor(instA, instB) {
  13992. !('_nativeNode' in instA) ? false ? invariant(false, 'isAncestor: Invalid argument.') : invariant(false) : void 0;
  13993. !('_nativeNode' in instB) ? false ? invariant(false, 'isAncestor: Invalid argument.') : invariant(false) : void 0;
  13994. while (instB) {
  13995. if (instB === instA) {
  13996. return true;
  13997. }
  13998. instB = instB._nativeParent;
  13999. }
  14000. return false;
  14001. }
  14002. /**
  14003. * Return the parent instance of the passed-in instance.
  14004. */
  14005. function getParentInstance(inst) {
  14006. !('_nativeNode' in inst) ? false ? invariant(false, 'getParentInstance: Invalid argument.') : invariant(false) : void 0;
  14007. return inst._nativeParent;
  14008. }
  14009. /**
  14010. * Simulates the traversal of a two-phase, capture/bubble event dispatch.
  14011. */
  14012. function traverseTwoPhase(inst, fn, arg) {
  14013. var path = [];
  14014. while (inst) {
  14015. path.push(inst);
  14016. inst = inst._nativeParent;
  14017. }
  14018. var i;
  14019. for (i = path.length; i-- > 0;) {
  14020. fn(path[i], false, arg);
  14021. }
  14022. for (i = 0; i < path.length; i++) {
  14023. fn(path[i], true, arg);
  14024. }
  14025. }
  14026. /**
  14027. * Traverses the ID hierarchy and invokes the supplied `cb` on any IDs that
  14028. * should would receive a `mouseEnter` or `mouseLeave` event.
  14029. *
  14030. * Does not invoke the callback on the nearest common ancestor because nothing
  14031. * "entered" or "left" that element.
  14032. */
  14033. function traverseEnterLeave(from, to, fn, argFrom, argTo) {
  14034. var common = from && to ? getLowestCommonAncestor(from, to) : null;
  14035. var pathFrom = [];
  14036. while (from && from !== common) {
  14037. pathFrom.push(from);
  14038. from = from._nativeParent;
  14039. }
  14040. var pathTo = [];
  14041. while (to && to !== common) {
  14042. pathTo.push(to);
  14043. to = to._nativeParent;
  14044. }
  14045. var i;
  14046. for (i = 0; i < pathFrom.length; i++) {
  14047. fn(pathFrom[i], true, argFrom);
  14048. }
  14049. for (i = pathTo.length; i-- > 0;) {
  14050. fn(pathTo[i], false, argTo);
  14051. }
  14052. }
  14053. module.exports = {
  14054. isAncestor: isAncestor,
  14055. getLowestCommonAncestor: getLowestCommonAncestor,
  14056. getParentInstance: getParentInstance,
  14057. traverseTwoPhase: traverseTwoPhase,
  14058. traverseEnterLeave: traverseEnterLeave
  14059. };
  14060. /***/ },
  14061. /* 129 */
  14062. /***/ function(module, exports, __webpack_require__) {
  14063. /**
  14064. * Copyright 2013-present, Facebook, Inc.
  14065. * All rights reserved.
  14066. *
  14067. * This source code is licensed under the BSD-style license found in the
  14068. * LICENSE file in the root directory of this source tree. An additional grant
  14069. * of patent rights can be found in the PATENTS file in the same directory.
  14070. *
  14071. * @providesModule ReactDOMTextComponent
  14072. */
  14073. 'use strict';
  14074. var _assign = __webpack_require__(3);
  14075. var DOMChildrenOperations = __webpack_require__(73);
  14076. var DOMLazyTree = __webpack_require__(74);
  14077. var ReactDOMComponentTree = __webpack_require__(36);
  14078. var ReactInstrumentation = __webpack_require__(17);
  14079. var escapeTextContentForBrowser = __webpack_require__(78);
  14080. var invariant = __webpack_require__(6);
  14081. var validateDOMNesting = __webpack_require__(126);
  14082. /**
  14083. * Text nodes violate a couple assumptions that React makes about components:
  14084. *
  14085. * - When mounting text into the DOM, adjacent text nodes are merged.
  14086. * - Text nodes cannot be assigned a React root ID.
  14087. *
  14088. * This component is used to wrap strings between comment nodes so that they
  14089. * can undergo the same reconciliation that is applied to elements.
  14090. *
  14091. * TODO: Investigate representing React components in the DOM with text nodes.
  14092. *
  14093. * @class ReactDOMTextComponent
  14094. * @extends ReactComponent
  14095. * @internal
  14096. */
  14097. var ReactDOMTextComponent = function (text) {
  14098. // TODO: This is really a ReactText (ReactNode), not a ReactElement
  14099. this._currentElement = text;
  14100. this._stringText = '' + text;
  14101. // ReactDOMComponentTree uses these:
  14102. this._nativeNode = null;
  14103. this._nativeParent = null;
  14104. // Properties
  14105. this._domID = null;
  14106. this._mountIndex = 0;
  14107. this._closingComment = null;
  14108. this._commentNodes = null;
  14109. };
  14110. _assign(ReactDOMTextComponent.prototype, {
  14111. /**
  14112. * Creates the markup for this text node. This node is not intended to have
  14113. * any features besides containing text content.
  14114. *
  14115. * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
  14116. * @return {string} Markup for this text node.
  14117. * @internal
  14118. */
  14119. mountComponent: function (transaction, nativeParent, nativeContainerInfo, context) {
  14120. if (false) {
  14121. ReactInstrumentation.debugTool.onSetText(this._debugID, this._stringText);
  14122. var parentInfo;
  14123. if (nativeParent != null) {
  14124. parentInfo = nativeParent._ancestorInfo;
  14125. } else if (nativeContainerInfo != null) {
  14126. parentInfo = nativeContainerInfo._ancestorInfo;
  14127. }
  14128. if (parentInfo) {
  14129. // parentInfo should always be present except for the top-level
  14130. // component when server rendering
  14131. validateDOMNesting('#text', this, parentInfo);
  14132. }
  14133. }
  14134. var domID = nativeContainerInfo._idCounter++;
  14135. var openingValue = ' react-text: ' + domID + ' ';
  14136. var closingValue = ' /react-text ';
  14137. this._domID = domID;
  14138. this._nativeParent = nativeParent;
  14139. if (transaction.useCreateElement) {
  14140. var ownerDocument = nativeContainerInfo._ownerDocument;
  14141. var openingComment = ownerDocument.createComment(openingValue);
  14142. var closingComment = ownerDocument.createComment(closingValue);
  14143. var lazyTree = DOMLazyTree(ownerDocument.createDocumentFragment());
  14144. DOMLazyTree.queueChild(lazyTree, DOMLazyTree(openingComment));
  14145. if (this._stringText) {
  14146. DOMLazyTree.queueChild(lazyTree, DOMLazyTree(ownerDocument.createTextNode(this._stringText)));
  14147. }
  14148. DOMLazyTree.queueChild(lazyTree, DOMLazyTree(closingComment));
  14149. ReactDOMComponentTree.precacheNode(this, openingComment);
  14150. this._closingComment = closingComment;
  14151. return lazyTree;
  14152. } else {
  14153. var escapedText = escapeTextContentForBrowser(this._stringText);
  14154. if (transaction.renderToStaticMarkup) {
  14155. // Normally we'd wrap this between comment nodes for the reasons stated
  14156. // above, but since this is a situation where React won't take over
  14157. // (static pages), we can simply return the text as it is.
  14158. return escapedText;
  14159. }
  14160. return '<!--' + openingValue + '-->' + escapedText + '<!--' + closingValue + '-->';
  14161. }
  14162. },
  14163. /**
  14164. * Updates this component by updating the text content.
  14165. *
  14166. * @param {ReactText} nextText The next text content
  14167. * @param {ReactReconcileTransaction} transaction
  14168. * @internal
  14169. */
  14170. receiveComponent: function (nextText, transaction) {
  14171. if (nextText !== this._currentElement) {
  14172. this._currentElement = nextText;
  14173. var nextStringText = '' + nextText;
  14174. if (nextStringText !== this._stringText) {
  14175. // TODO: Save this as pending props and use performUpdateIfNecessary
  14176. // and/or updateComponent to do the actual update for consistency with
  14177. // other component types?
  14178. this._stringText = nextStringText;
  14179. var commentNodes = this.getNativeNode();
  14180. DOMChildrenOperations.replaceDelimitedText(commentNodes[0], commentNodes[1], nextStringText);
  14181. if (false) {
  14182. ReactInstrumentation.debugTool.onSetText(this._debugID, nextStringText);
  14183. }
  14184. }
  14185. }
  14186. },
  14187. getNativeNode: function () {
  14188. var nativeNode = this._commentNodes;
  14189. if (nativeNode) {
  14190. return nativeNode;
  14191. }
  14192. if (!this._closingComment) {
  14193. var openingComment = ReactDOMComponentTree.getNodeFromInstance(this);
  14194. var node = openingComment.nextSibling;
  14195. while (true) {
  14196. !(node != null) ? false ? invariant(false, 'Missing closing comment for text component %s', this._domID) : invariant(false) : void 0;
  14197. if (node.nodeType === 8 && node.nodeValue === ' /react-text ') {
  14198. this._closingComment = node;
  14199. break;
  14200. }
  14201. node = node.nextSibling;
  14202. }
  14203. }
  14204. nativeNode = [this._nativeNode, this._closingComment];
  14205. this._commentNodes = nativeNode;
  14206. return nativeNode;
  14207. },
  14208. unmountComponent: function () {
  14209. this._closingComment = null;
  14210. this._commentNodes = null;
  14211. ReactDOMComponentTree.uncacheNode(this);
  14212. }
  14213. });
  14214. module.exports = ReactDOMTextComponent;
  14215. /***/ },
  14216. /* 130 */
  14217. /***/ function(module, exports, __webpack_require__) {
  14218. /**
  14219. * Copyright 2013-present, Facebook, Inc.
  14220. * All rights reserved.
  14221. *
  14222. * This source code is licensed under the BSD-style license found in the
  14223. * LICENSE file in the root directory of this source tree. An additional grant
  14224. * of patent rights can be found in the PATENTS file in the same directory.
  14225. *
  14226. * @providesModule ReactDefaultBatchingStrategy
  14227. */
  14228. 'use strict';
  14229. var _assign = __webpack_require__(3);
  14230. var ReactUpdates = __webpack_require__(55);
  14231. var Transaction = __webpack_require__(61);
  14232. var emptyFunction = __webpack_require__(10);
  14233. var RESET_BATCHED_UPDATES = {
  14234. initialize: emptyFunction,
  14235. close: function () {
  14236. ReactDefaultBatchingStrategy.isBatchingUpdates = false;
  14237. }
  14238. };
  14239. var FLUSH_BATCHED_UPDATES = {
  14240. initialize: emptyFunction,
  14241. close: ReactUpdates.flushBatchedUpdates.bind(ReactUpdates)
  14242. };
  14243. var TRANSACTION_WRAPPERS = [FLUSH_BATCHED_UPDATES, RESET_BATCHED_UPDATES];
  14244. function ReactDefaultBatchingStrategyTransaction() {
  14245. this.reinitializeTransaction();
  14246. }
  14247. _assign(ReactDefaultBatchingStrategyTransaction.prototype, Transaction.Mixin, {
  14248. getTransactionWrappers: function () {
  14249. return TRANSACTION_WRAPPERS;
  14250. }
  14251. });
  14252. var transaction = new ReactDefaultBatchingStrategyTransaction();
  14253. var ReactDefaultBatchingStrategy = {
  14254. isBatchingUpdates: false,
  14255. /**
  14256. * Call the provided function in a context within which calls to `setState`
  14257. * and friends are batched such that components aren't updated unnecessarily.
  14258. */
  14259. batchedUpdates: function (callback, a, b, c, d, e) {
  14260. var alreadyBatchingUpdates = ReactDefaultBatchingStrategy.isBatchingUpdates;
  14261. ReactDefaultBatchingStrategy.isBatchingUpdates = true;
  14262. // The code is written this way to avoid extra allocations
  14263. if (alreadyBatchingUpdates) {
  14264. callback(a, b, c, d, e);
  14265. } else {
  14266. transaction.perform(callback, null, a, b, c, d, e);
  14267. }
  14268. }
  14269. };
  14270. module.exports = ReactDefaultBatchingStrategy;
  14271. /***/ },
  14272. /* 131 */
  14273. /***/ function(module, exports, __webpack_require__) {
  14274. /**
  14275. * Copyright 2013-present, Facebook, Inc.
  14276. * All rights reserved.
  14277. *
  14278. * This source code is licensed under the BSD-style license found in the
  14279. * LICENSE file in the root directory of this source tree. An additional grant
  14280. * of patent rights can be found in the PATENTS file in the same directory.
  14281. *
  14282. * @providesModule ReactEventListener
  14283. */
  14284. 'use strict';
  14285. var _assign = __webpack_require__(3);
  14286. var EventListener = __webpack_require__(132);
  14287. var ExecutionEnvironment = __webpack_require__(19);
  14288. var PooledClass = __webpack_require__(5);
  14289. var ReactDOMComponentTree = __webpack_require__(36);
  14290. var ReactUpdates = __webpack_require__(55);
  14291. var getEventTarget = __webpack_require__(62);
  14292. var getUnboundedScrollPosition = __webpack_require__(133);
  14293. /**
  14294. * Find the deepest React component completely containing the root of the
  14295. * passed-in instance (for use when entire React trees are nested within each
  14296. * other). If React trees are not nested, returns null.
  14297. */
  14298. function findParent(inst) {
  14299. // TODO: It may be a good idea to cache this to prevent unnecessary DOM
  14300. // traversal, but caching is difficult to do correctly without using a
  14301. // mutation observer to listen for all DOM changes.
  14302. while (inst._nativeParent) {
  14303. inst = inst._nativeParent;
  14304. }
  14305. var rootNode = ReactDOMComponentTree.getNodeFromInstance(inst);
  14306. var container = rootNode.parentNode;
  14307. return ReactDOMComponentTree.getClosestInstanceFromNode(container);
  14308. }
  14309. // Used to store ancestor hierarchy in top level callback
  14310. function TopLevelCallbackBookKeeping(topLevelType, nativeEvent) {
  14311. this.topLevelType = topLevelType;
  14312. this.nativeEvent = nativeEvent;
  14313. this.ancestors = [];
  14314. }
  14315. _assign(TopLevelCallbackBookKeeping.prototype, {
  14316. destructor: function () {
  14317. this.topLevelType = null;
  14318. this.nativeEvent = null;
  14319. this.ancestors.length = 0;
  14320. }
  14321. });
  14322. PooledClass.addPoolingTo(TopLevelCallbackBookKeeping, PooledClass.twoArgumentPooler);
  14323. function handleTopLevelImpl(bookKeeping) {
  14324. var nativeEventTarget = getEventTarget(bookKeeping.nativeEvent);
  14325. var targetInst = ReactDOMComponentTree.getClosestInstanceFromNode(nativeEventTarget);
  14326. // Loop through the hierarchy, in case there's any nested components.
  14327. // It's important that we build the array of ancestors before calling any
  14328. // event handlers, because event handlers can modify the DOM, leading to
  14329. // inconsistencies with ReactMount's node cache. See #1105.
  14330. var ancestor = targetInst;
  14331. do {
  14332. bookKeeping.ancestors.push(ancestor);
  14333. ancestor = ancestor && findParent(ancestor);
  14334. } while (ancestor);
  14335. for (var i = 0; i < bookKeeping.ancestors.length; i++) {
  14336. targetInst = bookKeeping.ancestors[i];
  14337. ReactEventListener._handleTopLevel(bookKeeping.topLevelType, targetInst, bookKeeping.nativeEvent, getEventTarget(bookKeeping.nativeEvent));
  14338. }
  14339. }
  14340. function scrollValueMonitor(cb) {
  14341. var scrollPosition = getUnboundedScrollPosition(window);
  14342. cb(scrollPosition);
  14343. }
  14344. var ReactEventListener = {
  14345. _enabled: true,
  14346. _handleTopLevel: null,
  14347. WINDOW_HANDLE: ExecutionEnvironment.canUseDOM ? window : null,
  14348. setHandleTopLevel: function (handleTopLevel) {
  14349. ReactEventListener._handleTopLevel = handleTopLevel;
  14350. },
  14351. setEnabled: function (enabled) {
  14352. ReactEventListener._enabled = !!enabled;
  14353. },
  14354. isEnabled: function () {
  14355. return ReactEventListener._enabled;
  14356. },
  14357. /**
  14358. * Traps top-level events by using event bubbling.
  14359. *
  14360. * @param {string} topLevelType Record from `EventConstants`.
  14361. * @param {string} handlerBaseName Event name (e.g. "click").
  14362. * @param {object} handle Element on which to attach listener.
  14363. * @return {?object} An object with a remove function which will forcefully
  14364. * remove the listener.
  14365. * @internal
  14366. */
  14367. trapBubbledEvent: function (topLevelType, handlerBaseName, handle) {
  14368. var element = handle;
  14369. if (!element) {
  14370. return null;
  14371. }
  14372. return EventListener.listen(element, handlerBaseName, ReactEventListener.dispatchEvent.bind(null, topLevelType));
  14373. },
  14374. /**
  14375. * Traps a top-level event by using event capturing.
  14376. *
  14377. * @param {string} topLevelType Record from `EventConstants`.
  14378. * @param {string} handlerBaseName Event name (e.g. "click").
  14379. * @param {object} handle Element on which to attach listener.
  14380. * @return {?object} An object with a remove function which will forcefully
  14381. * remove the listener.
  14382. * @internal
  14383. */
  14384. trapCapturedEvent: function (topLevelType, handlerBaseName, handle) {
  14385. var element = handle;
  14386. if (!element) {
  14387. return null;
  14388. }
  14389. return EventListener.capture(element, handlerBaseName, ReactEventListener.dispatchEvent.bind(null, topLevelType));
  14390. },
  14391. monitorScrollValue: function (refresh) {
  14392. var callback = scrollValueMonitor.bind(null, refresh);
  14393. EventListener.listen(window, 'scroll', callback);
  14394. },
  14395. dispatchEvent: function (topLevelType, nativeEvent) {
  14396. if (!ReactEventListener._enabled) {
  14397. return;
  14398. }
  14399. var bookKeeping = TopLevelCallbackBookKeeping.getPooled(topLevelType, nativeEvent);
  14400. try {
  14401. // Event queue being processed in the same cycle allows
  14402. // `preventDefault`.
  14403. ReactUpdates.batchedUpdates(handleTopLevelImpl, bookKeeping);
  14404. } finally {
  14405. TopLevelCallbackBookKeeping.release(bookKeeping);
  14406. }
  14407. }
  14408. };
  14409. module.exports = ReactEventListener;
  14410. /***/ },
  14411. /* 132 */
  14412. /***/ function(module, exports, __webpack_require__) {
  14413. 'use strict';
  14414. /**
  14415. * Copyright (c) 2013-present, Facebook, Inc.
  14416. *
  14417. * Licensed under the Apache License, Version 2.0 (the "License");
  14418. * you may not use this file except in compliance with the License.
  14419. * You may obtain a copy of the License at
  14420. *
  14421. * http://www.apache.org/licenses/LICENSE-2.0
  14422. *
  14423. * Unless required by applicable law or agreed to in writing, software
  14424. * distributed under the License is distributed on an "AS IS" BASIS,
  14425. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14426. * See the License for the specific language governing permissions and
  14427. * limitations under the License.
  14428. *
  14429. * @typechecks
  14430. */
  14431. var emptyFunction = __webpack_require__(10);
  14432. /**
  14433. * Upstream version of event listener. Does not take into account specific
  14434. * nature of platform.
  14435. */
  14436. var EventListener = {
  14437. /**
  14438. * Listen to DOM events during the bubble phase.
  14439. *
  14440. * @param {DOMEventTarget} target DOM element to register listener on.
  14441. * @param {string} eventType Event type, e.g. 'click' or 'mouseover'.
  14442. * @param {function} callback Callback function.
  14443. * @return {object} Object with a `remove` method.
  14444. */
  14445. listen: function listen(target, eventType, callback) {
  14446. if (target.addEventListener) {
  14447. target.addEventListener(eventType, callback, false);
  14448. return {
  14449. remove: function remove() {
  14450. target.removeEventListener(eventType, callback, false);
  14451. }
  14452. };
  14453. } else if (target.attachEvent) {
  14454. target.attachEvent('on' + eventType, callback);
  14455. return {
  14456. remove: function remove() {
  14457. target.detachEvent('on' + eventType, callback);
  14458. }
  14459. };
  14460. }
  14461. },
  14462. /**
  14463. * Listen to DOM events during the capture phase.
  14464. *
  14465. * @param {DOMEventTarget} target DOM element to register listener on.
  14466. * @param {string} eventType Event type, e.g. 'click' or 'mouseover'.
  14467. * @param {function} callback Callback function.
  14468. * @return {object} Object with a `remove` method.
  14469. */
  14470. capture: function capture(target, eventType, callback) {
  14471. if (target.addEventListener) {
  14472. target.addEventListener(eventType, callback, true);
  14473. return {
  14474. remove: function remove() {
  14475. target.removeEventListener(eventType, callback, true);
  14476. }
  14477. };
  14478. } else {
  14479. if (false) {
  14480. console.error('Attempted to listen to events during the capture phase on a ' + 'browser that does not support the capture phase. Your application ' + 'will not receive some events.');
  14481. }
  14482. return {
  14483. remove: emptyFunction
  14484. };
  14485. }
  14486. },
  14487. registerDefault: function registerDefault() {}
  14488. };
  14489. module.exports = EventListener;
  14490. /***/ },
  14491. /* 133 */
  14492. /***/ function(module, exports) {
  14493. /**
  14494. * Copyright (c) 2013-present, Facebook, Inc.
  14495. * All rights reserved.
  14496. *
  14497. * This source code is licensed under the BSD-style license found in the
  14498. * LICENSE file in the root directory of this source tree. An additional grant
  14499. * of patent rights can be found in the PATENTS file in the same directory.
  14500. *
  14501. * @typechecks
  14502. */
  14503. 'use strict';
  14504. /**
  14505. * Gets the scroll position of the supplied element or window.
  14506. *
  14507. * The return values are unbounded, unlike `getScrollPosition`. This means they
  14508. * may be negative or exceed the element boundaries (which is possible using
  14509. * inertial scrolling).
  14510. *
  14511. * @param {DOMWindow|DOMElement} scrollable
  14512. * @return {object} Map with `x` and `y` keys.
  14513. */
  14514. function getUnboundedScrollPosition(scrollable) {
  14515. if (scrollable === window) {
  14516. return {
  14517. x: window.pageXOffset || document.documentElement.scrollLeft,
  14518. y: window.pageYOffset || document.documentElement.scrollTop
  14519. };
  14520. }
  14521. return {
  14522. x: scrollable.scrollLeft,
  14523. y: scrollable.scrollTop
  14524. };
  14525. }
  14526. module.exports = getUnboundedScrollPosition;
  14527. /***/ },
  14528. /* 134 */
  14529. /***/ function(module, exports, __webpack_require__) {
  14530. /**
  14531. * Copyright 2013-present, Facebook, Inc.
  14532. * All rights reserved.
  14533. *
  14534. * This source code is licensed under the BSD-style license found in the
  14535. * LICENSE file in the root directory of this source tree. An additional grant
  14536. * of patent rights can be found in the PATENTS file in the same directory.
  14537. *
  14538. * @providesModule ReactInjection
  14539. */
  14540. 'use strict';
  14541. var DOMProperty = __webpack_require__(37);
  14542. var EventPluginHub = __webpack_require__(43);
  14543. var EventPluginUtils = __webpack_require__(45);
  14544. var ReactComponentEnvironment = __webpack_require__(113);
  14545. var ReactClass = __webpack_require__(23);
  14546. var ReactEmptyComponent = __webpack_require__(121);
  14547. var ReactBrowserEventEmitter = __webpack_require__(102);
  14548. var ReactNativeComponent = __webpack_require__(122);
  14549. var ReactUpdates = __webpack_require__(55);
  14550. var ReactInjection = {
  14551. Component: ReactComponentEnvironment.injection,
  14552. Class: ReactClass.injection,
  14553. DOMProperty: DOMProperty.injection,
  14554. EmptyComponent: ReactEmptyComponent.injection,
  14555. EventPluginHub: EventPluginHub.injection,
  14556. EventPluginUtils: EventPluginUtils.injection,
  14557. EventEmitter: ReactBrowserEventEmitter.injection,
  14558. NativeComponent: ReactNativeComponent.injection,
  14559. Updates: ReactUpdates.injection
  14560. };
  14561. module.exports = ReactInjection;
  14562. /***/ },
  14563. /* 135 */
  14564. /***/ function(module, exports, __webpack_require__) {
  14565. /**
  14566. * Copyright 2013-present, Facebook, Inc.
  14567. * All rights reserved.
  14568. *
  14569. * This source code is licensed under the BSD-style license found in the
  14570. * LICENSE file in the root directory of this source tree. An additional grant
  14571. * of patent rights can be found in the PATENTS file in the same directory.
  14572. *
  14573. * @providesModule ReactReconcileTransaction
  14574. */
  14575. 'use strict';
  14576. var _assign = __webpack_require__(3);
  14577. var CallbackQueue = __webpack_require__(56);
  14578. var PooledClass = __webpack_require__(5);
  14579. var ReactBrowserEventEmitter = __webpack_require__(102);
  14580. var ReactInputSelection = __webpack_require__(136);
  14581. var Transaction = __webpack_require__(61);
  14582. /**
  14583. * Ensures that, when possible, the selection range (currently selected text
  14584. * input) is not disturbed by performing the transaction.
  14585. */
  14586. var SELECTION_RESTORATION = {
  14587. /**
  14588. * @return {Selection} Selection information.
  14589. */
  14590. initialize: ReactInputSelection.getSelectionInformation,
  14591. /**
  14592. * @param {Selection} sel Selection information returned from `initialize`.
  14593. */
  14594. close: ReactInputSelection.restoreSelection
  14595. };
  14596. /**
  14597. * Suppresses events (blur/focus) that could be inadvertently dispatched due to
  14598. * high level DOM manipulations (like temporarily removing a text input from the
  14599. * DOM).
  14600. */
  14601. var EVENT_SUPPRESSION = {
  14602. /**
  14603. * @return {boolean} The enabled status of `ReactBrowserEventEmitter` before
  14604. * the reconciliation.
  14605. */
  14606. initialize: function () {
  14607. var currentlyEnabled = ReactBrowserEventEmitter.isEnabled();
  14608. ReactBrowserEventEmitter.setEnabled(false);
  14609. return currentlyEnabled;
  14610. },
  14611. /**
  14612. * @param {boolean} previouslyEnabled Enabled status of
  14613. * `ReactBrowserEventEmitter` before the reconciliation occurred. `close`
  14614. * restores the previous value.
  14615. */
  14616. close: function (previouslyEnabled) {
  14617. ReactBrowserEventEmitter.setEnabled(previouslyEnabled);
  14618. }
  14619. };
  14620. /**
  14621. * Provides a queue for collecting `componentDidMount` and
  14622. * `componentDidUpdate` callbacks during the transaction.
  14623. */
  14624. var ON_DOM_READY_QUEUEING = {
  14625. /**
  14626. * Initializes the internal `onDOMReady` queue.
  14627. */
  14628. initialize: function () {
  14629. this.reactMountReady.reset();
  14630. },
  14631. /**
  14632. * After DOM is flushed, invoke all registered `onDOMReady` callbacks.
  14633. */
  14634. close: function () {
  14635. this.reactMountReady.notifyAll();
  14636. }
  14637. };
  14638. /**
  14639. * Executed within the scope of the `Transaction` instance. Consider these as
  14640. * being member methods, but with an implied ordering while being isolated from
  14641. * each other.
  14642. */
  14643. var TRANSACTION_WRAPPERS = [SELECTION_RESTORATION, EVENT_SUPPRESSION, ON_DOM_READY_QUEUEING];
  14644. /**
  14645. * Currently:
  14646. * - The order that these are listed in the transaction is critical:
  14647. * - Suppresses events.
  14648. * - Restores selection range.
  14649. *
  14650. * Future:
  14651. * - Restore document/overflow scroll positions that were unintentionally
  14652. * modified via DOM insertions above the top viewport boundary.
  14653. * - Implement/integrate with customized constraint based layout system and keep
  14654. * track of which dimensions must be remeasured.
  14655. *
  14656. * @class ReactReconcileTransaction
  14657. */
  14658. function ReactReconcileTransaction(useCreateElement) {
  14659. this.reinitializeTransaction();
  14660. // Only server-side rendering really needs this option (see
  14661. // `ReactServerRendering`), but server-side uses
  14662. // `ReactServerRenderingTransaction` instead. This option is here so that it's
  14663. // accessible and defaults to false when `ReactDOMComponent` and
  14664. // `ReactTextComponent` checks it in `mountComponent`.`
  14665. this.renderToStaticMarkup = false;
  14666. this.reactMountReady = CallbackQueue.getPooled(null);
  14667. this.useCreateElement = useCreateElement;
  14668. }
  14669. var Mixin = {
  14670. /**
  14671. * @see Transaction
  14672. * @abstract
  14673. * @final
  14674. * @return {array<object>} List of operation wrap procedures.
  14675. * TODO: convert to array<TransactionWrapper>
  14676. */
  14677. getTransactionWrappers: function () {
  14678. return TRANSACTION_WRAPPERS;
  14679. },
  14680. /**
  14681. * @return {object} The queue to collect `onDOMReady` callbacks with.
  14682. */
  14683. getReactMountReady: function () {
  14684. return this.reactMountReady;
  14685. },
  14686. /**
  14687. * Save current transaction state -- if the return value from this method is
  14688. * passed to `rollback`, the transaction will be reset to that state.
  14689. */
  14690. checkpoint: function () {
  14691. // reactMountReady is the our only stateful wrapper
  14692. return this.reactMountReady.checkpoint();
  14693. },
  14694. rollback: function (checkpoint) {
  14695. this.reactMountReady.rollback(checkpoint);
  14696. },
  14697. /**
  14698. * `PooledClass` looks for this, and will invoke this before allowing this
  14699. * instance to be reused.
  14700. */
  14701. destructor: function () {
  14702. CallbackQueue.release(this.reactMountReady);
  14703. this.reactMountReady = null;
  14704. }
  14705. };
  14706. _assign(ReactReconcileTransaction.prototype, Transaction.Mixin, Mixin);
  14707. PooledClass.addPoolingTo(ReactReconcileTransaction);
  14708. module.exports = ReactReconcileTransaction;
  14709. /***/ },
  14710. /* 136 */
  14711. /***/ function(module, exports, __webpack_require__) {
  14712. /**
  14713. * Copyright 2013-present, Facebook, Inc.
  14714. * All rights reserved.
  14715. *
  14716. * This source code is licensed under the BSD-style license found in the
  14717. * LICENSE file in the root directory of this source tree. An additional grant
  14718. * of patent rights can be found in the PATENTS file in the same directory.
  14719. *
  14720. * @providesModule ReactInputSelection
  14721. */
  14722. 'use strict';
  14723. var ReactDOMSelection = __webpack_require__(137);
  14724. var containsNode = __webpack_require__(139);
  14725. var focusNode = __webpack_require__(88);
  14726. var getActiveElement = __webpack_require__(142);
  14727. function isInDocument(node) {
  14728. return containsNode(document.documentElement, node);
  14729. }
  14730. /**
  14731. * @ReactInputSelection: React input selection module. Based on Selection.js,
  14732. * but modified to be suitable for react and has a couple of bug fixes (doesn't
  14733. * assume buttons have range selections allowed).
  14734. * Input selection module for React.
  14735. */
  14736. var ReactInputSelection = {
  14737. hasSelectionCapabilities: function (elem) {
  14738. var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();
  14739. return nodeName && (nodeName === 'input' && elem.type === 'text' || nodeName === 'textarea' || elem.contentEditable === 'true');
  14740. },
  14741. getSelectionInformation: function () {
  14742. var focusedElem = getActiveElement();
  14743. return {
  14744. focusedElem: focusedElem,
  14745. selectionRange: ReactInputSelection.hasSelectionCapabilities(focusedElem) ? ReactInputSelection.getSelection(focusedElem) : null
  14746. };
  14747. },
  14748. /**
  14749. * @restoreSelection: If any selection information was potentially lost,
  14750. * restore it. This is useful when performing operations that could remove dom
  14751. * nodes and place them back in, resulting in focus being lost.
  14752. */
  14753. restoreSelection: function (priorSelectionInformation) {
  14754. var curFocusedElem = getActiveElement();
  14755. var priorFocusedElem = priorSelectionInformation.focusedElem;
  14756. var priorSelectionRange = priorSelectionInformation.selectionRange;
  14757. if (curFocusedElem !== priorFocusedElem && isInDocument(priorFocusedElem)) {
  14758. if (ReactInputSelection.hasSelectionCapabilities(priorFocusedElem)) {
  14759. ReactInputSelection.setSelection(priorFocusedElem, priorSelectionRange);
  14760. }
  14761. focusNode(priorFocusedElem);
  14762. }
  14763. },
  14764. /**
  14765. * @getSelection: Gets the selection bounds of a focused textarea, input or
  14766. * contentEditable node.
  14767. * -@input: Look up selection bounds of this input
  14768. * -@return {start: selectionStart, end: selectionEnd}
  14769. */
  14770. getSelection: function (input) {
  14771. var selection;
  14772. if ('selectionStart' in input) {
  14773. // Modern browser with input or textarea.
  14774. selection = {
  14775. start: input.selectionStart,
  14776. end: input.selectionEnd
  14777. };
  14778. } else if (document.selection && input.nodeName && input.nodeName.toLowerCase() === 'input') {
  14779. // IE8 input.
  14780. var range = document.selection.createRange();
  14781. // There can only be one selection per document in IE, so it must
  14782. // be in our element.
  14783. if (range.parentElement() === input) {
  14784. selection = {
  14785. start: -range.moveStart('character', -input.value.length),
  14786. end: -range.moveEnd('character', -input.value.length)
  14787. };
  14788. }
  14789. } else {
  14790. // Content editable or old IE textarea.
  14791. selection = ReactDOMSelection.getOffsets(input);
  14792. }
  14793. return selection || { start: 0, end: 0 };
  14794. },
  14795. /**
  14796. * @setSelection: Sets the selection bounds of a textarea or input and focuses
  14797. * the input.
  14798. * -@input Set selection bounds of this input or textarea
  14799. * -@offsets Object of same form that is returned from get*
  14800. */
  14801. setSelection: function (input, offsets) {
  14802. var start = offsets.start;
  14803. var end = offsets.end;
  14804. if (end === undefined) {
  14805. end = start;
  14806. }
  14807. if ('selectionStart' in input) {
  14808. input.selectionStart = start;
  14809. input.selectionEnd = Math.min(end, input.value.length);
  14810. } else if (document.selection && input.nodeName && input.nodeName.toLowerCase() === 'input') {
  14811. var range = input.createTextRange();
  14812. range.collapse(true);
  14813. range.moveStart('character', start);
  14814. range.moveEnd('character', end - start);
  14815. range.select();
  14816. } else {
  14817. ReactDOMSelection.setOffsets(input, offsets);
  14818. }
  14819. }
  14820. };
  14821. module.exports = ReactInputSelection;
  14822. /***/ },
  14823. /* 137 */
  14824. /***/ function(module, exports, __webpack_require__) {
  14825. /**
  14826. * Copyright 2013-present, Facebook, Inc.
  14827. * All rights reserved.
  14828. *
  14829. * This source code is licensed under the BSD-style license found in the
  14830. * LICENSE file in the root directory of this source tree. An additional grant
  14831. * of patent rights can be found in the PATENTS file in the same directory.
  14832. *
  14833. * @providesModule ReactDOMSelection
  14834. */
  14835. 'use strict';
  14836. var ExecutionEnvironment = __webpack_require__(19);
  14837. var getNodeForCharacterOffset = __webpack_require__(138);
  14838. var getTextContentAccessor = __webpack_require__(50);
  14839. /**
  14840. * While `isCollapsed` is available on the Selection object and `collapsed`
  14841. * is available on the Range object, IE11 sometimes gets them wrong.
  14842. * If the anchor/focus nodes and offsets are the same, the range is collapsed.
  14843. */
  14844. function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {
  14845. return anchorNode === focusNode && anchorOffset === focusOffset;
  14846. }
  14847. /**
  14848. * Get the appropriate anchor and focus node/offset pairs for IE.
  14849. *
  14850. * The catch here is that IE's selection API doesn't provide information
  14851. * about whether the selection is forward or backward, so we have to
  14852. * behave as though it's always forward.
  14853. *
  14854. * IE text differs from modern selection in that it behaves as though
  14855. * block elements end with a new line. This means character offsets will
  14856. * differ between the two APIs.
  14857. *
  14858. * @param {DOMElement} node
  14859. * @return {object}
  14860. */
  14861. function getIEOffsets(node) {
  14862. var selection = document.selection;
  14863. var selectedRange = selection.createRange();
  14864. var selectedLength = selectedRange.text.length;
  14865. // Duplicate selection so we can move range without breaking user selection.
  14866. var fromStart = selectedRange.duplicate();
  14867. fromStart.moveToElementText(node);
  14868. fromStart.setEndPoint('EndToStart', selectedRange);
  14869. var startOffset = fromStart.text.length;
  14870. var endOffset = startOffset + selectedLength;
  14871. return {
  14872. start: startOffset,
  14873. end: endOffset
  14874. };
  14875. }
  14876. /**
  14877. * @param {DOMElement} node
  14878. * @return {?object}
  14879. */
  14880. function getModernOffsets(node) {
  14881. var selection = window.getSelection && window.getSelection();
  14882. if (!selection || selection.rangeCount === 0) {
  14883. return null;
  14884. }
  14885. var anchorNode = selection.anchorNode;
  14886. var anchorOffset = selection.anchorOffset;
  14887. var focusNode = selection.focusNode;
  14888. var focusOffset = selection.focusOffset;
  14889. var currentRange = selection.getRangeAt(0);
  14890. // In Firefox, range.startContainer and range.endContainer can be "anonymous
  14891. // divs", e.g. the up/down buttons on an <input type="number">. Anonymous
  14892. // divs do not seem to expose properties, triggering a "Permission denied
  14893. // error" if any of its properties are accessed. The only seemingly possible
  14894. // way to avoid erroring is to access a property that typically works for
  14895. // non-anonymous divs and catch any error that may otherwise arise. See
  14896. // https://bugzilla.mozilla.org/show_bug.cgi?id=208427
  14897. try {
  14898. /* eslint-disable no-unused-expressions */
  14899. currentRange.startContainer.nodeType;
  14900. currentRange.endContainer.nodeType;
  14901. /* eslint-enable no-unused-expressions */
  14902. } catch (e) {
  14903. return null;
  14904. }
  14905. // If the node and offset values are the same, the selection is collapsed.
  14906. // `Selection.isCollapsed` is available natively, but IE sometimes gets
  14907. // this value wrong.
  14908. var isSelectionCollapsed = isCollapsed(selection.anchorNode, selection.anchorOffset, selection.focusNode, selection.focusOffset);
  14909. var rangeLength = isSelectionCollapsed ? 0 : currentRange.toString().length;
  14910. var tempRange = currentRange.cloneRange();
  14911. tempRange.selectNodeContents(node);
  14912. tempRange.setEnd(currentRange.startContainer, currentRange.startOffset);
  14913. var isTempRangeCollapsed = isCollapsed(tempRange.startContainer, tempRange.startOffset, tempRange.endContainer, tempRange.endOffset);
  14914. var start = isTempRangeCollapsed ? 0 : tempRange.toString().length;
  14915. var end = start + rangeLength;
  14916. // Detect whether the selection is backward.
  14917. var detectionRange = document.createRange();
  14918. detectionRange.setStart(anchorNode, anchorOffset);
  14919. detectionRange.setEnd(focusNode, focusOffset);
  14920. var isBackward = detectionRange.collapsed;
  14921. return {
  14922. start: isBackward ? end : start,
  14923. end: isBackward ? start : end
  14924. };
  14925. }
  14926. /**
  14927. * @param {DOMElement|DOMTextNode} node
  14928. * @param {object} offsets
  14929. */
  14930. function setIEOffsets(node, offsets) {
  14931. var range = document.selection.createRange().duplicate();
  14932. var start, end;
  14933. if (offsets.end === undefined) {
  14934. start = offsets.start;
  14935. end = start;
  14936. } else if (offsets.start > offsets.end) {
  14937. start = offsets.end;
  14938. end = offsets.start;
  14939. } else {
  14940. start = offsets.start;
  14941. end = offsets.end;
  14942. }
  14943. range.moveToElementText(node);
  14944. range.moveStart('character', start);
  14945. range.setEndPoint('EndToStart', range);
  14946. range.moveEnd('character', end - start);
  14947. range.select();
  14948. }
  14949. /**
  14950. * In modern non-IE browsers, we can support both forward and backward
  14951. * selections.
  14952. *
  14953. * Note: IE10+ supports the Selection object, but it does not support
  14954. * the `extend` method, which means that even in modern IE, it's not possible
  14955. * to programmatically create a backward selection. Thus, for all IE
  14956. * versions, we use the old IE API to create our selections.
  14957. *
  14958. * @param {DOMElement|DOMTextNode} node
  14959. * @param {object} offsets
  14960. */
  14961. function setModernOffsets(node, offsets) {
  14962. if (!window.getSelection) {
  14963. return;
  14964. }
  14965. var selection = window.getSelection();
  14966. var length = node[getTextContentAccessor()].length;
  14967. var start = Math.min(offsets.start, length);
  14968. var end = offsets.end === undefined ? start : Math.min(offsets.end, length);
  14969. // IE 11 uses modern selection, but doesn't support the extend method.
  14970. // Flip backward selections, so we can set with a single range.
  14971. if (!selection.extend && start > end) {
  14972. var temp = end;
  14973. end = start;
  14974. start = temp;
  14975. }
  14976. var startMarker = getNodeForCharacterOffset(node, start);
  14977. var endMarker = getNodeForCharacterOffset(node, end);
  14978. if (startMarker && endMarker) {
  14979. var range = document.createRange();
  14980. range.setStart(startMarker.node, startMarker.offset);
  14981. selection.removeAllRanges();
  14982. if (start > end) {
  14983. selection.addRange(range);
  14984. selection.extend(endMarker.node, endMarker.offset);
  14985. } else {
  14986. range.setEnd(endMarker.node, endMarker.offset);
  14987. selection.addRange(range);
  14988. }
  14989. }
  14990. }
  14991. var useIEOffsets = ExecutionEnvironment.canUseDOM && 'selection' in document && !('getSelection' in window);
  14992. var ReactDOMSelection = {
  14993. /**
  14994. * @param {DOMElement} node
  14995. */
  14996. getOffsets: useIEOffsets ? getIEOffsets : getModernOffsets,
  14997. /**
  14998. * @param {DOMElement|DOMTextNode} node
  14999. * @param {object} offsets
  15000. */
  15001. setOffsets: useIEOffsets ? setIEOffsets : setModernOffsets
  15002. };
  15003. module.exports = ReactDOMSelection;
  15004. /***/ },
  15005. /* 138 */
  15006. /***/ function(module, exports) {
  15007. /**
  15008. * Copyright 2013-present, Facebook, Inc.
  15009. * All rights reserved.
  15010. *
  15011. * This source code is licensed under the BSD-style license found in the
  15012. * LICENSE file in the root directory of this source tree. An additional grant
  15013. * of patent rights can be found in the PATENTS file in the same directory.
  15014. *
  15015. * @providesModule getNodeForCharacterOffset
  15016. */
  15017. 'use strict';
  15018. /**
  15019. * Given any node return the first leaf node without children.
  15020. *
  15021. * @param {DOMElement|DOMTextNode} node
  15022. * @return {DOMElement|DOMTextNode}
  15023. */
  15024. function getLeafNode(node) {
  15025. while (node && node.firstChild) {
  15026. node = node.firstChild;
  15027. }
  15028. return node;
  15029. }
  15030. /**
  15031. * Get the next sibling within a container. This will walk up the
  15032. * DOM if a node's siblings have been exhausted.
  15033. *
  15034. * @param {DOMElement|DOMTextNode} node
  15035. * @return {?DOMElement|DOMTextNode}
  15036. */
  15037. function getSiblingNode(node) {
  15038. while (node) {
  15039. if (node.nextSibling) {
  15040. return node.nextSibling;
  15041. }
  15042. node = node.parentNode;
  15043. }
  15044. }
  15045. /**
  15046. * Get object describing the nodes which contain characters at offset.
  15047. *
  15048. * @param {DOMElement|DOMTextNode} root
  15049. * @param {number} offset
  15050. * @return {?object}
  15051. */
  15052. function getNodeForCharacterOffset(root, offset) {
  15053. var node = getLeafNode(root);
  15054. var nodeStart = 0;
  15055. var nodeEnd = 0;
  15056. while (node) {
  15057. if (node.nodeType === 3) {
  15058. nodeEnd = nodeStart + node.textContent.length;
  15059. if (nodeStart <= offset && nodeEnd >= offset) {
  15060. return {
  15061. node: node,
  15062. offset: offset - nodeStart
  15063. };
  15064. }
  15065. nodeStart = nodeEnd;
  15066. }
  15067. node = getLeafNode(getSiblingNode(node));
  15068. }
  15069. }
  15070. module.exports = getNodeForCharacterOffset;
  15071. /***/ },
  15072. /* 139 */
  15073. /***/ function(module, exports, __webpack_require__) {
  15074. 'use strict';
  15075. /**
  15076. * Copyright (c) 2013-present, Facebook, Inc.
  15077. * All rights reserved.
  15078. *
  15079. * This source code is licensed under the BSD-style license found in the
  15080. * LICENSE file in the root directory of this source tree. An additional grant
  15081. * of patent rights can be found in the PATENTS file in the same directory.
  15082. *
  15083. *
  15084. */
  15085. var isTextNode = __webpack_require__(140);
  15086. /*eslint-disable no-bitwise */
  15087. /**
  15088. * Checks if a given DOM node contains or is another DOM node.
  15089. */
  15090. function containsNode(outerNode, innerNode) {
  15091. if (!outerNode || !innerNode) {
  15092. return false;
  15093. } else if (outerNode === innerNode) {
  15094. return true;
  15095. } else if (isTextNode(outerNode)) {
  15096. return false;
  15097. } else if (isTextNode(innerNode)) {
  15098. return containsNode(outerNode, innerNode.parentNode);
  15099. } else if ('contains' in outerNode) {
  15100. return outerNode.contains(innerNode);
  15101. } else if (outerNode.compareDocumentPosition) {
  15102. return !!(outerNode.compareDocumentPosition(innerNode) & 16);
  15103. } else {
  15104. return false;
  15105. }
  15106. }
  15107. module.exports = containsNode;
  15108. /***/ },
  15109. /* 140 */
  15110. /***/ function(module, exports, __webpack_require__) {
  15111. 'use strict';
  15112. /**
  15113. * Copyright (c) 2013-present, Facebook, Inc.
  15114. * All rights reserved.
  15115. *
  15116. * This source code is licensed under the BSD-style license found in the
  15117. * LICENSE file in the root directory of this source tree. An additional grant
  15118. * of patent rights can be found in the PATENTS file in the same directory.
  15119. *
  15120. * @typechecks
  15121. */
  15122. var isNode = __webpack_require__(141);
  15123. /**
  15124. * @param {*} object The object to check.
  15125. * @return {boolean} Whether or not the object is a DOM text node.
  15126. */
  15127. function isTextNode(object) {
  15128. return isNode(object) && object.nodeType == 3;
  15129. }
  15130. module.exports = isTextNode;
  15131. /***/ },
  15132. /* 141 */
  15133. /***/ function(module, exports) {
  15134. 'use strict';
  15135. /**
  15136. * Copyright (c) 2013-present, Facebook, Inc.
  15137. * All rights reserved.
  15138. *
  15139. * This source code is licensed under the BSD-style license found in the
  15140. * LICENSE file in the root directory of this source tree. An additional grant
  15141. * of patent rights can be found in the PATENTS file in the same directory.
  15142. *
  15143. * @typechecks
  15144. */
  15145. /**
  15146. * @param {*} object The object to check.
  15147. * @return {boolean} Whether or not the object is a DOM node.
  15148. */
  15149. function isNode(object) {
  15150. return !!(object && (typeof Node === 'function' ? object instanceof Node : typeof object === 'object' && typeof object.nodeType === 'number' && typeof object.nodeName === 'string'));
  15151. }
  15152. module.exports = isNode;
  15153. /***/ },
  15154. /* 142 */
  15155. /***/ function(module, exports) {
  15156. 'use strict';
  15157. /**
  15158. * Copyright (c) 2013-present, Facebook, Inc.
  15159. * All rights reserved.
  15160. *
  15161. * This source code is licensed under the BSD-style license found in the
  15162. * LICENSE file in the root directory of this source tree. An additional grant
  15163. * of patent rights can be found in the PATENTS file in the same directory.
  15164. *
  15165. * @typechecks
  15166. */
  15167. /* eslint-disable fb-www/typeof-undefined */
  15168. /**
  15169. * Same as document.activeElement but wraps in a try-catch block. In IE it is
  15170. * not safe to call document.activeElement if there is nothing focused.
  15171. *
  15172. * The activeElement will be null only if the document or document body is not
  15173. * yet defined.
  15174. */
  15175. function getActiveElement() /*?DOMElement*/{
  15176. if (typeof document === 'undefined') {
  15177. return null;
  15178. }
  15179. try {
  15180. return document.activeElement || document.body;
  15181. } catch (e) {
  15182. return document.body;
  15183. }
  15184. }
  15185. module.exports = getActiveElement;
  15186. /***/ },
  15187. /* 143 */
  15188. /***/ function(module, exports) {
  15189. /**
  15190. * Copyright 2013-present, Facebook, Inc.
  15191. * All rights reserved.
  15192. *
  15193. * This source code is licensed under the BSD-style license found in the
  15194. * LICENSE file in the root directory of this source tree. An additional grant
  15195. * of patent rights can be found in the PATENTS file in the same directory.
  15196. *
  15197. * @providesModule SVGDOMPropertyConfig
  15198. */
  15199. 'use strict';
  15200. var NS = {
  15201. xlink: 'http://www.w3.org/1999/xlink',
  15202. xml: 'http://www.w3.org/XML/1998/namespace'
  15203. };
  15204. // We use attributes for everything SVG so let's avoid some duplication and run
  15205. // code instead.
  15206. // The following are all specified in the HTML config already so we exclude here.
  15207. // - class (as className)
  15208. // - color
  15209. // - height
  15210. // - id
  15211. // - lang
  15212. // - max
  15213. // - media
  15214. // - method
  15215. // - min
  15216. // - name
  15217. // - style
  15218. // - target
  15219. // - type
  15220. // - width
  15221. var ATTRS = {
  15222. accentHeight: 'accent-height',
  15223. accumulate: 0,
  15224. additive: 0,
  15225. alignmentBaseline: 'alignment-baseline',
  15226. allowReorder: 'allowReorder',
  15227. alphabetic: 0,
  15228. amplitude: 0,
  15229. arabicForm: 'arabic-form',
  15230. ascent: 0,
  15231. attributeName: 'attributeName',
  15232. attributeType: 'attributeType',
  15233. autoReverse: 'autoReverse',
  15234. azimuth: 0,
  15235. baseFrequency: 'baseFrequency',
  15236. baseProfile: 'baseProfile',
  15237. baselineShift: 'baseline-shift',
  15238. bbox: 0,
  15239. begin: 0,
  15240. bias: 0,
  15241. by: 0,
  15242. calcMode: 'calcMode',
  15243. capHeight: 'cap-height',
  15244. clip: 0,
  15245. clipPath: 'clip-path',
  15246. clipRule: 'clip-rule',
  15247. clipPathUnits: 'clipPathUnits',
  15248. colorInterpolation: 'color-interpolation',
  15249. colorInterpolationFilters: 'color-interpolation-filters',
  15250. colorProfile: 'color-profile',
  15251. colorRendering: 'color-rendering',
  15252. contentScriptType: 'contentScriptType',
  15253. contentStyleType: 'contentStyleType',
  15254. cursor: 0,
  15255. cx: 0,
  15256. cy: 0,
  15257. d: 0,
  15258. decelerate: 0,
  15259. descent: 0,
  15260. diffuseConstant: 'diffuseConstant',
  15261. direction: 0,
  15262. display: 0,
  15263. divisor: 0,
  15264. dominantBaseline: 'dominant-baseline',
  15265. dur: 0,
  15266. dx: 0,
  15267. dy: 0,
  15268. edgeMode: 'edgeMode',
  15269. elevation: 0,
  15270. enableBackground: 'enable-background',
  15271. end: 0,
  15272. exponent: 0,
  15273. externalResourcesRequired: 'externalResourcesRequired',
  15274. fill: 0,
  15275. fillOpacity: 'fill-opacity',
  15276. fillRule: 'fill-rule',
  15277. filter: 0,
  15278. filterRes: 'filterRes',
  15279. filterUnits: 'filterUnits',
  15280. floodColor: 'flood-color',
  15281. floodOpacity: 'flood-opacity',
  15282. focusable: 0,
  15283. fontFamily: 'font-family',
  15284. fontSize: 'font-size',
  15285. fontSizeAdjust: 'font-size-adjust',
  15286. fontStretch: 'font-stretch',
  15287. fontStyle: 'font-style',
  15288. fontVariant: 'font-variant',
  15289. fontWeight: 'font-weight',
  15290. format: 0,
  15291. from: 0,
  15292. fx: 0,
  15293. fy: 0,
  15294. g1: 0,
  15295. g2: 0,
  15296. glyphName: 'glyph-name',
  15297. glyphOrientationHorizontal: 'glyph-orientation-horizontal',
  15298. glyphOrientationVertical: 'glyph-orientation-vertical',
  15299. glyphRef: 'glyphRef',
  15300. gradientTransform: 'gradientTransform',
  15301. gradientUnits: 'gradientUnits',
  15302. hanging: 0,
  15303. horizAdvX: 'horiz-adv-x',
  15304. horizOriginX: 'horiz-origin-x',
  15305. ideographic: 0,
  15306. imageRendering: 'image-rendering',
  15307. 'in': 0,
  15308. in2: 0,
  15309. intercept: 0,
  15310. k: 0,
  15311. k1: 0,
  15312. k2: 0,
  15313. k3: 0,
  15314. k4: 0,
  15315. kernelMatrix: 'kernelMatrix',
  15316. kernelUnitLength: 'kernelUnitLength',
  15317. kerning: 0,
  15318. keyPoints: 'keyPoints',
  15319. keySplines: 'keySplines',
  15320. keyTimes: 'keyTimes',
  15321. lengthAdjust: 'lengthAdjust',
  15322. letterSpacing: 'letter-spacing',
  15323. lightingColor: 'lighting-color',
  15324. limitingConeAngle: 'limitingConeAngle',
  15325. local: 0,
  15326. markerEnd: 'marker-end',
  15327. markerMid: 'marker-mid',
  15328. markerStart: 'marker-start',
  15329. markerHeight: 'markerHeight',
  15330. markerUnits: 'markerUnits',
  15331. markerWidth: 'markerWidth',
  15332. mask: 0,
  15333. maskContentUnits: 'maskContentUnits',
  15334. maskUnits: 'maskUnits',
  15335. mathematical: 0,
  15336. mode: 0,
  15337. numOctaves: 'numOctaves',
  15338. offset: 0,
  15339. opacity: 0,
  15340. operator: 0,
  15341. order: 0,
  15342. orient: 0,
  15343. orientation: 0,
  15344. origin: 0,
  15345. overflow: 0,
  15346. overlinePosition: 'overline-position',
  15347. overlineThickness: 'overline-thickness',
  15348. paintOrder: 'paint-order',
  15349. panose1: 'panose-1',
  15350. pathLength: 'pathLength',
  15351. patternContentUnits: 'patternContentUnits',
  15352. patternTransform: 'patternTransform',
  15353. patternUnits: 'patternUnits',
  15354. pointerEvents: 'pointer-events',
  15355. points: 0,
  15356. pointsAtX: 'pointsAtX',
  15357. pointsAtY: 'pointsAtY',
  15358. pointsAtZ: 'pointsAtZ',
  15359. preserveAlpha: 'preserveAlpha',
  15360. preserveAspectRatio: 'preserveAspectRatio',
  15361. primitiveUnits: 'primitiveUnits',
  15362. r: 0,
  15363. radius: 0,
  15364. refX: 'refX',
  15365. refY: 'refY',
  15366. renderingIntent: 'rendering-intent',
  15367. repeatCount: 'repeatCount',
  15368. repeatDur: 'repeatDur',
  15369. requiredExtensions: 'requiredExtensions',
  15370. requiredFeatures: 'requiredFeatures',
  15371. restart: 0,
  15372. result: 0,
  15373. rotate: 0,
  15374. rx: 0,
  15375. ry: 0,
  15376. scale: 0,
  15377. seed: 0,
  15378. shapeRendering: 'shape-rendering',
  15379. slope: 0,
  15380. spacing: 0,
  15381. specularConstant: 'specularConstant',
  15382. specularExponent: 'specularExponent',
  15383. speed: 0,
  15384. spreadMethod: 'spreadMethod',
  15385. startOffset: 'startOffset',
  15386. stdDeviation: 'stdDeviation',
  15387. stemh: 0,
  15388. stemv: 0,
  15389. stitchTiles: 'stitchTiles',
  15390. stopColor: 'stop-color',
  15391. stopOpacity: 'stop-opacity',
  15392. strikethroughPosition: 'strikethrough-position',
  15393. strikethroughThickness: 'strikethrough-thickness',
  15394. string: 0,
  15395. stroke: 0,
  15396. strokeDasharray: 'stroke-dasharray',
  15397. strokeDashoffset: 'stroke-dashoffset',
  15398. strokeLinecap: 'stroke-linecap',
  15399. strokeLinejoin: 'stroke-linejoin',
  15400. strokeMiterlimit: 'stroke-miterlimit',
  15401. strokeOpacity: 'stroke-opacity',
  15402. strokeWidth: 'stroke-width',
  15403. surfaceScale: 'surfaceScale',
  15404. systemLanguage: 'systemLanguage',
  15405. tableValues: 'tableValues',
  15406. targetX: 'targetX',
  15407. targetY: 'targetY',
  15408. textAnchor: 'text-anchor',
  15409. textDecoration: 'text-decoration',
  15410. textRendering: 'text-rendering',
  15411. textLength: 'textLength',
  15412. to: 0,
  15413. transform: 0,
  15414. u1: 0,
  15415. u2: 0,
  15416. underlinePosition: 'underline-position',
  15417. underlineThickness: 'underline-thickness',
  15418. unicode: 0,
  15419. unicodeBidi: 'unicode-bidi',
  15420. unicodeRange: 'unicode-range',
  15421. unitsPerEm: 'units-per-em',
  15422. vAlphabetic: 'v-alphabetic',
  15423. vHanging: 'v-hanging',
  15424. vIdeographic: 'v-ideographic',
  15425. vMathematical: 'v-mathematical',
  15426. values: 0,
  15427. vectorEffect: 'vector-effect',
  15428. version: 0,
  15429. vertAdvY: 'vert-adv-y',
  15430. vertOriginX: 'vert-origin-x',
  15431. vertOriginY: 'vert-origin-y',
  15432. viewBox: 'viewBox',
  15433. viewTarget: 'viewTarget',
  15434. visibility: 0,
  15435. widths: 0,
  15436. wordSpacing: 'word-spacing',
  15437. writingMode: 'writing-mode',
  15438. x: 0,
  15439. xHeight: 'x-height',
  15440. x1: 0,
  15441. x2: 0,
  15442. xChannelSelector: 'xChannelSelector',
  15443. xlinkActuate: 'xlink:actuate',
  15444. xlinkArcrole: 'xlink:arcrole',
  15445. xlinkHref: 'xlink:href',
  15446. xlinkRole: 'xlink:role',
  15447. xlinkShow: 'xlink:show',
  15448. xlinkTitle: 'xlink:title',
  15449. xlinkType: 'xlink:type',
  15450. xmlBase: 'xml:base',
  15451. xmlLang: 'xml:lang',
  15452. xmlSpace: 'xml:space',
  15453. y: 0,
  15454. y1: 0,
  15455. y2: 0,
  15456. yChannelSelector: 'yChannelSelector',
  15457. z: 0,
  15458. zoomAndPan: 'zoomAndPan'
  15459. };
  15460. var SVGDOMPropertyConfig = {
  15461. Properties: {},
  15462. DOMAttributeNamespaces: {
  15463. xlinkActuate: NS.xlink,
  15464. xlinkArcrole: NS.xlink,
  15465. xlinkHref: NS.xlink,
  15466. xlinkRole: NS.xlink,
  15467. xlinkShow: NS.xlink,
  15468. xlinkTitle: NS.xlink,
  15469. xlinkType: NS.xlink,
  15470. xmlBase: NS.xml,
  15471. xmlLang: NS.xml,
  15472. xmlSpace: NS.xml
  15473. },
  15474. DOMAttributeNames: {}
  15475. };
  15476. Object.keys(ATTRS).forEach(function (key) {
  15477. SVGDOMPropertyConfig.Properties[key] = 0;
  15478. if (ATTRS[key]) {
  15479. SVGDOMPropertyConfig.DOMAttributeNames[key] = ATTRS[key];
  15480. }
  15481. });
  15482. module.exports = SVGDOMPropertyConfig;
  15483. /***/ },
  15484. /* 144 */
  15485. /***/ function(module, exports, __webpack_require__) {
  15486. /**
  15487. * Copyright 2013-present, Facebook, Inc.
  15488. * All rights reserved.
  15489. *
  15490. * This source code is licensed under the BSD-style license found in the
  15491. * LICENSE file in the root directory of this source tree. An additional grant
  15492. * of patent rights can be found in the PATENTS file in the same directory.
  15493. *
  15494. * @providesModule SelectEventPlugin
  15495. */
  15496. 'use strict';
  15497. var EventConstants = __webpack_require__(41);
  15498. var EventPropagators = __webpack_require__(42);
  15499. var ExecutionEnvironment = __webpack_require__(19);
  15500. var ReactDOMComponentTree = __webpack_require__(36);
  15501. var ReactInputSelection = __webpack_require__(136);
  15502. var SyntheticEvent = __webpack_require__(52);
  15503. var getActiveElement = __webpack_require__(142);
  15504. var isTextInputElement = __webpack_require__(64);
  15505. var keyOf = __webpack_require__(27);
  15506. var shallowEqual = __webpack_require__(125);
  15507. var topLevelTypes = EventConstants.topLevelTypes;
  15508. var skipSelectionChangeEvent = ExecutionEnvironment.canUseDOM && 'documentMode' in document && document.documentMode <= 11;
  15509. var eventTypes = {
  15510. select: {
  15511. phasedRegistrationNames: {
  15512. bubbled: keyOf({ onSelect: null }),
  15513. captured: keyOf({ onSelectCapture: null })
  15514. },
  15515. dependencies: [topLevelTypes.topBlur, topLevelTypes.topContextMenu, topLevelTypes.topFocus, topLevelTypes.topKeyDown, topLevelTypes.topMouseDown, topLevelTypes.topMouseUp, topLevelTypes.topSelectionChange]
  15516. }
  15517. };
  15518. var activeElement = null;
  15519. var activeElementInst = null;
  15520. var lastSelection = null;
  15521. var mouseDown = false;
  15522. // Track whether a listener exists for this plugin. If none exist, we do
  15523. // not extract events. See #3639.
  15524. var hasListener = false;
  15525. var ON_SELECT_KEY = keyOf({ onSelect: null });
  15526. /**
  15527. * Get an object which is a unique representation of the current selection.
  15528. *
  15529. * The return value will not be consistent across nodes or browsers, but
  15530. * two identical selections on the same node will return identical objects.
  15531. *
  15532. * @param {DOMElement} node
  15533. * @return {object}
  15534. */
  15535. function getSelection(node) {
  15536. if ('selectionStart' in node && ReactInputSelection.hasSelectionCapabilities(node)) {
  15537. return {
  15538. start: node.selectionStart,
  15539. end: node.selectionEnd
  15540. };
  15541. } else if (window.getSelection) {
  15542. var selection = window.getSelection();
  15543. return {
  15544. anchorNode: selection.anchorNode,
  15545. anchorOffset: selection.anchorOffset,
  15546. focusNode: selection.focusNode,
  15547. focusOffset: selection.focusOffset
  15548. };
  15549. } else if (document.selection) {
  15550. var range = document.selection.createRange();
  15551. return {
  15552. parentElement: range.parentElement(),
  15553. text: range.text,
  15554. top: range.boundingTop,
  15555. left: range.boundingLeft
  15556. };
  15557. }
  15558. }
  15559. /**
  15560. * Poll selection to see whether it's changed.
  15561. *
  15562. * @param {object} nativeEvent
  15563. * @return {?SyntheticEvent}
  15564. */
  15565. function constructSelectEvent(nativeEvent, nativeEventTarget) {
  15566. // Ensure we have the right element, and that the user is not dragging a
  15567. // selection (this matches native `select` event behavior). In HTML5, select
  15568. // fires only on input and textarea thus if there's no focused element we
  15569. // won't dispatch.
  15570. if (mouseDown || activeElement == null || activeElement !== getActiveElement()) {
  15571. return null;
  15572. }
  15573. // Only fire when selection has actually changed.
  15574. var currentSelection = getSelection(activeElement);
  15575. if (!lastSelection || !shallowEqual(lastSelection, currentSelection)) {
  15576. lastSelection = currentSelection;
  15577. var syntheticEvent = SyntheticEvent.getPooled(eventTypes.select, activeElementInst, nativeEvent, nativeEventTarget);
  15578. syntheticEvent.type = 'select';
  15579. syntheticEvent.target = activeElement;
  15580. EventPropagators.accumulateTwoPhaseDispatches(syntheticEvent);
  15581. return syntheticEvent;
  15582. }
  15583. return null;
  15584. }
  15585. /**
  15586. * This plugin creates an `onSelect` event that normalizes select events
  15587. * across form elements.
  15588. *
  15589. * Supported elements are:
  15590. * - input (see `isTextInputElement`)
  15591. * - textarea
  15592. * - contentEditable
  15593. *
  15594. * This differs from native browser implementations in the following ways:
  15595. * - Fires on contentEditable fields as well as inputs.
  15596. * - Fires for collapsed selection.
  15597. * - Fires after user input.
  15598. */
  15599. var SelectEventPlugin = {
  15600. eventTypes: eventTypes,
  15601. extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
  15602. if (!hasListener) {
  15603. return null;
  15604. }
  15605. var targetNode = targetInst ? ReactDOMComponentTree.getNodeFromInstance(targetInst) : window;
  15606. switch (topLevelType) {
  15607. // Track the input node that has focus.
  15608. case topLevelTypes.topFocus:
  15609. if (isTextInputElement(targetNode) || targetNode.contentEditable === 'true') {
  15610. activeElement = targetNode;
  15611. activeElementInst = targetInst;
  15612. lastSelection = null;
  15613. }
  15614. break;
  15615. case topLevelTypes.topBlur:
  15616. activeElement = null;
  15617. activeElementInst = null;
  15618. lastSelection = null;
  15619. break;
  15620. // Don't fire the event while the user is dragging. This matches the
  15621. // semantics of the native select event.
  15622. case topLevelTypes.topMouseDown:
  15623. mouseDown = true;
  15624. break;
  15625. case topLevelTypes.topContextMenu:
  15626. case topLevelTypes.topMouseUp:
  15627. mouseDown = false;
  15628. return constructSelectEvent(nativeEvent, nativeEventTarget);
  15629. // Chrome and IE fire non-standard event when selection is changed (and
  15630. // sometimes when it hasn't). IE's event fires out of order with respect
  15631. // to key and input events on deletion, so we discard it.
  15632. //
  15633. // Firefox doesn't support selectionchange, so check selection status
  15634. // after each key entry. The selection changes after keydown and before
  15635. // keyup, but we check on keydown as well in the case of holding down a
  15636. // key, when multiple keydown events are fired but only one keyup is.
  15637. // This is also our approach for IE handling, for the reason above.
  15638. case topLevelTypes.topSelectionChange:
  15639. if (skipSelectionChangeEvent) {
  15640. break;
  15641. }
  15642. // falls through
  15643. case topLevelTypes.topKeyDown:
  15644. case topLevelTypes.topKeyUp:
  15645. return constructSelectEvent(nativeEvent, nativeEventTarget);
  15646. }
  15647. return null;
  15648. },
  15649. didPutListener: function (inst, registrationName, listener) {
  15650. if (registrationName === ON_SELECT_KEY) {
  15651. hasListener = true;
  15652. }
  15653. }
  15654. };
  15655. module.exports = SelectEventPlugin;
  15656. /***/ },
  15657. /* 145 */
  15658. /***/ function(module, exports, __webpack_require__) {
  15659. /**
  15660. * Copyright 2013-present, Facebook, Inc.
  15661. * All rights reserved.
  15662. *
  15663. * This source code is licensed under the BSD-style license found in the
  15664. * LICENSE file in the root directory of this source tree. An additional grant
  15665. * of patent rights can be found in the PATENTS file in the same directory.
  15666. *
  15667. * @providesModule SimpleEventPlugin
  15668. */
  15669. 'use strict';
  15670. var EventConstants = __webpack_require__(41);
  15671. var EventListener = __webpack_require__(132);
  15672. var EventPropagators = __webpack_require__(42);
  15673. var ReactDOMComponentTree = __webpack_require__(36);
  15674. var SyntheticAnimationEvent = __webpack_require__(146);
  15675. var SyntheticClipboardEvent = __webpack_require__(147);
  15676. var SyntheticEvent = __webpack_require__(52);
  15677. var SyntheticFocusEvent = __webpack_require__(148);
  15678. var SyntheticKeyboardEvent = __webpack_require__(149);
  15679. var SyntheticMouseEvent = __webpack_require__(67);
  15680. var SyntheticDragEvent = __webpack_require__(152);
  15681. var SyntheticTouchEvent = __webpack_require__(153);
  15682. var SyntheticTransitionEvent = __webpack_require__(154);
  15683. var SyntheticUIEvent = __webpack_require__(68);
  15684. var SyntheticWheelEvent = __webpack_require__(155);
  15685. var emptyFunction = __webpack_require__(10);
  15686. var getEventCharCode = __webpack_require__(150);
  15687. var invariant = __webpack_require__(6);
  15688. var keyOf = __webpack_require__(27);
  15689. var topLevelTypes = EventConstants.topLevelTypes;
  15690. var eventTypes = {
  15691. abort: {
  15692. phasedRegistrationNames: {
  15693. bubbled: keyOf({ onAbort: true }),
  15694. captured: keyOf({ onAbortCapture: true })
  15695. }
  15696. },
  15697. animationEnd: {
  15698. phasedRegistrationNames: {
  15699. bubbled: keyOf({ onAnimationEnd: true }),
  15700. captured: keyOf({ onAnimationEndCapture: true })
  15701. }
  15702. },
  15703. animationIteration: {
  15704. phasedRegistrationNames: {
  15705. bubbled: keyOf({ onAnimationIteration: true }),
  15706. captured: keyOf({ onAnimationIterationCapture: true })
  15707. }
  15708. },
  15709. animationStart: {
  15710. phasedRegistrationNames: {
  15711. bubbled: keyOf({ onAnimationStart: true }),
  15712. captured: keyOf({ onAnimationStartCapture: true })
  15713. }
  15714. },
  15715. blur: {
  15716. phasedRegistrationNames: {
  15717. bubbled: keyOf({ onBlur: true }),
  15718. captured: keyOf({ onBlurCapture: true })
  15719. }
  15720. },
  15721. canPlay: {
  15722. phasedRegistrationNames: {
  15723. bubbled: keyOf({ onCanPlay: true }),
  15724. captured: keyOf({ onCanPlayCapture: true })
  15725. }
  15726. },
  15727. canPlayThrough: {
  15728. phasedRegistrationNames: {
  15729. bubbled: keyOf({ onCanPlayThrough: true }),
  15730. captured: keyOf({ onCanPlayThroughCapture: true })
  15731. }
  15732. },
  15733. click: {
  15734. phasedRegistrationNames: {
  15735. bubbled: keyOf({ onClick: true }),
  15736. captured: keyOf({ onClickCapture: true })
  15737. }
  15738. },
  15739. contextMenu: {
  15740. phasedRegistrationNames: {
  15741. bubbled: keyOf({ onContextMenu: true }),
  15742. captured: keyOf({ onContextMenuCapture: true })
  15743. }
  15744. },
  15745. copy: {
  15746. phasedRegistrationNames: {
  15747. bubbled: keyOf({ onCopy: true }),
  15748. captured: keyOf({ onCopyCapture: true })
  15749. }
  15750. },
  15751. cut: {
  15752. phasedRegistrationNames: {
  15753. bubbled: keyOf({ onCut: true }),
  15754. captured: keyOf({ onCutCapture: true })
  15755. }
  15756. },
  15757. doubleClick: {
  15758. phasedRegistrationNames: {
  15759. bubbled: keyOf({ onDoubleClick: true }),
  15760. captured: keyOf({ onDoubleClickCapture: true })
  15761. }
  15762. },
  15763. drag: {
  15764. phasedRegistrationNames: {
  15765. bubbled: keyOf({ onDrag: true }),
  15766. captured: keyOf({ onDragCapture: true })
  15767. }
  15768. },
  15769. dragEnd: {
  15770. phasedRegistrationNames: {
  15771. bubbled: keyOf({ onDragEnd: true }),
  15772. captured: keyOf({ onDragEndCapture: true })
  15773. }
  15774. },
  15775. dragEnter: {
  15776. phasedRegistrationNames: {
  15777. bubbled: keyOf({ onDragEnter: true }),
  15778. captured: keyOf({ onDragEnterCapture: true })
  15779. }
  15780. },
  15781. dragExit: {
  15782. phasedRegistrationNames: {
  15783. bubbled: keyOf({ onDragExit: true }),
  15784. captured: keyOf({ onDragExitCapture: true })
  15785. }
  15786. },
  15787. dragLeave: {
  15788. phasedRegistrationNames: {
  15789. bubbled: keyOf({ onDragLeave: true }),
  15790. captured: keyOf({ onDragLeaveCapture: true })
  15791. }
  15792. },
  15793. dragOver: {
  15794. phasedRegistrationNames: {
  15795. bubbled: keyOf({ onDragOver: true }),
  15796. captured: keyOf({ onDragOverCapture: true })
  15797. }
  15798. },
  15799. dragStart: {
  15800. phasedRegistrationNames: {
  15801. bubbled: keyOf({ onDragStart: true }),
  15802. captured: keyOf({ onDragStartCapture: true })
  15803. }
  15804. },
  15805. drop: {
  15806. phasedRegistrationNames: {
  15807. bubbled: keyOf({ onDrop: true }),
  15808. captured: keyOf({ onDropCapture: true })
  15809. }
  15810. },
  15811. durationChange: {
  15812. phasedRegistrationNames: {
  15813. bubbled: keyOf({ onDurationChange: true }),
  15814. captured: keyOf({ onDurationChangeCapture: true })
  15815. }
  15816. },
  15817. emptied: {
  15818. phasedRegistrationNames: {
  15819. bubbled: keyOf({ onEmptied: true }),
  15820. captured: keyOf({ onEmptiedCapture: true })
  15821. }
  15822. },
  15823. encrypted: {
  15824. phasedRegistrationNames: {
  15825. bubbled: keyOf({ onEncrypted: true }),
  15826. captured: keyOf({ onEncryptedCapture: true })
  15827. }
  15828. },
  15829. ended: {
  15830. phasedRegistrationNames: {
  15831. bubbled: keyOf({ onEnded: true }),
  15832. captured: keyOf({ onEndedCapture: true })
  15833. }
  15834. },
  15835. error: {
  15836. phasedRegistrationNames: {
  15837. bubbled: keyOf({ onError: true }),
  15838. captured: keyOf({ onErrorCapture: true })
  15839. }
  15840. },
  15841. focus: {
  15842. phasedRegistrationNames: {
  15843. bubbled: keyOf({ onFocus: true }),
  15844. captured: keyOf({ onFocusCapture: true })
  15845. }
  15846. },
  15847. input: {
  15848. phasedRegistrationNames: {
  15849. bubbled: keyOf({ onInput: true }),
  15850. captured: keyOf({ onInputCapture: true })
  15851. }
  15852. },
  15853. invalid: {
  15854. phasedRegistrationNames: {
  15855. bubbled: keyOf({ onInvalid: true }),
  15856. captured: keyOf({ onInvalidCapture: true })
  15857. }
  15858. },
  15859. keyDown: {
  15860. phasedRegistrationNames: {
  15861. bubbled: keyOf({ onKeyDown: true }),
  15862. captured: keyOf({ onKeyDownCapture: true })
  15863. }
  15864. },
  15865. keyPress: {
  15866. phasedRegistrationNames: {
  15867. bubbled: keyOf({ onKeyPress: true }),
  15868. captured: keyOf({ onKeyPressCapture: true })
  15869. }
  15870. },
  15871. keyUp: {
  15872. phasedRegistrationNames: {
  15873. bubbled: keyOf({ onKeyUp: true }),
  15874. captured: keyOf({ onKeyUpCapture: true })
  15875. }
  15876. },
  15877. load: {
  15878. phasedRegistrationNames: {
  15879. bubbled: keyOf({ onLoad: true }),
  15880. captured: keyOf({ onLoadCapture: true })
  15881. }
  15882. },
  15883. loadedData: {
  15884. phasedRegistrationNames: {
  15885. bubbled: keyOf({ onLoadedData: true }),
  15886. captured: keyOf({ onLoadedDataCapture: true })
  15887. }
  15888. },
  15889. loadedMetadata: {
  15890. phasedRegistrationNames: {
  15891. bubbled: keyOf({ onLoadedMetadata: true }),
  15892. captured: keyOf({ onLoadedMetadataCapture: true })
  15893. }
  15894. },
  15895. loadStart: {
  15896. phasedRegistrationNames: {
  15897. bubbled: keyOf({ onLoadStart: true }),
  15898. captured: keyOf({ onLoadStartCapture: true })
  15899. }
  15900. },
  15901. // Note: We do not allow listening to mouseOver events. Instead, use the
  15902. // onMouseEnter/onMouseLeave created by `EnterLeaveEventPlugin`.
  15903. mouseDown: {
  15904. phasedRegistrationNames: {
  15905. bubbled: keyOf({ onMouseDown: true }),
  15906. captured: keyOf({ onMouseDownCapture: true })
  15907. }
  15908. },
  15909. mouseMove: {
  15910. phasedRegistrationNames: {
  15911. bubbled: keyOf({ onMouseMove: true }),
  15912. captured: keyOf({ onMouseMoveCapture: true })
  15913. }
  15914. },
  15915. mouseOut: {
  15916. phasedRegistrationNames: {
  15917. bubbled: keyOf({ onMouseOut: true }),
  15918. captured: keyOf({ onMouseOutCapture: true })
  15919. }
  15920. },
  15921. mouseOver: {
  15922. phasedRegistrationNames: {
  15923. bubbled: keyOf({ onMouseOver: true }),
  15924. captured: keyOf({ onMouseOverCapture: true })
  15925. }
  15926. },
  15927. mouseUp: {
  15928. phasedRegistrationNames: {
  15929. bubbled: keyOf({ onMouseUp: true }),
  15930. captured: keyOf({ onMouseUpCapture: true })
  15931. }
  15932. },
  15933. paste: {
  15934. phasedRegistrationNames: {
  15935. bubbled: keyOf({ onPaste: true }),
  15936. captured: keyOf({ onPasteCapture: true })
  15937. }
  15938. },
  15939. pause: {
  15940. phasedRegistrationNames: {
  15941. bubbled: keyOf({ onPause: true }),
  15942. captured: keyOf({ onPauseCapture: true })
  15943. }
  15944. },
  15945. play: {
  15946. phasedRegistrationNames: {
  15947. bubbled: keyOf({ onPlay: true }),
  15948. captured: keyOf({ onPlayCapture: true })
  15949. }
  15950. },
  15951. playing: {
  15952. phasedRegistrationNames: {
  15953. bubbled: keyOf({ onPlaying: true }),
  15954. captured: keyOf({ onPlayingCapture: true })
  15955. }
  15956. },
  15957. progress: {
  15958. phasedRegistrationNames: {
  15959. bubbled: keyOf({ onProgress: true }),
  15960. captured: keyOf({ onProgressCapture: true })
  15961. }
  15962. },
  15963. rateChange: {
  15964. phasedRegistrationNames: {
  15965. bubbled: keyOf({ onRateChange: true }),
  15966. captured: keyOf({ onRateChangeCapture: true })
  15967. }
  15968. },
  15969. reset: {
  15970. phasedRegistrationNames: {
  15971. bubbled: keyOf({ onReset: true }),
  15972. captured: keyOf({ onResetCapture: true })
  15973. }
  15974. },
  15975. scroll: {
  15976. phasedRegistrationNames: {
  15977. bubbled: keyOf({ onScroll: true }),
  15978. captured: keyOf({ onScrollCapture: true })
  15979. }
  15980. },
  15981. seeked: {
  15982. phasedRegistrationNames: {
  15983. bubbled: keyOf({ onSeeked: true }),
  15984. captured: keyOf({ onSeekedCapture: true })
  15985. }
  15986. },
  15987. seeking: {
  15988. phasedRegistrationNames: {
  15989. bubbled: keyOf({ onSeeking: true }),
  15990. captured: keyOf({ onSeekingCapture: true })
  15991. }
  15992. },
  15993. stalled: {
  15994. phasedRegistrationNames: {
  15995. bubbled: keyOf({ onStalled: true }),
  15996. captured: keyOf({ onStalledCapture: true })
  15997. }
  15998. },
  15999. submit: {
  16000. phasedRegistrationNames: {
  16001. bubbled: keyOf({ onSubmit: true }),
  16002. captured: keyOf({ onSubmitCapture: true })
  16003. }
  16004. },
  16005. suspend: {
  16006. phasedRegistrationNames: {
  16007. bubbled: keyOf({ onSuspend: true }),
  16008. captured: keyOf({ onSuspendCapture: true })
  16009. }
  16010. },
  16011. timeUpdate: {
  16012. phasedRegistrationNames: {
  16013. bubbled: keyOf({ onTimeUpdate: true }),
  16014. captured: keyOf({ onTimeUpdateCapture: true })
  16015. }
  16016. },
  16017. touchCancel: {
  16018. phasedRegistrationNames: {
  16019. bubbled: keyOf({ onTouchCancel: true }),
  16020. captured: keyOf({ onTouchCancelCapture: true })
  16021. }
  16022. },
  16023. touchEnd: {
  16024. phasedRegistrationNames: {
  16025. bubbled: keyOf({ onTouchEnd: true }),
  16026. captured: keyOf({ onTouchEndCapture: true })
  16027. }
  16028. },
  16029. touchMove: {
  16030. phasedRegistrationNames: {
  16031. bubbled: keyOf({ onTouchMove: true }),
  16032. captured: keyOf({ onTouchMoveCapture: true })
  16033. }
  16034. },
  16035. touchStart: {
  16036. phasedRegistrationNames: {
  16037. bubbled: keyOf({ onTouchStart: true }),
  16038. captured: keyOf({ onTouchStartCapture: true })
  16039. }
  16040. },
  16041. transitionEnd: {
  16042. phasedRegistrationNames: {
  16043. bubbled: keyOf({ onTransitionEnd: true }),
  16044. captured: keyOf({ onTransitionEndCapture: true })
  16045. }
  16046. },
  16047. volumeChange: {
  16048. phasedRegistrationNames: {
  16049. bubbled: keyOf({ onVolumeChange: true }),
  16050. captured: keyOf({ onVolumeChangeCapture: true })
  16051. }
  16052. },
  16053. waiting: {
  16054. phasedRegistrationNames: {
  16055. bubbled: keyOf({ onWaiting: true }),
  16056. captured: keyOf({ onWaitingCapture: true })
  16057. }
  16058. },
  16059. wheel: {
  16060. phasedRegistrationNames: {
  16061. bubbled: keyOf({ onWheel: true }),
  16062. captured: keyOf({ onWheelCapture: true })
  16063. }
  16064. }
  16065. };
  16066. var topLevelEventsToDispatchConfig = {
  16067. topAbort: eventTypes.abort,
  16068. topAnimationEnd: eventTypes.animationEnd,
  16069. topAnimationIteration: eventTypes.animationIteration,
  16070. topAnimationStart: eventTypes.animationStart,
  16071. topBlur: eventTypes.blur,
  16072. topCanPlay: eventTypes.canPlay,
  16073. topCanPlayThrough: eventTypes.canPlayThrough,
  16074. topClick: eventTypes.click,
  16075. topContextMenu: eventTypes.contextMenu,
  16076. topCopy: eventTypes.copy,
  16077. topCut: eventTypes.cut,
  16078. topDoubleClick: eventTypes.doubleClick,
  16079. topDrag: eventTypes.drag,
  16080. topDragEnd: eventTypes.dragEnd,
  16081. topDragEnter: eventTypes.dragEnter,
  16082. topDragExit: eventTypes.dragExit,
  16083. topDragLeave: eventTypes.dragLeave,
  16084. topDragOver: eventTypes.dragOver,
  16085. topDragStart: eventTypes.dragStart,
  16086. topDrop: eventTypes.drop,
  16087. topDurationChange: eventTypes.durationChange,
  16088. topEmptied: eventTypes.emptied,
  16089. topEncrypted: eventTypes.encrypted,
  16090. topEnded: eventTypes.ended,
  16091. topError: eventTypes.error,
  16092. topFocus: eventTypes.focus,
  16093. topInput: eventTypes.input,
  16094. topInvalid: eventTypes.invalid,
  16095. topKeyDown: eventTypes.keyDown,
  16096. topKeyPress: eventTypes.keyPress,
  16097. topKeyUp: eventTypes.keyUp,
  16098. topLoad: eventTypes.load,
  16099. topLoadedData: eventTypes.loadedData,
  16100. topLoadedMetadata: eventTypes.loadedMetadata,
  16101. topLoadStart: eventTypes.loadStart,
  16102. topMouseDown: eventTypes.mouseDown,
  16103. topMouseMove: eventTypes.mouseMove,
  16104. topMouseOut: eventTypes.mouseOut,
  16105. topMouseOver: eventTypes.mouseOver,
  16106. topMouseUp: eventTypes.mouseUp,
  16107. topPaste: eventTypes.paste,
  16108. topPause: eventTypes.pause,
  16109. topPlay: eventTypes.play,
  16110. topPlaying: eventTypes.playing,
  16111. topProgress: eventTypes.progress,
  16112. topRateChange: eventTypes.rateChange,
  16113. topReset: eventTypes.reset,
  16114. topScroll: eventTypes.scroll,
  16115. topSeeked: eventTypes.seeked,
  16116. topSeeking: eventTypes.seeking,
  16117. topStalled: eventTypes.stalled,
  16118. topSubmit: eventTypes.submit,
  16119. topSuspend: eventTypes.suspend,
  16120. topTimeUpdate: eventTypes.timeUpdate,
  16121. topTouchCancel: eventTypes.touchCancel,
  16122. topTouchEnd: eventTypes.touchEnd,
  16123. topTouchMove: eventTypes.touchMove,
  16124. topTouchStart: eventTypes.touchStart,
  16125. topTransitionEnd: eventTypes.transitionEnd,
  16126. topVolumeChange: eventTypes.volumeChange,
  16127. topWaiting: eventTypes.waiting,
  16128. topWheel: eventTypes.wheel
  16129. };
  16130. for (var type in topLevelEventsToDispatchConfig) {
  16131. topLevelEventsToDispatchConfig[type].dependencies = [type];
  16132. }
  16133. var ON_CLICK_KEY = keyOf({ onClick: null });
  16134. var onClickListeners = {};
  16135. var SimpleEventPlugin = {
  16136. eventTypes: eventTypes,
  16137. extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
  16138. var dispatchConfig = topLevelEventsToDispatchConfig[topLevelType];
  16139. if (!dispatchConfig) {
  16140. return null;
  16141. }
  16142. var EventConstructor;
  16143. switch (topLevelType) {
  16144. case topLevelTypes.topAbort:
  16145. case topLevelTypes.topCanPlay:
  16146. case topLevelTypes.topCanPlayThrough:
  16147. case topLevelTypes.topDurationChange:
  16148. case topLevelTypes.topEmptied:
  16149. case topLevelTypes.topEncrypted:
  16150. case topLevelTypes.topEnded:
  16151. case topLevelTypes.topError:
  16152. case topLevelTypes.topInput:
  16153. case topLevelTypes.topInvalid:
  16154. case topLevelTypes.topLoad:
  16155. case topLevelTypes.topLoadedData:
  16156. case topLevelTypes.topLoadedMetadata:
  16157. case topLevelTypes.topLoadStart:
  16158. case topLevelTypes.topPause:
  16159. case topLevelTypes.topPlay:
  16160. case topLevelTypes.topPlaying:
  16161. case topLevelTypes.topProgress:
  16162. case topLevelTypes.topRateChange:
  16163. case topLevelTypes.topReset:
  16164. case topLevelTypes.topSeeked:
  16165. case topLevelTypes.topSeeking:
  16166. case topLevelTypes.topStalled:
  16167. case topLevelTypes.topSubmit:
  16168. case topLevelTypes.topSuspend:
  16169. case topLevelTypes.topTimeUpdate:
  16170. case topLevelTypes.topVolumeChange:
  16171. case topLevelTypes.topWaiting:
  16172. // HTML Events
  16173. // @see http://www.w3.org/TR/html5/index.html#events-0
  16174. EventConstructor = SyntheticEvent;
  16175. break;
  16176. case topLevelTypes.topKeyPress:
  16177. // Firefox creates a keypress event for function keys too. This removes
  16178. // the unwanted keypress events. Enter is however both printable and
  16179. // non-printable. One would expect Tab to be as well (but it isn't).
  16180. if (getEventCharCode(nativeEvent) === 0) {
  16181. return null;
  16182. }
  16183. /* falls through */
  16184. case topLevelTypes.topKeyDown:
  16185. case topLevelTypes.topKeyUp:
  16186. EventConstructor = SyntheticKeyboardEvent;
  16187. break;
  16188. case topLevelTypes.topBlur:
  16189. case topLevelTypes.topFocus:
  16190. EventConstructor = SyntheticFocusEvent;
  16191. break;
  16192. case topLevelTypes.topClick:
  16193. // Firefox creates a click event on right mouse clicks. This removes the
  16194. // unwanted click events.
  16195. if (nativeEvent.button === 2) {
  16196. return null;
  16197. }
  16198. /* falls through */
  16199. case topLevelTypes.topContextMenu:
  16200. case topLevelTypes.topDoubleClick:
  16201. case topLevelTypes.topMouseDown:
  16202. case topLevelTypes.topMouseMove:
  16203. case topLevelTypes.topMouseOut:
  16204. case topLevelTypes.topMouseOver:
  16205. case topLevelTypes.topMouseUp:
  16206. EventConstructor = SyntheticMouseEvent;
  16207. break;
  16208. case topLevelTypes.topDrag:
  16209. case topLevelTypes.topDragEnd:
  16210. case topLevelTypes.topDragEnter:
  16211. case topLevelTypes.topDragExit:
  16212. case topLevelTypes.topDragLeave:
  16213. case topLevelTypes.topDragOver:
  16214. case topLevelTypes.topDragStart:
  16215. case topLevelTypes.topDrop:
  16216. EventConstructor = SyntheticDragEvent;
  16217. break;
  16218. case topLevelTypes.topTouchCancel:
  16219. case topLevelTypes.topTouchEnd:
  16220. case topLevelTypes.topTouchMove:
  16221. case topLevelTypes.topTouchStart:
  16222. EventConstructor = SyntheticTouchEvent;
  16223. break;
  16224. case topLevelTypes.topAnimationEnd:
  16225. case topLevelTypes.topAnimationIteration:
  16226. case topLevelTypes.topAnimationStart:
  16227. EventConstructor = SyntheticAnimationEvent;
  16228. break;
  16229. case topLevelTypes.topTransitionEnd:
  16230. EventConstructor = SyntheticTransitionEvent;
  16231. break;
  16232. case topLevelTypes.topScroll:
  16233. EventConstructor = SyntheticUIEvent;
  16234. break;
  16235. case topLevelTypes.topWheel:
  16236. EventConstructor = SyntheticWheelEvent;
  16237. break;
  16238. case topLevelTypes.topCopy:
  16239. case topLevelTypes.topCut:
  16240. case topLevelTypes.topPaste:
  16241. EventConstructor = SyntheticClipboardEvent;
  16242. break;
  16243. }
  16244. !EventConstructor ? false ? invariant(false, 'SimpleEventPlugin: Unhandled event type, `%s`.', topLevelType) : invariant(false) : void 0;
  16245. var event = EventConstructor.getPooled(dispatchConfig, targetInst, nativeEvent, nativeEventTarget);
  16246. EventPropagators.accumulateTwoPhaseDispatches(event);
  16247. return event;
  16248. },
  16249. didPutListener: function (inst, registrationName, listener) {
  16250. // Mobile Safari does not fire properly bubble click events on
  16251. // non-interactive elements, which means delegated click listeners do not
  16252. // fire. The workaround for this bug involves attaching an empty click
  16253. // listener on the target node.
  16254. if (registrationName === ON_CLICK_KEY) {
  16255. var id = inst._rootNodeID;
  16256. var node = ReactDOMComponentTree.getNodeFromInstance(inst);
  16257. if (!onClickListeners[id]) {
  16258. onClickListeners[id] = EventListener.listen(node, 'click', emptyFunction);
  16259. }
  16260. }
  16261. },
  16262. willDeleteListener: function (inst, registrationName) {
  16263. if (registrationName === ON_CLICK_KEY) {
  16264. var id = inst._rootNodeID;
  16265. onClickListeners[id].remove();
  16266. delete onClickListeners[id];
  16267. }
  16268. }
  16269. };
  16270. module.exports = SimpleEventPlugin;
  16271. /***/ },
  16272. /* 146 */
  16273. /***/ function(module, exports, __webpack_require__) {
  16274. /**
  16275. * Copyright 2013-present, Facebook, Inc.
  16276. * All rights reserved.
  16277. *
  16278. * This source code is licensed under the BSD-style license found in the
  16279. * LICENSE file in the root directory of this source tree. An additional grant
  16280. * of patent rights can be found in the PATENTS file in the same directory.
  16281. *
  16282. * @providesModule SyntheticAnimationEvent
  16283. */
  16284. 'use strict';
  16285. var SyntheticEvent = __webpack_require__(52);
  16286. /**
  16287. * @interface Event
  16288. * @see http://www.w3.org/TR/css3-animations/#AnimationEvent-interface
  16289. * @see https://developer.mozilla.org/en-US/docs/Web/API/AnimationEvent
  16290. */
  16291. var AnimationEventInterface = {
  16292. animationName: null,
  16293. elapsedTime: null,
  16294. pseudoElement: null
  16295. };
  16296. /**
  16297. * @param {object} dispatchConfig Configuration used to dispatch this event.
  16298. * @param {string} dispatchMarker Marker identifying the event target.
  16299. * @param {object} nativeEvent Native browser event.
  16300. * @extends {SyntheticEvent}
  16301. */
  16302. function SyntheticAnimationEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
  16303. return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
  16304. }
  16305. SyntheticEvent.augmentClass(SyntheticAnimationEvent, AnimationEventInterface);
  16306. module.exports = SyntheticAnimationEvent;
  16307. /***/ },
  16308. /* 147 */
  16309. /***/ function(module, exports, __webpack_require__) {
  16310. /**
  16311. * Copyright 2013-present, Facebook, Inc.
  16312. * All rights reserved.
  16313. *
  16314. * This source code is licensed under the BSD-style license found in the
  16315. * LICENSE file in the root directory of this source tree. An additional grant
  16316. * of patent rights can be found in the PATENTS file in the same directory.
  16317. *
  16318. * @providesModule SyntheticClipboardEvent
  16319. */
  16320. 'use strict';
  16321. var SyntheticEvent = __webpack_require__(52);
  16322. /**
  16323. * @interface Event
  16324. * @see http://www.w3.org/TR/clipboard-apis/
  16325. */
  16326. var ClipboardEventInterface = {
  16327. clipboardData: function (event) {
  16328. return 'clipboardData' in event ? event.clipboardData : window.clipboardData;
  16329. }
  16330. };
  16331. /**
  16332. * @param {object} dispatchConfig Configuration used to dispatch this event.
  16333. * @param {string} dispatchMarker Marker identifying the event target.
  16334. * @param {object} nativeEvent Native browser event.
  16335. * @extends {SyntheticUIEvent}
  16336. */
  16337. function SyntheticClipboardEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
  16338. return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
  16339. }
  16340. SyntheticEvent.augmentClass(SyntheticClipboardEvent, ClipboardEventInterface);
  16341. module.exports = SyntheticClipboardEvent;
  16342. /***/ },
  16343. /* 148 */
  16344. /***/ function(module, exports, __webpack_require__) {
  16345. /**
  16346. * Copyright 2013-present, Facebook, Inc.
  16347. * All rights reserved.
  16348. *
  16349. * This source code is licensed under the BSD-style license found in the
  16350. * LICENSE file in the root directory of this source tree. An additional grant
  16351. * of patent rights can be found in the PATENTS file in the same directory.
  16352. *
  16353. * @providesModule SyntheticFocusEvent
  16354. */
  16355. 'use strict';
  16356. var SyntheticUIEvent = __webpack_require__(68);
  16357. /**
  16358. * @interface FocusEvent
  16359. * @see http://www.w3.org/TR/DOM-Level-3-Events/
  16360. */
  16361. var FocusEventInterface = {
  16362. relatedTarget: null
  16363. };
  16364. /**
  16365. * @param {object} dispatchConfig Configuration used to dispatch this event.
  16366. * @param {string} dispatchMarker Marker identifying the event target.
  16367. * @param {object} nativeEvent Native browser event.
  16368. * @extends {SyntheticUIEvent}
  16369. */
  16370. function SyntheticFocusEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
  16371. return SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
  16372. }
  16373. SyntheticUIEvent.augmentClass(SyntheticFocusEvent, FocusEventInterface);
  16374. module.exports = SyntheticFocusEvent;
  16375. /***/ },
  16376. /* 149 */
  16377. /***/ function(module, exports, __webpack_require__) {
  16378. /**
  16379. * Copyright 2013-present, Facebook, Inc.
  16380. * All rights reserved.
  16381. *
  16382. * This source code is licensed under the BSD-style license found in the
  16383. * LICENSE file in the root directory of this source tree. An additional grant
  16384. * of patent rights can be found in the PATENTS file in the same directory.
  16385. *
  16386. * @providesModule SyntheticKeyboardEvent
  16387. */
  16388. 'use strict';
  16389. var SyntheticUIEvent = __webpack_require__(68);
  16390. var getEventCharCode = __webpack_require__(150);
  16391. var getEventKey = __webpack_require__(151);
  16392. var getEventModifierState = __webpack_require__(70);
  16393. /**
  16394. * @interface KeyboardEvent
  16395. * @see http://www.w3.org/TR/DOM-Level-3-Events/
  16396. */
  16397. var KeyboardEventInterface = {
  16398. key: getEventKey,
  16399. location: null,
  16400. ctrlKey: null,
  16401. shiftKey: null,
  16402. altKey: null,
  16403. metaKey: null,
  16404. repeat: null,
  16405. locale: null,
  16406. getModifierState: getEventModifierState,
  16407. // Legacy Interface
  16408. charCode: function (event) {
  16409. // `charCode` is the result of a KeyPress event and represents the value of
  16410. // the actual printable character.
  16411. // KeyPress is deprecated, but its replacement is not yet final and not
  16412. // implemented in any major browser. Only KeyPress has charCode.
  16413. if (event.type === 'keypress') {
  16414. return getEventCharCode(event);
  16415. }
  16416. return 0;
  16417. },
  16418. keyCode: function (event) {
  16419. // `keyCode` is the result of a KeyDown/Up event and represents the value of
  16420. // physical keyboard key.
  16421. // The actual meaning of the value depends on the users' keyboard layout
  16422. // which cannot be detected. Assuming that it is a US keyboard layout
  16423. // provides a surprisingly accurate mapping for US and European users.
  16424. // Due to this, it is left to the user to implement at this time.
  16425. if (event.type === 'keydown' || event.type === 'keyup') {
  16426. return event.keyCode;
  16427. }
  16428. return 0;
  16429. },
  16430. which: function (event) {
  16431. // `which` is an alias for either `keyCode` or `charCode` depending on the
  16432. // type of the event.
  16433. if (event.type === 'keypress') {
  16434. return getEventCharCode(event);
  16435. }
  16436. if (event.type === 'keydown' || event.type === 'keyup') {
  16437. return event.keyCode;
  16438. }
  16439. return 0;
  16440. }
  16441. };
  16442. /**
  16443. * @param {object} dispatchConfig Configuration used to dispatch this event.
  16444. * @param {string} dispatchMarker Marker identifying the event target.
  16445. * @param {object} nativeEvent Native browser event.
  16446. * @extends {SyntheticUIEvent}
  16447. */
  16448. function SyntheticKeyboardEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
  16449. return SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
  16450. }
  16451. SyntheticUIEvent.augmentClass(SyntheticKeyboardEvent, KeyboardEventInterface);
  16452. module.exports = SyntheticKeyboardEvent;
  16453. /***/ },
  16454. /* 150 */
  16455. /***/ function(module, exports) {
  16456. /**
  16457. * Copyright 2013-present, Facebook, Inc.
  16458. * All rights reserved.
  16459. *
  16460. * This source code is licensed under the BSD-style license found in the
  16461. * LICENSE file in the root directory of this source tree. An additional grant
  16462. * of patent rights can be found in the PATENTS file in the same directory.
  16463. *
  16464. * @providesModule getEventCharCode
  16465. */
  16466. 'use strict';
  16467. /**
  16468. * `charCode` represents the actual "character code" and is safe to use with
  16469. * `String.fromCharCode`. As such, only keys that correspond to printable
  16470. * characters produce a valid `charCode`, the only exception to this is Enter.
  16471. * The Tab-key is considered non-printable and does not have a `charCode`,
  16472. * presumably because it does not produce a tab-character in browsers.
  16473. *
  16474. * @param {object} nativeEvent Native browser event.
  16475. * @return {number} Normalized `charCode` property.
  16476. */
  16477. function getEventCharCode(nativeEvent) {
  16478. var charCode;
  16479. var keyCode = nativeEvent.keyCode;
  16480. if ('charCode' in nativeEvent) {
  16481. charCode = nativeEvent.charCode;
  16482. // FF does not set `charCode` for the Enter-key, check against `keyCode`.
  16483. if (charCode === 0 && keyCode === 13) {
  16484. charCode = 13;
  16485. }
  16486. } else {
  16487. // IE8 does not implement `charCode`, but `keyCode` has the correct value.
  16488. charCode = keyCode;
  16489. }
  16490. // Some non-printable keys are reported in `charCode`/`keyCode`, discard them.
  16491. // Must not discard the (non-)printable Enter-key.
  16492. if (charCode >= 32 || charCode === 13) {
  16493. return charCode;
  16494. }
  16495. return 0;
  16496. }
  16497. module.exports = getEventCharCode;
  16498. /***/ },
  16499. /* 151 */
  16500. /***/ function(module, exports, __webpack_require__) {
  16501. /**
  16502. * Copyright 2013-present, Facebook, Inc.
  16503. * All rights reserved.
  16504. *
  16505. * This source code is licensed under the BSD-style license found in the
  16506. * LICENSE file in the root directory of this source tree. An additional grant
  16507. * of patent rights can be found in the PATENTS file in the same directory.
  16508. *
  16509. * @providesModule getEventKey
  16510. */
  16511. 'use strict';
  16512. var getEventCharCode = __webpack_require__(150);
  16513. /**
  16514. * Normalization of deprecated HTML5 `key` values
  16515. * @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_names
  16516. */
  16517. var normalizeKey = {
  16518. 'Esc': 'Escape',
  16519. 'Spacebar': ' ',
  16520. 'Left': 'ArrowLeft',
  16521. 'Up': 'ArrowUp',
  16522. 'Right': 'ArrowRight',
  16523. 'Down': 'ArrowDown',
  16524. 'Del': 'Delete',
  16525. 'Win': 'OS',
  16526. 'Menu': 'ContextMenu',
  16527. 'Apps': 'ContextMenu',
  16528. 'Scroll': 'ScrollLock',
  16529. 'MozPrintableKey': 'Unidentified'
  16530. };
  16531. /**
  16532. * Translation from legacy `keyCode` to HTML5 `key`
  16533. * Only special keys supported, all others depend on keyboard layout or browser
  16534. * @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_names
  16535. */
  16536. var translateToKey = {
  16537. 8: 'Backspace',
  16538. 9: 'Tab',
  16539. 12: 'Clear',
  16540. 13: 'Enter',
  16541. 16: 'Shift',
  16542. 17: 'Control',
  16543. 18: 'Alt',
  16544. 19: 'Pause',
  16545. 20: 'CapsLock',
  16546. 27: 'Escape',
  16547. 32: ' ',
  16548. 33: 'PageUp',
  16549. 34: 'PageDown',
  16550. 35: 'End',
  16551. 36: 'Home',
  16552. 37: 'ArrowLeft',
  16553. 38: 'ArrowUp',
  16554. 39: 'ArrowRight',
  16555. 40: 'ArrowDown',
  16556. 45: 'Insert',
  16557. 46: 'Delete',
  16558. 112: 'F1', 113: 'F2', 114: 'F3', 115: 'F4', 116: 'F5', 117: 'F6',
  16559. 118: 'F7', 119: 'F8', 120: 'F9', 121: 'F10', 122: 'F11', 123: 'F12',
  16560. 144: 'NumLock',
  16561. 145: 'ScrollLock',
  16562. 224: 'Meta'
  16563. };
  16564. /**
  16565. * @param {object} nativeEvent Native browser event.
  16566. * @return {string} Normalized `key` property.
  16567. */
  16568. function getEventKey(nativeEvent) {
  16569. if (nativeEvent.key) {
  16570. // Normalize inconsistent values reported by browsers due to
  16571. // implementations of a working draft specification.
  16572. // FireFox implements `key` but returns `MozPrintableKey` for all
  16573. // printable characters (normalized to `Unidentified`), ignore it.
  16574. var key = normalizeKey[nativeEvent.key] || nativeEvent.key;
  16575. if (key !== 'Unidentified') {
  16576. return key;
  16577. }
  16578. }
  16579. // Browser does not implement `key`, polyfill as much of it as we can.
  16580. if (nativeEvent.type === 'keypress') {
  16581. var charCode = getEventCharCode(nativeEvent);
  16582. // The enter-key is technically both printable and non-printable and can
  16583. // thus be captured by `keypress`, no other non-printable key should.
  16584. return charCode === 13 ? 'Enter' : String.fromCharCode(charCode);
  16585. }
  16586. if (nativeEvent.type === 'keydown' || nativeEvent.type === 'keyup') {
  16587. // While user keyboard layout determines the actual meaning of each
  16588. // `keyCode` value, almost all function keys have a universal value.
  16589. return translateToKey[nativeEvent.keyCode] || 'Unidentified';
  16590. }
  16591. return '';
  16592. }
  16593. module.exports = getEventKey;
  16594. /***/ },
  16595. /* 152 */
  16596. /***/ function(module, exports, __webpack_require__) {
  16597. /**
  16598. * Copyright 2013-present, Facebook, Inc.
  16599. * All rights reserved.
  16600. *
  16601. * This source code is licensed under the BSD-style license found in the
  16602. * LICENSE file in the root directory of this source tree. An additional grant
  16603. * of patent rights can be found in the PATENTS file in the same directory.
  16604. *
  16605. * @providesModule SyntheticDragEvent
  16606. */
  16607. 'use strict';
  16608. var SyntheticMouseEvent = __webpack_require__(67);
  16609. /**
  16610. * @interface DragEvent
  16611. * @see http://www.w3.org/TR/DOM-Level-3-Events/
  16612. */
  16613. var DragEventInterface = {
  16614. dataTransfer: null
  16615. };
  16616. /**
  16617. * @param {object} dispatchConfig Configuration used to dispatch this event.
  16618. * @param {string} dispatchMarker Marker identifying the event target.
  16619. * @param {object} nativeEvent Native browser event.
  16620. * @extends {SyntheticUIEvent}
  16621. */
  16622. function SyntheticDragEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
  16623. return SyntheticMouseEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
  16624. }
  16625. SyntheticMouseEvent.augmentClass(SyntheticDragEvent, DragEventInterface);
  16626. module.exports = SyntheticDragEvent;
  16627. /***/ },
  16628. /* 153 */
  16629. /***/ function(module, exports, __webpack_require__) {
  16630. /**
  16631. * Copyright 2013-present, Facebook, Inc.
  16632. * All rights reserved.
  16633. *
  16634. * This source code is licensed under the BSD-style license found in the
  16635. * LICENSE file in the root directory of this source tree. An additional grant
  16636. * of patent rights can be found in the PATENTS file in the same directory.
  16637. *
  16638. * @providesModule SyntheticTouchEvent
  16639. */
  16640. 'use strict';
  16641. var SyntheticUIEvent = __webpack_require__(68);
  16642. var getEventModifierState = __webpack_require__(70);
  16643. /**
  16644. * @interface TouchEvent
  16645. * @see http://www.w3.org/TR/touch-events/
  16646. */
  16647. var TouchEventInterface = {
  16648. touches: null,
  16649. targetTouches: null,
  16650. changedTouches: null,
  16651. altKey: null,
  16652. metaKey: null,
  16653. ctrlKey: null,
  16654. shiftKey: null,
  16655. getModifierState: getEventModifierState
  16656. };
  16657. /**
  16658. * @param {object} dispatchConfig Configuration used to dispatch this event.
  16659. * @param {string} dispatchMarker Marker identifying the event target.
  16660. * @param {object} nativeEvent Native browser event.
  16661. * @extends {SyntheticUIEvent}
  16662. */
  16663. function SyntheticTouchEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
  16664. return SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
  16665. }
  16666. SyntheticUIEvent.augmentClass(SyntheticTouchEvent, TouchEventInterface);
  16667. module.exports = SyntheticTouchEvent;
  16668. /***/ },
  16669. /* 154 */
  16670. /***/ function(module, exports, __webpack_require__) {
  16671. /**
  16672. * Copyright 2013-present, Facebook, Inc.
  16673. * All rights reserved.
  16674. *
  16675. * This source code is licensed under the BSD-style license found in the
  16676. * LICENSE file in the root directory of this source tree. An additional grant
  16677. * of patent rights can be found in the PATENTS file in the same directory.
  16678. *
  16679. * @providesModule SyntheticTransitionEvent
  16680. */
  16681. 'use strict';
  16682. var SyntheticEvent = __webpack_require__(52);
  16683. /**
  16684. * @interface Event
  16685. * @see http://www.w3.org/TR/2009/WD-css3-transitions-20090320/#transition-events-
  16686. * @see https://developer.mozilla.org/en-US/docs/Web/API/TransitionEvent
  16687. */
  16688. var TransitionEventInterface = {
  16689. propertyName: null,
  16690. elapsedTime: null,
  16691. pseudoElement: null
  16692. };
  16693. /**
  16694. * @param {object} dispatchConfig Configuration used to dispatch this event.
  16695. * @param {string} dispatchMarker Marker identifying the event target.
  16696. * @param {object} nativeEvent Native browser event.
  16697. * @extends {SyntheticEvent}
  16698. */
  16699. function SyntheticTransitionEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
  16700. return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
  16701. }
  16702. SyntheticEvent.augmentClass(SyntheticTransitionEvent, TransitionEventInterface);
  16703. module.exports = SyntheticTransitionEvent;
  16704. /***/ },
  16705. /* 155 */
  16706. /***/ function(module, exports, __webpack_require__) {
  16707. /**
  16708. * Copyright 2013-present, Facebook, Inc.
  16709. * All rights reserved.
  16710. *
  16711. * This source code is licensed under the BSD-style license found in the
  16712. * LICENSE file in the root directory of this source tree. An additional grant
  16713. * of patent rights can be found in the PATENTS file in the same directory.
  16714. *
  16715. * @providesModule SyntheticWheelEvent
  16716. */
  16717. 'use strict';
  16718. var SyntheticMouseEvent = __webpack_require__(67);
  16719. /**
  16720. * @interface WheelEvent
  16721. * @see http://www.w3.org/TR/DOM-Level-3-Events/
  16722. */
  16723. var WheelEventInterface = {
  16724. deltaX: function (event) {
  16725. return 'deltaX' in event ? event.deltaX :
  16726. // Fallback to `wheelDeltaX` for Webkit and normalize (right is positive).
  16727. 'wheelDeltaX' in event ? -event.wheelDeltaX : 0;
  16728. },
  16729. deltaY: function (event) {
  16730. return 'deltaY' in event ? event.deltaY :
  16731. // Fallback to `wheelDeltaY` for Webkit and normalize (down is positive).
  16732. 'wheelDeltaY' in event ? -event.wheelDeltaY :
  16733. // Fallback to `wheelDelta` for IE<9 and normalize (down is positive).
  16734. 'wheelDelta' in event ? -event.wheelDelta : 0;
  16735. },
  16736. deltaZ: null,
  16737. // Browsers without "deltaMode" is reporting in raw wheel delta where one
  16738. // notch on the scroll is always +/- 120, roughly equivalent to pixels.
  16739. // A good approximation of DOM_DELTA_LINE (1) is 5% of viewport size or
  16740. // ~40 pixels, for DOM_DELTA_SCREEN (2) it is 87.5% of viewport size.
  16741. deltaMode: null
  16742. };
  16743. /**
  16744. * @param {object} dispatchConfig Configuration used to dispatch this event.
  16745. * @param {string} dispatchMarker Marker identifying the event target.
  16746. * @param {object} nativeEvent Native browser event.
  16747. * @extends {SyntheticMouseEvent}
  16748. */
  16749. function SyntheticWheelEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
  16750. return SyntheticMouseEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
  16751. }
  16752. SyntheticMouseEvent.augmentClass(SyntheticWheelEvent, WheelEventInterface);
  16753. module.exports = SyntheticWheelEvent;
  16754. /***/ },
  16755. /* 156 */
  16756. /***/ function(module, exports, __webpack_require__) {
  16757. /**
  16758. * Copyright 2013-present, Facebook, Inc.
  16759. * All rights reserved.
  16760. *
  16761. * This source code is licensed under the BSD-style license found in the
  16762. * LICENSE file in the root directory of this source tree. An additional grant
  16763. * of patent rights can be found in the PATENTS file in the same directory.
  16764. *
  16765. * @providesModule ReactMount
  16766. */
  16767. 'use strict';
  16768. var DOMLazyTree = __webpack_require__(74);
  16769. var DOMProperty = __webpack_require__(37);
  16770. var ReactBrowserEventEmitter = __webpack_require__(102);
  16771. var ReactCurrentOwner = __webpack_require__(8);
  16772. var ReactDOMComponentTree = __webpack_require__(36);
  16773. var ReactDOMContainerInfo = __webpack_require__(157);
  16774. var ReactDOMFeatureFlags = __webpack_require__(158);
  16775. var ReactElement = __webpack_require__(7);
  16776. var ReactFeatureFlags = __webpack_require__(57);
  16777. var ReactInstrumentation = __webpack_require__(17);
  16778. var ReactMarkupChecksum = __webpack_require__(159);
  16779. var ReactReconciler = __webpack_require__(58);
  16780. var ReactUpdateQueue = __webpack_require__(119);
  16781. var ReactUpdates = __webpack_require__(55);
  16782. var emptyObject = __webpack_require__(22);
  16783. var instantiateReactComponent = __webpack_require__(115);
  16784. var invariant = __webpack_require__(6);
  16785. var setInnerHTML = __webpack_require__(79);
  16786. var shouldUpdateReactComponent = __webpack_require__(120);
  16787. var warning = __webpack_require__(9);
  16788. var ATTR_NAME = DOMProperty.ID_ATTRIBUTE_NAME;
  16789. var ROOT_ATTR_NAME = DOMProperty.ROOT_ATTRIBUTE_NAME;
  16790. var ELEMENT_NODE_TYPE = 1;
  16791. var DOC_NODE_TYPE = 9;
  16792. var DOCUMENT_FRAGMENT_NODE_TYPE = 11;
  16793. var instancesByReactRootID = {};
  16794. /**
  16795. * Finds the index of the first character
  16796. * that's not common between the two given strings.
  16797. *
  16798. * @return {number} the index of the character where the strings diverge
  16799. */
  16800. function firstDifferenceIndex(string1, string2) {
  16801. var minLen = Math.min(string1.length, string2.length);
  16802. for (var i = 0; i < minLen; i++) {
  16803. if (string1.charAt(i) !== string2.charAt(i)) {
  16804. return i;
  16805. }
  16806. }
  16807. return string1.length === string2.length ? -1 : minLen;
  16808. }
  16809. /**
  16810. * @param {DOMElement|DOMDocument} container DOM element that may contain
  16811. * a React component
  16812. * @return {?*} DOM element that may have the reactRoot ID, or null.
  16813. */
  16814. function getReactRootElementInContainer(container) {
  16815. if (!container) {
  16816. return null;
  16817. }
  16818. if (container.nodeType === DOC_NODE_TYPE) {
  16819. return container.documentElement;
  16820. } else {
  16821. return container.firstChild;
  16822. }
  16823. }
  16824. function internalGetID(node) {
  16825. // If node is something like a window, document, or text node, none of
  16826. // which support attributes or a .getAttribute method, gracefully return
  16827. // the empty string, as if the attribute were missing.
  16828. return node.getAttribute && node.getAttribute(ATTR_NAME) || '';
  16829. }
  16830. /**
  16831. * Mounts this component and inserts it into the DOM.
  16832. *
  16833. * @param {ReactComponent} componentInstance The instance to mount.
  16834. * @param {DOMElement} container DOM element to mount into.
  16835. * @param {ReactReconcileTransaction} transaction
  16836. * @param {boolean} shouldReuseMarkup If true, do not insert markup
  16837. */
  16838. function mountComponentIntoNode(wrapperInstance, container, transaction, shouldReuseMarkup, context) {
  16839. var markerName;
  16840. if (ReactFeatureFlags.logTopLevelRenders) {
  16841. var wrappedElement = wrapperInstance._currentElement.props;
  16842. var type = wrappedElement.type;
  16843. markerName = 'React mount: ' + (typeof type === 'string' ? type : type.displayName || type.name);
  16844. console.time(markerName);
  16845. }
  16846. var markup = ReactReconciler.mountComponent(wrapperInstance, transaction, null, ReactDOMContainerInfo(wrapperInstance, container), context);
  16847. if (markerName) {
  16848. console.timeEnd(markerName);
  16849. }
  16850. wrapperInstance._renderedComponent._topLevelWrapper = wrapperInstance;
  16851. ReactMount._mountImageIntoNode(markup, container, wrapperInstance, shouldReuseMarkup, transaction);
  16852. }
  16853. /**
  16854. * Batched mount.
  16855. *
  16856. * @param {ReactComponent} componentInstance The instance to mount.
  16857. * @param {DOMElement} container DOM element to mount into.
  16858. * @param {boolean} shouldReuseMarkup If true, do not insert markup
  16859. */
  16860. function batchedMountComponentIntoNode(componentInstance, container, shouldReuseMarkup, context) {
  16861. var transaction = ReactUpdates.ReactReconcileTransaction.getPooled(
  16862. /* useCreateElement */
  16863. !shouldReuseMarkup && ReactDOMFeatureFlags.useCreateElement);
  16864. transaction.perform(mountComponentIntoNode, null, componentInstance, container, transaction, shouldReuseMarkup, context);
  16865. ReactUpdates.ReactReconcileTransaction.release(transaction);
  16866. }
  16867. /**
  16868. * Unmounts a component and removes it from the DOM.
  16869. *
  16870. * @param {ReactComponent} instance React component instance.
  16871. * @param {DOMElement} container DOM element to unmount from.
  16872. * @final
  16873. * @internal
  16874. * @see {ReactMount.unmountComponentAtNode}
  16875. */
  16876. function unmountComponentFromNode(instance, container, safely) {
  16877. ReactReconciler.unmountComponent(instance, safely);
  16878. if (container.nodeType === DOC_NODE_TYPE) {
  16879. container = container.documentElement;
  16880. }
  16881. // http://jsperf.com/emptying-a-node
  16882. while (container.lastChild) {
  16883. container.removeChild(container.lastChild);
  16884. }
  16885. }
  16886. /**
  16887. * True if the supplied DOM node has a direct React-rendered child that is
  16888. * not a React root element. Useful for warning in `render`,
  16889. * `unmountComponentAtNode`, etc.
  16890. *
  16891. * @param {?DOMElement} node The candidate DOM node.
  16892. * @return {boolean} True if the DOM element contains a direct child that was
  16893. * rendered by React but is not a root element.
  16894. * @internal
  16895. */
  16896. function hasNonRootReactChild(container) {
  16897. var rootEl = getReactRootElementInContainer(container);
  16898. if (rootEl) {
  16899. var inst = ReactDOMComponentTree.getInstanceFromNode(rootEl);
  16900. return !!(inst && inst._nativeParent);
  16901. }
  16902. }
  16903. function getNativeRootInstanceInContainer(container) {
  16904. var rootEl = getReactRootElementInContainer(container);
  16905. var prevNativeInstance = rootEl && ReactDOMComponentTree.getInstanceFromNode(rootEl);
  16906. return prevNativeInstance && !prevNativeInstance._nativeParent ? prevNativeInstance : null;
  16907. }
  16908. function getTopLevelWrapperInContainer(container) {
  16909. var root = getNativeRootInstanceInContainer(container);
  16910. return root ? root._nativeContainerInfo._topLevelWrapper : null;
  16911. }
  16912. /**
  16913. * Temporary (?) hack so that we can store all top-level pending updates on
  16914. * composites instead of having to worry about different types of components
  16915. * here.
  16916. */
  16917. var topLevelRootCounter = 1;
  16918. var TopLevelWrapper = function () {
  16919. this.rootID = topLevelRootCounter++;
  16920. };
  16921. TopLevelWrapper.prototype.isReactComponent = {};
  16922. if (false) {
  16923. TopLevelWrapper.displayName = 'TopLevelWrapper';
  16924. }
  16925. TopLevelWrapper.prototype.render = function () {
  16926. // this.props is actually a ReactElement
  16927. return this.props;
  16928. };
  16929. /**
  16930. * Mounting is the process of initializing a React component by creating its
  16931. * representative DOM elements and inserting them into a supplied `container`.
  16932. * Any prior content inside `container` is destroyed in the process.
  16933. *
  16934. * ReactMount.render(
  16935. * component,
  16936. * document.getElementById('container')
  16937. * );
  16938. *
  16939. * <div id="container"> <-- Supplied `container`.
  16940. * <div data-reactid=".3"> <-- Rendered reactRoot of React
  16941. * // ... component.
  16942. * </div>
  16943. * </div>
  16944. *
  16945. * Inside of `container`, the first element rendered is the "reactRoot".
  16946. */
  16947. var ReactMount = {
  16948. TopLevelWrapper: TopLevelWrapper,
  16949. /**
  16950. * Used by devtools. The keys are not important.
  16951. */
  16952. _instancesByReactRootID: instancesByReactRootID,
  16953. /**
  16954. * This is a hook provided to support rendering React components while
  16955. * ensuring that the apparent scroll position of its `container` does not
  16956. * change.
  16957. *
  16958. * @param {DOMElement} container The `container` being rendered into.
  16959. * @param {function} renderCallback This must be called once to do the render.
  16960. */
  16961. scrollMonitor: function (container, renderCallback) {
  16962. renderCallback();
  16963. },
  16964. /**
  16965. * Take a component that's already mounted into the DOM and replace its props
  16966. * @param {ReactComponent} prevComponent component instance already in the DOM
  16967. * @param {ReactElement} nextElement component instance to render
  16968. * @param {DOMElement} container container to render into
  16969. * @param {?function} callback function triggered on completion
  16970. */
  16971. _updateRootComponent: function (prevComponent, nextElement, container, callback) {
  16972. ReactMount.scrollMonitor(container, function () {
  16973. ReactUpdateQueue.enqueueElementInternal(prevComponent, nextElement);
  16974. if (callback) {
  16975. ReactUpdateQueue.enqueueCallbackInternal(prevComponent, callback);
  16976. }
  16977. });
  16978. return prevComponent;
  16979. },
  16980. /**
  16981. * Render a new component into the DOM. Hooked by devtools!
  16982. *
  16983. * @param {ReactElement} nextElement element to render
  16984. * @param {DOMElement} container container to render into
  16985. * @param {boolean} shouldReuseMarkup if we should skip the markup insertion
  16986. * @return {ReactComponent} nextComponent
  16987. */
  16988. _renderNewRootComponent: function (nextElement, container, shouldReuseMarkup, context) {
  16989. if (false) {
  16990. ReactInstrumentation.debugTool.onBeginFlush();
  16991. }
  16992. // Various parts of our code (such as ReactCompositeComponent's
  16993. // _renderValidatedComponent) assume that calls to render aren't nested;
  16994. // verify that that's the case.
  16995. false ? warning(ReactCurrentOwner.current == null, '_renderNewRootComponent(): Render methods should be a pure function ' + 'of props and state; triggering nested component updates from ' + 'render is not allowed. If necessary, trigger nested updates in ' + 'componentDidUpdate. Check the render method of %s.', ReactCurrentOwner.current && ReactCurrentOwner.current.getName() || 'ReactCompositeComponent') : void 0;
  16996. !(container && (container.nodeType === ELEMENT_NODE_TYPE || container.nodeType === DOC_NODE_TYPE || container.nodeType === DOCUMENT_FRAGMENT_NODE_TYPE)) ? false ? invariant(false, '_registerComponent(...): Target container is not a DOM element.') : invariant(false) : void 0;
  16997. ReactBrowserEventEmitter.ensureScrollValueMonitoring();
  16998. var componentInstance = instantiateReactComponent(nextElement);
  16999. if (false) {
  17000. // Mute future events from the top level wrapper.
  17001. // It is an implementation detail that devtools should not know about.
  17002. componentInstance._debugID = 0;
  17003. }
  17004. // The initial render is synchronous but any updates that happen during
  17005. // rendering, in componentWillMount or componentDidMount, will be batched
  17006. // according to the current batching strategy.
  17007. ReactUpdates.batchedUpdates(batchedMountComponentIntoNode, componentInstance, container, shouldReuseMarkup, context);
  17008. var wrapperID = componentInstance._instance.rootID;
  17009. instancesByReactRootID[wrapperID] = componentInstance;
  17010. if (false) {
  17011. // The instance here is TopLevelWrapper so we report mount for its child.
  17012. ReactInstrumentation.debugTool.onMountRootComponent(componentInstance._renderedComponent._debugID);
  17013. ReactInstrumentation.debugTool.onEndFlush();
  17014. }
  17015. return componentInstance;
  17016. },
  17017. /**
  17018. * Renders a React component into the DOM in the supplied `container`.
  17019. *
  17020. * If the React component was previously rendered into `container`, this will
  17021. * perform an update on it and only mutate the DOM as necessary to reflect the
  17022. * latest React component.
  17023. *
  17024. * @param {ReactComponent} parentComponent The conceptual parent of this render tree.
  17025. * @param {ReactElement} nextElement Component element to render.
  17026. * @param {DOMElement} container DOM element to render into.
  17027. * @param {?function} callback function triggered on completion
  17028. * @return {ReactComponent} Component instance rendered in `container`.
  17029. */
  17030. renderSubtreeIntoContainer: function (parentComponent, nextElement, container, callback) {
  17031. !(parentComponent != null && parentComponent._reactInternalInstance != null) ? false ? invariant(false, 'parentComponent must be a valid React Component') : invariant(false) : void 0;
  17032. return ReactMount._renderSubtreeIntoContainer(parentComponent, nextElement, container, callback);
  17033. },
  17034. _renderSubtreeIntoContainer: function (parentComponent, nextElement, container, callback) {
  17035. ReactUpdateQueue.validateCallback(callback, 'ReactDOM.render');
  17036. !ReactElement.isValidElement(nextElement) ? false ? invariant(false, 'ReactDOM.render(): Invalid component element.%s', typeof nextElement === 'string' ? ' Instead of passing a string like \'div\', pass ' + 'React.createElement(\'div\') or <div />.' : typeof nextElement === 'function' ? ' Instead of passing a class like Foo, pass ' + 'React.createElement(Foo) or <Foo />.' :
  17037. // Check if it quacks like an element
  17038. nextElement != null && nextElement.props !== undefined ? ' This may be caused by unintentionally loading two independent ' + 'copies of React.' : '') : invariant(false) : void 0;
  17039. false ? warning(!container || !container.tagName || container.tagName.toUpperCase() !== 'BODY', 'render(): Rendering components directly into document.body is ' + 'discouraged, since its children are often manipulated by third-party ' + 'scripts and browser extensions. This may lead to subtle ' + 'reconciliation issues. Try rendering into a container element created ' + 'for your app.') : void 0;
  17040. var nextWrappedElement = ReactElement(TopLevelWrapper, null, null, null, null, null, nextElement);
  17041. var prevComponent = getTopLevelWrapperInContainer(container);
  17042. if (prevComponent) {
  17043. var prevWrappedElement = prevComponent._currentElement;
  17044. var prevElement = prevWrappedElement.props;
  17045. if (shouldUpdateReactComponent(prevElement, nextElement)) {
  17046. var publicInst = prevComponent._renderedComponent.getPublicInstance();
  17047. var updatedCallback = callback && function () {
  17048. callback.call(publicInst);
  17049. };
  17050. ReactMount._updateRootComponent(prevComponent, nextWrappedElement, container, updatedCallback);
  17051. return publicInst;
  17052. } else {
  17053. ReactMount.unmountComponentAtNode(container);
  17054. }
  17055. }
  17056. var reactRootElement = getReactRootElementInContainer(container);
  17057. var containerHasReactMarkup = reactRootElement && !!internalGetID(reactRootElement);
  17058. var containerHasNonRootReactChild = hasNonRootReactChild(container);
  17059. if (false) {
  17060. process.env.NODE_ENV !== 'production' ? warning(!containerHasNonRootReactChild, 'render(...): Replacing React-rendered children with a new root ' + 'component. If you intended to update the children of this node, ' + 'you should instead have the existing children update their state ' + 'and render the new components instead of calling ReactDOM.render.') : void 0;
  17061. if (!containerHasReactMarkup || reactRootElement.nextSibling) {
  17062. var rootElementSibling = reactRootElement;
  17063. while (rootElementSibling) {
  17064. if (internalGetID(rootElementSibling)) {
  17065. process.env.NODE_ENV !== 'production' ? warning(false, 'render(): Target node has markup rendered by React, but there ' + 'are unrelated nodes as well. This is most commonly caused by ' + 'white-space inserted around server-rendered markup.') : void 0;
  17066. break;
  17067. }
  17068. rootElementSibling = rootElementSibling.nextSibling;
  17069. }
  17070. }
  17071. }
  17072. var shouldReuseMarkup = containerHasReactMarkup && !prevComponent && !containerHasNonRootReactChild;
  17073. var component = ReactMount._renderNewRootComponent(nextWrappedElement, container, shouldReuseMarkup, parentComponent != null ? parentComponent._reactInternalInstance._processChildContext(parentComponent._reactInternalInstance._context) : emptyObject)._renderedComponent.getPublicInstance();
  17074. if (callback) {
  17075. callback.call(component);
  17076. }
  17077. return component;
  17078. },
  17079. /**
  17080. * Renders a React component into the DOM in the supplied `container`.
  17081. * See https://facebook.github.io/react/docs/top-level-api.html#reactdom.render
  17082. *
  17083. * If the React component was previously rendered into `container`, this will
  17084. * perform an update on it and only mutate the DOM as necessary to reflect the
  17085. * latest React component.
  17086. *
  17087. * @param {ReactElement} nextElement Component element to render.
  17088. * @param {DOMElement} container DOM element to render into.
  17089. * @param {?function} callback function triggered on completion
  17090. * @return {ReactComponent} Component instance rendered in `container`.
  17091. */
  17092. render: function (nextElement, container, callback) {
  17093. return ReactMount._renderSubtreeIntoContainer(null, nextElement, container, callback);
  17094. },
  17095. /**
  17096. * Unmounts and destroys the React component rendered in the `container`.
  17097. * See https://facebook.github.io/react/docs/top-level-api.html#reactdom.unmountcomponentatnode
  17098. *
  17099. * @param {DOMElement} container DOM element containing a React component.
  17100. * @return {boolean} True if a component was found in and unmounted from
  17101. * `container`
  17102. */
  17103. unmountComponentAtNode: function (container) {
  17104. // Various parts of our code (such as ReactCompositeComponent's
  17105. // _renderValidatedComponent) assume that calls to render aren't nested;
  17106. // verify that that's the case. (Strictly speaking, unmounting won't cause a
  17107. // render but we still don't expect to be in a render call here.)
  17108. false ? warning(ReactCurrentOwner.current == null, 'unmountComponentAtNode(): Render methods should be a pure function ' + 'of props and state; triggering nested component updates from render ' + 'is not allowed. If necessary, trigger nested updates in ' + 'componentDidUpdate. Check the render method of %s.', ReactCurrentOwner.current && ReactCurrentOwner.current.getName() || 'ReactCompositeComponent') : void 0;
  17109. !(container && (container.nodeType === ELEMENT_NODE_TYPE || container.nodeType === DOC_NODE_TYPE || container.nodeType === DOCUMENT_FRAGMENT_NODE_TYPE)) ? false ? invariant(false, 'unmountComponentAtNode(...): Target container is not a DOM element.') : invariant(false) : void 0;
  17110. var prevComponent = getTopLevelWrapperInContainer(container);
  17111. if (!prevComponent) {
  17112. // Check if the node being unmounted was rendered by React, but isn't a
  17113. // root node.
  17114. var containerHasNonRootReactChild = hasNonRootReactChild(container);
  17115. // Check if the container itself is a React root node.
  17116. var isContainerReactRoot = container.nodeType === 1 && container.hasAttribute(ROOT_ATTR_NAME);
  17117. if (false) {
  17118. process.env.NODE_ENV !== 'production' ? warning(!containerHasNonRootReactChild, 'unmountComponentAtNode(): The node you\'re attempting to unmount ' + 'was rendered by React and is not a top-level container. %s', isContainerReactRoot ? 'You may have accidentally passed in a React root node instead ' + 'of its container.' : 'Instead, have the parent component update its state and ' + 'rerender in order to remove this component.') : void 0;
  17119. }
  17120. return false;
  17121. }
  17122. delete instancesByReactRootID[prevComponent._instance.rootID];
  17123. ReactUpdates.batchedUpdates(unmountComponentFromNode, prevComponent, container, false);
  17124. return true;
  17125. },
  17126. _mountImageIntoNode: function (markup, container, instance, shouldReuseMarkup, transaction) {
  17127. !(container && (container.nodeType === ELEMENT_NODE_TYPE || container.nodeType === DOC_NODE_TYPE || container.nodeType === DOCUMENT_FRAGMENT_NODE_TYPE)) ? false ? invariant(false, 'mountComponentIntoNode(...): Target container is not valid.') : invariant(false) : void 0;
  17128. if (shouldReuseMarkup) {
  17129. var rootElement = getReactRootElementInContainer(container);
  17130. if (ReactMarkupChecksum.canReuseMarkup(markup, rootElement)) {
  17131. ReactDOMComponentTree.precacheNode(instance, rootElement);
  17132. return;
  17133. } else {
  17134. var checksum = rootElement.getAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME);
  17135. rootElement.removeAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME);
  17136. var rootMarkup = rootElement.outerHTML;
  17137. rootElement.setAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME, checksum);
  17138. var normalizedMarkup = markup;
  17139. if (false) {
  17140. // because rootMarkup is retrieved from the DOM, various normalizations
  17141. // will have occurred which will not be present in `markup`. Here,
  17142. // insert markup into a <div> or <iframe> depending on the container
  17143. // type to perform the same normalizations before comparing.
  17144. var normalizer;
  17145. if (container.nodeType === ELEMENT_NODE_TYPE) {
  17146. normalizer = document.createElement('div');
  17147. normalizer.innerHTML = markup;
  17148. normalizedMarkup = normalizer.innerHTML;
  17149. } else {
  17150. normalizer = document.createElement('iframe');
  17151. document.body.appendChild(normalizer);
  17152. normalizer.contentDocument.write(markup);
  17153. normalizedMarkup = normalizer.contentDocument.documentElement.outerHTML;
  17154. document.body.removeChild(normalizer);
  17155. }
  17156. }
  17157. var diffIndex = firstDifferenceIndex(normalizedMarkup, rootMarkup);
  17158. var difference = ' (client) ' + normalizedMarkup.substring(diffIndex - 20, diffIndex + 20) + '\n (server) ' + rootMarkup.substring(diffIndex - 20, diffIndex + 20);
  17159. !(container.nodeType !== DOC_NODE_TYPE) ? false ? invariant(false, 'You\'re trying to render a component to the document using ' + 'server rendering but the checksum was invalid. This usually ' + 'means you rendered a different component type or props on ' + 'the client from the one on the server, or your render() ' + 'methods are impure. React cannot handle this case due to ' + 'cross-browser quirks by rendering at the document root. You ' + 'should look for environment dependent code in your components ' + 'and ensure the props are the same client and server side:\n%s', difference) : invariant(false) : void 0;
  17160. if (false) {
  17161. process.env.NODE_ENV !== 'production' ? warning(false, 'React attempted to reuse markup in a container but the ' + 'checksum was invalid. This generally means that you are ' + 'using server rendering and the markup generated on the ' + 'server was not what the client was expecting. React injected ' + 'new markup to compensate which works but you have lost many ' + 'of the benefits of server rendering. Instead, figure out ' + 'why the markup being generated is different on the client ' + 'or server:\n%s', difference) : void 0;
  17162. }
  17163. }
  17164. }
  17165. !(container.nodeType !== DOC_NODE_TYPE) ? false ? invariant(false, 'You\'re trying to render a component to the document but ' + 'you didn\'t use server rendering. We can\'t do this ' + 'without using server rendering due to cross-browser quirks. ' + 'See ReactDOMServer.renderToString() for server rendering.') : invariant(false) : void 0;
  17166. if (transaction.useCreateElement) {
  17167. while (container.lastChild) {
  17168. container.removeChild(container.lastChild);
  17169. }
  17170. DOMLazyTree.insertTreeBefore(container, markup, null);
  17171. } else {
  17172. setInnerHTML(container, markup);
  17173. ReactDOMComponentTree.precacheNode(instance, container.firstChild);
  17174. }
  17175. if (false) {
  17176. var nativeNode = ReactDOMComponentTree.getInstanceFromNode(container.firstChild);
  17177. if (nativeNode._debugID !== 0) {
  17178. ReactInstrumentation.debugTool.onNativeOperation(nativeNode._debugID, 'mount', markup.toString());
  17179. }
  17180. }
  17181. }
  17182. };
  17183. module.exports = ReactMount;
  17184. /***/ },
  17185. /* 157 */
  17186. /***/ function(module, exports, __webpack_require__) {
  17187. /**
  17188. * Copyright 2013-present, Facebook, Inc.
  17189. * All rights reserved.
  17190. *
  17191. * This source code is licensed under the BSD-style license found in the
  17192. * LICENSE file in the root directory of this source tree. An additional grant
  17193. * of patent rights can be found in the PATENTS file in the same directory.
  17194. *
  17195. * @providesModule ReactDOMContainerInfo
  17196. */
  17197. 'use strict';
  17198. var validateDOMNesting = __webpack_require__(126);
  17199. var DOC_NODE_TYPE = 9;
  17200. function ReactDOMContainerInfo(topLevelWrapper, node) {
  17201. var info = {
  17202. _topLevelWrapper: topLevelWrapper,
  17203. _idCounter: 1,
  17204. _ownerDocument: node ? node.nodeType === DOC_NODE_TYPE ? node : node.ownerDocument : null,
  17205. _node: node,
  17206. _tag: node ? node.nodeName.toLowerCase() : null,
  17207. _namespaceURI: node ? node.namespaceURI : null
  17208. };
  17209. if (false) {
  17210. info._ancestorInfo = node ? validateDOMNesting.updatedAncestorInfo(null, info._tag, null) : null;
  17211. }
  17212. return info;
  17213. }
  17214. module.exports = ReactDOMContainerInfo;
  17215. /***/ },
  17216. /* 158 */
  17217. /***/ function(module, exports) {
  17218. /**
  17219. * Copyright 2013-present, Facebook, Inc.
  17220. * All rights reserved.
  17221. *
  17222. * This source code is licensed under the BSD-style license found in the
  17223. * LICENSE file in the root directory of this source tree. An additional grant
  17224. * of patent rights can be found in the PATENTS file in the same directory.
  17225. *
  17226. * @providesModule ReactDOMFeatureFlags
  17227. */
  17228. 'use strict';
  17229. var ReactDOMFeatureFlags = {
  17230. useCreateElement: true
  17231. };
  17232. module.exports = ReactDOMFeatureFlags;
  17233. /***/ },
  17234. /* 159 */
  17235. /***/ function(module, exports, __webpack_require__) {
  17236. /**
  17237. * Copyright 2013-present, Facebook, Inc.
  17238. * All rights reserved.
  17239. *
  17240. * This source code is licensed under the BSD-style license found in the
  17241. * LICENSE file in the root directory of this source tree. An additional grant
  17242. * of patent rights can be found in the PATENTS file in the same directory.
  17243. *
  17244. * @providesModule ReactMarkupChecksum
  17245. */
  17246. 'use strict';
  17247. var adler32 = __webpack_require__(160);
  17248. var TAG_END = /\/?>/;
  17249. var COMMENT_START = /^<\!\-\-/;
  17250. var ReactMarkupChecksum = {
  17251. CHECKSUM_ATTR_NAME: 'data-react-checksum',
  17252. /**
  17253. * @param {string} markup Markup string
  17254. * @return {string} Markup string with checksum attribute attached
  17255. */
  17256. addChecksumToMarkup: function (markup) {
  17257. var checksum = adler32(markup);
  17258. // Add checksum (handle both parent tags, comments and self-closing tags)
  17259. if (COMMENT_START.test(markup)) {
  17260. return markup;
  17261. } else {
  17262. return markup.replace(TAG_END, ' ' + ReactMarkupChecksum.CHECKSUM_ATTR_NAME + '="' + checksum + '"$&');
  17263. }
  17264. },
  17265. /**
  17266. * @param {string} markup to use
  17267. * @param {DOMElement} element root React element
  17268. * @returns {boolean} whether or not the markup is the same
  17269. */
  17270. canReuseMarkup: function (markup, element) {
  17271. var existingChecksum = element.getAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME);
  17272. existingChecksum = existingChecksum && parseInt(existingChecksum, 10);
  17273. var markupChecksum = adler32(markup);
  17274. return markupChecksum === existingChecksum;
  17275. }
  17276. };
  17277. module.exports = ReactMarkupChecksum;
  17278. /***/ },
  17279. /* 160 */
  17280. /***/ function(module, exports) {
  17281. /**
  17282. * Copyright 2013-present, Facebook, Inc.
  17283. * All rights reserved.
  17284. *
  17285. * This source code is licensed under the BSD-style license found in the
  17286. * LICENSE file in the root directory of this source tree. An additional grant
  17287. * of patent rights can be found in the PATENTS file in the same directory.
  17288. *
  17289. * @providesModule adler32
  17290. */
  17291. 'use strict';
  17292. var MOD = 65521;
  17293. // adler32 is not cryptographically strong, and is only used to sanity check that
  17294. // markup generated on the server matches the markup generated on the client.
  17295. // This implementation (a modified version of the SheetJS version) has been optimized
  17296. // for our use case, at the expense of conforming to the adler32 specification
  17297. // for non-ascii inputs.
  17298. function adler32(data) {
  17299. var a = 1;
  17300. var b = 0;
  17301. var i = 0;
  17302. var l = data.length;
  17303. var m = l & ~0x3;
  17304. while (i < m) {
  17305. var n = Math.min(i + 4096, m);
  17306. for (; i < n; i += 4) {
  17307. b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));
  17308. }
  17309. a %= MOD;
  17310. b %= MOD;
  17311. }
  17312. for (; i < l; i++) {
  17313. b += a += data.charCodeAt(i);
  17314. }
  17315. a %= MOD;
  17316. b %= MOD;
  17317. return a | b << 16;
  17318. }
  17319. module.exports = adler32;
  17320. /***/ },
  17321. /* 161 */
  17322. /***/ function(module, exports, __webpack_require__) {
  17323. /**
  17324. * Copyright 2013-present, Facebook, Inc.
  17325. * All rights reserved.
  17326. *
  17327. * This source code is licensed under the BSD-style license found in the
  17328. * LICENSE file in the root directory of this source tree. An additional grant
  17329. * of patent rights can be found in the PATENTS file in the same directory.
  17330. *
  17331. * @providesModule findDOMNode
  17332. */
  17333. 'use strict';
  17334. var ReactCurrentOwner = __webpack_require__(8);
  17335. var ReactDOMComponentTree = __webpack_require__(36);
  17336. var ReactInstanceMap = __webpack_require__(117);
  17337. var getNativeComponentFromComposite = __webpack_require__(162);
  17338. var invariant = __webpack_require__(6);
  17339. var warning = __webpack_require__(9);
  17340. /**
  17341. * Returns the DOM node rendered by this element.
  17342. *
  17343. * See https://facebook.github.io/react/docs/top-level-api.html#reactdom.finddomnode
  17344. *
  17345. * @param {ReactComponent|DOMElement} componentOrElement
  17346. * @return {?DOMElement} The root node of this element.
  17347. */
  17348. function findDOMNode(componentOrElement) {
  17349. if (false) {
  17350. var owner = ReactCurrentOwner.current;
  17351. if (owner !== null) {
  17352. process.env.NODE_ENV !== 'production' ? warning(owner._warnedAboutRefsInRender, '%s is accessing findDOMNode inside its render(). ' + 'render() should be a pure function of props and state. It should ' + 'never access something that requires stale data from the previous ' + 'render, such as refs. Move this logic to componentDidMount and ' + 'componentDidUpdate instead.', owner.getName() || 'A component') : void 0;
  17353. owner._warnedAboutRefsInRender = true;
  17354. }
  17355. }
  17356. if (componentOrElement == null) {
  17357. return null;
  17358. }
  17359. if (componentOrElement.nodeType === 1) {
  17360. return componentOrElement;
  17361. }
  17362. var inst = ReactInstanceMap.get(componentOrElement);
  17363. if (inst) {
  17364. inst = getNativeComponentFromComposite(inst);
  17365. return inst ? ReactDOMComponentTree.getNodeFromInstance(inst) : null;
  17366. }
  17367. if (typeof componentOrElement.render === 'function') {
  17368. true ? false ? invariant(false, 'findDOMNode was called on an unmounted component.') : invariant(false) : void 0;
  17369. } else {
  17370. true ? false ? invariant(false, 'Element appears to be neither ReactComponent nor DOMNode (keys: %s)', Object.keys(componentOrElement)) : invariant(false) : void 0;
  17371. }
  17372. }
  17373. module.exports = findDOMNode;
  17374. /***/ },
  17375. /* 162 */
  17376. /***/ function(module, exports, __webpack_require__) {
  17377. /**
  17378. * Copyright 2013-present, Facebook, Inc.
  17379. * All rights reserved.
  17380. *
  17381. * This source code is licensed under the BSD-style license found in the
  17382. * LICENSE file in the root directory of this source tree. An additional grant
  17383. * of patent rights can be found in the PATENTS file in the same directory.
  17384. *
  17385. * @providesModule getNativeComponentFromComposite
  17386. */
  17387. 'use strict';
  17388. var ReactNodeTypes = __webpack_require__(118);
  17389. function getNativeComponentFromComposite(inst) {
  17390. var type;
  17391. while ((type = inst._renderedNodeType) === ReactNodeTypes.COMPOSITE) {
  17392. inst = inst._renderedComponent;
  17393. }
  17394. if (type === ReactNodeTypes.NATIVE) {
  17395. return inst._renderedComponent;
  17396. } else if (type === ReactNodeTypes.EMPTY) {
  17397. return null;
  17398. }
  17399. }
  17400. module.exports = getNativeComponentFromComposite;
  17401. /***/ },
  17402. /* 163 */
  17403. /***/ function(module, exports, __webpack_require__) {
  17404. /**
  17405. * Copyright 2013-present, Facebook, Inc.
  17406. * All rights reserved.
  17407. *
  17408. * This source code is licensed under the BSD-style license found in the
  17409. * LICENSE file in the root directory of this source tree. An additional grant
  17410. * of patent rights can be found in the PATENTS file in the same directory.
  17411. *
  17412. * @providesModule renderSubtreeIntoContainer
  17413. */
  17414. 'use strict';
  17415. var ReactMount = __webpack_require__(156);
  17416. module.exports = ReactMount.renderSubtreeIntoContainer;
  17417. /***/ }
  17418. /******/ ]);