bundle.js 1.2 MB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151251522515325154251552515625157251582515925160251612516225163251642516525166251672516825169251702517125172251732517425175251762517725178251792518025181251822518325184251852518625187251882518925190251912519225193251942519525196251972519825199252002520125202252032520425205252062520725208252092521025211252122521325214252152521625217252182521925220252212522225223252242522525226252272522825229252302523125232252332523425235252362523725238252392524025241252422524325244252452524625247252482524925250252512525225253252542525525256252572525825259252602526125262252632526425265252662526725268252692527025271252722527325274252752527625277252782527925280252812528225283252842528525286252872528825289252902529125292252932529425295252962529725298252992530025301253022530325304253052530625307253082530925310253112531225313253142531525316253172531825319253202532125322253232532425325253262532725328253292533025331253322533325334253352533625337253382533925340253412534225343253442534525346253472534825349253502535125352253532535425355253562535725358253592536025361253622536325364253652536625367253682536925370253712537225373253742537525376253772537825379253802538125382253832538425385253862538725388253892539025391253922539325394253952539625397253982539925400254012540225403254042540525406254072540825409254102541125412254132541425415254162541725418254192542025421254222542325424254252542625427254282542925430254312543225433254342543525436254372543825439254402544125442254432544425445254462544725448254492545025451254522545325454254552545625457254582545925460254612546225463254642546525466254672546825469254702547125472254732547425475254762547725478254792548025481254822548325484254852548625487254882548925490254912549225493254942549525496254972549825499255002550125502255032550425505255062550725508255092551025511255122551325514255152551625517255182551925520255212552225523255242552525526255272552825529255302553125532255332553425535255362553725538255392554025541255422554325544255452554625547255482554925550255512555225553255542555525556255572555825559255602556125562255632556425565255662556725568255692557025571255722557325574255752557625577255782557925580255812558225583255842558525586255872558825589255902559125592255932559425595255962559725598255992560025601256022560325604256052560625607256082560925610256112561225613256142561525616256172561825619256202562125622256232562425625256262562725628256292563025631256322563325634256352563625637256382563925640256412564225643256442564525646256472564825649256502565125652256532565425655256562565725658256592566025661256622566325664256652566625667256682566925670256712567225673256742567525676256772567825679256802568125682256832568425685256862568725688256892569025691256922569325694256952569625697256982569925700257012570225703257042570525706257072570825709257102571125712257132571425715257162571725718257192572025721257222572325724257252572625727257282572925730257312573225733257342573525736257372573825739257402574125742257432574425745257462574725748257492575025751257522575325754257552575625757257582575925760257612576225763257642576525766257672576825769257702577125772257732577425775257762577725778257792578025781257822578325784257852578625787257882578925790257912579225793257942579525796257972579825799258002580125802258032580425805258062580725808258092581025811258122581325814258152581625817258182581925820258212582225823258242582525826258272582825829258302583125832258332583425835258362583725838258392584025841258422584325844258452584625847258482584925850258512585225853258542585525856258572585825859258602586125862258632586425865258662586725868258692587025871258722587325874258752587625877258782587925880258812588225883258842588525886258872588825889258902589125892258932589425895258962589725898258992590025901259022590325904259052590625907259082590925910259112591225913259142591525916259172591825919259202592125922259232592425925259262592725928259292593025931259322593325934259352593625937259382593925940259412594225943259442594525946259472594825949259502595125952259532595425955259562595725958259592596025961259622596325964259652596625967259682596925970259712597225973259742597525976259772597825979259802598125982259832598425985259862598725988259892599025991259922599325994259952599625997259982599926000260012600226003260042600526006260072600826009260102601126012260132601426015260162601726018260192602026021260222602326024260252602626027260282602926030260312603226033260342603526036260372603826039260402604126042260432604426045260462604726048260492605026051260522605326054260552605626057260582605926060260612606226063260642606526066260672606826069260702607126072260732607426075260762607726078260792608026081260822608326084260852608626087260882608926090260912609226093260942609526096260972609826099261002610126102261032610426105261062610726108261092611026111261122611326114261152611626117261182611926120261212612226123261242612526126261272612826129261302613126132261332613426135261362613726138261392614026141261422614326144261452614626147261482614926150261512615226153261542615526156261572615826159261602616126162261632616426165261662616726168261692617026171261722617326174261752617626177261782617926180261812618226183261842618526186261872618826189261902619126192261932619426195261962619726198261992620026201262022620326204262052620626207262082620926210262112621226213262142621526216262172621826219262202622126222262232622426225262262622726228262292623026231262322623326234262352623626237262382623926240262412624226243262442624526246262472624826249262502625126252262532625426255262562625726258262592626026261262622626326264262652626626267262682626926270262712627226273262742627526276262772627826279262802628126282262832628426285262862628726288262892629026291262922629326294262952629626297262982629926300263012630226303263042630526306263072630826309263102631126312263132631426315263162631726318263192632026321263222632326324263252632626327263282632926330263312633226333263342633526336263372633826339263402634126342263432634426345263462634726348263492635026351263522635326354263552635626357263582635926360263612636226363263642636526366263672636826369263702637126372263732637426375263762637726378263792638026381263822638326384263852638626387263882638926390263912639226393263942639526396263972639826399264002640126402264032640426405264062640726408264092641026411264122641326414264152641626417264182641926420264212642226423264242642526426264272642826429264302643126432264332643426435264362643726438264392644026441264422644326444264452644626447264482644926450264512645226453264542645526456264572645826459264602646126462264632646426465264662646726468264692647026471264722647326474264752647626477264782647926480264812648226483264842648526486264872648826489264902649126492264932649426495264962649726498264992650026501265022650326504265052650626507265082650926510265112651226513265142651526516265172651826519265202652126522265232652426525265262652726528265292653026531265322653326534265352653626537265382653926540265412654226543265442654526546265472654826549265502655126552265532655426555265562655726558265592656026561265622656326564265652656626567265682656926570265712657226573265742657526576265772657826579265802658126582265832658426585265862658726588265892659026591265922659326594265952659626597265982659926600266012660226603266042660526606266072660826609266102661126612266132661426615266162661726618266192662026621266222662326624266252662626627266282662926630266312663226633266342663526636266372663826639266402664126642266432664426645266462664726648266492665026651266522665326654266552665626657266582665926660266612666226663266642666526666266672666826669266702667126672266732667426675266762667726678266792668026681266822668326684266852668626687266882668926690266912669226693266942669526696266972669826699267002670126702267032670426705267062670726708267092671026711267122671326714267152671626717267182671926720267212672226723267242672526726267272672826729267302673126732267332673426735267362673726738267392674026741267422674326744267452674626747267482674926750267512675226753267542675526756267572675826759267602676126762267632676426765267662676726768267692677026771267722677326774267752677626777267782677926780267812678226783267842678526786267872678826789267902679126792267932679426795267962679726798267992680026801268022680326804268052680626807268082680926810268112681226813268142681526816268172681826819268202682126822268232682426825268262682726828268292683026831268322683326834268352683626837268382683926840268412684226843268442684526846268472684826849268502685126852268532685426855268562685726858268592686026861268622686326864268652686626867268682686926870268712687226873268742687526876268772687826879268802688126882268832688426885268862688726888268892689026891268922689326894268952689626897268982689926900269012690226903269042690526906269072690826909269102691126912269132691426915269162691726918269192692026921269222692326924269252692626927269282692926930269312693226933269342693526936269372693826939269402694126942269432694426945269462694726948269492695026951269522695326954269552695626957269582695926960269612696226963269642696526966269672696826969269702697126972269732697426975269762697726978269792698026981269822698326984269852698626987269882698926990269912699226993269942699526996269972699826999270002700127002270032700427005270062700727008270092701027011270122701327014270152701627017270182701927020270212702227023270242702527026270272702827029270302703127032270332703427035270362703727038270392704027041270422704327044270452704627047270482704927050270512705227053270542705527056270572705827059270602706127062270632706427065270662706727068270692707027071270722707327074270752707627077270782707927080270812708227083270842708527086270872708827089270902709127092270932709427095270962709727098270992710027101271022710327104271052710627107271082710927110271112711227113271142711527116271172711827119271202712127122271232712427125271262712727128271292713027131271322713327134271352713627137271382713927140271412714227143271442714527146271472714827149271502715127152271532715427155271562715727158271592716027161271622716327164271652716627167271682716927170271712717227173271742717527176271772717827179271802718127182271832718427185271862718727188271892719027191271922719327194271952719627197271982719927200272012720227203272042720527206272072720827209272102721127212272132721427215272162721727218272192722027221272222722327224272252722627227272282722927230272312723227233272342723527236272372723827239272402724127242272432724427245272462724727248272492725027251272522725327254272552725627257272582725927260272612726227263272642726527266272672726827269272702727127272272732727427275272762727727278272792728027281272822728327284272852728627287272882728927290272912729227293272942729527296272972729827299273002730127302273032730427305273062730727308273092731027311273122731327314273152731627317273182731927320273212732227323273242732527326273272732827329273302733127332273332733427335273362733727338273392734027341273422734327344273452734627347273482734927350273512735227353273542735527356273572735827359273602736127362273632736427365273662736727368273692737027371273722737327374273752737627377273782737927380273812738227383273842738527386273872738827389273902739127392273932739427395273962739727398273992740027401274022740327404274052740627407274082740927410274112741227413274142741527416274172741827419274202742127422274232742427425274262742727428274292743027431274322743327434274352743627437274382743927440274412744227443274442744527446274472744827449274502745127452274532745427455274562745727458274592746027461274622746327464274652746627467274682746927470274712747227473274742747527476274772747827479274802748127482274832748427485274862748727488274892749027491274922749327494274952749627497274982749927500275012750227503275042750527506275072750827509275102751127512275132751427515275162751727518275192752027521275222752327524275252752627527275282752927530275312753227533275342753527536275372753827539275402754127542275432754427545275462754727548275492755027551275522755327554275552755627557275582755927560275612756227563275642756527566275672756827569275702757127572275732757427575275762757727578275792758027581275822758327584275852758627587275882758927590275912759227593275942759527596275972759827599276002760127602276032760427605276062760727608276092761027611276122761327614276152761627617276182761927620276212762227623276242762527626276272762827629276302763127632276332763427635276362763727638276392764027641276422764327644276452764627647276482764927650276512765227653276542765527656276572765827659276602766127662276632766427665276662766727668276692767027671276722767327674276752767627677276782767927680276812768227683276842768527686276872768827689276902769127692276932769427695276962769727698276992770027701277022770327704277052770627707277082770927710277112771227713277142771527716277172771827719277202772127722277232772427725277262772727728277292773027731277322773327734277352773627737277382773927740277412774227743277442774527746277472774827749277502775127752277532775427755277562775727758277592776027761277622776327764277652776627767277682776927770277712777227773277742777527776277772777827779277802778127782277832778427785277862778727788277892779027791277922779327794277952779627797277982779927800278012780227803278042780527806278072780827809278102781127812278132781427815278162781727818278192782027821278222782327824278252782627827278282782927830278312783227833278342783527836278372783827839278402784127842278432784427845278462784727848278492785027851278522785327854278552785627857278582785927860278612786227863278642786527866278672786827869278702787127872278732787427875278762787727878278792788027881278822788327884278852788627887278882788927890278912789227893278942789527896278972789827899279002790127902279032790427905279062790727908279092791027911279122791327914279152791627917279182791927920279212792227923279242792527926279272792827929279302793127932279332793427935279362793727938279392794027941279422794327944279452794627947279482794927950279512795227953279542795527956279572795827959279602796127962279632796427965279662796727968279692797027971279722797327974279752797627977279782797927980279812798227983279842798527986279872798827989279902799127992279932799427995279962799727998279992800028001280022800328004280052800628007280082800928010280112801228013280142801528016280172801828019280202802128022280232802428025280262802728028280292803028031280322803328034280352803628037280382803928040280412804228043280442804528046280472804828049280502805128052280532805428055280562805728058280592806028061280622806328064280652806628067280682806928070280712807228073280742807528076280772807828079280802808128082280832808428085280862808728088280892809028091280922809328094280952809628097280982809928100281012810228103281042810528106281072810828109281102811128112281132811428115281162811728118281192812028121281222812328124281252812628127281282812928130281312813228133281342813528136281372813828139281402814128142281432814428145281462814728148281492815028151281522815328154281552815628157281582815928160281612816228163281642816528166281672816828169281702817128172281732817428175281762817728178281792818028181281822818328184281852818628187281882818928190281912819228193281942819528196281972819828199282002820128202282032820428205282062820728208282092821028211282122821328214282152821628217282182821928220282212822228223282242822528226282272822828229282302823128232282332823428235282362823728238282392824028241282422824328244282452824628247282482824928250282512825228253282542825528256282572825828259282602826128262282632826428265282662826728268282692827028271282722827328274282752827628277282782827928280282812828228283282842828528286282872828828289282902829128292282932829428295282962829728298282992830028301283022830328304283052830628307283082830928310283112831228313283142831528316283172831828319283202832128322283232832428325283262832728328283292833028331283322833328334283352833628337283382833928340283412834228343283442834528346283472834828349283502835128352283532835428355283562835728358283592836028361283622836328364283652836628367283682836928370283712837228373283742837528376283772837828379283802838128382283832838428385283862838728388283892839028391283922839328394283952839628397283982839928400284012840228403284042840528406284072840828409284102841128412284132841428415284162841728418284192842028421284222842328424284252842628427284282842928430284312843228433284342843528436284372843828439284402844128442284432844428445284462844728448284492845028451284522845328454284552845628457284582845928460284612846228463284642846528466284672846828469284702847128472284732847428475284762847728478284792848028481284822848328484284852848628487284882848928490284912849228493284942849528496284972849828499285002850128502285032850428505285062850728508285092851028511285122851328514285152851628517285182851928520285212852228523285242852528526285272852828529285302853128532285332853428535285362853728538285392854028541285422854328544285452854628547285482854928550285512855228553285542855528556285572855828559285602856128562285632856428565285662856728568285692857028571285722857328574285752857628577285782857928580285812858228583285842858528586285872858828589285902859128592285932859428595285962859728598285992860028601286022860328604286052860628607286082860928610286112861228613286142861528616286172861828619286202862128622286232862428625286262862728628286292863028631286322863328634286352863628637286382863928640286412864228643286442864528646286472864828649286502865128652286532865428655286562865728658286592866028661286622866328664286652866628667286682866928670286712867228673286742867528676286772867828679286802868128682286832868428685286862868728688286892869028691286922869328694286952869628697286982869928700287012870228703287042870528706287072870828709287102871128712287132871428715287162871728718287192872028721287222872328724287252872628727287282872928730287312873228733287342873528736287372873828739287402874128742287432874428745287462874728748287492875028751287522875328754287552875628757287582875928760287612876228763287642876528766287672876828769287702877128772287732877428775287762877728778287792878028781287822878328784287852878628787287882878928790287912879228793287942879528796287972879828799288002880128802288032880428805288062880728808288092881028811288122881328814288152881628817288182881928820288212882228823288242882528826288272882828829288302883128832288332883428835288362883728838288392884028841288422884328844288452884628847288482884928850288512885228853288542885528856288572885828859288602886128862288632886428865288662886728868288692887028871288722887328874288752887628877288782887928880288812888228883288842888528886288872888828889288902889128892288932889428895288962889728898288992890028901289022890328904289052890628907289082890928910289112891228913289142891528916289172891828919289202892128922289232892428925289262892728928289292893028931289322893328934289352893628937289382893928940289412894228943289442894528946289472894828949289502895128952289532895428955289562895728958289592896028961289622896328964289652896628967289682896928970289712897228973289742897528976289772897828979289802898128982289832898428985289862898728988289892899028991289922899328994289952899628997289982899929000290012900229003290042900529006290072900829009290102901129012290132901429015290162901729018290192902029021290222902329024290252902629027290282902929030290312903229033290342903529036290372903829039290402904129042290432904429045290462904729048290492905029051290522905329054290552905629057290582905929060290612906229063290642906529066290672906829069290702907129072290732907429075290762907729078290792908029081290822908329084290852908629087290882908929090290912909229093290942909529096290972909829099291002910129102291032910429105291062910729108291092911029111291122911329114291152911629117291182911929120291212912229123291242912529126291272912829129291302913129132291332913429135291362913729138291392914029141291422914329144291452914629147291482914929150291512915229153291542915529156291572915829159291602916129162291632916429165291662916729168291692917029171291722917329174291752917629177291782917929180291812918229183291842918529186291872918829189291902919129192291932919429195291962919729198291992920029201292022920329204292052920629207292082920929210292112921229213292142921529216292172921829219292202922129222292232922429225292262922729228292292923029231292322923329234292352923629237292382923929240292412924229243292442924529246292472924829249292502925129252292532925429255292562925729258292592926029261292622926329264292652926629267292682926929270292712927229273292742927529276292772927829279292802928129282292832928429285292862928729288292892929029291292922929329294292952929629297292982929929300293012930229303293042930529306293072930829309293102931129312293132931429315293162931729318293192932029321293222932329324293252932629327293282932929330293312933229333293342933529336293372933829339293402934129342293432934429345293462934729348293492935029351293522935329354293552935629357293582935929360293612936229363293642936529366293672936829369293702937129372293732937429375293762937729378293792938029381293822938329384293852938629387293882938929390293912939229393293942939529396293972939829399294002940129402294032940429405294062940729408294092941029411294122941329414294152941629417294182941929420294212942229423294242942529426294272942829429294302943129432294332943429435294362943729438294392944029441294422944329444294452944629447294482944929450294512945229453294542945529456294572945829459294602946129462294632946429465294662946729468294692947029471294722947329474294752947629477294782947929480294812948229483294842948529486294872948829489294902949129492294932949429495294962949729498294992950029501295022950329504295052950629507295082950929510295112951229513295142951529516295172951829519295202952129522295232952429525295262952729528295292953029531295322953329534295352953629537295382953929540295412954229543295442954529546295472954829549295502955129552295532955429555295562955729558295592956029561295622956329564295652956629567295682956929570295712957229573295742957529576295772957829579295802958129582295832958429585295862958729588295892959029591295922959329594295952959629597295982959929600296012960229603296042960529606296072960829609296102961129612296132961429615296162961729618296192962029621296222962329624296252962629627296282962929630296312963229633296342963529636296372963829639296402964129642296432964429645296462964729648296492965029651296522965329654296552965629657296582965929660296612966229663296642966529666296672966829669296702967129672296732967429675296762967729678296792968029681296822968329684296852968629687296882968929690296912969229693296942969529696296972969829699297002970129702297032970429705297062970729708297092971029711297122971329714297152971629717297182971929720297212972229723297242972529726297272972829729297302973129732297332973429735297362973729738297392974029741297422974329744297452974629747297482974929750297512975229753297542975529756297572975829759297602976129762297632976429765297662976729768297692977029771297722977329774297752977629777297782977929780297812978229783297842978529786297872978829789297902979129792297932979429795297962979729798297992980029801298022980329804298052980629807298082980929810298112981229813298142981529816298172981829819298202982129822298232982429825298262982729828298292983029831298322983329834298352983629837298382983929840298412984229843298442984529846298472984829849298502985129852298532985429855298562985729858298592986029861298622986329864298652986629867298682986929870298712987229873298742987529876298772987829879298802988129882298832988429885298862988729888298892989029891298922989329894298952989629897298982989929900299012990229903299042990529906299072990829909299102991129912299132991429915299162991729918299192992029921299222992329924299252992629927299282992929930299312993229933299342993529936299372993829939299402994129942299432994429945299462994729948299492995029951299522995329954299552995629957299582995929960299612996229963299642996529966299672996829969299702997129972299732997429975299762997729978299792998029981299822998329984299852998629987299882998929990299912999229993299942999529996299972999829999300003000130002300033000430005300063000730008300093001030011300123001330014300153001630017300183001930020300213002230023300243002530026300273002830029300303003130032300333003430035300363003730038300393004030041300423004330044300453004630047300483004930050300513005230053300543005530056300573005830059300603006130062300633006430065300663006730068300693007030071300723007330074300753007630077300783007930080300813008230083300843008530086300873008830089300903009130092300933009430095300963009730098300993010030101301023010330104301053010630107301083010930110301113011230113301143011530116301173011830119301203012130122301233012430125301263012730128301293013030131301323013330134301353013630137301383013930140301413014230143301443014530146301473014830149301503015130152301533015430155301563015730158301593016030161301623016330164301653016630167301683016930170301713017230173301743017530176301773017830179301803018130182301833018430185301863018730188301893019030191301923019330194301953019630197301983019930200302013020230203302043020530206302073020830209302103021130212302133021430215302163021730218302193022030221302223022330224302253022630227302283022930230302313023230233302343023530236302373023830239302403024130242302433024430245302463024730248302493025030251302523025330254302553025630257302583025930260302613026230263302643026530266302673026830269302703027130272302733027430275302763027730278302793028030281302823028330284302853028630287302883028930290302913029230293302943029530296302973029830299303003030130302303033030430305303063030730308303093031030311303123031330314303153031630317303183031930320303213032230323303243032530326303273032830329303303033130332303333033430335303363033730338303393034030341303423034330344303453034630347303483034930350303513035230353303543035530356303573035830359303603036130362303633036430365303663036730368303693037030371303723037330374303753037630377303783037930380303813038230383303843038530386303873038830389303903039130392303933039430395303963039730398303993040030401304023040330404304053040630407304083040930410304113041230413304143041530416304173041830419304203042130422304233042430425304263042730428304293043030431304323043330434304353043630437304383043930440304413044230443304443044530446304473044830449304503045130452304533045430455304563045730458304593046030461304623046330464304653046630467304683046930470304713047230473304743047530476304773047830479304803048130482304833048430485304863048730488304893049030491304923049330494304953049630497304983049930500305013050230503305043050530506305073050830509305103051130512305133051430515305163051730518305193052030521305223052330524305253052630527305283052930530305313053230533305343053530536305373053830539305403054130542305433054430545305463054730548305493055030551305523055330554305553055630557305583055930560305613056230563305643056530566305673056830569305703057130572305733057430575305763057730578305793058030581305823058330584305853058630587305883058930590305913059230593305943059530596305973059830599306003060130602306033060430605306063060730608306093061030611306123061330614306153061630617306183061930620306213062230623306243062530626306273062830629306303063130632306333063430635306363063730638306393064030641306423064330644306453064630647306483064930650306513065230653306543065530656306573065830659306603066130662306633066430665306663066730668306693067030671306723067330674306753067630677306783067930680306813068230683306843068530686306873068830689306903069130692306933069430695306963069730698306993070030701307023070330704307053070630707307083070930710307113071230713307143071530716307173071830719307203072130722307233072430725307263072730728307293073030731307323073330734307353073630737307383073930740307413074230743307443074530746307473074830749307503075130752307533075430755307563075730758307593076030761307623076330764307653076630767307683076930770307713077230773307743077530776307773077830779307803078130782307833078430785307863078730788307893079030791307923079330794307953079630797307983079930800308013080230803308043080530806308073080830809308103081130812308133081430815308163081730818308193082030821308223082330824308253082630827308283082930830308313083230833308343083530836308373083830839308403084130842308433084430845308463084730848308493085030851308523085330854308553085630857308583085930860308613086230863308643086530866308673086830869308703087130872308733087430875308763087730878308793088030881308823088330884308853088630887308883088930890308913089230893308943089530896308973089830899309003090130902309033090430905309063090730908309093091030911309123091330914309153091630917309183091930920309213092230923309243092530926309273092830929309303093130932309333093430935309363093730938309393094030941309423094330944309453094630947309483094930950309513095230953309543095530956309573095830959309603096130962309633096430965309663096730968309693097030971309723097330974309753097630977309783097930980309813098230983309843098530986309873098830989309903099130992309933099430995309963099730998309993100031001310023100331004310053100631007310083100931010310113101231013310143101531016310173101831019310203102131022310233102431025310263102731028310293103031031310323103331034310353103631037310383103931040310413104231043310443104531046310473104831049310503105131052310533105431055310563105731058310593106031061310623106331064310653106631067310683106931070310713107231073310743107531076310773107831079310803108131082310833108431085310863108731088310893109031091310923109331094310953109631097310983109931100311013110231103311043110531106311073110831109311103111131112311133111431115311163111731118311193112031121311223112331124311253112631127311283112931130311313113231133311343113531136311373113831139311403114131142311433114431145311463114731148311493115031151311523115331154311553115631157311583115931160311613116231163311643116531166311673116831169311703117131172311733117431175311763117731178311793118031181311823118331184311853118631187311883118931190311913119231193311943119531196311973119831199312003120131202312033120431205312063120731208312093121031211312123121331214312153121631217312183121931220312213122231223312243122531226312273122831229312303123131232312333123431235312363123731238312393124031241312423124331244312453124631247312483124931250312513125231253312543125531256312573125831259312603126131262312633126431265312663126731268312693127031271312723127331274312753127631277312783127931280312813128231283312843128531286312873128831289312903129131292312933129431295312963129731298312993130031301313023130331304313053130631307313083130931310313113131231313313143131531316313173131831319313203132131322313233132431325313263132731328313293133031331313323133331334313353133631337313383133931340313413134231343313443134531346313473134831349313503135131352313533135431355313563135731358313593136031361313623136331364313653136631367313683136931370313713137231373313743137531376313773137831379313803138131382313833138431385313863138731388313893139031391313923139331394313953139631397313983139931400314013140231403314043140531406314073140831409314103141131412314133141431415314163141731418314193142031421314223142331424314253142631427314283142931430314313143231433314343143531436314373143831439314403144131442314433144431445314463144731448314493145031451314523145331454314553145631457314583145931460314613146231463314643146531466314673146831469314703147131472314733147431475314763147731478314793148031481314823148331484314853148631487314883148931490314913149231493314943149531496314973149831499315003150131502315033150431505315063150731508315093151031511315123151331514315153151631517315183151931520315213152231523315243152531526315273152831529315303153131532315333153431535315363153731538315393154031541315423154331544315453154631547315483154931550315513155231553315543155531556315573155831559315603156131562315633156431565315663156731568315693157031571315723157331574315753157631577315783157931580315813158231583315843158531586315873158831589315903159131592315933159431595315963159731598315993160031601316023160331604316053160631607316083160931610316113161231613316143161531616316173161831619316203162131622316233162431625316263162731628316293163031631316323163331634316353163631637316383163931640316413164231643316443164531646316473164831649316503165131652316533165431655316563165731658316593166031661316623166331664316653166631667316683166931670316713167231673316743167531676316773167831679316803168131682316833168431685316863168731688316893169031691316923169331694316953169631697316983169931700317013170231703317043170531706317073170831709317103171131712317133171431715317163171731718317193172031721317223172331724317253172631727317283172931730317313173231733317343173531736317373173831739317403174131742317433174431745317463174731748317493175031751317523175331754317553175631757317583175931760317613176231763317643176531766317673176831769317703177131772317733177431775317763177731778317793178031781317823178331784317853178631787317883178931790317913179231793317943179531796317973179831799318003180131802318033180431805318063180731808318093181031811318123181331814318153181631817318183181931820318213182231823318243182531826318273182831829318303183131832318333183431835318363183731838318393184031841318423184331844318453184631847318483184931850318513185231853318543185531856318573185831859318603186131862318633186431865318663186731868318693187031871318723187331874318753187631877318783187931880318813188231883318843188531886318873188831889318903189131892318933189431895318963189731898318993190031901319023190331904319053190631907319083190931910319113191231913319143191531916319173191831919319203192131922319233192431925319263192731928319293193031931319323193331934319353193631937319383193931940319413194231943319443194531946319473194831949319503195131952319533195431955319563195731958319593196031961319623196331964319653196631967319683196931970319713197231973319743197531976319773197831979319803198131982319833198431985319863198731988319893199031991319923199331994319953199631997319983199932000320013200232003320043200532006320073200832009320103201132012320133201432015320163201732018320193202032021320223202332024320253202632027320283202932030320313203232033320343203532036320373203832039320403204132042320433204432045320463204732048320493205032051320523205332054320553205632057320583205932060320613206232063320643206532066320673206832069320703207132072320733207432075320763207732078320793208032081320823208332084320853208632087320883208932090320913209232093320943209532096320973209832099321003210132102321033210432105321063210732108321093211032111321123211332114321153211632117321183211932120321213212232123321243212532126321273212832129321303213132132321333213432135321363213732138321393214032141321423214332144321453214632147321483214932150321513215232153321543215532156321573215832159321603216132162321633216432165321663216732168321693217032171321723217332174321753217632177321783217932180321813218232183321843218532186321873218832189321903219132192321933219432195321963219732198321993220032201322023220332204322053220632207322083220932210322113221232213322143221532216322173221832219322203222132222322233222432225322263222732228322293223032231322323223332234322353223632237322383223932240322413224232243322443224532246322473224832249322503225132252322533225432255322563225732258322593226032261322623226332264322653226632267322683226932270322713227232273322743227532276322773227832279322803228132282322833228432285322863228732288322893229032291322923229332294322953229632297322983229932300323013230232303323043230532306323073230832309323103231132312323133231432315323163231732318323193232032321323223232332324323253232632327323283232932330323313233232333323343233532336323373233832339323403234132342323433234432345323463234732348323493235032351323523235332354323553235632357323583235932360323613236232363323643236532366323673236832369323703237132372323733237432375323763237732378323793238032381323823238332384323853238632387323883238932390323913239232393323943239532396323973239832399324003240132402324033240432405324063240732408324093241032411324123241332414324153241632417324183241932420324213242232423324243242532426324273242832429324303243132432324333243432435324363243732438324393244032441324423244332444324453244632447324483244932450324513245232453324543245532456324573245832459324603246132462324633246432465324663246732468324693247032471324723247332474324753247632477324783247932480324813248232483324843248532486324873248832489324903249132492324933249432495324963249732498324993250032501325023250332504325053250632507325083250932510325113251232513325143251532516325173251832519325203252132522325233252432525325263252732528325293253032531325323253332534325353253632537325383253932540325413254232543325443254532546325473254832549325503255132552325533255432555325563255732558325593256032561325623256332564325653256632567325683256932570325713257232573325743257532576325773257832579325803258132582325833258432585325863258732588325893259032591325923259332594325953259632597325983259932600326013260232603326043260532606326073260832609326103261132612326133261432615326163261732618326193262032621326223262332624326253262632627326283262932630326313263232633326343263532636326373263832639326403264132642326433264432645326463264732648326493265032651326523265332654326553265632657326583265932660326613266232663326643266532666326673266832669326703267132672326733267432675326763267732678326793268032681326823268332684326853268632687326883268932690326913269232693326943269532696326973269832699327003270132702327033270432705327063270732708327093271032711327123271332714327153271632717327183271932720327213272232723327243272532726327273272832729327303273132732327333273432735327363273732738327393274032741327423274332744327453274632747327483274932750327513275232753327543275532756327573275832759327603276132762327633276432765327663276732768327693277032771327723277332774327753277632777327783277932780327813278232783327843278532786327873278832789327903279132792327933279432795327963279732798327993280032801328023280332804328053280632807328083280932810328113281232813328143281532816328173281832819328203282132822328233282432825328263282732828328293283032831328323283332834328353283632837328383283932840328413284232843328443284532846328473284832849328503285132852328533285432855328563285732858328593286032861328623286332864328653286632867328683286932870328713287232873328743287532876328773287832879328803288132882328833288432885328863288732888328893289032891328923289332894328953289632897328983289932900329013290232903329043290532906329073290832909329103291132912329133291432915329163291732918329193292032921329223292332924329253292632927329283292932930329313293232933329343293532936329373293832939329403294132942329433294432945329463294732948329493295032951329523295332954329553295632957329583295932960329613296232963329643296532966329673296832969329703297132972329733297432975329763297732978329793298032981329823298332984329853298632987329883298932990329913299232993329943299532996329973299832999330003300133002330033300433005330063300733008330093301033011330123301333014330153301633017330183301933020330213302233023330243302533026330273302833029330303303133032330333303433035330363303733038330393304033041330423304333044330453304633047330483304933050330513305233053330543305533056330573305833059330603306133062330633306433065330663306733068330693307033071330723307333074330753307633077330783307933080330813308233083330843308533086330873308833089330903309133092330933309433095330963309733098330993310033101331023310333104331053310633107331083310933110331113311233113331143311533116331173311833119331203312133122331233312433125331263312733128331293313033131331323313333134331353313633137331383313933140331413314233143331443314533146331473314833149331503315133152331533315433155331563315733158331593316033161331623316333164331653316633167331683316933170331713317233173331743317533176331773317833179331803318133182331833318433185331863318733188331893319033191331923319333194331953319633197331983319933200332013320233203332043320533206332073320833209332103321133212332133321433215332163321733218332193322033221332223322333224332253322633227332283322933230332313323233233332343323533236332373323833239332403324133242332433324433245332463324733248332493325033251332523325333254332553325633257332583325933260332613326233263332643326533266332673326833269332703327133272332733327433275332763327733278332793328033281332823328333284332853328633287332883328933290332913329233293332943329533296332973329833299333003330133302333033330433305333063330733308333093331033311333123331333314333153331633317333183331933320333213332233323333243332533326333273332833329333303333133332333333333433335333363333733338333393334033341333423334333344333453334633347333483334933350333513335233353333543335533356333573335833359333603336133362333633336433365333663336733368333693337033371333723337333374333753337633377333783337933380333813338233383333843338533386333873338833389333903339133392333933339433395333963339733398333993340033401334023340333404334053340633407334083340933410334113341233413334143341533416334173341833419334203342133422334233342433425334263342733428334293343033431334323343333434334353343633437334383343933440334413344233443334443344533446334473344833449334503345133452334533345433455334563345733458334593346033461334623346333464334653346633467334683346933470334713347233473334743347533476334773347833479334803348133482334833348433485334863348733488334893349033491334923349333494334953349633497334983349933500335013350233503335043350533506335073350833509335103351133512335133351433515335163351733518
  1. /******/ (function(modules) { // webpackBootstrap
  2. /******/ // The module cache
  3. /******/ var installedModules = {};
  4. /******/
  5. /******/ // The require function
  6. /******/ function __webpack_require__(moduleId) {
  7. /******/
  8. /******/ // Check if module is in cache
  9. /******/ if(installedModules[moduleId])
  10. /******/ return installedModules[moduleId].exports;
  11. /******/
  12. /******/ // Create a new module (and put it into the cache)
  13. /******/ var module = installedModules[moduleId] = {
  14. /******/ exports: {},
  15. /******/ id: moduleId,
  16. /******/ loaded: false
  17. /******/ };
  18. /******/
  19. /******/ // Execute the module function
  20. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  21. /******/
  22. /******/ // Flag the module as loaded
  23. /******/ module.loaded = true;
  24. /******/
  25. /******/ // Return the exports of the module
  26. /******/ return module.exports;
  27. /******/ }
  28. /******/
  29. /******/
  30. /******/ // expose the modules object (__webpack_modules__)
  31. /******/ __webpack_require__.m = modules;
  32. /******/
  33. /******/ // expose the module cache
  34. /******/ __webpack_require__.c = installedModules;
  35. /******/
  36. /******/ // __webpack_public_path__
  37. /******/ __webpack_require__.p = "";
  38. /******/
  39. /******/ // Load entry module and return exports
  40. /******/ return __webpack_require__(0);
  41. /******/ })
  42. /************************************************************************/
  43. /******/ ([
  44. /* 0 */
  45. /***/ function(module, exports, __webpack_require__) {
  46. /**
  47. * @author oldj
  48. * @blog http://oldj.net
  49. */
  50. 'use strict';
  51. var _react = __webpack_require__(3);
  52. var _react2 = _interopRequireDefault(_react);
  53. var _reactDom = __webpack_require__(36);
  54. var _reactDom2 = _interopRequireDefault(_reactDom);
  55. var _app = __webpack_require__(174);
  56. var _app2 = _interopRequireDefault(_app);
  57. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  58. ipcRenderer.setMaxListeners(20);
  59. _reactDom2.default.render(_react2.default.createElement(_app2.default, null), document.getElementById('app'));
  60. /***/ },
  61. /* 1 */,
  62. /* 2 */,
  63. /* 3 */
  64. /***/ function(module, exports, __webpack_require__) {
  65. 'use strict';
  66. module.exports = __webpack_require__(4);
  67. /***/ },
  68. /* 4 */
  69. /***/ function(module, exports, __webpack_require__) {
  70. /* WEBPACK VAR INJECTION */(function(process) {/**
  71. * Copyright 2013-present, Facebook, Inc.
  72. * All rights reserved.
  73. *
  74. * This source code is licensed under the BSD-style license found in the
  75. * LICENSE file in the root directory of this source tree. An additional grant
  76. * of patent rights can be found in the PATENTS file in the same directory.
  77. *
  78. * @providesModule React
  79. */
  80. 'use strict';
  81. var _assign = __webpack_require__(6);
  82. var ReactChildren = __webpack_require__(7);
  83. var ReactComponent = __webpack_require__(19);
  84. var ReactPureComponent = __webpack_require__(22);
  85. var ReactClass = __webpack_require__(23);
  86. var ReactDOMFactories = __webpack_require__(28);
  87. var ReactElement = __webpack_require__(11);
  88. var ReactPropTypes = __webpack_require__(33);
  89. var ReactVersion = __webpack_require__(34);
  90. var onlyChild = __webpack_require__(35);
  91. var warning = __webpack_require__(13);
  92. var createElement = ReactElement.createElement;
  93. var createFactory = ReactElement.createFactory;
  94. var cloneElement = ReactElement.cloneElement;
  95. if (process.env.NODE_ENV !== 'production') {
  96. var ReactElementValidator = __webpack_require__(29);
  97. createElement = ReactElementValidator.createElement;
  98. createFactory = ReactElementValidator.createFactory;
  99. cloneElement = ReactElementValidator.cloneElement;
  100. }
  101. var __spread = _assign;
  102. if (process.env.NODE_ENV !== 'production') {
  103. var warned = false;
  104. __spread = function () {
  105. 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;
  106. warned = true;
  107. return _assign.apply(null, arguments);
  108. };
  109. }
  110. var React = {
  111. // Modern
  112. Children: {
  113. map: ReactChildren.map,
  114. forEach: ReactChildren.forEach,
  115. count: ReactChildren.count,
  116. toArray: ReactChildren.toArray,
  117. only: onlyChild
  118. },
  119. Component: ReactComponent,
  120. PureComponent: ReactPureComponent,
  121. createElement: createElement,
  122. cloneElement: cloneElement,
  123. isValidElement: ReactElement.isValidElement,
  124. // Classic
  125. PropTypes: ReactPropTypes,
  126. createClass: ReactClass.createClass,
  127. createFactory: createFactory,
  128. createMixin: function (mixin) {
  129. // Currently a noop. Will be used to validate and trace mixins.
  130. return mixin;
  131. },
  132. // This looks DOM specific but these are actually isomorphic helpers
  133. // since they are just generating DOM strings.
  134. DOM: ReactDOMFactories,
  135. version: ReactVersion,
  136. // Deprecated hook for JSX spread, don't use this for anything.
  137. __spread: __spread
  138. };
  139. module.exports = React;
  140. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  141. /***/ },
  142. /* 5 */
  143. /***/ function(module, exports) {
  144. // shim for using process in browser
  145. var process = module.exports = {};
  146. // cached from whatever global is present so that test runners that stub it
  147. // don't break things. But we need to wrap it in a try catch in case it is
  148. // wrapped in strict mode code which doesn't define any globals. It's inside a
  149. // function because try/catches deoptimize in certain engines.
  150. var cachedSetTimeout;
  151. var cachedClearTimeout;
  152. (function () {
  153. try {
  154. cachedSetTimeout = setTimeout;
  155. } catch (e) {
  156. cachedSetTimeout = function () {
  157. throw new Error('setTimeout is not defined');
  158. }
  159. }
  160. try {
  161. cachedClearTimeout = clearTimeout;
  162. } catch (e) {
  163. cachedClearTimeout = function () {
  164. throw new Error('clearTimeout is not defined');
  165. }
  166. }
  167. } ())
  168. function runTimeout(fun) {
  169. if (cachedSetTimeout === setTimeout) {
  170. //normal enviroments in sane situations
  171. return setTimeout(fun, 0);
  172. }
  173. try {
  174. // when when somebody has screwed with setTimeout but no I.E. maddness
  175. return cachedSetTimeout(fun, 0);
  176. } catch(e){
  177. try {
  178. // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
  179. return cachedSetTimeout.call(null, fun, 0);
  180. } catch(e){
  181. // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
  182. return cachedSetTimeout.call(this, fun, 0);
  183. }
  184. }
  185. }
  186. function runClearTimeout(marker) {
  187. if (cachedClearTimeout === clearTimeout) {
  188. //normal enviroments in sane situations
  189. return clearTimeout(marker);
  190. }
  191. try {
  192. // when when somebody has screwed with setTimeout but no I.E. maddness
  193. return cachedClearTimeout(marker);
  194. } catch (e){
  195. try {
  196. // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
  197. return cachedClearTimeout.call(null, marker);
  198. } catch (e){
  199. // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
  200. // Some versions of I.E. have different rules for clearTimeout vs setTimeout
  201. return cachedClearTimeout.call(this, marker);
  202. }
  203. }
  204. }
  205. var queue = [];
  206. var draining = false;
  207. var currentQueue;
  208. var queueIndex = -1;
  209. function cleanUpNextTick() {
  210. if (!draining || !currentQueue) {
  211. return;
  212. }
  213. draining = false;
  214. if (currentQueue.length) {
  215. queue = currentQueue.concat(queue);
  216. } else {
  217. queueIndex = -1;
  218. }
  219. if (queue.length) {
  220. drainQueue();
  221. }
  222. }
  223. function drainQueue() {
  224. if (draining) {
  225. return;
  226. }
  227. var timeout = runTimeout(cleanUpNextTick);
  228. draining = true;
  229. var len = queue.length;
  230. while(len) {
  231. currentQueue = queue;
  232. queue = [];
  233. while (++queueIndex < len) {
  234. if (currentQueue) {
  235. currentQueue[queueIndex].run();
  236. }
  237. }
  238. queueIndex = -1;
  239. len = queue.length;
  240. }
  241. currentQueue = null;
  242. draining = false;
  243. runClearTimeout(timeout);
  244. }
  245. process.nextTick = function (fun) {
  246. var args = new Array(arguments.length - 1);
  247. if (arguments.length > 1) {
  248. for (var i = 1; i < arguments.length; i++) {
  249. args[i - 1] = arguments[i];
  250. }
  251. }
  252. queue.push(new Item(fun, args));
  253. if (queue.length === 1 && !draining) {
  254. runTimeout(drainQueue);
  255. }
  256. };
  257. // v8 likes predictible objects
  258. function Item(fun, array) {
  259. this.fun = fun;
  260. this.array = array;
  261. }
  262. Item.prototype.run = function () {
  263. this.fun.apply(null, this.array);
  264. };
  265. process.title = 'browser';
  266. process.browser = true;
  267. process.env = {};
  268. process.argv = [];
  269. process.version = ''; // empty string to avoid regexp issues
  270. process.versions = {};
  271. function noop() {}
  272. process.on = noop;
  273. process.addListener = noop;
  274. process.once = noop;
  275. process.off = noop;
  276. process.removeListener = noop;
  277. process.removeAllListeners = noop;
  278. process.emit = noop;
  279. process.binding = function (name) {
  280. throw new Error('process.binding is not supported');
  281. };
  282. process.cwd = function () { return '/' };
  283. process.chdir = function (dir) {
  284. throw new Error('process.chdir is not supported');
  285. };
  286. process.umask = function() { return 0; };
  287. /***/ },
  288. /* 6 */
  289. /***/ function(module, exports) {
  290. 'use strict';
  291. /* eslint-disable no-unused-vars */
  292. var hasOwnProperty = Object.prototype.hasOwnProperty;
  293. var propIsEnumerable = Object.prototype.propertyIsEnumerable;
  294. function toObject(val) {
  295. if (val === null || val === undefined) {
  296. throw new TypeError('Object.assign cannot be called with null or undefined');
  297. }
  298. return Object(val);
  299. }
  300. function shouldUseNative() {
  301. try {
  302. if (!Object.assign) {
  303. return false;
  304. }
  305. // Detect buggy property enumeration order in older V8 versions.
  306. // https://bugs.chromium.org/p/v8/issues/detail?id=4118
  307. var test1 = new String('abc'); // eslint-disable-line
  308. test1[5] = 'de';
  309. if (Object.getOwnPropertyNames(test1)[0] === '5') {
  310. return false;
  311. }
  312. // https://bugs.chromium.org/p/v8/issues/detail?id=3056
  313. var test2 = {};
  314. for (var i = 0; i < 10; i++) {
  315. test2['_' + String.fromCharCode(i)] = i;
  316. }
  317. var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
  318. return test2[n];
  319. });
  320. if (order2.join('') !== '0123456789') {
  321. return false;
  322. }
  323. // https://bugs.chromium.org/p/v8/issues/detail?id=3056
  324. var test3 = {};
  325. 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
  326. test3[letter] = letter;
  327. });
  328. if (Object.keys(Object.assign({}, test3)).join('') !==
  329. 'abcdefghijklmnopqrst') {
  330. return false;
  331. }
  332. return true;
  333. } catch (e) {
  334. // We don't expect any of the above to throw, but better to be safe.
  335. return false;
  336. }
  337. }
  338. module.exports = shouldUseNative() ? Object.assign : function (target, source) {
  339. var from;
  340. var to = toObject(target);
  341. var symbols;
  342. for (var s = 1; s < arguments.length; s++) {
  343. from = Object(arguments[s]);
  344. for (var key in from) {
  345. if (hasOwnProperty.call(from, key)) {
  346. to[key] = from[key];
  347. }
  348. }
  349. if (Object.getOwnPropertySymbols) {
  350. symbols = Object.getOwnPropertySymbols(from);
  351. for (var i = 0; i < symbols.length; i++) {
  352. if (propIsEnumerable.call(from, symbols[i])) {
  353. to[symbols[i]] = from[symbols[i]];
  354. }
  355. }
  356. }
  357. }
  358. return to;
  359. };
  360. /***/ },
  361. /* 7 */
  362. /***/ function(module, exports, __webpack_require__) {
  363. /**
  364. * Copyright 2013-present, Facebook, Inc.
  365. * All rights reserved.
  366. *
  367. * This source code is licensed under the BSD-style license found in the
  368. * LICENSE file in the root directory of this source tree. An additional grant
  369. * of patent rights can be found in the PATENTS file in the same directory.
  370. *
  371. * @providesModule ReactChildren
  372. */
  373. 'use strict';
  374. var PooledClass = __webpack_require__(8);
  375. var ReactElement = __webpack_require__(11);
  376. var emptyFunction = __webpack_require__(14);
  377. var traverseAllChildren = __webpack_require__(16);
  378. var twoArgumentPooler = PooledClass.twoArgumentPooler;
  379. var fourArgumentPooler = PooledClass.fourArgumentPooler;
  380. var userProvidedKeyEscapeRegex = /\/+/g;
  381. function escapeUserProvidedKey(text) {
  382. return ('' + text).replace(userProvidedKeyEscapeRegex, '$&/');
  383. }
  384. /**
  385. * PooledClass representing the bookkeeping associated with performing a child
  386. * traversal. Allows avoiding binding callbacks.
  387. *
  388. * @constructor ForEachBookKeeping
  389. * @param {!function} forEachFunction Function to perform traversal with.
  390. * @param {?*} forEachContext Context to perform context with.
  391. */
  392. function ForEachBookKeeping(forEachFunction, forEachContext) {
  393. this.func = forEachFunction;
  394. this.context = forEachContext;
  395. this.count = 0;
  396. }
  397. ForEachBookKeeping.prototype.destructor = function () {
  398. this.func = null;
  399. this.context = null;
  400. this.count = 0;
  401. };
  402. PooledClass.addPoolingTo(ForEachBookKeeping, twoArgumentPooler);
  403. function forEachSingleChild(bookKeeping, child, name) {
  404. var func = bookKeeping.func;
  405. var context = bookKeeping.context;
  406. func.call(context, child, bookKeeping.count++);
  407. }
  408. /**
  409. * Iterates through children that are typically specified as `props.children`.
  410. *
  411. * See https://facebook.github.io/react/docs/top-level-api.html#react.children.foreach
  412. *
  413. * The provided forEachFunc(child, index) will be called for each
  414. * leaf child.
  415. *
  416. * @param {?*} children Children tree container.
  417. * @param {function(*, int)} forEachFunc
  418. * @param {*} forEachContext Context for forEachContext.
  419. */
  420. function forEachChildren(children, forEachFunc, forEachContext) {
  421. if (children == null) {
  422. return children;
  423. }
  424. var traverseContext = ForEachBookKeeping.getPooled(forEachFunc, forEachContext);
  425. traverseAllChildren(children, forEachSingleChild, traverseContext);
  426. ForEachBookKeeping.release(traverseContext);
  427. }
  428. /**
  429. * PooledClass representing the bookkeeping associated with performing a child
  430. * mapping. Allows avoiding binding callbacks.
  431. *
  432. * @constructor MapBookKeeping
  433. * @param {!*} mapResult Object containing the ordered map of results.
  434. * @param {!function} mapFunction Function to perform mapping with.
  435. * @param {?*} mapContext Context to perform mapping with.
  436. */
  437. function MapBookKeeping(mapResult, keyPrefix, mapFunction, mapContext) {
  438. this.result = mapResult;
  439. this.keyPrefix = keyPrefix;
  440. this.func = mapFunction;
  441. this.context = mapContext;
  442. this.count = 0;
  443. }
  444. MapBookKeeping.prototype.destructor = function () {
  445. this.result = null;
  446. this.keyPrefix = null;
  447. this.func = null;
  448. this.context = null;
  449. this.count = 0;
  450. };
  451. PooledClass.addPoolingTo(MapBookKeeping, fourArgumentPooler);
  452. function mapSingleChildIntoContext(bookKeeping, child, childKey) {
  453. var result = bookKeeping.result;
  454. var keyPrefix = bookKeeping.keyPrefix;
  455. var func = bookKeeping.func;
  456. var context = bookKeeping.context;
  457. var mappedChild = func.call(context, child, bookKeeping.count++);
  458. if (Array.isArray(mappedChild)) {
  459. mapIntoWithKeyPrefixInternal(mappedChild, result, childKey, emptyFunction.thatReturnsArgument);
  460. } else if (mappedChild != null) {
  461. if (ReactElement.isValidElement(mappedChild)) {
  462. mappedChild = ReactElement.cloneAndReplaceKey(mappedChild,
  463. // Keep both the (mapped) and old keys if they differ, just as
  464. // traverseAllChildren used to do for objects as children
  465. keyPrefix + (mappedChild.key && (!child || child.key !== mappedChild.key) ? escapeUserProvidedKey(mappedChild.key) + '/' : '') + childKey);
  466. }
  467. result.push(mappedChild);
  468. }
  469. }
  470. function mapIntoWithKeyPrefixInternal(children, array, prefix, func, context) {
  471. var escapedPrefix = '';
  472. if (prefix != null) {
  473. escapedPrefix = escapeUserProvidedKey(prefix) + '/';
  474. }
  475. var traverseContext = MapBookKeeping.getPooled(array, escapedPrefix, func, context);
  476. traverseAllChildren(children, mapSingleChildIntoContext, traverseContext);
  477. MapBookKeeping.release(traverseContext);
  478. }
  479. /**
  480. * Maps children that are typically specified as `props.children`.
  481. *
  482. * See https://facebook.github.io/react/docs/top-level-api.html#react.children.map
  483. *
  484. * The provided mapFunction(child, key, index) will be called for each
  485. * leaf child.
  486. *
  487. * @param {?*} children Children tree container.
  488. * @param {function(*, int)} func The map function.
  489. * @param {*} context Context for mapFunction.
  490. * @return {object} Object containing the ordered map of results.
  491. */
  492. function mapChildren(children, func, context) {
  493. if (children == null) {
  494. return children;
  495. }
  496. var result = [];
  497. mapIntoWithKeyPrefixInternal(children, result, null, func, context);
  498. return result;
  499. }
  500. function forEachSingleChildDummy(traverseContext, child, name) {
  501. return null;
  502. }
  503. /**
  504. * Count the number of children that are typically specified as
  505. * `props.children`.
  506. *
  507. * See https://facebook.github.io/react/docs/top-level-api.html#react.children.count
  508. *
  509. * @param {?*} children Children tree container.
  510. * @return {number} The number of children.
  511. */
  512. function countChildren(children, context) {
  513. return traverseAllChildren(children, forEachSingleChildDummy, null);
  514. }
  515. /**
  516. * Flatten a children object (typically specified as `props.children`) and
  517. * return an array with appropriately re-keyed children.
  518. *
  519. * See https://facebook.github.io/react/docs/top-level-api.html#react.children.toarray
  520. */
  521. function toArray(children) {
  522. var result = [];
  523. mapIntoWithKeyPrefixInternal(children, result, null, emptyFunction.thatReturnsArgument);
  524. return result;
  525. }
  526. var ReactChildren = {
  527. forEach: forEachChildren,
  528. map: mapChildren,
  529. mapIntoWithKeyPrefixInternal: mapIntoWithKeyPrefixInternal,
  530. count: countChildren,
  531. toArray: toArray
  532. };
  533. module.exports = ReactChildren;
  534. /***/ },
  535. /* 8 */
  536. /***/ function(module, exports, __webpack_require__) {
  537. /* WEBPACK VAR INJECTION */(function(process) {/**
  538. * Copyright 2013-present, Facebook, Inc.
  539. * All rights reserved.
  540. *
  541. * This source code is licensed under the BSD-style license found in the
  542. * LICENSE file in the root directory of this source tree. An additional grant
  543. * of patent rights can be found in the PATENTS file in the same directory.
  544. *
  545. * @providesModule PooledClass
  546. */
  547. 'use strict';
  548. var _prodInvariant = __webpack_require__(9);
  549. var invariant = __webpack_require__(10);
  550. /**
  551. * Static poolers. Several custom versions for each potential number of
  552. * arguments. A completely generic pooler is easy to implement, but would
  553. * require accessing the `arguments` object. In each of these, `this` refers to
  554. * the Class itself, not an instance. If any others are needed, simply add them
  555. * here, or in their own files.
  556. */
  557. var oneArgumentPooler = function (copyFieldsFrom) {
  558. var Klass = this;
  559. if (Klass.instancePool.length) {
  560. var instance = Klass.instancePool.pop();
  561. Klass.call(instance, copyFieldsFrom);
  562. return instance;
  563. } else {
  564. return new Klass(copyFieldsFrom);
  565. }
  566. };
  567. var twoArgumentPooler = function (a1, a2) {
  568. var Klass = this;
  569. if (Klass.instancePool.length) {
  570. var instance = Klass.instancePool.pop();
  571. Klass.call(instance, a1, a2);
  572. return instance;
  573. } else {
  574. return new Klass(a1, a2);
  575. }
  576. };
  577. var threeArgumentPooler = function (a1, a2, a3) {
  578. var Klass = this;
  579. if (Klass.instancePool.length) {
  580. var instance = Klass.instancePool.pop();
  581. Klass.call(instance, a1, a2, a3);
  582. return instance;
  583. } else {
  584. return new Klass(a1, a2, a3);
  585. }
  586. };
  587. var fourArgumentPooler = function (a1, a2, a3, a4) {
  588. var Klass = this;
  589. if (Klass.instancePool.length) {
  590. var instance = Klass.instancePool.pop();
  591. Klass.call(instance, a1, a2, a3, a4);
  592. return instance;
  593. } else {
  594. return new Klass(a1, a2, a3, a4);
  595. }
  596. };
  597. var fiveArgumentPooler = function (a1, a2, a3, a4, a5) {
  598. var Klass = this;
  599. if (Klass.instancePool.length) {
  600. var instance = Klass.instancePool.pop();
  601. Klass.call(instance, a1, a2, a3, a4, a5);
  602. return instance;
  603. } else {
  604. return new Klass(a1, a2, a3, a4, a5);
  605. }
  606. };
  607. var standardReleaser = function (instance) {
  608. var Klass = this;
  609. !(instance instanceof Klass) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Trying to release an instance into a pool of a different type.') : _prodInvariant('25') : void 0;
  610. instance.destructor();
  611. if (Klass.instancePool.length < Klass.poolSize) {
  612. Klass.instancePool.push(instance);
  613. }
  614. };
  615. var DEFAULT_POOL_SIZE = 10;
  616. var DEFAULT_POOLER = oneArgumentPooler;
  617. /**
  618. * Augments `CopyConstructor` to be a poolable class, augmenting only the class
  619. * itself (statically) not adding any prototypical fields. Any CopyConstructor
  620. * you give this may have a `poolSize` property, and will look for a
  621. * prototypical `destructor` on instances.
  622. *
  623. * @param {Function} CopyConstructor Constructor that can be used to reset.
  624. * @param {Function} pooler Customizable pooler.
  625. */
  626. var addPoolingTo = function (CopyConstructor, pooler) {
  627. var NewKlass = CopyConstructor;
  628. NewKlass.instancePool = [];
  629. NewKlass.getPooled = pooler || DEFAULT_POOLER;
  630. if (!NewKlass.poolSize) {
  631. NewKlass.poolSize = DEFAULT_POOL_SIZE;
  632. }
  633. NewKlass.release = standardReleaser;
  634. return NewKlass;
  635. };
  636. var PooledClass = {
  637. addPoolingTo: addPoolingTo,
  638. oneArgumentPooler: oneArgumentPooler,
  639. twoArgumentPooler: twoArgumentPooler,
  640. threeArgumentPooler: threeArgumentPooler,
  641. fourArgumentPooler: fourArgumentPooler,
  642. fiveArgumentPooler: fiveArgumentPooler
  643. };
  644. module.exports = PooledClass;
  645. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  646. /***/ },
  647. /* 9 */
  648. /***/ function(module, exports) {
  649. /**
  650. * Copyright (c) 2013-present, Facebook, Inc.
  651. * All rights reserved.
  652. *
  653. * This source code is licensed under the BSD-style license found in the
  654. * LICENSE file in the root directory of this source tree. An additional grant
  655. * of patent rights can be found in the PATENTS file in the same directory.
  656. *
  657. * @providesModule reactProdInvariant
  658. *
  659. */
  660. 'use strict';
  661. /**
  662. * WARNING: DO NOT manually require this module.
  663. * This is a replacement for `invariant(...)` used by the error code system
  664. * and will _only_ be required by the corresponding babel pass.
  665. * It always throws.
  666. */
  667. function reactProdInvariant(code) {
  668. var argCount = arguments.length - 1;
  669. var message = 'Minified React error #' + code + '; visit ' + 'http://facebook.github.io/react/docs/error-decoder.html?invariant=' + code;
  670. for (var argIdx = 0; argIdx < argCount; argIdx++) {
  671. message += '&args[]=' + encodeURIComponent(arguments[argIdx + 1]);
  672. }
  673. message += ' for the full message or use the non-minified dev environment' + ' for full errors and additional helpful warnings.';
  674. var error = new Error(message);
  675. error.name = 'Invariant Violation';
  676. error.framesToPop = 1; // we don't care about reactProdInvariant's own frame
  677. throw error;
  678. }
  679. module.exports = reactProdInvariant;
  680. /***/ },
  681. /* 10 */
  682. /***/ function(module, exports, __webpack_require__) {
  683. /* WEBPACK VAR INJECTION */(function(process) {/**
  684. * Copyright (c) 2013-present, Facebook, Inc.
  685. * All rights reserved.
  686. *
  687. * This source code is licensed under the BSD-style license found in the
  688. * LICENSE file in the root directory of this source tree. An additional grant
  689. * of patent rights can be found in the PATENTS file in the same directory.
  690. *
  691. */
  692. 'use strict';
  693. /**
  694. * Use invariant() to assert state which your program assumes to be true.
  695. *
  696. * Provide sprintf-style format (only %s is supported) and arguments
  697. * to provide information about what broke and what you were
  698. * expecting.
  699. *
  700. * The invariant message will be stripped in production, but the invariant
  701. * will remain to ensure logic does not differ in production.
  702. */
  703. function invariant(condition, format, a, b, c, d, e, f) {
  704. if (process.env.NODE_ENV !== 'production') {
  705. if (format === undefined) {
  706. throw new Error('invariant requires an error message argument');
  707. }
  708. }
  709. if (!condition) {
  710. var error;
  711. if (format === undefined) {
  712. error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');
  713. } else {
  714. var args = [a, b, c, d, e, f];
  715. var argIndex = 0;
  716. error = new Error(format.replace(/%s/g, function () {
  717. return args[argIndex++];
  718. }));
  719. error.name = 'Invariant Violation';
  720. }
  721. error.framesToPop = 1; // we don't care about invariant's own frame
  722. throw error;
  723. }
  724. }
  725. module.exports = invariant;
  726. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  727. /***/ },
  728. /* 11 */
  729. /***/ function(module, exports, __webpack_require__) {
  730. /* WEBPACK VAR INJECTION */(function(process) {/**
  731. * Copyright 2014-present, Facebook, Inc.
  732. * All rights reserved.
  733. *
  734. * This source code is licensed under the BSD-style license found in the
  735. * LICENSE file in the root directory of this source tree. An additional grant
  736. * of patent rights can be found in the PATENTS file in the same directory.
  737. *
  738. * @providesModule ReactElement
  739. */
  740. 'use strict';
  741. var _assign = __webpack_require__(6);
  742. var ReactCurrentOwner = __webpack_require__(12);
  743. var warning = __webpack_require__(13);
  744. var canDefineProperty = __webpack_require__(15);
  745. var hasOwnProperty = Object.prototype.hasOwnProperty;
  746. // The Symbol used to tag the ReactElement type. If there is no native Symbol
  747. // nor polyfill, then a plain number is used for performance.
  748. var REACT_ELEMENT_TYPE = typeof Symbol === 'function' && Symbol['for'] && Symbol['for']('react.element') || 0xeac7;
  749. var RESERVED_PROPS = {
  750. key: true,
  751. ref: true,
  752. __self: true,
  753. __source: true
  754. };
  755. var specialPropKeyWarningShown, specialPropRefWarningShown;
  756. function hasValidRef(config) {
  757. if (process.env.NODE_ENV !== 'production') {
  758. if (hasOwnProperty.call(config, 'ref')) {
  759. var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;
  760. if (getter && getter.isReactWarning) {
  761. return false;
  762. }
  763. }
  764. }
  765. return config.ref !== undefined;
  766. }
  767. function hasValidKey(config) {
  768. if (process.env.NODE_ENV !== 'production') {
  769. if (hasOwnProperty.call(config, 'key')) {
  770. var getter = Object.getOwnPropertyDescriptor(config, 'key').get;
  771. if (getter && getter.isReactWarning) {
  772. return false;
  773. }
  774. }
  775. }
  776. return config.key !== undefined;
  777. }
  778. function defineKeyPropWarningGetter(props, displayName) {
  779. var warnAboutAccessingKey = function () {
  780. if (!specialPropKeyWarningShown) {
  781. specialPropKeyWarningShown = true;
  782. 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)', displayName) : void 0;
  783. }
  784. };
  785. warnAboutAccessingKey.isReactWarning = true;
  786. Object.defineProperty(props, 'key', {
  787. get: warnAboutAccessingKey,
  788. configurable: true
  789. });
  790. }
  791. function defineRefPropWarningGetter(props, displayName) {
  792. var warnAboutAccessingRef = function () {
  793. if (!specialPropRefWarningShown) {
  794. specialPropRefWarningShown = true;
  795. 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)', displayName) : void 0;
  796. }
  797. };
  798. warnAboutAccessingRef.isReactWarning = true;
  799. Object.defineProperty(props, 'ref', {
  800. get: warnAboutAccessingRef,
  801. configurable: true
  802. });
  803. }
  804. /**
  805. * Factory method to create a new React element. This no longer adheres to
  806. * the class pattern, so do not use new to call it. Also, no instanceof check
  807. * will work. Instead test $$typeof field against Symbol.for('react.element') to check
  808. * if something is a React Element.
  809. *
  810. * @param {*} type
  811. * @param {*} key
  812. * @param {string|object} ref
  813. * @param {*} self A *temporary* helper to detect places where `this` is
  814. * different from the `owner` when React.createElement is called, so that we
  815. * can warn. We want to get rid of owner and replace string `ref`s with arrow
  816. * functions, and as long as `this` and owner are the same, there will be no
  817. * change in behavior.
  818. * @param {*} source An annotation object (added by a transpiler or otherwise)
  819. * indicating filename, line number, and/or other information.
  820. * @param {*} owner
  821. * @param {*} props
  822. * @internal
  823. */
  824. var ReactElement = function (type, key, ref, self, source, owner, props) {
  825. var element = {
  826. // This tag allow us to uniquely identify this as a React Element
  827. $$typeof: REACT_ELEMENT_TYPE,
  828. // Built-in properties that belong on the element
  829. type: type,
  830. key: key,
  831. ref: ref,
  832. props: props,
  833. // Record the component responsible for creating this element.
  834. _owner: owner
  835. };
  836. if (process.env.NODE_ENV !== 'production') {
  837. // The validation flag is currently mutative. We put it on
  838. // an external backing store so that we can freeze the whole object.
  839. // This can be replaced with a WeakMap once they are implemented in
  840. // commonly used development environments.
  841. element._store = {};
  842. var shadowChildren = Array.isArray(props.children) ? props.children.slice(0) : props.children;
  843. // To make comparing ReactElements easier for testing purposes, we make
  844. // the validation flag non-enumerable (where possible, which should
  845. // include every environment we run tests in), so the test framework
  846. // ignores it.
  847. if (canDefineProperty) {
  848. Object.defineProperty(element._store, 'validated', {
  849. configurable: false,
  850. enumerable: false,
  851. writable: true,
  852. value: false
  853. });
  854. // self and source are DEV only properties.
  855. Object.defineProperty(element, '_self', {
  856. configurable: false,
  857. enumerable: false,
  858. writable: false,
  859. value: self
  860. });
  861. Object.defineProperty(element, '_shadowChildren', {
  862. configurable: false,
  863. enumerable: false,
  864. writable: false,
  865. value: shadowChildren
  866. });
  867. // Two elements created in two different places should be considered
  868. // equal for testing purposes and therefore we hide it from enumeration.
  869. Object.defineProperty(element, '_source', {
  870. configurable: false,
  871. enumerable: false,
  872. writable: false,
  873. value: source
  874. });
  875. } else {
  876. element._store.validated = false;
  877. element._self = self;
  878. element._shadowChildren = shadowChildren;
  879. element._source = source;
  880. }
  881. if (Object.freeze) {
  882. Object.freeze(element.props);
  883. Object.freeze(element);
  884. }
  885. }
  886. return element;
  887. };
  888. /**
  889. * Create and return a new ReactElement of the given type.
  890. * See https://facebook.github.io/react/docs/top-level-api.html#react.createelement
  891. */
  892. ReactElement.createElement = function (type, config, children) {
  893. var propName;
  894. // Reserved names are extracted
  895. var props = {};
  896. var key = null;
  897. var ref = null;
  898. var self = null;
  899. var source = null;
  900. if (config != null) {
  901. if (process.env.NODE_ENV !== 'production') {
  902. process.env.NODE_ENV !== 'production' ? warning(
  903. /* eslint-disable no-proto */
  904. config.__proto__ == null || config.__proto__ === Object.prototype,
  905. /* eslint-enable no-proto */
  906. 'React.createElement(...): Expected props argument to be a plain object. ' + 'Properties defined in its prototype chain will be ignored.') : void 0;
  907. }
  908. if (hasValidRef(config)) {
  909. ref = config.ref;
  910. }
  911. if (hasValidKey(config)) {
  912. key = '' + config.key;
  913. }
  914. self = config.__self === undefined ? null : config.__self;
  915. source = config.__source === undefined ? null : config.__source;
  916. // Remaining properties are added to a new props object
  917. for (propName in config) {
  918. if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
  919. props[propName] = config[propName];
  920. }
  921. }
  922. }
  923. // Children can be more than one argument, and those are transferred onto
  924. // the newly allocated props object.
  925. var childrenLength = arguments.length - 2;
  926. if (childrenLength === 1) {
  927. props.children = children;
  928. } else if (childrenLength > 1) {
  929. var childArray = Array(childrenLength);
  930. for (var i = 0; i < childrenLength; i++) {
  931. childArray[i] = arguments[i + 2];
  932. }
  933. props.children = childArray;
  934. }
  935. // Resolve default props
  936. if (type && type.defaultProps) {
  937. var defaultProps = type.defaultProps;
  938. for (propName in defaultProps) {
  939. if (props[propName] === undefined) {
  940. props[propName] = defaultProps[propName];
  941. }
  942. }
  943. }
  944. if (process.env.NODE_ENV !== 'production') {
  945. if (key || ref) {
  946. if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {
  947. var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
  948. if (key) {
  949. defineKeyPropWarningGetter(props, displayName);
  950. }
  951. if (ref) {
  952. defineRefPropWarningGetter(props, displayName);
  953. }
  954. }
  955. }
  956. }
  957. return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
  958. };
  959. /**
  960. * Return a function that produces ReactElements of a given type.
  961. * See https://facebook.github.io/react/docs/top-level-api.html#react.createfactory
  962. */
  963. ReactElement.createFactory = function (type) {
  964. var factory = ReactElement.createElement.bind(null, type);
  965. // Expose the type on the factory and the prototype so that it can be
  966. // easily accessed on elements. E.g. `<Foo />.type === Foo`.
  967. // This should not be named `constructor` since this may not be the function
  968. // that created the element, and it may not even be a constructor.
  969. // Legacy hook TODO: Warn if this is accessed
  970. factory.type = type;
  971. return factory;
  972. };
  973. ReactElement.cloneAndReplaceKey = function (oldElement, newKey) {
  974. var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);
  975. return newElement;
  976. };
  977. /**
  978. * Clone and return a new ReactElement using element as the starting point.
  979. * See https://facebook.github.io/react/docs/top-level-api.html#react.cloneelement
  980. */
  981. ReactElement.cloneElement = function (element, config, children) {
  982. var propName;
  983. // Original props are copied
  984. var props = _assign({}, element.props);
  985. // Reserved names are extracted
  986. var key = element.key;
  987. var ref = element.ref;
  988. // Self is preserved since the owner is preserved.
  989. var self = element._self;
  990. // Source is preserved since cloneElement is unlikely to be targeted by a
  991. // transpiler, and the original source is probably a better indicator of the
  992. // true owner.
  993. var source = element._source;
  994. // Owner will be preserved, unless ref is overridden
  995. var owner = element._owner;
  996. if (config != null) {
  997. if (process.env.NODE_ENV !== 'production') {
  998. process.env.NODE_ENV !== 'production' ? warning(
  999. /* eslint-disable no-proto */
  1000. config.__proto__ == null || config.__proto__ === Object.prototype,
  1001. /* eslint-enable no-proto */
  1002. 'React.cloneElement(...): Expected props argument to be a plain object. ' + 'Properties defined in its prototype chain will be ignored.') : void 0;
  1003. }
  1004. if (hasValidRef(config)) {
  1005. // Silently steal the ref from the parent.
  1006. ref = config.ref;
  1007. owner = ReactCurrentOwner.current;
  1008. }
  1009. if (hasValidKey(config)) {
  1010. key = '' + config.key;
  1011. }
  1012. // Remaining properties override existing props
  1013. var defaultProps;
  1014. if (element.type && element.type.defaultProps) {
  1015. defaultProps = element.type.defaultProps;
  1016. }
  1017. for (propName in config) {
  1018. if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
  1019. if (config[propName] === undefined && defaultProps !== undefined) {
  1020. // Resolve default props
  1021. props[propName] = defaultProps[propName];
  1022. } else {
  1023. props[propName] = config[propName];
  1024. }
  1025. }
  1026. }
  1027. }
  1028. // Children can be more than one argument, and those are transferred onto
  1029. // the newly allocated props object.
  1030. var childrenLength = arguments.length - 2;
  1031. if (childrenLength === 1) {
  1032. props.children = children;
  1033. } else if (childrenLength > 1) {
  1034. var childArray = Array(childrenLength);
  1035. for (var i = 0; i < childrenLength; i++) {
  1036. childArray[i] = arguments[i + 2];
  1037. }
  1038. props.children = childArray;
  1039. }
  1040. return ReactElement(element.type, key, ref, self, source, owner, props);
  1041. };
  1042. /**
  1043. * Verifies the object is a ReactElement.
  1044. * See https://facebook.github.io/react/docs/top-level-api.html#react.isvalidelement
  1045. * @param {?object} object
  1046. * @return {boolean} True if `object` is a valid component.
  1047. * @final
  1048. */
  1049. ReactElement.isValidElement = function (object) {
  1050. return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
  1051. };
  1052. ReactElement.REACT_ELEMENT_TYPE = REACT_ELEMENT_TYPE;
  1053. module.exports = ReactElement;
  1054. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  1055. /***/ },
  1056. /* 12 */
  1057. /***/ function(module, exports) {
  1058. /**
  1059. * Copyright 2013-present, Facebook, Inc.
  1060. * All rights reserved.
  1061. *
  1062. * This source code is licensed under the BSD-style license found in the
  1063. * LICENSE file in the root directory of this source tree. An additional grant
  1064. * of patent rights can be found in the PATENTS file in the same directory.
  1065. *
  1066. * @providesModule ReactCurrentOwner
  1067. */
  1068. 'use strict';
  1069. /**
  1070. * Keeps track of the current owner.
  1071. *
  1072. * The current owner is the component who should own any components that are
  1073. * currently being constructed.
  1074. */
  1075. var ReactCurrentOwner = {
  1076. /**
  1077. * @internal
  1078. * @type {ReactComponent}
  1079. */
  1080. current: null
  1081. };
  1082. module.exports = ReactCurrentOwner;
  1083. /***/ },
  1084. /* 13 */
  1085. /***/ function(module, exports, __webpack_require__) {
  1086. /* WEBPACK VAR INJECTION */(function(process) {/**
  1087. * Copyright 2014-2015, Facebook, Inc.
  1088. * All rights reserved.
  1089. *
  1090. * This source code is licensed under the BSD-style license found in the
  1091. * LICENSE file in the root directory of this source tree. An additional grant
  1092. * of patent rights can be found in the PATENTS file in the same directory.
  1093. *
  1094. */
  1095. 'use strict';
  1096. var emptyFunction = __webpack_require__(14);
  1097. /**
  1098. * Similar to invariant but only logs a warning if the condition is not met.
  1099. * This can be used to log issues in development environments in critical
  1100. * paths. Removing the logging code for production environments will keep the
  1101. * same logic and follow the same code paths.
  1102. */
  1103. var warning = emptyFunction;
  1104. if (process.env.NODE_ENV !== 'production') {
  1105. (function () {
  1106. var printWarning = function printWarning(format) {
  1107. for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
  1108. args[_key - 1] = arguments[_key];
  1109. }
  1110. var argIndex = 0;
  1111. var message = 'Warning: ' + format.replace(/%s/g, function () {
  1112. return args[argIndex++];
  1113. });
  1114. if (typeof console !== 'undefined') {
  1115. console.error(message);
  1116. }
  1117. try {
  1118. // --- Welcome to debugging React ---
  1119. // This error was thrown as a convenience so that you can use this stack
  1120. // to find the callsite that caused this warning to fire.
  1121. throw new Error(message);
  1122. } catch (x) {}
  1123. };
  1124. warning = function warning(condition, format) {
  1125. if (format === undefined) {
  1126. throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');
  1127. }
  1128. if (format.indexOf('Failed Composite propType: ') === 0) {
  1129. return; // Ignore CompositeComponent proptype check.
  1130. }
  1131. if (!condition) {
  1132. for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
  1133. args[_key2 - 2] = arguments[_key2];
  1134. }
  1135. printWarning.apply(undefined, [format].concat(args));
  1136. }
  1137. };
  1138. })();
  1139. }
  1140. module.exports = warning;
  1141. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  1142. /***/ },
  1143. /* 14 */
  1144. /***/ function(module, exports) {
  1145. "use strict";
  1146. /**
  1147. * Copyright (c) 2013-present, Facebook, Inc.
  1148. * All rights reserved.
  1149. *
  1150. * This source code is licensed under the BSD-style license found in the
  1151. * LICENSE file in the root directory of this source tree. An additional grant
  1152. * of patent rights can be found in the PATENTS file in the same directory.
  1153. *
  1154. *
  1155. */
  1156. function makeEmptyFunction(arg) {
  1157. return function () {
  1158. return arg;
  1159. };
  1160. }
  1161. /**
  1162. * This function accepts and discards inputs; it has no side effects. This is
  1163. * primarily useful idiomatically for overridable function endpoints which
  1164. * always need to be callable, since JS lacks a null-call idiom ala Cocoa.
  1165. */
  1166. var emptyFunction = function emptyFunction() {};
  1167. emptyFunction.thatReturns = makeEmptyFunction;
  1168. emptyFunction.thatReturnsFalse = makeEmptyFunction(false);
  1169. emptyFunction.thatReturnsTrue = makeEmptyFunction(true);
  1170. emptyFunction.thatReturnsNull = makeEmptyFunction(null);
  1171. emptyFunction.thatReturnsThis = function () {
  1172. return this;
  1173. };
  1174. emptyFunction.thatReturnsArgument = function (arg) {
  1175. return arg;
  1176. };
  1177. module.exports = emptyFunction;
  1178. /***/ },
  1179. /* 15 */
  1180. /***/ function(module, exports, __webpack_require__) {
  1181. /* WEBPACK VAR INJECTION */(function(process) {/**
  1182. * Copyright 2013-present, Facebook, Inc.
  1183. * All rights reserved.
  1184. *
  1185. * This source code is licensed under the BSD-style license found in the
  1186. * LICENSE file in the root directory of this source tree. An additional grant
  1187. * of patent rights can be found in the PATENTS file in the same directory.
  1188. *
  1189. * @providesModule canDefineProperty
  1190. */
  1191. 'use strict';
  1192. var canDefineProperty = false;
  1193. if (process.env.NODE_ENV !== 'production') {
  1194. try {
  1195. Object.defineProperty({}, 'x', { get: function () {} });
  1196. canDefineProperty = true;
  1197. } catch (x) {
  1198. // IE will fail on defineProperty
  1199. }
  1200. }
  1201. module.exports = canDefineProperty;
  1202. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  1203. /***/ },
  1204. /* 16 */
  1205. /***/ function(module, exports, __webpack_require__) {
  1206. /* WEBPACK VAR INJECTION */(function(process) {/**
  1207. * Copyright 2013-present, Facebook, Inc.
  1208. * All rights reserved.
  1209. *
  1210. * This source code is licensed under the BSD-style license found in the
  1211. * LICENSE file in the root directory of this source tree. An additional grant
  1212. * of patent rights can be found in the PATENTS file in the same directory.
  1213. *
  1214. * @providesModule traverseAllChildren
  1215. */
  1216. 'use strict';
  1217. var _prodInvariant = __webpack_require__(9);
  1218. var ReactCurrentOwner = __webpack_require__(12);
  1219. var ReactElement = __webpack_require__(11);
  1220. var getIteratorFn = __webpack_require__(17);
  1221. var invariant = __webpack_require__(10);
  1222. var KeyEscapeUtils = __webpack_require__(18);
  1223. var warning = __webpack_require__(13);
  1224. var SEPARATOR = '.';
  1225. var SUBSEPARATOR = ':';
  1226. /**
  1227. * TODO: Test that a single child and an array with one item have the same key
  1228. * pattern.
  1229. */
  1230. var didWarnAboutMaps = false;
  1231. /**
  1232. * Generate a key string that identifies a component within a set.
  1233. *
  1234. * @param {*} component A component that could contain a manual key.
  1235. * @param {number} index Index that is used if a manual key is not provided.
  1236. * @return {string}
  1237. */
  1238. function getComponentKey(component, index) {
  1239. // Do some typechecking here since we call this blindly. We want to ensure
  1240. // that we don't block potential future ES APIs.
  1241. if (component && typeof component === 'object' && component.key != null) {
  1242. // Explicit key
  1243. return KeyEscapeUtils.escape(component.key);
  1244. }
  1245. // Implicit key determined by the index in the set
  1246. return index.toString(36);
  1247. }
  1248. /**
  1249. * @param {?*} children Children tree container.
  1250. * @param {!string} nameSoFar Name of the key path so far.
  1251. * @param {!function} callback Callback to invoke with each child found.
  1252. * @param {?*} traverseContext Used to pass information throughout the traversal
  1253. * process.
  1254. * @return {!number} The number of children in this subtree.
  1255. */
  1256. function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext) {
  1257. var type = typeof children;
  1258. if (type === 'undefined' || type === 'boolean') {
  1259. // All of the above are perceived as null.
  1260. children = null;
  1261. }
  1262. if (children === null || type === 'string' || type === 'number' || ReactElement.isValidElement(children)) {
  1263. callback(traverseContext, children,
  1264. // If it's the only child, treat the name as if it was wrapped in an array
  1265. // so that it's consistent if the number of children grows.
  1266. nameSoFar === '' ? SEPARATOR + getComponentKey(children, 0) : nameSoFar);
  1267. return 1;
  1268. }
  1269. var child;
  1270. var nextName;
  1271. var subtreeCount = 0; // Count of children found in the current subtree.
  1272. var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;
  1273. if (Array.isArray(children)) {
  1274. for (var i = 0; i < children.length; i++) {
  1275. child = children[i];
  1276. nextName = nextNamePrefix + getComponentKey(child, i);
  1277. subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
  1278. }
  1279. } else {
  1280. var iteratorFn = getIteratorFn(children);
  1281. if (iteratorFn) {
  1282. var iterator = iteratorFn.call(children);
  1283. var step;
  1284. if (iteratorFn !== children.entries) {
  1285. var ii = 0;
  1286. while (!(step = iterator.next()).done) {
  1287. child = step.value;
  1288. nextName = nextNamePrefix + getComponentKey(child, ii++);
  1289. subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
  1290. }
  1291. } else {
  1292. if (process.env.NODE_ENV !== 'production') {
  1293. var mapsAsChildrenAddendum = '';
  1294. if (ReactCurrentOwner.current) {
  1295. var mapsAsChildrenOwnerName = ReactCurrentOwner.current.getName();
  1296. if (mapsAsChildrenOwnerName) {
  1297. mapsAsChildrenAddendum = ' Check the render method of `' + mapsAsChildrenOwnerName + '`.';
  1298. }
  1299. }
  1300. 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.%s', mapsAsChildrenAddendum) : void 0;
  1301. didWarnAboutMaps = true;
  1302. }
  1303. // Iterator will provide entry [k,v] tuples rather than values.
  1304. while (!(step = iterator.next()).done) {
  1305. var entry = step.value;
  1306. if (entry) {
  1307. child = entry[1];
  1308. nextName = nextNamePrefix + KeyEscapeUtils.escape(entry[0]) + SUBSEPARATOR + getComponentKey(child, 0);
  1309. subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
  1310. }
  1311. }
  1312. }
  1313. } else if (type === 'object') {
  1314. var addendum = '';
  1315. if (process.env.NODE_ENV !== 'production') {
  1316. 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.';
  1317. if (children._isReactElement) {
  1318. 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.';
  1319. }
  1320. if (ReactCurrentOwner.current) {
  1321. var name = ReactCurrentOwner.current.getName();
  1322. if (name) {
  1323. addendum += ' Check the render method of `' + name + '`.';
  1324. }
  1325. }
  1326. }
  1327. var childrenString = String(children);
  1328. true ? process.env.NODE_ENV !== 'production' ? 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) : _prodInvariant('31', childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString, addendum) : void 0;
  1329. }
  1330. }
  1331. return subtreeCount;
  1332. }
  1333. /**
  1334. * Traverses children that are typically specified as `props.children`, but
  1335. * might also be specified through attributes:
  1336. *
  1337. * - `traverseAllChildren(this.props.children, ...)`
  1338. * - `traverseAllChildren(this.props.leftPanelChildren, ...)`
  1339. *
  1340. * The `traverseContext` is an optional argument that is passed through the
  1341. * entire traversal. It can be used to store accumulations or anything else that
  1342. * the callback might find relevant.
  1343. *
  1344. * @param {?*} children Children tree object.
  1345. * @param {!function} callback To invoke upon traversing each child.
  1346. * @param {?*} traverseContext Context for traversal.
  1347. * @return {!number} The number of children in this subtree.
  1348. */
  1349. function traverseAllChildren(children, callback, traverseContext) {
  1350. if (children == null) {
  1351. return 0;
  1352. }
  1353. return traverseAllChildrenImpl(children, '', callback, traverseContext);
  1354. }
  1355. module.exports = traverseAllChildren;
  1356. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  1357. /***/ },
  1358. /* 17 */
  1359. /***/ function(module, exports) {
  1360. /**
  1361. * Copyright 2013-present, Facebook, Inc.
  1362. * All rights reserved.
  1363. *
  1364. * This source code is licensed under the BSD-style license found in the
  1365. * LICENSE file in the root directory of this source tree. An additional grant
  1366. * of patent rights can be found in the PATENTS file in the same directory.
  1367. *
  1368. * @providesModule getIteratorFn
  1369. *
  1370. */
  1371. 'use strict';
  1372. /* global Symbol */
  1373. var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
  1374. var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
  1375. /**
  1376. * Returns the iterator method function contained on the iterable object.
  1377. *
  1378. * Be sure to invoke the function with the iterable as context:
  1379. *
  1380. * var iteratorFn = getIteratorFn(myIterable);
  1381. * if (iteratorFn) {
  1382. * var iterator = iteratorFn.call(myIterable);
  1383. * ...
  1384. * }
  1385. *
  1386. * @param {?object} maybeIterable
  1387. * @return {?function}
  1388. */
  1389. function getIteratorFn(maybeIterable) {
  1390. var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
  1391. if (typeof iteratorFn === 'function') {
  1392. return iteratorFn;
  1393. }
  1394. }
  1395. module.exports = getIteratorFn;
  1396. /***/ },
  1397. /* 18 */
  1398. /***/ function(module, exports) {
  1399. /**
  1400. * Copyright 2013-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 KeyEscapeUtils
  1408. *
  1409. */
  1410. 'use strict';
  1411. /**
  1412. * Escape and wrap key so it is safe to use as a reactid
  1413. *
  1414. * @param {string} key to be escaped.
  1415. * @return {string} the escaped key.
  1416. */
  1417. function escape(key) {
  1418. var escapeRegex = /[=:]/g;
  1419. var escaperLookup = {
  1420. '=': '=0',
  1421. ':': '=2'
  1422. };
  1423. var escapedString = ('' + key).replace(escapeRegex, function (match) {
  1424. return escaperLookup[match];
  1425. });
  1426. return '$' + escapedString;
  1427. }
  1428. /**
  1429. * Unescape and unwrap key for human-readable display
  1430. *
  1431. * @param {string} key to unescape.
  1432. * @return {string} the unescaped key.
  1433. */
  1434. function unescape(key) {
  1435. var unescapeRegex = /(=0|=2)/g;
  1436. var unescaperLookup = {
  1437. '=0': '=',
  1438. '=2': ':'
  1439. };
  1440. var keySubstring = key[0] === '.' && key[1] === '$' ? key.substring(2) : key.substring(1);
  1441. return ('' + keySubstring).replace(unescapeRegex, function (match) {
  1442. return unescaperLookup[match];
  1443. });
  1444. }
  1445. var KeyEscapeUtils = {
  1446. escape: escape,
  1447. unescape: unescape
  1448. };
  1449. module.exports = KeyEscapeUtils;
  1450. /***/ },
  1451. /* 19 */
  1452. /***/ function(module, exports, __webpack_require__) {
  1453. /* WEBPACK VAR INJECTION */(function(process) {/**
  1454. * Copyright 2013-present, Facebook, Inc.
  1455. * All rights reserved.
  1456. *
  1457. * This source code is licensed under the BSD-style license found in the
  1458. * LICENSE file in the root directory of this source tree. An additional grant
  1459. * of patent rights can be found in the PATENTS file in the same directory.
  1460. *
  1461. * @providesModule ReactComponent
  1462. */
  1463. 'use strict';
  1464. var _prodInvariant = __webpack_require__(9);
  1465. var ReactNoopUpdateQueue = __webpack_require__(20);
  1466. var canDefineProperty = __webpack_require__(15);
  1467. var emptyObject = __webpack_require__(21);
  1468. var invariant = __webpack_require__(10);
  1469. var warning = __webpack_require__(13);
  1470. /**
  1471. * Base class helpers for the updating state of a component.
  1472. */
  1473. function ReactComponent(props, context, updater) {
  1474. this.props = props;
  1475. this.context = context;
  1476. this.refs = emptyObject;
  1477. // We initialize the default updater but the real one gets injected by the
  1478. // renderer.
  1479. this.updater = updater || ReactNoopUpdateQueue;
  1480. }
  1481. ReactComponent.prototype.isReactComponent = {};
  1482. /**
  1483. * Sets a subset of the state. Always use this to mutate
  1484. * state. You should treat `this.state` as immutable.
  1485. *
  1486. * There is no guarantee that `this.state` will be immediately updated, so
  1487. * accessing `this.state` after calling this method may return the old value.
  1488. *
  1489. * There is no guarantee that calls to `setState` will run synchronously,
  1490. * as they may eventually be batched together. You can provide an optional
  1491. * callback that will be executed when the call to setState is actually
  1492. * completed.
  1493. *
  1494. * When a function is provided to setState, it will be called at some point in
  1495. * the future (not synchronously). It will be called with the up to date
  1496. * component arguments (state, props, context). These values can be different
  1497. * from this.* because your function may be called after receiveProps but before
  1498. * shouldComponentUpdate, and this new state, props, and context will not yet be
  1499. * assigned to this.
  1500. *
  1501. * @param {object|function} partialState Next partial state or function to
  1502. * produce next partial state to be merged with current state.
  1503. * @param {?function} callback Called after state is updated.
  1504. * @final
  1505. * @protected
  1506. */
  1507. ReactComponent.prototype.setState = function (partialState, callback) {
  1508. !(typeof partialState === 'object' || typeof partialState === 'function' || partialState == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'setState(...): takes an object of state variables to update or a function which returns an object of state variables.') : _prodInvariant('85') : void 0;
  1509. this.updater.enqueueSetState(this, partialState);
  1510. if (callback) {
  1511. this.updater.enqueueCallback(this, callback, 'setState');
  1512. }
  1513. };
  1514. /**
  1515. * Forces an update. This should only be invoked when it is known with
  1516. * certainty that we are **not** in a DOM transaction.
  1517. *
  1518. * You may want to call this when you know that some deeper aspect of the
  1519. * component's state has changed but `setState` was not called.
  1520. *
  1521. * This will not invoke `shouldComponentUpdate`, but it will invoke
  1522. * `componentWillUpdate` and `componentDidUpdate`.
  1523. *
  1524. * @param {?function} callback Called after update is complete.
  1525. * @final
  1526. * @protected
  1527. */
  1528. ReactComponent.prototype.forceUpdate = function (callback) {
  1529. this.updater.enqueueForceUpdate(this);
  1530. if (callback) {
  1531. this.updater.enqueueCallback(this, callback, 'forceUpdate');
  1532. }
  1533. };
  1534. /**
  1535. * Deprecated APIs. These APIs used to exist on classic React classes but since
  1536. * we would like to deprecate them, we're not going to move them over to this
  1537. * modern base class. Instead, we define a getter that warns if it's accessed.
  1538. */
  1539. if (process.env.NODE_ENV !== 'production') {
  1540. var deprecatedAPIs = {
  1541. isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'],
  1542. replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).']
  1543. };
  1544. var defineDeprecationWarning = function (methodName, info) {
  1545. if (canDefineProperty) {
  1546. Object.defineProperty(ReactComponent.prototype, methodName, {
  1547. get: function () {
  1548. process.env.NODE_ENV !== 'production' ? warning(false, '%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]) : void 0;
  1549. return undefined;
  1550. }
  1551. });
  1552. }
  1553. };
  1554. for (var fnName in deprecatedAPIs) {
  1555. if (deprecatedAPIs.hasOwnProperty(fnName)) {
  1556. defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
  1557. }
  1558. }
  1559. }
  1560. module.exports = ReactComponent;
  1561. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  1562. /***/ },
  1563. /* 20 */
  1564. /***/ function(module, exports, __webpack_require__) {
  1565. /* WEBPACK VAR INJECTION */(function(process) {/**
  1566. * Copyright 2015-present, Facebook, Inc.
  1567. * All rights reserved.
  1568. *
  1569. * This source code is licensed under the BSD-style license found in the
  1570. * LICENSE file in the root directory of this source tree. An additional grant
  1571. * of patent rights can be found in the PATENTS file in the same directory.
  1572. *
  1573. * @providesModule ReactNoopUpdateQueue
  1574. */
  1575. 'use strict';
  1576. var warning = __webpack_require__(13);
  1577. function warnNoop(publicInstance, callerName) {
  1578. if (process.env.NODE_ENV !== 'production') {
  1579. var constructor = publicInstance.constructor;
  1580. 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, constructor && (constructor.displayName || constructor.name) || 'ReactClass') : void 0;
  1581. }
  1582. }
  1583. /**
  1584. * This is the abstract API for an update queue.
  1585. */
  1586. var ReactNoopUpdateQueue = {
  1587. /**
  1588. * Checks whether or not this composite component is mounted.
  1589. * @param {ReactClass} publicInstance The instance we want to test.
  1590. * @return {boolean} True if mounted, false otherwise.
  1591. * @protected
  1592. * @final
  1593. */
  1594. isMounted: function (publicInstance) {
  1595. return false;
  1596. },
  1597. /**
  1598. * Enqueue a callback that will be executed after all the pending updates
  1599. * have processed.
  1600. *
  1601. * @param {ReactClass} publicInstance The instance to use as `this` context.
  1602. * @param {?function} callback Called after state is updated.
  1603. * @internal
  1604. */
  1605. enqueueCallback: function (publicInstance, callback) {},
  1606. /**
  1607. * Forces an update. This should only be invoked when it is known with
  1608. * certainty that we are **not** in a DOM transaction.
  1609. *
  1610. * You may want to call this when you know that some deeper aspect of the
  1611. * component's state has changed but `setState` was not called.
  1612. *
  1613. * This will not invoke `shouldComponentUpdate`, but it will invoke
  1614. * `componentWillUpdate` and `componentDidUpdate`.
  1615. *
  1616. * @param {ReactClass} publicInstance The instance that should rerender.
  1617. * @internal
  1618. */
  1619. enqueueForceUpdate: function (publicInstance) {
  1620. warnNoop(publicInstance, 'forceUpdate');
  1621. },
  1622. /**
  1623. * Replaces all of the state. Always use this or `setState` to mutate state.
  1624. * You should treat `this.state` as immutable.
  1625. *
  1626. * There is no guarantee that `this.state` will be immediately updated, so
  1627. * accessing `this.state` after calling this method may return the old value.
  1628. *
  1629. * @param {ReactClass} publicInstance The instance that should rerender.
  1630. * @param {object} completeState Next state.
  1631. * @internal
  1632. */
  1633. enqueueReplaceState: function (publicInstance, completeState) {
  1634. warnNoop(publicInstance, 'replaceState');
  1635. },
  1636. /**
  1637. * Sets a subset of the state. This only exists because _pendingState is
  1638. * internal. This provides a merging strategy that is not available to deep
  1639. * properties which is confusing. TODO: Expose pendingState or don't use it
  1640. * during the merge.
  1641. *
  1642. * @param {ReactClass} publicInstance The instance that should rerender.
  1643. * @param {object} partialState Next partial state to be merged with state.
  1644. * @internal
  1645. */
  1646. enqueueSetState: function (publicInstance, partialState) {
  1647. warnNoop(publicInstance, 'setState');
  1648. }
  1649. };
  1650. module.exports = ReactNoopUpdateQueue;
  1651. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  1652. /***/ },
  1653. /* 21 */
  1654. /***/ function(module, exports, __webpack_require__) {
  1655. /* WEBPACK VAR INJECTION */(function(process) {/**
  1656. * Copyright (c) 2013-present, Facebook, Inc.
  1657. * All rights reserved.
  1658. *
  1659. * This source code is licensed under the BSD-style license found in the
  1660. * LICENSE file in the root directory of this source tree. An additional grant
  1661. * of patent rights can be found in the PATENTS file in the same directory.
  1662. *
  1663. */
  1664. 'use strict';
  1665. var emptyObject = {};
  1666. if (process.env.NODE_ENV !== 'production') {
  1667. Object.freeze(emptyObject);
  1668. }
  1669. module.exports = emptyObject;
  1670. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  1671. /***/ },
  1672. /* 22 */
  1673. /***/ function(module, exports, __webpack_require__) {
  1674. /**
  1675. * Copyright 2013-present, Facebook, Inc.
  1676. * All rights reserved.
  1677. *
  1678. * This source code is licensed under the BSD-style license found in the
  1679. * LICENSE file in the root directory of this source tree. An additional grant
  1680. * of patent rights can be found in the PATENTS file in the same directory.
  1681. *
  1682. * @providesModule ReactPureComponent
  1683. */
  1684. 'use strict';
  1685. var _assign = __webpack_require__(6);
  1686. var ReactComponent = __webpack_require__(19);
  1687. var ReactNoopUpdateQueue = __webpack_require__(20);
  1688. var emptyObject = __webpack_require__(21);
  1689. /**
  1690. * Base class helpers for the updating state of a component.
  1691. */
  1692. function ReactPureComponent(props, context, updater) {
  1693. // Duplicated from ReactComponent.
  1694. this.props = props;
  1695. this.context = context;
  1696. this.refs = emptyObject;
  1697. // We initialize the default updater but the real one gets injected by the
  1698. // renderer.
  1699. this.updater = updater || ReactNoopUpdateQueue;
  1700. }
  1701. function ComponentDummy() {}
  1702. ComponentDummy.prototype = ReactComponent.prototype;
  1703. ReactPureComponent.prototype = new ComponentDummy();
  1704. ReactPureComponent.prototype.constructor = ReactPureComponent;
  1705. // Avoid an extra prototype jump for these methods.
  1706. _assign(ReactPureComponent.prototype, ReactComponent.prototype);
  1707. ReactPureComponent.prototype.isPureReactComponent = true;
  1708. module.exports = ReactPureComponent;
  1709. /***/ },
  1710. /* 23 */
  1711. /***/ function(module, exports, __webpack_require__) {
  1712. /* WEBPACK VAR INJECTION */(function(process) {/**
  1713. * Copyright 2013-present, Facebook, Inc.
  1714. * All rights reserved.
  1715. *
  1716. * This source code is licensed under the BSD-style license found in the
  1717. * LICENSE file in the root directory of this source tree. An additional grant
  1718. * of patent rights can be found in the PATENTS file in the same directory.
  1719. *
  1720. * @providesModule ReactClass
  1721. */
  1722. 'use strict';
  1723. var _prodInvariant = __webpack_require__(9),
  1724. _assign = __webpack_require__(6);
  1725. var ReactComponent = __webpack_require__(19);
  1726. var ReactElement = __webpack_require__(11);
  1727. var ReactPropTypeLocations = __webpack_require__(24);
  1728. var ReactPropTypeLocationNames = __webpack_require__(26);
  1729. var ReactNoopUpdateQueue = __webpack_require__(20);
  1730. var emptyObject = __webpack_require__(21);
  1731. var invariant = __webpack_require__(10);
  1732. var keyMirror = __webpack_require__(25);
  1733. var keyOf = __webpack_require__(27);
  1734. var warning = __webpack_require__(13);
  1735. var MIXINS_KEY = keyOf({ mixins: null });
  1736. /**
  1737. * Policies that describe methods in `ReactClassInterface`.
  1738. */
  1739. var SpecPolicy = keyMirror({
  1740. /**
  1741. * These methods may be defined only once by the class specification or mixin.
  1742. */
  1743. DEFINE_ONCE: null,
  1744. /**
  1745. * These methods may be defined by both the class specification and mixins.
  1746. * Subsequent definitions will be chained. These methods must return void.
  1747. */
  1748. DEFINE_MANY: null,
  1749. /**
  1750. * These methods are overriding the base class.
  1751. */
  1752. OVERRIDE_BASE: null,
  1753. /**
  1754. * These methods are similar to DEFINE_MANY, except we assume they return
  1755. * objects. We try to merge the keys of the return values of all the mixed in
  1756. * functions. If there is a key conflict we throw.
  1757. */
  1758. DEFINE_MANY_MERGED: null
  1759. });
  1760. var injectedMixins = [];
  1761. /**
  1762. * Composite components are higher-level components that compose other composite
  1763. * or host components.
  1764. *
  1765. * To create a new type of `ReactClass`, pass a specification of
  1766. * your new class to `React.createClass`. The only requirement of your class
  1767. * specification is that you implement a `render` method.
  1768. *
  1769. * var MyComponent = React.createClass({
  1770. * render: function() {
  1771. * return <div>Hello World</div>;
  1772. * }
  1773. * });
  1774. *
  1775. * The class specification supports a specific protocol of methods that have
  1776. * special meaning (e.g. `render`). See `ReactClassInterface` for
  1777. * more the comprehensive protocol. Any other properties and methods in the
  1778. * class specification will be available on the prototype.
  1779. *
  1780. * @interface ReactClassInterface
  1781. * @internal
  1782. */
  1783. var ReactClassInterface = {
  1784. /**
  1785. * An array of Mixin objects to include when defining your component.
  1786. *
  1787. * @type {array}
  1788. * @optional
  1789. */
  1790. mixins: SpecPolicy.DEFINE_MANY,
  1791. /**
  1792. * An object containing properties and methods that should be defined on
  1793. * the component's constructor instead of its prototype (static methods).
  1794. *
  1795. * @type {object}
  1796. * @optional
  1797. */
  1798. statics: SpecPolicy.DEFINE_MANY,
  1799. /**
  1800. * Definition of prop types for this component.
  1801. *
  1802. * @type {object}
  1803. * @optional
  1804. */
  1805. propTypes: SpecPolicy.DEFINE_MANY,
  1806. /**
  1807. * Definition of context types for this component.
  1808. *
  1809. * @type {object}
  1810. * @optional
  1811. */
  1812. contextTypes: SpecPolicy.DEFINE_MANY,
  1813. /**
  1814. * Definition of context types this component sets for its children.
  1815. *
  1816. * @type {object}
  1817. * @optional
  1818. */
  1819. childContextTypes: SpecPolicy.DEFINE_MANY,
  1820. // ==== Definition methods ====
  1821. /**
  1822. * Invoked when the component is mounted. Values in the mapping will be set on
  1823. * `this.props` if that prop is not specified (i.e. using an `in` check).
  1824. *
  1825. * This method is invoked before `getInitialState` and therefore cannot rely
  1826. * on `this.state` or use `this.setState`.
  1827. *
  1828. * @return {object}
  1829. * @optional
  1830. */
  1831. getDefaultProps: SpecPolicy.DEFINE_MANY_MERGED,
  1832. /**
  1833. * Invoked once before the component is mounted. The return value will be used
  1834. * as the initial value of `this.state`.
  1835. *
  1836. * getInitialState: function() {
  1837. * return {
  1838. * isOn: false,
  1839. * fooBaz: new BazFoo()
  1840. * }
  1841. * }
  1842. *
  1843. * @return {object}
  1844. * @optional
  1845. */
  1846. getInitialState: SpecPolicy.DEFINE_MANY_MERGED,
  1847. /**
  1848. * @return {object}
  1849. * @optional
  1850. */
  1851. getChildContext: SpecPolicy.DEFINE_MANY_MERGED,
  1852. /**
  1853. * Uses props from `this.props` and state from `this.state` to render the
  1854. * structure of the component.
  1855. *
  1856. * No guarantees are made about when or how often this method is invoked, so
  1857. * it must not have side effects.
  1858. *
  1859. * render: function() {
  1860. * var name = this.props.name;
  1861. * return <div>Hello, {name}!</div>;
  1862. * }
  1863. *
  1864. * @return {ReactComponent}
  1865. * @nosideeffects
  1866. * @required
  1867. */
  1868. render: SpecPolicy.DEFINE_ONCE,
  1869. // ==== Delegate methods ====
  1870. /**
  1871. * Invoked when the component is initially created and about to be mounted.
  1872. * This may have side effects, but any external subscriptions or data created
  1873. * by this method must be cleaned up in `componentWillUnmount`.
  1874. *
  1875. * @optional
  1876. */
  1877. componentWillMount: SpecPolicy.DEFINE_MANY,
  1878. /**
  1879. * Invoked when the component has been mounted and has a DOM representation.
  1880. * However, there is no guarantee that the DOM node is in the document.
  1881. *
  1882. * Use this as an opportunity to operate on the DOM when the component has
  1883. * been mounted (initialized and rendered) for the first time.
  1884. *
  1885. * @param {DOMElement} rootNode DOM element representing the component.
  1886. * @optional
  1887. */
  1888. componentDidMount: SpecPolicy.DEFINE_MANY,
  1889. /**
  1890. * Invoked before the component receives new props.
  1891. *
  1892. * Use this as an opportunity to react to a prop transition by updating the
  1893. * state using `this.setState`. Current props are accessed via `this.props`.
  1894. *
  1895. * componentWillReceiveProps: function(nextProps, nextContext) {
  1896. * this.setState({
  1897. * likesIncreasing: nextProps.likeCount > this.props.likeCount
  1898. * });
  1899. * }
  1900. *
  1901. * NOTE: There is no equivalent `componentWillReceiveState`. An incoming prop
  1902. * transition may cause a state change, but the opposite is not true. If you
  1903. * need it, you are probably looking for `componentWillUpdate`.
  1904. *
  1905. * @param {object} nextProps
  1906. * @optional
  1907. */
  1908. componentWillReceiveProps: SpecPolicy.DEFINE_MANY,
  1909. /**
  1910. * Invoked while deciding if the component should be updated as a result of
  1911. * receiving new props, state and/or context.
  1912. *
  1913. * Use this as an opportunity to `return false` when you're certain that the
  1914. * transition to the new props/state/context will not require a component
  1915. * update.
  1916. *
  1917. * shouldComponentUpdate: function(nextProps, nextState, nextContext) {
  1918. * return !equal(nextProps, this.props) ||
  1919. * !equal(nextState, this.state) ||
  1920. * !equal(nextContext, this.context);
  1921. * }
  1922. *
  1923. * @param {object} nextProps
  1924. * @param {?object} nextState
  1925. * @param {?object} nextContext
  1926. * @return {boolean} True if the component should update.
  1927. * @optional
  1928. */
  1929. shouldComponentUpdate: SpecPolicy.DEFINE_ONCE,
  1930. /**
  1931. * Invoked when the component is about to update due to a transition from
  1932. * `this.props`, `this.state` and `this.context` to `nextProps`, `nextState`
  1933. * and `nextContext`.
  1934. *
  1935. * Use this as an opportunity to perform preparation before an update occurs.
  1936. *
  1937. * NOTE: You **cannot** use `this.setState()` in this method.
  1938. *
  1939. * @param {object} nextProps
  1940. * @param {?object} nextState
  1941. * @param {?object} nextContext
  1942. * @param {ReactReconcileTransaction} transaction
  1943. * @optional
  1944. */
  1945. componentWillUpdate: SpecPolicy.DEFINE_MANY,
  1946. /**
  1947. * Invoked when the component's DOM representation has been updated.
  1948. *
  1949. * Use this as an opportunity to operate on the DOM when the component has
  1950. * been updated.
  1951. *
  1952. * @param {object} prevProps
  1953. * @param {?object} prevState
  1954. * @param {?object} prevContext
  1955. * @param {DOMElement} rootNode DOM element representing the component.
  1956. * @optional
  1957. */
  1958. componentDidUpdate: SpecPolicy.DEFINE_MANY,
  1959. /**
  1960. * Invoked when the component is about to be removed from its parent and have
  1961. * its DOM representation destroyed.
  1962. *
  1963. * Use this as an opportunity to deallocate any external resources.
  1964. *
  1965. * NOTE: There is no `componentDidUnmount` since your component will have been
  1966. * destroyed by that point.
  1967. *
  1968. * @optional
  1969. */
  1970. componentWillUnmount: SpecPolicy.DEFINE_MANY,
  1971. // ==== Advanced methods ====
  1972. /**
  1973. * Updates the component's currently mounted DOM representation.
  1974. *
  1975. * By default, this implements React's rendering and reconciliation algorithm.
  1976. * Sophisticated clients may wish to override this.
  1977. *
  1978. * @param {ReactReconcileTransaction} transaction
  1979. * @internal
  1980. * @overridable
  1981. */
  1982. updateComponent: SpecPolicy.OVERRIDE_BASE
  1983. };
  1984. /**
  1985. * Mapping from class specification keys to special processing functions.
  1986. *
  1987. * Although these are declared like instance properties in the specification
  1988. * when defining classes using `React.createClass`, they are actually static
  1989. * and are accessible on the constructor instead of the prototype. Despite
  1990. * being static, they must be defined outside of the "statics" key under
  1991. * which all other static methods are defined.
  1992. */
  1993. var RESERVED_SPEC_KEYS = {
  1994. displayName: function (Constructor, displayName) {
  1995. Constructor.displayName = displayName;
  1996. },
  1997. mixins: function (Constructor, mixins) {
  1998. if (mixins) {
  1999. for (var i = 0; i < mixins.length; i++) {
  2000. mixSpecIntoComponent(Constructor, mixins[i]);
  2001. }
  2002. }
  2003. },
  2004. childContextTypes: function (Constructor, childContextTypes) {
  2005. if (process.env.NODE_ENV !== 'production') {
  2006. validateTypeDef(Constructor, childContextTypes, ReactPropTypeLocations.childContext);
  2007. }
  2008. Constructor.childContextTypes = _assign({}, Constructor.childContextTypes, childContextTypes);
  2009. },
  2010. contextTypes: function (Constructor, contextTypes) {
  2011. if (process.env.NODE_ENV !== 'production') {
  2012. validateTypeDef(Constructor, contextTypes, ReactPropTypeLocations.context);
  2013. }
  2014. Constructor.contextTypes = _assign({}, Constructor.contextTypes, contextTypes);
  2015. },
  2016. /**
  2017. * Special case getDefaultProps which should move into statics but requires
  2018. * automatic merging.
  2019. */
  2020. getDefaultProps: function (Constructor, getDefaultProps) {
  2021. if (Constructor.getDefaultProps) {
  2022. Constructor.getDefaultProps = createMergedResultFunction(Constructor.getDefaultProps, getDefaultProps);
  2023. } else {
  2024. Constructor.getDefaultProps = getDefaultProps;
  2025. }
  2026. },
  2027. propTypes: function (Constructor, propTypes) {
  2028. if (process.env.NODE_ENV !== 'production') {
  2029. validateTypeDef(Constructor, propTypes, ReactPropTypeLocations.prop);
  2030. }
  2031. Constructor.propTypes = _assign({}, Constructor.propTypes, propTypes);
  2032. },
  2033. statics: function (Constructor, statics) {
  2034. mixStaticSpecIntoComponent(Constructor, statics);
  2035. },
  2036. autobind: function () {} };
  2037. // noop
  2038. function validateTypeDef(Constructor, typeDef, location) {
  2039. for (var propName in typeDef) {
  2040. if (typeDef.hasOwnProperty(propName)) {
  2041. // use a warning instead of an invariant so components
  2042. // don't show up in prod but only in __DEV__
  2043. process.env.NODE_ENV !== 'production' ? 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;
  2044. }
  2045. }
  2046. }
  2047. function validateMethodOverride(isAlreadyDefined, name) {
  2048. var specPolicy = ReactClassInterface.hasOwnProperty(name) ? ReactClassInterface[name] : null;
  2049. // Disallow overriding of base class methods unless explicitly allowed.
  2050. if (ReactClassMixin.hasOwnProperty(name)) {
  2051. !(specPolicy === SpecPolicy.OVERRIDE_BASE) ? process.env.NODE_ENV !== 'production' ? 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) : _prodInvariant('73', name) : void 0;
  2052. }
  2053. // Disallow defining methods more than once unless explicitly allowed.
  2054. if (isAlreadyDefined) {
  2055. !(specPolicy === SpecPolicy.DEFINE_MANY || specPolicy === SpecPolicy.DEFINE_MANY_MERGED) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClassInterface: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.', name) : _prodInvariant('74', name) : void 0;
  2056. }
  2057. }
  2058. /**
  2059. * Mixin helper which handles policy validation and reserved
  2060. * specification keys when building React classes.
  2061. */
  2062. function mixSpecIntoComponent(Constructor, spec) {
  2063. if (!spec) {
  2064. if (process.env.NODE_ENV !== 'production') {
  2065. var typeofSpec = typeof spec;
  2066. var isMixinValid = typeofSpec === 'object' && spec !== null;
  2067. process.env.NODE_ENV !== 'production' ? warning(isMixinValid, '%s: You\'re attempting to include a mixin that is either null ' + 'or not an object. Check the mixins included by the component, ' + 'as well as any mixins they include themselves. ' + 'Expected object but got %s.', Constructor.displayName || 'ReactClass', spec === null ? null : typeofSpec) : void 0;
  2068. }
  2069. return;
  2070. }
  2071. !(typeof spec !== 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClass: You\'re attempting to use a component class or function as a mixin. Instead, just use a regular object.') : _prodInvariant('75') : void 0;
  2072. !!ReactElement.isValidElement(spec) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClass: You\'re attempting to use a component as a mixin. Instead, just use a regular object.') : _prodInvariant('76') : void 0;
  2073. var proto = Constructor.prototype;
  2074. var autoBindPairs = proto.__reactAutoBindPairs;
  2075. // By handling mixins before any other properties, we ensure the same
  2076. // chaining order is applied to methods with DEFINE_MANY policy, whether
  2077. // mixins are listed before or after these methods in the spec.
  2078. if (spec.hasOwnProperty(MIXINS_KEY)) {
  2079. RESERVED_SPEC_KEYS.mixins(Constructor, spec.mixins);
  2080. }
  2081. for (var name in spec) {
  2082. if (!spec.hasOwnProperty(name)) {
  2083. continue;
  2084. }
  2085. if (name === MIXINS_KEY) {
  2086. // We have already handled mixins in a special case above.
  2087. continue;
  2088. }
  2089. var property = spec[name];
  2090. var isAlreadyDefined = proto.hasOwnProperty(name);
  2091. validateMethodOverride(isAlreadyDefined, name);
  2092. if (RESERVED_SPEC_KEYS.hasOwnProperty(name)) {
  2093. RESERVED_SPEC_KEYS[name](Constructor, property);
  2094. } else {
  2095. // Setup methods on prototype:
  2096. // The following member methods should not be automatically bound:
  2097. // 1. Expected ReactClass methods (in the "interface").
  2098. // 2. Overridden methods (that were mixed in).
  2099. var isReactClassMethod = ReactClassInterface.hasOwnProperty(name);
  2100. var isFunction = typeof property === 'function';
  2101. var shouldAutoBind = isFunction && !isReactClassMethod && !isAlreadyDefined && spec.autobind !== false;
  2102. if (shouldAutoBind) {
  2103. autoBindPairs.push(name, property);
  2104. proto[name] = property;
  2105. } else {
  2106. if (isAlreadyDefined) {
  2107. var specPolicy = ReactClassInterface[name];
  2108. // These cases should already be caught by validateMethodOverride.
  2109. !(isReactClassMethod && (specPolicy === SpecPolicy.DEFINE_MANY_MERGED || specPolicy === SpecPolicy.DEFINE_MANY)) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClass: Unexpected spec policy %s for key %s when mixing in component specs.', specPolicy, name) : _prodInvariant('77', specPolicy, name) : void 0;
  2110. // For methods which are defined more than once, call the existing
  2111. // methods before calling the new property, merging if appropriate.
  2112. if (specPolicy === SpecPolicy.DEFINE_MANY_MERGED) {
  2113. proto[name] = createMergedResultFunction(proto[name], property);
  2114. } else if (specPolicy === SpecPolicy.DEFINE_MANY) {
  2115. proto[name] = createChainedFunction(proto[name], property);
  2116. }
  2117. } else {
  2118. proto[name] = property;
  2119. if (process.env.NODE_ENV !== 'production') {
  2120. // Add verbose displayName to the function, which helps when looking
  2121. // at profiling tools.
  2122. if (typeof property === 'function' && spec.displayName) {
  2123. proto[name].displayName = spec.displayName + '_' + name;
  2124. }
  2125. }
  2126. }
  2127. }
  2128. }
  2129. }
  2130. }
  2131. function mixStaticSpecIntoComponent(Constructor, statics) {
  2132. if (!statics) {
  2133. return;
  2134. }
  2135. for (var name in statics) {
  2136. var property = statics[name];
  2137. if (!statics.hasOwnProperty(name)) {
  2138. continue;
  2139. }
  2140. var isReserved = name in RESERVED_SPEC_KEYS;
  2141. !!isReserved ? process.env.NODE_ENV !== 'production' ? 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) : _prodInvariant('78', name) : void 0;
  2142. var isInherited = name in Constructor;
  2143. !!isInherited ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClass: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.', name) : _prodInvariant('79', name) : void 0;
  2144. Constructor[name] = property;
  2145. }
  2146. }
  2147. /**
  2148. * Merge two objects, but throw if both contain the same key.
  2149. *
  2150. * @param {object} one The first object, which is mutated.
  2151. * @param {object} two The second object
  2152. * @return {object} one after it has been mutated to contain everything in two.
  2153. */
  2154. function mergeIntoWithNoDuplicateKeys(one, two) {
  2155. !(one && two && typeof one === 'object' && typeof two === 'object') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.') : _prodInvariant('80') : void 0;
  2156. for (var key in two) {
  2157. if (two.hasOwnProperty(key)) {
  2158. !(one[key] === undefined) ? process.env.NODE_ENV !== 'production' ? 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) : _prodInvariant('81', key) : void 0;
  2159. one[key] = two[key];
  2160. }
  2161. }
  2162. return one;
  2163. }
  2164. /**
  2165. * Creates a function that invokes two functions and merges their return values.
  2166. *
  2167. * @param {function} one Function to invoke first.
  2168. * @param {function} two Function to invoke second.
  2169. * @return {function} Function that invokes the two argument functions.
  2170. * @private
  2171. */
  2172. function createMergedResultFunction(one, two) {
  2173. return function mergedResult() {
  2174. var a = one.apply(this, arguments);
  2175. var b = two.apply(this, arguments);
  2176. if (a == null) {
  2177. return b;
  2178. } else if (b == null) {
  2179. return a;
  2180. }
  2181. var c = {};
  2182. mergeIntoWithNoDuplicateKeys(c, a);
  2183. mergeIntoWithNoDuplicateKeys(c, b);
  2184. return c;
  2185. };
  2186. }
  2187. /**
  2188. * Creates a function that invokes two functions and ignores their return vales.
  2189. *
  2190. * @param {function} one Function to invoke first.
  2191. * @param {function} two Function to invoke second.
  2192. * @return {function} Function that invokes the two argument functions.
  2193. * @private
  2194. */
  2195. function createChainedFunction(one, two) {
  2196. return function chainedFunction() {
  2197. one.apply(this, arguments);
  2198. two.apply(this, arguments);
  2199. };
  2200. }
  2201. /**
  2202. * Binds a method to the component.
  2203. *
  2204. * @param {object} component Component whose method is going to be bound.
  2205. * @param {function} method Method to be bound.
  2206. * @return {function} The bound method.
  2207. */
  2208. function bindAutoBindMethod(component, method) {
  2209. var boundMethod = method.bind(component);
  2210. if (process.env.NODE_ENV !== 'production') {
  2211. boundMethod.__reactBoundContext = component;
  2212. boundMethod.__reactBoundMethod = method;
  2213. boundMethod.__reactBoundArguments = null;
  2214. var componentName = component.constructor.displayName;
  2215. var _bind = boundMethod.bind;
  2216. boundMethod.bind = function (newThis) {
  2217. for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
  2218. args[_key - 1] = arguments[_key];
  2219. }
  2220. // User is trying to bind() an autobound method; we effectively will
  2221. // ignore the value of "this" that the user is trying to use, so
  2222. // let's warn.
  2223. if (newThis !== component && newThis !== null) {
  2224. process.env.NODE_ENV !== 'production' ? warning(false, 'bind(): React component methods may only be bound to the ' + 'component instance. See %s', componentName) : void 0;
  2225. } else if (!args.length) {
  2226. 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;
  2227. return boundMethod;
  2228. }
  2229. var reboundMethod = _bind.apply(boundMethod, arguments);
  2230. reboundMethod.__reactBoundContext = component;
  2231. reboundMethod.__reactBoundMethod = method;
  2232. reboundMethod.__reactBoundArguments = args;
  2233. return reboundMethod;
  2234. };
  2235. }
  2236. return boundMethod;
  2237. }
  2238. /**
  2239. * Binds all auto-bound methods in a component.
  2240. *
  2241. * @param {object} component Component whose method is going to be bound.
  2242. */
  2243. function bindAutoBindMethods(component) {
  2244. var pairs = component.__reactAutoBindPairs;
  2245. for (var i = 0; i < pairs.length; i += 2) {
  2246. var autoBindKey = pairs[i];
  2247. var method = pairs[i + 1];
  2248. component[autoBindKey] = bindAutoBindMethod(component, method);
  2249. }
  2250. }
  2251. /**
  2252. * Add more to the ReactClass base class. These are all legacy features and
  2253. * therefore not already part of the modern ReactComponent.
  2254. */
  2255. var ReactClassMixin = {
  2256. /**
  2257. * TODO: This will be deprecated because state should always keep a consistent
  2258. * type signature and the only use case for this, is to avoid that.
  2259. */
  2260. replaceState: function (newState, callback) {
  2261. this.updater.enqueueReplaceState(this, newState);
  2262. if (callback) {
  2263. this.updater.enqueueCallback(this, callback, 'replaceState');
  2264. }
  2265. },
  2266. /**
  2267. * Checks whether or not this composite component is mounted.
  2268. * @return {boolean} True if mounted, false otherwise.
  2269. * @protected
  2270. * @final
  2271. */
  2272. isMounted: function () {
  2273. return this.updater.isMounted(this);
  2274. }
  2275. };
  2276. var ReactClassComponent = function () {};
  2277. _assign(ReactClassComponent.prototype, ReactComponent.prototype, ReactClassMixin);
  2278. /**
  2279. * Module for creating composite components.
  2280. *
  2281. * @class ReactClass
  2282. */
  2283. var ReactClass = {
  2284. /**
  2285. * Creates a composite component class given a class specification.
  2286. * See https://facebook.github.io/react/docs/top-level-api.html#react.createclass
  2287. *
  2288. * @param {object} spec Class specification (which must define `render`).
  2289. * @return {function} Component constructor function.
  2290. * @public
  2291. */
  2292. createClass: function (spec) {
  2293. var Constructor = function (props, context, updater) {
  2294. // This constructor gets overridden by mocks. The argument is used
  2295. // by mocks to assert on what gets mounted.
  2296. if (process.env.NODE_ENV !== 'production') {
  2297. 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;
  2298. }
  2299. // Wire up auto-binding
  2300. if (this.__reactAutoBindPairs.length) {
  2301. bindAutoBindMethods(this);
  2302. }
  2303. this.props = props;
  2304. this.context = context;
  2305. this.refs = emptyObject;
  2306. this.updater = updater || ReactNoopUpdateQueue;
  2307. this.state = null;
  2308. // ReactClasses doesn't have constructors. Instead, they use the
  2309. // getInitialState and componentWillMount methods for initialization.
  2310. var initialState = this.getInitialState ? this.getInitialState() : null;
  2311. if (process.env.NODE_ENV !== 'production') {
  2312. // We allow auto-mocks to proceed as if they're returning null.
  2313. if (initialState === undefined && this.getInitialState._isMockFunction) {
  2314. // This is probably bad practice. Consider warning here and
  2315. // deprecating this convenience.
  2316. initialState = null;
  2317. }
  2318. }
  2319. !(typeof initialState === 'object' && !Array.isArray(initialState)) ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s.getInitialState(): must return an object or null', Constructor.displayName || 'ReactCompositeComponent') : _prodInvariant('82', Constructor.displayName || 'ReactCompositeComponent') : void 0;
  2320. this.state = initialState;
  2321. };
  2322. Constructor.prototype = new ReactClassComponent();
  2323. Constructor.prototype.constructor = Constructor;
  2324. Constructor.prototype.__reactAutoBindPairs = [];
  2325. injectedMixins.forEach(mixSpecIntoComponent.bind(null, Constructor));
  2326. mixSpecIntoComponent(Constructor, spec);
  2327. // Initialize the defaultProps property after all mixins have been merged.
  2328. if (Constructor.getDefaultProps) {
  2329. Constructor.defaultProps = Constructor.getDefaultProps();
  2330. }
  2331. if (process.env.NODE_ENV !== 'production') {
  2332. // This is a tag to indicate that the use of these method names is ok,
  2333. // since it's used with createClass. If it's not, then it's likely a
  2334. // mistake so we'll warn you to use the static property, property
  2335. // initializer or constructor respectively.
  2336. if (Constructor.getDefaultProps) {
  2337. Constructor.getDefaultProps.isReactClassApproved = {};
  2338. }
  2339. if (Constructor.prototype.getInitialState) {
  2340. Constructor.prototype.getInitialState.isReactClassApproved = {};
  2341. }
  2342. }
  2343. !Constructor.prototype.render ? process.env.NODE_ENV !== 'production' ? invariant(false, 'createClass(...): Class specification must implement a `render` method.') : _prodInvariant('83') : void 0;
  2344. if (process.env.NODE_ENV !== 'production') {
  2345. 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;
  2346. 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;
  2347. }
  2348. // Reduce time spent doing lookups by setting these on the prototype.
  2349. for (var methodName in ReactClassInterface) {
  2350. if (!Constructor.prototype[methodName]) {
  2351. Constructor.prototype[methodName] = null;
  2352. }
  2353. }
  2354. return Constructor;
  2355. },
  2356. injection: {
  2357. injectMixin: function (mixin) {
  2358. injectedMixins.push(mixin);
  2359. }
  2360. }
  2361. };
  2362. module.exports = ReactClass;
  2363. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  2364. /***/ },
  2365. /* 24 */
  2366. /***/ function(module, exports, __webpack_require__) {
  2367. /**
  2368. * Copyright 2013-present, Facebook, Inc.
  2369. * All rights reserved.
  2370. *
  2371. * This source code is licensed under the BSD-style license found in the
  2372. * LICENSE file in the root directory of this source tree. An additional grant
  2373. * of patent rights can be found in the PATENTS file in the same directory.
  2374. *
  2375. * @providesModule ReactPropTypeLocations
  2376. */
  2377. 'use strict';
  2378. var keyMirror = __webpack_require__(25);
  2379. var ReactPropTypeLocations = keyMirror({
  2380. prop: null,
  2381. context: null,
  2382. childContext: null
  2383. });
  2384. module.exports = ReactPropTypeLocations;
  2385. /***/ },
  2386. /* 25 */
  2387. /***/ function(module, exports, __webpack_require__) {
  2388. /* WEBPACK VAR INJECTION */(function(process) {/**
  2389. * Copyright (c) 2013-present, Facebook, Inc.
  2390. * All rights reserved.
  2391. *
  2392. * This source code is licensed under the BSD-style license found in the
  2393. * LICENSE file in the root directory of this source tree. An additional grant
  2394. * of patent rights can be found in the PATENTS file in the same directory.
  2395. *
  2396. * @typechecks static-only
  2397. */
  2398. 'use strict';
  2399. var invariant = __webpack_require__(10);
  2400. /**
  2401. * Constructs an enumeration with keys equal to their value.
  2402. *
  2403. * For example:
  2404. *
  2405. * var COLORS = keyMirror({blue: null, red: null});
  2406. * var myColor = COLORS.blue;
  2407. * var isColorValid = !!COLORS[myColor];
  2408. *
  2409. * The last line could not be performed if the values of the generated enum were
  2410. * not equal to their keys.
  2411. *
  2412. * Input: {key1: val1, key2: val2}
  2413. * Output: {key1: key1, key2: key2}
  2414. *
  2415. * @param {object} obj
  2416. * @return {object}
  2417. */
  2418. var keyMirror = function keyMirror(obj) {
  2419. var ret = {};
  2420. var key;
  2421. !(obj instanceof Object && !Array.isArray(obj)) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'keyMirror(...): Argument must be an object.') : invariant(false) : void 0;
  2422. for (key in obj) {
  2423. if (!obj.hasOwnProperty(key)) {
  2424. continue;
  2425. }
  2426. ret[key] = key;
  2427. }
  2428. return ret;
  2429. };
  2430. module.exports = keyMirror;
  2431. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  2432. /***/ },
  2433. /* 26 */
  2434. /***/ function(module, exports, __webpack_require__) {
  2435. /* WEBPACK VAR INJECTION */(function(process) {/**
  2436. * Copyright 2013-present, Facebook, Inc.
  2437. * All rights reserved.
  2438. *
  2439. * This source code is licensed under the BSD-style license found in the
  2440. * LICENSE file in the root directory of this source tree. An additional grant
  2441. * of patent rights can be found in the PATENTS file in the same directory.
  2442. *
  2443. * @providesModule ReactPropTypeLocationNames
  2444. */
  2445. 'use strict';
  2446. var ReactPropTypeLocationNames = {};
  2447. if (process.env.NODE_ENV !== 'production') {
  2448. ReactPropTypeLocationNames = {
  2449. prop: 'prop',
  2450. context: 'context',
  2451. childContext: 'child context'
  2452. };
  2453. }
  2454. module.exports = ReactPropTypeLocationNames;
  2455. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  2456. /***/ },
  2457. /* 27 */
  2458. /***/ function(module, exports) {
  2459. "use strict";
  2460. /**
  2461. * Copyright (c) 2013-present, Facebook, Inc.
  2462. * All rights reserved.
  2463. *
  2464. * This source code is licensed under the BSD-style license found in the
  2465. * LICENSE file in the root directory of this source tree. An additional grant
  2466. * of patent rights can be found in the PATENTS file in the same directory.
  2467. *
  2468. */
  2469. /**
  2470. * Allows extraction of a minified key. Let's the build system minify keys
  2471. * without losing the ability to dynamically use key strings as values
  2472. * themselves. Pass in an object with a single key/val pair and it will return
  2473. * you the string key of that single record. Suppose you want to grab the
  2474. * value for a key 'className' inside of an object. Key/val minification may
  2475. * have aliased that key to be 'xa12'. keyOf({className: null}) will return
  2476. * 'xa12' in that case. Resolve keys you want to use once at startup time, then
  2477. * reuse those resolutions.
  2478. */
  2479. var keyOf = function keyOf(oneKeyObj) {
  2480. var key;
  2481. for (key in oneKeyObj) {
  2482. if (!oneKeyObj.hasOwnProperty(key)) {
  2483. continue;
  2484. }
  2485. return key;
  2486. }
  2487. return null;
  2488. };
  2489. module.exports = keyOf;
  2490. /***/ },
  2491. /* 28 */
  2492. /***/ function(module, exports, __webpack_require__) {
  2493. /* WEBPACK VAR INJECTION */(function(process) {/**
  2494. * Copyright 2013-present, Facebook, Inc.
  2495. * All rights reserved.
  2496. *
  2497. * This source code is licensed under the BSD-style license found in the
  2498. * LICENSE file in the root directory of this source tree. An additional grant
  2499. * of patent rights can be found in the PATENTS file in the same directory.
  2500. *
  2501. * @providesModule ReactDOMFactories
  2502. */
  2503. 'use strict';
  2504. var ReactElement = __webpack_require__(11);
  2505. /**
  2506. * Create a factory that creates HTML tag elements.
  2507. *
  2508. * @private
  2509. */
  2510. var createDOMFactory = ReactElement.createFactory;
  2511. if (process.env.NODE_ENV !== 'production') {
  2512. var ReactElementValidator = __webpack_require__(29);
  2513. createDOMFactory = ReactElementValidator.createFactory;
  2514. }
  2515. /**
  2516. * Creates a mapping from supported HTML tags to `ReactDOMComponent` classes.
  2517. * This is also accessible via `React.DOM`.
  2518. *
  2519. * @public
  2520. */
  2521. var ReactDOMFactories = {
  2522. a: createDOMFactory('a'),
  2523. abbr: createDOMFactory('abbr'),
  2524. address: createDOMFactory('address'),
  2525. area: createDOMFactory('area'),
  2526. article: createDOMFactory('article'),
  2527. aside: createDOMFactory('aside'),
  2528. audio: createDOMFactory('audio'),
  2529. b: createDOMFactory('b'),
  2530. base: createDOMFactory('base'),
  2531. bdi: createDOMFactory('bdi'),
  2532. bdo: createDOMFactory('bdo'),
  2533. big: createDOMFactory('big'),
  2534. blockquote: createDOMFactory('blockquote'),
  2535. body: createDOMFactory('body'),
  2536. br: createDOMFactory('br'),
  2537. button: createDOMFactory('button'),
  2538. canvas: createDOMFactory('canvas'),
  2539. caption: createDOMFactory('caption'),
  2540. cite: createDOMFactory('cite'),
  2541. code: createDOMFactory('code'),
  2542. col: createDOMFactory('col'),
  2543. colgroup: createDOMFactory('colgroup'),
  2544. data: createDOMFactory('data'),
  2545. datalist: createDOMFactory('datalist'),
  2546. dd: createDOMFactory('dd'),
  2547. del: createDOMFactory('del'),
  2548. details: createDOMFactory('details'),
  2549. dfn: createDOMFactory('dfn'),
  2550. dialog: createDOMFactory('dialog'),
  2551. div: createDOMFactory('div'),
  2552. dl: createDOMFactory('dl'),
  2553. dt: createDOMFactory('dt'),
  2554. em: createDOMFactory('em'),
  2555. embed: createDOMFactory('embed'),
  2556. fieldset: createDOMFactory('fieldset'),
  2557. figcaption: createDOMFactory('figcaption'),
  2558. figure: createDOMFactory('figure'),
  2559. footer: createDOMFactory('footer'),
  2560. form: createDOMFactory('form'),
  2561. h1: createDOMFactory('h1'),
  2562. h2: createDOMFactory('h2'),
  2563. h3: createDOMFactory('h3'),
  2564. h4: createDOMFactory('h4'),
  2565. h5: createDOMFactory('h5'),
  2566. h6: createDOMFactory('h6'),
  2567. head: createDOMFactory('head'),
  2568. header: createDOMFactory('header'),
  2569. hgroup: createDOMFactory('hgroup'),
  2570. hr: createDOMFactory('hr'),
  2571. html: createDOMFactory('html'),
  2572. i: createDOMFactory('i'),
  2573. iframe: createDOMFactory('iframe'),
  2574. img: createDOMFactory('img'),
  2575. input: createDOMFactory('input'),
  2576. ins: createDOMFactory('ins'),
  2577. kbd: createDOMFactory('kbd'),
  2578. keygen: createDOMFactory('keygen'),
  2579. label: createDOMFactory('label'),
  2580. legend: createDOMFactory('legend'),
  2581. li: createDOMFactory('li'),
  2582. link: createDOMFactory('link'),
  2583. main: createDOMFactory('main'),
  2584. map: createDOMFactory('map'),
  2585. mark: createDOMFactory('mark'),
  2586. menu: createDOMFactory('menu'),
  2587. menuitem: createDOMFactory('menuitem'),
  2588. meta: createDOMFactory('meta'),
  2589. meter: createDOMFactory('meter'),
  2590. nav: createDOMFactory('nav'),
  2591. noscript: createDOMFactory('noscript'),
  2592. object: createDOMFactory('object'),
  2593. ol: createDOMFactory('ol'),
  2594. optgroup: createDOMFactory('optgroup'),
  2595. option: createDOMFactory('option'),
  2596. output: createDOMFactory('output'),
  2597. p: createDOMFactory('p'),
  2598. param: createDOMFactory('param'),
  2599. picture: createDOMFactory('picture'),
  2600. pre: createDOMFactory('pre'),
  2601. progress: createDOMFactory('progress'),
  2602. q: createDOMFactory('q'),
  2603. rp: createDOMFactory('rp'),
  2604. rt: createDOMFactory('rt'),
  2605. ruby: createDOMFactory('ruby'),
  2606. s: createDOMFactory('s'),
  2607. samp: createDOMFactory('samp'),
  2608. script: createDOMFactory('script'),
  2609. section: createDOMFactory('section'),
  2610. select: createDOMFactory('select'),
  2611. small: createDOMFactory('small'),
  2612. source: createDOMFactory('source'),
  2613. span: createDOMFactory('span'),
  2614. strong: createDOMFactory('strong'),
  2615. style: createDOMFactory('style'),
  2616. sub: createDOMFactory('sub'),
  2617. summary: createDOMFactory('summary'),
  2618. sup: createDOMFactory('sup'),
  2619. table: createDOMFactory('table'),
  2620. tbody: createDOMFactory('tbody'),
  2621. td: createDOMFactory('td'),
  2622. textarea: createDOMFactory('textarea'),
  2623. tfoot: createDOMFactory('tfoot'),
  2624. th: createDOMFactory('th'),
  2625. thead: createDOMFactory('thead'),
  2626. time: createDOMFactory('time'),
  2627. title: createDOMFactory('title'),
  2628. tr: createDOMFactory('tr'),
  2629. track: createDOMFactory('track'),
  2630. u: createDOMFactory('u'),
  2631. ul: createDOMFactory('ul'),
  2632. 'var': createDOMFactory('var'),
  2633. video: createDOMFactory('video'),
  2634. wbr: createDOMFactory('wbr'),
  2635. // SVG
  2636. circle: createDOMFactory('circle'),
  2637. clipPath: createDOMFactory('clipPath'),
  2638. defs: createDOMFactory('defs'),
  2639. ellipse: createDOMFactory('ellipse'),
  2640. g: createDOMFactory('g'),
  2641. image: createDOMFactory('image'),
  2642. line: createDOMFactory('line'),
  2643. linearGradient: createDOMFactory('linearGradient'),
  2644. mask: createDOMFactory('mask'),
  2645. path: createDOMFactory('path'),
  2646. pattern: createDOMFactory('pattern'),
  2647. polygon: createDOMFactory('polygon'),
  2648. polyline: createDOMFactory('polyline'),
  2649. radialGradient: createDOMFactory('radialGradient'),
  2650. rect: createDOMFactory('rect'),
  2651. stop: createDOMFactory('stop'),
  2652. svg: createDOMFactory('svg'),
  2653. text: createDOMFactory('text'),
  2654. tspan: createDOMFactory('tspan')
  2655. };
  2656. module.exports = ReactDOMFactories;
  2657. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  2658. /***/ },
  2659. /* 29 */
  2660. /***/ function(module, exports, __webpack_require__) {
  2661. /* WEBPACK VAR INJECTION */(function(process) {/**
  2662. * Copyright 2014-present, Facebook, Inc.
  2663. * All rights reserved.
  2664. *
  2665. * This source code is licensed under the BSD-style license found in the
  2666. * LICENSE file in the root directory of this source tree. An additional grant
  2667. * of patent rights can be found in the PATENTS file in the same directory.
  2668. *
  2669. * @providesModule ReactElementValidator
  2670. */
  2671. /**
  2672. * ReactElementValidator provides a wrapper around a element factory
  2673. * which validates the props passed to the element. This is intended to be
  2674. * used only in DEV and could be replaced by a static type checker for languages
  2675. * that support it.
  2676. */
  2677. 'use strict';
  2678. var ReactCurrentOwner = __webpack_require__(12);
  2679. var ReactComponentTreeHook = __webpack_require__(30);
  2680. var ReactElement = __webpack_require__(11);
  2681. var ReactPropTypeLocations = __webpack_require__(24);
  2682. var checkReactTypeSpec = __webpack_require__(31);
  2683. var canDefineProperty = __webpack_require__(15);
  2684. var getIteratorFn = __webpack_require__(17);
  2685. var warning = __webpack_require__(13);
  2686. function getDeclarationErrorAddendum() {
  2687. if (ReactCurrentOwner.current) {
  2688. var name = ReactCurrentOwner.current.getName();
  2689. if (name) {
  2690. return ' Check the render method of `' + name + '`.';
  2691. }
  2692. }
  2693. return '';
  2694. }
  2695. /**
  2696. * Warn if there's no key explicitly set on dynamic arrays of children or
  2697. * object keys are not valid. This allows us to keep track of children between
  2698. * updates.
  2699. */
  2700. var ownerHasKeyUseWarning = {};
  2701. function getCurrentComponentErrorInfo(parentType) {
  2702. var info = getDeclarationErrorAddendum();
  2703. if (!info) {
  2704. var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;
  2705. if (parentName) {
  2706. info = ' Check the top-level render call using <' + parentName + '>.';
  2707. }
  2708. }
  2709. return info;
  2710. }
  2711. /**
  2712. * Warn if the element doesn't have an explicit key assigned to it.
  2713. * This element is in an array. The array could grow and shrink or be
  2714. * reordered. All children that haven't already been validated are required to
  2715. * have a "key" property assigned to it. Error statuses are cached so a warning
  2716. * will only be shown once.
  2717. *
  2718. * @internal
  2719. * @param {ReactElement} element Element that requires a key.
  2720. * @param {*} parentType element's parent's type.
  2721. */
  2722. function validateExplicitKey(element, parentType) {
  2723. if (!element._store || element._store.validated || element.key != null) {
  2724. return;
  2725. }
  2726. element._store.validated = true;
  2727. var memoizer = ownerHasKeyUseWarning.uniqueKey || (ownerHasKeyUseWarning.uniqueKey = {});
  2728. var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
  2729. if (memoizer[currentComponentErrorInfo]) {
  2730. return;
  2731. }
  2732. memoizer[currentComponentErrorInfo] = true;
  2733. // Usually the current owner is the offender, but if it accepts children as a
  2734. // property, it may be the creator of the child that's responsible for
  2735. // assigning it a key.
  2736. var childOwner = '';
  2737. if (element && element._owner && element._owner !== ReactCurrentOwner.current) {
  2738. // Give the component that originally created this child.
  2739. childOwner = ' It was passed a child from ' + element._owner.getName() + '.';
  2740. }
  2741. process.env.NODE_ENV !== 'production' ? warning(false, 'Each child in an array or iterator should have a unique "key" prop.' + '%s%s See https://fb.me/react-warning-keys for more information.%s', currentComponentErrorInfo, childOwner, ReactComponentTreeHook.getCurrentStackAddendum(element)) : void 0;
  2742. }
  2743. /**
  2744. * Ensure that every element either is passed in a static location, in an
  2745. * array with an explicit keys property defined, or in an object literal
  2746. * with valid key property.
  2747. *
  2748. * @internal
  2749. * @param {ReactNode} node Statically passed child of any type.
  2750. * @param {*} parentType node's parent's type.
  2751. */
  2752. function validateChildKeys(node, parentType) {
  2753. if (typeof node !== 'object') {
  2754. return;
  2755. }
  2756. if (Array.isArray(node)) {
  2757. for (var i = 0; i < node.length; i++) {
  2758. var child = node[i];
  2759. if (ReactElement.isValidElement(child)) {
  2760. validateExplicitKey(child, parentType);
  2761. }
  2762. }
  2763. } else if (ReactElement.isValidElement(node)) {
  2764. // This element was passed in a valid location.
  2765. if (node._store) {
  2766. node._store.validated = true;
  2767. }
  2768. } else if (node) {
  2769. var iteratorFn = getIteratorFn(node);
  2770. // Entry iterators provide implicit keys.
  2771. if (iteratorFn) {
  2772. if (iteratorFn !== node.entries) {
  2773. var iterator = iteratorFn.call(node);
  2774. var step;
  2775. while (!(step = iterator.next()).done) {
  2776. if (ReactElement.isValidElement(step.value)) {
  2777. validateExplicitKey(step.value, parentType);
  2778. }
  2779. }
  2780. }
  2781. }
  2782. }
  2783. }
  2784. /**
  2785. * Given an element, validate that its props follow the propTypes definition,
  2786. * provided by the type.
  2787. *
  2788. * @param {ReactElement} element
  2789. */
  2790. function validatePropTypes(element) {
  2791. var componentClass = element.type;
  2792. if (typeof componentClass !== 'function') {
  2793. return;
  2794. }
  2795. var name = componentClass.displayName || componentClass.name;
  2796. if (componentClass.propTypes) {
  2797. checkReactTypeSpec(componentClass.propTypes, element.props, ReactPropTypeLocations.prop, name, element, null);
  2798. }
  2799. if (typeof componentClass.getDefaultProps === 'function') {
  2800. process.env.NODE_ENV !== 'production' ? warning(componentClass.getDefaultProps.isReactClassApproved, 'getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.') : void 0;
  2801. }
  2802. }
  2803. var ReactElementValidator = {
  2804. createElement: function (type, props, children) {
  2805. var validType = typeof type === 'string' || typeof type === 'function';
  2806. // We warn in this case but don't throw. We expect the element creation to
  2807. // succeed and there will likely be errors in render.
  2808. if (!validType) {
  2809. process.env.NODE_ENV !== 'production' ? warning(false, '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;
  2810. }
  2811. var element = ReactElement.createElement.apply(this, arguments);
  2812. // The result can be nullish if a mock or a custom function is used.
  2813. // TODO: Drop this when these are no longer allowed as the type argument.
  2814. if (element == null) {
  2815. return element;
  2816. }
  2817. // Skip key warning if the type isn't valid since our key validation logic
  2818. // doesn't expect a non-string/function type and can throw confusing errors.
  2819. // We don't want exception behavior to differ between dev and prod.
  2820. // (Rendering will throw with a helpful message and as soon as the type is
  2821. // fixed, the key warnings will appear.)
  2822. if (validType) {
  2823. for (var i = 2; i < arguments.length; i++) {
  2824. validateChildKeys(arguments[i], type);
  2825. }
  2826. }
  2827. validatePropTypes(element);
  2828. return element;
  2829. },
  2830. createFactory: function (type) {
  2831. var validatedFactory = ReactElementValidator.createElement.bind(null, type);
  2832. // Legacy hook TODO: Warn if this is accessed
  2833. validatedFactory.type = type;
  2834. if (process.env.NODE_ENV !== 'production') {
  2835. if (canDefineProperty) {
  2836. Object.defineProperty(validatedFactory, 'type', {
  2837. enumerable: false,
  2838. get: function () {
  2839. process.env.NODE_ENV !== 'production' ? warning(false, 'Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.') : void 0;
  2840. Object.defineProperty(this, 'type', {
  2841. value: type
  2842. });
  2843. return type;
  2844. }
  2845. });
  2846. }
  2847. }
  2848. return validatedFactory;
  2849. },
  2850. cloneElement: function (element, props, children) {
  2851. var newElement = ReactElement.cloneElement.apply(this, arguments);
  2852. for (var i = 2; i < arguments.length; i++) {
  2853. validateChildKeys(arguments[i], newElement.type);
  2854. }
  2855. validatePropTypes(newElement);
  2856. return newElement;
  2857. }
  2858. };
  2859. module.exports = ReactElementValidator;
  2860. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  2861. /***/ },
  2862. /* 30 */
  2863. /***/ function(module, exports, __webpack_require__) {
  2864. /* WEBPACK VAR INJECTION */(function(process) {/**
  2865. * Copyright 2016-present, Facebook, Inc.
  2866. * All rights reserved.
  2867. *
  2868. * This source code is licensed under the BSD-style license found in the
  2869. * LICENSE file in the root directory of this source tree. An additional grant
  2870. * of patent rights can be found in the PATENTS file in the same directory.
  2871. *
  2872. * @providesModule ReactComponentTreeHook
  2873. */
  2874. 'use strict';
  2875. var _prodInvariant = __webpack_require__(9);
  2876. var ReactCurrentOwner = __webpack_require__(12);
  2877. var invariant = __webpack_require__(10);
  2878. var warning = __webpack_require__(13);
  2879. function isNative(fn) {
  2880. // Based on isNative() from Lodash
  2881. var funcToString = Function.prototype.toString;
  2882. var hasOwnProperty = Object.prototype.hasOwnProperty;
  2883. var reIsNative = RegExp('^' + funcToString
  2884. // Take an example native function source for comparison
  2885. .call(hasOwnProperty)
  2886. // Strip regex characters so we can use it for regex
  2887. .replace(/[\\^$.*+?()[\]{}|]/g, '\\$&')
  2888. // Remove hasOwnProperty from the template to make it generic
  2889. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$');
  2890. try {
  2891. var source = funcToString.call(fn);
  2892. return reIsNative.test(source);
  2893. } catch (err) {
  2894. return false;
  2895. }
  2896. }
  2897. var canUseCollections =
  2898. // Array.from
  2899. typeof Array.from === 'function' &&
  2900. // Map
  2901. typeof Map === 'function' && isNative(Map) &&
  2902. // Map.prototype.keys
  2903. Map.prototype != null && typeof Map.prototype.keys === 'function' && isNative(Map.prototype.keys) &&
  2904. // Set
  2905. typeof Set === 'function' && isNative(Set) &&
  2906. // Set.prototype.keys
  2907. Set.prototype != null && typeof Set.prototype.keys === 'function' && isNative(Set.prototype.keys);
  2908. var itemMap;
  2909. var rootIDSet;
  2910. var itemByKey;
  2911. var rootByKey;
  2912. if (canUseCollections) {
  2913. itemMap = new Map();
  2914. rootIDSet = new Set();
  2915. } else {
  2916. itemByKey = {};
  2917. rootByKey = {};
  2918. }
  2919. var unmountedIDs = [];
  2920. // Use non-numeric keys to prevent V8 performance issues:
  2921. // https://github.com/facebook/react/pull/7232
  2922. function getKeyFromID(id) {
  2923. return '.' + id;
  2924. }
  2925. function getIDFromKey(key) {
  2926. return parseInt(key.substr(1), 10);
  2927. }
  2928. function get(id) {
  2929. if (canUseCollections) {
  2930. return itemMap.get(id);
  2931. } else {
  2932. var key = getKeyFromID(id);
  2933. return itemByKey[key];
  2934. }
  2935. }
  2936. function remove(id) {
  2937. if (canUseCollections) {
  2938. itemMap['delete'](id);
  2939. } else {
  2940. var key = getKeyFromID(id);
  2941. delete itemByKey[key];
  2942. }
  2943. }
  2944. function create(id, element, parentID) {
  2945. var item = {
  2946. element: element,
  2947. parentID: parentID,
  2948. text: null,
  2949. childIDs: [],
  2950. isMounted: false,
  2951. updateCount: 0
  2952. };
  2953. if (canUseCollections) {
  2954. itemMap.set(id, item);
  2955. } else {
  2956. var key = getKeyFromID(id);
  2957. itemByKey[key] = item;
  2958. }
  2959. }
  2960. function addRoot(id) {
  2961. if (canUseCollections) {
  2962. rootIDSet.add(id);
  2963. } else {
  2964. var key = getKeyFromID(id);
  2965. rootByKey[key] = true;
  2966. }
  2967. }
  2968. function removeRoot(id) {
  2969. if (canUseCollections) {
  2970. rootIDSet['delete'](id);
  2971. } else {
  2972. var key = getKeyFromID(id);
  2973. delete rootByKey[key];
  2974. }
  2975. }
  2976. function getRegisteredIDs() {
  2977. if (canUseCollections) {
  2978. return Array.from(itemMap.keys());
  2979. } else {
  2980. return Object.keys(itemByKey).map(getIDFromKey);
  2981. }
  2982. }
  2983. function getRootIDs() {
  2984. if (canUseCollections) {
  2985. return Array.from(rootIDSet.keys());
  2986. } else {
  2987. return Object.keys(rootByKey).map(getIDFromKey);
  2988. }
  2989. }
  2990. function purgeDeep(id) {
  2991. var item = get(id);
  2992. if (item) {
  2993. var childIDs = item.childIDs;
  2994. remove(id);
  2995. childIDs.forEach(purgeDeep);
  2996. }
  2997. }
  2998. function describeComponentFrame(name, source, ownerName) {
  2999. return '\n in ' + name + (source ? ' (at ' + source.fileName.replace(/^.*[\\\/]/, '') + ':' + source.lineNumber + ')' : ownerName ? ' (created by ' + ownerName + ')' : '');
  3000. }
  3001. function getDisplayName(element) {
  3002. if (element == null) {
  3003. return '#empty';
  3004. } else if (typeof element === 'string' || typeof element === 'number') {
  3005. return '#text';
  3006. } else if (typeof element.type === 'string') {
  3007. return element.type;
  3008. } else {
  3009. return element.type.displayName || element.type.name || 'Unknown';
  3010. }
  3011. }
  3012. function describeID(id) {
  3013. var name = ReactComponentTreeHook.getDisplayName(id);
  3014. var element = ReactComponentTreeHook.getElement(id);
  3015. var ownerID = ReactComponentTreeHook.getOwnerID(id);
  3016. var ownerName;
  3017. if (ownerID) {
  3018. ownerName = ReactComponentTreeHook.getDisplayName(ownerID);
  3019. }
  3020. process.env.NODE_ENV !== 'production' ? warning(element, 'ReactComponentTreeHook: Missing React element for debugID %s when ' + 'building stack', id) : void 0;
  3021. return describeComponentFrame(name, element && element._source, ownerName);
  3022. }
  3023. var ReactComponentTreeHook = {
  3024. onSetChildren: function (id, nextChildIDs) {
  3025. var item = get(id);
  3026. item.childIDs = nextChildIDs;
  3027. for (var i = 0; i < nextChildIDs.length; i++) {
  3028. var nextChildID = nextChildIDs[i];
  3029. var nextChild = get(nextChildID);
  3030. !nextChild ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected hook events to fire for the child before its parent includes it in onSetChildren().') : _prodInvariant('140') : void 0;
  3031. !(nextChild.childIDs != null || typeof nextChild.element !== 'object' || nextChild.element == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected onSetChildren() to fire for a container child before its parent includes it in onSetChildren().') : _prodInvariant('141') : void 0;
  3032. !nextChild.isMounted ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected onMountComponent() to fire for the child before its parent includes it in onSetChildren().') : _prodInvariant('71') : void 0;
  3033. if (nextChild.parentID == null) {
  3034. nextChild.parentID = id;
  3035. // TODO: This shouldn't be necessary but mounting a new root during in
  3036. // componentWillMount currently causes not-yet-mounted components to
  3037. // be purged from our tree data so their parent ID is missing.
  3038. }
  3039. !(nextChild.parentID === id) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected onBeforeMountComponent() parent and onSetChildren() to be consistent (%s has parents %s and %s).', nextChildID, nextChild.parentID, id) : _prodInvariant('142', nextChildID, nextChild.parentID, id) : void 0;
  3040. }
  3041. },
  3042. onBeforeMountComponent: function (id, element, parentID) {
  3043. create(id, element, parentID);
  3044. },
  3045. onBeforeUpdateComponent: function (id, element) {
  3046. var item = get(id);
  3047. if (!item || !item.isMounted) {
  3048. // We may end up here as a result of setState() in componentWillUnmount().
  3049. // In this case, ignore the element.
  3050. return;
  3051. }
  3052. item.element = element;
  3053. },
  3054. onMountComponent: function (id) {
  3055. var item = get(id);
  3056. item.isMounted = true;
  3057. var isRoot = item.parentID === 0;
  3058. if (isRoot) {
  3059. addRoot(id);
  3060. }
  3061. },
  3062. onUpdateComponent: function (id) {
  3063. var item = get(id);
  3064. if (!item || !item.isMounted) {
  3065. // We may end up here as a result of setState() in componentWillUnmount().
  3066. // In this case, ignore the element.
  3067. return;
  3068. }
  3069. item.updateCount++;
  3070. },
  3071. onUnmountComponent: function (id) {
  3072. var item = get(id);
  3073. if (item) {
  3074. // We need to check if it exists.
  3075. // `item` might not exist if it is inside an error boundary, and a sibling
  3076. // error boundary child threw while mounting. Then this instance never
  3077. // got a chance to mount, but it still gets an unmounting event during
  3078. // the error boundary cleanup.
  3079. item.isMounted = false;
  3080. var isRoot = item.parentID === 0;
  3081. if (isRoot) {
  3082. removeRoot(id);
  3083. }
  3084. }
  3085. unmountedIDs.push(id);
  3086. },
  3087. purgeUnmountedComponents: function () {
  3088. if (ReactComponentTreeHook._preventPurging) {
  3089. // Should only be used for testing.
  3090. return;
  3091. }
  3092. for (var i = 0; i < unmountedIDs.length; i++) {
  3093. var id = unmountedIDs[i];
  3094. purgeDeep(id);
  3095. }
  3096. unmountedIDs.length = 0;
  3097. },
  3098. isMounted: function (id) {
  3099. var item = get(id);
  3100. return item ? item.isMounted : false;
  3101. },
  3102. getCurrentStackAddendum: function (topElement) {
  3103. var info = '';
  3104. if (topElement) {
  3105. var type = topElement.type;
  3106. var name = typeof type === 'function' ? type.displayName || type.name : type;
  3107. var owner = topElement._owner;
  3108. info += describeComponentFrame(name || 'Unknown', topElement._source, owner && owner.getName());
  3109. }
  3110. var currentOwner = ReactCurrentOwner.current;
  3111. var id = currentOwner && currentOwner._debugID;
  3112. info += ReactComponentTreeHook.getStackAddendumByID(id);
  3113. return info;
  3114. },
  3115. getStackAddendumByID: function (id) {
  3116. var info = '';
  3117. while (id) {
  3118. info += describeID(id);
  3119. id = ReactComponentTreeHook.getParentID(id);
  3120. }
  3121. return info;
  3122. },
  3123. getChildIDs: function (id) {
  3124. var item = get(id);
  3125. return item ? item.childIDs : [];
  3126. },
  3127. getDisplayName: function (id) {
  3128. var element = ReactComponentTreeHook.getElement(id);
  3129. if (!element) {
  3130. return null;
  3131. }
  3132. return getDisplayName(element);
  3133. },
  3134. getElement: function (id) {
  3135. var item = get(id);
  3136. return item ? item.element : null;
  3137. },
  3138. getOwnerID: function (id) {
  3139. var element = ReactComponentTreeHook.getElement(id);
  3140. if (!element || !element._owner) {
  3141. return null;
  3142. }
  3143. return element._owner._debugID;
  3144. },
  3145. getParentID: function (id) {
  3146. var item = get(id);
  3147. return item ? item.parentID : null;
  3148. },
  3149. getSource: function (id) {
  3150. var item = get(id);
  3151. var element = item ? item.element : null;
  3152. var source = element != null ? element._source : null;
  3153. return source;
  3154. },
  3155. getText: function (id) {
  3156. var element = ReactComponentTreeHook.getElement(id);
  3157. if (typeof element === 'string') {
  3158. return element;
  3159. } else if (typeof element === 'number') {
  3160. return '' + element;
  3161. } else {
  3162. return null;
  3163. }
  3164. },
  3165. getUpdateCount: function (id) {
  3166. var item = get(id);
  3167. return item ? item.updateCount : 0;
  3168. },
  3169. getRegisteredIDs: getRegisteredIDs,
  3170. getRootIDs: getRootIDs
  3171. };
  3172. module.exports = ReactComponentTreeHook;
  3173. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  3174. /***/ },
  3175. /* 31 */
  3176. /***/ function(module, exports, __webpack_require__) {
  3177. /* WEBPACK VAR INJECTION */(function(process) {/**
  3178. * Copyright 2013-present, Facebook, Inc.
  3179. * All rights reserved.
  3180. *
  3181. * This source code is licensed under the BSD-style license found in the
  3182. * LICENSE file in the root directory of this source tree. An additional grant
  3183. * of patent rights can be found in the PATENTS file in the same directory.
  3184. *
  3185. * @providesModule checkReactTypeSpec
  3186. */
  3187. 'use strict';
  3188. var _prodInvariant = __webpack_require__(9);
  3189. var ReactPropTypeLocationNames = __webpack_require__(26);
  3190. var ReactPropTypesSecret = __webpack_require__(32);
  3191. var invariant = __webpack_require__(10);
  3192. var warning = __webpack_require__(13);
  3193. var ReactComponentTreeHook;
  3194. if (typeof process !== 'undefined' && process.env && process.env.NODE_ENV === 'test') {
  3195. // Temporary hack.
  3196. // Inline requires don't work well with Jest:
  3197. // https://github.com/facebook/react/issues/7240
  3198. // Remove the inline requires when we don't need them anymore:
  3199. // https://github.com/facebook/react/pull/7178
  3200. ReactComponentTreeHook = __webpack_require__(30);
  3201. }
  3202. var loggedTypeFailures = {};
  3203. /**
  3204. * Assert that the values match with the type specs.
  3205. * Error messages are memorized and will only be shown once.
  3206. *
  3207. * @param {object} typeSpecs Map of name to a ReactPropType
  3208. * @param {object} values Runtime values that need to be type-checked
  3209. * @param {string} location e.g. "prop", "context", "child context"
  3210. * @param {string} componentName Name of the component for error messages.
  3211. * @param {?object} element The React element that is being type-checked
  3212. * @param {?number} debugID The React component instance that is being type-checked
  3213. * @private
  3214. */
  3215. function checkReactTypeSpec(typeSpecs, values, location, componentName, element, debugID) {
  3216. for (var typeSpecName in typeSpecs) {
  3217. if (typeSpecs.hasOwnProperty(typeSpecName)) {
  3218. var error;
  3219. // Prop type validation may throw. In case they do, we don't want to
  3220. // fail the render phase where it didn't fail before. So we log it.
  3221. // After these have been cleaned up, we'll let them throw.
  3222. try {
  3223. // This is intentionally an invariant that gets caught. It's the same
  3224. // behavior as without this statement except with a better message.
  3225. !(typeof typeSpecs[typeSpecName] === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s: %s type `%s` is invalid; it must be a function, usually from React.PropTypes.', componentName || 'React class', ReactPropTypeLocationNames[location], typeSpecName) : _prodInvariant('84', componentName || 'React class', ReactPropTypeLocationNames[location], typeSpecName) : void 0;
  3226. error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
  3227. } catch (ex) {
  3228. error = ex;
  3229. }
  3230. process.env.NODE_ENV !== 'production' ? 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], typeSpecName, typeof error) : void 0;
  3231. if (error instanceof Error && !(error.message in loggedTypeFailures)) {
  3232. // Only monitor this failure once because there tends to be a lot of the
  3233. // same error.
  3234. loggedTypeFailures[error.message] = true;
  3235. var componentStackInfo = '';
  3236. if (process.env.NODE_ENV !== 'production') {
  3237. if (!ReactComponentTreeHook) {
  3238. ReactComponentTreeHook = __webpack_require__(30);
  3239. }
  3240. if (debugID !== null) {
  3241. componentStackInfo = ReactComponentTreeHook.getStackAddendumByID(debugID);
  3242. } else if (element !== null) {
  3243. componentStackInfo = ReactComponentTreeHook.getCurrentStackAddendum(element);
  3244. }
  3245. }
  3246. process.env.NODE_ENV !== 'production' ? warning(false, 'Failed %s type: %s%s', location, error.message, componentStackInfo) : void 0;
  3247. }
  3248. }
  3249. }
  3250. }
  3251. module.exports = checkReactTypeSpec;
  3252. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  3253. /***/ },
  3254. /* 32 */
  3255. /***/ function(module, exports) {
  3256. /**
  3257. * Copyright 2013-present, Facebook, Inc.
  3258. * All rights reserved.
  3259. *
  3260. * This source code is licensed under the BSD-style license found in the
  3261. * LICENSE file in the root directory of this source tree. An additional grant
  3262. * of patent rights can be found in the PATENTS file in the same directory.
  3263. *
  3264. * @providesModule ReactPropTypesSecret
  3265. */
  3266. 'use strict';
  3267. var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
  3268. module.exports = ReactPropTypesSecret;
  3269. /***/ },
  3270. /* 33 */
  3271. /***/ function(module, exports, __webpack_require__) {
  3272. /* WEBPACK VAR INJECTION */(function(process) {/**
  3273. * Copyright 2013-present, Facebook, Inc.
  3274. * All rights reserved.
  3275. *
  3276. * This source code is licensed under the BSD-style license found in the
  3277. * LICENSE file in the root directory of this source tree. An additional grant
  3278. * of patent rights can be found in the PATENTS file in the same directory.
  3279. *
  3280. * @providesModule ReactPropTypes
  3281. */
  3282. 'use strict';
  3283. var ReactElement = __webpack_require__(11);
  3284. var ReactPropTypeLocationNames = __webpack_require__(26);
  3285. var ReactPropTypesSecret = __webpack_require__(32);
  3286. var emptyFunction = __webpack_require__(14);
  3287. var getIteratorFn = __webpack_require__(17);
  3288. var warning = __webpack_require__(13);
  3289. /**
  3290. * Collection of methods that allow declaration and validation of props that are
  3291. * supplied to React components. Example usage:
  3292. *
  3293. * var Props = require('ReactPropTypes');
  3294. * var MyArticle = React.createClass({
  3295. * propTypes: {
  3296. * // An optional string prop named "description".
  3297. * description: Props.string,
  3298. *
  3299. * // A required enum prop named "category".
  3300. * category: Props.oneOf(['News','Photos']).isRequired,
  3301. *
  3302. * // A prop named "dialog" that requires an instance of Dialog.
  3303. * dialog: Props.instanceOf(Dialog).isRequired
  3304. * },
  3305. * render: function() { ... }
  3306. * });
  3307. *
  3308. * A more formal specification of how these methods are used:
  3309. *
  3310. * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
  3311. * decl := ReactPropTypes.{type}(.isRequired)?
  3312. *
  3313. * Each and every declaration produces a function with the same signature. This
  3314. * allows the creation of custom validation functions. For example:
  3315. *
  3316. * var MyLink = React.createClass({
  3317. * propTypes: {
  3318. * // An optional string or URI prop named "href".
  3319. * href: function(props, propName, componentName) {
  3320. * var propValue = props[propName];
  3321. * if (propValue != null && typeof propValue !== 'string' &&
  3322. * !(propValue instanceof URI)) {
  3323. * return new Error(
  3324. * 'Expected a string or an URI for ' + propName + ' in ' +
  3325. * componentName
  3326. * );
  3327. * }
  3328. * }
  3329. * },
  3330. * render: function() {...}
  3331. * });
  3332. *
  3333. * @internal
  3334. */
  3335. var ANONYMOUS = '<<anonymous>>';
  3336. var ReactPropTypes = {
  3337. array: createPrimitiveTypeChecker('array'),
  3338. bool: createPrimitiveTypeChecker('boolean'),
  3339. func: createPrimitiveTypeChecker('function'),
  3340. number: createPrimitiveTypeChecker('number'),
  3341. object: createPrimitiveTypeChecker('object'),
  3342. string: createPrimitiveTypeChecker('string'),
  3343. symbol: createPrimitiveTypeChecker('symbol'),
  3344. any: createAnyTypeChecker(),
  3345. arrayOf: createArrayOfTypeChecker,
  3346. element: createElementTypeChecker(),
  3347. instanceOf: createInstanceTypeChecker,
  3348. node: createNodeChecker(),
  3349. objectOf: createObjectOfTypeChecker,
  3350. oneOf: createEnumTypeChecker,
  3351. oneOfType: createUnionTypeChecker,
  3352. shape: createShapeTypeChecker
  3353. };
  3354. /**
  3355. * inlined Object.is polyfill to avoid requiring consumers ship their own
  3356. * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
  3357. */
  3358. /*eslint-disable no-self-compare*/
  3359. function is(x, y) {
  3360. // SameValue algorithm
  3361. if (x === y) {
  3362. // Steps 1-5, 7-10
  3363. // Steps 6.b-6.e: +0 != -0
  3364. return x !== 0 || 1 / x === 1 / y;
  3365. } else {
  3366. // Step 6.a: NaN == NaN
  3367. return x !== x && y !== y;
  3368. }
  3369. }
  3370. /*eslint-enable no-self-compare*/
  3371. /**
  3372. * We use an Error-like object for backward compatibility as people may call
  3373. * PropTypes directly and inspect their output. However we don't use real
  3374. * Errors anymore. We don't inspect their stack anyway, and creating them
  3375. * is prohibitively expensive if they are created too often, such as what
  3376. * happens in oneOfType() for any type before the one that matched.
  3377. */
  3378. function PropTypeError(message) {
  3379. this.message = message;
  3380. this.stack = '';
  3381. }
  3382. // Make `instanceof Error` still work for returned errors.
  3383. PropTypeError.prototype = Error.prototype;
  3384. function createChainableTypeChecker(validate) {
  3385. if (process.env.NODE_ENV !== 'production') {
  3386. var manualPropTypeCallCache = {};
  3387. }
  3388. function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
  3389. componentName = componentName || ANONYMOUS;
  3390. propFullName = propFullName || propName;
  3391. if (process.env.NODE_ENV !== 'production') {
  3392. if (secret !== ReactPropTypesSecret && typeof console !== 'undefined') {
  3393. var cacheKey = componentName + ':' + propName;
  3394. if (!manualPropTypeCallCache[cacheKey]) {
  3395. process.env.NODE_ENV !== 'production' ? warning(false, 'You are manually calling a React.PropTypes validation ' + 'function for the `%s` prop on `%s`. This is deprecated ' + 'and will not work in the next major version. You may be ' + 'seeing this warning due to a third-party PropTypes library. ' + 'See https://fb.me/react-warning-dont-call-proptypes for details.', propFullName, componentName) : void 0;
  3396. manualPropTypeCallCache[cacheKey] = true;
  3397. }
  3398. }
  3399. }
  3400. if (props[propName] == null) {
  3401. var locationName = ReactPropTypeLocationNames[location];
  3402. if (isRequired) {
  3403. return new PropTypeError('Required ' + locationName + ' `' + propFullName + '` was not specified in ' + ('`' + componentName + '`.'));
  3404. }
  3405. return null;
  3406. } else {
  3407. return validate(props, propName, componentName, location, propFullName);
  3408. }
  3409. }
  3410. var chainedCheckType = checkType.bind(null, false);
  3411. chainedCheckType.isRequired = checkType.bind(null, true);
  3412. return chainedCheckType;
  3413. }
  3414. function createPrimitiveTypeChecker(expectedType) {
  3415. function validate(props, propName, componentName, location, propFullName, secret) {
  3416. var propValue = props[propName];
  3417. var propType = getPropType(propValue);
  3418. if (propType !== expectedType) {
  3419. var locationName = ReactPropTypeLocationNames[location];
  3420. // `propValue` being instance of, say, date/regexp, pass the 'object'
  3421. // check, but we can offer a more precise error message here rather than
  3422. // 'of type `object`'.
  3423. var preciseType = getPreciseType(propValue);
  3424. return new PropTypeError('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'));
  3425. }
  3426. return null;
  3427. }
  3428. return createChainableTypeChecker(validate);
  3429. }
  3430. function createAnyTypeChecker() {
  3431. return createChainableTypeChecker(emptyFunction.thatReturns(null));
  3432. }
  3433. function createArrayOfTypeChecker(typeChecker) {
  3434. function validate(props, propName, componentName, location, propFullName) {
  3435. if (typeof typeChecker !== 'function') {
  3436. return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
  3437. }
  3438. var propValue = props[propName];
  3439. if (!Array.isArray(propValue)) {
  3440. var locationName = ReactPropTypeLocationNames[location];
  3441. var propType = getPropType(propValue);
  3442. return new PropTypeError('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
  3443. }
  3444. for (var i = 0; i < propValue.length; i++) {
  3445. var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);
  3446. if (error instanceof Error) {
  3447. return error;
  3448. }
  3449. }
  3450. return null;
  3451. }
  3452. return createChainableTypeChecker(validate);
  3453. }
  3454. function createElementTypeChecker() {
  3455. function validate(props, propName, componentName, location, propFullName) {
  3456. var propValue = props[propName];
  3457. if (!ReactElement.isValidElement(propValue)) {
  3458. var locationName = ReactPropTypeLocationNames[location];
  3459. var propType = getPropType(propValue);
  3460. return new PropTypeError('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
  3461. }
  3462. return null;
  3463. }
  3464. return createChainableTypeChecker(validate);
  3465. }
  3466. function createInstanceTypeChecker(expectedClass) {
  3467. function validate(props, propName, componentName, location, propFullName) {
  3468. if (!(props[propName] instanceof expectedClass)) {
  3469. var locationName = ReactPropTypeLocationNames[location];
  3470. var expectedClassName = expectedClass.name || ANONYMOUS;
  3471. var actualClassName = getClassName(props[propName]);
  3472. return new PropTypeError('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
  3473. }
  3474. return null;
  3475. }
  3476. return createChainableTypeChecker(validate);
  3477. }
  3478. function createEnumTypeChecker(expectedValues) {
  3479. if (!Array.isArray(expectedValues)) {
  3480. process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid argument supplied to oneOf, expected an instance of array.') : void 0;
  3481. return emptyFunction.thatReturnsNull;
  3482. }
  3483. function validate(props, propName, componentName, location, propFullName) {
  3484. var propValue = props[propName];
  3485. for (var i = 0; i < expectedValues.length; i++) {
  3486. if (is(propValue, expectedValues[i])) {
  3487. return null;
  3488. }
  3489. }
  3490. var locationName = ReactPropTypeLocationNames[location];
  3491. var valuesString = JSON.stringify(expectedValues);
  3492. return new PropTypeError('Invalid ' + locationName + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
  3493. }
  3494. return createChainableTypeChecker(validate);
  3495. }
  3496. function createObjectOfTypeChecker(typeChecker) {
  3497. function validate(props, propName, componentName, location, propFullName) {
  3498. if (typeof typeChecker !== 'function') {
  3499. return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
  3500. }
  3501. var propValue = props[propName];
  3502. var propType = getPropType(propValue);
  3503. if (propType !== 'object') {
  3504. var locationName = ReactPropTypeLocationNames[location];
  3505. return new PropTypeError('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
  3506. }
  3507. for (var key in propValue) {
  3508. if (propValue.hasOwnProperty(key)) {
  3509. var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
  3510. if (error instanceof Error) {
  3511. return error;
  3512. }
  3513. }
  3514. }
  3515. return null;
  3516. }
  3517. return createChainableTypeChecker(validate);
  3518. }
  3519. function createUnionTypeChecker(arrayOfTypeCheckers) {
  3520. if (!Array.isArray(arrayOfTypeCheckers)) {
  3521. process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;
  3522. return emptyFunction.thatReturnsNull;
  3523. }
  3524. function validate(props, propName, componentName, location, propFullName) {
  3525. for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
  3526. var checker = arrayOfTypeCheckers[i];
  3527. if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) {
  3528. return null;
  3529. }
  3530. }
  3531. var locationName = ReactPropTypeLocationNames[location];
  3532. return new PropTypeError('Invalid ' + locationName + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.'));
  3533. }
  3534. return createChainableTypeChecker(validate);
  3535. }
  3536. function createNodeChecker() {
  3537. function validate(props, propName, componentName, location, propFullName) {
  3538. if (!isNode(props[propName])) {
  3539. var locationName = ReactPropTypeLocationNames[location];
  3540. return new PropTypeError('Invalid ' + locationName + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
  3541. }
  3542. return null;
  3543. }
  3544. return createChainableTypeChecker(validate);
  3545. }
  3546. function createShapeTypeChecker(shapeTypes) {
  3547. function validate(props, propName, componentName, location, propFullName) {
  3548. var propValue = props[propName];
  3549. var propType = getPropType(propValue);
  3550. if (propType !== 'object') {
  3551. var locationName = ReactPropTypeLocationNames[location];
  3552. return new PropTypeError('Invalid ' + locationName + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
  3553. }
  3554. for (var key in shapeTypes) {
  3555. var checker = shapeTypes[key];
  3556. if (!checker) {
  3557. continue;
  3558. }
  3559. var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
  3560. if (error) {
  3561. return error;
  3562. }
  3563. }
  3564. return null;
  3565. }
  3566. return createChainableTypeChecker(validate);
  3567. }
  3568. function isNode(propValue) {
  3569. switch (typeof propValue) {
  3570. case 'number':
  3571. case 'string':
  3572. case 'undefined':
  3573. return true;
  3574. case 'boolean':
  3575. return !propValue;
  3576. case 'object':
  3577. if (Array.isArray(propValue)) {
  3578. return propValue.every(isNode);
  3579. }
  3580. if (propValue === null || ReactElement.isValidElement(propValue)) {
  3581. return true;
  3582. }
  3583. var iteratorFn = getIteratorFn(propValue);
  3584. if (iteratorFn) {
  3585. var iterator = iteratorFn.call(propValue);
  3586. var step;
  3587. if (iteratorFn !== propValue.entries) {
  3588. while (!(step = iterator.next()).done) {
  3589. if (!isNode(step.value)) {
  3590. return false;
  3591. }
  3592. }
  3593. } else {
  3594. // Iterator will provide entry [k,v] tuples rather than values.
  3595. while (!(step = iterator.next()).done) {
  3596. var entry = step.value;
  3597. if (entry) {
  3598. if (!isNode(entry[1])) {
  3599. return false;
  3600. }
  3601. }
  3602. }
  3603. }
  3604. } else {
  3605. return false;
  3606. }
  3607. return true;
  3608. default:
  3609. return false;
  3610. }
  3611. }
  3612. function isSymbol(propType, propValue) {
  3613. // Native Symbol.
  3614. if (propType === 'symbol') {
  3615. return true;
  3616. }
  3617. // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
  3618. if (propValue['@@toStringTag'] === 'Symbol') {
  3619. return true;
  3620. }
  3621. // Fallback for non-spec compliant Symbols which are polyfilled.
  3622. if (typeof Symbol === 'function' && propValue instanceof Symbol) {
  3623. return true;
  3624. }
  3625. return false;
  3626. }
  3627. // Equivalent of `typeof` but with special handling for array and regexp.
  3628. function getPropType(propValue) {
  3629. var propType = typeof propValue;
  3630. if (Array.isArray(propValue)) {
  3631. return 'array';
  3632. }
  3633. if (propValue instanceof RegExp) {
  3634. // Old webkits (at least until Android 4.0) return 'function' rather than
  3635. // 'object' for typeof a RegExp. We'll normalize this here so that /bla/
  3636. // passes PropTypes.object.
  3637. return 'object';
  3638. }
  3639. if (isSymbol(propType, propValue)) {
  3640. return 'symbol';
  3641. }
  3642. return propType;
  3643. }
  3644. // This handles more types than `getPropType`. Only used for error messages.
  3645. // See `createPrimitiveTypeChecker`.
  3646. function getPreciseType(propValue) {
  3647. var propType = getPropType(propValue);
  3648. if (propType === 'object') {
  3649. if (propValue instanceof Date) {
  3650. return 'date';
  3651. } else if (propValue instanceof RegExp) {
  3652. return 'regexp';
  3653. }
  3654. }
  3655. return propType;
  3656. }
  3657. // Returns class name of the object, if any.
  3658. function getClassName(propValue) {
  3659. if (!propValue.constructor || !propValue.constructor.name) {
  3660. return ANONYMOUS;
  3661. }
  3662. return propValue.constructor.name;
  3663. }
  3664. module.exports = ReactPropTypes;
  3665. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  3666. /***/ },
  3667. /* 34 */
  3668. /***/ function(module, exports) {
  3669. /**
  3670. * Copyright 2013-present, Facebook, Inc.
  3671. * All rights reserved.
  3672. *
  3673. * This source code is licensed under the BSD-style license found in the
  3674. * LICENSE file in the root directory of this source tree. An additional grant
  3675. * of patent rights can be found in the PATENTS file in the same directory.
  3676. *
  3677. * @providesModule ReactVersion
  3678. */
  3679. 'use strict';
  3680. module.exports = '15.3.1';
  3681. /***/ },
  3682. /* 35 */
  3683. /***/ function(module, exports, __webpack_require__) {
  3684. /* WEBPACK VAR INJECTION */(function(process) {/**
  3685. * Copyright 2013-present, Facebook, Inc.
  3686. * All rights reserved.
  3687. *
  3688. * This source code is licensed under the BSD-style license found in the
  3689. * LICENSE file in the root directory of this source tree. An additional grant
  3690. * of patent rights can be found in the PATENTS file in the same directory.
  3691. *
  3692. * @providesModule onlyChild
  3693. */
  3694. 'use strict';
  3695. var _prodInvariant = __webpack_require__(9);
  3696. var ReactElement = __webpack_require__(11);
  3697. var invariant = __webpack_require__(10);
  3698. /**
  3699. * Returns the first child in a collection of children and verifies that there
  3700. * is only one child in the collection.
  3701. *
  3702. * See https://facebook.github.io/react/docs/top-level-api.html#react.children.only
  3703. *
  3704. * The current implementation of this function assumes that a single child gets
  3705. * passed without a wrapper, but the purpose of this helper function is to
  3706. * abstract away the particular structure of children.
  3707. *
  3708. * @param {?object} children Child collection structure.
  3709. * @return {ReactElement} The first and only `ReactElement` contained in the
  3710. * structure.
  3711. */
  3712. function onlyChild(children) {
  3713. !ReactElement.isValidElement(children) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'React.Children.only expected to receive a single React element child.') : _prodInvariant('143') : void 0;
  3714. return children;
  3715. }
  3716. module.exports = onlyChild;
  3717. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  3718. /***/ },
  3719. /* 36 */
  3720. /***/ function(module, exports, __webpack_require__) {
  3721. 'use strict';
  3722. module.exports = __webpack_require__(37);
  3723. /***/ },
  3724. /* 37 */
  3725. /***/ function(module, exports, __webpack_require__) {
  3726. /* WEBPACK VAR INJECTION */(function(process) {/**
  3727. * Copyright 2013-present, Facebook, Inc.
  3728. * All rights reserved.
  3729. *
  3730. * This source code is licensed under the BSD-style license found in the
  3731. * LICENSE file in the root directory of this source tree. An additional grant
  3732. * of patent rights can be found in the PATENTS file in the same directory.
  3733. *
  3734. * @providesModule ReactDOM
  3735. */
  3736. /* globals __REACT_DEVTOOLS_GLOBAL_HOOK__*/
  3737. 'use strict';
  3738. var ReactDOMComponentTree = __webpack_require__(38);
  3739. var ReactDefaultInjection = __webpack_require__(41);
  3740. var ReactMount = __webpack_require__(164);
  3741. var ReactReconciler = __webpack_require__(61);
  3742. var ReactUpdates = __webpack_require__(58);
  3743. var ReactVersion = __webpack_require__(34);
  3744. var findDOMNode = __webpack_require__(169);
  3745. var getHostComponentFromComposite = __webpack_require__(170);
  3746. var renderSubtreeIntoContainer = __webpack_require__(171);
  3747. var warning = __webpack_require__(13);
  3748. ReactDefaultInjection.inject();
  3749. var ReactDOM = {
  3750. findDOMNode: findDOMNode,
  3751. render: ReactMount.render,
  3752. unmountComponentAtNode: ReactMount.unmountComponentAtNode,
  3753. version: ReactVersion,
  3754. /* eslint-disable camelcase */
  3755. unstable_batchedUpdates: ReactUpdates.batchedUpdates,
  3756. unstable_renderSubtreeIntoContainer: renderSubtreeIntoContainer
  3757. };
  3758. // Inject the runtime into a devtools global hook regardless of browser.
  3759. // Allows for debugging when the hook is injected on the page.
  3760. /* eslint-enable camelcase */
  3761. if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.inject === 'function') {
  3762. __REACT_DEVTOOLS_GLOBAL_HOOK__.inject({
  3763. ComponentTree: {
  3764. getClosestInstanceFromNode: ReactDOMComponentTree.getClosestInstanceFromNode,
  3765. getNodeFromInstance: function (inst) {
  3766. // inst is an internal instance (but could be a composite)
  3767. if (inst._renderedComponent) {
  3768. inst = getHostComponentFromComposite(inst);
  3769. }
  3770. if (inst) {
  3771. return ReactDOMComponentTree.getNodeFromInstance(inst);
  3772. } else {
  3773. return null;
  3774. }
  3775. }
  3776. },
  3777. Mount: ReactMount,
  3778. Reconciler: ReactReconciler
  3779. });
  3780. }
  3781. if (process.env.NODE_ENV !== 'production') {
  3782. var ExecutionEnvironment = __webpack_require__(51);
  3783. if (ExecutionEnvironment.canUseDOM && window.top === window.self) {
  3784. // First check if devtools is not installed
  3785. if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined') {
  3786. // If we're in Chrome or Firefox, provide a download link if not installed.
  3787. if (navigator.userAgent.indexOf('Chrome') > -1 && navigator.userAgent.indexOf('Edge') === -1 || navigator.userAgent.indexOf('Firefox') > -1) {
  3788. // Firefox does not have the issue with devtools loaded over file://
  3789. var showFileUrlMessage = window.location.protocol.indexOf('http') === -1 && navigator.userAgent.indexOf('Firefox') === -1;
  3790. 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');
  3791. }
  3792. }
  3793. var testFunc = function testFn() {};
  3794. 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;
  3795. // If we're in IE8, check to see if we are in compatibility mode and provide
  3796. // information on preventing compatibility mode
  3797. var ieCompatibilityMode = document.documentMode && document.documentMode < 8;
  3798. 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;
  3799. var expectedFeatures = [
  3800. // shims
  3801. 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];
  3802. for (var i = 0; i < expectedFeatures.length; i++) {
  3803. if (!expectedFeatures[i]) {
  3804. 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;
  3805. break;
  3806. }
  3807. }
  3808. }
  3809. }
  3810. if (process.env.NODE_ENV !== 'production') {
  3811. var ReactInstrumentation = __webpack_require__(64);
  3812. var ReactDOMUnknownPropertyHook = __webpack_require__(172);
  3813. var ReactDOMNullInputValuePropHook = __webpack_require__(173);
  3814. ReactInstrumentation.debugTool.addHook(ReactDOMUnknownPropertyHook);
  3815. ReactInstrumentation.debugTool.addHook(ReactDOMNullInputValuePropHook);
  3816. }
  3817. module.exports = ReactDOM;
  3818. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  3819. /***/ },
  3820. /* 38 */
  3821. /***/ function(module, exports, __webpack_require__) {
  3822. /* WEBPACK VAR INJECTION */(function(process) {/**
  3823. * Copyright 2013-present, Facebook, Inc.
  3824. * All rights reserved.
  3825. *
  3826. * This source code is licensed under the BSD-style license found in the
  3827. * LICENSE file in the root directory of this source tree. An additional grant
  3828. * of patent rights can be found in the PATENTS file in the same directory.
  3829. *
  3830. * @providesModule ReactDOMComponentTree
  3831. */
  3832. 'use strict';
  3833. var _prodInvariant = __webpack_require__(9);
  3834. var DOMProperty = __webpack_require__(39);
  3835. var ReactDOMComponentFlags = __webpack_require__(40);
  3836. var invariant = __webpack_require__(10);
  3837. var ATTR_NAME = DOMProperty.ID_ATTRIBUTE_NAME;
  3838. var Flags = ReactDOMComponentFlags;
  3839. var internalInstanceKey = '__reactInternalInstance$' + Math.random().toString(36).slice(2);
  3840. /**
  3841. * Drill down (through composites and empty components) until we get a host or
  3842. * host text component.
  3843. *
  3844. * This is pretty polymorphic but unavoidable with the current structure we have
  3845. * for `_renderedChildren`.
  3846. */
  3847. function getRenderedHostOrTextFromComponent(component) {
  3848. var rendered;
  3849. while (rendered = component._renderedComponent) {
  3850. component = rendered;
  3851. }
  3852. return component;
  3853. }
  3854. /**
  3855. * Populate `_hostNode` on the rendered host/text component with the given
  3856. * DOM node. The passed `inst` can be a composite.
  3857. */
  3858. function precacheNode(inst, node) {
  3859. var hostInst = getRenderedHostOrTextFromComponent(inst);
  3860. hostInst._hostNode = node;
  3861. node[internalInstanceKey] = hostInst;
  3862. }
  3863. function uncacheNode(inst) {
  3864. var node = inst._hostNode;
  3865. if (node) {
  3866. delete node[internalInstanceKey];
  3867. inst._hostNode = null;
  3868. }
  3869. }
  3870. /**
  3871. * Populate `_hostNode` on each child of `inst`, assuming that the children
  3872. * match up with the DOM (element) children of `node`.
  3873. *
  3874. * We cache entire levels at once to avoid an n^2 problem where we access the
  3875. * children of a node sequentially and have to walk from the start to our target
  3876. * node every time.
  3877. *
  3878. * Since we update `_renderedChildren` and the actual DOM at (slightly)
  3879. * different times, we could race here and see a newer `_renderedChildren` than
  3880. * the DOM nodes we see. To avoid this, ReactMultiChild calls
  3881. * `prepareToManageChildren` before we change `_renderedChildren`, at which
  3882. * time the container's child nodes are always cached (until it unmounts).
  3883. */
  3884. function precacheChildNodes(inst, node) {
  3885. if (inst._flags & Flags.hasCachedChildNodes) {
  3886. return;
  3887. }
  3888. var children = inst._renderedChildren;
  3889. var childNode = node.firstChild;
  3890. outer: for (var name in children) {
  3891. if (!children.hasOwnProperty(name)) {
  3892. continue;
  3893. }
  3894. var childInst = children[name];
  3895. var childID = getRenderedHostOrTextFromComponent(childInst)._domID;
  3896. if (childID === 0) {
  3897. // We're currently unmounting this child in ReactMultiChild; skip it.
  3898. continue;
  3899. }
  3900. // We assume the child nodes are in the same order as the child instances.
  3901. for (; childNode !== null; childNode = childNode.nextSibling) {
  3902. 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 + ' ') {
  3903. precacheNode(childInst, childNode);
  3904. continue outer;
  3905. }
  3906. }
  3907. // We reached the end of the DOM children without finding an ID match.
  3908. true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;
  3909. }
  3910. inst._flags |= Flags.hasCachedChildNodes;
  3911. }
  3912. /**
  3913. * Given a DOM node, return the closest ReactDOMComponent or
  3914. * ReactDOMTextComponent instance ancestor.
  3915. */
  3916. function getClosestInstanceFromNode(node) {
  3917. if (node[internalInstanceKey]) {
  3918. return node[internalInstanceKey];
  3919. }
  3920. // Walk up the tree until we find an ancestor whose instance we have cached.
  3921. var parents = [];
  3922. while (!node[internalInstanceKey]) {
  3923. parents.push(node);
  3924. if (node.parentNode) {
  3925. node = node.parentNode;
  3926. } else {
  3927. // Top of the tree. This node must not be part of a React tree (or is
  3928. // unmounted, potentially).
  3929. return null;
  3930. }
  3931. }
  3932. var closest;
  3933. var inst;
  3934. for (; node && (inst = node[internalInstanceKey]); node = parents.pop()) {
  3935. closest = inst;
  3936. if (parents.length) {
  3937. precacheChildNodes(inst, node);
  3938. }
  3939. }
  3940. return closest;
  3941. }
  3942. /**
  3943. * Given a DOM node, return the ReactDOMComponent or ReactDOMTextComponent
  3944. * instance, or null if the node was not rendered by this React.
  3945. */
  3946. function getInstanceFromNode(node) {
  3947. var inst = getClosestInstanceFromNode(node);
  3948. if (inst != null && inst._hostNode === node) {
  3949. return inst;
  3950. } else {
  3951. return null;
  3952. }
  3953. }
  3954. /**
  3955. * Given a ReactDOMComponent or ReactDOMTextComponent, return the corresponding
  3956. * DOM node.
  3957. */
  3958. function getNodeFromInstance(inst) {
  3959. // Without this first invariant, passing a non-DOM-component triggers the next
  3960. // invariant for a missing parent, which is super confusing.
  3961. !(inst._hostNode !== undefined) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'getNodeFromInstance: Invalid argument.') : _prodInvariant('33') : void 0;
  3962. if (inst._hostNode) {
  3963. return inst._hostNode;
  3964. }
  3965. // Walk up the tree until we find an ancestor whose DOM node we have cached.
  3966. var parents = [];
  3967. while (!inst._hostNode) {
  3968. parents.push(inst);
  3969. !inst._hostParent ? process.env.NODE_ENV !== 'production' ? invariant(false, 'React DOM tree root should always have a node reference.') : _prodInvariant('34') : void 0;
  3970. inst = inst._hostParent;
  3971. }
  3972. // Now parents contains each ancestor that does *not* have a cached native
  3973. // node, and `inst` is the deepest ancestor that does.
  3974. for (; parents.length; inst = parents.pop()) {
  3975. precacheChildNodes(inst, inst._hostNode);
  3976. }
  3977. return inst._hostNode;
  3978. }
  3979. var ReactDOMComponentTree = {
  3980. getClosestInstanceFromNode: getClosestInstanceFromNode,
  3981. getInstanceFromNode: getInstanceFromNode,
  3982. getNodeFromInstance: getNodeFromInstance,
  3983. precacheChildNodes: precacheChildNodes,
  3984. precacheNode: precacheNode,
  3985. uncacheNode: uncacheNode
  3986. };
  3987. module.exports = ReactDOMComponentTree;
  3988. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  3989. /***/ },
  3990. /* 39 */
  3991. /***/ function(module, exports, __webpack_require__) {
  3992. /* WEBPACK VAR INJECTION */(function(process) {/**
  3993. * Copyright 2013-present, Facebook, Inc.
  3994. * All rights reserved.
  3995. *
  3996. * This source code is licensed under the BSD-style license found in the
  3997. * LICENSE file in the root directory of this source tree. An additional grant
  3998. * of patent rights can be found in the PATENTS file in the same directory.
  3999. *
  4000. * @providesModule DOMProperty
  4001. */
  4002. 'use strict';
  4003. var _prodInvariant = __webpack_require__(9);
  4004. var invariant = __webpack_require__(10);
  4005. function checkMask(value, bitmask) {
  4006. return (value & bitmask) === bitmask;
  4007. }
  4008. var DOMPropertyInjection = {
  4009. /**
  4010. * Mapping from normalized, camelcased property names to a configuration that
  4011. * specifies how the associated DOM property should be accessed or rendered.
  4012. */
  4013. MUST_USE_PROPERTY: 0x1,
  4014. HAS_BOOLEAN_VALUE: 0x4,
  4015. HAS_NUMERIC_VALUE: 0x8,
  4016. HAS_POSITIVE_NUMERIC_VALUE: 0x10 | 0x8,
  4017. HAS_OVERLOADED_BOOLEAN_VALUE: 0x20,
  4018. /**
  4019. * Inject some specialized knowledge about the DOM. This takes a config object
  4020. * with the following properties:
  4021. *
  4022. * isCustomAttribute: function that given an attribute name will return true
  4023. * if it can be inserted into the DOM verbatim. Useful for data-* or aria-*
  4024. * attributes where it's impossible to enumerate all of the possible
  4025. * attribute names,
  4026. *
  4027. * Properties: object mapping DOM property name to one of the
  4028. * DOMPropertyInjection constants or null. If your attribute isn't in here,
  4029. * it won't get written to the DOM.
  4030. *
  4031. * DOMAttributeNames: object mapping React attribute name to the DOM
  4032. * attribute name. Attribute names not specified use the **lowercase**
  4033. * normalized name.
  4034. *
  4035. * DOMAttributeNamespaces: object mapping React attribute name to the DOM
  4036. * attribute namespace URL. (Attribute names not specified use no namespace.)
  4037. *
  4038. * DOMPropertyNames: similar to DOMAttributeNames but for DOM properties.
  4039. * Property names not specified use the normalized name.
  4040. *
  4041. * DOMMutationMethods: Properties that require special mutation methods. If
  4042. * `value` is undefined, the mutation method should unset the property.
  4043. *
  4044. * @param {object} domPropertyConfig the config as described above.
  4045. */
  4046. injectDOMPropertyConfig: function (domPropertyConfig) {
  4047. var Injection = DOMPropertyInjection;
  4048. var Properties = domPropertyConfig.Properties || {};
  4049. var DOMAttributeNamespaces = domPropertyConfig.DOMAttributeNamespaces || {};
  4050. var DOMAttributeNames = domPropertyConfig.DOMAttributeNames || {};
  4051. var DOMPropertyNames = domPropertyConfig.DOMPropertyNames || {};
  4052. var DOMMutationMethods = domPropertyConfig.DOMMutationMethods || {};
  4053. if (domPropertyConfig.isCustomAttribute) {
  4054. DOMProperty._isCustomAttributeFunctions.push(domPropertyConfig.isCustomAttribute);
  4055. }
  4056. for (var propName in Properties) {
  4057. !!DOMProperty.properties.hasOwnProperty(propName) ? process.env.NODE_ENV !== 'production' ? 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) : _prodInvariant('48', propName) : void 0;
  4058. var lowerCased = propName.toLowerCase();
  4059. var propConfig = Properties[propName];
  4060. var propertyInfo = {
  4061. attributeName: lowerCased,
  4062. attributeNamespace: null,
  4063. propertyName: propName,
  4064. mutationMethod: null,
  4065. mustUseProperty: checkMask(propConfig, Injection.MUST_USE_PROPERTY),
  4066. hasBooleanValue: checkMask(propConfig, Injection.HAS_BOOLEAN_VALUE),
  4067. hasNumericValue: checkMask(propConfig, Injection.HAS_NUMERIC_VALUE),
  4068. hasPositiveNumericValue: checkMask(propConfig, Injection.HAS_POSITIVE_NUMERIC_VALUE),
  4069. hasOverloadedBooleanValue: checkMask(propConfig, Injection.HAS_OVERLOADED_BOOLEAN_VALUE)
  4070. };
  4071. !(propertyInfo.hasBooleanValue + propertyInfo.hasNumericValue + propertyInfo.hasOverloadedBooleanValue <= 1) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'DOMProperty: Value can be one of boolean, overloaded boolean, or numeric value, but not a combination: %s', propName) : _prodInvariant('50', propName) : void 0;
  4072. if (process.env.NODE_ENV !== 'production') {
  4073. DOMProperty.getPossibleStandardName[lowerCased] = propName;
  4074. }
  4075. if (DOMAttributeNames.hasOwnProperty(propName)) {
  4076. var attributeName = DOMAttributeNames[propName];
  4077. propertyInfo.attributeName = attributeName;
  4078. if (process.env.NODE_ENV !== 'production') {
  4079. DOMProperty.getPossibleStandardName[attributeName] = propName;
  4080. }
  4081. }
  4082. if (DOMAttributeNamespaces.hasOwnProperty(propName)) {
  4083. propertyInfo.attributeNamespace = DOMAttributeNamespaces[propName];
  4084. }
  4085. if (DOMPropertyNames.hasOwnProperty(propName)) {
  4086. propertyInfo.propertyName = DOMPropertyNames[propName];
  4087. }
  4088. if (DOMMutationMethods.hasOwnProperty(propName)) {
  4089. propertyInfo.mutationMethod = DOMMutationMethods[propName];
  4090. }
  4091. DOMProperty.properties[propName] = propertyInfo;
  4092. }
  4093. }
  4094. };
  4095. /* eslint-disable max-len */
  4096. 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';
  4097. /* eslint-enable max-len */
  4098. /**
  4099. * DOMProperty exports lookup objects that can be used like functions:
  4100. *
  4101. * > DOMProperty.isValid['id']
  4102. * true
  4103. * > DOMProperty.isValid['foobar']
  4104. * undefined
  4105. *
  4106. * Although this may be confusing, it performs better in general.
  4107. *
  4108. * @see http://jsperf.com/key-exists
  4109. * @see http://jsperf.com/key-missing
  4110. */
  4111. var DOMProperty = {
  4112. ID_ATTRIBUTE_NAME: 'data-reactid',
  4113. ROOT_ATTRIBUTE_NAME: 'data-reactroot',
  4114. ATTRIBUTE_NAME_START_CHAR: ATTRIBUTE_NAME_START_CHAR,
  4115. ATTRIBUTE_NAME_CHAR: ATTRIBUTE_NAME_START_CHAR + '\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040',
  4116. /**
  4117. * Map from property "standard name" to an object with info about how to set
  4118. * the property in the DOM. Each object contains:
  4119. *
  4120. * attributeName:
  4121. * Used when rendering markup or with `*Attribute()`.
  4122. * attributeNamespace
  4123. * propertyName:
  4124. * Used on DOM node instances. (This includes properties that mutate due to
  4125. * external factors.)
  4126. * mutationMethod:
  4127. * If non-null, used instead of the property or `setAttribute()` after
  4128. * initial render.
  4129. * mustUseProperty:
  4130. * Whether the property must be accessed and mutated as an object property.
  4131. * hasBooleanValue:
  4132. * Whether the property should be removed when set to a falsey value.
  4133. * hasNumericValue:
  4134. * Whether the property must be numeric or parse as a numeric and should be
  4135. * removed when set to a falsey value.
  4136. * hasPositiveNumericValue:
  4137. * Whether the property must be positive numeric or parse as a positive
  4138. * numeric and should be removed when set to a falsey value.
  4139. * hasOverloadedBooleanValue:
  4140. * Whether the property can be used as a flag as well as with a value.
  4141. * Removed when strictly equal to false; present without a value when
  4142. * strictly equal to true; present with a value otherwise.
  4143. */
  4144. properties: {},
  4145. /**
  4146. * Mapping from lowercase property names to the properly cased version, used
  4147. * to warn in the case of missing properties. Available only in __DEV__.
  4148. * @type {Object}
  4149. */
  4150. getPossibleStandardName: process.env.NODE_ENV !== 'production' ? {} : null,
  4151. /**
  4152. * All of the isCustomAttribute() functions that have been injected.
  4153. */
  4154. _isCustomAttributeFunctions: [],
  4155. /**
  4156. * Checks whether a property name is a custom attribute.
  4157. * @method
  4158. */
  4159. isCustomAttribute: function (attributeName) {
  4160. for (var i = 0; i < DOMProperty._isCustomAttributeFunctions.length; i++) {
  4161. var isCustomAttributeFn = DOMProperty._isCustomAttributeFunctions[i];
  4162. if (isCustomAttributeFn(attributeName)) {
  4163. return true;
  4164. }
  4165. }
  4166. return false;
  4167. },
  4168. injection: DOMPropertyInjection
  4169. };
  4170. module.exports = DOMProperty;
  4171. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  4172. /***/ },
  4173. /* 40 */
  4174. /***/ function(module, exports) {
  4175. /**
  4176. * Copyright 2015-present, Facebook, Inc.
  4177. * All rights reserved.
  4178. *
  4179. * This source code is licensed under the BSD-style license found in the
  4180. * LICENSE file in the root directory of this source tree. An additional grant
  4181. * of patent rights can be found in the PATENTS file in the same directory.
  4182. *
  4183. * @providesModule ReactDOMComponentFlags
  4184. */
  4185. 'use strict';
  4186. var ReactDOMComponentFlags = {
  4187. hasCachedChildNodes: 1 << 0
  4188. };
  4189. module.exports = ReactDOMComponentFlags;
  4190. /***/ },
  4191. /* 41 */
  4192. /***/ function(module, exports, __webpack_require__) {
  4193. /**
  4194. * Copyright 2013-present, Facebook, Inc.
  4195. * All rights reserved.
  4196. *
  4197. * This source code is licensed under the BSD-style license found in the
  4198. * LICENSE file in the root directory of this source tree. An additional grant
  4199. * of patent rights can be found in the PATENTS file in the same directory.
  4200. *
  4201. * @providesModule ReactDefaultInjection
  4202. */
  4203. 'use strict';
  4204. var BeforeInputEventPlugin = __webpack_require__(42);
  4205. var ChangeEventPlugin = __webpack_require__(57);
  4206. var DefaultEventPluginOrder = __webpack_require__(75);
  4207. var EnterLeaveEventPlugin = __webpack_require__(76);
  4208. var HTMLDOMPropertyConfig = __webpack_require__(81);
  4209. var ReactComponentBrowserEnvironment = __webpack_require__(82);
  4210. var ReactDOMComponent = __webpack_require__(96);
  4211. var ReactDOMComponentTree = __webpack_require__(38);
  4212. var ReactDOMEmptyComponent = __webpack_require__(135);
  4213. var ReactDOMTreeTraversal = __webpack_require__(136);
  4214. var ReactDOMTextComponent = __webpack_require__(137);
  4215. var ReactDefaultBatchingStrategy = __webpack_require__(138);
  4216. var ReactEventListener = __webpack_require__(139);
  4217. var ReactInjection = __webpack_require__(142);
  4218. var ReactReconcileTransaction = __webpack_require__(143);
  4219. var SVGDOMPropertyConfig = __webpack_require__(151);
  4220. var SelectEventPlugin = __webpack_require__(152);
  4221. var SimpleEventPlugin = __webpack_require__(153);
  4222. var alreadyInjected = false;
  4223. function inject() {
  4224. if (alreadyInjected) {
  4225. // TODO: This is currently true because these injections are shared between
  4226. // the client and the server package. They should be built independently
  4227. // and not share any injection state. Then this problem will be solved.
  4228. return;
  4229. }
  4230. alreadyInjected = true;
  4231. ReactInjection.EventEmitter.injectReactEventListener(ReactEventListener);
  4232. /**
  4233. * Inject modules for resolving DOM hierarchy and plugin ordering.
  4234. */
  4235. ReactInjection.EventPluginHub.injectEventPluginOrder(DefaultEventPluginOrder);
  4236. ReactInjection.EventPluginUtils.injectComponentTree(ReactDOMComponentTree);
  4237. ReactInjection.EventPluginUtils.injectTreeTraversal(ReactDOMTreeTraversal);
  4238. /**
  4239. * Some important event plugins included by default (without having to require
  4240. * them).
  4241. */
  4242. ReactInjection.EventPluginHub.injectEventPluginsByName({
  4243. SimpleEventPlugin: SimpleEventPlugin,
  4244. EnterLeaveEventPlugin: EnterLeaveEventPlugin,
  4245. ChangeEventPlugin: ChangeEventPlugin,
  4246. SelectEventPlugin: SelectEventPlugin,
  4247. BeforeInputEventPlugin: BeforeInputEventPlugin
  4248. });
  4249. ReactInjection.HostComponent.injectGenericComponentClass(ReactDOMComponent);
  4250. ReactInjection.HostComponent.injectTextComponentClass(ReactDOMTextComponent);
  4251. ReactInjection.DOMProperty.injectDOMPropertyConfig(HTMLDOMPropertyConfig);
  4252. ReactInjection.DOMProperty.injectDOMPropertyConfig(SVGDOMPropertyConfig);
  4253. ReactInjection.EmptyComponent.injectEmptyComponentFactory(function (instantiate) {
  4254. return new ReactDOMEmptyComponent(instantiate);
  4255. });
  4256. ReactInjection.Updates.injectReconcileTransaction(ReactReconcileTransaction);
  4257. ReactInjection.Updates.injectBatchingStrategy(ReactDefaultBatchingStrategy);
  4258. ReactInjection.Component.injectEnvironment(ReactComponentBrowserEnvironment);
  4259. }
  4260. module.exports = {
  4261. inject: inject
  4262. };
  4263. /***/ },
  4264. /* 42 */
  4265. /***/ function(module, exports, __webpack_require__) {
  4266. /**
  4267. * Copyright 2013-present Facebook, Inc.
  4268. * All rights reserved.
  4269. *
  4270. * This source code is licensed under the BSD-style license found in the
  4271. * LICENSE file in the root directory of this source tree. An additional grant
  4272. * of patent rights can be found in the PATENTS file in the same directory.
  4273. *
  4274. * @providesModule BeforeInputEventPlugin
  4275. */
  4276. 'use strict';
  4277. var EventConstants = __webpack_require__(43);
  4278. var EventPropagators = __webpack_require__(44);
  4279. var ExecutionEnvironment = __webpack_require__(51);
  4280. var FallbackCompositionState = __webpack_require__(52);
  4281. var SyntheticCompositionEvent = __webpack_require__(54);
  4282. var SyntheticInputEvent = __webpack_require__(56);
  4283. var keyOf = __webpack_require__(27);
  4284. var END_KEYCODES = [9, 13, 27, 32]; // Tab, Return, Esc, Space
  4285. var START_KEYCODE = 229;
  4286. var canUseCompositionEvent = ExecutionEnvironment.canUseDOM && 'CompositionEvent' in window;
  4287. var documentMode = null;
  4288. if (ExecutionEnvironment.canUseDOM && 'documentMode' in document) {
  4289. documentMode = document.documentMode;
  4290. }
  4291. // Webkit offers a very useful `textInput` event that can be used to
  4292. // directly represent `beforeInput`. The IE `textinput` event is not as
  4293. // useful, so we don't use it.
  4294. var canUseTextInputEvent = ExecutionEnvironment.canUseDOM && 'TextEvent' in window && !documentMode && !isPresto();
  4295. // In IE9+, we have access to composition events, but the data supplied
  4296. // by the native compositionend event may be incorrect. Japanese ideographic
  4297. // spaces, for instance (\u3000) are not recorded correctly.
  4298. var useFallbackCompositionData = ExecutionEnvironment.canUseDOM && (!canUseCompositionEvent || documentMode && documentMode > 8 && documentMode <= 11);
  4299. /**
  4300. * Opera <= 12 includes TextEvent in window, but does not fire
  4301. * text input events. Rely on keypress instead.
  4302. */
  4303. function isPresto() {
  4304. var opera = window.opera;
  4305. return typeof opera === 'object' && typeof opera.version === 'function' && parseInt(opera.version(), 10) <= 12;
  4306. }
  4307. var SPACEBAR_CODE = 32;
  4308. var SPACEBAR_CHAR = String.fromCharCode(SPACEBAR_CODE);
  4309. var topLevelTypes = EventConstants.topLevelTypes;
  4310. // Events and their corresponding property names.
  4311. var eventTypes = {
  4312. beforeInput: {
  4313. phasedRegistrationNames: {
  4314. bubbled: keyOf({ onBeforeInput: null }),
  4315. captured: keyOf({ onBeforeInputCapture: null })
  4316. },
  4317. dependencies: [topLevelTypes.topCompositionEnd, topLevelTypes.topKeyPress, topLevelTypes.topTextInput, topLevelTypes.topPaste]
  4318. },
  4319. compositionEnd: {
  4320. phasedRegistrationNames: {
  4321. bubbled: keyOf({ onCompositionEnd: null }),
  4322. captured: keyOf({ onCompositionEndCapture: null })
  4323. },
  4324. dependencies: [topLevelTypes.topBlur, topLevelTypes.topCompositionEnd, topLevelTypes.topKeyDown, topLevelTypes.topKeyPress, topLevelTypes.topKeyUp, topLevelTypes.topMouseDown]
  4325. },
  4326. compositionStart: {
  4327. phasedRegistrationNames: {
  4328. bubbled: keyOf({ onCompositionStart: null }),
  4329. captured: keyOf({ onCompositionStartCapture: null })
  4330. },
  4331. dependencies: [topLevelTypes.topBlur, topLevelTypes.topCompositionStart, topLevelTypes.topKeyDown, topLevelTypes.topKeyPress, topLevelTypes.topKeyUp, topLevelTypes.topMouseDown]
  4332. },
  4333. compositionUpdate: {
  4334. phasedRegistrationNames: {
  4335. bubbled: keyOf({ onCompositionUpdate: null }),
  4336. captured: keyOf({ onCompositionUpdateCapture: null })
  4337. },
  4338. dependencies: [topLevelTypes.topBlur, topLevelTypes.topCompositionUpdate, topLevelTypes.topKeyDown, topLevelTypes.topKeyPress, topLevelTypes.topKeyUp, topLevelTypes.topMouseDown]
  4339. }
  4340. };
  4341. // Track whether we've ever handled a keypress on the space key.
  4342. var hasSpaceKeypress = false;
  4343. /**
  4344. * Return whether a native keypress event is assumed to be a command.
  4345. * This is required because Firefox fires `keypress` events for key commands
  4346. * (cut, copy, select-all, etc.) even though no character is inserted.
  4347. */
  4348. function isKeypressCommand(nativeEvent) {
  4349. return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&
  4350. // ctrlKey && altKey is equivalent to AltGr, and is not a command.
  4351. !(nativeEvent.ctrlKey && nativeEvent.altKey);
  4352. }
  4353. /**
  4354. * Translate native top level events into event types.
  4355. *
  4356. * @param {string} topLevelType
  4357. * @return {object}
  4358. */
  4359. function getCompositionEventType(topLevelType) {
  4360. switch (topLevelType) {
  4361. case topLevelTypes.topCompositionStart:
  4362. return eventTypes.compositionStart;
  4363. case topLevelTypes.topCompositionEnd:
  4364. return eventTypes.compositionEnd;
  4365. case topLevelTypes.topCompositionUpdate:
  4366. return eventTypes.compositionUpdate;
  4367. }
  4368. }
  4369. /**
  4370. * Does our fallback best-guess model think this event signifies that
  4371. * composition has begun?
  4372. *
  4373. * @param {string} topLevelType
  4374. * @param {object} nativeEvent
  4375. * @return {boolean}
  4376. */
  4377. function isFallbackCompositionStart(topLevelType, nativeEvent) {
  4378. return topLevelType === topLevelTypes.topKeyDown && nativeEvent.keyCode === START_KEYCODE;
  4379. }
  4380. /**
  4381. * Does our fallback mode think that this event is the end of composition?
  4382. *
  4383. * @param {string} topLevelType
  4384. * @param {object} nativeEvent
  4385. * @return {boolean}
  4386. */
  4387. function isFallbackCompositionEnd(topLevelType, nativeEvent) {
  4388. switch (topLevelType) {
  4389. case topLevelTypes.topKeyUp:
  4390. // Command keys insert or clear IME input.
  4391. return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1;
  4392. case topLevelTypes.topKeyDown:
  4393. // Expect IME keyCode on each keydown. If we get any other
  4394. // code we must have exited earlier.
  4395. return nativeEvent.keyCode !== START_KEYCODE;
  4396. case topLevelTypes.topKeyPress:
  4397. case topLevelTypes.topMouseDown:
  4398. case topLevelTypes.topBlur:
  4399. // Events are not possible without cancelling IME.
  4400. return true;
  4401. default:
  4402. return false;
  4403. }
  4404. }
  4405. /**
  4406. * Google Input Tools provides composition data via a CustomEvent,
  4407. * with the `data` property populated in the `detail` object. If this
  4408. * is available on the event object, use it. If not, this is a plain
  4409. * composition event and we have nothing special to extract.
  4410. *
  4411. * @param {object} nativeEvent
  4412. * @return {?string}
  4413. */
  4414. function getDataFromCustomEvent(nativeEvent) {
  4415. var detail = nativeEvent.detail;
  4416. if (typeof detail === 'object' && 'data' in detail) {
  4417. return detail.data;
  4418. }
  4419. return null;
  4420. }
  4421. // Track the current IME composition fallback object, if any.
  4422. var currentComposition = null;
  4423. /**
  4424. * @return {?object} A SyntheticCompositionEvent.
  4425. */
  4426. function extractCompositionEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget) {
  4427. var eventType;
  4428. var fallbackData;
  4429. if (canUseCompositionEvent) {
  4430. eventType = getCompositionEventType(topLevelType);
  4431. } else if (!currentComposition) {
  4432. if (isFallbackCompositionStart(topLevelType, nativeEvent)) {
  4433. eventType = eventTypes.compositionStart;
  4434. }
  4435. } else if (isFallbackCompositionEnd(topLevelType, nativeEvent)) {
  4436. eventType = eventTypes.compositionEnd;
  4437. }
  4438. if (!eventType) {
  4439. return null;
  4440. }
  4441. if (useFallbackCompositionData) {
  4442. // The current composition is stored statically and must not be
  4443. // overwritten while composition continues.
  4444. if (!currentComposition && eventType === eventTypes.compositionStart) {
  4445. currentComposition = FallbackCompositionState.getPooled(nativeEventTarget);
  4446. } else if (eventType === eventTypes.compositionEnd) {
  4447. if (currentComposition) {
  4448. fallbackData = currentComposition.getData();
  4449. }
  4450. }
  4451. }
  4452. var event = SyntheticCompositionEvent.getPooled(eventType, targetInst, nativeEvent, nativeEventTarget);
  4453. if (fallbackData) {
  4454. // Inject data generated from fallback path into the synthetic event.
  4455. // This matches the property of native CompositionEventInterface.
  4456. event.data = fallbackData;
  4457. } else {
  4458. var customData = getDataFromCustomEvent(nativeEvent);
  4459. if (customData !== null) {
  4460. event.data = customData;
  4461. }
  4462. }
  4463. EventPropagators.accumulateTwoPhaseDispatches(event);
  4464. return event;
  4465. }
  4466. /**
  4467. * @param {string} topLevelType Record from `EventConstants`.
  4468. * @param {object} nativeEvent Native browser event.
  4469. * @return {?string} The string corresponding to this `beforeInput` event.
  4470. */
  4471. function getNativeBeforeInputChars(topLevelType, nativeEvent) {
  4472. switch (topLevelType) {
  4473. case topLevelTypes.topCompositionEnd:
  4474. return getDataFromCustomEvent(nativeEvent);
  4475. case topLevelTypes.topKeyPress:
  4476. /**
  4477. * If native `textInput` events are available, our goal is to make
  4478. * use of them. However, there is a special case: the spacebar key.
  4479. * In Webkit, preventing default on a spacebar `textInput` event
  4480. * cancels character insertion, but it *also* causes the browser
  4481. * to fall back to its default spacebar behavior of scrolling the
  4482. * page.
  4483. *
  4484. * Tracking at:
  4485. * https://code.google.com/p/chromium/issues/detail?id=355103
  4486. *
  4487. * To avoid this issue, use the keypress event as if no `textInput`
  4488. * event is available.
  4489. */
  4490. var which = nativeEvent.which;
  4491. if (which !== SPACEBAR_CODE) {
  4492. return null;
  4493. }
  4494. hasSpaceKeypress = true;
  4495. return SPACEBAR_CHAR;
  4496. case topLevelTypes.topTextInput:
  4497. // Record the characters to be added to the DOM.
  4498. var chars = nativeEvent.data;
  4499. // If it's a spacebar character, assume that we have already handled
  4500. // it at the keypress level and bail immediately. Android Chrome
  4501. // doesn't give us keycodes, so we need to blacklist it.
  4502. if (chars === SPACEBAR_CHAR && hasSpaceKeypress) {
  4503. return null;
  4504. }
  4505. return chars;
  4506. default:
  4507. // For other native event types, do nothing.
  4508. return null;
  4509. }
  4510. }
  4511. /**
  4512. * For browsers that do not provide the `textInput` event, extract the
  4513. * appropriate string to use for SyntheticInputEvent.
  4514. *
  4515. * @param {string} topLevelType Record from `EventConstants`.
  4516. * @param {object} nativeEvent Native browser event.
  4517. * @return {?string} The fallback string for this `beforeInput` event.
  4518. */
  4519. function getFallbackBeforeInputChars(topLevelType, nativeEvent) {
  4520. // If we are currently composing (IME) and using a fallback to do so,
  4521. // try to extract the composed characters from the fallback object.
  4522. if (currentComposition) {
  4523. if (topLevelType === topLevelTypes.topCompositionEnd || isFallbackCompositionEnd(topLevelType, nativeEvent)) {
  4524. var chars = currentComposition.getData();
  4525. FallbackCompositionState.release(currentComposition);
  4526. currentComposition = null;
  4527. return chars;
  4528. }
  4529. return null;
  4530. }
  4531. switch (topLevelType) {
  4532. case topLevelTypes.topPaste:
  4533. // If a paste event occurs after a keypress, throw out the input
  4534. // chars. Paste events should not lead to BeforeInput events.
  4535. return null;
  4536. case topLevelTypes.topKeyPress:
  4537. /**
  4538. * As of v27, Firefox may fire keypress events even when no character
  4539. * will be inserted. A few possibilities:
  4540. *
  4541. * - `which` is `0`. Arrow keys, Esc key, etc.
  4542. *
  4543. * - `which` is the pressed key code, but no char is available.
  4544. * Ex: 'AltGr + d` in Polish. There is no modified character for
  4545. * this key combination and no character is inserted into the
  4546. * document, but FF fires the keypress for char code `100` anyway.
  4547. * No `input` event will occur.
  4548. *
  4549. * - `which` is the pressed key code, but a command combination is
  4550. * being used. Ex: `Cmd+C`. No character is inserted, and no
  4551. * `input` event will occur.
  4552. */
  4553. if (nativeEvent.which && !isKeypressCommand(nativeEvent)) {
  4554. return String.fromCharCode(nativeEvent.which);
  4555. }
  4556. return null;
  4557. case topLevelTypes.topCompositionEnd:
  4558. return useFallbackCompositionData ? null : nativeEvent.data;
  4559. default:
  4560. return null;
  4561. }
  4562. }
  4563. /**
  4564. * Extract a SyntheticInputEvent for `beforeInput`, based on either native
  4565. * `textInput` or fallback behavior.
  4566. *
  4567. * @return {?object} A SyntheticInputEvent.
  4568. */
  4569. function extractBeforeInputEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget) {
  4570. var chars;
  4571. if (canUseTextInputEvent) {
  4572. chars = getNativeBeforeInputChars(topLevelType, nativeEvent);
  4573. } else {
  4574. chars = getFallbackBeforeInputChars(topLevelType, nativeEvent);
  4575. }
  4576. // If no characters are being inserted, no BeforeInput event should
  4577. // be fired.
  4578. if (!chars) {
  4579. return null;
  4580. }
  4581. var event = SyntheticInputEvent.getPooled(eventTypes.beforeInput, targetInst, nativeEvent, nativeEventTarget);
  4582. event.data = chars;
  4583. EventPropagators.accumulateTwoPhaseDispatches(event);
  4584. return event;
  4585. }
  4586. /**
  4587. * Create an `onBeforeInput` event to match
  4588. * http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105/#events-inputevents.
  4589. *
  4590. * This event plugin is based on the native `textInput` event
  4591. * available in Chrome, Safari, Opera, and IE. This event fires after
  4592. * `onKeyPress` and `onCompositionEnd`, but before `onInput`.
  4593. *
  4594. * `beforeInput` is spec'd but not implemented in any browsers, and
  4595. * the `input` event does not provide any useful information about what has
  4596. * actually been added, contrary to the spec. Thus, `textInput` is the best
  4597. * available event to identify the characters that have actually been inserted
  4598. * into the target node.
  4599. *
  4600. * This plugin is also responsible for emitting `composition` events, thus
  4601. * allowing us to share composition fallback code for both `beforeInput` and
  4602. * `composition` event types.
  4603. */
  4604. var BeforeInputEventPlugin = {
  4605. eventTypes: eventTypes,
  4606. extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
  4607. return [extractCompositionEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget), extractBeforeInputEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget)];
  4608. }
  4609. };
  4610. module.exports = BeforeInputEventPlugin;
  4611. /***/ },
  4612. /* 43 */
  4613. /***/ function(module, exports, __webpack_require__) {
  4614. /**
  4615. * Copyright 2013-present, Facebook, Inc.
  4616. * All rights reserved.
  4617. *
  4618. * This source code is licensed under the BSD-style license found in the
  4619. * LICENSE file in the root directory of this source tree. An additional grant
  4620. * of patent rights can be found in the PATENTS file in the same directory.
  4621. *
  4622. * @providesModule EventConstants
  4623. */
  4624. 'use strict';
  4625. var keyMirror = __webpack_require__(25);
  4626. var PropagationPhases = keyMirror({ bubbled: null, captured: null });
  4627. /**
  4628. * Types of raw signals from the browser caught at the top level.
  4629. */
  4630. var topLevelTypes = keyMirror({
  4631. topAbort: null,
  4632. topAnimationEnd: null,
  4633. topAnimationIteration: null,
  4634. topAnimationStart: null,
  4635. topBlur: null,
  4636. topCanPlay: null,
  4637. topCanPlayThrough: null,
  4638. topChange: null,
  4639. topClick: null,
  4640. topCompositionEnd: null,
  4641. topCompositionStart: null,
  4642. topCompositionUpdate: null,
  4643. topContextMenu: null,
  4644. topCopy: null,
  4645. topCut: null,
  4646. topDoubleClick: null,
  4647. topDrag: null,
  4648. topDragEnd: null,
  4649. topDragEnter: null,
  4650. topDragExit: null,
  4651. topDragLeave: null,
  4652. topDragOver: null,
  4653. topDragStart: null,
  4654. topDrop: null,
  4655. topDurationChange: null,
  4656. topEmptied: null,
  4657. topEncrypted: null,
  4658. topEnded: null,
  4659. topError: null,
  4660. topFocus: null,
  4661. topInput: null,
  4662. topInvalid: null,
  4663. topKeyDown: null,
  4664. topKeyPress: null,
  4665. topKeyUp: null,
  4666. topLoad: null,
  4667. topLoadedData: null,
  4668. topLoadedMetadata: null,
  4669. topLoadStart: null,
  4670. topMouseDown: null,
  4671. topMouseMove: null,
  4672. topMouseOut: null,
  4673. topMouseOver: null,
  4674. topMouseUp: null,
  4675. topPaste: null,
  4676. topPause: null,
  4677. topPlay: null,
  4678. topPlaying: null,
  4679. topProgress: null,
  4680. topRateChange: null,
  4681. topReset: null,
  4682. topScroll: null,
  4683. topSeeked: null,
  4684. topSeeking: null,
  4685. topSelectionChange: null,
  4686. topStalled: null,
  4687. topSubmit: null,
  4688. topSuspend: null,
  4689. topTextInput: null,
  4690. topTimeUpdate: null,
  4691. topTouchCancel: null,
  4692. topTouchEnd: null,
  4693. topTouchMove: null,
  4694. topTouchStart: null,
  4695. topTransitionEnd: null,
  4696. topVolumeChange: null,
  4697. topWaiting: null,
  4698. topWheel: null
  4699. });
  4700. var EventConstants = {
  4701. topLevelTypes: topLevelTypes,
  4702. PropagationPhases: PropagationPhases
  4703. };
  4704. module.exports = EventConstants;
  4705. /***/ },
  4706. /* 44 */
  4707. /***/ function(module, exports, __webpack_require__) {
  4708. /* WEBPACK VAR INJECTION */(function(process) {/**
  4709. * Copyright 2013-present, Facebook, Inc.
  4710. * All rights reserved.
  4711. *
  4712. * This source code is licensed under the BSD-style license found in the
  4713. * LICENSE file in the root directory of this source tree. An additional grant
  4714. * of patent rights can be found in the PATENTS file in the same directory.
  4715. *
  4716. * @providesModule EventPropagators
  4717. */
  4718. 'use strict';
  4719. var EventConstants = __webpack_require__(43);
  4720. var EventPluginHub = __webpack_require__(45);
  4721. var EventPluginUtils = __webpack_require__(47);
  4722. var accumulateInto = __webpack_require__(49);
  4723. var forEachAccumulated = __webpack_require__(50);
  4724. var warning = __webpack_require__(13);
  4725. var PropagationPhases = EventConstants.PropagationPhases;
  4726. var getListener = EventPluginHub.getListener;
  4727. /**
  4728. * Some event types have a notion of different registration names for different
  4729. * "phases" of propagation. This finds listeners by a given phase.
  4730. */
  4731. function listenerAtPhase(inst, event, propagationPhase) {
  4732. var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];
  4733. return getListener(inst, registrationName);
  4734. }
  4735. /**
  4736. * Tags a `SyntheticEvent` with dispatched listeners. Creating this function
  4737. * here, allows us to not have to bind or create functions for each event.
  4738. * Mutating the event's members allows us to not have to create a wrapping
  4739. * "dispatch" object that pairs the event with the listener.
  4740. */
  4741. function accumulateDirectionalDispatches(inst, upwards, event) {
  4742. if (process.env.NODE_ENV !== 'production') {
  4743. process.env.NODE_ENV !== 'production' ? warning(inst, 'Dispatching inst must not be null') : void 0;
  4744. }
  4745. var phase = upwards ? PropagationPhases.bubbled : PropagationPhases.captured;
  4746. var listener = listenerAtPhase(inst, event, phase);
  4747. if (listener) {
  4748. event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);
  4749. event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);
  4750. }
  4751. }
  4752. /**
  4753. * Collect dispatches (must be entirely collected before dispatching - see unit
  4754. * tests). Lazily allocate the array to conserve memory. We must loop through
  4755. * each event and perform the traversal for each one. We cannot perform a
  4756. * single traversal for the entire collection of events because each event may
  4757. * have a different target.
  4758. */
  4759. function accumulateTwoPhaseDispatchesSingle(event) {
  4760. if (event && event.dispatchConfig.phasedRegistrationNames) {
  4761. EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);
  4762. }
  4763. }
  4764. /**
  4765. * Same as `accumulateTwoPhaseDispatchesSingle`, but skips over the targetID.
  4766. */
  4767. function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {
  4768. if (event && event.dispatchConfig.phasedRegistrationNames) {
  4769. var targetInst = event._targetInst;
  4770. var parentInst = targetInst ? EventPluginUtils.getParentInstance(targetInst) : null;
  4771. EventPluginUtils.traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);
  4772. }
  4773. }
  4774. /**
  4775. * Accumulates without regard to direction, does not look for phased
  4776. * registration names. Same as `accumulateDirectDispatchesSingle` but without
  4777. * requiring that the `dispatchMarker` be the same as the dispatched ID.
  4778. */
  4779. function accumulateDispatches(inst, ignoredDirection, event) {
  4780. if (event && event.dispatchConfig.registrationName) {
  4781. var registrationName = event.dispatchConfig.registrationName;
  4782. var listener = getListener(inst, registrationName);
  4783. if (listener) {
  4784. event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);
  4785. event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);
  4786. }
  4787. }
  4788. }
  4789. /**
  4790. * Accumulates dispatches on an `SyntheticEvent`, but only for the
  4791. * `dispatchMarker`.
  4792. * @param {SyntheticEvent} event
  4793. */
  4794. function accumulateDirectDispatchesSingle(event) {
  4795. if (event && event.dispatchConfig.registrationName) {
  4796. accumulateDispatches(event._targetInst, null, event);
  4797. }
  4798. }
  4799. function accumulateTwoPhaseDispatches(events) {
  4800. forEachAccumulated(events, accumulateTwoPhaseDispatchesSingle);
  4801. }
  4802. function accumulateTwoPhaseDispatchesSkipTarget(events) {
  4803. forEachAccumulated(events, accumulateTwoPhaseDispatchesSingleSkipTarget);
  4804. }
  4805. function accumulateEnterLeaveDispatches(leave, enter, from, to) {
  4806. EventPluginUtils.traverseEnterLeave(from, to, accumulateDispatches, leave, enter);
  4807. }
  4808. function accumulateDirectDispatches(events) {
  4809. forEachAccumulated(events, accumulateDirectDispatchesSingle);
  4810. }
  4811. /**
  4812. * A small set of propagation patterns, each of which will accept a small amount
  4813. * of information, and generate a set of "dispatch ready event objects" - which
  4814. * are sets of events that have already been annotated with a set of dispatched
  4815. * listener functions/ids. The API is designed this way to discourage these
  4816. * propagation strategies from actually executing the dispatches, since we
  4817. * always want to collect the entire set of dispatches before executing event a
  4818. * single one.
  4819. *
  4820. * @constructor EventPropagators
  4821. */
  4822. var EventPropagators = {
  4823. accumulateTwoPhaseDispatches: accumulateTwoPhaseDispatches,
  4824. accumulateTwoPhaseDispatchesSkipTarget: accumulateTwoPhaseDispatchesSkipTarget,
  4825. accumulateDirectDispatches: accumulateDirectDispatches,
  4826. accumulateEnterLeaveDispatches: accumulateEnterLeaveDispatches
  4827. };
  4828. module.exports = EventPropagators;
  4829. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  4830. /***/ },
  4831. /* 45 */
  4832. /***/ function(module, exports, __webpack_require__) {
  4833. /* WEBPACK VAR INJECTION */(function(process) {/**
  4834. * Copyright 2013-present, Facebook, Inc.
  4835. * All rights reserved.
  4836. *
  4837. * This source code is licensed under the BSD-style license found in the
  4838. * LICENSE file in the root directory of this source tree. An additional grant
  4839. * of patent rights can be found in the PATENTS file in the same directory.
  4840. *
  4841. * @providesModule EventPluginHub
  4842. */
  4843. 'use strict';
  4844. var _prodInvariant = __webpack_require__(9);
  4845. var EventPluginRegistry = __webpack_require__(46);
  4846. var EventPluginUtils = __webpack_require__(47);
  4847. var ReactErrorUtils = __webpack_require__(48);
  4848. var accumulateInto = __webpack_require__(49);
  4849. var forEachAccumulated = __webpack_require__(50);
  4850. var invariant = __webpack_require__(10);
  4851. /**
  4852. * Internal store for event listeners
  4853. */
  4854. var listenerBank = {};
  4855. /**
  4856. * Internal queue of events that have accumulated their dispatches and are
  4857. * waiting to have their dispatches executed.
  4858. */
  4859. var eventQueue = null;
  4860. /**
  4861. * Dispatches an event and releases it back into the pool, unless persistent.
  4862. *
  4863. * @param {?object} event Synthetic event to be dispatched.
  4864. * @param {boolean} simulated If the event is simulated (changes exn behavior)
  4865. * @private
  4866. */
  4867. var executeDispatchesAndRelease = function (event, simulated) {
  4868. if (event) {
  4869. EventPluginUtils.executeDispatchesInOrder(event, simulated);
  4870. if (!event.isPersistent()) {
  4871. event.constructor.release(event);
  4872. }
  4873. }
  4874. };
  4875. var executeDispatchesAndReleaseSimulated = function (e) {
  4876. return executeDispatchesAndRelease(e, true);
  4877. };
  4878. var executeDispatchesAndReleaseTopLevel = function (e) {
  4879. return executeDispatchesAndRelease(e, false);
  4880. };
  4881. var getDictionaryKey = function (inst) {
  4882. // Prevents V8 performance issue:
  4883. // https://github.com/facebook/react/pull/7232
  4884. return '.' + inst._rootNodeID;
  4885. };
  4886. /**
  4887. * This is a unified interface for event plugins to be installed and configured.
  4888. *
  4889. * Event plugins can implement the following properties:
  4890. *
  4891. * `extractEvents` {function(string, DOMEventTarget, string, object): *}
  4892. * Required. When a top-level event is fired, this method is expected to
  4893. * extract synthetic events that will in turn be queued and dispatched.
  4894. *
  4895. * `eventTypes` {object}
  4896. * Optional, plugins that fire events must publish a mapping of registration
  4897. * names that are used to register listeners. Values of this mapping must
  4898. * be objects that contain `registrationName` or `phasedRegistrationNames`.
  4899. *
  4900. * `executeDispatch` {function(object, function, string)}
  4901. * Optional, allows plugins to override how an event gets dispatched. By
  4902. * default, the listener is simply invoked.
  4903. *
  4904. * Each plugin that is injected into `EventsPluginHub` is immediately operable.
  4905. *
  4906. * @public
  4907. */
  4908. var EventPluginHub = {
  4909. /**
  4910. * Methods for injecting dependencies.
  4911. */
  4912. injection: {
  4913. /**
  4914. * @param {array} InjectedEventPluginOrder
  4915. * @public
  4916. */
  4917. injectEventPluginOrder: EventPluginRegistry.injectEventPluginOrder,
  4918. /**
  4919. * @param {object} injectedNamesToPlugins Map from names to plugin modules.
  4920. */
  4921. injectEventPluginsByName: EventPluginRegistry.injectEventPluginsByName
  4922. },
  4923. /**
  4924. * Stores `listener` at `listenerBank[registrationName][key]`. Is idempotent.
  4925. *
  4926. * @param {object} inst The instance, which is the source of events.
  4927. * @param {string} registrationName Name of listener (e.g. `onClick`).
  4928. * @param {function} listener The callback to store.
  4929. */
  4930. putListener: function (inst, registrationName, listener) {
  4931. !(typeof listener === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected %s listener to be a function, instead got type %s', registrationName, typeof listener) : _prodInvariant('94', registrationName, typeof listener) : void 0;
  4932. var key = getDictionaryKey(inst);
  4933. var bankForRegistrationName = listenerBank[registrationName] || (listenerBank[registrationName] = {});
  4934. bankForRegistrationName[key] = listener;
  4935. var PluginModule = EventPluginRegistry.registrationNameModules[registrationName];
  4936. if (PluginModule && PluginModule.didPutListener) {
  4937. PluginModule.didPutListener(inst, registrationName, listener);
  4938. }
  4939. },
  4940. /**
  4941. * @param {object} inst The instance, which is the source of events.
  4942. * @param {string} registrationName Name of listener (e.g. `onClick`).
  4943. * @return {?function} The stored callback.
  4944. */
  4945. getListener: function (inst, registrationName) {
  4946. var bankForRegistrationName = listenerBank[registrationName];
  4947. var key = getDictionaryKey(inst);
  4948. return bankForRegistrationName && bankForRegistrationName[key];
  4949. },
  4950. /**
  4951. * Deletes a listener from the registration bank.
  4952. *
  4953. * @param {object} inst The instance, which is the source of events.
  4954. * @param {string} registrationName Name of listener (e.g. `onClick`).
  4955. */
  4956. deleteListener: function (inst, registrationName) {
  4957. var PluginModule = EventPluginRegistry.registrationNameModules[registrationName];
  4958. if (PluginModule && PluginModule.willDeleteListener) {
  4959. PluginModule.willDeleteListener(inst, registrationName);
  4960. }
  4961. var bankForRegistrationName = listenerBank[registrationName];
  4962. // TODO: This should never be null -- when is it?
  4963. if (bankForRegistrationName) {
  4964. var key = getDictionaryKey(inst);
  4965. delete bankForRegistrationName[key];
  4966. }
  4967. },
  4968. /**
  4969. * Deletes all listeners for the DOM element with the supplied ID.
  4970. *
  4971. * @param {object} inst The instance, which is the source of events.
  4972. */
  4973. deleteAllListeners: function (inst) {
  4974. var key = getDictionaryKey(inst);
  4975. for (var registrationName in listenerBank) {
  4976. if (!listenerBank.hasOwnProperty(registrationName)) {
  4977. continue;
  4978. }
  4979. if (!listenerBank[registrationName][key]) {
  4980. continue;
  4981. }
  4982. var PluginModule = EventPluginRegistry.registrationNameModules[registrationName];
  4983. if (PluginModule && PluginModule.willDeleteListener) {
  4984. PluginModule.willDeleteListener(inst, registrationName);
  4985. }
  4986. delete listenerBank[registrationName][key];
  4987. }
  4988. },
  4989. /**
  4990. * Allows registered plugins an opportunity to extract events from top-level
  4991. * native browser events.
  4992. *
  4993. * @return {*} An accumulation of synthetic events.
  4994. * @internal
  4995. */
  4996. extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
  4997. var events;
  4998. var plugins = EventPluginRegistry.plugins;
  4999. for (var i = 0; i < plugins.length; i++) {
  5000. // Not every plugin in the ordering may be loaded at runtime.
  5001. var possiblePlugin = plugins[i];
  5002. if (possiblePlugin) {
  5003. var extractedEvents = possiblePlugin.extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget);
  5004. if (extractedEvents) {
  5005. events = accumulateInto(events, extractedEvents);
  5006. }
  5007. }
  5008. }
  5009. return events;
  5010. },
  5011. /**
  5012. * Enqueues a synthetic event that should be dispatched when
  5013. * `processEventQueue` is invoked.
  5014. *
  5015. * @param {*} events An accumulation of synthetic events.
  5016. * @internal
  5017. */
  5018. enqueueEvents: function (events) {
  5019. if (events) {
  5020. eventQueue = accumulateInto(eventQueue, events);
  5021. }
  5022. },
  5023. /**
  5024. * Dispatches all synthetic events on the event queue.
  5025. *
  5026. * @internal
  5027. */
  5028. processEventQueue: function (simulated) {
  5029. // Set `eventQueue` to null before processing it so that we can tell if more
  5030. // events get enqueued while processing.
  5031. var processingEventQueue = eventQueue;
  5032. eventQueue = null;
  5033. if (simulated) {
  5034. forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseSimulated);
  5035. } else {
  5036. forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseTopLevel);
  5037. }
  5038. !!eventQueue ? process.env.NODE_ENV !== 'production' ? invariant(false, 'processEventQueue(): Additional events were enqueued while processing an event queue. Support for this has not yet been implemented.') : _prodInvariant('95') : void 0;
  5039. // This would be a good time to rethrow if any of the event handlers threw.
  5040. ReactErrorUtils.rethrowCaughtError();
  5041. },
  5042. /**
  5043. * These are needed for tests only. Do not use!
  5044. */
  5045. __purge: function () {
  5046. listenerBank = {};
  5047. },
  5048. __getListenerBank: function () {
  5049. return listenerBank;
  5050. }
  5051. };
  5052. module.exports = EventPluginHub;
  5053. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  5054. /***/ },
  5055. /* 46 */
  5056. /***/ function(module, exports, __webpack_require__) {
  5057. /* WEBPACK VAR INJECTION */(function(process) {/**
  5058. * Copyright 2013-present, Facebook, Inc.
  5059. * All rights reserved.
  5060. *
  5061. * This source code is licensed under the BSD-style license found in the
  5062. * LICENSE file in the root directory of this source tree. An additional grant
  5063. * of patent rights can be found in the PATENTS file in the same directory.
  5064. *
  5065. * @providesModule EventPluginRegistry
  5066. */
  5067. 'use strict';
  5068. var _prodInvariant = __webpack_require__(9);
  5069. var invariant = __webpack_require__(10);
  5070. /**
  5071. * Injectable ordering of event plugins.
  5072. */
  5073. var EventPluginOrder = null;
  5074. /**
  5075. * Injectable mapping from names to event plugin modules.
  5076. */
  5077. var namesToPlugins = {};
  5078. /**
  5079. * Recomputes the plugin list using the injected plugins and plugin ordering.
  5080. *
  5081. * @private
  5082. */
  5083. function recomputePluginOrdering() {
  5084. if (!EventPluginOrder) {
  5085. // Wait until an `EventPluginOrder` is injected.
  5086. return;
  5087. }
  5088. for (var pluginName in namesToPlugins) {
  5089. var PluginModule = namesToPlugins[pluginName];
  5090. var pluginIndex = EventPluginOrder.indexOf(pluginName);
  5091. !(pluginIndex > -1) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : _prodInvariant('96', pluginName) : void 0;
  5092. if (EventPluginRegistry.plugins[pluginIndex]) {
  5093. continue;
  5094. }
  5095. !PluginModule.extractEvents ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : _prodInvariant('97', pluginName) : void 0;
  5096. EventPluginRegistry.plugins[pluginIndex] = PluginModule;
  5097. var publishedEvents = PluginModule.eventTypes;
  5098. for (var eventName in publishedEvents) {
  5099. !publishEventForPlugin(publishedEvents[eventName], PluginModule, eventName) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : _prodInvariant('98', eventName, pluginName) : void 0;
  5100. }
  5101. }
  5102. }
  5103. /**
  5104. * Publishes an event so that it can be dispatched by the supplied plugin.
  5105. *
  5106. * @param {object} dispatchConfig Dispatch configuration for the event.
  5107. * @param {object} PluginModule Plugin publishing the event.
  5108. * @return {boolean} True if the event was successfully published.
  5109. * @private
  5110. */
  5111. function publishEventForPlugin(dispatchConfig, PluginModule, eventName) {
  5112. !!EventPluginRegistry.eventNameDispatchConfigs.hasOwnProperty(eventName) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginHub: More than one plugin attempted to publish the same event name, `%s`.', eventName) : _prodInvariant('99', eventName) : void 0;
  5113. EventPluginRegistry.eventNameDispatchConfigs[eventName] = dispatchConfig;
  5114. var phasedRegistrationNames = dispatchConfig.phasedRegistrationNames;
  5115. if (phasedRegistrationNames) {
  5116. for (var phaseName in phasedRegistrationNames) {
  5117. if (phasedRegistrationNames.hasOwnProperty(phaseName)) {
  5118. var phasedRegistrationName = phasedRegistrationNames[phaseName];
  5119. publishRegistrationName(phasedRegistrationName, PluginModule, eventName);
  5120. }
  5121. }
  5122. return true;
  5123. } else if (dispatchConfig.registrationName) {
  5124. publishRegistrationName(dispatchConfig.registrationName, PluginModule, eventName);
  5125. return true;
  5126. }
  5127. return false;
  5128. }
  5129. /**
  5130. * Publishes a registration name that is used to identify dispatched events and
  5131. * can be used with `EventPluginHub.putListener` to register listeners.
  5132. *
  5133. * @param {string} registrationName Registration name to add.
  5134. * @param {object} PluginModule Plugin publishing the event.
  5135. * @private
  5136. */
  5137. function publishRegistrationName(registrationName, PluginModule, eventName) {
  5138. !!EventPluginRegistry.registrationNameModules[registrationName] ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginHub: More than one plugin attempted to publish the same registration name, `%s`.', registrationName) : _prodInvariant('100', registrationName) : void 0;
  5139. EventPluginRegistry.registrationNameModules[registrationName] = PluginModule;
  5140. EventPluginRegistry.registrationNameDependencies[registrationName] = PluginModule.eventTypes[eventName].dependencies;
  5141. if (process.env.NODE_ENV !== 'production') {
  5142. var lowerCasedName = registrationName.toLowerCase();
  5143. EventPluginRegistry.possibleRegistrationNames[lowerCasedName] = registrationName;
  5144. if (registrationName === 'onDoubleClick') {
  5145. EventPluginRegistry.possibleRegistrationNames.ondblclick = registrationName;
  5146. }
  5147. }
  5148. }
  5149. /**
  5150. * Registers plugins so that they can extract and dispatch events.
  5151. *
  5152. * @see {EventPluginHub}
  5153. */
  5154. var EventPluginRegistry = {
  5155. /**
  5156. * Ordered list of injected plugins.
  5157. */
  5158. plugins: [],
  5159. /**
  5160. * Mapping from event name to dispatch config
  5161. */
  5162. eventNameDispatchConfigs: {},
  5163. /**
  5164. * Mapping from registration name to plugin module
  5165. */
  5166. registrationNameModules: {},
  5167. /**
  5168. * Mapping from registration name to event name
  5169. */
  5170. registrationNameDependencies: {},
  5171. /**
  5172. * Mapping from lowercase registration names to the properly cased version,
  5173. * used to warn in the case of missing event handlers. Available
  5174. * only in __DEV__.
  5175. * @type {Object}
  5176. */
  5177. possibleRegistrationNames: process.env.NODE_ENV !== 'production' ? {} : null,
  5178. /**
  5179. * Injects an ordering of plugins (by plugin name). This allows the ordering
  5180. * to be decoupled from injection of the actual plugins so that ordering is
  5181. * always deterministic regardless of packaging, on-the-fly injection, etc.
  5182. *
  5183. * @param {array} InjectedEventPluginOrder
  5184. * @internal
  5185. * @see {EventPluginHub.injection.injectEventPluginOrder}
  5186. */
  5187. injectEventPluginOrder: function (InjectedEventPluginOrder) {
  5188. !!EventPluginOrder ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginRegistry: Cannot inject event plugin ordering more than once. You are likely trying to load more than one copy of React.') : _prodInvariant('101') : void 0;
  5189. // Clone the ordering so it cannot be dynamically mutated.
  5190. EventPluginOrder = Array.prototype.slice.call(InjectedEventPluginOrder);
  5191. recomputePluginOrdering();
  5192. },
  5193. /**
  5194. * Injects plugins to be used by `EventPluginHub`. The plugin names must be
  5195. * in the ordering injected by `injectEventPluginOrder`.
  5196. *
  5197. * Plugins can be injected as part of page initialization or on-the-fly.
  5198. *
  5199. * @param {object} injectedNamesToPlugins Map from names to plugin modules.
  5200. * @internal
  5201. * @see {EventPluginHub.injection.injectEventPluginsByName}
  5202. */
  5203. injectEventPluginsByName: function (injectedNamesToPlugins) {
  5204. var isOrderingDirty = false;
  5205. for (var pluginName in injectedNamesToPlugins) {
  5206. if (!injectedNamesToPlugins.hasOwnProperty(pluginName)) {
  5207. continue;
  5208. }
  5209. var PluginModule = injectedNamesToPlugins[pluginName];
  5210. if (!namesToPlugins.hasOwnProperty(pluginName) || namesToPlugins[pluginName] !== PluginModule) {
  5211. !!namesToPlugins[pluginName] ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginRegistry: Cannot inject two different event plugins using the same name, `%s`.', pluginName) : _prodInvariant('102', pluginName) : void 0;
  5212. namesToPlugins[pluginName] = PluginModule;
  5213. isOrderingDirty = true;
  5214. }
  5215. }
  5216. if (isOrderingDirty) {
  5217. recomputePluginOrdering();
  5218. }
  5219. },
  5220. /**
  5221. * Looks up the plugin for the supplied event.
  5222. *
  5223. * @param {object} event A synthetic event.
  5224. * @return {?object} The plugin that created the supplied event.
  5225. * @internal
  5226. */
  5227. getPluginModuleForEvent: function (event) {
  5228. var dispatchConfig = event.dispatchConfig;
  5229. if (dispatchConfig.registrationName) {
  5230. return EventPluginRegistry.registrationNameModules[dispatchConfig.registrationName] || null;
  5231. }
  5232. for (var phase in dispatchConfig.phasedRegistrationNames) {
  5233. if (!dispatchConfig.phasedRegistrationNames.hasOwnProperty(phase)) {
  5234. continue;
  5235. }
  5236. var PluginModule = EventPluginRegistry.registrationNameModules[dispatchConfig.phasedRegistrationNames[phase]];
  5237. if (PluginModule) {
  5238. return PluginModule;
  5239. }
  5240. }
  5241. return null;
  5242. },
  5243. /**
  5244. * Exposed for unit testing.
  5245. * @private
  5246. */
  5247. _resetEventPlugins: function () {
  5248. EventPluginOrder = null;
  5249. for (var pluginName in namesToPlugins) {
  5250. if (namesToPlugins.hasOwnProperty(pluginName)) {
  5251. delete namesToPlugins[pluginName];
  5252. }
  5253. }
  5254. EventPluginRegistry.plugins.length = 0;
  5255. var eventNameDispatchConfigs = EventPluginRegistry.eventNameDispatchConfigs;
  5256. for (var eventName in eventNameDispatchConfigs) {
  5257. if (eventNameDispatchConfigs.hasOwnProperty(eventName)) {
  5258. delete eventNameDispatchConfigs[eventName];
  5259. }
  5260. }
  5261. var registrationNameModules = EventPluginRegistry.registrationNameModules;
  5262. for (var registrationName in registrationNameModules) {
  5263. if (registrationNameModules.hasOwnProperty(registrationName)) {
  5264. delete registrationNameModules[registrationName];
  5265. }
  5266. }
  5267. if (process.env.NODE_ENV !== 'production') {
  5268. var possibleRegistrationNames = EventPluginRegistry.possibleRegistrationNames;
  5269. for (var lowerCasedName in possibleRegistrationNames) {
  5270. if (possibleRegistrationNames.hasOwnProperty(lowerCasedName)) {
  5271. delete possibleRegistrationNames[lowerCasedName];
  5272. }
  5273. }
  5274. }
  5275. }
  5276. };
  5277. module.exports = EventPluginRegistry;
  5278. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  5279. /***/ },
  5280. /* 47 */
  5281. /***/ function(module, exports, __webpack_require__) {
  5282. /* WEBPACK VAR INJECTION */(function(process) {/**
  5283. * Copyright 2013-present, Facebook, Inc.
  5284. * All rights reserved.
  5285. *
  5286. * This source code is licensed under the BSD-style license found in the
  5287. * LICENSE file in the root directory of this source tree. An additional grant
  5288. * of patent rights can be found in the PATENTS file in the same directory.
  5289. *
  5290. * @providesModule EventPluginUtils
  5291. */
  5292. 'use strict';
  5293. var _prodInvariant = __webpack_require__(9);
  5294. var EventConstants = __webpack_require__(43);
  5295. var ReactErrorUtils = __webpack_require__(48);
  5296. var invariant = __webpack_require__(10);
  5297. var warning = __webpack_require__(13);
  5298. /**
  5299. * Injected dependencies:
  5300. */
  5301. /**
  5302. * - `ComponentTree`: [required] Module that can convert between React instances
  5303. * and actual node references.
  5304. */
  5305. var ComponentTree;
  5306. var TreeTraversal;
  5307. var injection = {
  5308. injectComponentTree: function (Injected) {
  5309. ComponentTree = Injected;
  5310. if (process.env.NODE_ENV !== 'production') {
  5311. process.env.NODE_ENV !== 'production' ? warning(Injected && Injected.getNodeFromInstance && Injected.getInstanceFromNode, 'EventPluginUtils.injection.injectComponentTree(...): Injected ' + 'module is missing getNodeFromInstance or getInstanceFromNode.') : void 0;
  5312. }
  5313. },
  5314. injectTreeTraversal: function (Injected) {
  5315. TreeTraversal = Injected;
  5316. if (process.env.NODE_ENV !== 'production') {
  5317. process.env.NODE_ENV !== 'production' ? warning(Injected && Injected.isAncestor && Injected.getLowestCommonAncestor, 'EventPluginUtils.injection.injectTreeTraversal(...): Injected ' + 'module is missing isAncestor or getLowestCommonAncestor.') : void 0;
  5318. }
  5319. }
  5320. };
  5321. var topLevelTypes = EventConstants.topLevelTypes;
  5322. function isEndish(topLevelType) {
  5323. return topLevelType === topLevelTypes.topMouseUp || topLevelType === topLevelTypes.topTouchEnd || topLevelType === topLevelTypes.topTouchCancel;
  5324. }
  5325. function isMoveish(topLevelType) {
  5326. return topLevelType === topLevelTypes.topMouseMove || topLevelType === topLevelTypes.topTouchMove;
  5327. }
  5328. function isStartish(topLevelType) {
  5329. return topLevelType === topLevelTypes.topMouseDown || topLevelType === topLevelTypes.topTouchStart;
  5330. }
  5331. var validateEventDispatches;
  5332. if (process.env.NODE_ENV !== 'production') {
  5333. validateEventDispatches = function (event) {
  5334. var dispatchListeners = event._dispatchListeners;
  5335. var dispatchInstances = event._dispatchInstances;
  5336. var listenersIsArr = Array.isArray(dispatchListeners);
  5337. var listenersLen = listenersIsArr ? dispatchListeners.length : dispatchListeners ? 1 : 0;
  5338. var instancesIsArr = Array.isArray(dispatchInstances);
  5339. var instancesLen = instancesIsArr ? dispatchInstances.length : dispatchInstances ? 1 : 0;
  5340. process.env.NODE_ENV !== 'production' ? warning(instancesIsArr === listenersIsArr && instancesLen === listenersLen, 'EventPluginUtils: Invalid `event`.') : void 0;
  5341. };
  5342. }
  5343. /**
  5344. * Dispatch the event to the listener.
  5345. * @param {SyntheticEvent} event SyntheticEvent to handle
  5346. * @param {boolean} simulated If the event is simulated (changes exn behavior)
  5347. * @param {function} listener Application-level callback
  5348. * @param {*} inst Internal component instance
  5349. */
  5350. function executeDispatch(event, simulated, listener, inst) {
  5351. var type = event.type || 'unknown-event';
  5352. event.currentTarget = EventPluginUtils.getNodeFromInstance(inst);
  5353. if (simulated) {
  5354. ReactErrorUtils.invokeGuardedCallbackWithCatch(type, listener, event);
  5355. } else {
  5356. ReactErrorUtils.invokeGuardedCallback(type, listener, event);
  5357. }
  5358. event.currentTarget = null;
  5359. }
  5360. /**
  5361. * Standard/simple iteration through an event's collected dispatches.
  5362. */
  5363. function executeDispatchesInOrder(event, simulated) {
  5364. var dispatchListeners = event._dispatchListeners;
  5365. var dispatchInstances = event._dispatchInstances;
  5366. if (process.env.NODE_ENV !== 'production') {
  5367. validateEventDispatches(event);
  5368. }
  5369. if (Array.isArray(dispatchListeners)) {
  5370. for (var i = 0; i < dispatchListeners.length; i++) {
  5371. if (event.isPropagationStopped()) {
  5372. break;
  5373. }
  5374. // Listeners and Instances are two parallel arrays that are always in sync.
  5375. executeDispatch(event, simulated, dispatchListeners[i], dispatchInstances[i]);
  5376. }
  5377. } else if (dispatchListeners) {
  5378. executeDispatch(event, simulated, dispatchListeners, dispatchInstances);
  5379. }
  5380. event._dispatchListeners = null;
  5381. event._dispatchInstances = null;
  5382. }
  5383. /**
  5384. * Standard/simple iteration through an event's collected dispatches, but stops
  5385. * at the first dispatch execution returning true, and returns that id.
  5386. *
  5387. * @return {?string} id of the first dispatch execution who's listener returns
  5388. * true, or null if no listener returned true.
  5389. */
  5390. function executeDispatchesInOrderStopAtTrueImpl(event) {
  5391. var dispatchListeners = event._dispatchListeners;
  5392. var dispatchInstances = event._dispatchInstances;
  5393. if (process.env.NODE_ENV !== 'production') {
  5394. validateEventDispatches(event);
  5395. }
  5396. if (Array.isArray(dispatchListeners)) {
  5397. for (var i = 0; i < dispatchListeners.length; i++) {
  5398. if (event.isPropagationStopped()) {
  5399. break;
  5400. }
  5401. // Listeners and Instances are two parallel arrays that are always in sync.
  5402. if (dispatchListeners[i](event, dispatchInstances[i])) {
  5403. return dispatchInstances[i];
  5404. }
  5405. }
  5406. } else if (dispatchListeners) {
  5407. if (dispatchListeners(event, dispatchInstances)) {
  5408. return dispatchInstances;
  5409. }
  5410. }
  5411. return null;
  5412. }
  5413. /**
  5414. * @see executeDispatchesInOrderStopAtTrueImpl
  5415. */
  5416. function executeDispatchesInOrderStopAtTrue(event) {
  5417. var ret = executeDispatchesInOrderStopAtTrueImpl(event);
  5418. event._dispatchInstances = null;
  5419. event._dispatchListeners = null;
  5420. return ret;
  5421. }
  5422. /**
  5423. * Execution of a "direct" dispatch - there must be at most one dispatch
  5424. * accumulated on the event or it is considered an error. It doesn't really make
  5425. * sense for an event with multiple dispatches (bubbled) to keep track of the
  5426. * return values at each dispatch execution, but it does tend to make sense when
  5427. * dealing with "direct" dispatches.
  5428. *
  5429. * @return {*} The return value of executing the single dispatch.
  5430. */
  5431. function executeDirectDispatch(event) {
  5432. if (process.env.NODE_ENV !== 'production') {
  5433. validateEventDispatches(event);
  5434. }
  5435. var dispatchListener = event._dispatchListeners;
  5436. var dispatchInstance = event._dispatchInstances;
  5437. !!Array.isArray(dispatchListener) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'executeDirectDispatch(...): Invalid `event`.') : _prodInvariant('103') : void 0;
  5438. event.currentTarget = dispatchListener ? EventPluginUtils.getNodeFromInstance(dispatchInstance) : null;
  5439. var res = dispatchListener ? dispatchListener(event) : null;
  5440. event.currentTarget = null;
  5441. event._dispatchListeners = null;
  5442. event._dispatchInstances = null;
  5443. return res;
  5444. }
  5445. /**
  5446. * @param {SyntheticEvent} event
  5447. * @return {boolean} True iff number of dispatches accumulated is greater than 0.
  5448. */
  5449. function hasDispatches(event) {
  5450. return !!event._dispatchListeners;
  5451. }
  5452. /**
  5453. * General utilities that are useful in creating custom Event Plugins.
  5454. */
  5455. var EventPluginUtils = {
  5456. isEndish: isEndish,
  5457. isMoveish: isMoveish,
  5458. isStartish: isStartish,
  5459. executeDirectDispatch: executeDirectDispatch,
  5460. executeDispatchesInOrder: executeDispatchesInOrder,
  5461. executeDispatchesInOrderStopAtTrue: executeDispatchesInOrderStopAtTrue,
  5462. hasDispatches: hasDispatches,
  5463. getInstanceFromNode: function (node) {
  5464. return ComponentTree.getInstanceFromNode(node);
  5465. },
  5466. getNodeFromInstance: function (node) {
  5467. return ComponentTree.getNodeFromInstance(node);
  5468. },
  5469. isAncestor: function (a, b) {
  5470. return TreeTraversal.isAncestor(a, b);
  5471. },
  5472. getLowestCommonAncestor: function (a, b) {
  5473. return TreeTraversal.getLowestCommonAncestor(a, b);
  5474. },
  5475. getParentInstance: function (inst) {
  5476. return TreeTraversal.getParentInstance(inst);
  5477. },
  5478. traverseTwoPhase: function (target, fn, arg) {
  5479. return TreeTraversal.traverseTwoPhase(target, fn, arg);
  5480. },
  5481. traverseEnterLeave: function (from, to, fn, argFrom, argTo) {
  5482. return TreeTraversal.traverseEnterLeave(from, to, fn, argFrom, argTo);
  5483. },
  5484. injection: injection
  5485. };
  5486. module.exports = EventPluginUtils;
  5487. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  5488. /***/ },
  5489. /* 48 */
  5490. /***/ function(module, exports, __webpack_require__) {
  5491. /* WEBPACK VAR INJECTION */(function(process) {/**
  5492. * Copyright 2013-present, Facebook, Inc.
  5493. * All rights reserved.
  5494. *
  5495. * This source code is licensed under the BSD-style license found in the
  5496. * LICENSE file in the root directory of this source tree. An additional grant
  5497. * of patent rights can be found in the PATENTS file in the same directory.
  5498. *
  5499. * @providesModule ReactErrorUtils
  5500. */
  5501. 'use strict';
  5502. var caughtError = null;
  5503. /**
  5504. * Call a function while guarding against errors that happens within it.
  5505. *
  5506. * @param {?String} name of the guard to use for logging or debugging
  5507. * @param {Function} func The function to invoke
  5508. * @param {*} a First argument
  5509. * @param {*} b Second argument
  5510. */
  5511. function invokeGuardedCallback(name, func, a, b) {
  5512. try {
  5513. return func(a, b);
  5514. } catch (x) {
  5515. if (caughtError === null) {
  5516. caughtError = x;
  5517. }
  5518. return undefined;
  5519. }
  5520. }
  5521. var ReactErrorUtils = {
  5522. invokeGuardedCallback: invokeGuardedCallback,
  5523. /**
  5524. * Invoked by ReactTestUtils.Simulate so that any errors thrown by the event
  5525. * handler are sure to be rethrown by rethrowCaughtError.
  5526. */
  5527. invokeGuardedCallbackWithCatch: invokeGuardedCallback,
  5528. /**
  5529. * During execution of guarded functions we will capture the first error which
  5530. * we will rethrow to be handled by the top level error handler.
  5531. */
  5532. rethrowCaughtError: function () {
  5533. if (caughtError) {
  5534. var error = caughtError;
  5535. caughtError = null;
  5536. throw error;
  5537. }
  5538. }
  5539. };
  5540. if (process.env.NODE_ENV !== 'production') {
  5541. /**
  5542. * To help development we can get better devtools integration by simulating a
  5543. * real browser event.
  5544. */
  5545. if (typeof window !== 'undefined' && typeof window.dispatchEvent === 'function' && typeof document !== 'undefined' && typeof document.createEvent === 'function') {
  5546. var fakeNode = document.createElement('react');
  5547. ReactErrorUtils.invokeGuardedCallback = function (name, func, a, b) {
  5548. var boundFunc = func.bind(null, a, b);
  5549. var evtType = 'react-' + name;
  5550. fakeNode.addEventListener(evtType, boundFunc, false);
  5551. var evt = document.createEvent('Event');
  5552. evt.initEvent(evtType, false, false);
  5553. fakeNode.dispatchEvent(evt);
  5554. fakeNode.removeEventListener(evtType, boundFunc, false);
  5555. };
  5556. }
  5557. }
  5558. module.exports = ReactErrorUtils;
  5559. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  5560. /***/ },
  5561. /* 49 */
  5562. /***/ function(module, exports, __webpack_require__) {
  5563. /* WEBPACK VAR INJECTION */(function(process) {/**
  5564. * Copyright 2014-present, Facebook, Inc.
  5565. * All rights reserved.
  5566. *
  5567. * This source code is licensed under the BSD-style license found in the
  5568. * LICENSE file in the root directory of this source tree. An additional grant
  5569. * of patent rights can be found in the PATENTS file in the same directory.
  5570. *
  5571. * @providesModule accumulateInto
  5572. *
  5573. */
  5574. 'use strict';
  5575. var _prodInvariant = __webpack_require__(9);
  5576. var invariant = __webpack_require__(10);
  5577. /**
  5578. * Accumulates items that must not be null or undefined into the first one. This
  5579. * is used to conserve memory by avoiding array allocations, and thus sacrifices
  5580. * API cleanness. Since `current` can be null before being passed in and not
  5581. * null after this function, make sure to assign it back to `current`:
  5582. *
  5583. * `a = accumulateInto(a, b);`
  5584. *
  5585. * This API should be sparingly used. Try `accumulate` for something cleaner.
  5586. *
  5587. * @return {*|array<*>} An accumulation of items.
  5588. */
  5589. function accumulateInto(current, next) {
  5590. !(next != null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'accumulateInto(...): Accumulated items must not be null or undefined.') : _prodInvariant('30') : void 0;
  5591. if (current == null) {
  5592. return next;
  5593. }
  5594. // Both are not empty. Warning: Never call x.concat(y) when you are not
  5595. // certain that x is an Array (x could be a string with concat method).
  5596. if (Array.isArray(current)) {
  5597. if (Array.isArray(next)) {
  5598. current.push.apply(current, next);
  5599. return current;
  5600. }
  5601. current.push(next);
  5602. return current;
  5603. }
  5604. if (Array.isArray(next)) {
  5605. // A bit too dangerous to mutate `next`.
  5606. return [current].concat(next);
  5607. }
  5608. return [current, next];
  5609. }
  5610. module.exports = accumulateInto;
  5611. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  5612. /***/ },
  5613. /* 50 */
  5614. /***/ function(module, exports) {
  5615. /**
  5616. * Copyright 2013-present, Facebook, Inc.
  5617. * All rights reserved.
  5618. *
  5619. * This source code is licensed under the BSD-style license found in the
  5620. * LICENSE file in the root directory of this source tree. An additional grant
  5621. * of patent rights can be found in the PATENTS file in the same directory.
  5622. *
  5623. * @providesModule forEachAccumulated
  5624. *
  5625. */
  5626. 'use strict';
  5627. /**
  5628. * @param {array} arr an "accumulation" of items which is either an Array or
  5629. * a single item. Useful when paired with the `accumulate` module. This is a
  5630. * simple utility that allows us to reason about a collection of items, but
  5631. * handling the case when there is exactly one item (and we do not need to
  5632. * allocate an array).
  5633. */
  5634. function forEachAccumulated(arr, cb, scope) {
  5635. if (Array.isArray(arr)) {
  5636. arr.forEach(cb, scope);
  5637. } else if (arr) {
  5638. cb.call(scope, arr);
  5639. }
  5640. }
  5641. module.exports = forEachAccumulated;
  5642. /***/ },
  5643. /* 51 */
  5644. /***/ function(module, exports) {
  5645. /**
  5646. * Copyright (c) 2013-present, Facebook, Inc.
  5647. * All rights reserved.
  5648. *
  5649. * This source code is licensed under the BSD-style license found in the
  5650. * LICENSE file in the root directory of this source tree. An additional grant
  5651. * of patent rights can be found in the PATENTS file in the same directory.
  5652. *
  5653. */
  5654. 'use strict';
  5655. var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
  5656. /**
  5657. * Simple, lightweight module assisting with the detection and context of
  5658. * Worker. Helps avoid circular dependencies and allows code to reason about
  5659. * whether or not they are in a Worker, even if they never include the main
  5660. * `ReactWorker` dependency.
  5661. */
  5662. var ExecutionEnvironment = {
  5663. canUseDOM: canUseDOM,
  5664. canUseWorkers: typeof Worker !== 'undefined',
  5665. canUseEventListeners: canUseDOM && !!(window.addEventListener || window.attachEvent),
  5666. canUseViewport: canUseDOM && !!window.screen,
  5667. isInWorker: !canUseDOM // For now, this is true - might change in the future.
  5668. };
  5669. module.exports = ExecutionEnvironment;
  5670. /***/ },
  5671. /* 52 */
  5672. /***/ function(module, exports, __webpack_require__) {
  5673. /**
  5674. * Copyright 2013-present, Facebook, Inc.
  5675. * All rights reserved.
  5676. *
  5677. * This source code is licensed under the BSD-style license found in the
  5678. * LICENSE file in the root directory of this source tree. An additional grant
  5679. * of patent rights can be found in the PATENTS file in the same directory.
  5680. *
  5681. * @providesModule FallbackCompositionState
  5682. */
  5683. 'use strict';
  5684. var _assign = __webpack_require__(6);
  5685. var PooledClass = __webpack_require__(8);
  5686. var getTextContentAccessor = __webpack_require__(53);
  5687. /**
  5688. * This helper class stores information about text content of a target node,
  5689. * allowing comparison of content before and after a given event.
  5690. *
  5691. * Identify the node where selection currently begins, then observe
  5692. * both its text content and its current position in the DOM. Since the
  5693. * browser may natively replace the target node during composition, we can
  5694. * use its position to find its replacement.
  5695. *
  5696. * @param {DOMEventTarget} root
  5697. */
  5698. function FallbackCompositionState(root) {
  5699. this._root = root;
  5700. this._startText = this.getText();
  5701. this._fallbackText = null;
  5702. }
  5703. _assign(FallbackCompositionState.prototype, {
  5704. destructor: function () {
  5705. this._root = null;
  5706. this._startText = null;
  5707. this._fallbackText = null;
  5708. },
  5709. /**
  5710. * Get current text of input.
  5711. *
  5712. * @return {string}
  5713. */
  5714. getText: function () {
  5715. if ('value' in this._root) {
  5716. return this._root.value;
  5717. }
  5718. return this._root[getTextContentAccessor()];
  5719. },
  5720. /**
  5721. * Determine the differing substring between the initially stored
  5722. * text content and the current content.
  5723. *
  5724. * @return {string}
  5725. */
  5726. getData: function () {
  5727. if (this._fallbackText) {
  5728. return this._fallbackText;
  5729. }
  5730. var start;
  5731. var startValue = this._startText;
  5732. var startLength = startValue.length;
  5733. var end;
  5734. var endValue = this.getText();
  5735. var endLength = endValue.length;
  5736. for (start = 0; start < startLength; start++) {
  5737. if (startValue[start] !== endValue[start]) {
  5738. break;
  5739. }
  5740. }
  5741. var minEnd = startLength - start;
  5742. for (end = 1; end <= minEnd; end++) {
  5743. if (startValue[startLength - end] !== endValue[endLength - end]) {
  5744. break;
  5745. }
  5746. }
  5747. var sliceTail = end > 1 ? 1 - end : undefined;
  5748. this._fallbackText = endValue.slice(start, sliceTail);
  5749. return this._fallbackText;
  5750. }
  5751. });
  5752. PooledClass.addPoolingTo(FallbackCompositionState);
  5753. module.exports = FallbackCompositionState;
  5754. /***/ },
  5755. /* 53 */
  5756. /***/ function(module, exports, __webpack_require__) {
  5757. /**
  5758. * Copyright 2013-present, Facebook, Inc.
  5759. * All rights reserved.
  5760. *
  5761. * This source code is licensed under the BSD-style license found in the
  5762. * LICENSE file in the root directory of this source tree. An additional grant
  5763. * of patent rights can be found in the PATENTS file in the same directory.
  5764. *
  5765. * @providesModule getTextContentAccessor
  5766. */
  5767. 'use strict';
  5768. var ExecutionEnvironment = __webpack_require__(51);
  5769. var contentKey = null;
  5770. /**
  5771. * Gets the key used to access text content on a DOM node.
  5772. *
  5773. * @return {?string} Key used to access text content.
  5774. * @internal
  5775. */
  5776. function getTextContentAccessor() {
  5777. if (!contentKey && ExecutionEnvironment.canUseDOM) {
  5778. // Prefer textContent to innerText because many browsers support both but
  5779. // SVG <text> elements don't support innerText even when <div> does.
  5780. contentKey = 'textContent' in document.documentElement ? 'textContent' : 'innerText';
  5781. }
  5782. return contentKey;
  5783. }
  5784. module.exports = getTextContentAccessor;
  5785. /***/ },
  5786. /* 54 */
  5787. /***/ function(module, exports, __webpack_require__) {
  5788. /**
  5789. * Copyright 2013-present, Facebook, Inc.
  5790. * All rights reserved.
  5791. *
  5792. * This source code is licensed under the BSD-style license found in the
  5793. * LICENSE file in the root directory of this source tree. An additional grant
  5794. * of patent rights can be found in the PATENTS file in the same directory.
  5795. *
  5796. * @providesModule SyntheticCompositionEvent
  5797. */
  5798. 'use strict';
  5799. var SyntheticEvent = __webpack_require__(55);
  5800. /**
  5801. * @interface Event
  5802. * @see http://www.w3.org/TR/DOM-Level-3-Events/#events-compositionevents
  5803. */
  5804. var CompositionEventInterface = {
  5805. data: null
  5806. };
  5807. /**
  5808. * @param {object} dispatchConfig Configuration used to dispatch this event.
  5809. * @param {string} dispatchMarker Marker identifying the event target.
  5810. * @param {object} nativeEvent Native browser event.
  5811. * @extends {SyntheticUIEvent}
  5812. */
  5813. function SyntheticCompositionEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
  5814. return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
  5815. }
  5816. SyntheticEvent.augmentClass(SyntheticCompositionEvent, CompositionEventInterface);
  5817. module.exports = SyntheticCompositionEvent;
  5818. /***/ },
  5819. /* 55 */
  5820. /***/ function(module, exports, __webpack_require__) {
  5821. /* WEBPACK VAR INJECTION */(function(process) {/**
  5822. * Copyright 2013-present, Facebook, Inc.
  5823. * All rights reserved.
  5824. *
  5825. * This source code is licensed under the BSD-style license found in the
  5826. * LICENSE file in the root directory of this source tree. An additional grant
  5827. * of patent rights can be found in the PATENTS file in the same directory.
  5828. *
  5829. * @providesModule SyntheticEvent
  5830. */
  5831. 'use strict';
  5832. var _assign = __webpack_require__(6);
  5833. var PooledClass = __webpack_require__(8);
  5834. var emptyFunction = __webpack_require__(14);
  5835. var warning = __webpack_require__(13);
  5836. var didWarnForAddedNewProperty = false;
  5837. var isProxySupported = typeof Proxy === 'function';
  5838. var shouldBeReleasedProperties = ['dispatchConfig', '_targetInst', 'nativeEvent', 'isDefaultPrevented', 'isPropagationStopped', '_dispatchListeners', '_dispatchInstances'];
  5839. /**
  5840. * @interface Event
  5841. * @see http://www.w3.org/TR/DOM-Level-3-Events/
  5842. */
  5843. var EventInterface = {
  5844. type: null,
  5845. target: null,
  5846. // currentTarget is set when dispatching; no use in copying it here
  5847. currentTarget: emptyFunction.thatReturnsNull,
  5848. eventPhase: null,
  5849. bubbles: null,
  5850. cancelable: null,
  5851. timeStamp: function (event) {
  5852. return event.timeStamp || Date.now();
  5853. },
  5854. defaultPrevented: null,
  5855. isTrusted: null
  5856. };
  5857. /**
  5858. * Synthetic events are dispatched by event plugins, typically in response to a
  5859. * top-level event delegation handler.
  5860. *
  5861. * These systems should generally use pooling to reduce the frequency of garbage
  5862. * collection. The system should check `isPersistent` to determine whether the
  5863. * event should be released into the pool after being dispatched. Users that
  5864. * need a persisted event should invoke `persist`.
  5865. *
  5866. * Synthetic events (and subclasses) implement the DOM Level 3 Events API by
  5867. * normalizing browser quirks. Subclasses do not necessarily have to implement a
  5868. * DOM interface; custom application-specific events can also subclass this.
  5869. *
  5870. * @param {object} dispatchConfig Configuration used to dispatch this event.
  5871. * @param {*} targetInst Marker identifying the event target.
  5872. * @param {object} nativeEvent Native browser event.
  5873. * @param {DOMEventTarget} nativeEventTarget Target node.
  5874. */
  5875. function SyntheticEvent(dispatchConfig, targetInst, nativeEvent, nativeEventTarget) {
  5876. if (process.env.NODE_ENV !== 'production') {
  5877. // these have a getter/setter for warnings
  5878. delete this.nativeEvent;
  5879. delete this.preventDefault;
  5880. delete this.stopPropagation;
  5881. }
  5882. this.dispatchConfig = dispatchConfig;
  5883. this._targetInst = targetInst;
  5884. this.nativeEvent = nativeEvent;
  5885. var Interface = this.constructor.Interface;
  5886. for (var propName in Interface) {
  5887. if (!Interface.hasOwnProperty(propName)) {
  5888. continue;
  5889. }
  5890. if (process.env.NODE_ENV !== 'production') {
  5891. delete this[propName]; // this has a getter/setter for warnings
  5892. }
  5893. var normalize = Interface[propName];
  5894. if (normalize) {
  5895. this[propName] = normalize(nativeEvent);
  5896. } else {
  5897. if (propName === 'target') {
  5898. this.target = nativeEventTarget;
  5899. } else {
  5900. this[propName] = nativeEvent[propName];
  5901. }
  5902. }
  5903. }
  5904. var defaultPrevented = nativeEvent.defaultPrevented != null ? nativeEvent.defaultPrevented : nativeEvent.returnValue === false;
  5905. if (defaultPrevented) {
  5906. this.isDefaultPrevented = emptyFunction.thatReturnsTrue;
  5907. } else {
  5908. this.isDefaultPrevented = emptyFunction.thatReturnsFalse;
  5909. }
  5910. this.isPropagationStopped = emptyFunction.thatReturnsFalse;
  5911. return this;
  5912. }
  5913. _assign(SyntheticEvent.prototype, {
  5914. preventDefault: function () {
  5915. this.defaultPrevented = true;
  5916. var event = this.nativeEvent;
  5917. if (!event) {
  5918. return;
  5919. }
  5920. if (event.preventDefault) {
  5921. event.preventDefault();
  5922. } else {
  5923. event.returnValue = false;
  5924. }
  5925. this.isDefaultPrevented = emptyFunction.thatReturnsTrue;
  5926. },
  5927. stopPropagation: function () {
  5928. var event = this.nativeEvent;
  5929. if (!event) {
  5930. return;
  5931. }
  5932. if (event.stopPropagation) {
  5933. event.stopPropagation();
  5934. } else if (typeof event.cancelBubble !== 'unknown') {
  5935. // eslint-disable-line valid-typeof
  5936. // The ChangeEventPlugin registers a "propertychange" event for
  5937. // IE. This event does not support bubbling or cancelling, and
  5938. // any references to cancelBubble throw "Member not found". A
  5939. // typeof check of "unknown" circumvents this issue (and is also
  5940. // IE specific).
  5941. event.cancelBubble = true;
  5942. }
  5943. this.isPropagationStopped = emptyFunction.thatReturnsTrue;
  5944. },
  5945. /**
  5946. * We release all dispatched `SyntheticEvent`s after each event loop, adding
  5947. * them back into the pool. This allows a way to hold onto a reference that
  5948. * won't be added back into the pool.
  5949. */
  5950. persist: function () {
  5951. this.isPersistent = emptyFunction.thatReturnsTrue;
  5952. },
  5953. /**
  5954. * Checks if this event should be released back into the pool.
  5955. *
  5956. * @return {boolean} True if this should not be released, false otherwise.
  5957. */
  5958. isPersistent: emptyFunction.thatReturnsFalse,
  5959. /**
  5960. * `PooledClass` looks for `destructor` on each instance it releases.
  5961. */
  5962. destructor: function () {
  5963. var Interface = this.constructor.Interface;
  5964. for (var propName in Interface) {
  5965. if (process.env.NODE_ENV !== 'production') {
  5966. Object.defineProperty(this, propName, getPooledWarningPropertyDefinition(propName, Interface[propName]));
  5967. } else {
  5968. this[propName] = null;
  5969. }
  5970. }
  5971. for (var i = 0; i < shouldBeReleasedProperties.length; i++) {
  5972. this[shouldBeReleasedProperties[i]] = null;
  5973. }
  5974. if (process.env.NODE_ENV !== 'production') {
  5975. Object.defineProperty(this, 'nativeEvent', getPooledWarningPropertyDefinition('nativeEvent', null));
  5976. Object.defineProperty(this, 'preventDefault', getPooledWarningPropertyDefinition('preventDefault', emptyFunction));
  5977. Object.defineProperty(this, 'stopPropagation', getPooledWarningPropertyDefinition('stopPropagation', emptyFunction));
  5978. }
  5979. }
  5980. });
  5981. SyntheticEvent.Interface = EventInterface;
  5982. if (process.env.NODE_ENV !== 'production') {
  5983. if (isProxySupported) {
  5984. /*eslint-disable no-func-assign */
  5985. SyntheticEvent = new Proxy(SyntheticEvent, {
  5986. construct: function (target, args) {
  5987. return this.apply(target, Object.create(target.prototype), args);
  5988. },
  5989. apply: function (constructor, that, args) {
  5990. return new Proxy(constructor.apply(that, args), {
  5991. set: function (target, prop, value) {
  5992. if (prop !== 'isPersistent' && !target.constructor.Interface.hasOwnProperty(prop) && shouldBeReleasedProperties.indexOf(prop) === -1) {
  5993. 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;
  5994. didWarnForAddedNewProperty = true;
  5995. }
  5996. target[prop] = value;
  5997. return true;
  5998. }
  5999. });
  6000. }
  6001. });
  6002. /*eslint-enable no-func-assign */
  6003. }
  6004. }
  6005. /**
  6006. * Helper to reduce boilerplate when creating subclasses.
  6007. *
  6008. * @param {function} Class
  6009. * @param {?object} Interface
  6010. */
  6011. SyntheticEvent.augmentClass = function (Class, Interface) {
  6012. var Super = this;
  6013. var E = function () {};
  6014. E.prototype = Super.prototype;
  6015. var prototype = new E();
  6016. _assign(prototype, Class.prototype);
  6017. Class.prototype = prototype;
  6018. Class.prototype.constructor = Class;
  6019. Class.Interface = _assign({}, Super.Interface, Interface);
  6020. Class.augmentClass = Super.augmentClass;
  6021. PooledClass.addPoolingTo(Class, PooledClass.fourArgumentPooler);
  6022. };
  6023. PooledClass.addPoolingTo(SyntheticEvent, PooledClass.fourArgumentPooler);
  6024. module.exports = SyntheticEvent;
  6025. /**
  6026. * Helper to nullify syntheticEvent instance properties when destructing
  6027. *
  6028. * @param {object} SyntheticEvent
  6029. * @param {String} propName
  6030. * @return {object} defineProperty object
  6031. */
  6032. function getPooledWarningPropertyDefinition(propName, getVal) {
  6033. var isFunction = typeof getVal === 'function';
  6034. return {
  6035. configurable: true,
  6036. set: set,
  6037. get: get
  6038. };
  6039. function set(val) {
  6040. var action = isFunction ? 'setting the method' : 'setting the property';
  6041. warn(action, 'This is effectively a no-op');
  6042. return val;
  6043. }
  6044. function get() {
  6045. var action = isFunction ? 'accessing the method' : 'accessing the property';
  6046. var result = isFunction ? 'This is a no-op function' : 'This is set to null';
  6047. warn(action, result);
  6048. return getVal;
  6049. }
  6050. function warn(action, result) {
  6051. var warningCondition = false;
  6052. process.env.NODE_ENV !== 'production' ? 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;
  6053. }
  6054. }
  6055. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  6056. /***/ },
  6057. /* 56 */
  6058. /***/ function(module, exports, __webpack_require__) {
  6059. /**
  6060. * Copyright 2013-present, Facebook, Inc.
  6061. * All rights reserved.
  6062. *
  6063. * This source code is licensed under the BSD-style license found in the
  6064. * LICENSE file in the root directory of this source tree. An additional grant
  6065. * of patent rights can be found in the PATENTS file in the same directory.
  6066. *
  6067. * @providesModule SyntheticInputEvent
  6068. */
  6069. 'use strict';
  6070. var SyntheticEvent = __webpack_require__(55);
  6071. /**
  6072. * @interface Event
  6073. * @see http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105
  6074. * /#events-inputevents
  6075. */
  6076. var InputEventInterface = {
  6077. data: null
  6078. };
  6079. /**
  6080. * @param {object} dispatchConfig Configuration used to dispatch this event.
  6081. * @param {string} dispatchMarker Marker identifying the event target.
  6082. * @param {object} nativeEvent Native browser event.
  6083. * @extends {SyntheticUIEvent}
  6084. */
  6085. function SyntheticInputEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
  6086. return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
  6087. }
  6088. SyntheticEvent.augmentClass(SyntheticInputEvent, InputEventInterface);
  6089. module.exports = SyntheticInputEvent;
  6090. /***/ },
  6091. /* 57 */
  6092. /***/ function(module, exports, __webpack_require__) {
  6093. /**
  6094. * Copyright 2013-present, Facebook, Inc.
  6095. * All rights reserved.
  6096. *
  6097. * This source code is licensed under the BSD-style license found in the
  6098. * LICENSE file in the root directory of this source tree. An additional grant
  6099. * of patent rights can be found in the PATENTS file in the same directory.
  6100. *
  6101. * @providesModule ChangeEventPlugin
  6102. */
  6103. 'use strict';
  6104. var EventConstants = __webpack_require__(43);
  6105. var EventPluginHub = __webpack_require__(45);
  6106. var EventPropagators = __webpack_require__(44);
  6107. var ExecutionEnvironment = __webpack_require__(51);
  6108. var ReactDOMComponentTree = __webpack_require__(38);
  6109. var ReactUpdates = __webpack_require__(58);
  6110. var SyntheticEvent = __webpack_require__(55);
  6111. var getEventTarget = __webpack_require__(72);
  6112. var isEventSupported = __webpack_require__(73);
  6113. var isTextInputElement = __webpack_require__(74);
  6114. var keyOf = __webpack_require__(27);
  6115. var topLevelTypes = EventConstants.topLevelTypes;
  6116. var eventTypes = {
  6117. change: {
  6118. phasedRegistrationNames: {
  6119. bubbled: keyOf({ onChange: null }),
  6120. captured: keyOf({ onChangeCapture: null })
  6121. },
  6122. dependencies: [topLevelTypes.topBlur, topLevelTypes.topChange, topLevelTypes.topClick, topLevelTypes.topFocus, topLevelTypes.topInput, topLevelTypes.topKeyDown, topLevelTypes.topKeyUp, topLevelTypes.topSelectionChange]
  6123. }
  6124. };
  6125. /**
  6126. * For IE shims
  6127. */
  6128. var activeElement = null;
  6129. var activeElementInst = null;
  6130. var activeElementValue = null;
  6131. var activeElementValueProp = null;
  6132. /**
  6133. * SECTION: handle `change` event
  6134. */
  6135. function shouldUseChangeEvent(elem) {
  6136. var nodeName = elem.nodeName && elem.nodeName.toLowerCase();
  6137. return nodeName === 'select' || nodeName === 'input' && elem.type === 'file';
  6138. }
  6139. var doesChangeEventBubble = false;
  6140. if (ExecutionEnvironment.canUseDOM) {
  6141. // See `handleChange` comment below
  6142. doesChangeEventBubble = isEventSupported('change') && (!('documentMode' in document) || document.documentMode > 8);
  6143. }
  6144. function manualDispatchChangeEvent(nativeEvent) {
  6145. var event = SyntheticEvent.getPooled(eventTypes.change, activeElementInst, nativeEvent, getEventTarget(nativeEvent));
  6146. EventPropagators.accumulateTwoPhaseDispatches(event);
  6147. // If change and propertychange bubbled, we'd just bind to it like all the
  6148. // other events and have it go through ReactBrowserEventEmitter. Since it
  6149. // doesn't, we manually listen for the events and so we have to enqueue and
  6150. // process the abstract event manually.
  6151. //
  6152. // Batching is necessary here in order to ensure that all event handlers run
  6153. // before the next rerender (including event handlers attached to ancestor
  6154. // elements instead of directly on the input). Without this, controlled
  6155. // components don't work properly in conjunction with event bubbling because
  6156. // the component is rerendered and the value reverted before all the event
  6157. // handlers can run. See https://github.com/facebook/react/issues/708.
  6158. ReactUpdates.batchedUpdates(runEventInBatch, event);
  6159. }
  6160. function runEventInBatch(event) {
  6161. EventPluginHub.enqueueEvents(event);
  6162. EventPluginHub.processEventQueue(false);
  6163. }
  6164. function startWatchingForChangeEventIE8(target, targetInst) {
  6165. activeElement = target;
  6166. activeElementInst = targetInst;
  6167. activeElement.attachEvent('onchange', manualDispatchChangeEvent);
  6168. }
  6169. function stopWatchingForChangeEventIE8() {
  6170. if (!activeElement) {
  6171. return;
  6172. }
  6173. activeElement.detachEvent('onchange', manualDispatchChangeEvent);
  6174. activeElement = null;
  6175. activeElementInst = null;
  6176. }
  6177. function getTargetInstForChangeEvent(topLevelType, targetInst) {
  6178. if (topLevelType === topLevelTypes.topChange) {
  6179. return targetInst;
  6180. }
  6181. }
  6182. function handleEventsForChangeEventIE8(topLevelType, target, targetInst) {
  6183. if (topLevelType === topLevelTypes.topFocus) {
  6184. // stopWatching() should be a noop here but we call it just in case we
  6185. // missed a blur event somehow.
  6186. stopWatchingForChangeEventIE8();
  6187. startWatchingForChangeEventIE8(target, targetInst);
  6188. } else if (topLevelType === topLevelTypes.topBlur) {
  6189. stopWatchingForChangeEventIE8();
  6190. }
  6191. }
  6192. /**
  6193. * SECTION: handle `input` event
  6194. */
  6195. var isInputEventSupported = false;
  6196. if (ExecutionEnvironment.canUseDOM) {
  6197. // IE9 claims to support the input event but fails to trigger it when
  6198. // deleting text, so we ignore its input events.
  6199. // IE10+ fire input events to often, such when a placeholder
  6200. // changes or when an input with a placeholder is focused.
  6201. isInputEventSupported = isEventSupported('input') && (!('documentMode' in document) || document.documentMode > 11);
  6202. }
  6203. /**
  6204. * (For IE <=11) Replacement getter/setter for the `value` property that gets
  6205. * set on the active element.
  6206. */
  6207. var newValueProp = {
  6208. get: function () {
  6209. return activeElementValueProp.get.call(this);
  6210. },
  6211. set: function (val) {
  6212. // Cast to a string so we can do equality checks.
  6213. activeElementValue = '' + val;
  6214. activeElementValueProp.set.call(this, val);
  6215. }
  6216. };
  6217. /**
  6218. * (For IE <=11) Starts tracking propertychange events on the passed-in element
  6219. * and override the value property so that we can distinguish user events from
  6220. * value changes in JS.
  6221. */
  6222. function startWatchingForValueChange(target, targetInst) {
  6223. activeElement = target;
  6224. activeElementInst = targetInst;
  6225. activeElementValue = target.value;
  6226. activeElementValueProp = Object.getOwnPropertyDescriptor(target.constructor.prototype, 'value');
  6227. // Not guarded in a canDefineProperty check: IE8 supports defineProperty only
  6228. // on DOM elements
  6229. Object.defineProperty(activeElement, 'value', newValueProp);
  6230. if (activeElement.attachEvent) {
  6231. activeElement.attachEvent('onpropertychange', handlePropertyChange);
  6232. } else {
  6233. activeElement.addEventListener('propertychange', handlePropertyChange, false);
  6234. }
  6235. }
  6236. /**
  6237. * (For IE <=11) Removes the event listeners from the currently-tracked element,
  6238. * if any exists.
  6239. */
  6240. function stopWatchingForValueChange() {
  6241. if (!activeElement) {
  6242. return;
  6243. }
  6244. // delete restores the original property definition
  6245. delete activeElement.value;
  6246. if (activeElement.detachEvent) {
  6247. activeElement.detachEvent('onpropertychange', handlePropertyChange);
  6248. } else {
  6249. activeElement.removeEventListener('propertychange', handlePropertyChange, false);
  6250. }
  6251. activeElement = null;
  6252. activeElementInst = null;
  6253. activeElementValue = null;
  6254. activeElementValueProp = null;
  6255. }
  6256. /**
  6257. * (For IE <=11) Handles a propertychange event, sending a `change` event if
  6258. * the value of the active element has changed.
  6259. */
  6260. function handlePropertyChange(nativeEvent) {
  6261. if (nativeEvent.propertyName !== 'value') {
  6262. return;
  6263. }
  6264. var value = nativeEvent.srcElement.value;
  6265. if (value === activeElementValue) {
  6266. return;
  6267. }
  6268. activeElementValue = value;
  6269. manualDispatchChangeEvent(nativeEvent);
  6270. }
  6271. /**
  6272. * If a `change` event should be fired, returns the target's ID.
  6273. */
  6274. function getTargetInstForInputEvent(topLevelType, targetInst) {
  6275. if (topLevelType === topLevelTypes.topInput) {
  6276. // In modern browsers (i.e., not IE8 or IE9), the input event is exactly
  6277. // what we want so fall through here and trigger an abstract event
  6278. return targetInst;
  6279. }
  6280. }
  6281. function handleEventsForInputEventIE(topLevelType, target, targetInst) {
  6282. if (topLevelType === topLevelTypes.topFocus) {
  6283. // In IE8, we can capture almost all .value changes by adding a
  6284. // propertychange handler and looking for events with propertyName
  6285. // equal to 'value'
  6286. // In IE9-11, propertychange fires for most input events but is buggy and
  6287. // doesn't fire when text is deleted, but conveniently, selectionchange
  6288. // appears to fire in all of the remaining cases so we catch those and
  6289. // forward the event if the value has changed
  6290. // In either case, we don't want to call the event handler if the value
  6291. // is changed from JS so we redefine a setter for `.value` that updates
  6292. // our activeElementValue variable, allowing us to ignore those changes
  6293. //
  6294. // stopWatching() should be a noop here but we call it just in case we
  6295. // missed a blur event somehow.
  6296. stopWatchingForValueChange();
  6297. startWatchingForValueChange(target, targetInst);
  6298. } else if (topLevelType === topLevelTypes.topBlur) {
  6299. stopWatchingForValueChange();
  6300. }
  6301. }
  6302. // For IE8 and IE9.
  6303. function getTargetInstForInputEventIE(topLevelType, targetInst) {
  6304. if (topLevelType === topLevelTypes.topSelectionChange || topLevelType === topLevelTypes.topKeyUp || topLevelType === topLevelTypes.topKeyDown) {
  6305. // On the selectionchange event, the target is just document which isn't
  6306. // helpful for us so just check activeElement instead.
  6307. //
  6308. // 99% of the time, keydown and keyup aren't necessary. IE8 fails to fire
  6309. // propertychange on the first input event after setting `value` from a
  6310. // script and fires only keydown, keypress, keyup. Catching keyup usually
  6311. // gets it and catching keydown lets us fire an event for the first
  6312. // keystroke if user does a key repeat (it'll be a little delayed: right
  6313. // before the second keystroke). Other input methods (e.g., paste) seem to
  6314. // fire selectionchange normally.
  6315. if (activeElement && activeElement.value !== activeElementValue) {
  6316. activeElementValue = activeElement.value;
  6317. return activeElementInst;
  6318. }
  6319. }
  6320. }
  6321. /**
  6322. * SECTION: handle `click` event
  6323. */
  6324. function shouldUseClickEvent(elem) {
  6325. // Use the `click` event to detect changes to checkbox and radio inputs.
  6326. // This approach works across all browsers, whereas `change` does not fire
  6327. // until `blur` in IE8.
  6328. return elem.nodeName && elem.nodeName.toLowerCase() === 'input' && (elem.type === 'checkbox' || elem.type === 'radio');
  6329. }
  6330. function getTargetInstForClickEvent(topLevelType, targetInst) {
  6331. if (topLevelType === topLevelTypes.topClick) {
  6332. return targetInst;
  6333. }
  6334. }
  6335. /**
  6336. * This plugin creates an `onChange` event that normalizes change events
  6337. * across form elements. This event fires at a time when it's possible to
  6338. * change the element's value without seeing a flicker.
  6339. *
  6340. * Supported elements are:
  6341. * - input (see `isTextInputElement`)
  6342. * - textarea
  6343. * - select
  6344. */
  6345. var ChangeEventPlugin = {
  6346. eventTypes: eventTypes,
  6347. extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
  6348. var targetNode = targetInst ? ReactDOMComponentTree.getNodeFromInstance(targetInst) : window;
  6349. var getTargetInstFunc, handleEventFunc;
  6350. if (shouldUseChangeEvent(targetNode)) {
  6351. if (doesChangeEventBubble) {
  6352. getTargetInstFunc = getTargetInstForChangeEvent;
  6353. } else {
  6354. handleEventFunc = handleEventsForChangeEventIE8;
  6355. }
  6356. } else if (isTextInputElement(targetNode)) {
  6357. if (isInputEventSupported) {
  6358. getTargetInstFunc = getTargetInstForInputEvent;
  6359. } else {
  6360. getTargetInstFunc = getTargetInstForInputEventIE;
  6361. handleEventFunc = handleEventsForInputEventIE;
  6362. }
  6363. } else if (shouldUseClickEvent(targetNode)) {
  6364. getTargetInstFunc = getTargetInstForClickEvent;
  6365. }
  6366. if (getTargetInstFunc) {
  6367. var inst = getTargetInstFunc(topLevelType, targetInst);
  6368. if (inst) {
  6369. var event = SyntheticEvent.getPooled(eventTypes.change, inst, nativeEvent, nativeEventTarget);
  6370. event.type = 'change';
  6371. EventPropagators.accumulateTwoPhaseDispatches(event);
  6372. return event;
  6373. }
  6374. }
  6375. if (handleEventFunc) {
  6376. handleEventFunc(topLevelType, targetNode, targetInst);
  6377. }
  6378. }
  6379. };
  6380. module.exports = ChangeEventPlugin;
  6381. /***/ },
  6382. /* 58 */
  6383. /***/ function(module, exports, __webpack_require__) {
  6384. /* WEBPACK VAR INJECTION */(function(process) {/**
  6385. * Copyright 2013-present, Facebook, Inc.
  6386. * All rights reserved.
  6387. *
  6388. * This source code is licensed under the BSD-style license found in the
  6389. * LICENSE file in the root directory of this source tree. An additional grant
  6390. * of patent rights can be found in the PATENTS file in the same directory.
  6391. *
  6392. * @providesModule ReactUpdates
  6393. */
  6394. 'use strict';
  6395. var _prodInvariant = __webpack_require__(9),
  6396. _assign = __webpack_require__(6);
  6397. var CallbackQueue = __webpack_require__(59);
  6398. var PooledClass = __webpack_require__(8);
  6399. var ReactFeatureFlags = __webpack_require__(60);
  6400. var ReactReconciler = __webpack_require__(61);
  6401. var Transaction = __webpack_require__(71);
  6402. var invariant = __webpack_require__(10);
  6403. var dirtyComponents = [];
  6404. var updateBatchNumber = 0;
  6405. var asapCallbackQueue = CallbackQueue.getPooled();
  6406. var asapEnqueued = false;
  6407. var batchingStrategy = null;
  6408. function ensureInjected() {
  6409. !(ReactUpdates.ReactReconcileTransaction && batchingStrategy) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must inject a reconcile transaction class and batching strategy') : _prodInvariant('123') : void 0;
  6410. }
  6411. var NESTED_UPDATES = {
  6412. initialize: function () {
  6413. this.dirtyComponentsLength = dirtyComponents.length;
  6414. },
  6415. close: function () {
  6416. if (this.dirtyComponentsLength !== dirtyComponents.length) {
  6417. // Additional updates were enqueued by componentDidUpdate handlers or
  6418. // similar; before our own UPDATE_QUEUEING wrapper closes, we want to run
  6419. // these new updates so that if A's componentDidUpdate calls setState on
  6420. // B, B will update before the callback A's updater provided when calling
  6421. // setState.
  6422. dirtyComponents.splice(0, this.dirtyComponentsLength);
  6423. flushBatchedUpdates();
  6424. } else {
  6425. dirtyComponents.length = 0;
  6426. }
  6427. }
  6428. };
  6429. var UPDATE_QUEUEING = {
  6430. initialize: function () {
  6431. this.callbackQueue.reset();
  6432. },
  6433. close: function () {
  6434. this.callbackQueue.notifyAll();
  6435. }
  6436. };
  6437. var TRANSACTION_WRAPPERS = [NESTED_UPDATES, UPDATE_QUEUEING];
  6438. function ReactUpdatesFlushTransaction() {
  6439. this.reinitializeTransaction();
  6440. this.dirtyComponentsLength = null;
  6441. this.callbackQueue = CallbackQueue.getPooled();
  6442. this.reconcileTransaction = ReactUpdates.ReactReconcileTransaction.getPooled(
  6443. /* useCreateElement */true);
  6444. }
  6445. _assign(ReactUpdatesFlushTransaction.prototype, Transaction.Mixin, {
  6446. getTransactionWrappers: function () {
  6447. return TRANSACTION_WRAPPERS;
  6448. },
  6449. destructor: function () {
  6450. this.dirtyComponentsLength = null;
  6451. CallbackQueue.release(this.callbackQueue);
  6452. this.callbackQueue = null;
  6453. ReactUpdates.ReactReconcileTransaction.release(this.reconcileTransaction);
  6454. this.reconcileTransaction = null;
  6455. },
  6456. perform: function (method, scope, a) {
  6457. // Essentially calls `this.reconcileTransaction.perform(method, scope, a)`
  6458. // with this transaction's wrappers around it.
  6459. return Transaction.Mixin.perform.call(this, this.reconcileTransaction.perform, this.reconcileTransaction, method, scope, a);
  6460. }
  6461. });
  6462. PooledClass.addPoolingTo(ReactUpdatesFlushTransaction);
  6463. function batchedUpdates(callback, a, b, c, d, e) {
  6464. ensureInjected();
  6465. batchingStrategy.batchedUpdates(callback, a, b, c, d, e);
  6466. }
  6467. /**
  6468. * Array comparator for ReactComponents by mount ordering.
  6469. *
  6470. * @param {ReactComponent} c1 first component you're comparing
  6471. * @param {ReactComponent} c2 second component you're comparing
  6472. * @return {number} Return value usable by Array.prototype.sort().
  6473. */
  6474. function mountOrderComparator(c1, c2) {
  6475. return c1._mountOrder - c2._mountOrder;
  6476. }
  6477. function runBatchedUpdates(transaction) {
  6478. var len = transaction.dirtyComponentsLength;
  6479. !(len === dirtyComponents.length) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected flush transaction\'s stored dirty-components length (%s) to match dirty-components array length (%s).', len, dirtyComponents.length) : _prodInvariant('124', len, dirtyComponents.length) : void 0;
  6480. // Since reconciling a component higher in the owner hierarchy usually (not
  6481. // always -- see shouldComponentUpdate()) will reconcile children, reconcile
  6482. // them before their children by sorting the array.
  6483. dirtyComponents.sort(mountOrderComparator);
  6484. // Any updates enqueued while reconciling must be performed after this entire
  6485. // batch. Otherwise, if dirtyComponents is [A, B] where A has children B and
  6486. // C, B could update twice in a single batch if C's render enqueues an update
  6487. // to B (since B would have already updated, we should skip it, and the only
  6488. // way we can know to do so is by checking the batch counter).
  6489. updateBatchNumber++;
  6490. for (var i = 0; i < len; i++) {
  6491. // If a component is unmounted before pending changes apply, it will still
  6492. // be here, but we assume that it has cleared its _pendingCallbacks and
  6493. // that performUpdateIfNecessary is a noop.
  6494. var component = dirtyComponents[i];
  6495. // If performUpdateIfNecessary happens to enqueue any new updates, we
  6496. // shouldn't execute the callbacks until the next render happens, so
  6497. // stash the callbacks first
  6498. var callbacks = component._pendingCallbacks;
  6499. component._pendingCallbacks = null;
  6500. var markerName;
  6501. if (ReactFeatureFlags.logTopLevelRenders) {
  6502. var namedComponent = component;
  6503. // Duck type TopLevelWrapper. This is probably always true.
  6504. if (component._currentElement.props === component._renderedComponent._currentElement) {
  6505. namedComponent = component._renderedComponent;
  6506. }
  6507. markerName = 'React update: ' + namedComponent.getName();
  6508. console.time(markerName);
  6509. }
  6510. ReactReconciler.performUpdateIfNecessary(component, transaction.reconcileTransaction, updateBatchNumber);
  6511. if (markerName) {
  6512. console.timeEnd(markerName);
  6513. }
  6514. if (callbacks) {
  6515. for (var j = 0; j < callbacks.length; j++) {
  6516. transaction.callbackQueue.enqueue(callbacks[j], component.getPublicInstance());
  6517. }
  6518. }
  6519. }
  6520. }
  6521. var flushBatchedUpdates = function () {
  6522. // ReactUpdatesFlushTransaction's wrappers will clear the dirtyComponents
  6523. // array and perform any updates enqueued by mount-ready handlers (i.e.,
  6524. // componentDidUpdate) but we need to check here too in order to catch
  6525. // updates enqueued by setState callbacks and asap calls.
  6526. while (dirtyComponents.length || asapEnqueued) {
  6527. if (dirtyComponents.length) {
  6528. var transaction = ReactUpdatesFlushTransaction.getPooled();
  6529. transaction.perform(runBatchedUpdates, null, transaction);
  6530. ReactUpdatesFlushTransaction.release(transaction);
  6531. }
  6532. if (asapEnqueued) {
  6533. asapEnqueued = false;
  6534. var queue = asapCallbackQueue;
  6535. asapCallbackQueue = CallbackQueue.getPooled();
  6536. queue.notifyAll();
  6537. CallbackQueue.release(queue);
  6538. }
  6539. }
  6540. };
  6541. /**
  6542. * Mark a component as needing a rerender, adding an optional callback to a
  6543. * list of functions which will be executed once the rerender occurs.
  6544. */
  6545. function enqueueUpdate(component) {
  6546. ensureInjected();
  6547. // Various parts of our code (such as ReactCompositeComponent's
  6548. // _renderValidatedComponent) assume that calls to render aren't nested;
  6549. // verify that that's the case. (This is called by each top-level update
  6550. // function, like setState, forceUpdate, etc.; creation and
  6551. // destruction of top-level components is guarded in ReactMount.)
  6552. if (!batchingStrategy.isBatchingUpdates) {
  6553. batchingStrategy.batchedUpdates(enqueueUpdate, component);
  6554. return;
  6555. }
  6556. dirtyComponents.push(component);
  6557. if (component._updateBatchNumber == null) {
  6558. component._updateBatchNumber = updateBatchNumber + 1;
  6559. }
  6560. }
  6561. /**
  6562. * Enqueue a callback to be run at the end of the current batching cycle. Throws
  6563. * if no updates are currently being performed.
  6564. */
  6565. function asap(callback, context) {
  6566. !batchingStrategy.isBatchingUpdates ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates.asap: Can\'t enqueue an asap callback in a context whereupdates are not being batched.') : _prodInvariant('125') : void 0;
  6567. asapCallbackQueue.enqueue(callback, context);
  6568. asapEnqueued = true;
  6569. }
  6570. var ReactUpdatesInjection = {
  6571. injectReconcileTransaction: function (ReconcileTransaction) {
  6572. !ReconcileTransaction ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must provide a reconcile transaction class') : _prodInvariant('126') : void 0;
  6573. ReactUpdates.ReactReconcileTransaction = ReconcileTransaction;
  6574. },
  6575. injectBatchingStrategy: function (_batchingStrategy) {
  6576. !_batchingStrategy ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must provide a batching strategy') : _prodInvariant('127') : void 0;
  6577. !(typeof _batchingStrategy.batchedUpdates === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must provide a batchedUpdates() function') : _prodInvariant('128') : void 0;
  6578. !(typeof _batchingStrategy.isBatchingUpdates === 'boolean') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must provide an isBatchingUpdates boolean attribute') : _prodInvariant('129') : void 0;
  6579. batchingStrategy = _batchingStrategy;
  6580. }
  6581. };
  6582. var ReactUpdates = {
  6583. /**
  6584. * React references `ReactReconcileTransaction` using this property in order
  6585. * to allow dependency injection.
  6586. *
  6587. * @internal
  6588. */
  6589. ReactReconcileTransaction: null,
  6590. batchedUpdates: batchedUpdates,
  6591. enqueueUpdate: enqueueUpdate,
  6592. flushBatchedUpdates: flushBatchedUpdates,
  6593. injection: ReactUpdatesInjection,
  6594. asap: asap
  6595. };
  6596. module.exports = ReactUpdates;
  6597. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  6598. /***/ },
  6599. /* 59 */
  6600. /***/ function(module, exports, __webpack_require__) {
  6601. /* WEBPACK VAR INJECTION */(function(process) {/**
  6602. * Copyright 2013-present, Facebook, Inc.
  6603. * All rights reserved.
  6604. *
  6605. * This source code is licensed under the BSD-style license found in the
  6606. * LICENSE file in the root directory of this source tree. An additional grant
  6607. * of patent rights can be found in the PATENTS file in the same directory.
  6608. *
  6609. * @providesModule CallbackQueue
  6610. */
  6611. 'use strict';
  6612. var _prodInvariant = __webpack_require__(9),
  6613. _assign = __webpack_require__(6);
  6614. var PooledClass = __webpack_require__(8);
  6615. var invariant = __webpack_require__(10);
  6616. /**
  6617. * A specialized pseudo-event module to help keep track of components waiting to
  6618. * be notified when their DOM representations are available for use.
  6619. *
  6620. * This implements `PooledClass`, so you should never need to instantiate this.
  6621. * Instead, use `CallbackQueue.getPooled()`.
  6622. *
  6623. * @class ReactMountReady
  6624. * @implements PooledClass
  6625. * @internal
  6626. */
  6627. function CallbackQueue() {
  6628. this._callbacks = null;
  6629. this._contexts = null;
  6630. }
  6631. _assign(CallbackQueue.prototype, {
  6632. /**
  6633. * Enqueues a callback to be invoked when `notifyAll` is invoked.
  6634. *
  6635. * @param {function} callback Invoked when `notifyAll` is invoked.
  6636. * @param {?object} context Context to call `callback` with.
  6637. * @internal
  6638. */
  6639. enqueue: function (callback, context) {
  6640. this._callbacks = this._callbacks || [];
  6641. this._contexts = this._contexts || [];
  6642. this._callbacks.push(callback);
  6643. this._contexts.push(context);
  6644. },
  6645. /**
  6646. * Invokes all enqueued callbacks and clears the queue. This is invoked after
  6647. * the DOM representation of a component has been created or updated.
  6648. *
  6649. * @internal
  6650. */
  6651. notifyAll: function () {
  6652. var callbacks = this._callbacks;
  6653. var contexts = this._contexts;
  6654. if (callbacks) {
  6655. !(callbacks.length === contexts.length) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Mismatched list of contexts in callback queue') : _prodInvariant('24') : void 0;
  6656. this._callbacks = null;
  6657. this._contexts = null;
  6658. for (var i = 0; i < callbacks.length; i++) {
  6659. callbacks[i].call(contexts[i]);
  6660. }
  6661. callbacks.length = 0;
  6662. contexts.length = 0;
  6663. }
  6664. },
  6665. checkpoint: function () {
  6666. return this._callbacks ? this._callbacks.length : 0;
  6667. },
  6668. rollback: function (len) {
  6669. if (this._callbacks) {
  6670. this._callbacks.length = len;
  6671. this._contexts.length = len;
  6672. }
  6673. },
  6674. /**
  6675. * Resets the internal queue.
  6676. *
  6677. * @internal
  6678. */
  6679. reset: function () {
  6680. this._callbacks = null;
  6681. this._contexts = null;
  6682. },
  6683. /**
  6684. * `PooledClass` looks for this.
  6685. */
  6686. destructor: function () {
  6687. this.reset();
  6688. }
  6689. });
  6690. PooledClass.addPoolingTo(CallbackQueue);
  6691. module.exports = CallbackQueue;
  6692. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  6693. /***/ },
  6694. /* 60 */
  6695. /***/ function(module, exports) {
  6696. /**
  6697. * Copyright 2013-present, Facebook, Inc.
  6698. * All rights reserved.
  6699. *
  6700. * This source code is licensed under the BSD-style license found in the
  6701. * LICENSE file in the root directory of this source tree. An additional grant
  6702. * of patent rights can be found in the PATENTS file in the same directory.
  6703. *
  6704. * @providesModule ReactFeatureFlags
  6705. *
  6706. */
  6707. 'use strict';
  6708. var ReactFeatureFlags = {
  6709. // When true, call console.time() before and .timeEnd() after each top-level
  6710. // render (both initial renders and updates). Useful when looking at prod-mode
  6711. // timeline profiles in Chrome, for example.
  6712. logTopLevelRenders: false
  6713. };
  6714. module.exports = ReactFeatureFlags;
  6715. /***/ },
  6716. /* 61 */
  6717. /***/ function(module, exports, __webpack_require__) {
  6718. /* WEBPACK VAR INJECTION */(function(process) {/**
  6719. * Copyright 2013-present, Facebook, Inc.
  6720. * All rights reserved.
  6721. *
  6722. * This source code is licensed under the BSD-style license found in the
  6723. * LICENSE file in the root directory of this source tree. An additional grant
  6724. * of patent rights can be found in the PATENTS file in the same directory.
  6725. *
  6726. * @providesModule ReactReconciler
  6727. */
  6728. 'use strict';
  6729. var ReactRef = __webpack_require__(62);
  6730. var ReactInstrumentation = __webpack_require__(64);
  6731. var warning = __webpack_require__(13);
  6732. /**
  6733. * Helper to call ReactRef.attachRefs with this composite component, split out
  6734. * to avoid allocations in the transaction mount-ready queue.
  6735. */
  6736. function attachRefs() {
  6737. ReactRef.attachRefs(this, this._currentElement);
  6738. }
  6739. var ReactReconciler = {
  6740. /**
  6741. * Initializes the component, renders markup, and registers event listeners.
  6742. *
  6743. * @param {ReactComponent} internalInstance
  6744. * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
  6745. * @param {?object} the containing host component instance
  6746. * @param {?object} info about the host container
  6747. * @return {?string} Rendered markup to be inserted into the DOM.
  6748. * @final
  6749. * @internal
  6750. */
  6751. mountComponent: function (internalInstance, transaction, hostParent, hostContainerInfo, context, parentDebugID // 0 in production and for roots
  6752. ) {
  6753. if (process.env.NODE_ENV !== 'production') {
  6754. if (internalInstance._debugID !== 0) {
  6755. ReactInstrumentation.debugTool.onBeforeMountComponent(internalInstance._debugID, internalInstance._currentElement, parentDebugID);
  6756. }
  6757. }
  6758. var markup = internalInstance.mountComponent(transaction, hostParent, hostContainerInfo, context, parentDebugID);
  6759. if (internalInstance._currentElement && internalInstance._currentElement.ref != null) {
  6760. transaction.getReactMountReady().enqueue(attachRefs, internalInstance);
  6761. }
  6762. if (process.env.NODE_ENV !== 'production') {
  6763. if (internalInstance._debugID !== 0) {
  6764. ReactInstrumentation.debugTool.onMountComponent(internalInstance._debugID);
  6765. }
  6766. }
  6767. return markup;
  6768. },
  6769. /**
  6770. * Returns a value that can be passed to
  6771. * ReactComponentEnvironment.replaceNodeWithMarkup.
  6772. */
  6773. getHostNode: function (internalInstance) {
  6774. return internalInstance.getHostNode();
  6775. },
  6776. /**
  6777. * Releases any resources allocated by `mountComponent`.
  6778. *
  6779. * @final
  6780. * @internal
  6781. */
  6782. unmountComponent: function (internalInstance, safely) {
  6783. if (process.env.NODE_ENV !== 'production') {
  6784. if (internalInstance._debugID !== 0) {
  6785. ReactInstrumentation.debugTool.onBeforeUnmountComponent(internalInstance._debugID);
  6786. }
  6787. }
  6788. ReactRef.detachRefs(internalInstance, internalInstance._currentElement);
  6789. internalInstance.unmountComponent(safely);
  6790. if (process.env.NODE_ENV !== 'production') {
  6791. if (internalInstance._debugID !== 0) {
  6792. ReactInstrumentation.debugTool.onUnmountComponent(internalInstance._debugID);
  6793. }
  6794. }
  6795. },
  6796. /**
  6797. * Update a component using a new element.
  6798. *
  6799. * @param {ReactComponent} internalInstance
  6800. * @param {ReactElement} nextElement
  6801. * @param {ReactReconcileTransaction} transaction
  6802. * @param {object} context
  6803. * @internal
  6804. */
  6805. receiveComponent: function (internalInstance, nextElement, transaction, context) {
  6806. var prevElement = internalInstance._currentElement;
  6807. if (nextElement === prevElement && context === internalInstance._context) {
  6808. // Since elements are immutable after the owner is rendered,
  6809. // we can do a cheap identity compare here to determine if this is a
  6810. // superfluous reconcile. It's possible for state to be mutable but such
  6811. // change should trigger an update of the owner which would recreate
  6812. // the element. We explicitly check for the existence of an owner since
  6813. // it's possible for an element created outside a composite to be
  6814. // deeply mutated and reused.
  6815. // TODO: Bailing out early is just a perf optimization right?
  6816. // TODO: Removing the return statement should affect correctness?
  6817. return;
  6818. }
  6819. if (process.env.NODE_ENV !== 'production') {
  6820. if (internalInstance._debugID !== 0) {
  6821. ReactInstrumentation.debugTool.onBeforeUpdateComponent(internalInstance._debugID, nextElement);
  6822. }
  6823. }
  6824. var refsChanged = ReactRef.shouldUpdateRefs(prevElement, nextElement);
  6825. if (refsChanged) {
  6826. ReactRef.detachRefs(internalInstance, prevElement);
  6827. }
  6828. internalInstance.receiveComponent(nextElement, transaction, context);
  6829. if (refsChanged && internalInstance._currentElement && internalInstance._currentElement.ref != null) {
  6830. transaction.getReactMountReady().enqueue(attachRefs, internalInstance);
  6831. }
  6832. if (process.env.NODE_ENV !== 'production') {
  6833. if (internalInstance._debugID !== 0) {
  6834. ReactInstrumentation.debugTool.onUpdateComponent(internalInstance._debugID);
  6835. }
  6836. }
  6837. },
  6838. /**
  6839. * Flush any dirty changes in a component.
  6840. *
  6841. * @param {ReactComponent} internalInstance
  6842. * @param {ReactReconcileTransaction} transaction
  6843. * @internal
  6844. */
  6845. performUpdateIfNecessary: function (internalInstance, transaction, updateBatchNumber) {
  6846. if (internalInstance._updateBatchNumber !== updateBatchNumber) {
  6847. // The component's enqueued batch number should always be the current
  6848. // batch or the following one.
  6849. process.env.NODE_ENV !== 'production' ? warning(internalInstance._updateBatchNumber == null || internalInstance._updateBatchNumber === updateBatchNumber + 1, 'performUpdateIfNecessary: Unexpected batch number (current %s, ' + 'pending %s)', updateBatchNumber, internalInstance._updateBatchNumber) : void 0;
  6850. return;
  6851. }
  6852. if (process.env.NODE_ENV !== 'production') {
  6853. if (internalInstance._debugID !== 0) {
  6854. ReactInstrumentation.debugTool.onBeforeUpdateComponent(internalInstance._debugID, internalInstance._currentElement);
  6855. }
  6856. }
  6857. internalInstance.performUpdateIfNecessary(transaction);
  6858. if (process.env.NODE_ENV !== 'production') {
  6859. if (internalInstance._debugID !== 0) {
  6860. ReactInstrumentation.debugTool.onUpdateComponent(internalInstance._debugID);
  6861. }
  6862. }
  6863. }
  6864. };
  6865. module.exports = ReactReconciler;
  6866. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  6867. /***/ },
  6868. /* 62 */
  6869. /***/ function(module, exports, __webpack_require__) {
  6870. /**
  6871. * Copyright 2013-present, Facebook, Inc.
  6872. * All rights reserved.
  6873. *
  6874. * This source code is licensed under the BSD-style license found in the
  6875. * LICENSE file in the root directory of this source tree. An additional grant
  6876. * of patent rights can be found in the PATENTS file in the same directory.
  6877. *
  6878. * @providesModule ReactRef
  6879. */
  6880. 'use strict';
  6881. var ReactOwner = __webpack_require__(63);
  6882. var ReactRef = {};
  6883. function attachRef(ref, component, owner) {
  6884. if (typeof ref === 'function') {
  6885. ref(component.getPublicInstance());
  6886. } else {
  6887. // Legacy ref
  6888. ReactOwner.addComponentAsRefTo(component, ref, owner);
  6889. }
  6890. }
  6891. function detachRef(ref, component, owner) {
  6892. if (typeof ref === 'function') {
  6893. ref(null);
  6894. } else {
  6895. // Legacy ref
  6896. ReactOwner.removeComponentAsRefFrom(component, ref, owner);
  6897. }
  6898. }
  6899. ReactRef.attachRefs = function (instance, element) {
  6900. if (element === null || element === false) {
  6901. return;
  6902. }
  6903. var ref = element.ref;
  6904. if (ref != null) {
  6905. attachRef(ref, instance, element._owner);
  6906. }
  6907. };
  6908. ReactRef.shouldUpdateRefs = function (prevElement, nextElement) {
  6909. // If either the owner or a `ref` has changed, make sure the newest owner
  6910. // has stored a reference to `this`, and the previous owner (if different)
  6911. // has forgotten the reference to `this`. We use the element instead
  6912. // of the public this.props because the post processing cannot determine
  6913. // a ref. The ref conceptually lives on the element.
  6914. // TODO: Should this even be possible? The owner cannot change because
  6915. // it's forbidden by shouldUpdateReactComponent. The ref can change
  6916. // if you swap the keys of but not the refs. Reconsider where this check
  6917. // is made. It probably belongs where the key checking and
  6918. // instantiateReactComponent is done.
  6919. var prevEmpty = prevElement === null || prevElement === false;
  6920. var nextEmpty = nextElement === null || nextElement === false;
  6921. return (
  6922. // This has a few false positives w/r/t empty components.
  6923. prevEmpty || nextEmpty || nextElement.ref !== prevElement.ref ||
  6924. // If owner changes but we have an unchanged function ref, don't update refs
  6925. typeof nextElement.ref === 'string' && nextElement._owner !== prevElement._owner
  6926. );
  6927. };
  6928. ReactRef.detachRefs = function (instance, element) {
  6929. if (element === null || element === false) {
  6930. return;
  6931. }
  6932. var ref = element.ref;
  6933. if (ref != null) {
  6934. detachRef(ref, instance, element._owner);
  6935. }
  6936. };
  6937. module.exports = ReactRef;
  6938. /***/ },
  6939. /* 63 */
  6940. /***/ function(module, exports, __webpack_require__) {
  6941. /* WEBPACK VAR INJECTION */(function(process) {/**
  6942. * Copyright 2013-present, Facebook, Inc.
  6943. * All rights reserved.
  6944. *
  6945. * This source code is licensed under the BSD-style license found in the
  6946. * LICENSE file in the root directory of this source tree. An additional grant
  6947. * of patent rights can be found in the PATENTS file in the same directory.
  6948. *
  6949. * @providesModule ReactOwner
  6950. */
  6951. 'use strict';
  6952. var _prodInvariant = __webpack_require__(9);
  6953. var invariant = __webpack_require__(10);
  6954. /**
  6955. * ReactOwners are capable of storing references to owned components.
  6956. *
  6957. * All components are capable of //being// referenced by owner components, but
  6958. * only ReactOwner components are capable of //referencing// owned components.
  6959. * The named reference is known as a "ref".
  6960. *
  6961. * Refs are available when mounted and updated during reconciliation.
  6962. *
  6963. * var MyComponent = React.createClass({
  6964. * render: function() {
  6965. * return (
  6966. * <div onClick={this.handleClick}>
  6967. * <CustomComponent ref="custom" />
  6968. * </div>
  6969. * );
  6970. * },
  6971. * handleClick: function() {
  6972. * this.refs.custom.handleClick();
  6973. * },
  6974. * componentDidMount: function() {
  6975. * this.refs.custom.initialize();
  6976. * }
  6977. * });
  6978. *
  6979. * Refs should rarely be used. When refs are used, they should only be done to
  6980. * control data that is not handled by React's data flow.
  6981. *
  6982. * @class ReactOwner
  6983. */
  6984. var ReactOwner = {
  6985. /**
  6986. * @param {?object} object
  6987. * @return {boolean} True if `object` is a valid owner.
  6988. * @final
  6989. */
  6990. isValidOwner: function (object) {
  6991. return !!(object && typeof object.attachRef === 'function' && typeof object.detachRef === 'function');
  6992. },
  6993. /**
  6994. * Adds a component by ref to an owner component.
  6995. *
  6996. * @param {ReactComponent} component Component to reference.
  6997. * @param {string} ref Name by which to refer to the component.
  6998. * @param {ReactOwner} owner Component on which to record the ref.
  6999. * @final
  7000. * @internal
  7001. */
  7002. addComponentAsRefTo: function (component, ref, owner) {
  7003. !ReactOwner.isValidOwner(owner) ? process.env.NODE_ENV !== 'production' ? 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).') : _prodInvariant('119') : void 0;
  7004. owner.attachRef(ref, component);
  7005. },
  7006. /**
  7007. * Removes a component by ref from an owner component.
  7008. *
  7009. * @param {ReactComponent} component Component to dereference.
  7010. * @param {string} ref Name of the ref to remove.
  7011. * @param {ReactOwner} owner Component on which the ref is recorded.
  7012. * @final
  7013. * @internal
  7014. */
  7015. removeComponentAsRefFrom: function (component, ref, owner) {
  7016. !ReactOwner.isValidOwner(owner) ? process.env.NODE_ENV !== 'production' ? 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).') : _prodInvariant('120') : void 0;
  7017. var ownerPublicInstance = owner.getPublicInstance();
  7018. // Check that `component`'s owner is still alive and that `component` is still the current ref
  7019. // because we do not want to detach the ref if another component stole it.
  7020. if (ownerPublicInstance && ownerPublicInstance.refs[ref] === component.getPublicInstance()) {
  7021. owner.detachRef(ref);
  7022. }
  7023. }
  7024. };
  7025. module.exports = ReactOwner;
  7026. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  7027. /***/ },
  7028. /* 64 */
  7029. /***/ function(module, exports, __webpack_require__) {
  7030. /* WEBPACK VAR INJECTION */(function(process) {/**
  7031. * Copyright 2016-present, Facebook, Inc.
  7032. * All rights reserved.
  7033. *
  7034. * This source code is licensed under the BSD-style license found in the
  7035. * LICENSE file in the root directory of this source tree. An additional grant
  7036. * of patent rights can be found in the PATENTS file in the same directory.
  7037. *
  7038. * @providesModule ReactInstrumentation
  7039. */
  7040. 'use strict';
  7041. var debugTool = null;
  7042. if (process.env.NODE_ENV !== 'production') {
  7043. var ReactDebugTool = __webpack_require__(65);
  7044. debugTool = ReactDebugTool;
  7045. }
  7046. module.exports = { debugTool: debugTool };
  7047. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  7048. /***/ },
  7049. /* 65 */
  7050. /***/ function(module, exports, __webpack_require__) {
  7051. /* WEBPACK VAR INJECTION */(function(process) {/**
  7052. * Copyright 2016-present, Facebook, Inc.
  7053. * All rights reserved.
  7054. *
  7055. * This source code is licensed under the BSD-style license found in the
  7056. * LICENSE file in the root directory of this source tree. An additional grant
  7057. * of patent rights can be found in the PATENTS file in the same directory.
  7058. *
  7059. * @providesModule ReactDebugTool
  7060. */
  7061. 'use strict';
  7062. var ReactInvalidSetStateWarningHook = __webpack_require__(66);
  7063. var ReactHostOperationHistoryHook = __webpack_require__(67);
  7064. var ReactComponentTreeHook = __webpack_require__(30);
  7065. var ReactChildrenMutationWarningHook = __webpack_require__(68);
  7066. var ExecutionEnvironment = __webpack_require__(51);
  7067. var performanceNow = __webpack_require__(69);
  7068. var warning = __webpack_require__(13);
  7069. var hooks = [];
  7070. var didHookThrowForEvent = {};
  7071. function callHook(event, fn, context, arg1, arg2, arg3, arg4, arg5) {
  7072. try {
  7073. fn.call(context, arg1, arg2, arg3, arg4, arg5);
  7074. } catch (e) {
  7075. process.env.NODE_ENV !== 'production' ? warning(didHookThrowForEvent[event], 'Exception thrown by hook while handling %s: %s', event, e + '\n' + e.stack) : void 0;
  7076. didHookThrowForEvent[event] = true;
  7077. }
  7078. }
  7079. function emitEvent(event, arg1, arg2, arg3, arg4, arg5) {
  7080. for (var i = 0; i < hooks.length; i++) {
  7081. var hook = hooks[i];
  7082. var fn = hook[event];
  7083. if (fn) {
  7084. callHook(event, fn, hook, arg1, arg2, arg3, arg4, arg5);
  7085. }
  7086. }
  7087. }
  7088. var isProfiling = false;
  7089. var flushHistory = [];
  7090. var lifeCycleTimerStack = [];
  7091. var currentFlushNesting = 0;
  7092. var currentFlushMeasurements = null;
  7093. var currentFlushStartTime = null;
  7094. var currentTimerDebugID = null;
  7095. var currentTimerStartTime = null;
  7096. var currentTimerNestedFlushDuration = null;
  7097. var currentTimerType = null;
  7098. var lifeCycleTimerHasWarned = false;
  7099. function clearHistory() {
  7100. ReactComponentTreeHook.purgeUnmountedComponents();
  7101. ReactHostOperationHistoryHook.clearHistory();
  7102. }
  7103. function getTreeSnapshot(registeredIDs) {
  7104. return registeredIDs.reduce(function (tree, id) {
  7105. var ownerID = ReactComponentTreeHook.getOwnerID(id);
  7106. var parentID = ReactComponentTreeHook.getParentID(id);
  7107. tree[id] = {
  7108. displayName: ReactComponentTreeHook.getDisplayName(id),
  7109. text: ReactComponentTreeHook.getText(id),
  7110. updateCount: ReactComponentTreeHook.getUpdateCount(id),
  7111. childIDs: ReactComponentTreeHook.getChildIDs(id),
  7112. // Text nodes don't have owners but this is close enough.
  7113. ownerID: ownerID || ReactComponentTreeHook.getOwnerID(parentID),
  7114. parentID: parentID
  7115. };
  7116. return tree;
  7117. }, {});
  7118. }
  7119. function resetMeasurements() {
  7120. var previousStartTime = currentFlushStartTime;
  7121. var previousMeasurements = currentFlushMeasurements || [];
  7122. var previousOperations = ReactHostOperationHistoryHook.getHistory();
  7123. if (currentFlushNesting === 0) {
  7124. currentFlushStartTime = null;
  7125. currentFlushMeasurements = null;
  7126. clearHistory();
  7127. return;
  7128. }
  7129. if (previousMeasurements.length || previousOperations.length) {
  7130. var registeredIDs = ReactComponentTreeHook.getRegisteredIDs();
  7131. flushHistory.push({
  7132. duration: performanceNow() - previousStartTime,
  7133. measurements: previousMeasurements || [],
  7134. operations: previousOperations || [],
  7135. treeSnapshot: getTreeSnapshot(registeredIDs)
  7136. });
  7137. }
  7138. clearHistory();
  7139. currentFlushStartTime = performanceNow();
  7140. currentFlushMeasurements = [];
  7141. }
  7142. function checkDebugID(debugID) {
  7143. var allowRoot = arguments.length <= 1 || arguments[1] === undefined ? false : arguments[1];
  7144. if (allowRoot && debugID === 0) {
  7145. return;
  7146. }
  7147. if (!debugID) {
  7148. process.env.NODE_ENV !== 'production' ? warning(false, 'ReactDebugTool: debugID may not be empty.') : void 0;
  7149. }
  7150. }
  7151. function beginLifeCycleTimer(debugID, timerType) {
  7152. if (currentFlushNesting === 0) {
  7153. return;
  7154. }
  7155. if (currentTimerType && !lifeCycleTimerHasWarned) {
  7156. process.env.NODE_ENV !== 'production' ? warning(false, '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;
  7157. lifeCycleTimerHasWarned = true;
  7158. }
  7159. currentTimerStartTime = performanceNow();
  7160. currentTimerNestedFlushDuration = 0;
  7161. currentTimerDebugID = debugID;
  7162. currentTimerType = timerType;
  7163. }
  7164. function endLifeCycleTimer(debugID, timerType) {
  7165. if (currentFlushNesting === 0) {
  7166. return;
  7167. }
  7168. if (currentTimerType !== timerType && !lifeCycleTimerHasWarned) {
  7169. process.env.NODE_ENV !== 'production' ? warning(false, '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;
  7170. lifeCycleTimerHasWarned = true;
  7171. }
  7172. if (isProfiling) {
  7173. currentFlushMeasurements.push({
  7174. timerType: timerType,
  7175. instanceID: debugID,
  7176. duration: performanceNow() - currentTimerStartTime - currentTimerNestedFlushDuration
  7177. });
  7178. }
  7179. currentTimerStartTime = null;
  7180. currentTimerNestedFlushDuration = null;
  7181. currentTimerDebugID = null;
  7182. currentTimerType = null;
  7183. }
  7184. function pauseCurrentLifeCycleTimer() {
  7185. var currentTimer = {
  7186. startTime: currentTimerStartTime,
  7187. nestedFlushStartTime: performanceNow(),
  7188. debugID: currentTimerDebugID,
  7189. timerType: currentTimerType
  7190. };
  7191. lifeCycleTimerStack.push(currentTimer);
  7192. currentTimerStartTime = null;
  7193. currentTimerNestedFlushDuration = null;
  7194. currentTimerDebugID = null;
  7195. currentTimerType = null;
  7196. }
  7197. function resumeCurrentLifeCycleTimer() {
  7198. var _lifeCycleTimerStack$ = lifeCycleTimerStack.pop();
  7199. var startTime = _lifeCycleTimerStack$.startTime;
  7200. var nestedFlushStartTime = _lifeCycleTimerStack$.nestedFlushStartTime;
  7201. var debugID = _lifeCycleTimerStack$.debugID;
  7202. var timerType = _lifeCycleTimerStack$.timerType;
  7203. var nestedFlushDuration = performanceNow() - nestedFlushStartTime;
  7204. currentTimerStartTime = startTime;
  7205. currentTimerNestedFlushDuration += nestedFlushDuration;
  7206. currentTimerDebugID = debugID;
  7207. currentTimerType = timerType;
  7208. }
  7209. var ReactDebugTool = {
  7210. addHook: function (hook) {
  7211. hooks.push(hook);
  7212. },
  7213. removeHook: function (hook) {
  7214. for (var i = 0; i < hooks.length; i++) {
  7215. if (hooks[i] === hook) {
  7216. hooks.splice(i, 1);
  7217. i--;
  7218. }
  7219. }
  7220. },
  7221. isProfiling: function () {
  7222. return isProfiling;
  7223. },
  7224. beginProfiling: function () {
  7225. if (isProfiling) {
  7226. return;
  7227. }
  7228. isProfiling = true;
  7229. flushHistory.length = 0;
  7230. resetMeasurements();
  7231. ReactDebugTool.addHook(ReactHostOperationHistoryHook);
  7232. },
  7233. endProfiling: function () {
  7234. if (!isProfiling) {
  7235. return;
  7236. }
  7237. isProfiling = false;
  7238. resetMeasurements();
  7239. ReactDebugTool.removeHook(ReactHostOperationHistoryHook);
  7240. },
  7241. getFlushHistory: function () {
  7242. return flushHistory;
  7243. },
  7244. onBeginFlush: function () {
  7245. currentFlushNesting++;
  7246. resetMeasurements();
  7247. pauseCurrentLifeCycleTimer();
  7248. emitEvent('onBeginFlush');
  7249. },
  7250. onEndFlush: function () {
  7251. resetMeasurements();
  7252. currentFlushNesting--;
  7253. resumeCurrentLifeCycleTimer();
  7254. emitEvent('onEndFlush');
  7255. },
  7256. onBeginLifeCycleTimer: function (debugID, timerType) {
  7257. checkDebugID(debugID);
  7258. emitEvent('onBeginLifeCycleTimer', debugID, timerType);
  7259. beginLifeCycleTimer(debugID, timerType);
  7260. },
  7261. onEndLifeCycleTimer: function (debugID, timerType) {
  7262. checkDebugID(debugID);
  7263. endLifeCycleTimer(debugID, timerType);
  7264. emitEvent('onEndLifeCycleTimer', debugID, timerType);
  7265. },
  7266. onError: function (debugID) {
  7267. if (currentTimerDebugID != null) {
  7268. endLifeCycleTimer(currentTimerDebugID, currentTimerType);
  7269. }
  7270. emitEvent('onError', debugID);
  7271. },
  7272. onBeginProcessingChildContext: function () {
  7273. emitEvent('onBeginProcessingChildContext');
  7274. },
  7275. onEndProcessingChildContext: function () {
  7276. emitEvent('onEndProcessingChildContext');
  7277. },
  7278. onHostOperation: function (debugID, type, payload) {
  7279. checkDebugID(debugID);
  7280. emitEvent('onHostOperation', debugID, type, payload);
  7281. },
  7282. onSetState: function () {
  7283. emitEvent('onSetState');
  7284. },
  7285. onSetChildren: function (debugID, childDebugIDs) {
  7286. checkDebugID(debugID);
  7287. childDebugIDs.forEach(checkDebugID);
  7288. emitEvent('onSetChildren', debugID, childDebugIDs);
  7289. },
  7290. onBeforeMountComponent: function (debugID, element, parentDebugID) {
  7291. checkDebugID(debugID);
  7292. checkDebugID(parentDebugID, true);
  7293. emitEvent('onBeforeMountComponent', debugID, element, parentDebugID);
  7294. },
  7295. onMountComponent: function (debugID) {
  7296. checkDebugID(debugID);
  7297. emitEvent('onMountComponent', debugID);
  7298. },
  7299. onBeforeUpdateComponent: function (debugID, element) {
  7300. checkDebugID(debugID);
  7301. emitEvent('onBeforeUpdateComponent', debugID, element);
  7302. },
  7303. onUpdateComponent: function (debugID) {
  7304. checkDebugID(debugID);
  7305. emitEvent('onUpdateComponent', debugID);
  7306. },
  7307. onBeforeUnmountComponent: function (debugID) {
  7308. checkDebugID(debugID);
  7309. emitEvent('onBeforeUnmountComponent', debugID);
  7310. },
  7311. onUnmountComponent: function (debugID) {
  7312. checkDebugID(debugID);
  7313. emitEvent('onUnmountComponent', debugID);
  7314. },
  7315. onTestEvent: function () {
  7316. emitEvent('onTestEvent');
  7317. }
  7318. };
  7319. // TODO remove these when RN/www gets updated
  7320. ReactDebugTool.addDevtool = ReactDebugTool.addHook;
  7321. ReactDebugTool.removeDevtool = ReactDebugTool.removeHook;
  7322. ReactDebugTool.addHook(ReactInvalidSetStateWarningHook);
  7323. ReactDebugTool.addHook(ReactComponentTreeHook);
  7324. ReactDebugTool.addHook(ReactChildrenMutationWarningHook);
  7325. var url = ExecutionEnvironment.canUseDOM && window.location.href || '';
  7326. if (/[?&]react_perf\b/.test(url)) {
  7327. ReactDebugTool.beginProfiling();
  7328. }
  7329. module.exports = ReactDebugTool;
  7330. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  7331. /***/ },
  7332. /* 66 */
  7333. /***/ function(module, exports, __webpack_require__) {
  7334. /* WEBPACK VAR INJECTION */(function(process) {/**
  7335. * Copyright 2016-present, Facebook, Inc.
  7336. * All rights reserved.
  7337. *
  7338. * This source code is licensed under the BSD-style license found in the
  7339. * LICENSE file in the root directory of this source tree. An additional grant
  7340. * of patent rights can be found in the PATENTS file in the same directory.
  7341. *
  7342. * @providesModule ReactInvalidSetStateWarningHook
  7343. */
  7344. 'use strict';
  7345. var warning = __webpack_require__(13);
  7346. if (process.env.NODE_ENV !== 'production') {
  7347. var processingChildContext = false;
  7348. var warnInvalidSetState = function () {
  7349. process.env.NODE_ENV !== 'production' ? warning(!processingChildContext, 'setState(...): Cannot call setState() inside getChildContext()') : void 0;
  7350. };
  7351. }
  7352. var ReactInvalidSetStateWarningHook = {
  7353. onBeginProcessingChildContext: function () {
  7354. processingChildContext = true;
  7355. },
  7356. onEndProcessingChildContext: function () {
  7357. processingChildContext = false;
  7358. },
  7359. onSetState: function () {
  7360. warnInvalidSetState();
  7361. }
  7362. };
  7363. module.exports = ReactInvalidSetStateWarningHook;
  7364. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  7365. /***/ },
  7366. /* 67 */
  7367. /***/ function(module, exports) {
  7368. /**
  7369. * Copyright 2016-present, Facebook, Inc.
  7370. * All rights reserved.
  7371. *
  7372. * This source code is licensed under the BSD-style license found in the
  7373. * LICENSE file in the root directory of this source tree. An additional grant
  7374. * of patent rights can be found in the PATENTS file in the same directory.
  7375. *
  7376. * @providesModule ReactHostOperationHistoryHook
  7377. */
  7378. 'use strict';
  7379. var history = [];
  7380. var ReactHostOperationHistoryHook = {
  7381. onHostOperation: function (debugID, type, payload) {
  7382. history.push({
  7383. instanceID: debugID,
  7384. type: type,
  7385. payload: payload
  7386. });
  7387. },
  7388. clearHistory: function () {
  7389. if (ReactHostOperationHistoryHook._preventClearing) {
  7390. // Should only be used for tests.
  7391. return;
  7392. }
  7393. history = [];
  7394. },
  7395. getHistory: function () {
  7396. return history;
  7397. }
  7398. };
  7399. module.exports = ReactHostOperationHistoryHook;
  7400. /***/ },
  7401. /* 68 */
  7402. /***/ function(module, exports, __webpack_require__) {
  7403. /* WEBPACK VAR INJECTION */(function(process) {/**
  7404. * Copyright 2013-present, Facebook, Inc.
  7405. * All rights reserved.
  7406. *
  7407. * This source code is licensed under the BSD-style license found in the
  7408. * LICENSE file in the root directory of this source tree. An additional grant
  7409. * of patent rights can be found in the PATENTS file in the same directory.
  7410. *
  7411. * @providesModule ReactChildrenMutationWarningHook
  7412. */
  7413. 'use strict';
  7414. var ReactComponentTreeHook = __webpack_require__(30);
  7415. var warning = __webpack_require__(13);
  7416. function handleElement(debugID, element) {
  7417. if (element == null) {
  7418. return;
  7419. }
  7420. if (element._shadowChildren === undefined) {
  7421. return;
  7422. }
  7423. if (element._shadowChildren === element.props.children) {
  7424. return;
  7425. }
  7426. var isMutated = false;
  7427. if (Array.isArray(element._shadowChildren)) {
  7428. if (element._shadowChildren.length === element.props.children.length) {
  7429. for (var i = 0; i < element._shadowChildren.length; i++) {
  7430. if (element._shadowChildren[i] !== element.props.children[i]) {
  7431. isMutated = true;
  7432. }
  7433. }
  7434. } else {
  7435. isMutated = true;
  7436. }
  7437. }
  7438. if (!Array.isArray(element._shadowChildren) || isMutated) {
  7439. process.env.NODE_ENV !== 'production' ? warning(false, 'Component\'s children should not be mutated.%s', ReactComponentTreeHook.getStackAddendumByID(debugID)) : void 0;
  7440. }
  7441. }
  7442. var ReactChildrenMutationWarningHook = {
  7443. onMountComponent: function (debugID) {
  7444. handleElement(debugID, ReactComponentTreeHook.getElement(debugID));
  7445. },
  7446. onUpdateComponent: function (debugID) {
  7447. handleElement(debugID, ReactComponentTreeHook.getElement(debugID));
  7448. }
  7449. };
  7450. module.exports = ReactChildrenMutationWarningHook;
  7451. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  7452. /***/ },
  7453. /* 69 */
  7454. /***/ function(module, exports, __webpack_require__) {
  7455. 'use strict';
  7456. /**
  7457. * Copyright (c) 2013-present, Facebook, Inc.
  7458. * All rights reserved.
  7459. *
  7460. * This source code is licensed under the BSD-style license found in the
  7461. * LICENSE file in the root directory of this source tree. An additional grant
  7462. * of patent rights can be found in the PATENTS file in the same directory.
  7463. *
  7464. * @typechecks
  7465. */
  7466. var performance = __webpack_require__(70);
  7467. var performanceNow;
  7468. /**
  7469. * Detect if we can use `window.performance.now()` and gracefully fallback to
  7470. * `Date.now()` if it doesn't exist. We need to support Firefox < 15 for now
  7471. * because of Facebook's testing infrastructure.
  7472. */
  7473. if (performance.now) {
  7474. performanceNow = function performanceNow() {
  7475. return performance.now();
  7476. };
  7477. } else {
  7478. performanceNow = function performanceNow() {
  7479. return Date.now();
  7480. };
  7481. }
  7482. module.exports = performanceNow;
  7483. /***/ },
  7484. /* 70 */
  7485. /***/ function(module, exports, __webpack_require__) {
  7486. /**
  7487. * Copyright (c) 2013-present, Facebook, Inc.
  7488. * All rights reserved.
  7489. *
  7490. * This source code is licensed under the BSD-style license found in the
  7491. * LICENSE file in the root directory of this source tree. An additional grant
  7492. * of patent rights can be found in the PATENTS file in the same directory.
  7493. *
  7494. * @typechecks
  7495. */
  7496. 'use strict';
  7497. var ExecutionEnvironment = __webpack_require__(51);
  7498. var performance;
  7499. if (ExecutionEnvironment.canUseDOM) {
  7500. performance = window.performance || window.msPerformance || window.webkitPerformance;
  7501. }
  7502. module.exports = performance || {};
  7503. /***/ },
  7504. /* 71 */
  7505. /***/ function(module, exports, __webpack_require__) {
  7506. /* WEBPACK VAR INJECTION */(function(process) {/**
  7507. * Copyright 2013-present, Facebook, Inc.
  7508. * All rights reserved.
  7509. *
  7510. * This source code is licensed under the BSD-style license found in the
  7511. * LICENSE file in the root directory of this source tree. An additional grant
  7512. * of patent rights can be found in the PATENTS file in the same directory.
  7513. *
  7514. * @providesModule Transaction
  7515. */
  7516. 'use strict';
  7517. var _prodInvariant = __webpack_require__(9);
  7518. var invariant = __webpack_require__(10);
  7519. /**
  7520. * `Transaction` creates a black box that is able to wrap any method such that
  7521. * certain invariants are maintained before and after the method is invoked
  7522. * (Even if an exception is thrown while invoking the wrapped method). Whoever
  7523. * instantiates a transaction can provide enforcers of the invariants at
  7524. * creation time. The `Transaction` class itself will supply one additional
  7525. * automatic invariant for you - the invariant that any transaction instance
  7526. * should not be run while it is already being run. You would typically create a
  7527. * single instance of a `Transaction` for reuse multiple times, that potentially
  7528. * is used to wrap several different methods. Wrappers are extremely simple -
  7529. * they only require implementing two methods.
  7530. *
  7531. * <pre>
  7532. * wrappers (injected at creation time)
  7533. * + +
  7534. * | |
  7535. * +-----------------|--------|--------------+
  7536. * | v | |
  7537. * | +---------------+ | |
  7538. * | +--| wrapper1 |---|----+ |
  7539. * | | +---------------+ v | |
  7540. * | | +-------------+ | |
  7541. * | | +----| wrapper2 |--------+ |
  7542. * | | | +-------------+ | | |
  7543. * | | | | | |
  7544. * | v v v v | wrapper
  7545. * | +---+ +---+ +---------+ +---+ +---+ | invariants
  7546. * perform(anyMethod) | | | | | | | | | | | | maintained
  7547. * +----------------->|-|---|-|---|-->|anyMethod|---|---|-|---|-|-------->
  7548. * | | | | | | | | | | | |
  7549. * | | | | | | | | | | | |
  7550. * | | | | | | | | | | | |
  7551. * | +---+ +---+ +---------+ +---+ +---+ |
  7552. * | initialize close |
  7553. * +-----------------------------------------+
  7554. * </pre>
  7555. *
  7556. * Use cases:
  7557. * - Preserving the input selection ranges before/after reconciliation.
  7558. * Restoring selection even in the event of an unexpected error.
  7559. * - Deactivating events while rearranging the DOM, preventing blurs/focuses,
  7560. * while guaranteeing that afterwards, the event system is reactivated.
  7561. * - Flushing a queue of collected DOM mutations to the main UI thread after a
  7562. * reconciliation takes place in a worker thread.
  7563. * - Invoking any collected `componentDidUpdate` callbacks after rendering new
  7564. * content.
  7565. * - (Future use case): Wrapping particular flushes of the `ReactWorker` queue
  7566. * to preserve the `scrollTop` (an automatic scroll aware DOM).
  7567. * - (Future use case): Layout calculations before and after DOM updates.
  7568. *
  7569. * Transactional plugin API:
  7570. * - A module that has an `initialize` method that returns any precomputation.
  7571. * - and a `close` method that accepts the precomputation. `close` is invoked
  7572. * when the wrapped process is completed, or has failed.
  7573. *
  7574. * @param {Array<TransactionalWrapper>} transactionWrapper Wrapper modules
  7575. * that implement `initialize` and `close`.
  7576. * @return {Transaction} Single transaction for reuse in thread.
  7577. *
  7578. * @class Transaction
  7579. */
  7580. var Mixin = {
  7581. /**
  7582. * Sets up this instance so that it is prepared for collecting metrics. Does
  7583. * so such that this setup method may be used on an instance that is already
  7584. * initialized, in a way that does not consume additional memory upon reuse.
  7585. * That can be useful if you decide to make your subclass of this mixin a
  7586. * "PooledClass".
  7587. */
  7588. reinitializeTransaction: function () {
  7589. this.transactionWrappers = this.getTransactionWrappers();
  7590. if (this.wrapperInitData) {
  7591. this.wrapperInitData.length = 0;
  7592. } else {
  7593. this.wrapperInitData = [];
  7594. }
  7595. this._isInTransaction = false;
  7596. },
  7597. _isInTransaction: false,
  7598. /**
  7599. * @abstract
  7600. * @return {Array<TransactionWrapper>} Array of transaction wrappers.
  7601. */
  7602. getTransactionWrappers: null,
  7603. isInTransaction: function () {
  7604. return !!this._isInTransaction;
  7605. },
  7606. /**
  7607. * Executes the function within a safety window. Use this for the top level
  7608. * methods that result in large amounts of computation/mutations that would
  7609. * need to be safety checked. The optional arguments helps prevent the need
  7610. * to bind in many cases.
  7611. *
  7612. * @param {function} method Member of scope to call.
  7613. * @param {Object} scope Scope to invoke from.
  7614. * @param {Object?=} a Argument to pass to the method.
  7615. * @param {Object?=} b Argument to pass to the method.
  7616. * @param {Object?=} c Argument to pass to the method.
  7617. * @param {Object?=} d Argument to pass to the method.
  7618. * @param {Object?=} e Argument to pass to the method.
  7619. * @param {Object?=} f Argument to pass to the method.
  7620. *
  7621. * @return {*} Return value from `method`.
  7622. */
  7623. perform: function (method, scope, a, b, c, d, e, f) {
  7624. !!this.isInTransaction() ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Transaction.perform(...): Cannot initialize a transaction when there is already an outstanding transaction.') : _prodInvariant('27') : void 0;
  7625. var errorThrown;
  7626. var ret;
  7627. try {
  7628. this._isInTransaction = true;
  7629. // Catching errors makes debugging more difficult, so we start with
  7630. // errorThrown set to true before setting it to false after calling
  7631. // close -- if it's still set to true in the finally block, it means
  7632. // one of these calls threw.
  7633. errorThrown = true;
  7634. this.initializeAll(0);
  7635. ret = method.call(scope, a, b, c, d, e, f);
  7636. errorThrown = false;
  7637. } finally {
  7638. try {
  7639. if (errorThrown) {
  7640. // If `method` throws, prefer to show that stack trace over any thrown
  7641. // by invoking `closeAll`.
  7642. try {
  7643. this.closeAll(0);
  7644. } catch (err) {}
  7645. } else {
  7646. // Since `method` didn't throw, we don't want to silence the exception
  7647. // here.
  7648. this.closeAll(0);
  7649. }
  7650. } finally {
  7651. this._isInTransaction = false;
  7652. }
  7653. }
  7654. return ret;
  7655. },
  7656. initializeAll: function (startIndex) {
  7657. var transactionWrappers = this.transactionWrappers;
  7658. for (var i = startIndex; i < transactionWrappers.length; i++) {
  7659. var wrapper = transactionWrappers[i];
  7660. try {
  7661. // Catching errors makes debugging more difficult, so we start with the
  7662. // OBSERVED_ERROR state before overwriting it with the real return value
  7663. // of initialize -- if it's still set to OBSERVED_ERROR in the finally
  7664. // block, it means wrapper.initialize threw.
  7665. this.wrapperInitData[i] = Transaction.OBSERVED_ERROR;
  7666. this.wrapperInitData[i] = wrapper.initialize ? wrapper.initialize.call(this) : null;
  7667. } finally {
  7668. if (this.wrapperInitData[i] === Transaction.OBSERVED_ERROR) {
  7669. // The initializer for wrapper i threw an error; initialize the
  7670. // remaining wrappers but silence any exceptions from them to ensure
  7671. // that the first error is the one to bubble up.
  7672. try {
  7673. this.initializeAll(i + 1);
  7674. } catch (err) {}
  7675. }
  7676. }
  7677. }
  7678. },
  7679. /**
  7680. * Invokes each of `this.transactionWrappers.close[i]` functions, passing into
  7681. * them the respective return values of `this.transactionWrappers.init[i]`
  7682. * (`close`rs that correspond to initializers that failed will not be
  7683. * invoked).
  7684. */
  7685. closeAll: function (startIndex) {
  7686. !this.isInTransaction() ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Transaction.closeAll(): Cannot close transaction when none are open.') : _prodInvariant('28') : void 0;
  7687. var transactionWrappers = this.transactionWrappers;
  7688. for (var i = startIndex; i < transactionWrappers.length; i++) {
  7689. var wrapper = transactionWrappers[i];
  7690. var initData = this.wrapperInitData[i];
  7691. var errorThrown;
  7692. try {
  7693. // Catching errors makes debugging more difficult, so we start with
  7694. // errorThrown set to true before setting it to false after calling
  7695. // close -- if it's still set to true in the finally block, it means
  7696. // wrapper.close threw.
  7697. errorThrown = true;
  7698. if (initData !== Transaction.OBSERVED_ERROR && wrapper.close) {
  7699. wrapper.close.call(this, initData);
  7700. }
  7701. errorThrown = false;
  7702. } finally {
  7703. if (errorThrown) {
  7704. // The closer for wrapper i threw an error; close the remaining
  7705. // wrappers but silence any exceptions from them to ensure that the
  7706. // first error is the one to bubble up.
  7707. try {
  7708. this.closeAll(i + 1);
  7709. } catch (e) {}
  7710. }
  7711. }
  7712. }
  7713. this.wrapperInitData.length = 0;
  7714. }
  7715. };
  7716. var Transaction = {
  7717. Mixin: Mixin,
  7718. /**
  7719. * Token to look for to determine if an error occurred.
  7720. */
  7721. OBSERVED_ERROR: {}
  7722. };
  7723. module.exports = Transaction;
  7724. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  7725. /***/ },
  7726. /* 72 */
  7727. /***/ function(module, exports) {
  7728. /**
  7729. * Copyright 2013-present, Facebook, Inc.
  7730. * All rights reserved.
  7731. *
  7732. * This source code is licensed under the BSD-style license found in the
  7733. * LICENSE file in the root directory of this source tree. An additional grant
  7734. * of patent rights can be found in the PATENTS file in the same directory.
  7735. *
  7736. * @providesModule getEventTarget
  7737. */
  7738. 'use strict';
  7739. /**
  7740. * Gets the target node from a native browser event by accounting for
  7741. * inconsistencies in browser DOM APIs.
  7742. *
  7743. * @param {object} nativeEvent Native browser event.
  7744. * @return {DOMEventTarget} Target node.
  7745. */
  7746. function getEventTarget(nativeEvent) {
  7747. var target = nativeEvent.target || nativeEvent.srcElement || window;
  7748. // Normalize SVG <use> element events #4963
  7749. if (target.correspondingUseElement) {
  7750. target = target.correspondingUseElement;
  7751. }
  7752. // Safari may fire events on text nodes (Node.TEXT_NODE is 3).
  7753. // @see http://www.quirksmode.org/js/events_properties.html
  7754. return target.nodeType === 3 ? target.parentNode : target;
  7755. }
  7756. module.exports = getEventTarget;
  7757. /***/ },
  7758. /* 73 */
  7759. /***/ function(module, exports, __webpack_require__) {
  7760. /**
  7761. * Copyright 2013-present, Facebook, Inc.
  7762. * All rights reserved.
  7763. *
  7764. * This source code is licensed under the BSD-style license found in the
  7765. * LICENSE file in the root directory of this source tree. An additional grant
  7766. * of patent rights can be found in the PATENTS file in the same directory.
  7767. *
  7768. * @providesModule isEventSupported
  7769. */
  7770. 'use strict';
  7771. var ExecutionEnvironment = __webpack_require__(51);
  7772. var useHasFeature;
  7773. if (ExecutionEnvironment.canUseDOM) {
  7774. useHasFeature = document.implementation && document.implementation.hasFeature &&
  7775. // always returns true in newer browsers as per the standard.
  7776. // @see http://dom.spec.whatwg.org/#dom-domimplementation-hasfeature
  7777. document.implementation.hasFeature('', '') !== true;
  7778. }
  7779. /**
  7780. * Checks if an event is supported in the current execution environment.
  7781. *
  7782. * NOTE: This will not work correctly for non-generic events such as `change`,
  7783. * `reset`, `load`, `error`, and `select`.
  7784. *
  7785. * Borrows from Modernizr.
  7786. *
  7787. * @param {string} eventNameSuffix Event name, e.g. "click".
  7788. * @param {?boolean} capture Check if the capture phase is supported.
  7789. * @return {boolean} True if the event is supported.
  7790. * @internal
  7791. * @license Modernizr 3.0.0pre (Custom Build) | MIT
  7792. */
  7793. function isEventSupported(eventNameSuffix, capture) {
  7794. if (!ExecutionEnvironment.canUseDOM || capture && !('addEventListener' in document)) {
  7795. return false;
  7796. }
  7797. var eventName = 'on' + eventNameSuffix;
  7798. var isSupported = eventName in document;
  7799. if (!isSupported) {
  7800. var element = document.createElement('div');
  7801. element.setAttribute(eventName, 'return;');
  7802. isSupported = typeof element[eventName] === 'function';
  7803. }
  7804. if (!isSupported && useHasFeature && eventNameSuffix === 'wheel') {
  7805. // This is the only way to test support for the `wheel` event in IE9+.
  7806. isSupported = document.implementation.hasFeature('Events.wheel', '3.0');
  7807. }
  7808. return isSupported;
  7809. }
  7810. module.exports = isEventSupported;
  7811. /***/ },
  7812. /* 74 */
  7813. /***/ function(module, exports) {
  7814. /**
  7815. * Copyright 2013-present, Facebook, Inc.
  7816. * All rights reserved.
  7817. *
  7818. * This source code is licensed under the BSD-style license found in the
  7819. * LICENSE file in the root directory of this source tree. An additional grant
  7820. * of patent rights can be found in the PATENTS file in the same directory.
  7821. *
  7822. * @providesModule isTextInputElement
  7823. *
  7824. */
  7825. 'use strict';
  7826. /**
  7827. * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#input-type-attr-summary
  7828. */
  7829. var supportedInputTypes = {
  7830. 'color': true,
  7831. 'date': true,
  7832. 'datetime': true,
  7833. 'datetime-local': true,
  7834. 'email': true,
  7835. 'month': true,
  7836. 'number': true,
  7837. 'password': true,
  7838. 'range': true,
  7839. 'search': true,
  7840. 'tel': true,
  7841. 'text': true,
  7842. 'time': true,
  7843. 'url': true,
  7844. 'week': true
  7845. };
  7846. function isTextInputElement(elem) {
  7847. var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();
  7848. if (nodeName === 'input') {
  7849. return !!supportedInputTypes[elem.type];
  7850. }
  7851. if (nodeName === 'textarea') {
  7852. return true;
  7853. }
  7854. return false;
  7855. }
  7856. module.exports = isTextInputElement;
  7857. /***/ },
  7858. /* 75 */
  7859. /***/ function(module, exports, __webpack_require__) {
  7860. /**
  7861. * Copyright 2013-present, Facebook, Inc.
  7862. * All rights reserved.
  7863. *
  7864. * This source code is licensed under the BSD-style license found in the
  7865. * LICENSE file in the root directory of this source tree. An additional grant
  7866. * of patent rights can be found in the PATENTS file in the same directory.
  7867. *
  7868. * @providesModule DefaultEventPluginOrder
  7869. */
  7870. 'use strict';
  7871. var keyOf = __webpack_require__(27);
  7872. /**
  7873. * Module that is injectable into `EventPluginHub`, that specifies a
  7874. * deterministic ordering of `EventPlugin`s. A convenient way to reason about
  7875. * plugins, without having to package every one of them. This is better than
  7876. * having plugins be ordered in the same order that they are injected because
  7877. * that ordering would be influenced by the packaging order.
  7878. * `ResponderEventPlugin` must occur before `SimpleEventPlugin` so that
  7879. * preventing default on events is convenient in `SimpleEventPlugin` handlers.
  7880. */
  7881. var DefaultEventPluginOrder = [keyOf({ ResponderEventPlugin: null }), keyOf({ SimpleEventPlugin: null }), keyOf({ TapEventPlugin: null }), keyOf({ EnterLeaveEventPlugin: null }), keyOf({ ChangeEventPlugin: null }), keyOf({ SelectEventPlugin: null }), keyOf({ BeforeInputEventPlugin: null })];
  7882. module.exports = DefaultEventPluginOrder;
  7883. /***/ },
  7884. /* 76 */
  7885. /***/ function(module, exports, __webpack_require__) {
  7886. /**
  7887. * Copyright 2013-present, Facebook, Inc.
  7888. * All rights reserved.
  7889. *
  7890. * This source code is licensed under the BSD-style license found in the
  7891. * LICENSE file in the root directory of this source tree. An additional grant
  7892. * of patent rights can be found in the PATENTS file in the same directory.
  7893. *
  7894. * @providesModule EnterLeaveEventPlugin
  7895. */
  7896. 'use strict';
  7897. var EventConstants = __webpack_require__(43);
  7898. var EventPropagators = __webpack_require__(44);
  7899. var ReactDOMComponentTree = __webpack_require__(38);
  7900. var SyntheticMouseEvent = __webpack_require__(77);
  7901. var keyOf = __webpack_require__(27);
  7902. var topLevelTypes = EventConstants.topLevelTypes;
  7903. var eventTypes = {
  7904. mouseEnter: {
  7905. registrationName: keyOf({ onMouseEnter: null }),
  7906. dependencies: [topLevelTypes.topMouseOut, topLevelTypes.topMouseOver]
  7907. },
  7908. mouseLeave: {
  7909. registrationName: keyOf({ onMouseLeave: null }),
  7910. dependencies: [topLevelTypes.topMouseOut, topLevelTypes.topMouseOver]
  7911. }
  7912. };
  7913. var EnterLeaveEventPlugin = {
  7914. eventTypes: eventTypes,
  7915. /**
  7916. * For almost every interaction we care about, there will be both a top-level
  7917. * `mouseover` and `mouseout` event that occurs. Only use `mouseout` so that
  7918. * we do not extract duplicate events. However, moving the mouse into the
  7919. * browser from outside will not fire a `mouseout` event. In this case, we use
  7920. * the `mouseover` top-level event.
  7921. */
  7922. extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
  7923. if (topLevelType === topLevelTypes.topMouseOver && (nativeEvent.relatedTarget || nativeEvent.fromElement)) {
  7924. return null;
  7925. }
  7926. if (topLevelType !== topLevelTypes.topMouseOut && topLevelType !== topLevelTypes.topMouseOver) {
  7927. // Must not be a mouse in or mouse out - ignoring.
  7928. return null;
  7929. }
  7930. var win;
  7931. if (nativeEventTarget.window === nativeEventTarget) {
  7932. // `nativeEventTarget` is probably a window object.
  7933. win = nativeEventTarget;
  7934. } else {
  7935. // TODO: Figure out why `ownerDocument` is sometimes undefined in IE8.
  7936. var doc = nativeEventTarget.ownerDocument;
  7937. if (doc) {
  7938. win = doc.defaultView || doc.parentWindow;
  7939. } else {
  7940. win = window;
  7941. }
  7942. }
  7943. var from;
  7944. var to;
  7945. if (topLevelType === topLevelTypes.topMouseOut) {
  7946. from = targetInst;
  7947. var related = nativeEvent.relatedTarget || nativeEvent.toElement;
  7948. to = related ? ReactDOMComponentTree.getClosestInstanceFromNode(related) : null;
  7949. } else {
  7950. // Moving to a node from outside the window.
  7951. from = null;
  7952. to = targetInst;
  7953. }
  7954. if (from === to) {
  7955. // Nothing pertains to our managed components.
  7956. return null;
  7957. }
  7958. var fromNode = from == null ? win : ReactDOMComponentTree.getNodeFromInstance(from);
  7959. var toNode = to == null ? win : ReactDOMComponentTree.getNodeFromInstance(to);
  7960. var leave = SyntheticMouseEvent.getPooled(eventTypes.mouseLeave, from, nativeEvent, nativeEventTarget);
  7961. leave.type = 'mouseleave';
  7962. leave.target = fromNode;
  7963. leave.relatedTarget = toNode;
  7964. var enter = SyntheticMouseEvent.getPooled(eventTypes.mouseEnter, to, nativeEvent, nativeEventTarget);
  7965. enter.type = 'mouseenter';
  7966. enter.target = toNode;
  7967. enter.relatedTarget = fromNode;
  7968. EventPropagators.accumulateEnterLeaveDispatches(leave, enter, from, to);
  7969. return [leave, enter];
  7970. }
  7971. };
  7972. module.exports = EnterLeaveEventPlugin;
  7973. /***/ },
  7974. /* 77 */
  7975. /***/ function(module, exports, __webpack_require__) {
  7976. /**
  7977. * Copyright 2013-present, Facebook, Inc.
  7978. * All rights reserved.
  7979. *
  7980. * This source code is licensed under the BSD-style license found in the
  7981. * LICENSE file in the root directory of this source tree. An additional grant
  7982. * of patent rights can be found in the PATENTS file in the same directory.
  7983. *
  7984. * @providesModule SyntheticMouseEvent
  7985. */
  7986. 'use strict';
  7987. var SyntheticUIEvent = __webpack_require__(78);
  7988. var ViewportMetrics = __webpack_require__(79);
  7989. var getEventModifierState = __webpack_require__(80);
  7990. /**
  7991. * @interface MouseEvent
  7992. * @see http://www.w3.org/TR/DOM-Level-3-Events/
  7993. */
  7994. var MouseEventInterface = {
  7995. screenX: null,
  7996. screenY: null,
  7997. clientX: null,
  7998. clientY: null,
  7999. ctrlKey: null,
  8000. shiftKey: null,
  8001. altKey: null,
  8002. metaKey: null,
  8003. getModifierState: getEventModifierState,
  8004. button: function (event) {
  8005. // Webkit, Firefox, IE9+
  8006. // which: 1 2 3
  8007. // button: 0 1 2 (standard)
  8008. var button = event.button;
  8009. if ('which' in event) {
  8010. return button;
  8011. }
  8012. // IE<9
  8013. // which: undefined
  8014. // button: 0 0 0
  8015. // button: 1 4 2 (onmouseup)
  8016. return button === 2 ? 2 : button === 4 ? 1 : 0;
  8017. },
  8018. buttons: null,
  8019. relatedTarget: function (event) {
  8020. return event.relatedTarget || (event.fromElement === event.srcElement ? event.toElement : event.fromElement);
  8021. },
  8022. // "Proprietary" Interface.
  8023. pageX: function (event) {
  8024. return 'pageX' in event ? event.pageX : event.clientX + ViewportMetrics.currentScrollLeft;
  8025. },
  8026. pageY: function (event) {
  8027. return 'pageY' in event ? event.pageY : event.clientY + ViewportMetrics.currentScrollTop;
  8028. }
  8029. };
  8030. /**
  8031. * @param {object} dispatchConfig Configuration used to dispatch this event.
  8032. * @param {string} dispatchMarker Marker identifying the event target.
  8033. * @param {object} nativeEvent Native browser event.
  8034. * @extends {SyntheticUIEvent}
  8035. */
  8036. function SyntheticMouseEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
  8037. return SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
  8038. }
  8039. SyntheticUIEvent.augmentClass(SyntheticMouseEvent, MouseEventInterface);
  8040. module.exports = SyntheticMouseEvent;
  8041. /***/ },
  8042. /* 78 */
  8043. /***/ function(module, exports, __webpack_require__) {
  8044. /**
  8045. * Copyright 2013-present, Facebook, Inc.
  8046. * All rights reserved.
  8047. *
  8048. * This source code is licensed under the BSD-style license found in the
  8049. * LICENSE file in the root directory of this source tree. An additional grant
  8050. * of patent rights can be found in the PATENTS file in the same directory.
  8051. *
  8052. * @providesModule SyntheticUIEvent
  8053. */
  8054. 'use strict';
  8055. var SyntheticEvent = __webpack_require__(55);
  8056. var getEventTarget = __webpack_require__(72);
  8057. /**
  8058. * @interface UIEvent
  8059. * @see http://www.w3.org/TR/DOM-Level-3-Events/
  8060. */
  8061. var UIEventInterface = {
  8062. view: function (event) {
  8063. if (event.view) {
  8064. return event.view;
  8065. }
  8066. var target = getEventTarget(event);
  8067. if (target.window === target) {
  8068. // target is a window object
  8069. return target;
  8070. }
  8071. var doc = target.ownerDocument;
  8072. // TODO: Figure out why `ownerDocument` is sometimes undefined in IE8.
  8073. if (doc) {
  8074. return doc.defaultView || doc.parentWindow;
  8075. } else {
  8076. return window;
  8077. }
  8078. },
  8079. detail: function (event) {
  8080. return event.detail || 0;
  8081. }
  8082. };
  8083. /**
  8084. * @param {object} dispatchConfig Configuration used to dispatch this event.
  8085. * @param {string} dispatchMarker Marker identifying the event target.
  8086. * @param {object} nativeEvent Native browser event.
  8087. * @extends {SyntheticEvent}
  8088. */
  8089. function SyntheticUIEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
  8090. return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
  8091. }
  8092. SyntheticEvent.augmentClass(SyntheticUIEvent, UIEventInterface);
  8093. module.exports = SyntheticUIEvent;
  8094. /***/ },
  8095. /* 79 */
  8096. /***/ function(module, exports) {
  8097. /**
  8098. * Copyright 2013-present, Facebook, Inc.
  8099. * All rights reserved.
  8100. *
  8101. * This source code is licensed under the BSD-style license found in the
  8102. * LICENSE file in the root directory of this source tree. An additional grant
  8103. * of patent rights can be found in the PATENTS file in the same directory.
  8104. *
  8105. * @providesModule ViewportMetrics
  8106. */
  8107. 'use strict';
  8108. var ViewportMetrics = {
  8109. currentScrollLeft: 0,
  8110. currentScrollTop: 0,
  8111. refreshScrollValues: function (scrollPosition) {
  8112. ViewportMetrics.currentScrollLeft = scrollPosition.x;
  8113. ViewportMetrics.currentScrollTop = scrollPosition.y;
  8114. }
  8115. };
  8116. module.exports = ViewportMetrics;
  8117. /***/ },
  8118. /* 80 */
  8119. /***/ function(module, exports) {
  8120. /**
  8121. * Copyright 2013-present, Facebook, Inc.
  8122. * All rights reserved.
  8123. *
  8124. * This source code is licensed under the BSD-style license found in the
  8125. * LICENSE file in the root directory of this source tree. An additional grant
  8126. * of patent rights can be found in the PATENTS file in the same directory.
  8127. *
  8128. * @providesModule getEventModifierState
  8129. */
  8130. 'use strict';
  8131. /**
  8132. * Translation from modifier key to the associated property in the event.
  8133. * @see http://www.w3.org/TR/DOM-Level-3-Events/#keys-Modifiers
  8134. */
  8135. var modifierKeyToProp = {
  8136. 'Alt': 'altKey',
  8137. 'Control': 'ctrlKey',
  8138. 'Meta': 'metaKey',
  8139. 'Shift': 'shiftKey'
  8140. };
  8141. // IE8 does not implement getModifierState so we simply map it to the only
  8142. // modifier keys exposed by the event itself, does not support Lock-keys.
  8143. // Currently, all major browsers except Chrome seems to support Lock-keys.
  8144. function modifierStateGetter(keyArg) {
  8145. var syntheticEvent = this;
  8146. var nativeEvent = syntheticEvent.nativeEvent;
  8147. if (nativeEvent.getModifierState) {
  8148. return nativeEvent.getModifierState(keyArg);
  8149. }
  8150. var keyProp = modifierKeyToProp[keyArg];
  8151. return keyProp ? !!nativeEvent[keyProp] : false;
  8152. }
  8153. function getEventModifierState(nativeEvent) {
  8154. return modifierStateGetter;
  8155. }
  8156. module.exports = getEventModifierState;
  8157. /***/ },
  8158. /* 81 */
  8159. /***/ function(module, exports, __webpack_require__) {
  8160. /**
  8161. * Copyright 2013-present, Facebook, Inc.
  8162. * All rights reserved.
  8163. *
  8164. * This source code is licensed under the BSD-style license found in the
  8165. * LICENSE file in the root directory of this source tree. An additional grant
  8166. * of patent rights can be found in the PATENTS file in the same directory.
  8167. *
  8168. * @providesModule HTMLDOMPropertyConfig
  8169. */
  8170. 'use strict';
  8171. var DOMProperty = __webpack_require__(39);
  8172. var MUST_USE_PROPERTY = DOMProperty.injection.MUST_USE_PROPERTY;
  8173. var HAS_BOOLEAN_VALUE = DOMProperty.injection.HAS_BOOLEAN_VALUE;
  8174. var HAS_NUMERIC_VALUE = DOMProperty.injection.HAS_NUMERIC_VALUE;
  8175. var HAS_POSITIVE_NUMERIC_VALUE = DOMProperty.injection.HAS_POSITIVE_NUMERIC_VALUE;
  8176. var HAS_OVERLOADED_BOOLEAN_VALUE = DOMProperty.injection.HAS_OVERLOADED_BOOLEAN_VALUE;
  8177. var HTMLDOMPropertyConfig = {
  8178. isCustomAttribute: RegExp.prototype.test.bind(new RegExp('^(data|aria)-[' + DOMProperty.ATTRIBUTE_NAME_CHAR + ']*$')),
  8179. Properties: {
  8180. /**
  8181. * Standard Properties
  8182. */
  8183. accept: 0,
  8184. acceptCharset: 0,
  8185. accessKey: 0,
  8186. action: 0,
  8187. allowFullScreen: HAS_BOOLEAN_VALUE,
  8188. allowTransparency: 0,
  8189. alt: 0,
  8190. async: HAS_BOOLEAN_VALUE,
  8191. autoComplete: 0,
  8192. // autoFocus is polyfilled/normalized by AutoFocusUtils
  8193. // autoFocus: HAS_BOOLEAN_VALUE,
  8194. autoPlay: HAS_BOOLEAN_VALUE,
  8195. capture: HAS_BOOLEAN_VALUE,
  8196. cellPadding: 0,
  8197. cellSpacing: 0,
  8198. charSet: 0,
  8199. challenge: 0,
  8200. checked: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
  8201. cite: 0,
  8202. classID: 0,
  8203. className: 0,
  8204. cols: HAS_POSITIVE_NUMERIC_VALUE,
  8205. colSpan: 0,
  8206. content: 0,
  8207. contentEditable: 0,
  8208. contextMenu: 0,
  8209. controls: HAS_BOOLEAN_VALUE,
  8210. coords: 0,
  8211. crossOrigin: 0,
  8212. data: 0, // For `<object />` acts as `src`.
  8213. dateTime: 0,
  8214. 'default': HAS_BOOLEAN_VALUE,
  8215. defer: HAS_BOOLEAN_VALUE,
  8216. dir: 0,
  8217. disabled: HAS_BOOLEAN_VALUE,
  8218. download: HAS_OVERLOADED_BOOLEAN_VALUE,
  8219. draggable: 0,
  8220. encType: 0,
  8221. form: 0,
  8222. formAction: 0,
  8223. formEncType: 0,
  8224. formMethod: 0,
  8225. formNoValidate: HAS_BOOLEAN_VALUE,
  8226. formTarget: 0,
  8227. frameBorder: 0,
  8228. headers: 0,
  8229. height: 0,
  8230. hidden: HAS_BOOLEAN_VALUE,
  8231. high: 0,
  8232. href: 0,
  8233. hrefLang: 0,
  8234. htmlFor: 0,
  8235. httpEquiv: 0,
  8236. icon: 0,
  8237. id: 0,
  8238. inputMode: 0,
  8239. integrity: 0,
  8240. is: 0,
  8241. keyParams: 0,
  8242. keyType: 0,
  8243. kind: 0,
  8244. label: 0,
  8245. lang: 0,
  8246. list: 0,
  8247. loop: HAS_BOOLEAN_VALUE,
  8248. low: 0,
  8249. manifest: 0,
  8250. marginHeight: 0,
  8251. marginWidth: 0,
  8252. max: 0,
  8253. maxLength: 0,
  8254. media: 0,
  8255. mediaGroup: 0,
  8256. method: 0,
  8257. min: 0,
  8258. minLength: 0,
  8259. // Caution; `option.selected` is not updated if `select.multiple` is
  8260. // disabled with `removeAttribute`.
  8261. multiple: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
  8262. muted: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
  8263. name: 0,
  8264. nonce: 0,
  8265. noValidate: HAS_BOOLEAN_VALUE,
  8266. open: HAS_BOOLEAN_VALUE,
  8267. optimum: 0,
  8268. pattern: 0,
  8269. placeholder: 0,
  8270. poster: 0,
  8271. preload: 0,
  8272. profile: 0,
  8273. radioGroup: 0,
  8274. readOnly: HAS_BOOLEAN_VALUE,
  8275. referrerPolicy: 0,
  8276. rel: 0,
  8277. required: HAS_BOOLEAN_VALUE,
  8278. reversed: HAS_BOOLEAN_VALUE,
  8279. role: 0,
  8280. rows: HAS_POSITIVE_NUMERIC_VALUE,
  8281. rowSpan: HAS_NUMERIC_VALUE,
  8282. sandbox: 0,
  8283. scope: 0,
  8284. scoped: HAS_BOOLEAN_VALUE,
  8285. scrolling: 0,
  8286. seamless: HAS_BOOLEAN_VALUE,
  8287. selected: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
  8288. shape: 0,
  8289. size: HAS_POSITIVE_NUMERIC_VALUE,
  8290. sizes: 0,
  8291. span: HAS_POSITIVE_NUMERIC_VALUE,
  8292. spellCheck: 0,
  8293. src: 0,
  8294. srcDoc: 0,
  8295. srcLang: 0,
  8296. srcSet: 0,
  8297. start: HAS_NUMERIC_VALUE,
  8298. step: 0,
  8299. style: 0,
  8300. summary: 0,
  8301. tabIndex: 0,
  8302. target: 0,
  8303. title: 0,
  8304. // Setting .type throws on non-<input> tags
  8305. type: 0,
  8306. useMap: 0,
  8307. value: 0,
  8308. width: 0,
  8309. wmode: 0,
  8310. wrap: 0,
  8311. /**
  8312. * RDFa Properties
  8313. */
  8314. about: 0,
  8315. datatype: 0,
  8316. inlist: 0,
  8317. prefix: 0,
  8318. // property is also supported for OpenGraph in meta tags.
  8319. property: 0,
  8320. resource: 0,
  8321. 'typeof': 0,
  8322. vocab: 0,
  8323. /**
  8324. * Non-standard Properties
  8325. */
  8326. // autoCapitalize and autoCorrect are supported in Mobile Safari for
  8327. // keyboard hints.
  8328. autoCapitalize: 0,
  8329. autoCorrect: 0,
  8330. // autoSave allows WebKit/Blink to persist values of input fields on page reloads
  8331. autoSave: 0,
  8332. // color is for Safari mask-icon link
  8333. color: 0,
  8334. // itemProp, itemScope, itemType are for
  8335. // Microdata support. See http://schema.org/docs/gs.html
  8336. itemProp: 0,
  8337. itemScope: HAS_BOOLEAN_VALUE,
  8338. itemType: 0,
  8339. // itemID and itemRef are for Microdata support as well but
  8340. // only specified in the WHATWG spec document. See
  8341. // https://html.spec.whatwg.org/multipage/microdata.html#microdata-dom-api
  8342. itemID: 0,
  8343. itemRef: 0,
  8344. // results show looking glass icon and recent searches on input
  8345. // search fields in WebKit/Blink
  8346. results: 0,
  8347. // IE-only attribute that specifies security restrictions on an iframe
  8348. // as an alternative to the sandbox attribute on IE<10
  8349. security: 0,
  8350. // IE-only attribute that controls focus behavior
  8351. unselectable: 0
  8352. },
  8353. DOMAttributeNames: {
  8354. acceptCharset: 'accept-charset',
  8355. className: 'class',
  8356. htmlFor: 'for',
  8357. httpEquiv: 'http-equiv'
  8358. },
  8359. DOMPropertyNames: {}
  8360. };
  8361. module.exports = HTMLDOMPropertyConfig;
  8362. /***/ },
  8363. /* 82 */
  8364. /***/ function(module, exports, __webpack_require__) {
  8365. /**
  8366. * Copyright 2013-present, Facebook, Inc.
  8367. * All rights reserved.
  8368. *
  8369. * This source code is licensed under the BSD-style license found in the
  8370. * LICENSE file in the root directory of this source tree. An additional grant
  8371. * of patent rights can be found in the PATENTS file in the same directory.
  8372. *
  8373. * @providesModule ReactComponentBrowserEnvironment
  8374. */
  8375. 'use strict';
  8376. var DOMChildrenOperations = __webpack_require__(83);
  8377. var ReactDOMIDOperations = __webpack_require__(95);
  8378. /**
  8379. * Abstracts away all functionality of the reconciler that requires knowledge of
  8380. * the browser context. TODO: These callers should be refactored to avoid the
  8381. * need for this injection.
  8382. */
  8383. var ReactComponentBrowserEnvironment = {
  8384. processChildrenUpdates: ReactDOMIDOperations.dangerouslyProcessChildrenUpdates,
  8385. replaceNodeWithMarkup: DOMChildrenOperations.dangerouslyReplaceNodeWithMarkup
  8386. };
  8387. module.exports = ReactComponentBrowserEnvironment;
  8388. /***/ },
  8389. /* 83 */
  8390. /***/ function(module, exports, __webpack_require__) {
  8391. /* WEBPACK VAR INJECTION */(function(process) {/**
  8392. * Copyright 2013-present, Facebook, Inc.
  8393. * All rights reserved.
  8394. *
  8395. * This source code is licensed under the BSD-style license found in the
  8396. * LICENSE file in the root directory of this source tree. An additional grant
  8397. * of patent rights can be found in the PATENTS file in the same directory.
  8398. *
  8399. * @providesModule DOMChildrenOperations
  8400. */
  8401. 'use strict';
  8402. var DOMLazyTree = __webpack_require__(84);
  8403. var Danger = __webpack_require__(90);
  8404. var ReactMultiChildUpdateTypes = __webpack_require__(94);
  8405. var ReactDOMComponentTree = __webpack_require__(38);
  8406. var ReactInstrumentation = __webpack_require__(64);
  8407. var createMicrosoftUnsafeLocalFunction = __webpack_require__(87);
  8408. var setInnerHTML = __webpack_require__(86);
  8409. var setTextContent = __webpack_require__(88);
  8410. function getNodeAfter(parentNode, node) {
  8411. // Special case for text components, which return [open, close] comments
  8412. // from getHostNode.
  8413. if (Array.isArray(node)) {
  8414. node = node[1];
  8415. }
  8416. return node ? node.nextSibling : parentNode.firstChild;
  8417. }
  8418. /**
  8419. * Inserts `childNode` as a child of `parentNode` at the `index`.
  8420. *
  8421. * @param {DOMElement} parentNode Parent node in which to insert.
  8422. * @param {DOMElement} childNode Child node to insert.
  8423. * @param {number} index Index at which to insert the child.
  8424. * @internal
  8425. */
  8426. var insertChildAt = createMicrosoftUnsafeLocalFunction(function (parentNode, childNode, referenceNode) {
  8427. // We rely exclusively on `insertBefore(node, null)` instead of also using
  8428. // `appendChild(node)`. (Using `undefined` is not allowed by all browsers so
  8429. // we are careful to use `null`.)
  8430. parentNode.insertBefore(childNode, referenceNode);
  8431. });
  8432. function insertLazyTreeChildAt(parentNode, childTree, referenceNode) {
  8433. DOMLazyTree.insertTreeBefore(parentNode, childTree, referenceNode);
  8434. }
  8435. function moveChild(parentNode, childNode, referenceNode) {
  8436. if (Array.isArray(childNode)) {
  8437. moveDelimitedText(parentNode, childNode[0], childNode[1], referenceNode);
  8438. } else {
  8439. insertChildAt(parentNode, childNode, referenceNode);
  8440. }
  8441. }
  8442. function removeChild(parentNode, childNode) {
  8443. if (Array.isArray(childNode)) {
  8444. var closingComment = childNode[1];
  8445. childNode = childNode[0];
  8446. removeDelimitedText(parentNode, childNode, closingComment);
  8447. parentNode.removeChild(closingComment);
  8448. }
  8449. parentNode.removeChild(childNode);
  8450. }
  8451. function moveDelimitedText(parentNode, openingComment, closingComment, referenceNode) {
  8452. var node = openingComment;
  8453. while (true) {
  8454. var nextNode = node.nextSibling;
  8455. insertChildAt(parentNode, node, referenceNode);
  8456. if (node === closingComment) {
  8457. break;
  8458. }
  8459. node = nextNode;
  8460. }
  8461. }
  8462. function removeDelimitedText(parentNode, startNode, closingComment) {
  8463. while (true) {
  8464. var node = startNode.nextSibling;
  8465. if (node === closingComment) {
  8466. // The closing comment is removed by ReactMultiChild.
  8467. break;
  8468. } else {
  8469. parentNode.removeChild(node);
  8470. }
  8471. }
  8472. }
  8473. function replaceDelimitedText(openingComment, closingComment, stringText) {
  8474. var parentNode = openingComment.parentNode;
  8475. var nodeAfterComment = openingComment.nextSibling;
  8476. if (nodeAfterComment === closingComment) {
  8477. // There are no text nodes between the opening and closing comments; insert
  8478. // a new one if stringText isn't empty.
  8479. if (stringText) {
  8480. insertChildAt(parentNode, document.createTextNode(stringText), nodeAfterComment);
  8481. }
  8482. } else {
  8483. if (stringText) {
  8484. // Set the text content of the first node after the opening comment, and
  8485. // remove all following nodes up until the closing comment.
  8486. setTextContent(nodeAfterComment, stringText);
  8487. removeDelimitedText(parentNode, nodeAfterComment, closingComment);
  8488. } else {
  8489. removeDelimitedText(parentNode, openingComment, closingComment);
  8490. }
  8491. }
  8492. if (process.env.NODE_ENV !== 'production') {
  8493. ReactInstrumentation.debugTool.onHostOperation(ReactDOMComponentTree.getInstanceFromNode(openingComment)._debugID, 'replace text', stringText);
  8494. }
  8495. }
  8496. var dangerouslyReplaceNodeWithMarkup = Danger.dangerouslyReplaceNodeWithMarkup;
  8497. if (process.env.NODE_ENV !== 'production') {
  8498. dangerouslyReplaceNodeWithMarkup = function (oldChild, markup, prevInstance) {
  8499. Danger.dangerouslyReplaceNodeWithMarkup(oldChild, markup);
  8500. if (prevInstance._debugID !== 0) {
  8501. ReactInstrumentation.debugTool.onHostOperation(prevInstance._debugID, 'replace with', markup.toString());
  8502. } else {
  8503. var nextInstance = ReactDOMComponentTree.getInstanceFromNode(markup.node);
  8504. if (nextInstance._debugID !== 0) {
  8505. ReactInstrumentation.debugTool.onHostOperation(nextInstance._debugID, 'mount', markup.toString());
  8506. }
  8507. }
  8508. };
  8509. }
  8510. /**
  8511. * Operations for updating with DOM children.
  8512. */
  8513. var DOMChildrenOperations = {
  8514. dangerouslyReplaceNodeWithMarkup: dangerouslyReplaceNodeWithMarkup,
  8515. replaceDelimitedText: replaceDelimitedText,
  8516. /**
  8517. * Updates a component's children by processing a series of updates. The
  8518. * update configurations are each expected to have a `parentNode` property.
  8519. *
  8520. * @param {array<object>} updates List of update configurations.
  8521. * @internal
  8522. */
  8523. processUpdates: function (parentNode, updates) {
  8524. if (process.env.NODE_ENV !== 'production') {
  8525. var parentNodeDebugID = ReactDOMComponentTree.getInstanceFromNode(parentNode)._debugID;
  8526. }
  8527. for (var k = 0; k < updates.length; k++) {
  8528. var update = updates[k];
  8529. switch (update.type) {
  8530. case ReactMultiChildUpdateTypes.INSERT_MARKUP:
  8531. insertLazyTreeChildAt(parentNode, update.content, getNodeAfter(parentNode, update.afterNode));
  8532. if (process.env.NODE_ENV !== 'production') {
  8533. ReactInstrumentation.debugTool.onHostOperation(parentNodeDebugID, 'insert child', { toIndex: update.toIndex, content: update.content.toString() });
  8534. }
  8535. break;
  8536. case ReactMultiChildUpdateTypes.MOVE_EXISTING:
  8537. moveChild(parentNode, update.fromNode, getNodeAfter(parentNode, update.afterNode));
  8538. if (process.env.NODE_ENV !== 'production') {
  8539. ReactInstrumentation.debugTool.onHostOperation(parentNodeDebugID, 'move child', { fromIndex: update.fromIndex, toIndex: update.toIndex });
  8540. }
  8541. break;
  8542. case ReactMultiChildUpdateTypes.SET_MARKUP:
  8543. setInnerHTML(parentNode, update.content);
  8544. if (process.env.NODE_ENV !== 'production') {
  8545. ReactInstrumentation.debugTool.onHostOperation(parentNodeDebugID, 'replace children', update.content.toString());
  8546. }
  8547. break;
  8548. case ReactMultiChildUpdateTypes.TEXT_CONTENT:
  8549. setTextContent(parentNode, update.content);
  8550. if (process.env.NODE_ENV !== 'production') {
  8551. ReactInstrumentation.debugTool.onHostOperation(parentNodeDebugID, 'replace text', update.content.toString());
  8552. }
  8553. break;
  8554. case ReactMultiChildUpdateTypes.REMOVE_NODE:
  8555. removeChild(parentNode, update.fromNode);
  8556. if (process.env.NODE_ENV !== 'production') {
  8557. ReactInstrumentation.debugTool.onHostOperation(parentNodeDebugID, 'remove child', { fromIndex: update.fromIndex });
  8558. }
  8559. break;
  8560. }
  8561. }
  8562. }
  8563. };
  8564. module.exports = DOMChildrenOperations;
  8565. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  8566. /***/ },
  8567. /* 84 */
  8568. /***/ function(module, exports, __webpack_require__) {
  8569. /**
  8570. * Copyright 2015-present, Facebook, Inc.
  8571. * All rights reserved.
  8572. *
  8573. * This source code is licensed under the BSD-style license found in the
  8574. * LICENSE file in the root directory of this source tree. An additional grant
  8575. * of patent rights can be found in the PATENTS file in the same directory.
  8576. *
  8577. * @providesModule DOMLazyTree
  8578. */
  8579. 'use strict';
  8580. var DOMNamespaces = __webpack_require__(85);
  8581. var setInnerHTML = __webpack_require__(86);
  8582. var createMicrosoftUnsafeLocalFunction = __webpack_require__(87);
  8583. var setTextContent = __webpack_require__(88);
  8584. var ELEMENT_NODE_TYPE = 1;
  8585. var DOCUMENT_FRAGMENT_NODE_TYPE = 11;
  8586. /**
  8587. * In IE (8-11) and Edge, appending nodes with no children is dramatically
  8588. * faster than appending a full subtree, so we essentially queue up the
  8589. * .appendChild calls here and apply them so each node is added to its parent
  8590. * before any children are added.
  8591. *
  8592. * In other browsers, doing so is slower or neutral compared to the other order
  8593. * (in Firefox, twice as slow) so we only do this inversion in IE.
  8594. *
  8595. * See https://github.com/spicyj/innerhtml-vs-createelement-vs-clonenode.
  8596. */
  8597. var enableLazy = typeof document !== 'undefined' && typeof document.documentMode === 'number' || typeof navigator !== 'undefined' && typeof navigator.userAgent === 'string' && /\bEdge\/\d/.test(navigator.userAgent);
  8598. function insertTreeChildren(tree) {
  8599. if (!enableLazy) {
  8600. return;
  8601. }
  8602. var node = tree.node;
  8603. var children = tree.children;
  8604. if (children.length) {
  8605. for (var i = 0; i < children.length; i++) {
  8606. insertTreeBefore(node, children[i], null);
  8607. }
  8608. } else if (tree.html != null) {
  8609. setInnerHTML(node, tree.html);
  8610. } else if (tree.text != null) {
  8611. setTextContent(node, tree.text);
  8612. }
  8613. }
  8614. var insertTreeBefore = createMicrosoftUnsafeLocalFunction(function (parentNode, tree, referenceNode) {
  8615. // DocumentFragments aren't actually part of the DOM after insertion so
  8616. // appending children won't update the DOM. We need to ensure the fragment
  8617. // is properly populated first, breaking out of our lazy approach for just
  8618. // this level. Also, some <object> plugins (like Flash Player) will read
  8619. // <param> nodes immediately upon insertion into the DOM, so <object>
  8620. // must also be populated prior to insertion into the DOM.
  8621. 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)) {
  8622. insertTreeChildren(tree);
  8623. parentNode.insertBefore(tree.node, referenceNode);
  8624. } else {
  8625. parentNode.insertBefore(tree.node, referenceNode);
  8626. insertTreeChildren(tree);
  8627. }
  8628. });
  8629. function replaceChildWithTree(oldNode, newTree) {
  8630. oldNode.parentNode.replaceChild(newTree.node, oldNode);
  8631. insertTreeChildren(newTree);
  8632. }
  8633. function queueChild(parentTree, childTree) {
  8634. if (enableLazy) {
  8635. parentTree.children.push(childTree);
  8636. } else {
  8637. parentTree.node.appendChild(childTree.node);
  8638. }
  8639. }
  8640. function queueHTML(tree, html) {
  8641. if (enableLazy) {
  8642. tree.html = html;
  8643. } else {
  8644. setInnerHTML(tree.node, html);
  8645. }
  8646. }
  8647. function queueText(tree, text) {
  8648. if (enableLazy) {
  8649. tree.text = text;
  8650. } else {
  8651. setTextContent(tree.node, text);
  8652. }
  8653. }
  8654. function toString() {
  8655. return this.node.nodeName;
  8656. }
  8657. function DOMLazyTree(node) {
  8658. return {
  8659. node: node,
  8660. children: [],
  8661. html: null,
  8662. text: null,
  8663. toString: toString
  8664. };
  8665. }
  8666. DOMLazyTree.insertTreeBefore = insertTreeBefore;
  8667. DOMLazyTree.replaceChildWithTree = replaceChildWithTree;
  8668. DOMLazyTree.queueChild = queueChild;
  8669. DOMLazyTree.queueHTML = queueHTML;
  8670. DOMLazyTree.queueText = queueText;
  8671. module.exports = DOMLazyTree;
  8672. /***/ },
  8673. /* 85 */
  8674. /***/ function(module, exports) {
  8675. /**
  8676. * Copyright 2013-present, Facebook, Inc.
  8677. * All rights reserved.
  8678. *
  8679. * This source code is licensed under the BSD-style license found in the
  8680. * LICENSE file in the root directory of this source tree. An additional grant
  8681. * of patent rights can be found in the PATENTS file in the same directory.
  8682. *
  8683. * @providesModule DOMNamespaces
  8684. */
  8685. 'use strict';
  8686. var DOMNamespaces = {
  8687. html: 'http://www.w3.org/1999/xhtml',
  8688. mathml: 'http://www.w3.org/1998/Math/MathML',
  8689. svg: 'http://www.w3.org/2000/svg'
  8690. };
  8691. module.exports = DOMNamespaces;
  8692. /***/ },
  8693. /* 86 */
  8694. /***/ function(module, exports, __webpack_require__) {
  8695. /**
  8696. * Copyright 2013-present, Facebook, Inc.
  8697. * All rights reserved.
  8698. *
  8699. * This source code is licensed under the BSD-style license found in the
  8700. * LICENSE file in the root directory of this source tree. An additional grant
  8701. * of patent rights can be found in the PATENTS file in the same directory.
  8702. *
  8703. * @providesModule setInnerHTML
  8704. */
  8705. 'use strict';
  8706. var ExecutionEnvironment = __webpack_require__(51);
  8707. var DOMNamespaces = __webpack_require__(85);
  8708. var WHITESPACE_TEST = /^[ \r\n\t\f]/;
  8709. var NONVISIBLE_TEST = /<(!--|link|noscript|meta|script|style)[ \r\n\t\f\/>]/;
  8710. var createMicrosoftUnsafeLocalFunction = __webpack_require__(87);
  8711. // SVG temp container for IE lacking innerHTML
  8712. var reusableSVGContainer;
  8713. /**
  8714. * Set the innerHTML property of a node, ensuring that whitespace is preserved
  8715. * even in IE8.
  8716. *
  8717. * @param {DOMElement} node
  8718. * @param {string} html
  8719. * @internal
  8720. */
  8721. var setInnerHTML = createMicrosoftUnsafeLocalFunction(function (node, html) {
  8722. // IE does not have innerHTML for SVG nodes, so instead we inject the
  8723. // new markup in a temp node and then move the child nodes across into
  8724. // the target node
  8725. if (node.namespaceURI === DOMNamespaces.svg && !('innerHTML' in node)) {
  8726. reusableSVGContainer = reusableSVGContainer || document.createElement('div');
  8727. reusableSVGContainer.innerHTML = '<svg>' + html + '</svg>';
  8728. var newNodes = reusableSVGContainer.firstChild.childNodes;
  8729. for (var i = 0; i < newNodes.length; i++) {
  8730. node.appendChild(newNodes[i]);
  8731. }
  8732. } else {
  8733. node.innerHTML = html;
  8734. }
  8735. });
  8736. if (ExecutionEnvironment.canUseDOM) {
  8737. // IE8: When updating a just created node with innerHTML only leading
  8738. // whitespace is removed. When updating an existing node with innerHTML
  8739. // whitespace in root TextNodes is also collapsed.
  8740. // @see quirksmode.org/bugreports/archives/2004/11/innerhtml_and_t.html
  8741. // Feature detection; only IE8 is known to behave improperly like this.
  8742. var testElement = document.createElement('div');
  8743. testElement.innerHTML = ' ';
  8744. if (testElement.innerHTML === '') {
  8745. setInnerHTML = function (node, html) {
  8746. // Magic theory: IE8 supposedly differentiates between added and updated
  8747. // nodes when processing innerHTML, innerHTML on updated nodes suffers
  8748. // from worse whitespace behavior. Re-adding a node like this triggers
  8749. // the initial and more favorable whitespace behavior.
  8750. // TODO: What to do on a detached node?
  8751. if (node.parentNode) {
  8752. node.parentNode.replaceChild(node, node);
  8753. }
  8754. // We also implement a workaround for non-visible tags disappearing into
  8755. // thin air on IE8, this only happens if there is no visible text
  8756. // in-front of the non-visible tags. Piggyback on the whitespace fix
  8757. // and simply check if any non-visible tags appear in the source.
  8758. if (WHITESPACE_TEST.test(html) || html[0] === '<' && NONVISIBLE_TEST.test(html)) {
  8759. // Recover leading whitespace by temporarily prepending any character.
  8760. // \uFEFF has the potential advantage of being zero-width/invisible.
  8761. // UglifyJS drops U+FEFF chars when parsing, so use String.fromCharCode
  8762. // in hopes that this is preserved even if "\uFEFF" is transformed to
  8763. // the actual Unicode character (by Babel, for example).
  8764. // https://github.com/mishoo/UglifyJS2/blob/v2.4.20/lib/parse.js#L216
  8765. node.innerHTML = String.fromCharCode(0xFEFF) + html;
  8766. // deleteData leaves an empty `TextNode` which offsets the index of all
  8767. // children. Definitely want to avoid this.
  8768. var textNode = node.firstChild;
  8769. if (textNode.data.length === 1) {
  8770. node.removeChild(textNode);
  8771. } else {
  8772. textNode.deleteData(0, 1);
  8773. }
  8774. } else {
  8775. node.innerHTML = html;
  8776. }
  8777. };
  8778. }
  8779. testElement = null;
  8780. }
  8781. module.exports = setInnerHTML;
  8782. /***/ },
  8783. /* 87 */
  8784. /***/ function(module, exports) {
  8785. /**
  8786. * Copyright 2013-present, Facebook, Inc.
  8787. * All rights reserved.
  8788. *
  8789. * This source code is licensed under the BSD-style license found in the
  8790. * LICENSE file in the root directory of this source tree. An additional grant
  8791. * of patent rights can be found in the PATENTS file in the same directory.
  8792. *
  8793. * @providesModule createMicrosoftUnsafeLocalFunction
  8794. */
  8795. /* globals MSApp */
  8796. 'use strict';
  8797. /**
  8798. * Create a function which has 'unsafe' privileges (required by windows8 apps)
  8799. */
  8800. var createMicrosoftUnsafeLocalFunction = function (func) {
  8801. if (typeof MSApp !== 'undefined' && MSApp.execUnsafeLocalFunction) {
  8802. return function (arg0, arg1, arg2, arg3) {
  8803. MSApp.execUnsafeLocalFunction(function () {
  8804. return func(arg0, arg1, arg2, arg3);
  8805. });
  8806. };
  8807. } else {
  8808. return func;
  8809. }
  8810. };
  8811. module.exports = createMicrosoftUnsafeLocalFunction;
  8812. /***/ },
  8813. /* 88 */
  8814. /***/ function(module, exports, __webpack_require__) {
  8815. /**
  8816. * Copyright 2013-present, Facebook, Inc.
  8817. * All rights reserved.
  8818. *
  8819. * This source code is licensed under the BSD-style license found in the
  8820. * LICENSE file in the root directory of this source tree. An additional grant
  8821. * of patent rights can be found in the PATENTS file in the same directory.
  8822. *
  8823. * @providesModule setTextContent
  8824. */
  8825. 'use strict';
  8826. var ExecutionEnvironment = __webpack_require__(51);
  8827. var escapeTextContentForBrowser = __webpack_require__(89);
  8828. var setInnerHTML = __webpack_require__(86);
  8829. /**
  8830. * Set the textContent property of a node, ensuring that whitespace is preserved
  8831. * even in IE8. innerText is a poor substitute for textContent and, among many
  8832. * issues, inserts <br> instead of the literal newline chars. innerHTML behaves
  8833. * as it should.
  8834. *
  8835. * @param {DOMElement} node
  8836. * @param {string} text
  8837. * @internal
  8838. */
  8839. var setTextContent = function (node, text) {
  8840. if (text) {
  8841. var firstChild = node.firstChild;
  8842. if (firstChild && firstChild === node.lastChild && firstChild.nodeType === 3) {
  8843. firstChild.nodeValue = text;
  8844. return;
  8845. }
  8846. }
  8847. node.textContent = text;
  8848. };
  8849. if (ExecutionEnvironment.canUseDOM) {
  8850. if (!('textContent' in document.documentElement)) {
  8851. setTextContent = function (node, text) {
  8852. setInnerHTML(node, escapeTextContentForBrowser(text));
  8853. };
  8854. }
  8855. }
  8856. module.exports = setTextContent;
  8857. /***/ },
  8858. /* 89 */
  8859. /***/ function(module, exports) {
  8860. /**
  8861. * Copyright 2016-present, Facebook, Inc.
  8862. * All rights reserved.
  8863. *
  8864. * This source code is licensed under the BSD-style license found in the
  8865. * LICENSE file in the root directory of this source tree. An additional grant
  8866. * of patent rights can be found in the PATENTS file in the same directory.
  8867. *
  8868. * Based on the escape-html library, which is used under the MIT License below:
  8869. *
  8870. * Copyright (c) 2012-2013 TJ Holowaychuk
  8871. * Copyright (c) 2015 Andreas Lubbe
  8872. * Copyright (c) 2015 Tiancheng "Timothy" Gu
  8873. *
  8874. * Permission is hereby granted, free of charge, to any person obtaining
  8875. * a copy of this software and associated documentation files (the
  8876. * 'Software'), to deal in the Software without restriction, including
  8877. * without limitation the rights to use, copy, modify, merge, publish,
  8878. * distribute, sublicense, and/or sell copies of the Software, and to
  8879. * permit persons to whom the Software is furnished to do so, subject to
  8880. * the following conditions:
  8881. *
  8882. * The above copyright notice and this permission notice shall be
  8883. * included in all copies or substantial portions of the Software.
  8884. *
  8885. * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
  8886. * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  8887. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  8888. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
  8889. * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
  8890. * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
  8891. * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  8892. *
  8893. * @providesModule escapeTextContentForBrowser
  8894. */
  8895. 'use strict';
  8896. // code copied and modified from escape-html
  8897. /**
  8898. * Module variables.
  8899. * @private
  8900. */
  8901. var matchHtmlRegExp = /["'&<>]/;
  8902. /**
  8903. * Escape special characters in the given string of html.
  8904. *
  8905. * @param {string} string The string to escape for inserting into HTML
  8906. * @return {string}
  8907. * @public
  8908. */
  8909. function escapeHtml(string) {
  8910. var str = '' + string;
  8911. var match = matchHtmlRegExp.exec(str);
  8912. if (!match) {
  8913. return str;
  8914. }
  8915. var escape;
  8916. var html = '';
  8917. var index = 0;
  8918. var lastIndex = 0;
  8919. for (index = match.index; index < str.length; index++) {
  8920. switch (str.charCodeAt(index)) {
  8921. case 34:
  8922. // "
  8923. escape = '&quot;';
  8924. break;
  8925. case 38:
  8926. // &
  8927. escape = '&amp;';
  8928. break;
  8929. case 39:
  8930. // '
  8931. escape = '&#x27;'; // modified from escape-html; used to be '&#39'
  8932. break;
  8933. case 60:
  8934. // <
  8935. escape = '&lt;';
  8936. break;
  8937. case 62:
  8938. // >
  8939. escape = '&gt;';
  8940. break;
  8941. default:
  8942. continue;
  8943. }
  8944. if (lastIndex !== index) {
  8945. html += str.substring(lastIndex, index);
  8946. }
  8947. lastIndex = index + 1;
  8948. html += escape;
  8949. }
  8950. return lastIndex !== index ? html + str.substring(lastIndex, index) : html;
  8951. }
  8952. // end code copied and modified from escape-html
  8953. /**
  8954. * Escapes text to prevent scripting attacks.
  8955. *
  8956. * @param {*} text Text value to escape.
  8957. * @return {string} An escaped string.
  8958. */
  8959. function escapeTextContentForBrowser(text) {
  8960. if (typeof text === 'boolean' || typeof text === 'number') {
  8961. // this shortcircuit helps perf for types that we know will never have
  8962. // special characters, especially given that this function is used often
  8963. // for numeric dom ids.
  8964. return '' + text;
  8965. }
  8966. return escapeHtml(text);
  8967. }
  8968. module.exports = escapeTextContentForBrowser;
  8969. /***/ },
  8970. /* 90 */
  8971. /***/ function(module, exports, __webpack_require__) {
  8972. /* WEBPACK VAR INJECTION */(function(process) {/**
  8973. * Copyright 2013-present, Facebook, Inc.
  8974. * All rights reserved.
  8975. *
  8976. * This source code is licensed under the BSD-style license found in the
  8977. * LICENSE file in the root directory of this source tree. An additional grant
  8978. * of patent rights can be found in the PATENTS file in the same directory.
  8979. *
  8980. * @providesModule Danger
  8981. */
  8982. 'use strict';
  8983. var _prodInvariant = __webpack_require__(9);
  8984. var DOMLazyTree = __webpack_require__(84);
  8985. var ExecutionEnvironment = __webpack_require__(51);
  8986. var createNodesFromMarkup = __webpack_require__(91);
  8987. var emptyFunction = __webpack_require__(14);
  8988. var invariant = __webpack_require__(10);
  8989. var Danger = {
  8990. /**
  8991. * Replaces a node with a string of markup at its current position within its
  8992. * parent. The markup must render into a single root node.
  8993. *
  8994. * @param {DOMElement} oldChild Child node to replace.
  8995. * @param {string} markup Markup to render in place of the child node.
  8996. * @internal
  8997. */
  8998. dangerouslyReplaceNodeWithMarkup: function (oldChild, markup) {
  8999. !ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? 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.') : _prodInvariant('56') : void 0;
  9000. !markup ? process.env.NODE_ENV !== 'production' ? invariant(false, 'dangerouslyReplaceNodeWithMarkup(...): Missing markup.') : _prodInvariant('57') : void 0;
  9001. !(oldChild.nodeName !== 'HTML') ? process.env.NODE_ENV !== 'production' ? 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().') : _prodInvariant('58') : void 0;
  9002. if (typeof markup === 'string') {
  9003. var newChild = createNodesFromMarkup(markup, emptyFunction)[0];
  9004. oldChild.parentNode.replaceChild(newChild, oldChild);
  9005. } else {
  9006. DOMLazyTree.replaceChildWithTree(oldChild, markup);
  9007. }
  9008. }
  9009. };
  9010. module.exports = Danger;
  9011. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  9012. /***/ },
  9013. /* 91 */
  9014. /***/ function(module, exports, __webpack_require__) {
  9015. /* WEBPACK VAR INJECTION */(function(process) {'use strict';
  9016. /**
  9017. * Copyright (c) 2013-present, Facebook, Inc.
  9018. * All rights reserved.
  9019. *
  9020. * This source code is licensed under the BSD-style license found in the
  9021. * LICENSE file in the root directory of this source tree. An additional grant
  9022. * of patent rights can be found in the PATENTS file in the same directory.
  9023. *
  9024. * @typechecks
  9025. */
  9026. /*eslint-disable fb-www/unsafe-html*/
  9027. var ExecutionEnvironment = __webpack_require__(51);
  9028. var createArrayFromMixed = __webpack_require__(92);
  9029. var getMarkupWrap = __webpack_require__(93);
  9030. var invariant = __webpack_require__(10);
  9031. /**
  9032. * Dummy container used to render all markup.
  9033. */
  9034. var dummyNode = ExecutionEnvironment.canUseDOM ? document.createElement('div') : null;
  9035. /**
  9036. * Pattern used by `getNodeName`.
  9037. */
  9038. var nodeNamePattern = /^\s*<(\w+)/;
  9039. /**
  9040. * Extracts the `nodeName` of the first element in a string of markup.
  9041. *
  9042. * @param {string} markup String of markup.
  9043. * @return {?string} Node name of the supplied markup.
  9044. */
  9045. function getNodeName(markup) {
  9046. var nodeNameMatch = markup.match(nodeNamePattern);
  9047. return nodeNameMatch && nodeNameMatch[1].toLowerCase();
  9048. }
  9049. /**
  9050. * Creates an array containing the nodes rendered from the supplied markup. The
  9051. * optionally supplied `handleScript` function will be invoked once for each
  9052. * <script> element that is rendered. If no `handleScript` function is supplied,
  9053. * an exception is thrown if any <script> elements are rendered.
  9054. *
  9055. * @param {string} markup A string of valid HTML markup.
  9056. * @param {?function} handleScript Invoked once for each rendered <script>.
  9057. * @return {array<DOMElement|DOMTextNode>} An array of rendered nodes.
  9058. */
  9059. function createNodesFromMarkup(markup, handleScript) {
  9060. var node = dummyNode;
  9061. !!!dummyNode ? process.env.NODE_ENV !== 'production' ? invariant(false, 'createNodesFromMarkup dummy not initialized') : invariant(false) : void 0;
  9062. var nodeName = getNodeName(markup);
  9063. var wrap = nodeName && getMarkupWrap(nodeName);
  9064. if (wrap) {
  9065. node.innerHTML = wrap[1] + markup + wrap[2];
  9066. var wrapDepth = wrap[0];
  9067. while (wrapDepth--) {
  9068. node = node.lastChild;
  9069. }
  9070. } else {
  9071. node.innerHTML = markup;
  9072. }
  9073. var scripts = node.getElementsByTagName('script');
  9074. if (scripts.length) {
  9075. !handleScript ? process.env.NODE_ENV !== 'production' ? invariant(false, 'createNodesFromMarkup(...): Unexpected <script> element rendered.') : invariant(false) : void 0;
  9076. createArrayFromMixed(scripts).forEach(handleScript);
  9077. }
  9078. var nodes = Array.from(node.childNodes);
  9079. while (node.lastChild) {
  9080. node.removeChild(node.lastChild);
  9081. }
  9082. return nodes;
  9083. }
  9084. module.exports = createNodesFromMarkup;
  9085. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  9086. /***/ },
  9087. /* 92 */
  9088. /***/ function(module, exports, __webpack_require__) {
  9089. /* WEBPACK VAR INJECTION */(function(process) {'use strict';
  9090. /**
  9091. * Copyright (c) 2013-present, Facebook, Inc.
  9092. * All rights reserved.
  9093. *
  9094. * This source code is licensed under the BSD-style license found in the
  9095. * LICENSE file in the root directory of this source tree. An additional grant
  9096. * of patent rights can be found in the PATENTS file in the same directory.
  9097. *
  9098. * @typechecks
  9099. */
  9100. var invariant = __webpack_require__(10);
  9101. /**
  9102. * Convert array-like objects to arrays.
  9103. *
  9104. * This API assumes the caller knows the contents of the data type. For less
  9105. * well defined inputs use createArrayFromMixed.
  9106. *
  9107. * @param {object|function|filelist} obj
  9108. * @return {array}
  9109. */
  9110. function toArray(obj) {
  9111. var length = obj.length;
  9112. // Some browsers builtin objects can report typeof 'function' (e.g. NodeList
  9113. // in old versions of Safari).
  9114. !(!Array.isArray(obj) && (typeof obj === 'object' || typeof obj === 'function')) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'toArray: Array-like object expected') : invariant(false) : void 0;
  9115. !(typeof length === 'number') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'toArray: Object needs a length property') : invariant(false) : void 0;
  9116. !(length === 0 || length - 1 in obj) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'toArray: Object should have keys for indices') : invariant(false) : void 0;
  9117. !(typeof obj.callee !== 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'toArray: Object can\'t be `arguments`. Use rest params ' + '(function(...args) {}) or Array.from() instead.') : invariant(false) : void 0;
  9118. // Old IE doesn't give collections access to hasOwnProperty. Assume inputs
  9119. // without method will throw during the slice call and skip straight to the
  9120. // fallback.
  9121. if (obj.hasOwnProperty) {
  9122. try {
  9123. return Array.prototype.slice.call(obj);
  9124. } catch (e) {
  9125. // IE < 9 does not support Array#slice on collections objects
  9126. }
  9127. }
  9128. // Fall back to copying key by key. This assumes all keys have a value,
  9129. // so will not preserve sparsely populated inputs.
  9130. var ret = Array(length);
  9131. for (var ii = 0; ii < length; ii++) {
  9132. ret[ii] = obj[ii];
  9133. }
  9134. return ret;
  9135. }
  9136. /**
  9137. * Perform a heuristic test to determine if an object is "array-like".
  9138. *
  9139. * A monk asked Joshu, a Zen master, "Has a dog Buddha nature?"
  9140. * Joshu replied: "Mu."
  9141. *
  9142. * This function determines if its argument has "array nature": it returns
  9143. * true if the argument is an actual array, an `arguments' object, or an
  9144. * HTMLCollection (e.g. node.childNodes or node.getElementsByTagName()).
  9145. *
  9146. * It will return false for other array-like objects like Filelist.
  9147. *
  9148. * @param {*} obj
  9149. * @return {boolean}
  9150. */
  9151. function hasArrayNature(obj) {
  9152. return (
  9153. // not null/false
  9154. !!obj && (
  9155. // arrays are objects, NodeLists are functions in Safari
  9156. typeof obj == 'object' || typeof obj == 'function') &&
  9157. // quacks like an array
  9158. 'length' in obj &&
  9159. // not window
  9160. !('setInterval' in obj) &&
  9161. // no DOM node should be considered an array-like
  9162. // a 'select' element has 'length' and 'item' properties on IE8
  9163. typeof obj.nodeType != 'number' && (
  9164. // a real array
  9165. Array.isArray(obj) ||
  9166. // arguments
  9167. 'callee' in obj ||
  9168. // HTMLCollection/NodeList
  9169. 'item' in obj)
  9170. );
  9171. }
  9172. /**
  9173. * Ensure that the argument is an array by wrapping it in an array if it is not.
  9174. * Creates a copy of the argument if it is already an array.
  9175. *
  9176. * This is mostly useful idiomatically:
  9177. *
  9178. * var createArrayFromMixed = require('createArrayFromMixed');
  9179. *
  9180. * function takesOneOrMoreThings(things) {
  9181. * things = createArrayFromMixed(things);
  9182. * ...
  9183. * }
  9184. *
  9185. * This allows you to treat `things' as an array, but accept scalars in the API.
  9186. *
  9187. * If you need to convert an array-like object, like `arguments`, into an array
  9188. * use toArray instead.
  9189. *
  9190. * @param {*} obj
  9191. * @return {array}
  9192. */
  9193. function createArrayFromMixed(obj) {
  9194. if (!hasArrayNature(obj)) {
  9195. return [obj];
  9196. } else if (Array.isArray(obj)) {
  9197. return obj.slice();
  9198. } else {
  9199. return toArray(obj);
  9200. }
  9201. }
  9202. module.exports = createArrayFromMixed;
  9203. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  9204. /***/ },
  9205. /* 93 */
  9206. /***/ function(module, exports, __webpack_require__) {
  9207. /* WEBPACK VAR INJECTION */(function(process) {'use strict';
  9208. /**
  9209. * Copyright (c) 2013-present, Facebook, Inc.
  9210. * All rights reserved.
  9211. *
  9212. * This source code is licensed under the BSD-style license found in the
  9213. * LICENSE file in the root directory of this source tree. An additional grant
  9214. * of patent rights can be found in the PATENTS file in the same directory.
  9215. *
  9216. */
  9217. /*eslint-disable fb-www/unsafe-html */
  9218. var ExecutionEnvironment = __webpack_require__(51);
  9219. var invariant = __webpack_require__(10);
  9220. /**
  9221. * Dummy container used to detect which wraps are necessary.
  9222. */
  9223. var dummyNode = ExecutionEnvironment.canUseDOM ? document.createElement('div') : null;
  9224. /**
  9225. * Some browsers cannot use `innerHTML` to render certain elements standalone,
  9226. * so we wrap them, render the wrapped nodes, then extract the desired node.
  9227. *
  9228. * In IE8, certain elements cannot render alone, so wrap all elements ('*').
  9229. */
  9230. var shouldWrap = {};
  9231. var selectWrap = [1, '<select multiple="true">', '</select>'];
  9232. var tableWrap = [1, '<table>', '</table>'];
  9233. var trWrap = [3, '<table><tbody><tr>', '</tr></tbody></table>'];
  9234. var svgWrap = [1, '<svg xmlns="http://www.w3.org/2000/svg">', '</svg>'];
  9235. var markupWrap = {
  9236. '*': [1, '?<div>', '</div>'],
  9237. 'area': [1, '<map>', '</map>'],
  9238. 'col': [2, '<table><tbody></tbody><colgroup>', '</colgroup></table>'],
  9239. 'legend': [1, '<fieldset>', '</fieldset>'],
  9240. 'param': [1, '<object>', '</object>'],
  9241. 'tr': [2, '<table><tbody>', '</tbody></table>'],
  9242. 'optgroup': selectWrap,
  9243. 'option': selectWrap,
  9244. 'caption': tableWrap,
  9245. 'colgroup': tableWrap,
  9246. 'tbody': tableWrap,
  9247. 'tfoot': tableWrap,
  9248. 'thead': tableWrap,
  9249. 'td': trWrap,
  9250. 'th': trWrap
  9251. };
  9252. // Initialize the SVG elements since we know they'll always need to be wrapped
  9253. // consistently. If they are created inside a <div> they will be initialized in
  9254. // the wrong namespace (and will not display).
  9255. var svgElements = ['circle', 'clipPath', 'defs', 'ellipse', 'g', 'image', 'line', 'linearGradient', 'mask', 'path', 'pattern', 'polygon', 'polyline', 'radialGradient', 'rect', 'stop', 'text', 'tspan'];
  9256. svgElements.forEach(function (nodeName) {
  9257. markupWrap[nodeName] = svgWrap;
  9258. shouldWrap[nodeName] = true;
  9259. });
  9260. /**
  9261. * Gets the markup wrap configuration for the supplied `nodeName`.
  9262. *
  9263. * NOTE: This lazily detects which wraps are necessary for the current browser.
  9264. *
  9265. * @param {string} nodeName Lowercase `nodeName`.
  9266. * @return {?array} Markup wrap configuration, if applicable.
  9267. */
  9268. function getMarkupWrap(nodeName) {
  9269. !!!dummyNode ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Markup wrapping node not initialized') : invariant(false) : void 0;
  9270. if (!markupWrap.hasOwnProperty(nodeName)) {
  9271. nodeName = '*';
  9272. }
  9273. if (!shouldWrap.hasOwnProperty(nodeName)) {
  9274. if (nodeName === '*') {
  9275. dummyNode.innerHTML = '<link />';
  9276. } else {
  9277. dummyNode.innerHTML = '<' + nodeName + '></' + nodeName + '>';
  9278. }
  9279. shouldWrap[nodeName] = !dummyNode.firstChild;
  9280. }
  9281. return shouldWrap[nodeName] ? markupWrap[nodeName] : null;
  9282. }
  9283. module.exports = getMarkupWrap;
  9284. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  9285. /***/ },
  9286. /* 94 */
  9287. /***/ function(module, exports, __webpack_require__) {
  9288. /**
  9289. * Copyright 2013-present, Facebook, Inc.
  9290. * All rights reserved.
  9291. *
  9292. * This source code is licensed under the BSD-style license found in the
  9293. * LICENSE file in the root directory of this source tree. An additional grant
  9294. * of patent rights can be found in the PATENTS file in the same directory.
  9295. *
  9296. * @providesModule ReactMultiChildUpdateTypes
  9297. */
  9298. 'use strict';
  9299. var keyMirror = __webpack_require__(25);
  9300. /**
  9301. * When a component's children are updated, a series of update configuration
  9302. * objects are created in order to batch and serialize the required changes.
  9303. *
  9304. * Enumerates all the possible types of update configurations.
  9305. *
  9306. * @internal
  9307. */
  9308. var ReactMultiChildUpdateTypes = keyMirror({
  9309. INSERT_MARKUP: null,
  9310. MOVE_EXISTING: null,
  9311. REMOVE_NODE: null,
  9312. SET_MARKUP: null,
  9313. TEXT_CONTENT: null
  9314. });
  9315. module.exports = ReactMultiChildUpdateTypes;
  9316. /***/ },
  9317. /* 95 */
  9318. /***/ function(module, exports, __webpack_require__) {
  9319. /**
  9320. * Copyright 2013-present, Facebook, Inc.
  9321. * All rights reserved.
  9322. *
  9323. * This source code is licensed under the BSD-style license found in the
  9324. * LICENSE file in the root directory of this source tree. An additional grant
  9325. * of patent rights can be found in the PATENTS file in the same directory.
  9326. *
  9327. * @providesModule ReactDOMIDOperations
  9328. */
  9329. 'use strict';
  9330. var DOMChildrenOperations = __webpack_require__(83);
  9331. var ReactDOMComponentTree = __webpack_require__(38);
  9332. /**
  9333. * Operations used to process updates to DOM nodes.
  9334. */
  9335. var ReactDOMIDOperations = {
  9336. /**
  9337. * Updates a component's children by processing a series of updates.
  9338. *
  9339. * @param {array<object>} updates List of update configurations.
  9340. * @internal
  9341. */
  9342. dangerouslyProcessChildrenUpdates: function (parentInst, updates) {
  9343. var node = ReactDOMComponentTree.getNodeFromInstance(parentInst);
  9344. DOMChildrenOperations.processUpdates(node, updates);
  9345. }
  9346. };
  9347. module.exports = ReactDOMIDOperations;
  9348. /***/ },
  9349. /* 96 */
  9350. /***/ function(module, exports, __webpack_require__) {
  9351. /* WEBPACK VAR INJECTION */(function(process) {/**
  9352. * Copyright 2013-present, Facebook, Inc.
  9353. * All rights reserved.
  9354. *
  9355. * This source code is licensed under the BSD-style license found in the
  9356. * LICENSE file in the root directory of this source tree. An additional grant
  9357. * of patent rights can be found in the PATENTS file in the same directory.
  9358. *
  9359. * @providesModule ReactDOMComponent
  9360. */
  9361. /* global hasOwnProperty:true */
  9362. 'use strict';
  9363. var _prodInvariant = __webpack_require__(9),
  9364. _assign = __webpack_require__(6);
  9365. var AutoFocusUtils = __webpack_require__(97);
  9366. var CSSPropertyOperations = __webpack_require__(99);
  9367. var DOMLazyTree = __webpack_require__(84);
  9368. var DOMNamespaces = __webpack_require__(85);
  9369. var DOMProperty = __webpack_require__(39);
  9370. var DOMPropertyOperations = __webpack_require__(107);
  9371. var EventConstants = __webpack_require__(43);
  9372. var EventPluginHub = __webpack_require__(45);
  9373. var EventPluginRegistry = __webpack_require__(46);
  9374. var ReactBrowserEventEmitter = __webpack_require__(109);
  9375. var ReactDOMButton = __webpack_require__(112);
  9376. var ReactDOMComponentFlags = __webpack_require__(40);
  9377. var ReactDOMComponentTree = __webpack_require__(38);
  9378. var ReactDOMInput = __webpack_require__(114);
  9379. var ReactDOMOption = __webpack_require__(116);
  9380. var ReactDOMSelect = __webpack_require__(117);
  9381. var ReactDOMTextarea = __webpack_require__(118);
  9382. var ReactInstrumentation = __webpack_require__(64);
  9383. var ReactMultiChild = __webpack_require__(119);
  9384. var ReactServerRenderingTransaction = __webpack_require__(131);
  9385. var emptyFunction = __webpack_require__(14);
  9386. var escapeTextContentForBrowser = __webpack_require__(89);
  9387. var invariant = __webpack_require__(10);
  9388. var isEventSupported = __webpack_require__(73);
  9389. var keyOf = __webpack_require__(27);
  9390. var shallowEqual = __webpack_require__(126);
  9391. var validateDOMNesting = __webpack_require__(134);
  9392. var warning = __webpack_require__(13);
  9393. var Flags = ReactDOMComponentFlags;
  9394. var deleteListener = EventPluginHub.deleteListener;
  9395. var getNode = ReactDOMComponentTree.getNodeFromInstance;
  9396. var listenTo = ReactBrowserEventEmitter.listenTo;
  9397. var registrationNameModules = EventPluginRegistry.registrationNameModules;
  9398. // For quickly matching children type, to test if can be treated as content.
  9399. var CONTENT_TYPES = { 'string': true, 'number': true };
  9400. var STYLE = keyOf({ style: null });
  9401. var HTML = keyOf({ __html: null });
  9402. var RESERVED_PROPS = {
  9403. children: null,
  9404. dangerouslySetInnerHTML: null,
  9405. suppressContentEditableWarning: null
  9406. };
  9407. // Node type for document fragments (Node.DOCUMENT_FRAGMENT_NODE).
  9408. var DOC_FRAGMENT_TYPE = 11;
  9409. function getDeclarationErrorAddendum(internalInstance) {
  9410. if (internalInstance) {
  9411. var owner = internalInstance._currentElement._owner || null;
  9412. if (owner) {
  9413. var name = owner.getName();
  9414. if (name) {
  9415. return ' This DOM node was rendered by `' + name + '`.';
  9416. }
  9417. }
  9418. }
  9419. return '';
  9420. }
  9421. function friendlyStringify(obj) {
  9422. if (typeof obj === 'object') {
  9423. if (Array.isArray(obj)) {
  9424. return '[' + obj.map(friendlyStringify).join(', ') + ']';
  9425. } else {
  9426. var pairs = [];
  9427. for (var key in obj) {
  9428. if (Object.prototype.hasOwnProperty.call(obj, key)) {
  9429. var keyEscaped = /^[a-z$_][\w$_]*$/i.test(key) ? key : JSON.stringify(key);
  9430. pairs.push(keyEscaped + ': ' + friendlyStringify(obj[key]));
  9431. }
  9432. }
  9433. return '{' + pairs.join(', ') + '}';
  9434. }
  9435. } else if (typeof obj === 'string') {
  9436. return JSON.stringify(obj);
  9437. } else if (typeof obj === 'function') {
  9438. return '[function object]';
  9439. }
  9440. // Differs from JSON.stringify in that undefined because undefined and that
  9441. // inf and nan don't become null
  9442. return String(obj);
  9443. }
  9444. var styleMutationWarning = {};
  9445. function checkAndWarnForMutatedStyle(style1, style2, component) {
  9446. if (style1 == null || style2 == null) {
  9447. return;
  9448. }
  9449. if (shallowEqual(style1, style2)) {
  9450. return;
  9451. }
  9452. var componentName = component._tag;
  9453. var owner = component._currentElement._owner;
  9454. var ownerName;
  9455. if (owner) {
  9456. ownerName = owner.getName();
  9457. }
  9458. var hash = ownerName + '|' + componentName;
  9459. if (styleMutationWarning.hasOwnProperty(hash)) {
  9460. return;
  9461. }
  9462. styleMutationWarning[hash] = true;
  9463. process.env.NODE_ENV !== 'production' ? 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;
  9464. }
  9465. /**
  9466. * @param {object} component
  9467. * @param {?object} props
  9468. */
  9469. function assertValidProps(component, props) {
  9470. if (!props) {
  9471. return;
  9472. }
  9473. // Note the use of `==` which checks for null or undefined.
  9474. if (voidElementTags[component._tag]) {
  9475. !(props.children == null && props.dangerouslySetInnerHTML == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`.%s', component._tag, component._currentElement._owner ? ' Check the render method of ' + component._currentElement._owner.getName() + '.' : '') : _prodInvariant('137', component._tag, component._currentElement._owner ? ' Check the render method of ' + component._currentElement._owner.getName() + '.' : '') : void 0;
  9476. }
  9477. if (props.dangerouslySetInnerHTML != null) {
  9478. !(props.children == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Can only set one of `children` or `props.dangerouslySetInnerHTML`.') : _prodInvariant('60') : void 0;
  9479. !(typeof props.dangerouslySetInnerHTML === 'object' && HTML in props.dangerouslySetInnerHTML) ? process.env.NODE_ENV !== 'production' ? invariant(false, '`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://fb.me/react-invariant-dangerously-set-inner-html for more information.') : _prodInvariant('61') : void 0;
  9480. }
  9481. if (process.env.NODE_ENV !== 'production') {
  9482. 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;
  9483. 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;
  9484. 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;
  9485. }
  9486. !(props.style == null || typeof props.style === 'object') ? process.env.NODE_ENV !== 'production' ? 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)) : _prodInvariant('62', getDeclarationErrorAddendum(component)) : void 0;
  9487. }
  9488. function enqueuePutListener(inst, registrationName, listener, transaction) {
  9489. if (transaction instanceof ReactServerRenderingTransaction) {
  9490. return;
  9491. }
  9492. if (process.env.NODE_ENV !== 'production') {
  9493. // IE8 has no API for event capturing and the `onScroll` event doesn't
  9494. // bubble.
  9495. process.env.NODE_ENV !== 'production' ? warning(registrationName !== 'onScroll' || isEventSupported('scroll', true), 'This browser doesn\'t support the `onScroll` event') : void 0;
  9496. }
  9497. var containerInfo = inst._hostContainerInfo;
  9498. var isDocumentFragment = containerInfo._node && containerInfo._node.nodeType === DOC_FRAGMENT_TYPE;
  9499. var doc = isDocumentFragment ? containerInfo._node : containerInfo._ownerDocument;
  9500. listenTo(registrationName, doc);
  9501. transaction.getReactMountReady().enqueue(putListener, {
  9502. inst: inst,
  9503. registrationName: registrationName,
  9504. listener: listener
  9505. });
  9506. }
  9507. function putListener() {
  9508. var listenerToPut = this;
  9509. EventPluginHub.putListener(listenerToPut.inst, listenerToPut.registrationName, listenerToPut.listener);
  9510. }
  9511. function inputPostMount() {
  9512. var inst = this;
  9513. ReactDOMInput.postMountWrapper(inst);
  9514. }
  9515. function textareaPostMount() {
  9516. var inst = this;
  9517. ReactDOMTextarea.postMountWrapper(inst);
  9518. }
  9519. function optionPostMount() {
  9520. var inst = this;
  9521. ReactDOMOption.postMountWrapper(inst);
  9522. }
  9523. var setContentChildForInstrumentation = emptyFunction;
  9524. if (process.env.NODE_ENV !== 'production') {
  9525. setContentChildForInstrumentation = function (content) {
  9526. var hasExistingContent = this._contentDebugID != null;
  9527. var debugID = this._debugID;
  9528. // This ID represents the inlined child that has no backing instance:
  9529. var contentDebugID = -debugID;
  9530. if (content == null) {
  9531. if (hasExistingContent) {
  9532. ReactInstrumentation.debugTool.onUnmountComponent(this._contentDebugID);
  9533. }
  9534. this._contentDebugID = null;
  9535. return;
  9536. }
  9537. this._contentDebugID = contentDebugID;
  9538. if (hasExistingContent) {
  9539. ReactInstrumentation.debugTool.onBeforeUpdateComponent(contentDebugID, content);
  9540. ReactInstrumentation.debugTool.onUpdateComponent(contentDebugID);
  9541. } else {
  9542. ReactInstrumentation.debugTool.onBeforeMountComponent(contentDebugID, content, debugID);
  9543. ReactInstrumentation.debugTool.onMountComponent(contentDebugID);
  9544. ReactInstrumentation.debugTool.onSetChildren(debugID, [contentDebugID]);
  9545. }
  9546. };
  9547. }
  9548. // There are so many media events, it makes sense to just
  9549. // maintain a list rather than create a `trapBubbledEvent` for each
  9550. var mediaEvents = {
  9551. topAbort: 'abort',
  9552. topCanPlay: 'canplay',
  9553. topCanPlayThrough: 'canplaythrough',
  9554. topDurationChange: 'durationchange',
  9555. topEmptied: 'emptied',
  9556. topEncrypted: 'encrypted',
  9557. topEnded: 'ended',
  9558. topError: 'error',
  9559. topLoadedData: 'loadeddata',
  9560. topLoadedMetadata: 'loadedmetadata',
  9561. topLoadStart: 'loadstart',
  9562. topPause: 'pause',
  9563. topPlay: 'play',
  9564. topPlaying: 'playing',
  9565. topProgress: 'progress',
  9566. topRateChange: 'ratechange',
  9567. topSeeked: 'seeked',
  9568. topSeeking: 'seeking',
  9569. topStalled: 'stalled',
  9570. topSuspend: 'suspend',
  9571. topTimeUpdate: 'timeupdate',
  9572. topVolumeChange: 'volumechange',
  9573. topWaiting: 'waiting'
  9574. };
  9575. function trapBubbledEventsLocal() {
  9576. var inst = this;
  9577. // If a component renders to null or if another component fatals and causes
  9578. // the state of the tree to be corrupted, `node` here can be null.
  9579. !inst._rootNodeID ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Must be mounted to trap events') : _prodInvariant('63') : void 0;
  9580. var node = getNode(inst);
  9581. !node ? process.env.NODE_ENV !== 'production' ? invariant(false, 'trapBubbledEvent(...): Requires node to be rendered.') : _prodInvariant('64') : void 0;
  9582. switch (inst._tag) {
  9583. case 'iframe':
  9584. case 'object':
  9585. inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topLoad, 'load', node)];
  9586. break;
  9587. case 'video':
  9588. case 'audio':
  9589. inst._wrapperState.listeners = [];
  9590. // Create listener for each media event
  9591. for (var event in mediaEvents) {
  9592. if (mediaEvents.hasOwnProperty(event)) {
  9593. inst._wrapperState.listeners.push(ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes[event], mediaEvents[event], node));
  9594. }
  9595. }
  9596. break;
  9597. case 'source':
  9598. inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topError, 'error', node)];
  9599. break;
  9600. case 'img':
  9601. inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topError, 'error', node), ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topLoad, 'load', node)];
  9602. break;
  9603. case 'form':
  9604. inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topReset, 'reset', node), ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topSubmit, 'submit', node)];
  9605. break;
  9606. case 'input':
  9607. case 'select':
  9608. case 'textarea':
  9609. inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topInvalid, 'invalid', node)];
  9610. break;
  9611. }
  9612. }
  9613. function postUpdateSelectWrapper() {
  9614. ReactDOMSelect.postUpdateWrapper(this);
  9615. }
  9616. // For HTML, certain tags should omit their close tag. We keep a whitelist for
  9617. // those special-case tags.
  9618. var omittedCloseTags = {
  9619. 'area': true,
  9620. 'base': true,
  9621. 'br': true,
  9622. 'col': true,
  9623. 'embed': true,
  9624. 'hr': true,
  9625. 'img': true,
  9626. 'input': true,
  9627. 'keygen': true,
  9628. 'link': true,
  9629. 'meta': true,
  9630. 'param': true,
  9631. 'source': true,
  9632. 'track': true,
  9633. 'wbr': true
  9634. };
  9635. // NOTE: menuitem's close tag should be omitted, but that causes problems.
  9636. var newlineEatingTags = {
  9637. 'listing': true,
  9638. 'pre': true,
  9639. 'textarea': true
  9640. };
  9641. // For HTML, certain tags cannot have children. This has the same purpose as
  9642. // `omittedCloseTags` except that `menuitem` should still have its closing tag.
  9643. var voidElementTags = _assign({
  9644. 'menuitem': true
  9645. }, omittedCloseTags);
  9646. // We accept any tag to be rendered but since this gets injected into arbitrary
  9647. // HTML, we want to make sure that it's a safe tag.
  9648. // http://www.w3.org/TR/REC-xml/#NT-Name
  9649. var VALID_TAG_REGEX = /^[a-zA-Z][a-zA-Z:_\.\-\d]*$/; // Simplified subset
  9650. var validatedTagCache = {};
  9651. var hasOwnProperty = {}.hasOwnProperty;
  9652. function validateDangerousTag(tag) {
  9653. if (!hasOwnProperty.call(validatedTagCache, tag)) {
  9654. !VALID_TAG_REGEX.test(tag) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Invalid tag: %s', tag) : _prodInvariant('65', tag) : void 0;
  9655. validatedTagCache[tag] = true;
  9656. }
  9657. }
  9658. function isCustomComponent(tagName, props) {
  9659. return tagName.indexOf('-') >= 0 || props.is != null;
  9660. }
  9661. var globalIdCounter = 1;
  9662. /**
  9663. * Creates a new React class that is idempotent and capable of containing other
  9664. * React components. It accepts event listeners and DOM properties that are
  9665. * valid according to `DOMProperty`.
  9666. *
  9667. * - Event listeners: `onClick`, `onMouseDown`, etc.
  9668. * - DOM properties: `className`, `name`, `title`, etc.
  9669. *
  9670. * The `style` property functions differently from the DOM API. It accepts an
  9671. * object mapping of style properties to values.
  9672. *
  9673. * @constructor ReactDOMComponent
  9674. * @extends ReactMultiChild
  9675. */
  9676. function ReactDOMComponent(element) {
  9677. var tag = element.type;
  9678. validateDangerousTag(tag);
  9679. this._currentElement = element;
  9680. this._tag = tag.toLowerCase();
  9681. this._namespaceURI = null;
  9682. this._renderedChildren = null;
  9683. this._previousStyle = null;
  9684. this._previousStyleCopy = null;
  9685. this._hostNode = null;
  9686. this._hostParent = null;
  9687. this._rootNodeID = 0;
  9688. this._domID = 0;
  9689. this._hostContainerInfo = null;
  9690. this._wrapperState = null;
  9691. this._topLevelWrapper = null;
  9692. this._flags = 0;
  9693. if (process.env.NODE_ENV !== 'production') {
  9694. this._ancestorInfo = null;
  9695. setContentChildForInstrumentation.call(this, null);
  9696. }
  9697. }
  9698. ReactDOMComponent.displayName = 'ReactDOMComponent';
  9699. ReactDOMComponent.Mixin = {
  9700. /**
  9701. * Generates root tag markup then recurses. This method has side effects and
  9702. * is not idempotent.
  9703. *
  9704. * @internal
  9705. * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
  9706. * @param {?ReactDOMComponent} the parent component instance
  9707. * @param {?object} info about the host container
  9708. * @param {object} context
  9709. * @return {string} The computed markup.
  9710. */
  9711. mountComponent: function (transaction, hostParent, hostContainerInfo, context) {
  9712. this._rootNodeID = globalIdCounter++;
  9713. this._domID = hostContainerInfo._idCounter++;
  9714. this._hostParent = hostParent;
  9715. this._hostContainerInfo = hostContainerInfo;
  9716. var props = this._currentElement.props;
  9717. switch (this._tag) {
  9718. case 'audio':
  9719. case 'form':
  9720. case 'iframe':
  9721. case 'img':
  9722. case 'link':
  9723. case 'object':
  9724. case 'source':
  9725. case 'video':
  9726. this._wrapperState = {
  9727. listeners: null
  9728. };
  9729. transaction.getReactMountReady().enqueue(trapBubbledEventsLocal, this);
  9730. break;
  9731. case 'button':
  9732. props = ReactDOMButton.getHostProps(this, props, hostParent);
  9733. break;
  9734. case 'input':
  9735. ReactDOMInput.mountWrapper(this, props, hostParent);
  9736. props = ReactDOMInput.getHostProps(this, props);
  9737. transaction.getReactMountReady().enqueue(trapBubbledEventsLocal, this);
  9738. break;
  9739. case 'option':
  9740. ReactDOMOption.mountWrapper(this, props, hostParent);
  9741. props = ReactDOMOption.getHostProps(this, props);
  9742. break;
  9743. case 'select':
  9744. ReactDOMSelect.mountWrapper(this, props, hostParent);
  9745. props = ReactDOMSelect.getHostProps(this, props);
  9746. transaction.getReactMountReady().enqueue(trapBubbledEventsLocal, this);
  9747. break;
  9748. case 'textarea':
  9749. ReactDOMTextarea.mountWrapper(this, props, hostParent);
  9750. props = ReactDOMTextarea.getHostProps(this, props);
  9751. transaction.getReactMountReady().enqueue(trapBubbledEventsLocal, this);
  9752. break;
  9753. }
  9754. assertValidProps(this, props);
  9755. // We create tags in the namespace of their parent container, except HTML
  9756. // tags get no namespace.
  9757. var namespaceURI;
  9758. var parentTag;
  9759. if (hostParent != null) {
  9760. namespaceURI = hostParent._namespaceURI;
  9761. parentTag = hostParent._tag;
  9762. } else if (hostContainerInfo._tag) {
  9763. namespaceURI = hostContainerInfo._namespaceURI;
  9764. parentTag = hostContainerInfo._tag;
  9765. }
  9766. if (namespaceURI == null || namespaceURI === DOMNamespaces.svg && parentTag === 'foreignobject') {
  9767. namespaceURI = DOMNamespaces.html;
  9768. }
  9769. if (namespaceURI === DOMNamespaces.html) {
  9770. if (this._tag === 'svg') {
  9771. namespaceURI = DOMNamespaces.svg;
  9772. } else if (this._tag === 'math') {
  9773. namespaceURI = DOMNamespaces.mathml;
  9774. }
  9775. }
  9776. this._namespaceURI = namespaceURI;
  9777. if (process.env.NODE_ENV !== 'production') {
  9778. var parentInfo;
  9779. if (hostParent != null) {
  9780. parentInfo = hostParent._ancestorInfo;
  9781. } else if (hostContainerInfo._tag) {
  9782. parentInfo = hostContainerInfo._ancestorInfo;
  9783. }
  9784. if (parentInfo) {
  9785. // parentInfo should always be present except for the top-level
  9786. // component when server rendering
  9787. validateDOMNesting(this._tag, this, parentInfo);
  9788. }
  9789. this._ancestorInfo = validateDOMNesting.updatedAncestorInfo(parentInfo, this._tag, this);
  9790. }
  9791. var mountImage;
  9792. if (transaction.useCreateElement) {
  9793. var ownerDocument = hostContainerInfo._ownerDocument;
  9794. var el;
  9795. if (namespaceURI === DOMNamespaces.html) {
  9796. if (this._tag === 'script') {
  9797. // Create the script via .innerHTML so its "parser-inserted" flag is
  9798. // set to true and it does not execute
  9799. var div = ownerDocument.createElement('div');
  9800. var type = this._currentElement.type;
  9801. div.innerHTML = '<' + type + '></' + type + '>';
  9802. el = div.removeChild(div.firstChild);
  9803. } else if (props.is) {
  9804. el = ownerDocument.createElement(this._currentElement.type, props.is);
  9805. } else {
  9806. // Separate else branch instead of using `props.is || undefined` above becuase of a Firefox bug.
  9807. // See discussion in https://github.com/facebook/react/pull/6896
  9808. // and discussion in https://bugzilla.mozilla.org/show_bug.cgi?id=1276240
  9809. el = ownerDocument.createElement(this._currentElement.type);
  9810. }
  9811. } else {
  9812. el = ownerDocument.createElementNS(namespaceURI, this._currentElement.type);
  9813. }
  9814. ReactDOMComponentTree.precacheNode(this, el);
  9815. this._flags |= Flags.hasCachedChildNodes;
  9816. if (!this._hostParent) {
  9817. DOMPropertyOperations.setAttributeForRoot(el);
  9818. }
  9819. this._updateDOMProperties(null, props, transaction);
  9820. var lazyTree = DOMLazyTree(el);
  9821. this._createInitialChildren(transaction, props, context, lazyTree);
  9822. mountImage = lazyTree;
  9823. } else {
  9824. var tagOpen = this._createOpenTagMarkupAndPutListeners(transaction, props);
  9825. var tagContent = this._createContentMarkup(transaction, props, context);
  9826. if (!tagContent && omittedCloseTags[this._tag]) {
  9827. mountImage = tagOpen + '/>';
  9828. } else {
  9829. mountImage = tagOpen + '>' + tagContent + '</' + this._currentElement.type + '>';
  9830. }
  9831. }
  9832. switch (this._tag) {
  9833. case 'input':
  9834. transaction.getReactMountReady().enqueue(inputPostMount, this);
  9835. if (props.autoFocus) {
  9836. transaction.getReactMountReady().enqueue(AutoFocusUtils.focusDOMComponent, this);
  9837. }
  9838. break;
  9839. case 'textarea':
  9840. transaction.getReactMountReady().enqueue(textareaPostMount, this);
  9841. if (props.autoFocus) {
  9842. transaction.getReactMountReady().enqueue(AutoFocusUtils.focusDOMComponent, this);
  9843. }
  9844. break;
  9845. case 'select':
  9846. if (props.autoFocus) {
  9847. transaction.getReactMountReady().enqueue(AutoFocusUtils.focusDOMComponent, this);
  9848. }
  9849. break;
  9850. case 'button':
  9851. if (props.autoFocus) {
  9852. transaction.getReactMountReady().enqueue(AutoFocusUtils.focusDOMComponent, this);
  9853. }
  9854. break;
  9855. case 'option':
  9856. transaction.getReactMountReady().enqueue(optionPostMount, this);
  9857. break;
  9858. }
  9859. return mountImage;
  9860. },
  9861. /**
  9862. * Creates markup for the open tag and all attributes.
  9863. *
  9864. * This method has side effects because events get registered.
  9865. *
  9866. * Iterating over object properties is faster than iterating over arrays.
  9867. * @see http://jsperf.com/obj-vs-arr-iteration
  9868. *
  9869. * @private
  9870. * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
  9871. * @param {object} props
  9872. * @return {string} Markup of opening tag.
  9873. */
  9874. _createOpenTagMarkupAndPutListeners: function (transaction, props) {
  9875. var ret = '<' + this._currentElement.type;
  9876. for (var propKey in props) {
  9877. if (!props.hasOwnProperty(propKey)) {
  9878. continue;
  9879. }
  9880. var propValue = props[propKey];
  9881. if (propValue == null) {
  9882. continue;
  9883. }
  9884. if (registrationNameModules.hasOwnProperty(propKey)) {
  9885. if (propValue) {
  9886. enqueuePutListener(this, propKey, propValue, transaction);
  9887. }
  9888. } else {
  9889. if (propKey === STYLE) {
  9890. if (propValue) {
  9891. if (process.env.NODE_ENV !== 'production') {
  9892. // See `_updateDOMProperties`. style block
  9893. this._previousStyle = propValue;
  9894. }
  9895. propValue = this._previousStyleCopy = _assign({}, props.style);
  9896. }
  9897. propValue = CSSPropertyOperations.createMarkupForStyles(propValue, this);
  9898. }
  9899. var markup = null;
  9900. if (this._tag != null && isCustomComponent(this._tag, props)) {
  9901. if (!RESERVED_PROPS.hasOwnProperty(propKey)) {
  9902. markup = DOMPropertyOperations.createMarkupForCustomAttribute(propKey, propValue);
  9903. }
  9904. } else {
  9905. markup = DOMPropertyOperations.createMarkupForProperty(propKey, propValue);
  9906. }
  9907. if (markup) {
  9908. ret += ' ' + markup;
  9909. }
  9910. }
  9911. }
  9912. // For static pages, no need to put React ID and checksum. Saves lots of
  9913. // bytes.
  9914. if (transaction.renderToStaticMarkup) {
  9915. return ret;
  9916. }
  9917. if (!this._hostParent) {
  9918. ret += ' ' + DOMPropertyOperations.createMarkupForRoot();
  9919. }
  9920. ret += ' ' + DOMPropertyOperations.createMarkupForID(this._domID);
  9921. return ret;
  9922. },
  9923. /**
  9924. * Creates markup for the content between the tags.
  9925. *
  9926. * @private
  9927. * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
  9928. * @param {object} props
  9929. * @param {object} context
  9930. * @return {string} Content markup.
  9931. */
  9932. _createContentMarkup: function (transaction, props, context) {
  9933. var ret = '';
  9934. // Intentional use of != to avoid catching zero/false.
  9935. var innerHTML = props.dangerouslySetInnerHTML;
  9936. if (innerHTML != null) {
  9937. if (innerHTML.__html != null) {
  9938. ret = innerHTML.__html;
  9939. }
  9940. } else {
  9941. var contentToUse = CONTENT_TYPES[typeof props.children] ? props.children : null;
  9942. var childrenToUse = contentToUse != null ? null : props.children;
  9943. if (contentToUse != null) {
  9944. // TODO: Validate that text is allowed as a child of this node
  9945. ret = escapeTextContentForBrowser(contentToUse);
  9946. if (process.env.NODE_ENV !== 'production') {
  9947. setContentChildForInstrumentation.call(this, contentToUse);
  9948. }
  9949. } else if (childrenToUse != null) {
  9950. var mountImages = this.mountChildren(childrenToUse, transaction, context);
  9951. ret = mountImages.join('');
  9952. }
  9953. }
  9954. if (newlineEatingTags[this._tag] && ret.charAt(0) === '\n') {
  9955. // text/html ignores the first character in these tags if it's a newline
  9956. // Prefer to break application/xml over text/html (for now) by adding
  9957. // a newline specifically to get eaten by the parser. (Alternately for
  9958. // textareas, replacing "^\n" with "\r\n" doesn't get eaten, and the first
  9959. // \r is normalized out by HTMLTextAreaElement#value.)
  9960. // See: <http://www.w3.org/TR/html-polyglot/#newlines-in-textarea-and-pre>
  9961. // See: <http://www.w3.org/TR/html5/syntax.html#element-restrictions>
  9962. // See: <http://www.w3.org/TR/html5/syntax.html#newlines>
  9963. // See: Parsing of "textarea" "listing" and "pre" elements
  9964. // from <http://www.w3.org/TR/html5/syntax.html#parsing-main-inbody>
  9965. return '\n' + ret;
  9966. } else {
  9967. return ret;
  9968. }
  9969. },
  9970. _createInitialChildren: function (transaction, props, context, lazyTree) {
  9971. // Intentional use of != to avoid catching zero/false.
  9972. var innerHTML = props.dangerouslySetInnerHTML;
  9973. if (innerHTML != null) {
  9974. if (innerHTML.__html != null) {
  9975. DOMLazyTree.queueHTML(lazyTree, innerHTML.__html);
  9976. }
  9977. } else {
  9978. var contentToUse = CONTENT_TYPES[typeof props.children] ? props.children : null;
  9979. var childrenToUse = contentToUse != null ? null : props.children;
  9980. if (contentToUse != null) {
  9981. // TODO: Validate that text is allowed as a child of this node
  9982. if (process.env.NODE_ENV !== 'production') {
  9983. setContentChildForInstrumentation.call(this, contentToUse);
  9984. }
  9985. DOMLazyTree.queueText(lazyTree, contentToUse);
  9986. } else if (childrenToUse != null) {
  9987. var mountImages = this.mountChildren(childrenToUse, transaction, context);
  9988. for (var i = 0; i < mountImages.length; i++) {
  9989. DOMLazyTree.queueChild(lazyTree, mountImages[i]);
  9990. }
  9991. }
  9992. }
  9993. },
  9994. /**
  9995. * Receives a next element and updates the component.
  9996. *
  9997. * @internal
  9998. * @param {ReactElement} nextElement
  9999. * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
  10000. * @param {object} context
  10001. */
  10002. receiveComponent: function (nextElement, transaction, context) {
  10003. var prevElement = this._currentElement;
  10004. this._currentElement = nextElement;
  10005. this.updateComponent(transaction, prevElement, nextElement, context);
  10006. },
  10007. /**
  10008. * Updates a DOM component after it has already been allocated and
  10009. * attached to the DOM. Reconciles the root DOM node, then recurses.
  10010. *
  10011. * @param {ReactReconcileTransaction} transaction
  10012. * @param {ReactElement} prevElement
  10013. * @param {ReactElement} nextElement
  10014. * @internal
  10015. * @overridable
  10016. */
  10017. updateComponent: function (transaction, prevElement, nextElement, context) {
  10018. var lastProps = prevElement.props;
  10019. var nextProps = this._currentElement.props;
  10020. switch (this._tag) {
  10021. case 'button':
  10022. lastProps = ReactDOMButton.getHostProps(this, lastProps);
  10023. nextProps = ReactDOMButton.getHostProps(this, nextProps);
  10024. break;
  10025. case 'input':
  10026. lastProps = ReactDOMInput.getHostProps(this, lastProps);
  10027. nextProps = ReactDOMInput.getHostProps(this, nextProps);
  10028. break;
  10029. case 'option':
  10030. lastProps = ReactDOMOption.getHostProps(this, lastProps);
  10031. nextProps = ReactDOMOption.getHostProps(this, nextProps);
  10032. break;
  10033. case 'select':
  10034. lastProps = ReactDOMSelect.getHostProps(this, lastProps);
  10035. nextProps = ReactDOMSelect.getHostProps(this, nextProps);
  10036. break;
  10037. case 'textarea':
  10038. lastProps = ReactDOMTextarea.getHostProps(this, lastProps);
  10039. nextProps = ReactDOMTextarea.getHostProps(this, nextProps);
  10040. break;
  10041. }
  10042. assertValidProps(this, nextProps);
  10043. this._updateDOMProperties(lastProps, nextProps, transaction);
  10044. this._updateDOMChildren(lastProps, nextProps, transaction, context);
  10045. switch (this._tag) {
  10046. case 'input':
  10047. // Update the wrapper around inputs *after* updating props. This has to
  10048. // happen after `_updateDOMProperties`. Otherwise HTML5 input validations
  10049. // raise warnings and prevent the new value from being assigned.
  10050. ReactDOMInput.updateWrapper(this);
  10051. break;
  10052. case 'textarea':
  10053. ReactDOMTextarea.updateWrapper(this);
  10054. break;
  10055. case 'select':
  10056. // <select> value update needs to occur after <option> children
  10057. // reconciliation
  10058. transaction.getReactMountReady().enqueue(postUpdateSelectWrapper, this);
  10059. break;
  10060. }
  10061. },
  10062. /**
  10063. * Reconciles the properties by detecting differences in property values and
  10064. * updating the DOM as necessary. This function is probably the single most
  10065. * critical path for performance optimization.
  10066. *
  10067. * TODO: Benchmark whether checking for changed values in memory actually
  10068. * improves performance (especially statically positioned elements).
  10069. * TODO: Benchmark the effects of putting this at the top since 99% of props
  10070. * do not change for a given reconciliation.
  10071. * TODO: Benchmark areas that can be improved with caching.
  10072. *
  10073. * @private
  10074. * @param {object} lastProps
  10075. * @param {object} nextProps
  10076. * @param {?DOMElement} node
  10077. */
  10078. _updateDOMProperties: function (lastProps, nextProps, transaction) {
  10079. var propKey;
  10080. var styleName;
  10081. var styleUpdates;
  10082. for (propKey in lastProps) {
  10083. if (nextProps.hasOwnProperty(propKey) || !lastProps.hasOwnProperty(propKey) || lastProps[propKey] == null) {
  10084. continue;
  10085. }
  10086. if (propKey === STYLE) {
  10087. var lastStyle = this._previousStyleCopy;
  10088. for (styleName in lastStyle) {
  10089. if (lastStyle.hasOwnProperty(styleName)) {
  10090. styleUpdates = styleUpdates || {};
  10091. styleUpdates[styleName] = '';
  10092. }
  10093. }
  10094. this._previousStyleCopy = null;
  10095. } else if (registrationNameModules.hasOwnProperty(propKey)) {
  10096. if (lastProps[propKey]) {
  10097. // Only call deleteListener if there was a listener previously or
  10098. // else willDeleteListener gets called when there wasn't actually a
  10099. // listener (e.g., onClick={null})
  10100. deleteListener(this, propKey);
  10101. }
  10102. } else if (isCustomComponent(this._tag, lastProps)) {
  10103. if (!RESERVED_PROPS.hasOwnProperty(propKey)) {
  10104. DOMPropertyOperations.deleteValueForAttribute(getNode(this), propKey);
  10105. }
  10106. } else if (DOMProperty.properties[propKey] || DOMProperty.isCustomAttribute(propKey)) {
  10107. DOMPropertyOperations.deleteValueForProperty(getNode(this), propKey);
  10108. }
  10109. }
  10110. for (propKey in nextProps) {
  10111. var nextProp = nextProps[propKey];
  10112. var lastProp = propKey === STYLE ? this._previousStyleCopy : lastProps != null ? lastProps[propKey] : undefined;
  10113. if (!nextProps.hasOwnProperty(propKey) || nextProp === lastProp || nextProp == null && lastProp == null) {
  10114. continue;
  10115. }
  10116. if (propKey === STYLE) {
  10117. if (nextProp) {
  10118. if (process.env.NODE_ENV !== 'production') {
  10119. checkAndWarnForMutatedStyle(this._previousStyleCopy, this._previousStyle, this);
  10120. this._previousStyle = nextProp;
  10121. }
  10122. nextProp = this._previousStyleCopy = _assign({}, nextProp);
  10123. } else {
  10124. this._previousStyleCopy = null;
  10125. }
  10126. if (lastProp) {
  10127. // Unset styles on `lastProp` but not on `nextProp`.
  10128. for (styleName in lastProp) {
  10129. if (lastProp.hasOwnProperty(styleName) && (!nextProp || !nextProp.hasOwnProperty(styleName))) {
  10130. styleUpdates = styleUpdates || {};
  10131. styleUpdates[styleName] = '';
  10132. }
  10133. }
  10134. // Update styles that changed since `lastProp`.
  10135. for (styleName in nextProp) {
  10136. if (nextProp.hasOwnProperty(styleName) && lastProp[styleName] !== nextProp[styleName]) {
  10137. styleUpdates = styleUpdates || {};
  10138. styleUpdates[styleName] = nextProp[styleName];
  10139. }
  10140. }
  10141. } else {
  10142. // Relies on `updateStylesByID` not mutating `styleUpdates`.
  10143. styleUpdates = nextProp;
  10144. }
  10145. } else if (registrationNameModules.hasOwnProperty(propKey)) {
  10146. if (nextProp) {
  10147. enqueuePutListener(this, propKey, nextProp, transaction);
  10148. } else if (lastProp) {
  10149. deleteListener(this, propKey);
  10150. }
  10151. } else if (isCustomComponent(this._tag, nextProps)) {
  10152. if (!RESERVED_PROPS.hasOwnProperty(propKey)) {
  10153. DOMPropertyOperations.setValueForAttribute(getNode(this), propKey, nextProp);
  10154. }
  10155. } else if (DOMProperty.properties[propKey] || DOMProperty.isCustomAttribute(propKey)) {
  10156. var node = getNode(this);
  10157. // If we're updating to null or undefined, we should remove the property
  10158. // from the DOM node instead of inadvertently setting to a string. This
  10159. // brings us in line with the same behavior we have on initial render.
  10160. if (nextProp != null) {
  10161. DOMPropertyOperations.setValueForProperty(node, propKey, nextProp);
  10162. } else {
  10163. DOMPropertyOperations.deleteValueForProperty(node, propKey);
  10164. }
  10165. }
  10166. }
  10167. if (styleUpdates) {
  10168. CSSPropertyOperations.setValueForStyles(getNode(this), styleUpdates, this);
  10169. }
  10170. },
  10171. /**
  10172. * Reconciles the children with the various properties that affect the
  10173. * children content.
  10174. *
  10175. * @param {object} lastProps
  10176. * @param {object} nextProps
  10177. * @param {ReactReconcileTransaction} transaction
  10178. * @param {object} context
  10179. */
  10180. _updateDOMChildren: function (lastProps, nextProps, transaction, context) {
  10181. var lastContent = CONTENT_TYPES[typeof lastProps.children] ? lastProps.children : null;
  10182. var nextContent = CONTENT_TYPES[typeof nextProps.children] ? nextProps.children : null;
  10183. var lastHtml = lastProps.dangerouslySetInnerHTML && lastProps.dangerouslySetInnerHTML.__html;
  10184. var nextHtml = nextProps.dangerouslySetInnerHTML && nextProps.dangerouslySetInnerHTML.__html;
  10185. // Note the use of `!=` which checks for null or undefined.
  10186. var lastChildren = lastContent != null ? null : lastProps.children;
  10187. var nextChildren = nextContent != null ? null : nextProps.children;
  10188. // If we're switching from children to content/html or vice versa, remove
  10189. // the old content
  10190. var lastHasContentOrHtml = lastContent != null || lastHtml != null;
  10191. var nextHasContentOrHtml = nextContent != null || nextHtml != null;
  10192. if (lastChildren != null && nextChildren == null) {
  10193. this.updateChildren(null, transaction, context);
  10194. } else if (lastHasContentOrHtml && !nextHasContentOrHtml) {
  10195. this.updateTextContent('');
  10196. if (process.env.NODE_ENV !== 'production') {
  10197. ReactInstrumentation.debugTool.onSetChildren(this._debugID, []);
  10198. }
  10199. }
  10200. if (nextContent != null) {
  10201. if (lastContent !== nextContent) {
  10202. this.updateTextContent('' + nextContent);
  10203. if (process.env.NODE_ENV !== 'production') {
  10204. setContentChildForInstrumentation.call(this, nextContent);
  10205. }
  10206. }
  10207. } else if (nextHtml != null) {
  10208. if (lastHtml !== nextHtml) {
  10209. this.updateMarkup('' + nextHtml);
  10210. }
  10211. if (process.env.NODE_ENV !== 'production') {
  10212. ReactInstrumentation.debugTool.onSetChildren(this._debugID, []);
  10213. }
  10214. } else if (nextChildren != null) {
  10215. if (process.env.NODE_ENV !== 'production') {
  10216. setContentChildForInstrumentation.call(this, null);
  10217. }
  10218. this.updateChildren(nextChildren, transaction, context);
  10219. }
  10220. },
  10221. getHostNode: function () {
  10222. return getNode(this);
  10223. },
  10224. /**
  10225. * Destroys all event registrations for this instance. Does not remove from
  10226. * the DOM. That must be done by the parent.
  10227. *
  10228. * @internal
  10229. */
  10230. unmountComponent: function (safely) {
  10231. switch (this._tag) {
  10232. case 'audio':
  10233. case 'form':
  10234. case 'iframe':
  10235. case 'img':
  10236. case 'link':
  10237. case 'object':
  10238. case 'source':
  10239. case 'video':
  10240. var listeners = this._wrapperState.listeners;
  10241. if (listeners) {
  10242. for (var i = 0; i < listeners.length; i++) {
  10243. listeners[i].remove();
  10244. }
  10245. }
  10246. break;
  10247. case 'html':
  10248. case 'head':
  10249. case 'body':
  10250. /**
  10251. * Components like <html> <head> and <body> can't be removed or added
  10252. * easily in a cross-browser way, however it's valuable to be able to
  10253. * take advantage of React's reconciliation for styling and <title>
  10254. * management. So we just document it and throw in dangerous cases.
  10255. */
  10256. true ? process.env.NODE_ENV !== 'production' ? 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) : _prodInvariant('66', this._tag) : void 0;
  10257. break;
  10258. }
  10259. this.unmountChildren(safely);
  10260. ReactDOMComponentTree.uncacheNode(this);
  10261. EventPluginHub.deleteAllListeners(this);
  10262. this._rootNodeID = 0;
  10263. this._domID = 0;
  10264. this._wrapperState = null;
  10265. if (process.env.NODE_ENV !== 'production') {
  10266. setContentChildForInstrumentation.call(this, null);
  10267. }
  10268. },
  10269. getPublicInstance: function () {
  10270. return getNode(this);
  10271. }
  10272. };
  10273. _assign(ReactDOMComponent.prototype, ReactDOMComponent.Mixin, ReactMultiChild.Mixin);
  10274. module.exports = ReactDOMComponent;
  10275. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  10276. /***/ },
  10277. /* 97 */
  10278. /***/ function(module, exports, __webpack_require__) {
  10279. /**
  10280. * Copyright 2013-present, Facebook, Inc.
  10281. * All rights reserved.
  10282. *
  10283. * This source code is licensed under the BSD-style license found in the
  10284. * LICENSE file in the root directory of this source tree. An additional grant
  10285. * of patent rights can be found in the PATENTS file in the same directory.
  10286. *
  10287. * @providesModule AutoFocusUtils
  10288. */
  10289. 'use strict';
  10290. var ReactDOMComponentTree = __webpack_require__(38);
  10291. var focusNode = __webpack_require__(98);
  10292. var AutoFocusUtils = {
  10293. focusDOMComponent: function () {
  10294. focusNode(ReactDOMComponentTree.getNodeFromInstance(this));
  10295. }
  10296. };
  10297. module.exports = AutoFocusUtils;
  10298. /***/ },
  10299. /* 98 */
  10300. /***/ function(module, exports) {
  10301. /**
  10302. * Copyright (c) 2013-present, Facebook, Inc.
  10303. * All rights reserved.
  10304. *
  10305. * This source code is licensed under the BSD-style license found in the
  10306. * LICENSE file in the root directory of this source tree. An additional grant
  10307. * of patent rights can be found in the PATENTS file in the same directory.
  10308. *
  10309. */
  10310. 'use strict';
  10311. /**
  10312. * @param {DOMElement} node input/textarea to focus
  10313. */
  10314. function focusNode(node) {
  10315. // IE8 can throw "Can't move focus to the control because it is invisible,
  10316. // not enabled, or of a type that does not accept the focus." for all kinds of
  10317. // reasons that are too expensive and fragile to test.
  10318. try {
  10319. node.focus();
  10320. } catch (e) {}
  10321. }
  10322. module.exports = focusNode;
  10323. /***/ },
  10324. /* 99 */
  10325. /***/ function(module, exports, __webpack_require__) {
  10326. /* WEBPACK VAR INJECTION */(function(process) {/**
  10327. * Copyright 2013-present, Facebook, Inc.
  10328. * All rights reserved.
  10329. *
  10330. * This source code is licensed under the BSD-style license found in the
  10331. * LICENSE file in the root directory of this source tree. An additional grant
  10332. * of patent rights can be found in the PATENTS file in the same directory.
  10333. *
  10334. * @providesModule CSSPropertyOperations
  10335. */
  10336. 'use strict';
  10337. var CSSProperty = __webpack_require__(100);
  10338. var ExecutionEnvironment = __webpack_require__(51);
  10339. var ReactInstrumentation = __webpack_require__(64);
  10340. var camelizeStyleName = __webpack_require__(101);
  10341. var dangerousStyleValue = __webpack_require__(103);
  10342. var hyphenateStyleName = __webpack_require__(104);
  10343. var memoizeStringOnly = __webpack_require__(106);
  10344. var warning = __webpack_require__(13);
  10345. var processStyleName = memoizeStringOnly(function (styleName) {
  10346. return hyphenateStyleName(styleName);
  10347. });
  10348. var hasShorthandPropertyBug = false;
  10349. var styleFloatAccessor = 'cssFloat';
  10350. if (ExecutionEnvironment.canUseDOM) {
  10351. var tempStyle = document.createElement('div').style;
  10352. try {
  10353. // IE8 throws "Invalid argument." if resetting shorthand style properties.
  10354. tempStyle.font = '';
  10355. } catch (e) {
  10356. hasShorthandPropertyBug = true;
  10357. }
  10358. // IE8 only supports accessing cssFloat (standard) as styleFloat
  10359. if (document.documentElement.style.cssFloat === undefined) {
  10360. styleFloatAccessor = 'styleFloat';
  10361. }
  10362. }
  10363. if (process.env.NODE_ENV !== 'production') {
  10364. // 'msTransform' is correct, but the other prefixes should be capitalized
  10365. var badVendoredStyleNamePattern = /^(?:webkit|moz|o)[A-Z]/;
  10366. // style values shouldn't contain a semicolon
  10367. var badStyleValueWithSemicolonPattern = /;\s*$/;
  10368. var warnedStyleNames = {};
  10369. var warnedStyleValues = {};
  10370. var warnedForNaNValue = false;
  10371. var warnHyphenatedStyleName = function (name, owner) {
  10372. if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {
  10373. return;
  10374. }
  10375. warnedStyleNames[name] = true;
  10376. process.env.NODE_ENV !== 'production' ? warning(false, 'Unsupported style property %s. Did you mean %s?%s', name, camelizeStyleName(name), checkRenderMessage(owner)) : void 0;
  10377. };
  10378. var warnBadVendoredStyleName = function (name, owner) {
  10379. if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {
  10380. return;
  10381. }
  10382. warnedStyleNames[name] = true;
  10383. 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;
  10384. };
  10385. var warnStyleValueWithSemicolon = function (name, value, owner) {
  10386. if (warnedStyleValues.hasOwnProperty(value) && warnedStyleValues[value]) {
  10387. return;
  10388. }
  10389. warnedStyleValues[value] = true;
  10390. 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;
  10391. };
  10392. var warnStyleValueIsNaN = function (name, value, owner) {
  10393. if (warnedForNaNValue) {
  10394. return;
  10395. }
  10396. warnedForNaNValue = true;
  10397. process.env.NODE_ENV !== 'production' ? warning(false, '`NaN` is an invalid value for the `%s` css style property.%s', name, checkRenderMessage(owner)) : void 0;
  10398. };
  10399. var checkRenderMessage = function (owner) {
  10400. if (owner) {
  10401. var name = owner.getName();
  10402. if (name) {
  10403. return ' Check the render method of `' + name + '`.';
  10404. }
  10405. }
  10406. return '';
  10407. };
  10408. /**
  10409. * @param {string} name
  10410. * @param {*} value
  10411. * @param {ReactDOMComponent} component
  10412. */
  10413. var warnValidStyle = function (name, value, component) {
  10414. var owner;
  10415. if (component) {
  10416. owner = component._currentElement._owner;
  10417. }
  10418. if (name.indexOf('-') > -1) {
  10419. warnHyphenatedStyleName(name, owner);
  10420. } else if (badVendoredStyleNamePattern.test(name)) {
  10421. warnBadVendoredStyleName(name, owner);
  10422. } else if (badStyleValueWithSemicolonPattern.test(value)) {
  10423. warnStyleValueWithSemicolon(name, value, owner);
  10424. }
  10425. if (typeof value === 'number' && isNaN(value)) {
  10426. warnStyleValueIsNaN(name, value, owner);
  10427. }
  10428. };
  10429. }
  10430. /**
  10431. * Operations for dealing with CSS properties.
  10432. */
  10433. var CSSPropertyOperations = {
  10434. /**
  10435. * Serializes a mapping of style properties for use as inline styles:
  10436. *
  10437. * > createMarkupForStyles({width: '200px', height: 0})
  10438. * "width:200px;height:0;"
  10439. *
  10440. * Undefined values are ignored so that declarative programming is easier.
  10441. * The result should be HTML-escaped before insertion into the DOM.
  10442. *
  10443. * @param {object} styles
  10444. * @param {ReactDOMComponent} component
  10445. * @return {?string}
  10446. */
  10447. createMarkupForStyles: function (styles, component) {
  10448. var serialized = '';
  10449. for (var styleName in styles) {
  10450. if (!styles.hasOwnProperty(styleName)) {
  10451. continue;
  10452. }
  10453. var styleValue = styles[styleName];
  10454. if (process.env.NODE_ENV !== 'production') {
  10455. warnValidStyle(styleName, styleValue, component);
  10456. }
  10457. if (styleValue != null) {
  10458. serialized += processStyleName(styleName) + ':';
  10459. serialized += dangerousStyleValue(styleName, styleValue, component) + ';';
  10460. }
  10461. }
  10462. return serialized || null;
  10463. },
  10464. /**
  10465. * Sets the value for multiple styles on a node. If a value is specified as
  10466. * '' (empty string), the corresponding style property will be unset.
  10467. *
  10468. * @param {DOMElement} node
  10469. * @param {object} styles
  10470. * @param {ReactDOMComponent} component
  10471. */
  10472. setValueForStyles: function (node, styles, component) {
  10473. if (process.env.NODE_ENV !== 'production') {
  10474. ReactInstrumentation.debugTool.onHostOperation(component._debugID, 'update styles', styles);
  10475. }
  10476. var style = node.style;
  10477. for (var styleName in styles) {
  10478. if (!styles.hasOwnProperty(styleName)) {
  10479. continue;
  10480. }
  10481. if (process.env.NODE_ENV !== 'production') {
  10482. warnValidStyle(styleName, styles[styleName], component);
  10483. }
  10484. var styleValue = dangerousStyleValue(styleName, styles[styleName], component);
  10485. if (styleName === 'float' || styleName === 'cssFloat') {
  10486. styleName = styleFloatAccessor;
  10487. }
  10488. if (styleValue) {
  10489. style[styleName] = styleValue;
  10490. } else {
  10491. var expansion = hasShorthandPropertyBug && CSSProperty.shorthandPropertyExpansions[styleName];
  10492. if (expansion) {
  10493. // Shorthand property that IE8 won't like unsetting, so unset each
  10494. // component to placate it
  10495. for (var individualStyleName in expansion) {
  10496. style[individualStyleName] = '';
  10497. }
  10498. } else {
  10499. style[styleName] = '';
  10500. }
  10501. }
  10502. }
  10503. }
  10504. };
  10505. module.exports = CSSPropertyOperations;
  10506. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  10507. /***/ },
  10508. /* 100 */
  10509. /***/ function(module, exports) {
  10510. /**
  10511. * Copyright 2013-present, Facebook, Inc.
  10512. * All rights reserved.
  10513. *
  10514. * This source code is licensed under the BSD-style license found in the
  10515. * LICENSE file in the root directory of this source tree. An additional grant
  10516. * of patent rights can be found in the PATENTS file in the same directory.
  10517. *
  10518. * @providesModule CSSProperty
  10519. */
  10520. 'use strict';
  10521. /**
  10522. * CSS properties which accept numbers but are not in units of "px".
  10523. */
  10524. var isUnitlessNumber = {
  10525. animationIterationCount: true,
  10526. borderImageOutset: true,
  10527. borderImageSlice: true,
  10528. borderImageWidth: true,
  10529. boxFlex: true,
  10530. boxFlexGroup: true,
  10531. boxOrdinalGroup: true,
  10532. columnCount: true,
  10533. flex: true,
  10534. flexGrow: true,
  10535. flexPositive: true,
  10536. flexShrink: true,
  10537. flexNegative: true,
  10538. flexOrder: true,
  10539. gridRow: true,
  10540. gridColumn: true,
  10541. fontWeight: true,
  10542. lineClamp: true,
  10543. lineHeight: true,
  10544. opacity: true,
  10545. order: true,
  10546. orphans: true,
  10547. tabSize: true,
  10548. widows: true,
  10549. zIndex: true,
  10550. zoom: true,
  10551. // SVG-related properties
  10552. fillOpacity: true,
  10553. floodOpacity: true,
  10554. stopOpacity: true,
  10555. strokeDasharray: true,
  10556. strokeDashoffset: true,
  10557. strokeMiterlimit: true,
  10558. strokeOpacity: true,
  10559. strokeWidth: true
  10560. };
  10561. /**
  10562. * @param {string} prefix vendor-specific prefix, eg: Webkit
  10563. * @param {string} key style name, eg: transitionDuration
  10564. * @return {string} style name prefixed with `prefix`, properly camelCased, eg:
  10565. * WebkitTransitionDuration
  10566. */
  10567. function prefixKey(prefix, key) {
  10568. return prefix + key.charAt(0).toUpperCase() + key.substring(1);
  10569. }
  10570. /**
  10571. * Support style names that may come passed in prefixed by adding permutations
  10572. * of vendor prefixes.
  10573. */
  10574. var prefixes = ['Webkit', 'ms', 'Moz', 'O'];
  10575. // Using Object.keys here, or else the vanilla for-in loop makes IE8 go into an
  10576. // infinite loop, because it iterates over the newly added props too.
  10577. Object.keys(isUnitlessNumber).forEach(function (prop) {
  10578. prefixes.forEach(function (prefix) {
  10579. isUnitlessNumber[prefixKey(prefix, prop)] = isUnitlessNumber[prop];
  10580. });
  10581. });
  10582. /**
  10583. * Most style properties can be unset by doing .style[prop] = '' but IE8
  10584. * doesn't like doing that with shorthand properties so for the properties that
  10585. * IE8 breaks on, which are listed here, we instead unset each of the
  10586. * individual properties. See http://bugs.jquery.com/ticket/12385.
  10587. * The 4-value 'clock' properties like margin, padding, border-width seem to
  10588. * behave without any problems. Curiously, list-style works too without any
  10589. * special prodding.
  10590. */
  10591. var shorthandPropertyExpansions = {
  10592. background: {
  10593. backgroundAttachment: true,
  10594. backgroundColor: true,
  10595. backgroundImage: true,
  10596. backgroundPositionX: true,
  10597. backgroundPositionY: true,
  10598. backgroundRepeat: true
  10599. },
  10600. backgroundPosition: {
  10601. backgroundPositionX: true,
  10602. backgroundPositionY: true
  10603. },
  10604. border: {
  10605. borderWidth: true,
  10606. borderStyle: true,
  10607. borderColor: true
  10608. },
  10609. borderBottom: {
  10610. borderBottomWidth: true,
  10611. borderBottomStyle: true,
  10612. borderBottomColor: true
  10613. },
  10614. borderLeft: {
  10615. borderLeftWidth: true,
  10616. borderLeftStyle: true,
  10617. borderLeftColor: true
  10618. },
  10619. borderRight: {
  10620. borderRightWidth: true,
  10621. borderRightStyle: true,
  10622. borderRightColor: true
  10623. },
  10624. borderTop: {
  10625. borderTopWidth: true,
  10626. borderTopStyle: true,
  10627. borderTopColor: true
  10628. },
  10629. font: {
  10630. fontStyle: true,
  10631. fontVariant: true,
  10632. fontWeight: true,
  10633. fontSize: true,
  10634. lineHeight: true,
  10635. fontFamily: true
  10636. },
  10637. outline: {
  10638. outlineWidth: true,
  10639. outlineStyle: true,
  10640. outlineColor: true
  10641. }
  10642. };
  10643. var CSSProperty = {
  10644. isUnitlessNumber: isUnitlessNumber,
  10645. shorthandPropertyExpansions: shorthandPropertyExpansions
  10646. };
  10647. module.exports = CSSProperty;
  10648. /***/ },
  10649. /* 101 */
  10650. /***/ function(module, exports, __webpack_require__) {
  10651. /**
  10652. * Copyright (c) 2013-present, Facebook, Inc.
  10653. * All rights reserved.
  10654. *
  10655. * This source code is licensed under the BSD-style license found in the
  10656. * LICENSE file in the root directory of this source tree. An additional grant
  10657. * of patent rights can be found in the PATENTS file in the same directory.
  10658. *
  10659. * @typechecks
  10660. */
  10661. 'use strict';
  10662. var camelize = __webpack_require__(102);
  10663. var msPattern = /^-ms-/;
  10664. /**
  10665. * Camelcases a hyphenated CSS property name, for example:
  10666. *
  10667. * > camelizeStyleName('background-color')
  10668. * < "backgroundColor"
  10669. * > camelizeStyleName('-moz-transition')
  10670. * < "MozTransition"
  10671. * > camelizeStyleName('-ms-transition')
  10672. * < "msTransition"
  10673. *
  10674. * As Andi Smith suggests
  10675. * (http://www.andismith.com/blog/2012/02/modernizr-prefixed/), an `-ms` prefix
  10676. * is converted to lowercase `ms`.
  10677. *
  10678. * @param {string} string
  10679. * @return {string}
  10680. */
  10681. function camelizeStyleName(string) {
  10682. return camelize(string.replace(msPattern, 'ms-'));
  10683. }
  10684. module.exports = camelizeStyleName;
  10685. /***/ },
  10686. /* 102 */
  10687. /***/ function(module, exports) {
  10688. "use strict";
  10689. /**
  10690. * Copyright (c) 2013-present, Facebook, Inc.
  10691. * All rights reserved.
  10692. *
  10693. * This source code is licensed under the BSD-style license found in the
  10694. * LICENSE file in the root directory of this source tree. An additional grant
  10695. * of patent rights can be found in the PATENTS file in the same directory.
  10696. *
  10697. * @typechecks
  10698. */
  10699. var _hyphenPattern = /-(.)/g;
  10700. /**
  10701. * Camelcases a hyphenated string, for example:
  10702. *
  10703. * > camelize('background-color')
  10704. * < "backgroundColor"
  10705. *
  10706. * @param {string} string
  10707. * @return {string}
  10708. */
  10709. function camelize(string) {
  10710. return string.replace(_hyphenPattern, function (_, character) {
  10711. return character.toUpperCase();
  10712. });
  10713. }
  10714. module.exports = camelize;
  10715. /***/ },
  10716. /* 103 */
  10717. /***/ function(module, exports, __webpack_require__) {
  10718. /* WEBPACK VAR INJECTION */(function(process) {/**
  10719. * Copyright 2013-present, Facebook, Inc.
  10720. * All rights reserved.
  10721. *
  10722. * This source code is licensed under the BSD-style license found in the
  10723. * LICENSE file in the root directory of this source tree. An additional grant
  10724. * of patent rights can be found in the PATENTS file in the same directory.
  10725. *
  10726. * @providesModule dangerousStyleValue
  10727. */
  10728. 'use strict';
  10729. var CSSProperty = __webpack_require__(100);
  10730. var warning = __webpack_require__(13);
  10731. var isUnitlessNumber = CSSProperty.isUnitlessNumber;
  10732. var styleWarnings = {};
  10733. /**
  10734. * Convert a value into the proper css writable value. The style name `name`
  10735. * should be logical (no hyphens), as specified
  10736. * in `CSSProperty.isUnitlessNumber`.
  10737. *
  10738. * @param {string} name CSS property name such as `topMargin`.
  10739. * @param {*} value CSS property value such as `10px`.
  10740. * @param {ReactDOMComponent} component
  10741. * @return {string} Normalized style value with dimensions applied.
  10742. */
  10743. function dangerousStyleValue(name, value, component) {
  10744. // Note that we've removed escapeTextForBrowser() calls here since the
  10745. // whole string will be escaped when the attribute is injected into
  10746. // the markup. If you provide unsafe user data here they can inject
  10747. // arbitrary CSS which may be problematic (I couldn't repro this):
  10748. // https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet
  10749. // http://www.thespanner.co.uk/2007/11/26/ultimate-xss-css-injection/
  10750. // This is not an XSS hole but instead a potential CSS injection issue
  10751. // which has lead to a greater discussion about how we're going to
  10752. // trust URLs moving forward. See #2115901
  10753. var isEmpty = value == null || typeof value === 'boolean' || value === '';
  10754. if (isEmpty) {
  10755. return '';
  10756. }
  10757. var isNonNumeric = isNaN(value);
  10758. if (isNonNumeric || value === 0 || isUnitlessNumber.hasOwnProperty(name) && isUnitlessNumber[name]) {
  10759. return '' + value; // cast to string
  10760. }
  10761. if (typeof value === 'string') {
  10762. if (process.env.NODE_ENV !== 'production') {
  10763. // Allow '0' to pass through without warning. 0 is already special and
  10764. // doesn't require units, so we don't need to warn about it.
  10765. if (component && value !== '0') {
  10766. var owner = component._currentElement._owner;
  10767. var ownerName = owner ? owner.getName() : null;
  10768. if (ownerName && !styleWarnings[ownerName]) {
  10769. styleWarnings[ownerName] = {};
  10770. }
  10771. var warned = false;
  10772. if (ownerName) {
  10773. var warnings = styleWarnings[ownerName];
  10774. warned = warnings[name];
  10775. if (!warned) {
  10776. warnings[name] = true;
  10777. }
  10778. }
  10779. if (!warned) {
  10780. 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;
  10781. }
  10782. }
  10783. }
  10784. value = value.trim();
  10785. }
  10786. return value + 'px';
  10787. }
  10788. module.exports = dangerousStyleValue;
  10789. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  10790. /***/ },
  10791. /* 104 */
  10792. /***/ function(module, exports, __webpack_require__) {
  10793. /**
  10794. * Copyright (c) 2013-present, Facebook, Inc.
  10795. * All rights reserved.
  10796. *
  10797. * This source code is licensed under the BSD-style license found in the
  10798. * LICENSE file in the root directory of this source tree. An additional grant
  10799. * of patent rights can be found in the PATENTS file in the same directory.
  10800. *
  10801. * @typechecks
  10802. */
  10803. 'use strict';
  10804. var hyphenate = __webpack_require__(105);
  10805. var msPattern = /^ms-/;
  10806. /**
  10807. * Hyphenates a camelcased CSS property name, for example:
  10808. *
  10809. * > hyphenateStyleName('backgroundColor')
  10810. * < "background-color"
  10811. * > hyphenateStyleName('MozTransition')
  10812. * < "-moz-transition"
  10813. * > hyphenateStyleName('msTransition')
  10814. * < "-ms-transition"
  10815. *
  10816. * As Modernizr suggests (http://modernizr.com/docs/#prefixed), an `ms` prefix
  10817. * is converted to `-ms-`.
  10818. *
  10819. * @param {string} string
  10820. * @return {string}
  10821. */
  10822. function hyphenateStyleName(string) {
  10823. return hyphenate(string).replace(msPattern, '-ms-');
  10824. }
  10825. module.exports = hyphenateStyleName;
  10826. /***/ },
  10827. /* 105 */
  10828. /***/ function(module, exports) {
  10829. 'use strict';
  10830. /**
  10831. * Copyright (c) 2013-present, Facebook, Inc.
  10832. * All rights reserved.
  10833. *
  10834. * This source code is licensed under the BSD-style license found in the
  10835. * LICENSE file in the root directory of this source tree. An additional grant
  10836. * of patent rights can be found in the PATENTS file in the same directory.
  10837. *
  10838. * @typechecks
  10839. */
  10840. var _uppercasePattern = /([A-Z])/g;
  10841. /**
  10842. * Hyphenates a camelcased string, for example:
  10843. *
  10844. * > hyphenate('backgroundColor')
  10845. * < "background-color"
  10846. *
  10847. * For CSS style names, use `hyphenateStyleName` instead which works properly
  10848. * with all vendor prefixes, including `ms`.
  10849. *
  10850. * @param {string} string
  10851. * @return {string}
  10852. */
  10853. function hyphenate(string) {
  10854. return string.replace(_uppercasePattern, '-$1').toLowerCase();
  10855. }
  10856. module.exports = hyphenate;
  10857. /***/ },
  10858. /* 106 */
  10859. /***/ function(module, exports) {
  10860. /**
  10861. * Copyright (c) 2013-present, Facebook, Inc.
  10862. * All rights reserved.
  10863. *
  10864. * This source code is licensed under the BSD-style license found in the
  10865. * LICENSE file in the root directory of this source tree. An additional grant
  10866. * of patent rights can be found in the PATENTS file in the same directory.
  10867. *
  10868. *
  10869. * @typechecks static-only
  10870. */
  10871. 'use strict';
  10872. /**
  10873. * Memoizes the return value of a function that accepts one string argument.
  10874. */
  10875. function memoizeStringOnly(callback) {
  10876. var cache = {};
  10877. return function (string) {
  10878. if (!cache.hasOwnProperty(string)) {
  10879. cache[string] = callback.call(this, string);
  10880. }
  10881. return cache[string];
  10882. };
  10883. }
  10884. module.exports = memoizeStringOnly;
  10885. /***/ },
  10886. /* 107 */
  10887. /***/ function(module, exports, __webpack_require__) {
  10888. /* WEBPACK VAR INJECTION */(function(process) {/**
  10889. * Copyright 2013-present, Facebook, Inc.
  10890. * All rights reserved.
  10891. *
  10892. * This source code is licensed under the BSD-style license found in the
  10893. * LICENSE file in the root directory of this source tree. An additional grant
  10894. * of patent rights can be found in the PATENTS file in the same directory.
  10895. *
  10896. * @providesModule DOMPropertyOperations
  10897. */
  10898. 'use strict';
  10899. var DOMProperty = __webpack_require__(39);
  10900. var ReactDOMComponentTree = __webpack_require__(38);
  10901. var ReactInstrumentation = __webpack_require__(64);
  10902. var quoteAttributeValueForBrowser = __webpack_require__(108);
  10903. var warning = __webpack_require__(13);
  10904. var VALID_ATTRIBUTE_NAME_REGEX = new RegExp('^[' + DOMProperty.ATTRIBUTE_NAME_START_CHAR + '][' + DOMProperty.ATTRIBUTE_NAME_CHAR + ']*$');
  10905. var illegalAttributeNameCache = {};
  10906. var validatedAttributeNameCache = {};
  10907. function isAttributeNameSafe(attributeName) {
  10908. if (validatedAttributeNameCache.hasOwnProperty(attributeName)) {
  10909. return true;
  10910. }
  10911. if (illegalAttributeNameCache.hasOwnProperty(attributeName)) {
  10912. return false;
  10913. }
  10914. if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) {
  10915. validatedAttributeNameCache[attributeName] = true;
  10916. return true;
  10917. }
  10918. illegalAttributeNameCache[attributeName] = true;
  10919. process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid attribute name: `%s`', attributeName) : void 0;
  10920. return false;
  10921. }
  10922. function shouldIgnoreValue(propertyInfo, value) {
  10923. return value == null || propertyInfo.hasBooleanValue && !value || propertyInfo.hasNumericValue && isNaN(value) || propertyInfo.hasPositiveNumericValue && value < 1 || propertyInfo.hasOverloadedBooleanValue && value === false;
  10924. }
  10925. /**
  10926. * Operations for dealing with DOM properties.
  10927. */
  10928. var DOMPropertyOperations = {
  10929. /**
  10930. * Creates markup for the ID property.
  10931. *
  10932. * @param {string} id Unescaped ID.
  10933. * @return {string} Markup string.
  10934. */
  10935. createMarkupForID: function (id) {
  10936. return DOMProperty.ID_ATTRIBUTE_NAME + '=' + quoteAttributeValueForBrowser(id);
  10937. },
  10938. setAttributeForID: function (node, id) {
  10939. node.setAttribute(DOMProperty.ID_ATTRIBUTE_NAME, id);
  10940. },
  10941. createMarkupForRoot: function () {
  10942. return DOMProperty.ROOT_ATTRIBUTE_NAME + '=""';
  10943. },
  10944. setAttributeForRoot: function (node) {
  10945. node.setAttribute(DOMProperty.ROOT_ATTRIBUTE_NAME, '');
  10946. },
  10947. /**
  10948. * Creates markup for a property.
  10949. *
  10950. * @param {string} name
  10951. * @param {*} value
  10952. * @return {?string} Markup string, or null if the property was invalid.
  10953. */
  10954. createMarkupForProperty: function (name, value) {
  10955. var propertyInfo = DOMProperty.properties.hasOwnProperty(name) ? DOMProperty.properties[name] : null;
  10956. if (propertyInfo) {
  10957. if (shouldIgnoreValue(propertyInfo, value)) {
  10958. return '';
  10959. }
  10960. var attributeName = propertyInfo.attributeName;
  10961. if (propertyInfo.hasBooleanValue || propertyInfo.hasOverloadedBooleanValue && value === true) {
  10962. return attributeName + '=""';
  10963. }
  10964. return attributeName + '=' + quoteAttributeValueForBrowser(value);
  10965. } else if (DOMProperty.isCustomAttribute(name)) {
  10966. if (value == null) {
  10967. return '';
  10968. }
  10969. return name + '=' + quoteAttributeValueForBrowser(value);
  10970. }
  10971. return null;
  10972. },
  10973. /**
  10974. * Creates markup for a custom property.
  10975. *
  10976. * @param {string} name
  10977. * @param {*} value
  10978. * @return {string} Markup string, or empty string if the property was invalid.
  10979. */
  10980. createMarkupForCustomAttribute: function (name, value) {
  10981. if (!isAttributeNameSafe(name) || value == null) {
  10982. return '';
  10983. }
  10984. return name + '=' + quoteAttributeValueForBrowser(value);
  10985. },
  10986. /**
  10987. * Sets the value for a property on a node.
  10988. *
  10989. * @param {DOMElement} node
  10990. * @param {string} name
  10991. * @param {*} value
  10992. */
  10993. setValueForProperty: function (node, name, value) {
  10994. var propertyInfo = DOMProperty.properties.hasOwnProperty(name) ? DOMProperty.properties[name] : null;
  10995. if (propertyInfo) {
  10996. var mutationMethod = propertyInfo.mutationMethod;
  10997. if (mutationMethod) {
  10998. mutationMethod(node, value);
  10999. } else if (shouldIgnoreValue(propertyInfo, value)) {
  11000. this.deleteValueForProperty(node, name);
  11001. return;
  11002. } else if (propertyInfo.mustUseProperty) {
  11003. // Contrary to `setAttribute`, object properties are properly
  11004. // `toString`ed by IE8/9.
  11005. node[propertyInfo.propertyName] = value;
  11006. } else {
  11007. var attributeName = propertyInfo.attributeName;
  11008. var namespace = propertyInfo.attributeNamespace;
  11009. // `setAttribute` with objects becomes only `[object]` in IE8/9,
  11010. // ('' + value) makes it output the correct toString()-value.
  11011. if (namespace) {
  11012. node.setAttributeNS(namespace, attributeName, '' + value);
  11013. } else if (propertyInfo.hasBooleanValue || propertyInfo.hasOverloadedBooleanValue && value === true) {
  11014. node.setAttribute(attributeName, '');
  11015. } else {
  11016. node.setAttribute(attributeName, '' + value);
  11017. }
  11018. }
  11019. } else if (DOMProperty.isCustomAttribute(name)) {
  11020. DOMPropertyOperations.setValueForAttribute(node, name, value);
  11021. return;
  11022. }
  11023. if (process.env.NODE_ENV !== 'production') {
  11024. var payload = {};
  11025. payload[name] = value;
  11026. ReactInstrumentation.debugTool.onHostOperation(ReactDOMComponentTree.getInstanceFromNode(node)._debugID, 'update attribute', payload);
  11027. }
  11028. },
  11029. setValueForAttribute: function (node, name, value) {
  11030. if (!isAttributeNameSafe(name)) {
  11031. return;
  11032. }
  11033. if (value == null) {
  11034. node.removeAttribute(name);
  11035. } else {
  11036. node.setAttribute(name, '' + value);
  11037. }
  11038. if (process.env.NODE_ENV !== 'production') {
  11039. var payload = {};
  11040. payload[name] = value;
  11041. ReactInstrumentation.debugTool.onHostOperation(ReactDOMComponentTree.getInstanceFromNode(node)._debugID, 'update attribute', payload);
  11042. }
  11043. },
  11044. /**
  11045. * Deletes an attributes from a node.
  11046. *
  11047. * @param {DOMElement} node
  11048. * @param {string} name
  11049. */
  11050. deleteValueForAttribute: function (node, name) {
  11051. node.removeAttribute(name);
  11052. if (process.env.NODE_ENV !== 'production') {
  11053. ReactInstrumentation.debugTool.onHostOperation(ReactDOMComponentTree.getInstanceFromNode(node)._debugID, 'remove attribute', name);
  11054. }
  11055. },
  11056. /**
  11057. * Deletes the value for a property on a node.
  11058. *
  11059. * @param {DOMElement} node
  11060. * @param {string} name
  11061. */
  11062. deleteValueForProperty: function (node, name) {
  11063. var propertyInfo = DOMProperty.properties.hasOwnProperty(name) ? DOMProperty.properties[name] : null;
  11064. if (propertyInfo) {
  11065. var mutationMethod = propertyInfo.mutationMethod;
  11066. if (mutationMethod) {
  11067. mutationMethod(node, undefined);
  11068. } else if (propertyInfo.mustUseProperty) {
  11069. var propName = propertyInfo.propertyName;
  11070. if (propertyInfo.hasBooleanValue) {
  11071. node[propName] = false;
  11072. } else {
  11073. node[propName] = '';
  11074. }
  11075. } else {
  11076. node.removeAttribute(propertyInfo.attributeName);
  11077. }
  11078. } else if (DOMProperty.isCustomAttribute(name)) {
  11079. node.removeAttribute(name);
  11080. }
  11081. if (process.env.NODE_ENV !== 'production') {
  11082. ReactInstrumentation.debugTool.onHostOperation(ReactDOMComponentTree.getInstanceFromNode(node)._debugID, 'remove attribute', name);
  11083. }
  11084. }
  11085. };
  11086. module.exports = DOMPropertyOperations;
  11087. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  11088. /***/ },
  11089. /* 108 */
  11090. /***/ function(module, exports, __webpack_require__) {
  11091. /**
  11092. * Copyright 2013-present, Facebook, Inc.
  11093. * All rights reserved.
  11094. *
  11095. * This source code is licensed under the BSD-style license found in the
  11096. * LICENSE file in the root directory of this source tree. An additional grant
  11097. * of patent rights can be found in the PATENTS file in the same directory.
  11098. *
  11099. * @providesModule quoteAttributeValueForBrowser
  11100. */
  11101. 'use strict';
  11102. var escapeTextContentForBrowser = __webpack_require__(89);
  11103. /**
  11104. * Escapes attribute value to prevent scripting attacks.
  11105. *
  11106. * @param {*} value Value to escape.
  11107. * @return {string} An escaped string.
  11108. */
  11109. function quoteAttributeValueForBrowser(value) {
  11110. return '"' + escapeTextContentForBrowser(value) + '"';
  11111. }
  11112. module.exports = quoteAttributeValueForBrowser;
  11113. /***/ },
  11114. /* 109 */
  11115. /***/ function(module, exports, __webpack_require__) {
  11116. /**
  11117. * Copyright 2013-present, Facebook, Inc.
  11118. * All rights reserved.
  11119. *
  11120. * This source code is licensed under the BSD-style license found in the
  11121. * LICENSE file in the root directory of this source tree. An additional grant
  11122. * of patent rights can be found in the PATENTS file in the same directory.
  11123. *
  11124. * @providesModule ReactBrowserEventEmitter
  11125. */
  11126. 'use strict';
  11127. var _assign = __webpack_require__(6);
  11128. var EventConstants = __webpack_require__(43);
  11129. var EventPluginRegistry = __webpack_require__(46);
  11130. var ReactEventEmitterMixin = __webpack_require__(110);
  11131. var ViewportMetrics = __webpack_require__(79);
  11132. var getVendorPrefixedEventName = __webpack_require__(111);
  11133. var isEventSupported = __webpack_require__(73);
  11134. /**
  11135. * Summary of `ReactBrowserEventEmitter` event handling:
  11136. *
  11137. * - Top-level delegation is used to trap most native browser events. This
  11138. * may only occur in the main thread and is the responsibility of
  11139. * ReactEventListener, which is injected and can therefore support pluggable
  11140. * event sources. This is the only work that occurs in the main thread.
  11141. *
  11142. * - We normalize and de-duplicate events to account for browser quirks. This
  11143. * may be done in the worker thread.
  11144. *
  11145. * - Forward these native events (with the associated top-level type used to
  11146. * trap it) to `EventPluginHub`, which in turn will ask plugins if they want
  11147. * to extract any synthetic events.
  11148. *
  11149. * - The `EventPluginHub` will then process each event by annotating them with
  11150. * "dispatches", a sequence of listeners and IDs that care about that event.
  11151. *
  11152. * - The `EventPluginHub` then dispatches the events.
  11153. *
  11154. * Overview of React and the event system:
  11155. *
  11156. * +------------+ .
  11157. * | DOM | .
  11158. * +------------+ .
  11159. * | .
  11160. * v .
  11161. * +------------+ .
  11162. * | ReactEvent | .
  11163. * | Listener | .
  11164. * +------------+ . +-----------+
  11165. * | . +--------+|SimpleEvent|
  11166. * | . | |Plugin |
  11167. * +-----|------+ . v +-----------+
  11168. * | | | . +--------------+ +------------+
  11169. * | +-----------.--->|EventPluginHub| | Event |
  11170. * | | . | | +-----------+ | Propagators|
  11171. * | ReactEvent | . | | |TapEvent | |------------|
  11172. * | Emitter | . | |<---+|Plugin | |other plugin|
  11173. * | | . | | +-----------+ | utilities |
  11174. * | +-----------.--->| | +------------+
  11175. * | | | . +--------------+
  11176. * +-----|------+ . ^ +-----------+
  11177. * | . | |Enter/Leave|
  11178. * + . +-------+|Plugin |
  11179. * +-------------+ . +-----------+
  11180. * | application | .
  11181. * |-------------| .
  11182. * | | .
  11183. * | | .
  11184. * +-------------+ .
  11185. * .
  11186. * React Core . General Purpose Event Plugin System
  11187. */
  11188. var hasEventPageXY;
  11189. var alreadyListeningTo = {};
  11190. var isMonitoringScrollValue = false;
  11191. var reactTopListenersCounter = 0;
  11192. // For events like 'submit' which don't consistently bubble (which we trap at a
  11193. // lower node than `document`), binding at `document` would cause duplicate
  11194. // events so we don't include them here
  11195. var topEventMapping = {
  11196. topAbort: 'abort',
  11197. topAnimationEnd: getVendorPrefixedEventName('animationend') || 'animationend',
  11198. topAnimationIteration: getVendorPrefixedEventName('animationiteration') || 'animationiteration',
  11199. topAnimationStart: getVendorPrefixedEventName('animationstart') || 'animationstart',
  11200. topBlur: 'blur',
  11201. topCanPlay: 'canplay',
  11202. topCanPlayThrough: 'canplaythrough',
  11203. topChange: 'change',
  11204. topClick: 'click',
  11205. topCompositionEnd: 'compositionend',
  11206. topCompositionStart: 'compositionstart',
  11207. topCompositionUpdate: 'compositionupdate',
  11208. topContextMenu: 'contextmenu',
  11209. topCopy: 'copy',
  11210. topCut: 'cut',
  11211. topDoubleClick: 'dblclick',
  11212. topDrag: 'drag',
  11213. topDragEnd: 'dragend',
  11214. topDragEnter: 'dragenter',
  11215. topDragExit: 'dragexit',
  11216. topDragLeave: 'dragleave',
  11217. topDragOver: 'dragover',
  11218. topDragStart: 'dragstart',
  11219. topDrop: 'drop',
  11220. topDurationChange: 'durationchange',
  11221. topEmptied: 'emptied',
  11222. topEncrypted: 'encrypted',
  11223. topEnded: 'ended',
  11224. topError: 'error',
  11225. topFocus: 'focus',
  11226. topInput: 'input',
  11227. topKeyDown: 'keydown',
  11228. topKeyPress: 'keypress',
  11229. topKeyUp: 'keyup',
  11230. topLoadedData: 'loadeddata',
  11231. topLoadedMetadata: 'loadedmetadata',
  11232. topLoadStart: 'loadstart',
  11233. topMouseDown: 'mousedown',
  11234. topMouseMove: 'mousemove',
  11235. topMouseOut: 'mouseout',
  11236. topMouseOver: 'mouseover',
  11237. topMouseUp: 'mouseup',
  11238. topPaste: 'paste',
  11239. topPause: 'pause',
  11240. topPlay: 'play',
  11241. topPlaying: 'playing',
  11242. topProgress: 'progress',
  11243. topRateChange: 'ratechange',
  11244. topScroll: 'scroll',
  11245. topSeeked: 'seeked',
  11246. topSeeking: 'seeking',
  11247. topSelectionChange: 'selectionchange',
  11248. topStalled: 'stalled',
  11249. topSuspend: 'suspend',
  11250. topTextInput: 'textInput',
  11251. topTimeUpdate: 'timeupdate',
  11252. topTouchCancel: 'touchcancel',
  11253. topTouchEnd: 'touchend',
  11254. topTouchMove: 'touchmove',
  11255. topTouchStart: 'touchstart',
  11256. topTransitionEnd: getVendorPrefixedEventName('transitionend') || 'transitionend',
  11257. topVolumeChange: 'volumechange',
  11258. topWaiting: 'waiting',
  11259. topWheel: 'wheel'
  11260. };
  11261. /**
  11262. * To ensure no conflicts with other potential React instances on the page
  11263. */
  11264. var topListenersIDKey = '_reactListenersID' + String(Math.random()).slice(2);
  11265. function getListeningForDocument(mountAt) {
  11266. // In IE8, `mountAt` is a host object and doesn't have `hasOwnProperty`
  11267. // directly.
  11268. if (!Object.prototype.hasOwnProperty.call(mountAt, topListenersIDKey)) {
  11269. mountAt[topListenersIDKey] = reactTopListenersCounter++;
  11270. alreadyListeningTo[mountAt[topListenersIDKey]] = {};
  11271. }
  11272. return alreadyListeningTo[mountAt[topListenersIDKey]];
  11273. }
  11274. /**
  11275. * `ReactBrowserEventEmitter` is used to attach top-level event listeners. For
  11276. * example:
  11277. *
  11278. * EventPluginHub.putListener('myID', 'onClick', myFunction);
  11279. *
  11280. * This would allocate a "registration" of `('onClick', myFunction)` on 'myID'.
  11281. *
  11282. * @internal
  11283. */
  11284. var ReactBrowserEventEmitter = _assign({}, ReactEventEmitterMixin, {
  11285. /**
  11286. * Injectable event backend
  11287. */
  11288. ReactEventListener: null,
  11289. injection: {
  11290. /**
  11291. * @param {object} ReactEventListener
  11292. */
  11293. injectReactEventListener: function (ReactEventListener) {
  11294. ReactEventListener.setHandleTopLevel(ReactBrowserEventEmitter.handleTopLevel);
  11295. ReactBrowserEventEmitter.ReactEventListener = ReactEventListener;
  11296. }
  11297. },
  11298. /**
  11299. * Sets whether or not any created callbacks should be enabled.
  11300. *
  11301. * @param {boolean} enabled True if callbacks should be enabled.
  11302. */
  11303. setEnabled: function (enabled) {
  11304. if (ReactBrowserEventEmitter.ReactEventListener) {
  11305. ReactBrowserEventEmitter.ReactEventListener.setEnabled(enabled);
  11306. }
  11307. },
  11308. /**
  11309. * @return {boolean} True if callbacks are enabled.
  11310. */
  11311. isEnabled: function () {
  11312. return !!(ReactBrowserEventEmitter.ReactEventListener && ReactBrowserEventEmitter.ReactEventListener.isEnabled());
  11313. },
  11314. /**
  11315. * We listen for bubbled touch events on the document object.
  11316. *
  11317. * Firefox v8.01 (and possibly others) exhibited strange behavior when
  11318. * mounting `onmousemove` events at some node that was not the document
  11319. * element. The symptoms were that if your mouse is not moving over something
  11320. * contained within that mount point (for example on the background) the
  11321. * top-level listeners for `onmousemove` won't be called. However, if you
  11322. * register the `mousemove` on the document object, then it will of course
  11323. * catch all `mousemove`s. This along with iOS quirks, justifies restricting
  11324. * top-level listeners to the document object only, at least for these
  11325. * movement types of events and possibly all events.
  11326. *
  11327. * @see http://www.quirksmode.org/blog/archives/2010/09/click_event_del.html
  11328. *
  11329. * Also, `keyup`/`keypress`/`keydown` do not bubble to the window on IE, but
  11330. * they bubble to document.
  11331. *
  11332. * @param {string} registrationName Name of listener (e.g. `onClick`).
  11333. * @param {object} contentDocumentHandle Document which owns the container
  11334. */
  11335. listenTo: function (registrationName, contentDocumentHandle) {
  11336. var mountAt = contentDocumentHandle;
  11337. var isListening = getListeningForDocument(mountAt);
  11338. var dependencies = EventPluginRegistry.registrationNameDependencies[registrationName];
  11339. var topLevelTypes = EventConstants.topLevelTypes;
  11340. for (var i = 0; i < dependencies.length; i++) {
  11341. var dependency = dependencies[i];
  11342. if (!(isListening.hasOwnProperty(dependency) && isListening[dependency])) {
  11343. if (dependency === topLevelTypes.topWheel) {
  11344. if (isEventSupported('wheel')) {
  11345. ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelTypes.topWheel, 'wheel', mountAt);
  11346. } else if (isEventSupported('mousewheel')) {
  11347. ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelTypes.topWheel, 'mousewheel', mountAt);
  11348. } else {
  11349. // Firefox needs to capture a different mouse scroll event.
  11350. // @see http://www.quirksmode.org/dom/events/tests/scroll.html
  11351. ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelTypes.topWheel, 'DOMMouseScroll', mountAt);
  11352. }
  11353. } else if (dependency === topLevelTypes.topScroll) {
  11354. if (isEventSupported('scroll', true)) {
  11355. ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent(topLevelTypes.topScroll, 'scroll', mountAt);
  11356. } else {
  11357. ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelTypes.topScroll, 'scroll', ReactBrowserEventEmitter.ReactEventListener.WINDOW_HANDLE);
  11358. }
  11359. } else if (dependency === topLevelTypes.topFocus || dependency === topLevelTypes.topBlur) {
  11360. if (isEventSupported('focus', true)) {
  11361. ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent(topLevelTypes.topFocus, 'focus', mountAt);
  11362. ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent(topLevelTypes.topBlur, 'blur', mountAt);
  11363. } else if (isEventSupported('focusin')) {
  11364. // IE has `focusin` and `focusout` events which bubble.
  11365. // @see http://www.quirksmode.org/blog/archives/2008/04/delegating_the.html
  11366. ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelTypes.topFocus, 'focusin', mountAt);
  11367. ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelTypes.topBlur, 'focusout', mountAt);
  11368. }
  11369. // to make sure blur and focus event listeners are only attached once
  11370. isListening[topLevelTypes.topBlur] = true;
  11371. isListening[topLevelTypes.topFocus] = true;
  11372. } else if (topEventMapping.hasOwnProperty(dependency)) {
  11373. ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(dependency, topEventMapping[dependency], mountAt);
  11374. }
  11375. isListening[dependency] = true;
  11376. }
  11377. }
  11378. },
  11379. trapBubbledEvent: function (topLevelType, handlerBaseName, handle) {
  11380. return ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelType, handlerBaseName, handle);
  11381. },
  11382. trapCapturedEvent: function (topLevelType, handlerBaseName, handle) {
  11383. return ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent(topLevelType, handlerBaseName, handle);
  11384. },
  11385. /**
  11386. * Listens to window scroll and resize events. We cache scroll values so that
  11387. * application code can access them without triggering reflows.
  11388. *
  11389. * ViewportMetrics is only used by SyntheticMouse/TouchEvent and only when
  11390. * pageX/pageY isn't supported (legacy browsers).
  11391. *
  11392. * NOTE: Scroll events do not bubble.
  11393. *
  11394. * @see http://www.quirksmode.org/dom/events/scroll.html
  11395. */
  11396. ensureScrollValueMonitoring: function () {
  11397. if (hasEventPageXY === undefined) {
  11398. hasEventPageXY = document.createEvent && 'pageX' in document.createEvent('MouseEvent');
  11399. }
  11400. if (!hasEventPageXY && !isMonitoringScrollValue) {
  11401. var refresh = ViewportMetrics.refreshScrollValues;
  11402. ReactBrowserEventEmitter.ReactEventListener.monitorScrollValue(refresh);
  11403. isMonitoringScrollValue = true;
  11404. }
  11405. }
  11406. });
  11407. module.exports = ReactBrowserEventEmitter;
  11408. /***/ },
  11409. /* 110 */
  11410. /***/ function(module, exports, __webpack_require__) {
  11411. /**
  11412. * Copyright 2013-present, Facebook, Inc.
  11413. * All rights reserved.
  11414. *
  11415. * This source code is licensed under the BSD-style license found in the
  11416. * LICENSE file in the root directory of this source tree. An additional grant
  11417. * of patent rights can be found in the PATENTS file in the same directory.
  11418. *
  11419. * @providesModule ReactEventEmitterMixin
  11420. */
  11421. 'use strict';
  11422. var EventPluginHub = __webpack_require__(45);
  11423. function runEventQueueInBatch(events) {
  11424. EventPluginHub.enqueueEvents(events);
  11425. EventPluginHub.processEventQueue(false);
  11426. }
  11427. var ReactEventEmitterMixin = {
  11428. /**
  11429. * Streams a fired top-level event to `EventPluginHub` where plugins have the
  11430. * opportunity to create `ReactEvent`s to be dispatched.
  11431. */
  11432. handleTopLevel: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
  11433. var events = EventPluginHub.extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget);
  11434. runEventQueueInBatch(events);
  11435. }
  11436. };
  11437. module.exports = ReactEventEmitterMixin;
  11438. /***/ },
  11439. /* 111 */
  11440. /***/ function(module, exports, __webpack_require__) {
  11441. /**
  11442. * Copyright 2013-present, Facebook, Inc.
  11443. * All rights reserved.
  11444. *
  11445. * This source code is licensed under the BSD-style license found in the
  11446. * LICENSE file in the root directory of this source tree. An additional grant
  11447. * of patent rights can be found in the PATENTS file in the same directory.
  11448. *
  11449. * @providesModule getVendorPrefixedEventName
  11450. */
  11451. 'use strict';
  11452. var ExecutionEnvironment = __webpack_require__(51);
  11453. /**
  11454. * Generate a mapping of standard vendor prefixes using the defined style property and event name.
  11455. *
  11456. * @param {string} styleProp
  11457. * @param {string} eventName
  11458. * @returns {object}
  11459. */
  11460. function makePrefixMap(styleProp, eventName) {
  11461. var prefixes = {};
  11462. prefixes[styleProp.toLowerCase()] = eventName.toLowerCase();
  11463. prefixes['Webkit' + styleProp] = 'webkit' + eventName;
  11464. prefixes['Moz' + styleProp] = 'moz' + eventName;
  11465. prefixes['ms' + styleProp] = 'MS' + eventName;
  11466. prefixes['O' + styleProp] = 'o' + eventName.toLowerCase();
  11467. return prefixes;
  11468. }
  11469. /**
  11470. * A list of event names to a configurable list of vendor prefixes.
  11471. */
  11472. var vendorPrefixes = {
  11473. animationend: makePrefixMap('Animation', 'AnimationEnd'),
  11474. animationiteration: makePrefixMap('Animation', 'AnimationIteration'),
  11475. animationstart: makePrefixMap('Animation', 'AnimationStart'),
  11476. transitionend: makePrefixMap('Transition', 'TransitionEnd')
  11477. };
  11478. /**
  11479. * Event names that have already been detected and prefixed (if applicable).
  11480. */
  11481. var prefixedEventNames = {};
  11482. /**
  11483. * Element to check for prefixes on.
  11484. */
  11485. var style = {};
  11486. /**
  11487. * Bootstrap if a DOM exists.
  11488. */
  11489. if (ExecutionEnvironment.canUseDOM) {
  11490. style = document.createElement('div').style;
  11491. // On some platforms, in particular some releases of Android 4.x,
  11492. // the un-prefixed "animation" and "transition" properties are defined on the
  11493. // style object but the events that fire will still be prefixed, so we need
  11494. // to check if the un-prefixed events are usable, and if not remove them from the map.
  11495. if (!('AnimationEvent' in window)) {
  11496. delete vendorPrefixes.animationend.animation;
  11497. delete vendorPrefixes.animationiteration.animation;
  11498. delete vendorPrefixes.animationstart.animation;
  11499. }
  11500. // Same as above
  11501. if (!('TransitionEvent' in window)) {
  11502. delete vendorPrefixes.transitionend.transition;
  11503. }
  11504. }
  11505. /**
  11506. * Attempts to determine the correct vendor prefixed event name.
  11507. *
  11508. * @param {string} eventName
  11509. * @returns {string}
  11510. */
  11511. function getVendorPrefixedEventName(eventName) {
  11512. if (prefixedEventNames[eventName]) {
  11513. return prefixedEventNames[eventName];
  11514. } else if (!vendorPrefixes[eventName]) {
  11515. return eventName;
  11516. }
  11517. var prefixMap = vendorPrefixes[eventName];
  11518. for (var styleProp in prefixMap) {
  11519. if (prefixMap.hasOwnProperty(styleProp) && styleProp in style) {
  11520. return prefixedEventNames[eventName] = prefixMap[styleProp];
  11521. }
  11522. }
  11523. return '';
  11524. }
  11525. module.exports = getVendorPrefixedEventName;
  11526. /***/ },
  11527. /* 112 */
  11528. /***/ function(module, exports, __webpack_require__) {
  11529. /**
  11530. * Copyright 2013-present, Facebook, Inc.
  11531. * All rights reserved.
  11532. *
  11533. * This source code is licensed under the BSD-style license found in the
  11534. * LICENSE file in the root directory of this source tree. An additional grant
  11535. * of patent rights can be found in the PATENTS file in the same directory.
  11536. *
  11537. * @providesModule ReactDOMButton
  11538. */
  11539. 'use strict';
  11540. var DisabledInputUtils = __webpack_require__(113);
  11541. /**
  11542. * Implements a <button> host component that does not receive mouse events
  11543. * when `disabled` is set.
  11544. */
  11545. var ReactDOMButton = {
  11546. getHostProps: DisabledInputUtils.getHostProps
  11547. };
  11548. module.exports = ReactDOMButton;
  11549. /***/ },
  11550. /* 113 */
  11551. /***/ function(module, exports) {
  11552. /**
  11553. * Copyright 2013-present, Facebook, Inc.
  11554. * All rights reserved.
  11555. *
  11556. * This source code is licensed under the BSD-style license found in the
  11557. * LICENSE file in the root directory of this source tree. An additional grant
  11558. * of patent rights can be found in the PATENTS file in the same directory.
  11559. *
  11560. * @providesModule DisabledInputUtils
  11561. */
  11562. 'use strict';
  11563. var disableableMouseListenerNames = {
  11564. onClick: true,
  11565. onDoubleClick: true,
  11566. onMouseDown: true,
  11567. onMouseMove: true,
  11568. onMouseUp: true,
  11569. onClickCapture: true,
  11570. onDoubleClickCapture: true,
  11571. onMouseDownCapture: true,
  11572. onMouseMoveCapture: true,
  11573. onMouseUpCapture: true
  11574. };
  11575. /**
  11576. * Implements a host component that does not receive mouse events
  11577. * when `disabled` is set.
  11578. */
  11579. var DisabledInputUtils = {
  11580. getHostProps: function (inst, props) {
  11581. if (!props.disabled) {
  11582. return props;
  11583. }
  11584. // Copy the props, except the mouse listeners
  11585. var hostProps = {};
  11586. for (var key in props) {
  11587. if (!disableableMouseListenerNames[key] && props.hasOwnProperty(key)) {
  11588. hostProps[key] = props[key];
  11589. }
  11590. }
  11591. return hostProps;
  11592. }
  11593. };
  11594. module.exports = DisabledInputUtils;
  11595. /***/ },
  11596. /* 114 */
  11597. /***/ function(module, exports, __webpack_require__) {
  11598. /* WEBPACK VAR INJECTION */(function(process) {/**
  11599. * Copyright 2013-present, Facebook, Inc.
  11600. * All rights reserved.
  11601. *
  11602. * This source code is licensed under the BSD-style license found in the
  11603. * LICENSE file in the root directory of this source tree. An additional grant
  11604. * of patent rights can be found in the PATENTS file in the same directory.
  11605. *
  11606. * @providesModule ReactDOMInput
  11607. */
  11608. 'use strict';
  11609. var _prodInvariant = __webpack_require__(9),
  11610. _assign = __webpack_require__(6);
  11611. var DisabledInputUtils = __webpack_require__(113);
  11612. var DOMPropertyOperations = __webpack_require__(107);
  11613. var LinkedValueUtils = __webpack_require__(115);
  11614. var ReactDOMComponentTree = __webpack_require__(38);
  11615. var ReactUpdates = __webpack_require__(58);
  11616. var invariant = __webpack_require__(10);
  11617. var warning = __webpack_require__(13);
  11618. var didWarnValueLink = false;
  11619. var didWarnCheckedLink = false;
  11620. var didWarnValueDefaultValue = false;
  11621. var didWarnCheckedDefaultChecked = false;
  11622. var didWarnControlledToUncontrolled = false;
  11623. var didWarnUncontrolledToControlled = false;
  11624. function forceUpdateIfMounted() {
  11625. if (this._rootNodeID) {
  11626. // DOM component is still mounted; update
  11627. ReactDOMInput.updateWrapper(this);
  11628. }
  11629. }
  11630. function isControlled(props) {
  11631. var usesChecked = props.type === 'checkbox' || props.type === 'radio';
  11632. return usesChecked ? props.checked !== undefined : props.value !== undefined;
  11633. }
  11634. /**
  11635. * Implements an <input> host component that allows setting these optional
  11636. * props: `checked`, `value`, `defaultChecked`, and `defaultValue`.
  11637. *
  11638. * If `checked` or `value` are not supplied (or null/undefined), user actions
  11639. * that affect the checked state or value will trigger updates to the element.
  11640. *
  11641. * If they are supplied (and not null/undefined), the rendered element will not
  11642. * trigger updates to the element. Instead, the props must change in order for
  11643. * the rendered element to be updated.
  11644. *
  11645. * The rendered element will be initialized as unchecked (or `defaultChecked`)
  11646. * with an empty value (or `defaultValue`).
  11647. *
  11648. * @see http://www.w3.org/TR/2012/WD-html5-20121025/the-input-element.html
  11649. */
  11650. var ReactDOMInput = {
  11651. getHostProps: function (inst, props) {
  11652. var value = LinkedValueUtils.getValue(props);
  11653. var checked = LinkedValueUtils.getChecked(props);
  11654. var hostProps = _assign({
  11655. // Make sure we set .type before any other properties (setting .value
  11656. // before .type means .value is lost in IE11 and below)
  11657. type: undefined,
  11658. // Make sure we set .step before .value (setting .value before .step
  11659. // means .value is rounded on mount, based upon step precision)
  11660. step: undefined,
  11661. // Make sure we set .min & .max before .value (to ensure proper order
  11662. // in corner cases such as min or max deriving from value, e.g. Issue #7170)
  11663. min: undefined,
  11664. max: undefined
  11665. }, DisabledInputUtils.getHostProps(inst, props), {
  11666. defaultChecked: undefined,
  11667. defaultValue: undefined,
  11668. value: value != null ? value : inst._wrapperState.initialValue,
  11669. checked: checked != null ? checked : inst._wrapperState.initialChecked,
  11670. onChange: inst._wrapperState.onChange
  11671. });
  11672. return hostProps;
  11673. },
  11674. mountWrapper: function (inst, props) {
  11675. if (process.env.NODE_ENV !== 'production') {
  11676. LinkedValueUtils.checkPropTypes('input', props, inst._currentElement._owner);
  11677. var owner = inst._currentElement._owner;
  11678. if (props.valueLink !== undefined && !didWarnValueLink) {
  11679. process.env.NODE_ENV !== 'production' ? warning(false, '`valueLink` prop on `input` is deprecated; set `value` and `onChange` instead.') : void 0;
  11680. didWarnValueLink = true;
  11681. }
  11682. if (props.checkedLink !== undefined && !didWarnCheckedLink) {
  11683. process.env.NODE_ENV !== 'production' ? warning(false, '`checkedLink` prop on `input` is deprecated; set `value` and `onChange` instead.') : void 0;
  11684. didWarnCheckedLink = true;
  11685. }
  11686. if (props.checked !== undefined && props.defaultChecked !== undefined && !didWarnCheckedDefaultChecked) {
  11687. 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;
  11688. didWarnCheckedDefaultChecked = true;
  11689. }
  11690. if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue) {
  11691. 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;
  11692. didWarnValueDefaultValue = true;
  11693. }
  11694. }
  11695. var defaultValue = props.defaultValue;
  11696. inst._wrapperState = {
  11697. initialChecked: props.checked != null ? props.checked : props.defaultChecked,
  11698. initialValue: props.value != null ? props.value : defaultValue,
  11699. listeners: null,
  11700. onChange: _handleChange.bind(inst)
  11701. };
  11702. if (process.env.NODE_ENV !== 'production') {
  11703. inst._wrapperState.controlled = isControlled(props);
  11704. }
  11705. },
  11706. updateWrapper: function (inst) {
  11707. var props = inst._currentElement.props;
  11708. if (process.env.NODE_ENV !== 'production') {
  11709. var controlled = isControlled(props);
  11710. var owner = inst._currentElement._owner;
  11711. if (!inst._wrapperState.controlled && controlled && !didWarnUncontrolledToControlled) {
  11712. 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;
  11713. didWarnUncontrolledToControlled = true;
  11714. }
  11715. if (inst._wrapperState.controlled && !controlled && !didWarnControlledToUncontrolled) {
  11716. 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;
  11717. didWarnControlledToUncontrolled = true;
  11718. }
  11719. }
  11720. // TODO: Shouldn't this be getChecked(props)?
  11721. var checked = props.checked;
  11722. if (checked != null) {
  11723. DOMPropertyOperations.setValueForProperty(ReactDOMComponentTree.getNodeFromInstance(inst), 'checked', checked || false);
  11724. }
  11725. var node = ReactDOMComponentTree.getNodeFromInstance(inst);
  11726. var value = LinkedValueUtils.getValue(props);
  11727. if (value != null) {
  11728. // Cast `value` to a string to ensure the value is set correctly. While
  11729. // browsers typically do this as necessary, jsdom doesn't.
  11730. var newValue = '' + value;
  11731. // To avoid side effects (such as losing text selection), only set value if changed
  11732. if (newValue !== node.value) {
  11733. node.value = newValue;
  11734. }
  11735. } else {
  11736. if (props.value == null && props.defaultValue != null) {
  11737. node.defaultValue = '' + props.defaultValue;
  11738. }
  11739. if (props.checked == null && props.defaultChecked != null) {
  11740. node.defaultChecked = !!props.defaultChecked;
  11741. }
  11742. }
  11743. },
  11744. postMountWrapper: function (inst) {
  11745. var props = inst._currentElement.props;
  11746. // This is in postMount because we need access to the DOM node, which is not
  11747. // available until after the component has mounted.
  11748. var node = ReactDOMComponentTree.getNodeFromInstance(inst);
  11749. // Detach value from defaultValue. We won't do anything if we're working on
  11750. // submit or reset inputs as those values & defaultValues are linked. They
  11751. // are not resetable nodes so this operation doesn't matter and actually
  11752. // removes browser-default values (eg "Submit Query") when no value is
  11753. // provided.
  11754. switch (props.type) {
  11755. case 'submit':
  11756. case 'reset':
  11757. break;
  11758. case 'color':
  11759. case 'date':
  11760. case 'datetime':
  11761. case 'datetime-local':
  11762. case 'month':
  11763. case 'time':
  11764. case 'week':
  11765. // This fixes the no-show issue on iOS Safari and Android Chrome:
  11766. // https://github.com/facebook/react/issues/7233
  11767. node.value = '';
  11768. node.value = node.defaultValue;
  11769. break;
  11770. default:
  11771. node.value = node.value;
  11772. break;
  11773. }
  11774. // Normally, we'd just do `node.checked = node.checked` upon initial mount, less this bug
  11775. // this is needed to work around a chrome bug where setting defaultChecked
  11776. // will sometimes influence the value of checked (even after detachment).
  11777. // Reference: https://bugs.chromium.org/p/chromium/issues/detail?id=608416
  11778. // We need to temporarily unset name to avoid disrupting radio button groups.
  11779. var name = node.name;
  11780. if (name !== '') {
  11781. node.name = '';
  11782. }
  11783. node.defaultChecked = !node.defaultChecked;
  11784. node.defaultChecked = !node.defaultChecked;
  11785. if (name !== '') {
  11786. node.name = name;
  11787. }
  11788. }
  11789. };
  11790. function _handleChange(event) {
  11791. var props = this._currentElement.props;
  11792. var returnValue = LinkedValueUtils.executeOnChange(props, event);
  11793. // Here we use asap to wait until all updates have propagated, which
  11794. // is important when using controlled components within layers:
  11795. // https://github.com/facebook/react/issues/1698
  11796. ReactUpdates.asap(forceUpdateIfMounted, this);
  11797. var name = props.name;
  11798. if (props.type === 'radio' && name != null) {
  11799. var rootNode = ReactDOMComponentTree.getNodeFromInstance(this);
  11800. var queryRoot = rootNode;
  11801. while (queryRoot.parentNode) {
  11802. queryRoot = queryRoot.parentNode;
  11803. }
  11804. // If `rootNode.form` was non-null, then we could try `form.elements`,
  11805. // but that sometimes behaves strangely in IE8. We could also try using
  11806. // `form.getElementsByName`, but that will only return direct children
  11807. // and won't include inputs that use the HTML5 `form=` attribute. Since
  11808. // the input might not even be in a form, let's just use the global
  11809. // `querySelectorAll` to ensure we don't miss anything.
  11810. var group = queryRoot.querySelectorAll('input[name=' + JSON.stringify('' + name) + '][type="radio"]');
  11811. for (var i = 0; i < group.length; i++) {
  11812. var otherNode = group[i];
  11813. if (otherNode === rootNode || otherNode.form !== rootNode.form) {
  11814. continue;
  11815. }
  11816. // This will throw if radio buttons rendered by different copies of React
  11817. // and the same name are rendered into the same form (same as #1939).
  11818. // That's probably okay; we don't support it just as we don't support
  11819. // mixing React radio buttons with non-React ones.
  11820. var otherInstance = ReactDOMComponentTree.getInstanceFromNode(otherNode);
  11821. !otherInstance ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactDOMInput: Mixing React and non-React radio inputs with the same `name` is not supported.') : _prodInvariant('90') : void 0;
  11822. // If this is a controlled radio button group, forcing the input that
  11823. // was previously checked to update will cause it to be come re-checked
  11824. // as appropriate.
  11825. ReactUpdates.asap(forceUpdateIfMounted, otherInstance);
  11826. }
  11827. }
  11828. return returnValue;
  11829. }
  11830. module.exports = ReactDOMInput;
  11831. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  11832. /***/ },
  11833. /* 115 */
  11834. /***/ function(module, exports, __webpack_require__) {
  11835. /* WEBPACK VAR INJECTION */(function(process) {/**
  11836. * Copyright 2013-present, Facebook, Inc.
  11837. * All rights reserved.
  11838. *
  11839. * This source code is licensed under the BSD-style license found in the
  11840. * LICENSE file in the root directory of this source tree. An additional grant
  11841. * of patent rights can be found in the PATENTS file in the same directory.
  11842. *
  11843. * @providesModule LinkedValueUtils
  11844. */
  11845. 'use strict';
  11846. var _prodInvariant = __webpack_require__(9);
  11847. var ReactPropTypes = __webpack_require__(33);
  11848. var ReactPropTypeLocations = __webpack_require__(24);
  11849. var ReactPropTypesSecret = __webpack_require__(32);
  11850. var invariant = __webpack_require__(10);
  11851. var warning = __webpack_require__(13);
  11852. var hasReadOnlyValue = {
  11853. 'button': true,
  11854. 'checkbox': true,
  11855. 'image': true,
  11856. 'hidden': true,
  11857. 'radio': true,
  11858. 'reset': true,
  11859. 'submit': true
  11860. };
  11861. function _assertSingleLink(inputProps) {
  11862. !(inputProps.checkedLink == null || inputProps.valueLink == null) ? process.env.NODE_ENV !== 'production' ? 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.') : _prodInvariant('87') : void 0;
  11863. }
  11864. function _assertValueLink(inputProps) {
  11865. _assertSingleLink(inputProps);
  11866. !(inputProps.value == null && inputProps.onChange == null) ? process.env.NODE_ENV !== 'production' ? 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.') : _prodInvariant('88') : void 0;
  11867. }
  11868. function _assertCheckedLink(inputProps) {
  11869. _assertSingleLink(inputProps);
  11870. !(inputProps.checked == null && inputProps.onChange == null) ? process.env.NODE_ENV !== 'production' ? 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') : _prodInvariant('89') : void 0;
  11871. }
  11872. var propTypes = {
  11873. value: function (props, propName, componentName) {
  11874. if (!props[propName] || hasReadOnlyValue[props.type] || props.onChange || props.readOnly || props.disabled) {
  11875. return null;
  11876. }
  11877. 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`.');
  11878. },
  11879. checked: function (props, propName, componentName) {
  11880. if (!props[propName] || props.onChange || props.readOnly || props.disabled) {
  11881. return null;
  11882. }
  11883. 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`.');
  11884. },
  11885. onChange: ReactPropTypes.func
  11886. };
  11887. var loggedTypeFailures = {};
  11888. function getDeclarationErrorAddendum(owner) {
  11889. if (owner) {
  11890. var name = owner.getName();
  11891. if (name) {
  11892. return ' Check the render method of `' + name + '`.';
  11893. }
  11894. }
  11895. return '';
  11896. }
  11897. /**
  11898. * Provide a linked `value` attribute for controlled forms. You should not use
  11899. * this outside of the ReactDOM controlled form components.
  11900. */
  11901. var LinkedValueUtils = {
  11902. checkPropTypes: function (tagName, props, owner) {
  11903. for (var propName in propTypes) {
  11904. if (propTypes.hasOwnProperty(propName)) {
  11905. var error = propTypes[propName](props, propName, tagName, ReactPropTypeLocations.prop, null, ReactPropTypesSecret);
  11906. }
  11907. if (error instanceof Error && !(error.message in loggedTypeFailures)) {
  11908. // Only monitor this failure once because there tends to be a lot of the
  11909. // same error.
  11910. loggedTypeFailures[error.message] = true;
  11911. var addendum = getDeclarationErrorAddendum(owner);
  11912. process.env.NODE_ENV !== 'production' ? warning(false, 'Failed form propType: %s%s', error.message, addendum) : void 0;
  11913. }
  11914. }
  11915. },
  11916. /**
  11917. * @param {object} inputProps Props for form component
  11918. * @return {*} current value of the input either from value prop or link.
  11919. */
  11920. getValue: function (inputProps) {
  11921. if (inputProps.valueLink) {
  11922. _assertValueLink(inputProps);
  11923. return inputProps.valueLink.value;
  11924. }
  11925. return inputProps.value;
  11926. },
  11927. /**
  11928. * @param {object} inputProps Props for form component
  11929. * @return {*} current checked status of the input either from checked prop
  11930. * or link.
  11931. */
  11932. getChecked: function (inputProps) {
  11933. if (inputProps.checkedLink) {
  11934. _assertCheckedLink(inputProps);
  11935. return inputProps.checkedLink.value;
  11936. }
  11937. return inputProps.checked;
  11938. },
  11939. /**
  11940. * @param {object} inputProps Props for form component
  11941. * @param {SyntheticEvent} event change event to handle
  11942. */
  11943. executeOnChange: function (inputProps, event) {
  11944. if (inputProps.valueLink) {
  11945. _assertValueLink(inputProps);
  11946. return inputProps.valueLink.requestChange(event.target.value);
  11947. } else if (inputProps.checkedLink) {
  11948. _assertCheckedLink(inputProps);
  11949. return inputProps.checkedLink.requestChange(event.target.checked);
  11950. } else if (inputProps.onChange) {
  11951. return inputProps.onChange.call(undefined, event);
  11952. }
  11953. }
  11954. };
  11955. module.exports = LinkedValueUtils;
  11956. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  11957. /***/ },
  11958. /* 116 */
  11959. /***/ function(module, exports, __webpack_require__) {
  11960. /* WEBPACK VAR INJECTION */(function(process) {/**
  11961. * Copyright 2013-present, Facebook, Inc.
  11962. * All rights reserved.
  11963. *
  11964. * This source code is licensed under the BSD-style license found in the
  11965. * LICENSE file in the root directory of this source tree. An additional grant
  11966. * of patent rights can be found in the PATENTS file in the same directory.
  11967. *
  11968. * @providesModule ReactDOMOption
  11969. */
  11970. 'use strict';
  11971. var _assign = __webpack_require__(6);
  11972. var ReactChildren = __webpack_require__(7);
  11973. var ReactDOMComponentTree = __webpack_require__(38);
  11974. var ReactDOMSelect = __webpack_require__(117);
  11975. var warning = __webpack_require__(13);
  11976. var didWarnInvalidOptionChildren = false;
  11977. function flattenChildren(children) {
  11978. var content = '';
  11979. // Flatten children and warn if they aren't strings or numbers;
  11980. // invalid types are ignored.
  11981. ReactChildren.forEach(children, function (child) {
  11982. if (child == null) {
  11983. return;
  11984. }
  11985. if (typeof child === 'string' || typeof child === 'number') {
  11986. content += child;
  11987. } else if (!didWarnInvalidOptionChildren) {
  11988. didWarnInvalidOptionChildren = true;
  11989. process.env.NODE_ENV !== 'production' ? warning(false, 'Only strings and numbers are supported as <option> children.') : void 0;
  11990. }
  11991. });
  11992. return content;
  11993. }
  11994. /**
  11995. * Implements an <option> host component that warns when `selected` is set.
  11996. */
  11997. var ReactDOMOption = {
  11998. mountWrapper: function (inst, props, hostParent) {
  11999. // TODO (yungsters): Remove support for `selected` in <option>.
  12000. if (process.env.NODE_ENV !== 'production') {
  12001. 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;
  12002. }
  12003. // Look up whether this option is 'selected'
  12004. var selectValue = null;
  12005. if (hostParent != null) {
  12006. var selectParent = hostParent;
  12007. if (selectParent._tag === 'optgroup') {
  12008. selectParent = selectParent._hostParent;
  12009. }
  12010. if (selectParent != null && selectParent._tag === 'select') {
  12011. selectValue = ReactDOMSelect.getSelectValueContext(selectParent);
  12012. }
  12013. }
  12014. // If the value is null (e.g., no specified value or after initial mount)
  12015. // or missing (e.g., for <datalist>), we don't change props.selected
  12016. var selected = null;
  12017. if (selectValue != null) {
  12018. var value;
  12019. if (props.value != null) {
  12020. value = props.value + '';
  12021. } else {
  12022. value = flattenChildren(props.children);
  12023. }
  12024. selected = false;
  12025. if (Array.isArray(selectValue)) {
  12026. // multiple
  12027. for (var i = 0; i < selectValue.length; i++) {
  12028. if ('' + selectValue[i] === value) {
  12029. selected = true;
  12030. break;
  12031. }
  12032. }
  12033. } else {
  12034. selected = '' + selectValue === value;
  12035. }
  12036. }
  12037. inst._wrapperState = { selected: selected };
  12038. },
  12039. postMountWrapper: function (inst) {
  12040. // value="" should make a value attribute (#6219)
  12041. var props = inst._currentElement.props;
  12042. if (props.value != null) {
  12043. var node = ReactDOMComponentTree.getNodeFromInstance(inst);
  12044. node.setAttribute('value', props.value);
  12045. }
  12046. },
  12047. getHostProps: function (inst, props) {
  12048. var hostProps = _assign({ selected: undefined, children: undefined }, props);
  12049. // Read state only from initial mount because <select> updates value
  12050. // manually; we need the initial state only for server rendering
  12051. if (inst._wrapperState.selected != null) {
  12052. hostProps.selected = inst._wrapperState.selected;
  12053. }
  12054. var content = flattenChildren(props.children);
  12055. if (content) {
  12056. hostProps.children = content;
  12057. }
  12058. return hostProps;
  12059. }
  12060. };
  12061. module.exports = ReactDOMOption;
  12062. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  12063. /***/ },
  12064. /* 117 */
  12065. /***/ function(module, exports, __webpack_require__) {
  12066. /* WEBPACK VAR INJECTION */(function(process) {/**
  12067. * Copyright 2013-present, Facebook, Inc.
  12068. * All rights reserved.
  12069. *
  12070. * This source code is licensed under the BSD-style license found in the
  12071. * LICENSE file in the root directory of this source tree. An additional grant
  12072. * of patent rights can be found in the PATENTS file in the same directory.
  12073. *
  12074. * @providesModule ReactDOMSelect
  12075. */
  12076. 'use strict';
  12077. var _assign = __webpack_require__(6);
  12078. var DisabledInputUtils = __webpack_require__(113);
  12079. var LinkedValueUtils = __webpack_require__(115);
  12080. var ReactDOMComponentTree = __webpack_require__(38);
  12081. var ReactUpdates = __webpack_require__(58);
  12082. var warning = __webpack_require__(13);
  12083. var didWarnValueLink = false;
  12084. var didWarnValueDefaultValue = false;
  12085. function updateOptionsIfPendingUpdateAndMounted() {
  12086. if (this._rootNodeID && this._wrapperState.pendingUpdate) {
  12087. this._wrapperState.pendingUpdate = false;
  12088. var props = this._currentElement.props;
  12089. var value = LinkedValueUtils.getValue(props);
  12090. if (value != null) {
  12091. updateOptions(this, Boolean(props.multiple), value);
  12092. }
  12093. }
  12094. }
  12095. function getDeclarationErrorAddendum(owner) {
  12096. if (owner) {
  12097. var name = owner.getName();
  12098. if (name) {
  12099. return ' Check the render method of `' + name + '`.';
  12100. }
  12101. }
  12102. return '';
  12103. }
  12104. var valuePropNames = ['value', 'defaultValue'];
  12105. /**
  12106. * Validation function for `value` and `defaultValue`.
  12107. * @private
  12108. */
  12109. function checkSelectPropTypes(inst, props) {
  12110. var owner = inst._currentElement._owner;
  12111. LinkedValueUtils.checkPropTypes('select', props, owner);
  12112. if (props.valueLink !== undefined && !didWarnValueLink) {
  12113. process.env.NODE_ENV !== 'production' ? warning(false, '`valueLink` prop on `select` is deprecated; set `value` and `onChange` instead.') : void 0;
  12114. didWarnValueLink = true;
  12115. }
  12116. for (var i = 0; i < valuePropNames.length; i++) {
  12117. var propName = valuePropNames[i];
  12118. if (props[propName] == null) {
  12119. continue;
  12120. }
  12121. var isArray = Array.isArray(props[propName]);
  12122. if (props.multiple && !isArray) {
  12123. process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;
  12124. } else if (!props.multiple && isArray) {
  12125. process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;
  12126. }
  12127. }
  12128. }
  12129. /**
  12130. * @param {ReactDOMComponent} inst
  12131. * @param {boolean} multiple
  12132. * @param {*} propValue A stringable (with `multiple`, a list of stringables).
  12133. * @private
  12134. */
  12135. function updateOptions(inst, multiple, propValue) {
  12136. var selectedValue, i;
  12137. var options = ReactDOMComponentTree.getNodeFromInstance(inst).options;
  12138. if (multiple) {
  12139. selectedValue = {};
  12140. for (i = 0; i < propValue.length; i++) {
  12141. selectedValue['' + propValue[i]] = true;
  12142. }
  12143. for (i = 0; i < options.length; i++) {
  12144. var selected = selectedValue.hasOwnProperty(options[i].value);
  12145. if (options[i].selected !== selected) {
  12146. options[i].selected = selected;
  12147. }
  12148. }
  12149. } else {
  12150. // Do not set `select.value` as exact behavior isn't consistent across all
  12151. // browsers for all cases.
  12152. selectedValue = '' + propValue;
  12153. for (i = 0; i < options.length; i++) {
  12154. if (options[i].value === selectedValue) {
  12155. options[i].selected = true;
  12156. return;
  12157. }
  12158. }
  12159. if (options.length) {
  12160. options[0].selected = true;
  12161. }
  12162. }
  12163. }
  12164. /**
  12165. * Implements a <select> host component that allows optionally setting the
  12166. * props `value` and `defaultValue`. If `multiple` is false, the prop must be a
  12167. * stringable. If `multiple` is true, the prop must be an array of stringables.
  12168. *
  12169. * If `value` is not supplied (or null/undefined), user actions that change the
  12170. * selected option will trigger updates to the rendered options.
  12171. *
  12172. * If it is supplied (and not null/undefined), the rendered options will not
  12173. * update in response to user actions. Instead, the `value` prop must change in
  12174. * order for the rendered options to update.
  12175. *
  12176. * If `defaultValue` is provided, any options with the supplied values will be
  12177. * selected.
  12178. */
  12179. var ReactDOMSelect = {
  12180. getHostProps: function (inst, props) {
  12181. return _assign({}, DisabledInputUtils.getHostProps(inst, props), {
  12182. onChange: inst._wrapperState.onChange,
  12183. value: undefined
  12184. });
  12185. },
  12186. mountWrapper: function (inst, props) {
  12187. if (process.env.NODE_ENV !== 'production') {
  12188. checkSelectPropTypes(inst, props);
  12189. }
  12190. var value = LinkedValueUtils.getValue(props);
  12191. inst._wrapperState = {
  12192. pendingUpdate: false,
  12193. initialValue: value != null ? value : props.defaultValue,
  12194. listeners: null,
  12195. onChange: _handleChange.bind(inst),
  12196. wasMultiple: Boolean(props.multiple)
  12197. };
  12198. if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue) {
  12199. process.env.NODE_ENV !== 'production' ? 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;
  12200. didWarnValueDefaultValue = true;
  12201. }
  12202. },
  12203. getSelectValueContext: function (inst) {
  12204. // ReactDOMOption looks at this initial value so the initial generated
  12205. // markup has correct `selected` attributes
  12206. return inst._wrapperState.initialValue;
  12207. },
  12208. postUpdateWrapper: function (inst) {
  12209. var props = inst._currentElement.props;
  12210. // After the initial mount, we control selected-ness manually so don't pass
  12211. // this value down
  12212. inst._wrapperState.initialValue = undefined;
  12213. var wasMultiple = inst._wrapperState.wasMultiple;
  12214. inst._wrapperState.wasMultiple = Boolean(props.multiple);
  12215. var value = LinkedValueUtils.getValue(props);
  12216. if (value != null) {
  12217. inst._wrapperState.pendingUpdate = false;
  12218. updateOptions(inst, Boolean(props.multiple), value);
  12219. } else if (wasMultiple !== Boolean(props.multiple)) {
  12220. // For simplicity, reapply `defaultValue` if `multiple` is toggled.
  12221. if (props.defaultValue != null) {
  12222. updateOptions(inst, Boolean(props.multiple), props.defaultValue);
  12223. } else {
  12224. // Revert the select back to its default unselected state.
  12225. updateOptions(inst, Boolean(props.multiple), props.multiple ? [] : '');
  12226. }
  12227. }
  12228. }
  12229. };
  12230. function _handleChange(event) {
  12231. var props = this._currentElement.props;
  12232. var returnValue = LinkedValueUtils.executeOnChange(props, event);
  12233. if (this._rootNodeID) {
  12234. this._wrapperState.pendingUpdate = true;
  12235. }
  12236. ReactUpdates.asap(updateOptionsIfPendingUpdateAndMounted, this);
  12237. return returnValue;
  12238. }
  12239. module.exports = ReactDOMSelect;
  12240. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  12241. /***/ },
  12242. /* 118 */
  12243. /***/ function(module, exports, __webpack_require__) {
  12244. /* WEBPACK VAR INJECTION */(function(process) {/**
  12245. * Copyright 2013-present, Facebook, Inc.
  12246. * All rights reserved.
  12247. *
  12248. * This source code is licensed under the BSD-style license found in the
  12249. * LICENSE file in the root directory of this source tree. An additional grant
  12250. * of patent rights can be found in the PATENTS file in the same directory.
  12251. *
  12252. * @providesModule ReactDOMTextarea
  12253. */
  12254. 'use strict';
  12255. var _prodInvariant = __webpack_require__(9),
  12256. _assign = __webpack_require__(6);
  12257. var DisabledInputUtils = __webpack_require__(113);
  12258. var LinkedValueUtils = __webpack_require__(115);
  12259. var ReactDOMComponentTree = __webpack_require__(38);
  12260. var ReactUpdates = __webpack_require__(58);
  12261. var invariant = __webpack_require__(10);
  12262. var warning = __webpack_require__(13);
  12263. var didWarnValueLink = false;
  12264. var didWarnValDefaultVal = false;
  12265. function forceUpdateIfMounted() {
  12266. if (this._rootNodeID) {
  12267. // DOM component is still mounted; update
  12268. ReactDOMTextarea.updateWrapper(this);
  12269. }
  12270. }
  12271. /**
  12272. * Implements a <textarea> host component that allows setting `value`, and
  12273. * `defaultValue`. This differs from the traditional DOM API because value is
  12274. * usually set as PCDATA children.
  12275. *
  12276. * If `value` is not supplied (or null/undefined), user actions that affect the
  12277. * value will trigger updates to the element.
  12278. *
  12279. * If `value` is supplied (and not null/undefined), the rendered element will
  12280. * not trigger updates to the element. Instead, the `value` prop must change in
  12281. * order for the rendered element to be updated.
  12282. *
  12283. * The rendered element will be initialized with an empty value, the prop
  12284. * `defaultValue` if specified, or the children content (deprecated).
  12285. */
  12286. var ReactDOMTextarea = {
  12287. getHostProps: function (inst, props) {
  12288. !(props.dangerouslySetInnerHTML == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, '`dangerouslySetInnerHTML` does not make sense on <textarea>.') : _prodInvariant('91') : void 0;
  12289. // Always set children to the same thing. In IE9, the selection range will
  12290. // get reset if `textContent` is mutated. We could add a check in setTextContent
  12291. // to only set the value if/when the value differs from the node value (which would
  12292. // completely solve this IE9 bug), but Sebastian+Ben seemed to like this solution.
  12293. // The value can be a boolean or object so that's why it's forced to be a string.
  12294. var hostProps = _assign({}, DisabledInputUtils.getHostProps(inst, props), {
  12295. value: undefined,
  12296. defaultValue: undefined,
  12297. children: '' + inst._wrapperState.initialValue,
  12298. onChange: inst._wrapperState.onChange
  12299. });
  12300. return hostProps;
  12301. },
  12302. mountWrapper: function (inst, props) {
  12303. if (process.env.NODE_ENV !== 'production') {
  12304. LinkedValueUtils.checkPropTypes('textarea', props, inst._currentElement._owner);
  12305. if (props.valueLink !== undefined && !didWarnValueLink) {
  12306. process.env.NODE_ENV !== 'production' ? warning(false, '`valueLink` prop on `textarea` is deprecated; set `value` and `onChange` instead.') : void 0;
  12307. didWarnValueLink = true;
  12308. }
  12309. if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValDefaultVal) {
  12310. 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;
  12311. didWarnValDefaultVal = true;
  12312. }
  12313. }
  12314. var value = LinkedValueUtils.getValue(props);
  12315. var initialValue = value;
  12316. // Only bother fetching default value if we're going to use it
  12317. if (value == null) {
  12318. var defaultValue = props.defaultValue;
  12319. // TODO (yungsters): Remove support for children content in <textarea>.
  12320. var children = props.children;
  12321. if (children != null) {
  12322. if (process.env.NODE_ENV !== 'production') {
  12323. process.env.NODE_ENV !== 'production' ? warning(false, 'Use the `defaultValue` or `value` props instead of setting ' + 'children on <textarea>.') : void 0;
  12324. }
  12325. !(defaultValue == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'If you supply `defaultValue` on a <textarea>, do not pass children.') : _prodInvariant('92') : void 0;
  12326. if (Array.isArray(children)) {
  12327. !(children.length <= 1) ? process.env.NODE_ENV !== 'production' ? invariant(false, '<textarea> can only have at most one child.') : _prodInvariant('93') : void 0;
  12328. children = children[0];
  12329. }
  12330. defaultValue = '' + children;
  12331. }
  12332. if (defaultValue == null) {
  12333. defaultValue = '';
  12334. }
  12335. initialValue = defaultValue;
  12336. }
  12337. inst._wrapperState = {
  12338. initialValue: '' + initialValue,
  12339. listeners: null,
  12340. onChange: _handleChange.bind(inst)
  12341. };
  12342. },
  12343. updateWrapper: function (inst) {
  12344. var props = inst._currentElement.props;
  12345. var node = ReactDOMComponentTree.getNodeFromInstance(inst);
  12346. var value = LinkedValueUtils.getValue(props);
  12347. if (value != null) {
  12348. // Cast `value` to a string to ensure the value is set correctly. While
  12349. // browsers typically do this as necessary, jsdom doesn't.
  12350. var newValue = '' + value;
  12351. // To avoid side effects (such as losing text selection), only set value if changed
  12352. if (newValue !== node.value) {
  12353. node.value = newValue;
  12354. }
  12355. if (props.defaultValue == null) {
  12356. node.defaultValue = newValue;
  12357. }
  12358. }
  12359. if (props.defaultValue != null) {
  12360. node.defaultValue = props.defaultValue;
  12361. }
  12362. },
  12363. postMountWrapper: function (inst) {
  12364. // This is in postMount because we need access to the DOM node, which is not
  12365. // available until after the component has mounted.
  12366. var node = ReactDOMComponentTree.getNodeFromInstance(inst);
  12367. // Warning: node.value may be the empty string at this point (IE11) if placeholder is set.
  12368. node.value = node.textContent; // Detach value from defaultValue
  12369. }
  12370. };
  12371. function _handleChange(event) {
  12372. var props = this._currentElement.props;
  12373. var returnValue = LinkedValueUtils.executeOnChange(props, event);
  12374. ReactUpdates.asap(forceUpdateIfMounted, this);
  12375. return returnValue;
  12376. }
  12377. module.exports = ReactDOMTextarea;
  12378. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  12379. /***/ },
  12380. /* 119 */
  12381. /***/ function(module, exports, __webpack_require__) {
  12382. /* WEBPACK VAR INJECTION */(function(process) {/**
  12383. * Copyright 2013-present, Facebook, Inc.
  12384. * All rights reserved.
  12385. *
  12386. * This source code is licensed under the BSD-style license found in the
  12387. * LICENSE file in the root directory of this source tree. An additional grant
  12388. * of patent rights can be found in the PATENTS file in the same directory.
  12389. *
  12390. * @providesModule ReactMultiChild
  12391. */
  12392. 'use strict';
  12393. var _prodInvariant = __webpack_require__(9);
  12394. var ReactComponentEnvironment = __webpack_require__(120);
  12395. var ReactInstanceMap = __webpack_require__(121);
  12396. var ReactInstrumentation = __webpack_require__(64);
  12397. var ReactMultiChildUpdateTypes = __webpack_require__(94);
  12398. var ReactCurrentOwner = __webpack_require__(12);
  12399. var ReactReconciler = __webpack_require__(61);
  12400. var ReactChildReconciler = __webpack_require__(122);
  12401. var emptyFunction = __webpack_require__(14);
  12402. var flattenChildren = __webpack_require__(130);
  12403. var invariant = __webpack_require__(10);
  12404. /**
  12405. * Make an update for markup to be rendered and inserted at a supplied index.
  12406. *
  12407. * @param {string} markup Markup that renders into an element.
  12408. * @param {number} toIndex Destination index.
  12409. * @private
  12410. */
  12411. function makeInsertMarkup(markup, afterNode, toIndex) {
  12412. // NOTE: Null values reduce hidden classes.
  12413. return {
  12414. type: ReactMultiChildUpdateTypes.INSERT_MARKUP,
  12415. content: markup,
  12416. fromIndex: null,
  12417. fromNode: null,
  12418. toIndex: toIndex,
  12419. afterNode: afterNode
  12420. };
  12421. }
  12422. /**
  12423. * Make an update for moving an existing element to another index.
  12424. *
  12425. * @param {number} fromIndex Source index of the existing element.
  12426. * @param {number} toIndex Destination index of the element.
  12427. * @private
  12428. */
  12429. function makeMove(child, afterNode, toIndex) {
  12430. // NOTE: Null values reduce hidden classes.
  12431. return {
  12432. type: ReactMultiChildUpdateTypes.MOVE_EXISTING,
  12433. content: null,
  12434. fromIndex: child._mountIndex,
  12435. fromNode: ReactReconciler.getHostNode(child),
  12436. toIndex: toIndex,
  12437. afterNode: afterNode
  12438. };
  12439. }
  12440. /**
  12441. * Make an update for removing an element at an index.
  12442. *
  12443. * @param {number} fromIndex Index of the element to remove.
  12444. * @private
  12445. */
  12446. function makeRemove(child, node) {
  12447. // NOTE: Null values reduce hidden classes.
  12448. return {
  12449. type: ReactMultiChildUpdateTypes.REMOVE_NODE,
  12450. content: null,
  12451. fromIndex: child._mountIndex,
  12452. fromNode: node,
  12453. toIndex: null,
  12454. afterNode: null
  12455. };
  12456. }
  12457. /**
  12458. * Make an update for setting the markup of a node.
  12459. *
  12460. * @param {string} markup Markup that renders into an element.
  12461. * @private
  12462. */
  12463. function makeSetMarkup(markup) {
  12464. // NOTE: Null values reduce hidden classes.
  12465. return {
  12466. type: ReactMultiChildUpdateTypes.SET_MARKUP,
  12467. content: markup,
  12468. fromIndex: null,
  12469. fromNode: null,
  12470. toIndex: null,
  12471. afterNode: null
  12472. };
  12473. }
  12474. /**
  12475. * Make an update for setting the text content.
  12476. *
  12477. * @param {string} textContent Text content to set.
  12478. * @private
  12479. */
  12480. function makeTextContent(textContent) {
  12481. // NOTE: Null values reduce hidden classes.
  12482. return {
  12483. type: ReactMultiChildUpdateTypes.TEXT_CONTENT,
  12484. content: textContent,
  12485. fromIndex: null,
  12486. fromNode: null,
  12487. toIndex: null,
  12488. afterNode: null
  12489. };
  12490. }
  12491. /**
  12492. * Push an update, if any, onto the queue. Creates a new queue if none is
  12493. * passed and always returns the queue. Mutative.
  12494. */
  12495. function enqueue(queue, update) {
  12496. if (update) {
  12497. queue = queue || [];
  12498. queue.push(update);
  12499. }
  12500. return queue;
  12501. }
  12502. /**
  12503. * Processes any enqueued updates.
  12504. *
  12505. * @private
  12506. */
  12507. function processQueue(inst, updateQueue) {
  12508. ReactComponentEnvironment.processChildrenUpdates(inst, updateQueue);
  12509. }
  12510. var setChildrenForInstrumentation = emptyFunction;
  12511. if (process.env.NODE_ENV !== 'production') {
  12512. var getDebugID = function (inst) {
  12513. if (!inst._debugID) {
  12514. // Check for ART-like instances. TODO: This is silly/gross.
  12515. var internal;
  12516. if (internal = ReactInstanceMap.get(inst)) {
  12517. inst = internal;
  12518. }
  12519. }
  12520. return inst._debugID;
  12521. };
  12522. setChildrenForInstrumentation = function (children) {
  12523. var debugID = getDebugID(this);
  12524. // TODO: React Native empty components are also multichild.
  12525. // This means they still get into this method but don't have _debugID.
  12526. if (debugID !== 0) {
  12527. ReactInstrumentation.debugTool.onSetChildren(debugID, children ? Object.keys(children).map(function (key) {
  12528. return children[key]._debugID;
  12529. }) : []);
  12530. }
  12531. };
  12532. }
  12533. /**
  12534. * ReactMultiChild are capable of reconciling multiple children.
  12535. *
  12536. * @class ReactMultiChild
  12537. * @internal
  12538. */
  12539. var ReactMultiChild = {
  12540. /**
  12541. * Provides common functionality for components that must reconcile multiple
  12542. * children. This is used by `ReactDOMComponent` to mount, update, and
  12543. * unmount child components.
  12544. *
  12545. * @lends {ReactMultiChild.prototype}
  12546. */
  12547. Mixin: {
  12548. _reconcilerInstantiateChildren: function (nestedChildren, transaction, context) {
  12549. if (process.env.NODE_ENV !== 'production') {
  12550. var selfDebugID = getDebugID(this);
  12551. if (this._currentElement) {
  12552. try {
  12553. ReactCurrentOwner.current = this._currentElement._owner;
  12554. return ReactChildReconciler.instantiateChildren(nestedChildren, transaction, context, selfDebugID);
  12555. } finally {
  12556. ReactCurrentOwner.current = null;
  12557. }
  12558. }
  12559. }
  12560. return ReactChildReconciler.instantiateChildren(nestedChildren, transaction, context);
  12561. },
  12562. _reconcilerUpdateChildren: function (prevChildren, nextNestedChildrenElements, mountImages, removedNodes, transaction, context) {
  12563. var nextChildren;
  12564. var selfDebugID = 0;
  12565. if (process.env.NODE_ENV !== 'production') {
  12566. selfDebugID = getDebugID(this);
  12567. if (this._currentElement) {
  12568. try {
  12569. ReactCurrentOwner.current = this._currentElement._owner;
  12570. nextChildren = flattenChildren(nextNestedChildrenElements, selfDebugID);
  12571. } finally {
  12572. ReactCurrentOwner.current = null;
  12573. }
  12574. ReactChildReconciler.updateChildren(prevChildren, nextChildren, mountImages, removedNodes, transaction, this, this._hostContainerInfo, context, selfDebugID);
  12575. return nextChildren;
  12576. }
  12577. }
  12578. nextChildren = flattenChildren(nextNestedChildrenElements, selfDebugID);
  12579. ReactChildReconciler.updateChildren(prevChildren, nextChildren, mountImages, removedNodes, transaction, this, this._hostContainerInfo, context, selfDebugID);
  12580. return nextChildren;
  12581. },
  12582. /**
  12583. * Generates a "mount image" for each of the supplied children. In the case
  12584. * of `ReactDOMComponent`, a mount image is a string of markup.
  12585. *
  12586. * @param {?object} nestedChildren Nested child maps.
  12587. * @return {array} An array of mounted representations.
  12588. * @internal
  12589. */
  12590. mountChildren: function (nestedChildren, transaction, context) {
  12591. var children = this._reconcilerInstantiateChildren(nestedChildren, transaction, context);
  12592. this._renderedChildren = children;
  12593. var mountImages = [];
  12594. var index = 0;
  12595. for (var name in children) {
  12596. if (children.hasOwnProperty(name)) {
  12597. var child = children[name];
  12598. var selfDebugID = 0;
  12599. if (process.env.NODE_ENV !== 'production') {
  12600. selfDebugID = getDebugID(this);
  12601. }
  12602. var mountImage = ReactReconciler.mountComponent(child, transaction, this, this._hostContainerInfo, context, selfDebugID);
  12603. child._mountIndex = index++;
  12604. mountImages.push(mountImage);
  12605. }
  12606. }
  12607. if (process.env.NODE_ENV !== 'production') {
  12608. setChildrenForInstrumentation.call(this, children);
  12609. }
  12610. return mountImages;
  12611. },
  12612. /**
  12613. * Replaces any rendered children with a text content string.
  12614. *
  12615. * @param {string} nextContent String of content.
  12616. * @internal
  12617. */
  12618. updateTextContent: function (nextContent) {
  12619. var prevChildren = this._renderedChildren;
  12620. // Remove any rendered children.
  12621. ReactChildReconciler.unmountChildren(prevChildren, false);
  12622. for (var name in prevChildren) {
  12623. if (prevChildren.hasOwnProperty(name)) {
  12624. true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'updateTextContent called on non-empty component.') : _prodInvariant('118') : void 0;
  12625. }
  12626. }
  12627. // Set new text content.
  12628. var updates = [makeTextContent(nextContent)];
  12629. processQueue(this, updates);
  12630. },
  12631. /**
  12632. * Replaces any rendered children with a markup string.
  12633. *
  12634. * @param {string} nextMarkup String of markup.
  12635. * @internal
  12636. */
  12637. updateMarkup: function (nextMarkup) {
  12638. var prevChildren = this._renderedChildren;
  12639. // Remove any rendered children.
  12640. ReactChildReconciler.unmountChildren(prevChildren, false);
  12641. for (var name in prevChildren) {
  12642. if (prevChildren.hasOwnProperty(name)) {
  12643. true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'updateTextContent called on non-empty component.') : _prodInvariant('118') : void 0;
  12644. }
  12645. }
  12646. var updates = [makeSetMarkup(nextMarkup)];
  12647. processQueue(this, updates);
  12648. },
  12649. /**
  12650. * Updates the rendered children with new children.
  12651. *
  12652. * @param {?object} nextNestedChildrenElements Nested child element maps.
  12653. * @param {ReactReconcileTransaction} transaction
  12654. * @internal
  12655. */
  12656. updateChildren: function (nextNestedChildrenElements, transaction, context) {
  12657. // Hook used by React ART
  12658. this._updateChildren(nextNestedChildrenElements, transaction, context);
  12659. },
  12660. /**
  12661. * @param {?object} nextNestedChildrenElements Nested child element maps.
  12662. * @param {ReactReconcileTransaction} transaction
  12663. * @final
  12664. * @protected
  12665. */
  12666. _updateChildren: function (nextNestedChildrenElements, transaction, context) {
  12667. var prevChildren = this._renderedChildren;
  12668. var removedNodes = {};
  12669. var mountImages = [];
  12670. var nextChildren = this._reconcilerUpdateChildren(prevChildren, nextNestedChildrenElements, mountImages, removedNodes, transaction, context);
  12671. if (!nextChildren && !prevChildren) {
  12672. return;
  12673. }
  12674. var updates = null;
  12675. var name;
  12676. // `nextIndex` will increment for each child in `nextChildren`, but
  12677. // `lastIndex` will be the last index visited in `prevChildren`.
  12678. var nextIndex = 0;
  12679. var lastIndex = 0;
  12680. // `nextMountIndex` will increment for each newly mounted child.
  12681. var nextMountIndex = 0;
  12682. var lastPlacedNode = null;
  12683. for (name in nextChildren) {
  12684. if (!nextChildren.hasOwnProperty(name)) {
  12685. continue;
  12686. }
  12687. var prevChild = prevChildren && prevChildren[name];
  12688. var nextChild = nextChildren[name];
  12689. if (prevChild === nextChild) {
  12690. updates = enqueue(updates, this.moveChild(prevChild, lastPlacedNode, nextIndex, lastIndex));
  12691. lastIndex = Math.max(prevChild._mountIndex, lastIndex);
  12692. prevChild._mountIndex = nextIndex;
  12693. } else {
  12694. if (prevChild) {
  12695. // Update `lastIndex` before `_mountIndex` gets unset by unmounting.
  12696. lastIndex = Math.max(prevChild._mountIndex, lastIndex);
  12697. // The `removedNodes` loop below will actually remove the child.
  12698. }
  12699. // The child must be instantiated before it's mounted.
  12700. updates = enqueue(updates, this._mountChildAtIndex(nextChild, mountImages[nextMountIndex], lastPlacedNode, nextIndex, transaction, context));
  12701. nextMountIndex++;
  12702. }
  12703. nextIndex++;
  12704. lastPlacedNode = ReactReconciler.getHostNode(nextChild);
  12705. }
  12706. // Remove children that are no longer present.
  12707. for (name in removedNodes) {
  12708. if (removedNodes.hasOwnProperty(name)) {
  12709. updates = enqueue(updates, this._unmountChild(prevChildren[name], removedNodes[name]));
  12710. }
  12711. }
  12712. if (updates) {
  12713. processQueue(this, updates);
  12714. }
  12715. this._renderedChildren = nextChildren;
  12716. if (process.env.NODE_ENV !== 'production') {
  12717. setChildrenForInstrumentation.call(this, nextChildren);
  12718. }
  12719. },
  12720. /**
  12721. * Unmounts all rendered children. This should be used to clean up children
  12722. * when this component is unmounted. It does not actually perform any
  12723. * backend operations.
  12724. *
  12725. * @internal
  12726. */
  12727. unmountChildren: function (safely) {
  12728. var renderedChildren = this._renderedChildren;
  12729. ReactChildReconciler.unmountChildren(renderedChildren, safely);
  12730. this._renderedChildren = null;
  12731. },
  12732. /**
  12733. * Moves a child component to the supplied index.
  12734. *
  12735. * @param {ReactComponent} child Component to move.
  12736. * @param {number} toIndex Destination index of the element.
  12737. * @param {number} lastIndex Last index visited of the siblings of `child`.
  12738. * @protected
  12739. */
  12740. moveChild: function (child, afterNode, toIndex, lastIndex) {
  12741. // If the index of `child` is less than `lastIndex`, then it needs to
  12742. // be moved. Otherwise, we do not need to move it because a child will be
  12743. // inserted or moved before `child`.
  12744. if (child._mountIndex < lastIndex) {
  12745. return makeMove(child, afterNode, toIndex);
  12746. }
  12747. },
  12748. /**
  12749. * Creates a child component.
  12750. *
  12751. * @param {ReactComponent} child Component to create.
  12752. * @param {string} mountImage Markup to insert.
  12753. * @protected
  12754. */
  12755. createChild: function (child, afterNode, mountImage) {
  12756. return makeInsertMarkup(mountImage, afterNode, child._mountIndex);
  12757. },
  12758. /**
  12759. * Removes a child component.
  12760. *
  12761. * @param {ReactComponent} child Child to remove.
  12762. * @protected
  12763. */
  12764. removeChild: function (child, node) {
  12765. return makeRemove(child, node);
  12766. },
  12767. /**
  12768. * Mounts a child with the supplied name.
  12769. *
  12770. * NOTE: This is part of `updateChildren` and is here for readability.
  12771. *
  12772. * @param {ReactComponent} child Component to mount.
  12773. * @param {string} name Name of the child.
  12774. * @param {number} index Index at which to insert the child.
  12775. * @param {ReactReconcileTransaction} transaction
  12776. * @private
  12777. */
  12778. _mountChildAtIndex: function (child, mountImage, afterNode, index, transaction, context) {
  12779. child._mountIndex = index;
  12780. return this.createChild(child, afterNode, mountImage);
  12781. },
  12782. /**
  12783. * Unmounts a rendered child.
  12784. *
  12785. * NOTE: This is part of `updateChildren` and is here for readability.
  12786. *
  12787. * @param {ReactComponent} child Component to unmount.
  12788. * @private
  12789. */
  12790. _unmountChild: function (child, node) {
  12791. var update = this.removeChild(child, node);
  12792. child._mountIndex = null;
  12793. return update;
  12794. }
  12795. }
  12796. };
  12797. module.exports = ReactMultiChild;
  12798. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  12799. /***/ },
  12800. /* 120 */
  12801. /***/ function(module, exports, __webpack_require__) {
  12802. /* WEBPACK VAR INJECTION */(function(process) {/**
  12803. * Copyright 2014-present, Facebook, Inc.
  12804. * All rights reserved.
  12805. *
  12806. * This source code is licensed under the BSD-style license found in the
  12807. * LICENSE file in the root directory of this source tree. An additional grant
  12808. * of patent rights can be found in the PATENTS file in the same directory.
  12809. *
  12810. * @providesModule ReactComponentEnvironment
  12811. */
  12812. 'use strict';
  12813. var _prodInvariant = __webpack_require__(9);
  12814. var invariant = __webpack_require__(10);
  12815. var injected = false;
  12816. var ReactComponentEnvironment = {
  12817. /**
  12818. * Optionally injectable hook for swapping out mount images in the middle of
  12819. * the tree.
  12820. */
  12821. replaceNodeWithMarkup: null,
  12822. /**
  12823. * Optionally injectable hook for processing a queue of child updates. Will
  12824. * later move into MultiChildComponents.
  12825. */
  12826. processChildrenUpdates: null,
  12827. injection: {
  12828. injectEnvironment: function (environment) {
  12829. !!injected ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactCompositeComponent: injectEnvironment() can only be called once.') : _prodInvariant('104') : void 0;
  12830. ReactComponentEnvironment.replaceNodeWithMarkup = environment.replaceNodeWithMarkup;
  12831. ReactComponentEnvironment.processChildrenUpdates = environment.processChildrenUpdates;
  12832. injected = true;
  12833. }
  12834. }
  12835. };
  12836. module.exports = ReactComponentEnvironment;
  12837. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  12838. /***/ },
  12839. /* 121 */
  12840. /***/ function(module, exports) {
  12841. /**
  12842. * Copyright 2013-present, Facebook, Inc.
  12843. * All rights reserved.
  12844. *
  12845. * This source code is licensed under the BSD-style license found in the
  12846. * LICENSE file in the root directory of this source tree. An additional grant
  12847. * of patent rights can be found in the PATENTS file in the same directory.
  12848. *
  12849. * @providesModule ReactInstanceMap
  12850. */
  12851. 'use strict';
  12852. /**
  12853. * `ReactInstanceMap` maintains a mapping from a public facing stateful
  12854. * instance (key) and the internal representation (value). This allows public
  12855. * methods to accept the user facing instance as an argument and map them back
  12856. * to internal methods.
  12857. */
  12858. // TODO: Replace this with ES6: var ReactInstanceMap = new Map();
  12859. var ReactInstanceMap = {
  12860. /**
  12861. * This API should be called `delete` but we'd have to make sure to always
  12862. * transform these to strings for IE support. When this transform is fully
  12863. * supported we can rename it.
  12864. */
  12865. remove: function (key) {
  12866. key._reactInternalInstance = undefined;
  12867. },
  12868. get: function (key) {
  12869. return key._reactInternalInstance;
  12870. },
  12871. has: function (key) {
  12872. return key._reactInternalInstance !== undefined;
  12873. },
  12874. set: function (key, value) {
  12875. key._reactInternalInstance = value;
  12876. }
  12877. };
  12878. module.exports = ReactInstanceMap;
  12879. /***/ },
  12880. /* 122 */
  12881. /***/ function(module, exports, __webpack_require__) {
  12882. /* WEBPACK VAR INJECTION */(function(process) {/**
  12883. * Copyright 2014-present, Facebook, Inc.
  12884. * All rights reserved.
  12885. *
  12886. * This source code is licensed under the BSD-style license found in the
  12887. * LICENSE file in the root directory of this source tree. An additional grant
  12888. * of patent rights can be found in the PATENTS file in the same directory.
  12889. *
  12890. * @providesModule ReactChildReconciler
  12891. */
  12892. 'use strict';
  12893. var ReactReconciler = __webpack_require__(61);
  12894. var instantiateReactComponent = __webpack_require__(123);
  12895. var KeyEscapeUtils = __webpack_require__(18);
  12896. var shouldUpdateReactComponent = __webpack_require__(127);
  12897. var traverseAllChildren = __webpack_require__(16);
  12898. var warning = __webpack_require__(13);
  12899. var ReactComponentTreeHook;
  12900. if (typeof process !== 'undefined' && process.env && process.env.NODE_ENV === 'test') {
  12901. // Temporary hack.
  12902. // Inline requires don't work well with Jest:
  12903. // https://github.com/facebook/react/issues/7240
  12904. // Remove the inline requires when we don't need them anymore:
  12905. // https://github.com/facebook/react/pull/7178
  12906. ReactComponentTreeHook = __webpack_require__(30);
  12907. }
  12908. function instantiateChild(childInstances, child, name, selfDebugID) {
  12909. // We found a component instance.
  12910. var keyUnique = childInstances[name] === undefined;
  12911. if (process.env.NODE_ENV !== 'production') {
  12912. if (!ReactComponentTreeHook) {
  12913. ReactComponentTreeHook = __webpack_require__(30);
  12914. }
  12915. if (!keyUnique) {
  12916. process.env.NODE_ENV !== 'production' ? warning(false, '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.%s', KeyEscapeUtils.unescape(name), ReactComponentTreeHook.getStackAddendumByID(selfDebugID)) : void 0;
  12917. }
  12918. }
  12919. if (child != null && keyUnique) {
  12920. childInstances[name] = instantiateReactComponent(child, true);
  12921. }
  12922. }
  12923. /**
  12924. * ReactChildReconciler provides helpers for initializing or updating a set of
  12925. * children. Its output is suitable for passing it onto ReactMultiChild which
  12926. * does diffed reordering and insertion.
  12927. */
  12928. var ReactChildReconciler = {
  12929. /**
  12930. * Generates a "mount image" for each of the supplied children. In the case
  12931. * of `ReactDOMComponent`, a mount image is a string of markup.
  12932. *
  12933. * @param {?object} nestedChildNodes Nested child maps.
  12934. * @return {?object} A set of child instances.
  12935. * @internal
  12936. */
  12937. instantiateChildren: function (nestedChildNodes, transaction, context, selfDebugID // 0 in production and for roots
  12938. ) {
  12939. if (nestedChildNodes == null) {
  12940. return null;
  12941. }
  12942. var childInstances = {};
  12943. if (process.env.NODE_ENV !== 'production') {
  12944. traverseAllChildren(nestedChildNodes, function (childInsts, child, name) {
  12945. return instantiateChild(childInsts, child, name, selfDebugID);
  12946. }, childInstances);
  12947. } else {
  12948. traverseAllChildren(nestedChildNodes, instantiateChild, childInstances);
  12949. }
  12950. return childInstances;
  12951. },
  12952. /**
  12953. * Updates the rendered children and returns a new set of children.
  12954. *
  12955. * @param {?object} prevChildren Previously initialized set of children.
  12956. * @param {?object} nextChildren Flat child element maps.
  12957. * @param {ReactReconcileTransaction} transaction
  12958. * @param {object} context
  12959. * @return {?object} A new set of child instances.
  12960. * @internal
  12961. */
  12962. updateChildren: function (prevChildren, nextChildren, mountImages, removedNodes, transaction, hostParent, hostContainerInfo, context, selfDebugID // 0 in production and for roots
  12963. ) {
  12964. // We currently don't have a way to track moves here but if we use iterators
  12965. // instead of for..in we can zip the iterators and check if an item has
  12966. // moved.
  12967. // TODO: If nothing has changed, return the prevChildren object so that we
  12968. // can quickly bailout if nothing has changed.
  12969. if (!nextChildren && !prevChildren) {
  12970. return;
  12971. }
  12972. var name;
  12973. var prevChild;
  12974. for (name in nextChildren) {
  12975. if (!nextChildren.hasOwnProperty(name)) {
  12976. continue;
  12977. }
  12978. prevChild = prevChildren && prevChildren[name];
  12979. var prevElement = prevChild && prevChild._currentElement;
  12980. var nextElement = nextChildren[name];
  12981. if (prevChild != null && shouldUpdateReactComponent(prevElement, nextElement)) {
  12982. ReactReconciler.receiveComponent(prevChild, nextElement, transaction, context);
  12983. nextChildren[name] = prevChild;
  12984. } else {
  12985. if (prevChild) {
  12986. removedNodes[name] = ReactReconciler.getHostNode(prevChild);
  12987. ReactReconciler.unmountComponent(prevChild, false);
  12988. }
  12989. // The child must be instantiated before it's mounted.
  12990. var nextChildInstance = instantiateReactComponent(nextElement, true);
  12991. nextChildren[name] = nextChildInstance;
  12992. // Creating mount image now ensures refs are resolved in right order
  12993. // (see https://github.com/facebook/react/pull/7101 for explanation).
  12994. var nextChildMountImage = ReactReconciler.mountComponent(nextChildInstance, transaction, hostParent, hostContainerInfo, context, selfDebugID);
  12995. mountImages.push(nextChildMountImage);
  12996. }
  12997. }
  12998. // Unmount children that are no longer present.
  12999. for (name in prevChildren) {
  13000. if (prevChildren.hasOwnProperty(name) && !(nextChildren && nextChildren.hasOwnProperty(name))) {
  13001. prevChild = prevChildren[name];
  13002. removedNodes[name] = ReactReconciler.getHostNode(prevChild);
  13003. ReactReconciler.unmountComponent(prevChild, false);
  13004. }
  13005. }
  13006. },
  13007. /**
  13008. * Unmounts all rendered children. This should be used to clean up children
  13009. * when this component is unmounted.
  13010. *
  13011. * @param {?object} renderedChildren Previously initialized set of children.
  13012. * @internal
  13013. */
  13014. unmountChildren: function (renderedChildren, safely) {
  13015. for (var name in renderedChildren) {
  13016. if (renderedChildren.hasOwnProperty(name)) {
  13017. var renderedChild = renderedChildren[name];
  13018. ReactReconciler.unmountComponent(renderedChild, safely);
  13019. }
  13020. }
  13021. }
  13022. };
  13023. module.exports = ReactChildReconciler;
  13024. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  13025. /***/ },
  13026. /* 123 */
  13027. /***/ function(module, exports, __webpack_require__) {
  13028. /* WEBPACK VAR INJECTION */(function(process) {/**
  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 instantiateReactComponent
  13037. */
  13038. 'use strict';
  13039. var _prodInvariant = __webpack_require__(9),
  13040. _assign = __webpack_require__(6);
  13041. var ReactCompositeComponent = __webpack_require__(124);
  13042. var ReactEmptyComponent = __webpack_require__(128);
  13043. var ReactHostComponent = __webpack_require__(129);
  13044. var invariant = __webpack_require__(10);
  13045. var warning = __webpack_require__(13);
  13046. // To avoid a cyclic dependency, we create the final class in this module
  13047. var ReactCompositeComponentWrapper = function (element) {
  13048. this.construct(element);
  13049. };
  13050. _assign(ReactCompositeComponentWrapper.prototype, ReactCompositeComponent.Mixin, {
  13051. _instantiateReactComponent: instantiateReactComponent
  13052. });
  13053. function getDeclarationErrorAddendum(owner) {
  13054. if (owner) {
  13055. var name = owner.getName();
  13056. if (name) {
  13057. return ' Check the render method of `' + name + '`.';
  13058. }
  13059. }
  13060. return '';
  13061. }
  13062. /**
  13063. * Check if the type reference is a known internal type. I.e. not a user
  13064. * provided composite type.
  13065. *
  13066. * @param {function} type
  13067. * @return {boolean} Returns true if this is a valid internal type.
  13068. */
  13069. function isInternalComponentType(type) {
  13070. return typeof type === 'function' && typeof type.prototype !== 'undefined' && typeof type.prototype.mountComponent === 'function' && typeof type.prototype.receiveComponent === 'function';
  13071. }
  13072. var nextDebugID = 1;
  13073. /**
  13074. * Given a ReactNode, create an instance that will actually be mounted.
  13075. *
  13076. * @param {ReactNode} node
  13077. * @param {boolean} shouldHaveDebugID
  13078. * @return {object} A new instance of the element's constructor.
  13079. * @protected
  13080. */
  13081. function instantiateReactComponent(node, shouldHaveDebugID) {
  13082. var instance;
  13083. if (node === null || node === false) {
  13084. instance = ReactEmptyComponent.create(instantiateReactComponent);
  13085. } else if (typeof node === 'object') {
  13086. var element = node;
  13087. !(element && (typeof element.type === 'function' || typeof element.type === 'string')) ? process.env.NODE_ENV !== 'production' ? 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)) : _prodInvariant('130', element.type == null ? element.type : typeof element.type, getDeclarationErrorAddendum(element._owner)) : void 0;
  13088. // Special case string values
  13089. if (typeof element.type === 'string') {
  13090. instance = ReactHostComponent.createInternalComponent(element);
  13091. } else if (isInternalComponentType(element.type)) {
  13092. // This is temporarily available for custom components that are not string
  13093. // representations. I.e. ART. Once those are updated to use the string
  13094. // representation, we can drop this code path.
  13095. instance = new element.type(element);
  13096. // We renamed this. Allow the old name for compat. :(
  13097. if (!instance.getHostNode) {
  13098. instance.getHostNode = instance.getNativeNode;
  13099. }
  13100. } else {
  13101. instance = new ReactCompositeComponentWrapper(element);
  13102. }
  13103. } else if (typeof node === 'string' || typeof node === 'number') {
  13104. instance = ReactHostComponent.createInstanceForText(node);
  13105. } else {
  13106. true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Encountered invalid React node of type %s', typeof node) : _prodInvariant('131', typeof node) : void 0;
  13107. }
  13108. if (process.env.NODE_ENV !== 'production') {
  13109. process.env.NODE_ENV !== 'production' ? warning(typeof instance.mountComponent === 'function' && typeof instance.receiveComponent === 'function' && typeof instance.getHostNode === 'function' && typeof instance.unmountComponent === 'function', 'Only React Components can be mounted.') : void 0;
  13110. }
  13111. // These two fields are used by the DOM and ART diffing algorithms
  13112. // respectively. Instead of using expandos on components, we should be
  13113. // storing the state needed by the diffing algorithms elsewhere.
  13114. instance._mountIndex = 0;
  13115. instance._mountImage = null;
  13116. if (process.env.NODE_ENV !== 'production') {
  13117. instance._debugID = shouldHaveDebugID ? nextDebugID++ : 0;
  13118. }
  13119. // Internal instances should fully constructed at this point, so they should
  13120. // not get any new fields added to them at this point.
  13121. if (process.env.NODE_ENV !== 'production') {
  13122. if (Object.preventExtensions) {
  13123. Object.preventExtensions(instance);
  13124. }
  13125. }
  13126. return instance;
  13127. }
  13128. module.exports = instantiateReactComponent;
  13129. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  13130. /***/ },
  13131. /* 124 */
  13132. /***/ function(module, exports, __webpack_require__) {
  13133. /* WEBPACK VAR INJECTION */(function(process) {/**
  13134. * Copyright 2013-present, Facebook, Inc.
  13135. * All rights reserved.
  13136. *
  13137. * This source code is licensed under the BSD-style license found in the
  13138. * LICENSE file in the root directory of this source tree. An additional grant
  13139. * of patent rights can be found in the PATENTS file in the same directory.
  13140. *
  13141. * @providesModule ReactCompositeComponent
  13142. */
  13143. 'use strict';
  13144. var _prodInvariant = __webpack_require__(9),
  13145. _assign = __webpack_require__(6);
  13146. var ReactComponentEnvironment = __webpack_require__(120);
  13147. var ReactCurrentOwner = __webpack_require__(12);
  13148. var ReactElement = __webpack_require__(11);
  13149. var ReactErrorUtils = __webpack_require__(48);
  13150. var ReactInstanceMap = __webpack_require__(121);
  13151. var ReactInstrumentation = __webpack_require__(64);
  13152. var ReactNodeTypes = __webpack_require__(125);
  13153. var ReactPropTypeLocations = __webpack_require__(24);
  13154. var ReactReconciler = __webpack_require__(61);
  13155. var checkReactTypeSpec = __webpack_require__(31);
  13156. var emptyObject = __webpack_require__(21);
  13157. var invariant = __webpack_require__(10);
  13158. var shallowEqual = __webpack_require__(126);
  13159. var shouldUpdateReactComponent = __webpack_require__(127);
  13160. var warning = __webpack_require__(13);
  13161. var CompositeTypes = {
  13162. ImpureClass: 0,
  13163. PureClass: 1,
  13164. StatelessFunctional: 2
  13165. };
  13166. function StatelessComponent(Component) {}
  13167. StatelessComponent.prototype.render = function () {
  13168. var Component = ReactInstanceMap.get(this)._currentElement.type;
  13169. var element = Component(this.props, this.context, this.updater);
  13170. warnIfInvalidElement(Component, element);
  13171. return element;
  13172. };
  13173. function warnIfInvalidElement(Component, element) {
  13174. if (process.env.NODE_ENV !== 'production') {
  13175. 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;
  13176. process.env.NODE_ENV !== 'production' ? warning(!Component.childContextTypes, '%s(...): childContextTypes cannot be defined on a functional component.', Component.displayName || Component.name || 'Component') : void 0;
  13177. }
  13178. }
  13179. function invokeComponentDidMountWithTimer() {
  13180. var publicInstance = this._instance;
  13181. if (this._debugID !== 0) {
  13182. ReactInstrumentation.debugTool.onBeginLifeCycleTimer(this._debugID, 'componentDidMount');
  13183. }
  13184. publicInstance.componentDidMount();
  13185. if (this._debugID !== 0) {
  13186. ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'componentDidMount');
  13187. }
  13188. }
  13189. function invokeComponentDidUpdateWithTimer(prevProps, prevState, prevContext) {
  13190. var publicInstance = this._instance;
  13191. if (this._debugID !== 0) {
  13192. ReactInstrumentation.debugTool.onBeginLifeCycleTimer(this._debugID, 'componentDidUpdate');
  13193. }
  13194. publicInstance.componentDidUpdate(prevProps, prevState, prevContext);
  13195. if (this._debugID !== 0) {
  13196. ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'componentDidUpdate');
  13197. }
  13198. }
  13199. function shouldConstruct(Component) {
  13200. return !!(Component.prototype && Component.prototype.isReactComponent);
  13201. }
  13202. function isPureComponent(Component) {
  13203. return !!(Component.prototype && Component.prototype.isPureReactComponent);
  13204. }
  13205. /**
  13206. * ------------------ The Life-Cycle of a Composite Component ------------------
  13207. *
  13208. * - constructor: Initialization of state. The instance is now retained.
  13209. * - componentWillMount
  13210. * - render
  13211. * - [children's constructors]
  13212. * - [children's componentWillMount and render]
  13213. * - [children's componentDidMount]
  13214. * - componentDidMount
  13215. *
  13216. * Update Phases:
  13217. * - componentWillReceiveProps (only called if parent updated)
  13218. * - shouldComponentUpdate
  13219. * - componentWillUpdate
  13220. * - render
  13221. * - [children's constructors or receive props phases]
  13222. * - componentDidUpdate
  13223. *
  13224. * - componentWillUnmount
  13225. * - [children's componentWillUnmount]
  13226. * - [children destroyed]
  13227. * - (destroyed): The instance is now blank, released by React and ready for GC.
  13228. *
  13229. * -----------------------------------------------------------------------------
  13230. */
  13231. /**
  13232. * An incrementing ID assigned to each component when it is mounted. This is
  13233. * used to enforce the order in which `ReactUpdates` updates dirty components.
  13234. *
  13235. * @private
  13236. */
  13237. var nextMountID = 1;
  13238. /**
  13239. * @lends {ReactCompositeComponent.prototype}
  13240. */
  13241. var ReactCompositeComponentMixin = {
  13242. /**
  13243. * Base constructor for all composite component.
  13244. *
  13245. * @param {ReactElement} element
  13246. * @final
  13247. * @internal
  13248. */
  13249. construct: function (element) {
  13250. this._currentElement = element;
  13251. this._rootNodeID = 0;
  13252. this._compositeType = null;
  13253. this._instance = null;
  13254. this._hostParent = null;
  13255. this._hostContainerInfo = null;
  13256. // See ReactUpdateQueue
  13257. this._updateBatchNumber = null;
  13258. this._pendingElement = null;
  13259. this._pendingStateQueue = null;
  13260. this._pendingReplaceState = false;
  13261. this._pendingForceUpdate = false;
  13262. this._renderedNodeType = null;
  13263. this._renderedComponent = null;
  13264. this._context = null;
  13265. this._mountOrder = 0;
  13266. this._topLevelWrapper = null;
  13267. // See ReactUpdates and ReactUpdateQueue.
  13268. this._pendingCallbacks = null;
  13269. // ComponentWillUnmount shall only be called once
  13270. this._calledComponentWillUnmount = false;
  13271. if (process.env.NODE_ENV !== 'production') {
  13272. this._warnedAboutRefsInRender = false;
  13273. }
  13274. },
  13275. /**
  13276. * Initializes the component, renders markup, and registers event listeners.
  13277. *
  13278. * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
  13279. * @param {?object} hostParent
  13280. * @param {?object} hostContainerInfo
  13281. * @param {?object} context
  13282. * @return {?string} Rendered markup to be inserted into the DOM.
  13283. * @final
  13284. * @internal
  13285. */
  13286. mountComponent: function (transaction, hostParent, hostContainerInfo, context) {
  13287. this._context = context;
  13288. this._mountOrder = nextMountID++;
  13289. this._hostParent = hostParent;
  13290. this._hostContainerInfo = hostContainerInfo;
  13291. var publicProps = this._currentElement.props;
  13292. var publicContext = this._processContext(context);
  13293. var Component = this._currentElement.type;
  13294. var updateQueue = transaction.getUpdateQueue();
  13295. // Initialize the public class
  13296. var doConstruct = shouldConstruct(Component);
  13297. var inst = this._constructComponent(doConstruct, publicProps, publicContext, updateQueue);
  13298. var renderedElement;
  13299. // Support functional components
  13300. if (!doConstruct && (inst == null || inst.render == null)) {
  13301. renderedElement = inst;
  13302. warnIfInvalidElement(Component, renderedElement);
  13303. !(inst === null || inst === false || ReactElement.isValidElement(inst)) ? process.env.NODE_ENV !== 'production' ? 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') : _prodInvariant('105', Component.displayName || Component.name || 'Component') : void 0;
  13304. inst = new StatelessComponent(Component);
  13305. this._compositeType = CompositeTypes.StatelessFunctional;
  13306. } else {
  13307. if (isPureComponent(Component)) {
  13308. this._compositeType = CompositeTypes.PureClass;
  13309. } else {
  13310. this._compositeType = CompositeTypes.ImpureClass;
  13311. }
  13312. }
  13313. if (process.env.NODE_ENV !== 'production') {
  13314. // This will throw later in _renderValidatedComponent, but add an early
  13315. // warning now to help debugging
  13316. if (inst.render == null) {
  13317. 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;
  13318. }
  13319. var propsMutated = inst.props !== publicProps;
  13320. var componentName = Component.displayName || Component.name || 'Component';
  13321. 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;
  13322. }
  13323. // These should be set up in the constructor, but as a convenience for
  13324. // simpler class abstractions, we set them up after the fact.
  13325. inst.props = publicProps;
  13326. inst.context = publicContext;
  13327. inst.refs = emptyObject;
  13328. inst.updater = updateQueue;
  13329. this._instance = inst;
  13330. // Store a reference from the instance back to the internal representation
  13331. ReactInstanceMap.set(inst, this);
  13332. if (process.env.NODE_ENV !== 'production') {
  13333. // Since plain JS classes are defined without any special initialization
  13334. // logic, we can not catch common errors early. Therefore, we have to
  13335. // catch them here, at initialization time, instead.
  13336. 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;
  13337. 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;
  13338. 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;
  13339. 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;
  13340. 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;
  13341. 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;
  13342. 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;
  13343. }
  13344. var initialState = inst.state;
  13345. if (initialState === undefined) {
  13346. inst.state = initialState = null;
  13347. }
  13348. !(typeof initialState === 'object' && !Array.isArray(initialState)) ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s.state: must be set to an object or null', this.getName() || 'ReactCompositeComponent') : _prodInvariant('106', this.getName() || 'ReactCompositeComponent') : void 0;
  13349. this._pendingStateQueue = null;
  13350. this._pendingReplaceState = false;
  13351. this._pendingForceUpdate = false;
  13352. var markup;
  13353. if (inst.unstable_handleError) {
  13354. markup = this.performInitialMountWithErrorHandling(renderedElement, hostParent, hostContainerInfo, transaction, context);
  13355. } else {
  13356. markup = this.performInitialMount(renderedElement, hostParent, hostContainerInfo, transaction, context);
  13357. }
  13358. if (inst.componentDidMount) {
  13359. if (process.env.NODE_ENV !== 'production') {
  13360. transaction.getReactMountReady().enqueue(invokeComponentDidMountWithTimer, this);
  13361. } else {
  13362. transaction.getReactMountReady().enqueue(inst.componentDidMount, inst);
  13363. }
  13364. }
  13365. return markup;
  13366. },
  13367. _constructComponent: function (doConstruct, publicProps, publicContext, updateQueue) {
  13368. if (process.env.NODE_ENV !== 'production') {
  13369. ReactCurrentOwner.current = this;
  13370. try {
  13371. return this._constructComponentWithoutOwner(doConstruct, publicProps, publicContext, updateQueue);
  13372. } finally {
  13373. ReactCurrentOwner.current = null;
  13374. }
  13375. } else {
  13376. return this._constructComponentWithoutOwner(doConstruct, publicProps, publicContext, updateQueue);
  13377. }
  13378. },
  13379. _constructComponentWithoutOwner: function (doConstruct, publicProps, publicContext, updateQueue) {
  13380. var Component = this._currentElement.type;
  13381. var instanceOrElement;
  13382. if (doConstruct) {
  13383. if (process.env.NODE_ENV !== 'production') {
  13384. if (this._debugID !== 0) {
  13385. ReactInstrumentation.debugTool.onBeginLifeCycleTimer(this._debugID, 'ctor');
  13386. }
  13387. }
  13388. instanceOrElement = new Component(publicProps, publicContext, updateQueue);
  13389. if (process.env.NODE_ENV !== 'production') {
  13390. if (this._debugID !== 0) {
  13391. ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'ctor');
  13392. }
  13393. }
  13394. } else {
  13395. // This can still be an instance in case of factory components
  13396. // but we'll count this as time spent rendering as the more common case.
  13397. if (process.env.NODE_ENV !== 'production') {
  13398. if (this._debugID !== 0) {
  13399. ReactInstrumentation.debugTool.onBeginLifeCycleTimer(this._debugID, 'render');
  13400. }
  13401. }
  13402. instanceOrElement = Component(publicProps, publicContext, updateQueue);
  13403. if (process.env.NODE_ENV !== 'production') {
  13404. if (this._debugID !== 0) {
  13405. ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'render');
  13406. }
  13407. }
  13408. }
  13409. return instanceOrElement;
  13410. },
  13411. performInitialMountWithErrorHandling: function (renderedElement, hostParent, hostContainerInfo, transaction, context) {
  13412. var markup;
  13413. var checkpoint = transaction.checkpoint();
  13414. try {
  13415. markup = this.performInitialMount(renderedElement, hostParent, hostContainerInfo, transaction, context);
  13416. } catch (e) {
  13417. if (process.env.NODE_ENV !== 'production') {
  13418. if (this._debugID !== 0) {
  13419. ReactInstrumentation.debugTool.onError();
  13420. }
  13421. }
  13422. // Roll back to checkpoint, handle error (which may add items to the transaction), and take a new checkpoint
  13423. transaction.rollback(checkpoint);
  13424. this._instance.unstable_handleError(e);
  13425. if (this._pendingStateQueue) {
  13426. this._instance.state = this._processPendingState(this._instance.props, this._instance.context);
  13427. }
  13428. checkpoint = transaction.checkpoint();
  13429. this._renderedComponent.unmountComponent(true);
  13430. transaction.rollback(checkpoint);
  13431. // Try again - we've informed the component about the error, so they can render an error message this time.
  13432. // If this throws again, the error will bubble up (and can be caught by a higher error boundary).
  13433. markup = this.performInitialMount(renderedElement, hostParent, hostContainerInfo, transaction, context);
  13434. }
  13435. return markup;
  13436. },
  13437. performInitialMount: function (renderedElement, hostParent, hostContainerInfo, transaction, context) {
  13438. var inst = this._instance;
  13439. if (inst.componentWillMount) {
  13440. if (process.env.NODE_ENV !== 'production') {
  13441. if (this._debugID !== 0) {
  13442. ReactInstrumentation.debugTool.onBeginLifeCycleTimer(this._debugID, 'componentWillMount');
  13443. }
  13444. }
  13445. inst.componentWillMount();
  13446. if (process.env.NODE_ENV !== 'production') {
  13447. if (this._debugID !== 0) {
  13448. ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'componentWillMount');
  13449. }
  13450. }
  13451. // When mounting, calls to `setState` by `componentWillMount` will set
  13452. // `this._pendingStateQueue` without triggering a re-render.
  13453. if (this._pendingStateQueue) {
  13454. inst.state = this._processPendingState(inst.props, inst.context);
  13455. }
  13456. }
  13457. // If not a stateless component, we now render
  13458. if (renderedElement === undefined) {
  13459. renderedElement = this._renderValidatedComponent();
  13460. }
  13461. var nodeType = ReactNodeTypes.getType(renderedElement);
  13462. this._renderedNodeType = nodeType;
  13463. var child = this._instantiateReactComponent(renderedElement, nodeType !== ReactNodeTypes.EMPTY /* shouldHaveDebugID */
  13464. );
  13465. this._renderedComponent = child;
  13466. var selfDebugID = 0;
  13467. if (process.env.NODE_ENV !== 'production') {
  13468. selfDebugID = this._debugID;
  13469. }
  13470. var markup = ReactReconciler.mountComponent(child, transaction, hostParent, hostContainerInfo, this._processChildContext(context), selfDebugID);
  13471. if (process.env.NODE_ENV !== 'production') {
  13472. if (this._debugID !== 0) {
  13473. ReactInstrumentation.debugTool.onSetChildren(this._debugID, child._debugID !== 0 ? [child._debugID] : []);
  13474. }
  13475. }
  13476. return markup;
  13477. },
  13478. getHostNode: function () {
  13479. return ReactReconciler.getHostNode(this._renderedComponent);
  13480. },
  13481. /**
  13482. * Releases any resources allocated by `mountComponent`.
  13483. *
  13484. * @final
  13485. * @internal
  13486. */
  13487. unmountComponent: function (safely) {
  13488. if (!this._renderedComponent) {
  13489. return;
  13490. }
  13491. var inst = this._instance;
  13492. if (inst.componentWillUnmount && !inst._calledComponentWillUnmount) {
  13493. inst._calledComponentWillUnmount = true;
  13494. if (process.env.NODE_ENV !== 'production') {
  13495. if (this._debugID !== 0) {
  13496. ReactInstrumentation.debugTool.onBeginLifeCycleTimer(this._debugID, 'componentWillUnmount');
  13497. }
  13498. }
  13499. if (safely) {
  13500. var name = this.getName() + '.componentWillUnmount()';
  13501. ReactErrorUtils.invokeGuardedCallback(name, inst.componentWillUnmount.bind(inst));
  13502. } else {
  13503. inst.componentWillUnmount();
  13504. }
  13505. if (process.env.NODE_ENV !== 'production') {
  13506. if (this._debugID !== 0) {
  13507. ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'componentWillUnmount');
  13508. }
  13509. }
  13510. }
  13511. if (this._renderedComponent) {
  13512. ReactReconciler.unmountComponent(this._renderedComponent, safely);
  13513. this._renderedNodeType = null;
  13514. this._renderedComponent = null;
  13515. this._instance = null;
  13516. }
  13517. // Reset pending fields
  13518. // Even if this component is scheduled for another update in ReactUpdates,
  13519. // it would still be ignored because these fields are reset.
  13520. this._pendingStateQueue = null;
  13521. this._pendingReplaceState = false;
  13522. this._pendingForceUpdate = false;
  13523. this._pendingCallbacks = null;
  13524. this._pendingElement = null;
  13525. // These fields do not really need to be reset since this object is no
  13526. // longer accessible.
  13527. this._context = null;
  13528. this._rootNodeID = 0;
  13529. this._topLevelWrapper = null;
  13530. // Delete the reference from the instance to this internal representation
  13531. // which allow the internals to be properly cleaned up even if the user
  13532. // leaks a reference to the public instance.
  13533. ReactInstanceMap.remove(inst);
  13534. // Some existing components rely on inst.props even after they've been
  13535. // destroyed (in event handlers).
  13536. // TODO: inst.props = null;
  13537. // TODO: inst.state = null;
  13538. // TODO: inst.context = null;
  13539. },
  13540. /**
  13541. * Filters the context object to only contain keys specified in
  13542. * `contextTypes`
  13543. *
  13544. * @param {object} context
  13545. * @return {?object}
  13546. * @private
  13547. */
  13548. _maskContext: function (context) {
  13549. var Component = this._currentElement.type;
  13550. var contextTypes = Component.contextTypes;
  13551. if (!contextTypes) {
  13552. return emptyObject;
  13553. }
  13554. var maskedContext = {};
  13555. for (var contextName in contextTypes) {
  13556. maskedContext[contextName] = context[contextName];
  13557. }
  13558. return maskedContext;
  13559. },
  13560. /**
  13561. * Filters the context object to only contain keys specified in
  13562. * `contextTypes`, and asserts that they are valid.
  13563. *
  13564. * @param {object} context
  13565. * @return {?object}
  13566. * @private
  13567. */
  13568. _processContext: function (context) {
  13569. var maskedContext = this._maskContext(context);
  13570. if (process.env.NODE_ENV !== 'production') {
  13571. var Component = this._currentElement.type;
  13572. if (Component.contextTypes) {
  13573. this._checkContextTypes(Component.contextTypes, maskedContext, ReactPropTypeLocations.context);
  13574. }
  13575. }
  13576. return maskedContext;
  13577. },
  13578. /**
  13579. * @param {object} currentContext
  13580. * @return {object}
  13581. * @private
  13582. */
  13583. _processChildContext: function (currentContext) {
  13584. var Component = this._currentElement.type;
  13585. var inst = this._instance;
  13586. if (process.env.NODE_ENV !== 'production') {
  13587. ReactInstrumentation.debugTool.onBeginProcessingChildContext();
  13588. }
  13589. var childContext = inst.getChildContext && inst.getChildContext();
  13590. if (process.env.NODE_ENV !== 'production') {
  13591. ReactInstrumentation.debugTool.onEndProcessingChildContext();
  13592. }
  13593. if (childContext) {
  13594. !(typeof Component.childContextTypes === 'object') ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s.getChildContext(): childContextTypes must be defined in order to use getChildContext().', this.getName() || 'ReactCompositeComponent') : _prodInvariant('107', this.getName() || 'ReactCompositeComponent') : void 0;
  13595. if (process.env.NODE_ENV !== 'production') {
  13596. this._checkContextTypes(Component.childContextTypes, childContext, ReactPropTypeLocations.childContext);
  13597. }
  13598. for (var name in childContext) {
  13599. !(name in Component.childContextTypes) ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s.getChildContext(): key "%s" is not defined in childContextTypes.', this.getName() || 'ReactCompositeComponent', name) : _prodInvariant('108', this.getName() || 'ReactCompositeComponent', name) : void 0;
  13600. }
  13601. return _assign({}, currentContext, childContext);
  13602. }
  13603. return currentContext;
  13604. },
  13605. /**
  13606. * Assert that the context types are valid
  13607. *
  13608. * @param {object} typeSpecs Map of context field to a ReactPropType
  13609. * @param {object} values Runtime values that need to be type-checked
  13610. * @param {string} location e.g. "prop", "context", "child context"
  13611. * @private
  13612. */
  13613. _checkContextTypes: function (typeSpecs, values, location) {
  13614. checkReactTypeSpec(typeSpecs, values, location, this.getName(), null, this._debugID);
  13615. },
  13616. receiveComponent: function (nextElement, transaction, nextContext) {
  13617. var prevElement = this._currentElement;
  13618. var prevContext = this._context;
  13619. this._pendingElement = null;
  13620. this.updateComponent(transaction, prevElement, nextElement, prevContext, nextContext);
  13621. },
  13622. /**
  13623. * If any of `_pendingElement`, `_pendingStateQueue`, or `_pendingForceUpdate`
  13624. * is set, update the component.
  13625. *
  13626. * @param {ReactReconcileTransaction} transaction
  13627. * @internal
  13628. */
  13629. performUpdateIfNecessary: function (transaction) {
  13630. if (this._pendingElement != null) {
  13631. ReactReconciler.receiveComponent(this, this._pendingElement, transaction, this._context);
  13632. } else if (this._pendingStateQueue !== null || this._pendingForceUpdate) {
  13633. this.updateComponent(transaction, this._currentElement, this._currentElement, this._context, this._context);
  13634. } else {
  13635. this._updateBatchNumber = null;
  13636. }
  13637. },
  13638. /**
  13639. * Perform an update to a mounted component. The componentWillReceiveProps and
  13640. * shouldComponentUpdate methods are called, then (assuming the update isn't
  13641. * skipped) the remaining update lifecycle methods are called and the DOM
  13642. * representation is updated.
  13643. *
  13644. * By default, this implements React's rendering and reconciliation algorithm.
  13645. * Sophisticated clients may wish to override this.
  13646. *
  13647. * @param {ReactReconcileTransaction} transaction
  13648. * @param {ReactElement} prevParentElement
  13649. * @param {ReactElement} nextParentElement
  13650. * @internal
  13651. * @overridable
  13652. */
  13653. updateComponent: function (transaction, prevParentElement, nextParentElement, prevUnmaskedContext, nextUnmaskedContext) {
  13654. var inst = this._instance;
  13655. !(inst != null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Attempted to update component `%s` that has already been unmounted (or failed to mount).', this.getName() || 'ReactCompositeComponent') : _prodInvariant('136', this.getName() || 'ReactCompositeComponent') : void 0;
  13656. var willReceive = false;
  13657. var nextContext;
  13658. // Determine if the context has changed or not
  13659. if (this._context === nextUnmaskedContext) {
  13660. nextContext = inst.context;
  13661. } else {
  13662. nextContext = this._processContext(nextUnmaskedContext);
  13663. willReceive = true;
  13664. }
  13665. var prevProps = prevParentElement.props;
  13666. var nextProps = nextParentElement.props;
  13667. // Not a simple state update but a props update
  13668. if (prevParentElement !== nextParentElement) {
  13669. willReceive = true;
  13670. }
  13671. // An update here will schedule an update but immediately set
  13672. // _pendingStateQueue which will ensure that any state updates gets
  13673. // immediately reconciled instead of waiting for the next batch.
  13674. if (willReceive && inst.componentWillReceiveProps) {
  13675. if (process.env.NODE_ENV !== 'production') {
  13676. if (this._debugID !== 0) {
  13677. ReactInstrumentation.debugTool.onBeginLifeCycleTimer(this._debugID, 'componentWillReceiveProps');
  13678. }
  13679. }
  13680. inst.componentWillReceiveProps(nextProps, nextContext);
  13681. if (process.env.NODE_ENV !== 'production') {
  13682. if (this._debugID !== 0) {
  13683. ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'componentWillReceiveProps');
  13684. }
  13685. }
  13686. }
  13687. var nextState = this._processPendingState(nextProps, nextContext);
  13688. var shouldUpdate = true;
  13689. if (!this._pendingForceUpdate) {
  13690. if (inst.shouldComponentUpdate) {
  13691. if (process.env.NODE_ENV !== 'production') {
  13692. if (this._debugID !== 0) {
  13693. ReactInstrumentation.debugTool.onBeginLifeCycleTimer(this._debugID, 'shouldComponentUpdate');
  13694. }
  13695. }
  13696. shouldUpdate = inst.shouldComponentUpdate(nextProps, nextState, nextContext);
  13697. if (process.env.NODE_ENV !== 'production') {
  13698. if (this._debugID !== 0) {
  13699. ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'shouldComponentUpdate');
  13700. }
  13701. }
  13702. } else {
  13703. if (this._compositeType === CompositeTypes.PureClass) {
  13704. shouldUpdate = !shallowEqual(prevProps, nextProps) || !shallowEqual(inst.state, nextState);
  13705. }
  13706. }
  13707. }
  13708. if (process.env.NODE_ENV !== 'production') {
  13709. 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;
  13710. }
  13711. this._updateBatchNumber = null;
  13712. if (shouldUpdate) {
  13713. this._pendingForceUpdate = false;
  13714. // Will set `this.props`, `this.state` and `this.context`.
  13715. this._performComponentUpdate(nextParentElement, nextProps, nextState, nextContext, transaction, nextUnmaskedContext);
  13716. } else {
  13717. // If it's determined that a component should not update, we still want
  13718. // to set props and state but we shortcut the rest of the update.
  13719. this._currentElement = nextParentElement;
  13720. this._context = nextUnmaskedContext;
  13721. inst.props = nextProps;
  13722. inst.state = nextState;
  13723. inst.context = nextContext;
  13724. }
  13725. },
  13726. _processPendingState: function (props, context) {
  13727. var inst = this._instance;
  13728. var queue = this._pendingStateQueue;
  13729. var replace = this._pendingReplaceState;
  13730. this._pendingReplaceState = false;
  13731. this._pendingStateQueue = null;
  13732. if (!queue) {
  13733. return inst.state;
  13734. }
  13735. if (replace && queue.length === 1) {
  13736. return queue[0];
  13737. }
  13738. var nextState = _assign({}, replace ? queue[0] : inst.state);
  13739. for (var i = replace ? 1 : 0; i < queue.length; i++) {
  13740. var partial = queue[i];
  13741. _assign(nextState, typeof partial === 'function' ? partial.call(inst, nextState, props, context) : partial);
  13742. }
  13743. return nextState;
  13744. },
  13745. /**
  13746. * Merges new props and state, notifies delegate methods of update and
  13747. * performs update.
  13748. *
  13749. * @param {ReactElement} nextElement Next element
  13750. * @param {object} nextProps Next public object to set as properties.
  13751. * @param {?object} nextState Next object to set as state.
  13752. * @param {?object} nextContext Next public object to set as context.
  13753. * @param {ReactReconcileTransaction} transaction
  13754. * @param {?object} unmaskedContext
  13755. * @private
  13756. */
  13757. _performComponentUpdate: function (nextElement, nextProps, nextState, nextContext, transaction, unmaskedContext) {
  13758. var inst = this._instance;
  13759. var hasComponentDidUpdate = Boolean(inst.componentDidUpdate);
  13760. var prevProps;
  13761. var prevState;
  13762. var prevContext;
  13763. if (hasComponentDidUpdate) {
  13764. prevProps = inst.props;
  13765. prevState = inst.state;
  13766. prevContext = inst.context;
  13767. }
  13768. if (inst.componentWillUpdate) {
  13769. if (process.env.NODE_ENV !== 'production') {
  13770. if (this._debugID !== 0) {
  13771. ReactInstrumentation.debugTool.onBeginLifeCycleTimer(this._debugID, 'componentWillUpdate');
  13772. }
  13773. }
  13774. inst.componentWillUpdate(nextProps, nextState, nextContext);
  13775. if (process.env.NODE_ENV !== 'production') {
  13776. if (this._debugID !== 0) {
  13777. ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'componentWillUpdate');
  13778. }
  13779. }
  13780. }
  13781. this._currentElement = nextElement;
  13782. this._context = unmaskedContext;
  13783. inst.props = nextProps;
  13784. inst.state = nextState;
  13785. inst.context = nextContext;
  13786. this._updateRenderedComponent(transaction, unmaskedContext);
  13787. if (hasComponentDidUpdate) {
  13788. if (process.env.NODE_ENV !== 'production') {
  13789. transaction.getReactMountReady().enqueue(invokeComponentDidUpdateWithTimer.bind(this, prevProps, prevState, prevContext), this);
  13790. } else {
  13791. transaction.getReactMountReady().enqueue(inst.componentDidUpdate.bind(inst, prevProps, prevState, prevContext), inst);
  13792. }
  13793. }
  13794. },
  13795. /**
  13796. * Call the component's `render` method and update the DOM accordingly.
  13797. *
  13798. * @param {ReactReconcileTransaction} transaction
  13799. * @internal
  13800. */
  13801. _updateRenderedComponent: function (transaction, context) {
  13802. var prevComponentInstance = this._renderedComponent;
  13803. var prevRenderedElement = prevComponentInstance._currentElement;
  13804. var nextRenderedElement = this._renderValidatedComponent();
  13805. if (shouldUpdateReactComponent(prevRenderedElement, nextRenderedElement)) {
  13806. ReactReconciler.receiveComponent(prevComponentInstance, nextRenderedElement, transaction, this._processChildContext(context));
  13807. } else {
  13808. var oldHostNode = ReactReconciler.getHostNode(prevComponentInstance);
  13809. ReactReconciler.unmountComponent(prevComponentInstance, false);
  13810. var nodeType = ReactNodeTypes.getType(nextRenderedElement);
  13811. this._renderedNodeType = nodeType;
  13812. var child = this._instantiateReactComponent(nextRenderedElement, nodeType !== ReactNodeTypes.EMPTY /* shouldHaveDebugID */
  13813. );
  13814. this._renderedComponent = child;
  13815. var selfDebugID = 0;
  13816. if (process.env.NODE_ENV !== 'production') {
  13817. selfDebugID = this._debugID;
  13818. }
  13819. var nextMarkup = ReactReconciler.mountComponent(child, transaction, this._hostParent, this._hostContainerInfo, this._processChildContext(context), selfDebugID);
  13820. if (process.env.NODE_ENV !== 'production') {
  13821. if (this._debugID !== 0) {
  13822. ReactInstrumentation.debugTool.onSetChildren(this._debugID, child._debugID !== 0 ? [child._debugID] : []);
  13823. }
  13824. }
  13825. this._replaceNodeWithMarkup(oldHostNode, nextMarkup, prevComponentInstance);
  13826. }
  13827. },
  13828. /**
  13829. * Overridden in shallow rendering.
  13830. *
  13831. * @protected
  13832. */
  13833. _replaceNodeWithMarkup: function (oldHostNode, nextMarkup, prevInstance) {
  13834. ReactComponentEnvironment.replaceNodeWithMarkup(oldHostNode, nextMarkup, prevInstance);
  13835. },
  13836. /**
  13837. * @protected
  13838. */
  13839. _renderValidatedComponentWithoutOwnerOrContext: function () {
  13840. var inst = this._instance;
  13841. if (process.env.NODE_ENV !== 'production') {
  13842. if (this._debugID !== 0) {
  13843. ReactInstrumentation.debugTool.onBeginLifeCycleTimer(this._debugID, 'render');
  13844. }
  13845. }
  13846. var renderedComponent = inst.render();
  13847. if (process.env.NODE_ENV !== 'production') {
  13848. if (this._debugID !== 0) {
  13849. ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'render');
  13850. }
  13851. }
  13852. if (process.env.NODE_ENV !== 'production') {
  13853. // We allow auto-mocks to proceed as if they're returning null.
  13854. if (renderedComponent === undefined && inst.render._isMockFunction) {
  13855. // This is probably bad practice. Consider warning here and
  13856. // deprecating this convenience.
  13857. renderedComponent = null;
  13858. }
  13859. }
  13860. return renderedComponent;
  13861. },
  13862. /**
  13863. * @private
  13864. */
  13865. _renderValidatedComponent: function () {
  13866. var renderedComponent;
  13867. if (process.env.NODE_ENV !== 'production' || this._compositeType !== CompositeTypes.StatelessFunctional) {
  13868. ReactCurrentOwner.current = this;
  13869. try {
  13870. renderedComponent = this._renderValidatedComponentWithoutOwnerOrContext();
  13871. } finally {
  13872. ReactCurrentOwner.current = null;
  13873. }
  13874. } else {
  13875. renderedComponent = this._renderValidatedComponentWithoutOwnerOrContext();
  13876. }
  13877. !(
  13878. // TODO: An `isValidNode` function would probably be more appropriate
  13879. renderedComponent === null || renderedComponent === false || ReactElement.isValidElement(renderedComponent)) ? process.env.NODE_ENV !== 'production' ? 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') : _prodInvariant('109', this.getName() || 'ReactCompositeComponent') : void 0;
  13880. return renderedComponent;
  13881. },
  13882. /**
  13883. * Lazily allocates the refs object and stores `component` as `ref`.
  13884. *
  13885. * @param {string} ref Reference name.
  13886. * @param {component} component Component to store as `ref`.
  13887. * @final
  13888. * @private
  13889. */
  13890. attachRef: function (ref, component) {
  13891. var inst = this.getPublicInstance();
  13892. !(inst != null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Stateless function components cannot have refs.') : _prodInvariant('110') : void 0;
  13893. var publicComponentInstance = component.getPublicInstance();
  13894. if (process.env.NODE_ENV !== 'production') {
  13895. var componentName = component && component.getName ? component.getName() : 'a component';
  13896. 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;
  13897. }
  13898. var refs = inst.refs === emptyObject ? inst.refs = {} : inst.refs;
  13899. refs[ref] = publicComponentInstance;
  13900. },
  13901. /**
  13902. * Detaches a reference name.
  13903. *
  13904. * @param {string} ref Name to dereference.
  13905. * @final
  13906. * @private
  13907. */
  13908. detachRef: function (ref) {
  13909. var refs = this.getPublicInstance().refs;
  13910. delete refs[ref];
  13911. },
  13912. /**
  13913. * Get a text description of the component that can be used to identify it
  13914. * in error messages.
  13915. * @return {string} The name or null.
  13916. * @internal
  13917. */
  13918. getName: function () {
  13919. var type = this._currentElement.type;
  13920. var constructor = this._instance && this._instance.constructor;
  13921. return type.displayName || constructor && constructor.displayName || type.name || constructor && constructor.name || null;
  13922. },
  13923. /**
  13924. * Get the publicly accessible representation of this component - i.e. what
  13925. * is exposed by refs and returned by render. Can be null for stateless
  13926. * components.
  13927. *
  13928. * @return {ReactComponent} the public component instance.
  13929. * @internal
  13930. */
  13931. getPublicInstance: function () {
  13932. var inst = this._instance;
  13933. if (this._compositeType === CompositeTypes.StatelessFunctional) {
  13934. return null;
  13935. }
  13936. return inst;
  13937. },
  13938. // Stub
  13939. _instantiateReactComponent: null
  13940. };
  13941. var ReactCompositeComponent = {
  13942. Mixin: ReactCompositeComponentMixin
  13943. };
  13944. module.exports = ReactCompositeComponent;
  13945. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  13946. /***/ },
  13947. /* 125 */
  13948. /***/ function(module, exports, __webpack_require__) {
  13949. /* WEBPACK VAR INJECTION */(function(process) {/**
  13950. * Copyright 2013-present, Facebook, Inc.
  13951. * All rights reserved.
  13952. *
  13953. * This source code is licensed under the BSD-style license found in the
  13954. * LICENSE file in the root directory of this source tree. An additional grant
  13955. * of patent rights can be found in the PATENTS file in the same directory.
  13956. *
  13957. * @providesModule ReactNodeTypes
  13958. *
  13959. */
  13960. 'use strict';
  13961. var _prodInvariant = __webpack_require__(9);
  13962. var ReactElement = __webpack_require__(11);
  13963. var invariant = __webpack_require__(10);
  13964. var ReactNodeTypes = {
  13965. HOST: 0,
  13966. COMPOSITE: 1,
  13967. EMPTY: 2,
  13968. getType: function (node) {
  13969. if (node === null || node === false) {
  13970. return ReactNodeTypes.EMPTY;
  13971. } else if (ReactElement.isValidElement(node)) {
  13972. if (typeof node.type === 'function') {
  13973. return ReactNodeTypes.COMPOSITE;
  13974. } else {
  13975. return ReactNodeTypes.HOST;
  13976. }
  13977. }
  13978. true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unexpected node: %s', node) : _prodInvariant('26', node) : void 0;
  13979. }
  13980. };
  13981. module.exports = ReactNodeTypes;
  13982. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  13983. /***/ },
  13984. /* 126 */
  13985. /***/ function(module, exports) {
  13986. /**
  13987. * Copyright (c) 2013-present, Facebook, Inc.
  13988. * All rights reserved.
  13989. *
  13990. * This source code is licensed under the BSD-style license found in the
  13991. * LICENSE file in the root directory of this source tree. An additional grant
  13992. * of patent rights can be found in the PATENTS file in the same directory.
  13993. *
  13994. * @typechecks
  13995. *
  13996. */
  13997. /*eslint-disable no-self-compare */
  13998. 'use strict';
  13999. var hasOwnProperty = Object.prototype.hasOwnProperty;
  14000. /**
  14001. * inlined Object.is polyfill to avoid requiring consumers ship their own
  14002. * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
  14003. */
  14004. function is(x, y) {
  14005. // SameValue algorithm
  14006. if (x === y) {
  14007. // Steps 1-5, 7-10
  14008. // Steps 6.b-6.e: +0 != -0
  14009. return x !== 0 || 1 / x === 1 / y;
  14010. } else {
  14011. // Step 6.a: NaN == NaN
  14012. return x !== x && y !== y;
  14013. }
  14014. }
  14015. /**
  14016. * Performs equality by iterating through keys on an object and returning false
  14017. * when any key has values which are not strictly equal between the arguments.
  14018. * Returns true when the values of all keys are strictly equal.
  14019. */
  14020. function shallowEqual(objA, objB) {
  14021. if (is(objA, objB)) {
  14022. return true;
  14023. }
  14024. if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {
  14025. return false;
  14026. }
  14027. var keysA = Object.keys(objA);
  14028. var keysB = Object.keys(objB);
  14029. if (keysA.length !== keysB.length) {
  14030. return false;
  14031. }
  14032. // Test for A's keys different from B.
  14033. for (var i = 0; i < keysA.length; i++) {
  14034. if (!hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {
  14035. return false;
  14036. }
  14037. }
  14038. return true;
  14039. }
  14040. module.exports = shallowEqual;
  14041. /***/ },
  14042. /* 127 */
  14043. /***/ function(module, exports) {
  14044. /**
  14045. * Copyright 2013-present, Facebook, Inc.
  14046. * All rights reserved.
  14047. *
  14048. * This source code is licensed under the BSD-style license found in the
  14049. * LICENSE file in the root directory of this source tree. An additional grant
  14050. * of patent rights can be found in the PATENTS file in the same directory.
  14051. *
  14052. * @providesModule shouldUpdateReactComponent
  14053. */
  14054. 'use strict';
  14055. /**
  14056. * Given a `prevElement` and `nextElement`, determines if the existing
  14057. * instance should be updated as opposed to being destroyed or replaced by a new
  14058. * instance. Both arguments are elements. This ensures that this logic can
  14059. * operate on stateless trees without any backing instance.
  14060. *
  14061. * @param {?object} prevElement
  14062. * @param {?object} nextElement
  14063. * @return {boolean} True if the existing instance should be updated.
  14064. * @protected
  14065. */
  14066. function shouldUpdateReactComponent(prevElement, nextElement) {
  14067. var prevEmpty = prevElement === null || prevElement === false;
  14068. var nextEmpty = nextElement === null || nextElement === false;
  14069. if (prevEmpty || nextEmpty) {
  14070. return prevEmpty === nextEmpty;
  14071. }
  14072. var prevType = typeof prevElement;
  14073. var nextType = typeof nextElement;
  14074. if (prevType === 'string' || prevType === 'number') {
  14075. return nextType === 'string' || nextType === 'number';
  14076. } else {
  14077. return nextType === 'object' && prevElement.type === nextElement.type && prevElement.key === nextElement.key;
  14078. }
  14079. }
  14080. module.exports = shouldUpdateReactComponent;
  14081. /***/ },
  14082. /* 128 */
  14083. /***/ function(module, exports) {
  14084. /**
  14085. * Copyright 2014-present, Facebook, Inc.
  14086. * All rights reserved.
  14087. *
  14088. * This source code is licensed under the BSD-style license found in the
  14089. * LICENSE file in the root directory of this source tree. An additional grant
  14090. * of patent rights can be found in the PATENTS file in the same directory.
  14091. *
  14092. * @providesModule ReactEmptyComponent
  14093. */
  14094. 'use strict';
  14095. var emptyComponentFactory;
  14096. var ReactEmptyComponentInjection = {
  14097. injectEmptyComponentFactory: function (factory) {
  14098. emptyComponentFactory = factory;
  14099. }
  14100. };
  14101. var ReactEmptyComponent = {
  14102. create: function (instantiate) {
  14103. return emptyComponentFactory(instantiate);
  14104. }
  14105. };
  14106. ReactEmptyComponent.injection = ReactEmptyComponentInjection;
  14107. module.exports = ReactEmptyComponent;
  14108. /***/ },
  14109. /* 129 */
  14110. /***/ function(module, exports, __webpack_require__) {
  14111. /* WEBPACK VAR INJECTION */(function(process) {/**
  14112. * Copyright 2014-present, Facebook, Inc.
  14113. * All rights reserved.
  14114. *
  14115. * This source code is licensed under the BSD-style license found in the
  14116. * LICENSE file in the root directory of this source tree. An additional grant
  14117. * of patent rights can be found in the PATENTS file in the same directory.
  14118. *
  14119. * @providesModule ReactHostComponent
  14120. */
  14121. 'use strict';
  14122. var _prodInvariant = __webpack_require__(9),
  14123. _assign = __webpack_require__(6);
  14124. var invariant = __webpack_require__(10);
  14125. var genericComponentClass = null;
  14126. // This registry keeps track of wrapper classes around host tags.
  14127. var tagToComponentClass = {};
  14128. var textComponentClass = null;
  14129. var ReactHostComponentInjection = {
  14130. // This accepts a class that receives the tag string. This is a catch all
  14131. // that can render any kind of tag.
  14132. injectGenericComponentClass: function (componentClass) {
  14133. genericComponentClass = componentClass;
  14134. },
  14135. // This accepts a text component class that takes the text string to be
  14136. // rendered as props.
  14137. injectTextComponentClass: function (componentClass) {
  14138. textComponentClass = componentClass;
  14139. },
  14140. // This accepts a keyed object with classes as values. Each key represents a
  14141. // tag. That particular tag will use this class instead of the generic one.
  14142. injectComponentClasses: function (componentClasses) {
  14143. _assign(tagToComponentClass, componentClasses);
  14144. }
  14145. };
  14146. /**
  14147. * Get a host internal component class for a specific tag.
  14148. *
  14149. * @param {ReactElement} element The element to create.
  14150. * @return {function} The internal class constructor function.
  14151. */
  14152. function createInternalComponent(element) {
  14153. !genericComponentClass ? process.env.NODE_ENV !== 'production' ? invariant(false, 'There is no registered component for the tag %s', element.type) : _prodInvariant('111', element.type) : void 0;
  14154. return new genericComponentClass(element);
  14155. }
  14156. /**
  14157. * @param {ReactText} text
  14158. * @return {ReactComponent}
  14159. */
  14160. function createInstanceForText(text) {
  14161. return new textComponentClass(text);
  14162. }
  14163. /**
  14164. * @param {ReactComponent} component
  14165. * @return {boolean}
  14166. */
  14167. function isTextComponent(component) {
  14168. return component instanceof textComponentClass;
  14169. }
  14170. var ReactHostComponent = {
  14171. createInternalComponent: createInternalComponent,
  14172. createInstanceForText: createInstanceForText,
  14173. isTextComponent: isTextComponent,
  14174. injection: ReactHostComponentInjection
  14175. };
  14176. module.exports = ReactHostComponent;
  14177. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  14178. /***/ },
  14179. /* 130 */
  14180. /***/ function(module, exports, __webpack_require__) {
  14181. /* WEBPACK VAR INJECTION */(function(process) {/**
  14182. * Copyright 2013-present, Facebook, Inc.
  14183. * All rights reserved.
  14184. *
  14185. * This source code is licensed under the BSD-style license found in the
  14186. * LICENSE file in the root directory of this source tree. An additional grant
  14187. * of patent rights can be found in the PATENTS file in the same directory.
  14188. *
  14189. * @providesModule flattenChildren
  14190. *
  14191. */
  14192. 'use strict';
  14193. var KeyEscapeUtils = __webpack_require__(18);
  14194. var traverseAllChildren = __webpack_require__(16);
  14195. var warning = __webpack_require__(13);
  14196. var ReactComponentTreeHook;
  14197. if (typeof process !== 'undefined' && process.env && process.env.NODE_ENV === 'test') {
  14198. // Temporary hack.
  14199. // Inline requires don't work well with Jest:
  14200. // https://github.com/facebook/react/issues/7240
  14201. // Remove the inline requires when we don't need them anymore:
  14202. // https://github.com/facebook/react/pull/7178
  14203. ReactComponentTreeHook = __webpack_require__(30);
  14204. }
  14205. /**
  14206. * @param {function} traverseContext Context passed through traversal.
  14207. * @param {?ReactComponent} child React child component.
  14208. * @param {!string} name String name of key path to child.
  14209. * @param {number=} selfDebugID Optional debugID of the current internal instance.
  14210. */
  14211. function flattenSingleChildIntoContext(traverseContext, child, name, selfDebugID) {
  14212. // We found a component instance.
  14213. if (traverseContext && typeof traverseContext === 'object') {
  14214. var result = traverseContext;
  14215. var keyUnique = result[name] === undefined;
  14216. if (process.env.NODE_ENV !== 'production') {
  14217. if (!ReactComponentTreeHook) {
  14218. ReactComponentTreeHook = __webpack_require__(30);
  14219. }
  14220. if (!keyUnique) {
  14221. process.env.NODE_ENV !== 'production' ? warning(false, '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.%s', KeyEscapeUtils.unescape(name), ReactComponentTreeHook.getStackAddendumByID(selfDebugID)) : void 0;
  14222. }
  14223. }
  14224. if (keyUnique && child != null) {
  14225. result[name] = child;
  14226. }
  14227. }
  14228. }
  14229. /**
  14230. * Flattens children that are typically specified as `props.children`. Any null
  14231. * children will not be included in the resulting object.
  14232. * @return {!object} flattened children keyed by name.
  14233. */
  14234. function flattenChildren(children, selfDebugID) {
  14235. if (children == null) {
  14236. return children;
  14237. }
  14238. var result = {};
  14239. if (process.env.NODE_ENV !== 'production') {
  14240. traverseAllChildren(children, function (traverseContext, child, name) {
  14241. return flattenSingleChildIntoContext(traverseContext, child, name, selfDebugID);
  14242. }, result);
  14243. } else {
  14244. traverseAllChildren(children, flattenSingleChildIntoContext, result);
  14245. }
  14246. return result;
  14247. }
  14248. module.exports = flattenChildren;
  14249. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  14250. /***/ },
  14251. /* 131 */
  14252. /***/ function(module, exports, __webpack_require__) {
  14253. /* WEBPACK VAR INJECTION */(function(process) {/**
  14254. * Copyright 2014-present, Facebook, Inc.
  14255. * All rights reserved.
  14256. *
  14257. * This source code is licensed under the BSD-style license found in the
  14258. * LICENSE file in the root directory of this source tree. An additional grant
  14259. * of patent rights can be found in the PATENTS file in the same directory.
  14260. *
  14261. * @providesModule ReactServerRenderingTransaction
  14262. */
  14263. 'use strict';
  14264. var _assign = __webpack_require__(6);
  14265. var PooledClass = __webpack_require__(8);
  14266. var Transaction = __webpack_require__(71);
  14267. var ReactInstrumentation = __webpack_require__(64);
  14268. var ReactServerUpdateQueue = __webpack_require__(132);
  14269. /**
  14270. * Executed within the scope of the `Transaction` instance. Consider these as
  14271. * being member methods, but with an implied ordering while being isolated from
  14272. * each other.
  14273. */
  14274. var TRANSACTION_WRAPPERS = [];
  14275. if (process.env.NODE_ENV !== 'production') {
  14276. TRANSACTION_WRAPPERS.push({
  14277. initialize: ReactInstrumentation.debugTool.onBeginFlush,
  14278. close: ReactInstrumentation.debugTool.onEndFlush
  14279. });
  14280. }
  14281. var noopCallbackQueue = {
  14282. enqueue: function () {}
  14283. };
  14284. /**
  14285. * @class ReactServerRenderingTransaction
  14286. * @param {boolean} renderToStaticMarkup
  14287. */
  14288. function ReactServerRenderingTransaction(renderToStaticMarkup) {
  14289. this.reinitializeTransaction();
  14290. this.renderToStaticMarkup = renderToStaticMarkup;
  14291. this.useCreateElement = false;
  14292. this.updateQueue = new ReactServerUpdateQueue(this);
  14293. }
  14294. var Mixin = {
  14295. /**
  14296. * @see Transaction
  14297. * @abstract
  14298. * @final
  14299. * @return {array} Empty list of operation wrap procedures.
  14300. */
  14301. getTransactionWrappers: function () {
  14302. return TRANSACTION_WRAPPERS;
  14303. },
  14304. /**
  14305. * @return {object} The queue to collect `onDOMReady` callbacks with.
  14306. */
  14307. getReactMountReady: function () {
  14308. return noopCallbackQueue;
  14309. },
  14310. /**
  14311. * @return {object} The queue to collect React async events.
  14312. */
  14313. getUpdateQueue: function () {
  14314. return this.updateQueue;
  14315. },
  14316. /**
  14317. * `PooledClass` looks for this, and will invoke this before allowing this
  14318. * instance to be reused.
  14319. */
  14320. destructor: function () {},
  14321. checkpoint: function () {},
  14322. rollback: function () {}
  14323. };
  14324. _assign(ReactServerRenderingTransaction.prototype, Transaction.Mixin, Mixin);
  14325. PooledClass.addPoolingTo(ReactServerRenderingTransaction);
  14326. module.exports = ReactServerRenderingTransaction;
  14327. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  14328. /***/ },
  14329. /* 132 */
  14330. /***/ function(module, exports, __webpack_require__) {
  14331. /* WEBPACK VAR INJECTION */(function(process) {/**
  14332. * Copyright 2015-present, Facebook, Inc.
  14333. * All rights reserved.
  14334. *
  14335. * This source code is licensed under the BSD-style license found in the
  14336. * LICENSE file in the root directory of this source tree. An additional grant
  14337. * of patent rights can be found in the PATENTS file in the same directory.
  14338. *
  14339. * @providesModule ReactServerUpdateQueue
  14340. *
  14341. */
  14342. 'use strict';
  14343. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  14344. var ReactUpdateQueue = __webpack_require__(133);
  14345. var Transaction = __webpack_require__(71);
  14346. var warning = __webpack_require__(13);
  14347. function warnNoop(publicInstance, callerName) {
  14348. if (process.env.NODE_ENV !== 'production') {
  14349. var constructor = publicInstance.constructor;
  14350. process.env.NODE_ENV !== 'production' ? warning(false, '%s(...): Can only update a mounting component. ' + 'This usually means you called %s() outside componentWillMount() on the server. ' + 'This is a no-op. Please check the code for the %s component.', callerName, callerName, constructor && (constructor.displayName || constructor.name) || 'ReactClass') : void 0;
  14351. }
  14352. }
  14353. /**
  14354. * This is the update queue used for server rendering.
  14355. * It delegates to ReactUpdateQueue while server rendering is in progress and
  14356. * switches to ReactNoopUpdateQueue after the transaction has completed.
  14357. * @class ReactServerUpdateQueue
  14358. * @param {Transaction} transaction
  14359. */
  14360. var ReactServerUpdateQueue = function () {
  14361. /* :: transaction: Transaction; */
  14362. function ReactServerUpdateQueue(transaction) {
  14363. _classCallCheck(this, ReactServerUpdateQueue);
  14364. this.transaction = transaction;
  14365. }
  14366. /**
  14367. * Checks whether or not this composite component is mounted.
  14368. * @param {ReactClass} publicInstance The instance we want to test.
  14369. * @return {boolean} True if mounted, false otherwise.
  14370. * @protected
  14371. * @final
  14372. */
  14373. ReactServerUpdateQueue.prototype.isMounted = function isMounted(publicInstance) {
  14374. return false;
  14375. };
  14376. /**
  14377. * Enqueue a callback that will be executed after all the pending updates
  14378. * have processed.
  14379. *
  14380. * @param {ReactClass} publicInstance The instance to use as `this` context.
  14381. * @param {?function} callback Called after state is updated.
  14382. * @internal
  14383. */
  14384. ReactServerUpdateQueue.prototype.enqueueCallback = function enqueueCallback(publicInstance, callback, callerName) {
  14385. if (this.transaction.isInTransaction()) {
  14386. ReactUpdateQueue.enqueueCallback(publicInstance, callback, callerName);
  14387. }
  14388. };
  14389. /**
  14390. * Forces an update. This should only be invoked when it is known with
  14391. * certainty that we are **not** in a DOM transaction.
  14392. *
  14393. * You may want to call this when you know that some deeper aspect of the
  14394. * component's state has changed but `setState` was not called.
  14395. *
  14396. * This will not invoke `shouldComponentUpdate`, but it will invoke
  14397. * `componentWillUpdate` and `componentDidUpdate`.
  14398. *
  14399. * @param {ReactClass} publicInstance The instance that should rerender.
  14400. * @internal
  14401. */
  14402. ReactServerUpdateQueue.prototype.enqueueForceUpdate = function enqueueForceUpdate(publicInstance) {
  14403. if (this.transaction.isInTransaction()) {
  14404. ReactUpdateQueue.enqueueForceUpdate(publicInstance);
  14405. } else {
  14406. warnNoop(publicInstance, 'forceUpdate');
  14407. }
  14408. };
  14409. /**
  14410. * Replaces all of the state. Always use this or `setState` to mutate state.
  14411. * You should treat `this.state` as immutable.
  14412. *
  14413. * There is no guarantee that `this.state` will be immediately updated, so
  14414. * accessing `this.state` after calling this method may return the old value.
  14415. *
  14416. * @param {ReactClass} publicInstance The instance that should rerender.
  14417. * @param {object|function} completeState Next state.
  14418. * @internal
  14419. */
  14420. ReactServerUpdateQueue.prototype.enqueueReplaceState = function enqueueReplaceState(publicInstance, completeState) {
  14421. if (this.transaction.isInTransaction()) {
  14422. ReactUpdateQueue.enqueueReplaceState(publicInstance, completeState);
  14423. } else {
  14424. warnNoop(publicInstance, 'replaceState');
  14425. }
  14426. };
  14427. /**
  14428. * Sets a subset of the state. This only exists because _pendingState is
  14429. * internal. This provides a merging strategy that is not available to deep
  14430. * properties which is confusing. TODO: Expose pendingState or don't use it
  14431. * during the merge.
  14432. *
  14433. * @param {ReactClass} publicInstance The instance that should rerender.
  14434. * @param {object|function} partialState Next partial state to be merged with state.
  14435. * @internal
  14436. */
  14437. ReactServerUpdateQueue.prototype.enqueueSetState = function enqueueSetState(publicInstance, partialState) {
  14438. if (this.transaction.isInTransaction()) {
  14439. ReactUpdateQueue.enqueueSetState(publicInstance, partialState);
  14440. } else {
  14441. warnNoop(publicInstance, 'setState');
  14442. }
  14443. };
  14444. return ReactServerUpdateQueue;
  14445. }();
  14446. module.exports = ReactServerUpdateQueue;
  14447. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  14448. /***/ },
  14449. /* 133 */
  14450. /***/ function(module, exports, __webpack_require__) {
  14451. /* WEBPACK VAR INJECTION */(function(process) {/**
  14452. * Copyright 2015-present, Facebook, Inc.
  14453. * All rights reserved.
  14454. *
  14455. * This source code is licensed under the BSD-style license found in the
  14456. * LICENSE file in the root directory of this source tree. An additional grant
  14457. * of patent rights can be found in the PATENTS file in the same directory.
  14458. *
  14459. * @providesModule ReactUpdateQueue
  14460. */
  14461. 'use strict';
  14462. var _prodInvariant = __webpack_require__(9);
  14463. var ReactCurrentOwner = __webpack_require__(12);
  14464. var ReactInstanceMap = __webpack_require__(121);
  14465. var ReactInstrumentation = __webpack_require__(64);
  14466. var ReactUpdates = __webpack_require__(58);
  14467. var invariant = __webpack_require__(10);
  14468. var warning = __webpack_require__(13);
  14469. function enqueueUpdate(internalInstance) {
  14470. ReactUpdates.enqueueUpdate(internalInstance);
  14471. }
  14472. function formatUnexpectedArgument(arg) {
  14473. var type = typeof arg;
  14474. if (type !== 'object') {
  14475. return type;
  14476. }
  14477. var displayName = arg.constructor && arg.constructor.name || type;
  14478. var keys = Object.keys(arg);
  14479. if (keys.length > 0 && keys.length < 20) {
  14480. return displayName + ' (keys: ' + keys.join(', ') + ')';
  14481. }
  14482. return displayName;
  14483. }
  14484. function getInternalInstanceReadyForUpdate(publicInstance, callerName) {
  14485. var internalInstance = ReactInstanceMap.get(publicInstance);
  14486. if (!internalInstance) {
  14487. if (process.env.NODE_ENV !== 'production') {
  14488. var ctor = publicInstance.constructor;
  14489. // Only warn when we have a callerName. Otherwise we should be silent.
  14490. // We're probably calling from enqueueCallback. We don't want to warn
  14491. // there because we already warned for the corresponding lifecycle method.
  14492. 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, ctor && (ctor.displayName || ctor.name) || 'ReactClass') : void 0;
  14493. }
  14494. return null;
  14495. }
  14496. if (process.env.NODE_ENV !== 'production') {
  14497. 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;
  14498. }
  14499. return internalInstance;
  14500. }
  14501. /**
  14502. * ReactUpdateQueue allows for state updates to be scheduled into a later
  14503. * reconciliation step.
  14504. */
  14505. var ReactUpdateQueue = {
  14506. /**
  14507. * Checks whether or not this composite component is mounted.
  14508. * @param {ReactClass} publicInstance The instance we want to test.
  14509. * @return {boolean} True if mounted, false otherwise.
  14510. * @protected
  14511. * @final
  14512. */
  14513. isMounted: function (publicInstance) {
  14514. if (process.env.NODE_ENV !== 'production') {
  14515. var owner = ReactCurrentOwner.current;
  14516. if (owner !== null) {
  14517. 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;
  14518. owner._warnedAboutRefsInRender = true;
  14519. }
  14520. }
  14521. var internalInstance = ReactInstanceMap.get(publicInstance);
  14522. if (internalInstance) {
  14523. // During componentWillMount and render this will still be null but after
  14524. // that will always render to something. At least for now. So we can use
  14525. // this hack.
  14526. return !!internalInstance._renderedComponent;
  14527. } else {
  14528. return false;
  14529. }
  14530. },
  14531. /**
  14532. * Enqueue a callback that will be executed after all the pending updates
  14533. * have processed.
  14534. *
  14535. * @param {ReactClass} publicInstance The instance to use as `this` context.
  14536. * @param {?function} callback Called after state is updated.
  14537. * @param {string} callerName Name of the calling function in the public API.
  14538. * @internal
  14539. */
  14540. enqueueCallback: function (publicInstance, callback, callerName) {
  14541. ReactUpdateQueue.validateCallback(callback, callerName);
  14542. var internalInstance = getInternalInstanceReadyForUpdate(publicInstance);
  14543. // Previously we would throw an error if we didn't have an internal
  14544. // instance. Since we want to make it a no-op instead, we mirror the same
  14545. // behavior we have in other enqueue* methods.
  14546. // We also need to ignore callbacks in componentWillMount. See
  14547. // enqueueUpdates.
  14548. if (!internalInstance) {
  14549. return null;
  14550. }
  14551. if (internalInstance._pendingCallbacks) {
  14552. internalInstance._pendingCallbacks.push(callback);
  14553. } else {
  14554. internalInstance._pendingCallbacks = [callback];
  14555. }
  14556. // TODO: The callback here is ignored when setState is called from
  14557. // componentWillMount. Either fix it or disallow doing so completely in
  14558. // favor of getInitialState. Alternatively, we can disallow
  14559. // componentWillMount during server-side rendering.
  14560. enqueueUpdate(internalInstance);
  14561. },
  14562. enqueueCallbackInternal: function (internalInstance, callback) {
  14563. if (internalInstance._pendingCallbacks) {
  14564. internalInstance._pendingCallbacks.push(callback);
  14565. } else {
  14566. internalInstance._pendingCallbacks = [callback];
  14567. }
  14568. enqueueUpdate(internalInstance);
  14569. },
  14570. /**
  14571. * Forces an update. This should only be invoked when it is known with
  14572. * certainty that we are **not** in a DOM transaction.
  14573. *
  14574. * You may want to call this when you know that some deeper aspect of the
  14575. * component's state has changed but `setState` was not called.
  14576. *
  14577. * This will not invoke `shouldComponentUpdate`, but it will invoke
  14578. * `componentWillUpdate` and `componentDidUpdate`.
  14579. *
  14580. * @param {ReactClass} publicInstance The instance that should rerender.
  14581. * @internal
  14582. */
  14583. enqueueForceUpdate: function (publicInstance) {
  14584. var internalInstance = getInternalInstanceReadyForUpdate(publicInstance, 'forceUpdate');
  14585. if (!internalInstance) {
  14586. return;
  14587. }
  14588. internalInstance._pendingForceUpdate = true;
  14589. enqueueUpdate(internalInstance);
  14590. },
  14591. /**
  14592. * Replaces all of the state. Always use this or `setState` to mutate state.
  14593. * You should treat `this.state` as immutable.
  14594. *
  14595. * There is no guarantee that `this.state` will be immediately updated, so
  14596. * accessing `this.state` after calling this method may return the old value.
  14597. *
  14598. * @param {ReactClass} publicInstance The instance that should rerender.
  14599. * @param {object} completeState Next state.
  14600. * @internal
  14601. */
  14602. enqueueReplaceState: function (publicInstance, completeState) {
  14603. var internalInstance = getInternalInstanceReadyForUpdate(publicInstance, 'replaceState');
  14604. if (!internalInstance) {
  14605. return;
  14606. }
  14607. internalInstance._pendingStateQueue = [completeState];
  14608. internalInstance._pendingReplaceState = true;
  14609. enqueueUpdate(internalInstance);
  14610. },
  14611. /**
  14612. * Sets a subset of the state. This only exists because _pendingState is
  14613. * internal. This provides a merging strategy that is not available to deep
  14614. * properties which is confusing. TODO: Expose pendingState or don't use it
  14615. * during the merge.
  14616. *
  14617. * @param {ReactClass} publicInstance The instance that should rerender.
  14618. * @param {object} partialState Next partial state to be merged with state.
  14619. * @internal
  14620. */
  14621. enqueueSetState: function (publicInstance, partialState) {
  14622. if (process.env.NODE_ENV !== 'production') {
  14623. ReactInstrumentation.debugTool.onSetState();
  14624. process.env.NODE_ENV !== 'production' ? warning(partialState != null, 'setState(...): You passed an undefined or null state object; ' + 'instead, use forceUpdate().') : void 0;
  14625. }
  14626. var internalInstance = getInternalInstanceReadyForUpdate(publicInstance, 'setState');
  14627. if (!internalInstance) {
  14628. return;
  14629. }
  14630. var queue = internalInstance._pendingStateQueue || (internalInstance._pendingStateQueue = []);
  14631. queue.push(partialState);
  14632. enqueueUpdate(internalInstance);
  14633. },
  14634. enqueueElementInternal: function (internalInstance, nextElement, nextContext) {
  14635. internalInstance._pendingElement = nextElement;
  14636. // TODO: introduce _pendingContext instead of setting it directly.
  14637. internalInstance._context = nextContext;
  14638. enqueueUpdate(internalInstance);
  14639. },
  14640. validateCallback: function (callback, callerName) {
  14641. !(!callback || typeof callback === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s(...): Expected the last optional `callback` argument to be a function. Instead received: %s.', callerName, formatUnexpectedArgument(callback)) : _prodInvariant('122', callerName, formatUnexpectedArgument(callback)) : void 0;
  14642. }
  14643. };
  14644. module.exports = ReactUpdateQueue;
  14645. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  14646. /***/ },
  14647. /* 134 */
  14648. /***/ function(module, exports, __webpack_require__) {
  14649. /* WEBPACK VAR INJECTION */(function(process) {/**
  14650. * Copyright 2015-present, Facebook, Inc.
  14651. * All rights reserved.
  14652. *
  14653. * This source code is licensed under the BSD-style license found in the
  14654. * LICENSE file in the root directory of this source tree. An additional grant
  14655. * of patent rights can be found in the PATENTS file in the same directory.
  14656. *
  14657. * @providesModule validateDOMNesting
  14658. */
  14659. 'use strict';
  14660. var _assign = __webpack_require__(6);
  14661. var emptyFunction = __webpack_require__(14);
  14662. var warning = __webpack_require__(13);
  14663. var validateDOMNesting = emptyFunction;
  14664. if (process.env.NODE_ENV !== 'production') {
  14665. // This validation code was written based on the HTML5 parsing spec:
  14666. // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-scope
  14667. //
  14668. // Note: this does not catch all invalid nesting, nor does it try to (as it's
  14669. // not clear what practical benefit doing so provides); instead, we warn only
  14670. // for cases where the parser will give a parse tree differing from what React
  14671. // intended. For example, <b><div></div></b> is invalid but we don't warn
  14672. // because it still parses correctly; we do warn for other cases like nested
  14673. // <p> tags where the beginning of the second element implicitly closes the
  14674. // first, causing a confusing mess.
  14675. // https://html.spec.whatwg.org/multipage/syntax.html#special
  14676. 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'];
  14677. // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-scope
  14678. var inScopeTags = ['applet', 'caption', 'html', 'table', 'td', 'th', 'marquee', 'object', 'template',
  14679. // https://html.spec.whatwg.org/multipage/syntax.html#html-integration-point
  14680. // TODO: Distinguish by namespace here -- for <title>, including it here
  14681. // errs on the side of fewer warnings
  14682. 'foreignObject', 'desc', 'title'];
  14683. // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-button-scope
  14684. var buttonScopeTags = inScopeTags.concat(['button']);
  14685. // https://html.spec.whatwg.org/multipage/syntax.html#generate-implied-end-tags
  14686. var impliedEndTags = ['dd', 'dt', 'li', 'option', 'optgroup', 'p', 'rp', 'rt'];
  14687. var emptyAncestorInfo = {
  14688. current: null,
  14689. formTag: null,
  14690. aTagInScope: null,
  14691. buttonTagInScope: null,
  14692. nobrTagInScope: null,
  14693. pTagInButtonScope: null,
  14694. listItemTagAutoclosing: null,
  14695. dlItemTagAutoclosing: null
  14696. };
  14697. var updatedAncestorInfo = function (oldInfo, tag, instance) {
  14698. var ancestorInfo = _assign({}, oldInfo || emptyAncestorInfo);
  14699. var info = { tag: tag, instance: instance };
  14700. if (inScopeTags.indexOf(tag) !== -1) {
  14701. ancestorInfo.aTagInScope = null;
  14702. ancestorInfo.buttonTagInScope = null;
  14703. ancestorInfo.nobrTagInScope = null;
  14704. }
  14705. if (buttonScopeTags.indexOf(tag) !== -1) {
  14706. ancestorInfo.pTagInButtonScope = null;
  14707. }
  14708. // See rules for 'li', 'dd', 'dt' start tags in
  14709. // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inbody
  14710. if (specialTags.indexOf(tag) !== -1 && tag !== 'address' && tag !== 'div' && tag !== 'p') {
  14711. ancestorInfo.listItemTagAutoclosing = null;
  14712. ancestorInfo.dlItemTagAutoclosing = null;
  14713. }
  14714. ancestorInfo.current = info;
  14715. if (tag === 'form') {
  14716. ancestorInfo.formTag = info;
  14717. }
  14718. if (tag === 'a') {
  14719. ancestorInfo.aTagInScope = info;
  14720. }
  14721. if (tag === 'button') {
  14722. ancestorInfo.buttonTagInScope = info;
  14723. }
  14724. if (tag === 'nobr') {
  14725. ancestorInfo.nobrTagInScope = info;
  14726. }
  14727. if (tag === 'p') {
  14728. ancestorInfo.pTagInButtonScope = info;
  14729. }
  14730. if (tag === 'li') {
  14731. ancestorInfo.listItemTagAutoclosing = info;
  14732. }
  14733. if (tag === 'dd' || tag === 'dt') {
  14734. ancestorInfo.dlItemTagAutoclosing = info;
  14735. }
  14736. return ancestorInfo;
  14737. };
  14738. /**
  14739. * Returns whether
  14740. */
  14741. var isTagValidWithParent = function (tag, parentTag) {
  14742. // First, let's check if we're in an unusual parsing mode...
  14743. switch (parentTag) {
  14744. // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inselect
  14745. case 'select':
  14746. return tag === 'option' || tag === 'optgroup' || tag === '#text';
  14747. case 'optgroup':
  14748. return tag === 'option' || tag === '#text';
  14749. // Strictly speaking, seeing an <option> doesn't mean we're in a <select>
  14750. // but
  14751. case 'option':
  14752. return tag === '#text';
  14753. // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intd
  14754. // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-incaption
  14755. // No special behavior since these rules fall back to "in body" mode for
  14756. // all except special table nodes which cause bad parsing behavior anyway.
  14757. // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intr
  14758. case 'tr':
  14759. return tag === 'th' || tag === 'td' || tag === 'style' || tag === 'script' || tag === 'template';
  14760. // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intbody
  14761. case 'tbody':
  14762. case 'thead':
  14763. case 'tfoot':
  14764. return tag === 'tr' || tag === 'style' || tag === 'script' || tag === 'template';
  14765. // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-incolgroup
  14766. case 'colgroup':
  14767. return tag === 'col' || tag === 'template';
  14768. // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intable
  14769. case 'table':
  14770. return tag === 'caption' || tag === 'colgroup' || tag === 'tbody' || tag === 'tfoot' || tag === 'thead' || tag === 'style' || tag === 'script' || tag === 'template';
  14771. // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inhead
  14772. case 'head':
  14773. return tag === 'base' || tag === 'basefont' || tag === 'bgsound' || tag === 'link' || tag === 'meta' || tag === 'title' || tag === 'noscript' || tag === 'noframes' || tag === 'style' || tag === 'script' || tag === 'template';
  14774. // https://html.spec.whatwg.org/multipage/semantics.html#the-html-element
  14775. case 'html':
  14776. return tag === 'head' || tag === 'body';
  14777. case '#document':
  14778. return tag === 'html';
  14779. }
  14780. // Probably in the "in body" parsing mode, so we outlaw only tag combos
  14781. // where the parsing rules cause implicit opens or closes to be added.
  14782. // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inbody
  14783. switch (tag) {
  14784. case 'h1':
  14785. case 'h2':
  14786. case 'h3':
  14787. case 'h4':
  14788. case 'h5':
  14789. case 'h6':
  14790. return parentTag !== 'h1' && parentTag !== 'h2' && parentTag !== 'h3' && parentTag !== 'h4' && parentTag !== 'h5' && parentTag !== 'h6';
  14791. case 'rp':
  14792. case 'rt':
  14793. return impliedEndTags.indexOf(parentTag) === -1;
  14794. case 'body':
  14795. case 'caption':
  14796. case 'col':
  14797. case 'colgroup':
  14798. case 'frame':
  14799. case 'head':
  14800. case 'html':
  14801. case 'tbody':
  14802. case 'td':
  14803. case 'tfoot':
  14804. case 'th':
  14805. case 'thead':
  14806. case 'tr':
  14807. // These tags are only valid with a few parents that have special child
  14808. // parsing rules -- if we're down here, then none of those matched and
  14809. // so we allow it only if we don't know what the parent is, as all other
  14810. // cases are invalid.
  14811. return parentTag == null;
  14812. }
  14813. return true;
  14814. };
  14815. /**
  14816. * Returns whether
  14817. */
  14818. var findInvalidAncestorForTag = function (tag, ancestorInfo) {
  14819. switch (tag) {
  14820. case 'address':
  14821. case 'article':
  14822. case 'aside':
  14823. case 'blockquote':
  14824. case 'center':
  14825. case 'details':
  14826. case 'dialog':
  14827. case 'dir':
  14828. case 'div':
  14829. case 'dl':
  14830. case 'fieldset':
  14831. case 'figcaption':
  14832. case 'figure':
  14833. case 'footer':
  14834. case 'header':
  14835. case 'hgroup':
  14836. case 'main':
  14837. case 'menu':
  14838. case 'nav':
  14839. case 'ol':
  14840. case 'p':
  14841. case 'section':
  14842. case 'summary':
  14843. case 'ul':
  14844. case 'pre':
  14845. case 'listing':
  14846. case 'table':
  14847. case 'hr':
  14848. case 'xmp':
  14849. case 'h1':
  14850. case 'h2':
  14851. case 'h3':
  14852. case 'h4':
  14853. case 'h5':
  14854. case 'h6':
  14855. return ancestorInfo.pTagInButtonScope;
  14856. case 'form':
  14857. return ancestorInfo.formTag || ancestorInfo.pTagInButtonScope;
  14858. case 'li':
  14859. return ancestorInfo.listItemTagAutoclosing;
  14860. case 'dd':
  14861. case 'dt':
  14862. return ancestorInfo.dlItemTagAutoclosing;
  14863. case 'button':
  14864. return ancestorInfo.buttonTagInScope;
  14865. case 'a':
  14866. // Spec says something about storing a list of markers, but it sounds
  14867. // equivalent to this check.
  14868. return ancestorInfo.aTagInScope;
  14869. case 'nobr':
  14870. return ancestorInfo.nobrTagInScope;
  14871. }
  14872. return null;
  14873. };
  14874. /**
  14875. * Given a ReactCompositeComponent instance, return a list of its recursive
  14876. * owners, starting at the root and ending with the instance itself.
  14877. */
  14878. var findOwnerStack = function (instance) {
  14879. if (!instance) {
  14880. return [];
  14881. }
  14882. var stack = [];
  14883. do {
  14884. stack.push(instance);
  14885. } while (instance = instance._currentElement._owner);
  14886. stack.reverse();
  14887. return stack;
  14888. };
  14889. var didWarn = {};
  14890. validateDOMNesting = function (childTag, childInstance, ancestorInfo) {
  14891. ancestorInfo = ancestorInfo || emptyAncestorInfo;
  14892. var parentInfo = ancestorInfo.current;
  14893. var parentTag = parentInfo && parentInfo.tag;
  14894. var invalidParent = isTagValidWithParent(childTag, parentTag) ? null : parentInfo;
  14895. var invalidAncestor = invalidParent ? null : findInvalidAncestorForTag(childTag, ancestorInfo);
  14896. var problematic = invalidParent || invalidAncestor;
  14897. if (problematic) {
  14898. var ancestorTag = problematic.tag;
  14899. var ancestorInstance = problematic.instance;
  14900. var childOwner = childInstance && childInstance._currentElement._owner;
  14901. var ancestorOwner = ancestorInstance && ancestorInstance._currentElement._owner;
  14902. var childOwners = findOwnerStack(childOwner);
  14903. var ancestorOwners = findOwnerStack(ancestorOwner);
  14904. var minStackLen = Math.min(childOwners.length, ancestorOwners.length);
  14905. var i;
  14906. var deepestCommon = -1;
  14907. for (i = 0; i < minStackLen; i++) {
  14908. if (childOwners[i] === ancestorOwners[i]) {
  14909. deepestCommon = i;
  14910. } else {
  14911. break;
  14912. }
  14913. }
  14914. var UNKNOWN = '(unknown)';
  14915. var childOwnerNames = childOwners.slice(deepestCommon + 1).map(function (inst) {
  14916. return inst.getName() || UNKNOWN;
  14917. });
  14918. var ancestorOwnerNames = ancestorOwners.slice(deepestCommon + 1).map(function (inst) {
  14919. return inst.getName() || UNKNOWN;
  14920. });
  14921. var ownerInfo = [].concat(
  14922. // If the parent and child instances have a common owner ancestor, start
  14923. // with that -- otherwise we just start with the parent's owners.
  14924. deepestCommon !== -1 ? childOwners[deepestCommon].getName() || UNKNOWN : [], ancestorOwnerNames, ancestorTag,
  14925. // If we're warning about an invalid (non-parent) ancestry, add '...'
  14926. invalidAncestor ? ['...'] : [], childOwnerNames, childTag).join(' > ');
  14927. var warnKey = !!invalidParent + '|' + childTag + '|' + ancestorTag + '|' + ownerInfo;
  14928. if (didWarn[warnKey]) {
  14929. return;
  14930. }
  14931. didWarn[warnKey] = true;
  14932. var tagDisplayName = childTag;
  14933. if (childTag !== '#text') {
  14934. tagDisplayName = '<' + childTag + '>';
  14935. }
  14936. if (invalidParent) {
  14937. var info = '';
  14938. if (ancestorTag === 'table' && childTag === 'tr') {
  14939. info += ' Add a <tbody> to your code to match the DOM tree generated by ' + 'the browser.';
  14940. }
  14941. 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;
  14942. } else {
  14943. process.env.NODE_ENV !== 'production' ? warning(false, 'validateDOMNesting(...): %s cannot appear as a descendant of ' + '<%s>. See %s.', tagDisplayName, ancestorTag, ownerInfo) : void 0;
  14944. }
  14945. }
  14946. };
  14947. validateDOMNesting.updatedAncestorInfo = updatedAncestorInfo;
  14948. // For testing
  14949. validateDOMNesting.isTagValidInContext = function (tag, ancestorInfo) {
  14950. ancestorInfo = ancestorInfo || emptyAncestorInfo;
  14951. var parentInfo = ancestorInfo.current;
  14952. var parentTag = parentInfo && parentInfo.tag;
  14953. return isTagValidWithParent(tag, parentTag) && !findInvalidAncestorForTag(tag, ancestorInfo);
  14954. };
  14955. }
  14956. module.exports = validateDOMNesting;
  14957. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  14958. /***/ },
  14959. /* 135 */
  14960. /***/ function(module, exports, __webpack_require__) {
  14961. /**
  14962. * Copyright 2014-present, Facebook, Inc.
  14963. * All rights reserved.
  14964. *
  14965. * This source code is licensed under the BSD-style license found in the
  14966. * LICENSE file in the root directory of this source tree. An additional grant
  14967. * of patent rights can be found in the PATENTS file in the same directory.
  14968. *
  14969. * @providesModule ReactDOMEmptyComponent
  14970. */
  14971. 'use strict';
  14972. var _assign = __webpack_require__(6);
  14973. var DOMLazyTree = __webpack_require__(84);
  14974. var ReactDOMComponentTree = __webpack_require__(38);
  14975. var ReactDOMEmptyComponent = function (instantiate) {
  14976. // ReactCompositeComponent uses this:
  14977. this._currentElement = null;
  14978. // ReactDOMComponentTree uses these:
  14979. this._hostNode = null;
  14980. this._hostParent = null;
  14981. this._hostContainerInfo = null;
  14982. this._domID = 0;
  14983. };
  14984. _assign(ReactDOMEmptyComponent.prototype, {
  14985. mountComponent: function (transaction, hostParent, hostContainerInfo, context) {
  14986. var domID = hostContainerInfo._idCounter++;
  14987. this._domID = domID;
  14988. this._hostParent = hostParent;
  14989. this._hostContainerInfo = hostContainerInfo;
  14990. var nodeValue = ' react-empty: ' + this._domID + ' ';
  14991. if (transaction.useCreateElement) {
  14992. var ownerDocument = hostContainerInfo._ownerDocument;
  14993. var node = ownerDocument.createComment(nodeValue);
  14994. ReactDOMComponentTree.precacheNode(this, node);
  14995. return DOMLazyTree(node);
  14996. } else {
  14997. if (transaction.renderToStaticMarkup) {
  14998. // Normally we'd insert a comment node, but since this is a situation
  14999. // where React won't take over (static pages), we can simply return
  15000. // nothing.
  15001. return '';
  15002. }
  15003. return '<!--' + nodeValue + '-->';
  15004. }
  15005. },
  15006. receiveComponent: function () {},
  15007. getHostNode: function () {
  15008. return ReactDOMComponentTree.getNodeFromInstance(this);
  15009. },
  15010. unmountComponent: function () {
  15011. ReactDOMComponentTree.uncacheNode(this);
  15012. }
  15013. });
  15014. module.exports = ReactDOMEmptyComponent;
  15015. /***/ },
  15016. /* 136 */
  15017. /***/ function(module, exports, __webpack_require__) {
  15018. /* WEBPACK VAR INJECTION */(function(process) {/**
  15019. * Copyright 2015-present, Facebook, Inc.
  15020. * All rights reserved.
  15021. *
  15022. * This source code is licensed under the BSD-style license found in the
  15023. * LICENSE file in the root directory of this source tree. An additional grant
  15024. * of patent rights can be found in the PATENTS file in the same directory.
  15025. *
  15026. * @providesModule ReactDOMTreeTraversal
  15027. */
  15028. 'use strict';
  15029. var _prodInvariant = __webpack_require__(9);
  15030. var invariant = __webpack_require__(10);
  15031. /**
  15032. * Return the lowest common ancestor of A and B, or null if they are in
  15033. * different trees.
  15034. */
  15035. function getLowestCommonAncestor(instA, instB) {
  15036. !('_hostNode' in instA) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'getNodeFromInstance: Invalid argument.') : _prodInvariant('33') : void 0;
  15037. !('_hostNode' in instB) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'getNodeFromInstance: Invalid argument.') : _prodInvariant('33') : void 0;
  15038. var depthA = 0;
  15039. for (var tempA = instA; tempA; tempA = tempA._hostParent) {
  15040. depthA++;
  15041. }
  15042. var depthB = 0;
  15043. for (var tempB = instB; tempB; tempB = tempB._hostParent) {
  15044. depthB++;
  15045. }
  15046. // If A is deeper, crawl up.
  15047. while (depthA - depthB > 0) {
  15048. instA = instA._hostParent;
  15049. depthA--;
  15050. }
  15051. // If B is deeper, crawl up.
  15052. while (depthB - depthA > 0) {
  15053. instB = instB._hostParent;
  15054. depthB--;
  15055. }
  15056. // Walk in lockstep until we find a match.
  15057. var depth = depthA;
  15058. while (depth--) {
  15059. if (instA === instB) {
  15060. return instA;
  15061. }
  15062. instA = instA._hostParent;
  15063. instB = instB._hostParent;
  15064. }
  15065. return null;
  15066. }
  15067. /**
  15068. * Return if A is an ancestor of B.
  15069. */
  15070. function isAncestor(instA, instB) {
  15071. !('_hostNode' in instA) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'isAncestor: Invalid argument.') : _prodInvariant('35') : void 0;
  15072. !('_hostNode' in instB) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'isAncestor: Invalid argument.') : _prodInvariant('35') : void 0;
  15073. while (instB) {
  15074. if (instB === instA) {
  15075. return true;
  15076. }
  15077. instB = instB._hostParent;
  15078. }
  15079. return false;
  15080. }
  15081. /**
  15082. * Return the parent instance of the passed-in instance.
  15083. */
  15084. function getParentInstance(inst) {
  15085. !('_hostNode' in inst) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'getParentInstance: Invalid argument.') : _prodInvariant('36') : void 0;
  15086. return inst._hostParent;
  15087. }
  15088. /**
  15089. * Simulates the traversal of a two-phase, capture/bubble event dispatch.
  15090. */
  15091. function traverseTwoPhase(inst, fn, arg) {
  15092. var path = [];
  15093. while (inst) {
  15094. path.push(inst);
  15095. inst = inst._hostParent;
  15096. }
  15097. var i;
  15098. for (i = path.length; i-- > 0;) {
  15099. fn(path[i], false, arg);
  15100. }
  15101. for (i = 0; i < path.length; i++) {
  15102. fn(path[i], true, arg);
  15103. }
  15104. }
  15105. /**
  15106. * Traverses the ID hierarchy and invokes the supplied `cb` on any IDs that
  15107. * should would receive a `mouseEnter` or `mouseLeave` event.
  15108. *
  15109. * Does not invoke the callback on the nearest common ancestor because nothing
  15110. * "entered" or "left" that element.
  15111. */
  15112. function traverseEnterLeave(from, to, fn, argFrom, argTo) {
  15113. var common = from && to ? getLowestCommonAncestor(from, to) : null;
  15114. var pathFrom = [];
  15115. while (from && from !== common) {
  15116. pathFrom.push(from);
  15117. from = from._hostParent;
  15118. }
  15119. var pathTo = [];
  15120. while (to && to !== common) {
  15121. pathTo.push(to);
  15122. to = to._hostParent;
  15123. }
  15124. var i;
  15125. for (i = 0; i < pathFrom.length; i++) {
  15126. fn(pathFrom[i], true, argFrom);
  15127. }
  15128. for (i = pathTo.length; i-- > 0;) {
  15129. fn(pathTo[i], false, argTo);
  15130. }
  15131. }
  15132. module.exports = {
  15133. isAncestor: isAncestor,
  15134. getLowestCommonAncestor: getLowestCommonAncestor,
  15135. getParentInstance: getParentInstance,
  15136. traverseTwoPhase: traverseTwoPhase,
  15137. traverseEnterLeave: traverseEnterLeave
  15138. };
  15139. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  15140. /***/ },
  15141. /* 137 */
  15142. /***/ function(module, exports, __webpack_require__) {
  15143. /* WEBPACK VAR INJECTION */(function(process) {/**
  15144. * Copyright 2013-present, Facebook, Inc.
  15145. * All rights reserved.
  15146. *
  15147. * This source code is licensed under the BSD-style license found in the
  15148. * LICENSE file in the root directory of this source tree. An additional grant
  15149. * of patent rights can be found in the PATENTS file in the same directory.
  15150. *
  15151. * @providesModule ReactDOMTextComponent
  15152. */
  15153. 'use strict';
  15154. var _prodInvariant = __webpack_require__(9),
  15155. _assign = __webpack_require__(6);
  15156. var DOMChildrenOperations = __webpack_require__(83);
  15157. var DOMLazyTree = __webpack_require__(84);
  15158. var ReactDOMComponentTree = __webpack_require__(38);
  15159. var escapeTextContentForBrowser = __webpack_require__(89);
  15160. var invariant = __webpack_require__(10);
  15161. var validateDOMNesting = __webpack_require__(134);
  15162. /**
  15163. * Text nodes violate a couple assumptions that React makes about components:
  15164. *
  15165. * - When mounting text into the DOM, adjacent text nodes are merged.
  15166. * - Text nodes cannot be assigned a React root ID.
  15167. *
  15168. * This component is used to wrap strings between comment nodes so that they
  15169. * can undergo the same reconciliation that is applied to elements.
  15170. *
  15171. * TODO: Investigate representing React components in the DOM with text nodes.
  15172. *
  15173. * @class ReactDOMTextComponent
  15174. * @extends ReactComponent
  15175. * @internal
  15176. */
  15177. var ReactDOMTextComponent = function (text) {
  15178. // TODO: This is really a ReactText (ReactNode), not a ReactElement
  15179. this._currentElement = text;
  15180. this._stringText = '' + text;
  15181. // ReactDOMComponentTree uses these:
  15182. this._hostNode = null;
  15183. this._hostParent = null;
  15184. // Properties
  15185. this._domID = 0;
  15186. this._mountIndex = 0;
  15187. this._closingComment = null;
  15188. this._commentNodes = null;
  15189. };
  15190. _assign(ReactDOMTextComponent.prototype, {
  15191. /**
  15192. * Creates the markup for this text node. This node is not intended to have
  15193. * any features besides containing text content.
  15194. *
  15195. * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
  15196. * @return {string} Markup for this text node.
  15197. * @internal
  15198. */
  15199. mountComponent: function (transaction, hostParent, hostContainerInfo, context) {
  15200. if (process.env.NODE_ENV !== 'production') {
  15201. var parentInfo;
  15202. if (hostParent != null) {
  15203. parentInfo = hostParent._ancestorInfo;
  15204. } else if (hostContainerInfo != null) {
  15205. parentInfo = hostContainerInfo._ancestorInfo;
  15206. }
  15207. if (parentInfo) {
  15208. // parentInfo should always be present except for the top-level
  15209. // component when server rendering
  15210. validateDOMNesting('#text', this, parentInfo);
  15211. }
  15212. }
  15213. var domID = hostContainerInfo._idCounter++;
  15214. var openingValue = ' react-text: ' + domID + ' ';
  15215. var closingValue = ' /react-text ';
  15216. this._domID = domID;
  15217. this._hostParent = hostParent;
  15218. if (transaction.useCreateElement) {
  15219. var ownerDocument = hostContainerInfo._ownerDocument;
  15220. var openingComment = ownerDocument.createComment(openingValue);
  15221. var closingComment = ownerDocument.createComment(closingValue);
  15222. var lazyTree = DOMLazyTree(ownerDocument.createDocumentFragment());
  15223. DOMLazyTree.queueChild(lazyTree, DOMLazyTree(openingComment));
  15224. if (this._stringText) {
  15225. DOMLazyTree.queueChild(lazyTree, DOMLazyTree(ownerDocument.createTextNode(this._stringText)));
  15226. }
  15227. DOMLazyTree.queueChild(lazyTree, DOMLazyTree(closingComment));
  15228. ReactDOMComponentTree.precacheNode(this, openingComment);
  15229. this._closingComment = closingComment;
  15230. return lazyTree;
  15231. } else {
  15232. var escapedText = escapeTextContentForBrowser(this._stringText);
  15233. if (transaction.renderToStaticMarkup) {
  15234. // Normally we'd wrap this between comment nodes for the reasons stated
  15235. // above, but since this is a situation where React won't take over
  15236. // (static pages), we can simply return the text as it is.
  15237. return escapedText;
  15238. }
  15239. return '<!--' + openingValue + '-->' + escapedText + '<!--' + closingValue + '-->';
  15240. }
  15241. },
  15242. /**
  15243. * Updates this component by updating the text content.
  15244. *
  15245. * @param {ReactText} nextText The next text content
  15246. * @param {ReactReconcileTransaction} transaction
  15247. * @internal
  15248. */
  15249. receiveComponent: function (nextText, transaction) {
  15250. if (nextText !== this._currentElement) {
  15251. this._currentElement = nextText;
  15252. var nextStringText = '' + nextText;
  15253. if (nextStringText !== this._stringText) {
  15254. // TODO: Save this as pending props and use performUpdateIfNecessary
  15255. // and/or updateComponent to do the actual update for consistency with
  15256. // other component types?
  15257. this._stringText = nextStringText;
  15258. var commentNodes = this.getHostNode();
  15259. DOMChildrenOperations.replaceDelimitedText(commentNodes[0], commentNodes[1], nextStringText);
  15260. }
  15261. }
  15262. },
  15263. getHostNode: function () {
  15264. var hostNode = this._commentNodes;
  15265. if (hostNode) {
  15266. return hostNode;
  15267. }
  15268. if (!this._closingComment) {
  15269. var openingComment = ReactDOMComponentTree.getNodeFromInstance(this);
  15270. var node = openingComment.nextSibling;
  15271. while (true) {
  15272. !(node != null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Missing closing comment for text component %s', this._domID) : _prodInvariant('67', this._domID) : void 0;
  15273. if (node.nodeType === 8 && node.nodeValue === ' /react-text ') {
  15274. this._closingComment = node;
  15275. break;
  15276. }
  15277. node = node.nextSibling;
  15278. }
  15279. }
  15280. hostNode = [this._hostNode, this._closingComment];
  15281. this._commentNodes = hostNode;
  15282. return hostNode;
  15283. },
  15284. unmountComponent: function () {
  15285. this._closingComment = null;
  15286. this._commentNodes = null;
  15287. ReactDOMComponentTree.uncacheNode(this);
  15288. }
  15289. });
  15290. module.exports = ReactDOMTextComponent;
  15291. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  15292. /***/ },
  15293. /* 138 */
  15294. /***/ function(module, exports, __webpack_require__) {
  15295. /**
  15296. * Copyright 2013-present, Facebook, Inc.
  15297. * All rights reserved.
  15298. *
  15299. * This source code is licensed under the BSD-style license found in the
  15300. * LICENSE file in the root directory of this source tree. An additional grant
  15301. * of patent rights can be found in the PATENTS file in the same directory.
  15302. *
  15303. * @providesModule ReactDefaultBatchingStrategy
  15304. */
  15305. 'use strict';
  15306. var _assign = __webpack_require__(6);
  15307. var ReactUpdates = __webpack_require__(58);
  15308. var Transaction = __webpack_require__(71);
  15309. var emptyFunction = __webpack_require__(14);
  15310. var RESET_BATCHED_UPDATES = {
  15311. initialize: emptyFunction,
  15312. close: function () {
  15313. ReactDefaultBatchingStrategy.isBatchingUpdates = false;
  15314. }
  15315. };
  15316. var FLUSH_BATCHED_UPDATES = {
  15317. initialize: emptyFunction,
  15318. close: ReactUpdates.flushBatchedUpdates.bind(ReactUpdates)
  15319. };
  15320. var TRANSACTION_WRAPPERS = [FLUSH_BATCHED_UPDATES, RESET_BATCHED_UPDATES];
  15321. function ReactDefaultBatchingStrategyTransaction() {
  15322. this.reinitializeTransaction();
  15323. }
  15324. _assign(ReactDefaultBatchingStrategyTransaction.prototype, Transaction.Mixin, {
  15325. getTransactionWrappers: function () {
  15326. return TRANSACTION_WRAPPERS;
  15327. }
  15328. });
  15329. var transaction = new ReactDefaultBatchingStrategyTransaction();
  15330. var ReactDefaultBatchingStrategy = {
  15331. isBatchingUpdates: false,
  15332. /**
  15333. * Call the provided function in a context within which calls to `setState`
  15334. * and friends are batched such that components aren't updated unnecessarily.
  15335. */
  15336. batchedUpdates: function (callback, a, b, c, d, e) {
  15337. var alreadyBatchingUpdates = ReactDefaultBatchingStrategy.isBatchingUpdates;
  15338. ReactDefaultBatchingStrategy.isBatchingUpdates = true;
  15339. // The code is written this way to avoid extra allocations
  15340. if (alreadyBatchingUpdates) {
  15341. callback(a, b, c, d, e);
  15342. } else {
  15343. transaction.perform(callback, null, a, b, c, d, e);
  15344. }
  15345. }
  15346. };
  15347. module.exports = ReactDefaultBatchingStrategy;
  15348. /***/ },
  15349. /* 139 */
  15350. /***/ function(module, exports, __webpack_require__) {
  15351. /**
  15352. * Copyright 2013-present, Facebook, Inc.
  15353. * All rights reserved.
  15354. *
  15355. * This source code is licensed under the BSD-style license found in the
  15356. * LICENSE file in the root directory of this source tree. An additional grant
  15357. * of patent rights can be found in the PATENTS file in the same directory.
  15358. *
  15359. * @providesModule ReactEventListener
  15360. */
  15361. 'use strict';
  15362. var _assign = __webpack_require__(6);
  15363. var EventListener = __webpack_require__(140);
  15364. var ExecutionEnvironment = __webpack_require__(51);
  15365. var PooledClass = __webpack_require__(8);
  15366. var ReactDOMComponentTree = __webpack_require__(38);
  15367. var ReactUpdates = __webpack_require__(58);
  15368. var getEventTarget = __webpack_require__(72);
  15369. var getUnboundedScrollPosition = __webpack_require__(141);
  15370. /**
  15371. * Find the deepest React component completely containing the root of the
  15372. * passed-in instance (for use when entire React trees are nested within each
  15373. * other). If React trees are not nested, returns null.
  15374. */
  15375. function findParent(inst) {
  15376. // TODO: It may be a good idea to cache this to prevent unnecessary DOM
  15377. // traversal, but caching is difficult to do correctly without using a
  15378. // mutation observer to listen for all DOM changes.
  15379. while (inst._hostParent) {
  15380. inst = inst._hostParent;
  15381. }
  15382. var rootNode = ReactDOMComponentTree.getNodeFromInstance(inst);
  15383. var container = rootNode.parentNode;
  15384. return ReactDOMComponentTree.getClosestInstanceFromNode(container);
  15385. }
  15386. // Used to store ancestor hierarchy in top level callback
  15387. function TopLevelCallbackBookKeeping(topLevelType, nativeEvent) {
  15388. this.topLevelType = topLevelType;
  15389. this.nativeEvent = nativeEvent;
  15390. this.ancestors = [];
  15391. }
  15392. _assign(TopLevelCallbackBookKeeping.prototype, {
  15393. destructor: function () {
  15394. this.topLevelType = null;
  15395. this.nativeEvent = null;
  15396. this.ancestors.length = 0;
  15397. }
  15398. });
  15399. PooledClass.addPoolingTo(TopLevelCallbackBookKeeping, PooledClass.twoArgumentPooler);
  15400. function handleTopLevelImpl(bookKeeping) {
  15401. var nativeEventTarget = getEventTarget(bookKeeping.nativeEvent);
  15402. var targetInst = ReactDOMComponentTree.getClosestInstanceFromNode(nativeEventTarget);
  15403. // Loop through the hierarchy, in case there's any nested components.
  15404. // It's important that we build the array of ancestors before calling any
  15405. // event handlers, because event handlers can modify the DOM, leading to
  15406. // inconsistencies with ReactMount's node cache. See #1105.
  15407. var ancestor = targetInst;
  15408. do {
  15409. bookKeeping.ancestors.push(ancestor);
  15410. ancestor = ancestor && findParent(ancestor);
  15411. } while (ancestor);
  15412. for (var i = 0; i < bookKeeping.ancestors.length; i++) {
  15413. targetInst = bookKeeping.ancestors[i];
  15414. ReactEventListener._handleTopLevel(bookKeeping.topLevelType, targetInst, bookKeeping.nativeEvent, getEventTarget(bookKeeping.nativeEvent));
  15415. }
  15416. }
  15417. function scrollValueMonitor(cb) {
  15418. var scrollPosition = getUnboundedScrollPosition(window);
  15419. cb(scrollPosition);
  15420. }
  15421. var ReactEventListener = {
  15422. _enabled: true,
  15423. _handleTopLevel: null,
  15424. WINDOW_HANDLE: ExecutionEnvironment.canUseDOM ? window : null,
  15425. setHandleTopLevel: function (handleTopLevel) {
  15426. ReactEventListener._handleTopLevel = handleTopLevel;
  15427. },
  15428. setEnabled: function (enabled) {
  15429. ReactEventListener._enabled = !!enabled;
  15430. },
  15431. isEnabled: function () {
  15432. return ReactEventListener._enabled;
  15433. },
  15434. /**
  15435. * Traps top-level events by using event bubbling.
  15436. *
  15437. * @param {string} topLevelType Record from `EventConstants`.
  15438. * @param {string} handlerBaseName Event name (e.g. "click").
  15439. * @param {object} handle Element on which to attach listener.
  15440. * @return {?object} An object with a remove function which will forcefully
  15441. * remove the listener.
  15442. * @internal
  15443. */
  15444. trapBubbledEvent: function (topLevelType, handlerBaseName, handle) {
  15445. var element = handle;
  15446. if (!element) {
  15447. return null;
  15448. }
  15449. return EventListener.listen(element, handlerBaseName, ReactEventListener.dispatchEvent.bind(null, topLevelType));
  15450. },
  15451. /**
  15452. * Traps a top-level event by using event capturing.
  15453. *
  15454. * @param {string} topLevelType Record from `EventConstants`.
  15455. * @param {string} handlerBaseName Event name (e.g. "click").
  15456. * @param {object} handle Element on which to attach listener.
  15457. * @return {?object} An object with a remove function which will forcefully
  15458. * remove the listener.
  15459. * @internal
  15460. */
  15461. trapCapturedEvent: function (topLevelType, handlerBaseName, handle) {
  15462. var element = handle;
  15463. if (!element) {
  15464. return null;
  15465. }
  15466. return EventListener.capture(element, handlerBaseName, ReactEventListener.dispatchEvent.bind(null, topLevelType));
  15467. },
  15468. monitorScrollValue: function (refresh) {
  15469. var callback = scrollValueMonitor.bind(null, refresh);
  15470. EventListener.listen(window, 'scroll', callback);
  15471. },
  15472. dispatchEvent: function (topLevelType, nativeEvent) {
  15473. if (!ReactEventListener._enabled) {
  15474. return;
  15475. }
  15476. var bookKeeping = TopLevelCallbackBookKeeping.getPooled(topLevelType, nativeEvent);
  15477. try {
  15478. // Event queue being processed in the same cycle allows
  15479. // `preventDefault`.
  15480. ReactUpdates.batchedUpdates(handleTopLevelImpl, bookKeeping);
  15481. } finally {
  15482. TopLevelCallbackBookKeeping.release(bookKeeping);
  15483. }
  15484. }
  15485. };
  15486. module.exports = ReactEventListener;
  15487. /***/ },
  15488. /* 140 */
  15489. /***/ function(module, exports, __webpack_require__) {
  15490. /* WEBPACK VAR INJECTION */(function(process) {'use strict';
  15491. /**
  15492. * Copyright (c) 2013-present, Facebook, Inc.
  15493. *
  15494. * Licensed under the Apache License, Version 2.0 (the "License");
  15495. * you may not use this file except in compliance with the License.
  15496. * You may obtain a copy of the License at
  15497. *
  15498. * http://www.apache.org/licenses/LICENSE-2.0
  15499. *
  15500. * Unless required by applicable law or agreed to in writing, software
  15501. * distributed under the License is distributed on an "AS IS" BASIS,
  15502. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15503. * See the License for the specific language governing permissions and
  15504. * limitations under the License.
  15505. *
  15506. * @typechecks
  15507. */
  15508. var emptyFunction = __webpack_require__(14);
  15509. /**
  15510. * Upstream version of event listener. Does not take into account specific
  15511. * nature of platform.
  15512. */
  15513. var EventListener = {
  15514. /**
  15515. * Listen to DOM events during the bubble phase.
  15516. *
  15517. * @param {DOMEventTarget} target DOM element to register listener on.
  15518. * @param {string} eventType Event type, e.g. 'click' or 'mouseover'.
  15519. * @param {function} callback Callback function.
  15520. * @return {object} Object with a `remove` method.
  15521. */
  15522. listen: function listen(target, eventType, callback) {
  15523. if (target.addEventListener) {
  15524. target.addEventListener(eventType, callback, false);
  15525. return {
  15526. remove: function remove() {
  15527. target.removeEventListener(eventType, callback, false);
  15528. }
  15529. };
  15530. } else if (target.attachEvent) {
  15531. target.attachEvent('on' + eventType, callback);
  15532. return {
  15533. remove: function remove() {
  15534. target.detachEvent('on' + eventType, callback);
  15535. }
  15536. };
  15537. }
  15538. },
  15539. /**
  15540. * Listen to DOM events during the capture phase.
  15541. *
  15542. * @param {DOMEventTarget} target DOM element to register listener on.
  15543. * @param {string} eventType Event type, e.g. 'click' or 'mouseover'.
  15544. * @param {function} callback Callback function.
  15545. * @return {object} Object with a `remove` method.
  15546. */
  15547. capture: function capture(target, eventType, callback) {
  15548. if (target.addEventListener) {
  15549. target.addEventListener(eventType, callback, true);
  15550. return {
  15551. remove: function remove() {
  15552. target.removeEventListener(eventType, callback, true);
  15553. }
  15554. };
  15555. } else {
  15556. if (process.env.NODE_ENV !== 'production') {
  15557. 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.');
  15558. }
  15559. return {
  15560. remove: emptyFunction
  15561. };
  15562. }
  15563. },
  15564. registerDefault: function registerDefault() {}
  15565. };
  15566. module.exports = EventListener;
  15567. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  15568. /***/ },
  15569. /* 141 */
  15570. /***/ function(module, exports) {
  15571. /**
  15572. * Copyright (c) 2013-present, Facebook, Inc.
  15573. * All rights reserved.
  15574. *
  15575. * This source code is licensed under the BSD-style license found in the
  15576. * LICENSE file in the root directory of this source tree. An additional grant
  15577. * of patent rights can be found in the PATENTS file in the same directory.
  15578. *
  15579. * @typechecks
  15580. */
  15581. 'use strict';
  15582. /**
  15583. * Gets the scroll position of the supplied element or window.
  15584. *
  15585. * The return values are unbounded, unlike `getScrollPosition`. This means they
  15586. * may be negative or exceed the element boundaries (which is possible using
  15587. * inertial scrolling).
  15588. *
  15589. * @param {DOMWindow|DOMElement} scrollable
  15590. * @return {object} Map with `x` and `y` keys.
  15591. */
  15592. function getUnboundedScrollPosition(scrollable) {
  15593. if (scrollable === window) {
  15594. return {
  15595. x: window.pageXOffset || document.documentElement.scrollLeft,
  15596. y: window.pageYOffset || document.documentElement.scrollTop
  15597. };
  15598. }
  15599. return {
  15600. x: scrollable.scrollLeft,
  15601. y: scrollable.scrollTop
  15602. };
  15603. }
  15604. module.exports = getUnboundedScrollPosition;
  15605. /***/ },
  15606. /* 142 */
  15607. /***/ function(module, exports, __webpack_require__) {
  15608. /**
  15609. * Copyright 2013-present, Facebook, Inc.
  15610. * All rights reserved.
  15611. *
  15612. * This source code is licensed under the BSD-style license found in the
  15613. * LICENSE file in the root directory of this source tree. An additional grant
  15614. * of patent rights can be found in the PATENTS file in the same directory.
  15615. *
  15616. * @providesModule ReactInjection
  15617. */
  15618. 'use strict';
  15619. var DOMProperty = __webpack_require__(39);
  15620. var EventPluginHub = __webpack_require__(45);
  15621. var EventPluginUtils = __webpack_require__(47);
  15622. var ReactComponentEnvironment = __webpack_require__(120);
  15623. var ReactClass = __webpack_require__(23);
  15624. var ReactEmptyComponent = __webpack_require__(128);
  15625. var ReactBrowserEventEmitter = __webpack_require__(109);
  15626. var ReactHostComponent = __webpack_require__(129);
  15627. var ReactUpdates = __webpack_require__(58);
  15628. var ReactInjection = {
  15629. Component: ReactComponentEnvironment.injection,
  15630. Class: ReactClass.injection,
  15631. DOMProperty: DOMProperty.injection,
  15632. EmptyComponent: ReactEmptyComponent.injection,
  15633. EventPluginHub: EventPluginHub.injection,
  15634. EventPluginUtils: EventPluginUtils.injection,
  15635. EventEmitter: ReactBrowserEventEmitter.injection,
  15636. HostComponent: ReactHostComponent.injection,
  15637. Updates: ReactUpdates.injection
  15638. };
  15639. module.exports = ReactInjection;
  15640. /***/ },
  15641. /* 143 */
  15642. /***/ function(module, exports, __webpack_require__) {
  15643. /* WEBPACK VAR INJECTION */(function(process) {/**
  15644. * Copyright 2013-present, Facebook, Inc.
  15645. * All rights reserved.
  15646. *
  15647. * This source code is licensed under the BSD-style license found in the
  15648. * LICENSE file in the root directory of this source tree. An additional grant
  15649. * of patent rights can be found in the PATENTS file in the same directory.
  15650. *
  15651. * @providesModule ReactReconcileTransaction
  15652. */
  15653. 'use strict';
  15654. var _assign = __webpack_require__(6);
  15655. var CallbackQueue = __webpack_require__(59);
  15656. var PooledClass = __webpack_require__(8);
  15657. var ReactBrowserEventEmitter = __webpack_require__(109);
  15658. var ReactInputSelection = __webpack_require__(144);
  15659. var ReactInstrumentation = __webpack_require__(64);
  15660. var Transaction = __webpack_require__(71);
  15661. var ReactUpdateQueue = __webpack_require__(133);
  15662. /**
  15663. * Ensures that, when possible, the selection range (currently selected text
  15664. * input) is not disturbed by performing the transaction.
  15665. */
  15666. var SELECTION_RESTORATION = {
  15667. /**
  15668. * @return {Selection} Selection information.
  15669. */
  15670. initialize: ReactInputSelection.getSelectionInformation,
  15671. /**
  15672. * @param {Selection} sel Selection information returned from `initialize`.
  15673. */
  15674. close: ReactInputSelection.restoreSelection
  15675. };
  15676. /**
  15677. * Suppresses events (blur/focus) that could be inadvertently dispatched due to
  15678. * high level DOM manipulations (like temporarily removing a text input from the
  15679. * DOM).
  15680. */
  15681. var EVENT_SUPPRESSION = {
  15682. /**
  15683. * @return {boolean} The enabled status of `ReactBrowserEventEmitter` before
  15684. * the reconciliation.
  15685. */
  15686. initialize: function () {
  15687. var currentlyEnabled = ReactBrowserEventEmitter.isEnabled();
  15688. ReactBrowserEventEmitter.setEnabled(false);
  15689. return currentlyEnabled;
  15690. },
  15691. /**
  15692. * @param {boolean} previouslyEnabled Enabled status of
  15693. * `ReactBrowserEventEmitter` before the reconciliation occurred. `close`
  15694. * restores the previous value.
  15695. */
  15696. close: function (previouslyEnabled) {
  15697. ReactBrowserEventEmitter.setEnabled(previouslyEnabled);
  15698. }
  15699. };
  15700. /**
  15701. * Provides a queue for collecting `componentDidMount` and
  15702. * `componentDidUpdate` callbacks during the transaction.
  15703. */
  15704. var ON_DOM_READY_QUEUEING = {
  15705. /**
  15706. * Initializes the internal `onDOMReady` queue.
  15707. */
  15708. initialize: function () {
  15709. this.reactMountReady.reset();
  15710. },
  15711. /**
  15712. * After DOM is flushed, invoke all registered `onDOMReady` callbacks.
  15713. */
  15714. close: function () {
  15715. this.reactMountReady.notifyAll();
  15716. }
  15717. };
  15718. /**
  15719. * Executed within the scope of the `Transaction` instance. Consider these as
  15720. * being member methods, but with an implied ordering while being isolated from
  15721. * each other.
  15722. */
  15723. var TRANSACTION_WRAPPERS = [SELECTION_RESTORATION, EVENT_SUPPRESSION, ON_DOM_READY_QUEUEING];
  15724. if (process.env.NODE_ENV !== 'production') {
  15725. TRANSACTION_WRAPPERS.push({
  15726. initialize: ReactInstrumentation.debugTool.onBeginFlush,
  15727. close: ReactInstrumentation.debugTool.onEndFlush
  15728. });
  15729. }
  15730. /**
  15731. * Currently:
  15732. * - The order that these are listed in the transaction is critical:
  15733. * - Suppresses events.
  15734. * - Restores selection range.
  15735. *
  15736. * Future:
  15737. * - Restore document/overflow scroll positions that were unintentionally
  15738. * modified via DOM insertions above the top viewport boundary.
  15739. * - Implement/integrate with customized constraint based layout system and keep
  15740. * track of which dimensions must be remeasured.
  15741. *
  15742. * @class ReactReconcileTransaction
  15743. */
  15744. function ReactReconcileTransaction(useCreateElement) {
  15745. this.reinitializeTransaction();
  15746. // Only server-side rendering really needs this option (see
  15747. // `ReactServerRendering`), but server-side uses
  15748. // `ReactServerRenderingTransaction` instead. This option is here so that it's
  15749. // accessible and defaults to false when `ReactDOMComponent` and
  15750. // `ReactDOMTextComponent` checks it in `mountComponent`.`
  15751. this.renderToStaticMarkup = false;
  15752. this.reactMountReady = CallbackQueue.getPooled(null);
  15753. this.useCreateElement = useCreateElement;
  15754. }
  15755. var Mixin = {
  15756. /**
  15757. * @see Transaction
  15758. * @abstract
  15759. * @final
  15760. * @return {array<object>} List of operation wrap procedures.
  15761. * TODO: convert to array<TransactionWrapper>
  15762. */
  15763. getTransactionWrappers: function () {
  15764. return TRANSACTION_WRAPPERS;
  15765. },
  15766. /**
  15767. * @return {object} The queue to collect `onDOMReady` callbacks with.
  15768. */
  15769. getReactMountReady: function () {
  15770. return this.reactMountReady;
  15771. },
  15772. /**
  15773. * @return {object} The queue to collect React async events.
  15774. */
  15775. getUpdateQueue: function () {
  15776. return ReactUpdateQueue;
  15777. },
  15778. /**
  15779. * Save current transaction state -- if the return value from this method is
  15780. * passed to `rollback`, the transaction will be reset to that state.
  15781. */
  15782. checkpoint: function () {
  15783. // reactMountReady is the our only stateful wrapper
  15784. return this.reactMountReady.checkpoint();
  15785. },
  15786. rollback: function (checkpoint) {
  15787. this.reactMountReady.rollback(checkpoint);
  15788. },
  15789. /**
  15790. * `PooledClass` looks for this, and will invoke this before allowing this
  15791. * instance to be reused.
  15792. */
  15793. destructor: function () {
  15794. CallbackQueue.release(this.reactMountReady);
  15795. this.reactMountReady = null;
  15796. }
  15797. };
  15798. _assign(ReactReconcileTransaction.prototype, Transaction.Mixin, Mixin);
  15799. PooledClass.addPoolingTo(ReactReconcileTransaction);
  15800. module.exports = ReactReconcileTransaction;
  15801. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  15802. /***/ },
  15803. /* 144 */
  15804. /***/ function(module, exports, __webpack_require__) {
  15805. /**
  15806. * Copyright 2013-present, Facebook, Inc.
  15807. * All rights reserved.
  15808. *
  15809. * This source code is licensed under the BSD-style license found in the
  15810. * LICENSE file in the root directory of this source tree. An additional grant
  15811. * of patent rights can be found in the PATENTS file in the same directory.
  15812. *
  15813. * @providesModule ReactInputSelection
  15814. */
  15815. 'use strict';
  15816. var ReactDOMSelection = __webpack_require__(145);
  15817. var containsNode = __webpack_require__(147);
  15818. var focusNode = __webpack_require__(98);
  15819. var getActiveElement = __webpack_require__(150);
  15820. function isInDocument(node) {
  15821. return containsNode(document.documentElement, node);
  15822. }
  15823. /**
  15824. * @ReactInputSelection: React input selection module. Based on Selection.js,
  15825. * but modified to be suitable for react and has a couple of bug fixes (doesn't
  15826. * assume buttons have range selections allowed).
  15827. * Input selection module for React.
  15828. */
  15829. var ReactInputSelection = {
  15830. hasSelectionCapabilities: function (elem) {
  15831. var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();
  15832. return nodeName && (nodeName === 'input' && elem.type === 'text' || nodeName === 'textarea' || elem.contentEditable === 'true');
  15833. },
  15834. getSelectionInformation: function () {
  15835. var focusedElem = getActiveElement();
  15836. return {
  15837. focusedElem: focusedElem,
  15838. selectionRange: ReactInputSelection.hasSelectionCapabilities(focusedElem) ? ReactInputSelection.getSelection(focusedElem) : null
  15839. };
  15840. },
  15841. /**
  15842. * @restoreSelection: If any selection information was potentially lost,
  15843. * restore it. This is useful when performing operations that could remove dom
  15844. * nodes and place them back in, resulting in focus being lost.
  15845. */
  15846. restoreSelection: function (priorSelectionInformation) {
  15847. var curFocusedElem = getActiveElement();
  15848. var priorFocusedElem = priorSelectionInformation.focusedElem;
  15849. var priorSelectionRange = priorSelectionInformation.selectionRange;
  15850. if (curFocusedElem !== priorFocusedElem && isInDocument(priorFocusedElem)) {
  15851. if (ReactInputSelection.hasSelectionCapabilities(priorFocusedElem)) {
  15852. ReactInputSelection.setSelection(priorFocusedElem, priorSelectionRange);
  15853. }
  15854. focusNode(priorFocusedElem);
  15855. }
  15856. },
  15857. /**
  15858. * @getSelection: Gets the selection bounds of a focused textarea, input or
  15859. * contentEditable node.
  15860. * -@input: Look up selection bounds of this input
  15861. * -@return {start: selectionStart, end: selectionEnd}
  15862. */
  15863. getSelection: function (input) {
  15864. var selection;
  15865. if ('selectionStart' in input) {
  15866. // Modern browser with input or textarea.
  15867. selection = {
  15868. start: input.selectionStart,
  15869. end: input.selectionEnd
  15870. };
  15871. } else if (document.selection && input.nodeName && input.nodeName.toLowerCase() === 'input') {
  15872. // IE8 input.
  15873. var range = document.selection.createRange();
  15874. // There can only be one selection per document in IE, so it must
  15875. // be in our element.
  15876. if (range.parentElement() === input) {
  15877. selection = {
  15878. start: -range.moveStart('character', -input.value.length),
  15879. end: -range.moveEnd('character', -input.value.length)
  15880. };
  15881. }
  15882. } else {
  15883. // Content editable or old IE textarea.
  15884. selection = ReactDOMSelection.getOffsets(input);
  15885. }
  15886. return selection || { start: 0, end: 0 };
  15887. },
  15888. /**
  15889. * @setSelection: Sets the selection bounds of a textarea or input and focuses
  15890. * the input.
  15891. * -@input Set selection bounds of this input or textarea
  15892. * -@offsets Object of same form that is returned from get*
  15893. */
  15894. setSelection: function (input, offsets) {
  15895. var start = offsets.start;
  15896. var end = offsets.end;
  15897. if (end === undefined) {
  15898. end = start;
  15899. }
  15900. if ('selectionStart' in input) {
  15901. input.selectionStart = start;
  15902. input.selectionEnd = Math.min(end, input.value.length);
  15903. } else if (document.selection && input.nodeName && input.nodeName.toLowerCase() === 'input') {
  15904. var range = input.createTextRange();
  15905. range.collapse(true);
  15906. range.moveStart('character', start);
  15907. range.moveEnd('character', end - start);
  15908. range.select();
  15909. } else {
  15910. ReactDOMSelection.setOffsets(input, offsets);
  15911. }
  15912. }
  15913. };
  15914. module.exports = ReactInputSelection;
  15915. /***/ },
  15916. /* 145 */
  15917. /***/ function(module, exports, __webpack_require__) {
  15918. /**
  15919. * Copyright 2013-present, Facebook, Inc.
  15920. * All rights reserved.
  15921. *
  15922. * This source code is licensed under the BSD-style license found in the
  15923. * LICENSE file in the root directory of this source tree. An additional grant
  15924. * of patent rights can be found in the PATENTS file in the same directory.
  15925. *
  15926. * @providesModule ReactDOMSelection
  15927. */
  15928. 'use strict';
  15929. var ExecutionEnvironment = __webpack_require__(51);
  15930. var getNodeForCharacterOffset = __webpack_require__(146);
  15931. var getTextContentAccessor = __webpack_require__(53);
  15932. /**
  15933. * While `isCollapsed` is available on the Selection object and `collapsed`
  15934. * is available on the Range object, IE11 sometimes gets them wrong.
  15935. * If the anchor/focus nodes and offsets are the same, the range is collapsed.
  15936. */
  15937. function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {
  15938. return anchorNode === focusNode && anchorOffset === focusOffset;
  15939. }
  15940. /**
  15941. * Get the appropriate anchor and focus node/offset pairs for IE.
  15942. *
  15943. * The catch here is that IE's selection API doesn't provide information
  15944. * about whether the selection is forward or backward, so we have to
  15945. * behave as though it's always forward.
  15946. *
  15947. * IE text differs from modern selection in that it behaves as though
  15948. * block elements end with a new line. This means character offsets will
  15949. * differ between the two APIs.
  15950. *
  15951. * @param {DOMElement} node
  15952. * @return {object}
  15953. */
  15954. function getIEOffsets(node) {
  15955. var selection = document.selection;
  15956. var selectedRange = selection.createRange();
  15957. var selectedLength = selectedRange.text.length;
  15958. // Duplicate selection so we can move range without breaking user selection.
  15959. var fromStart = selectedRange.duplicate();
  15960. fromStart.moveToElementText(node);
  15961. fromStart.setEndPoint('EndToStart', selectedRange);
  15962. var startOffset = fromStart.text.length;
  15963. var endOffset = startOffset + selectedLength;
  15964. return {
  15965. start: startOffset,
  15966. end: endOffset
  15967. };
  15968. }
  15969. /**
  15970. * @param {DOMElement} node
  15971. * @return {?object}
  15972. */
  15973. function getModernOffsets(node) {
  15974. var selection = window.getSelection && window.getSelection();
  15975. if (!selection || selection.rangeCount === 0) {
  15976. return null;
  15977. }
  15978. var anchorNode = selection.anchorNode;
  15979. var anchorOffset = selection.anchorOffset;
  15980. var focusNode = selection.focusNode;
  15981. var focusOffset = selection.focusOffset;
  15982. var currentRange = selection.getRangeAt(0);
  15983. // In Firefox, range.startContainer and range.endContainer can be "anonymous
  15984. // divs", e.g. the up/down buttons on an <input type="number">. Anonymous
  15985. // divs do not seem to expose properties, triggering a "Permission denied
  15986. // error" if any of its properties are accessed. The only seemingly possible
  15987. // way to avoid erroring is to access a property that typically works for
  15988. // non-anonymous divs and catch any error that may otherwise arise. See
  15989. // https://bugzilla.mozilla.org/show_bug.cgi?id=208427
  15990. try {
  15991. /* eslint-disable no-unused-expressions */
  15992. currentRange.startContainer.nodeType;
  15993. currentRange.endContainer.nodeType;
  15994. /* eslint-enable no-unused-expressions */
  15995. } catch (e) {
  15996. return null;
  15997. }
  15998. // If the node and offset values are the same, the selection is collapsed.
  15999. // `Selection.isCollapsed` is available natively, but IE sometimes gets
  16000. // this value wrong.
  16001. var isSelectionCollapsed = isCollapsed(selection.anchorNode, selection.anchorOffset, selection.focusNode, selection.focusOffset);
  16002. var rangeLength = isSelectionCollapsed ? 0 : currentRange.toString().length;
  16003. var tempRange = currentRange.cloneRange();
  16004. tempRange.selectNodeContents(node);
  16005. tempRange.setEnd(currentRange.startContainer, currentRange.startOffset);
  16006. var isTempRangeCollapsed = isCollapsed(tempRange.startContainer, tempRange.startOffset, tempRange.endContainer, tempRange.endOffset);
  16007. var start = isTempRangeCollapsed ? 0 : tempRange.toString().length;
  16008. var end = start + rangeLength;
  16009. // Detect whether the selection is backward.
  16010. var detectionRange = document.createRange();
  16011. detectionRange.setStart(anchorNode, anchorOffset);
  16012. detectionRange.setEnd(focusNode, focusOffset);
  16013. var isBackward = detectionRange.collapsed;
  16014. return {
  16015. start: isBackward ? end : start,
  16016. end: isBackward ? start : end
  16017. };
  16018. }
  16019. /**
  16020. * @param {DOMElement|DOMTextNode} node
  16021. * @param {object} offsets
  16022. */
  16023. function setIEOffsets(node, offsets) {
  16024. var range = document.selection.createRange().duplicate();
  16025. var start, end;
  16026. if (offsets.end === undefined) {
  16027. start = offsets.start;
  16028. end = start;
  16029. } else if (offsets.start > offsets.end) {
  16030. start = offsets.end;
  16031. end = offsets.start;
  16032. } else {
  16033. start = offsets.start;
  16034. end = offsets.end;
  16035. }
  16036. range.moveToElementText(node);
  16037. range.moveStart('character', start);
  16038. range.setEndPoint('EndToStart', range);
  16039. range.moveEnd('character', end - start);
  16040. range.select();
  16041. }
  16042. /**
  16043. * In modern non-IE browsers, we can support both forward and backward
  16044. * selections.
  16045. *
  16046. * Note: IE10+ supports the Selection object, but it does not support
  16047. * the `extend` method, which means that even in modern IE, it's not possible
  16048. * to programmatically create a backward selection. Thus, for all IE
  16049. * versions, we use the old IE API to create our selections.
  16050. *
  16051. * @param {DOMElement|DOMTextNode} node
  16052. * @param {object} offsets
  16053. */
  16054. function setModernOffsets(node, offsets) {
  16055. if (!window.getSelection) {
  16056. return;
  16057. }
  16058. var selection = window.getSelection();
  16059. var length = node[getTextContentAccessor()].length;
  16060. var start = Math.min(offsets.start, length);
  16061. var end = offsets.end === undefined ? start : Math.min(offsets.end, length);
  16062. // IE 11 uses modern selection, but doesn't support the extend method.
  16063. // Flip backward selections, so we can set with a single range.
  16064. if (!selection.extend && start > end) {
  16065. var temp = end;
  16066. end = start;
  16067. start = temp;
  16068. }
  16069. var startMarker = getNodeForCharacterOffset(node, start);
  16070. var endMarker = getNodeForCharacterOffset(node, end);
  16071. if (startMarker && endMarker) {
  16072. var range = document.createRange();
  16073. range.setStart(startMarker.node, startMarker.offset);
  16074. selection.removeAllRanges();
  16075. if (start > end) {
  16076. selection.addRange(range);
  16077. selection.extend(endMarker.node, endMarker.offset);
  16078. } else {
  16079. range.setEnd(endMarker.node, endMarker.offset);
  16080. selection.addRange(range);
  16081. }
  16082. }
  16083. }
  16084. var useIEOffsets = ExecutionEnvironment.canUseDOM && 'selection' in document && !('getSelection' in window);
  16085. var ReactDOMSelection = {
  16086. /**
  16087. * @param {DOMElement} node
  16088. */
  16089. getOffsets: useIEOffsets ? getIEOffsets : getModernOffsets,
  16090. /**
  16091. * @param {DOMElement|DOMTextNode} node
  16092. * @param {object} offsets
  16093. */
  16094. setOffsets: useIEOffsets ? setIEOffsets : setModernOffsets
  16095. };
  16096. module.exports = ReactDOMSelection;
  16097. /***/ },
  16098. /* 146 */
  16099. /***/ function(module, exports) {
  16100. /**
  16101. * Copyright 2013-present, Facebook, Inc.
  16102. * All rights reserved.
  16103. *
  16104. * This source code is licensed under the BSD-style license found in the
  16105. * LICENSE file in the root directory of this source tree. An additional grant
  16106. * of patent rights can be found in the PATENTS file in the same directory.
  16107. *
  16108. * @providesModule getNodeForCharacterOffset
  16109. */
  16110. 'use strict';
  16111. /**
  16112. * Given any node return the first leaf node without children.
  16113. *
  16114. * @param {DOMElement|DOMTextNode} node
  16115. * @return {DOMElement|DOMTextNode}
  16116. */
  16117. function getLeafNode(node) {
  16118. while (node && node.firstChild) {
  16119. node = node.firstChild;
  16120. }
  16121. return node;
  16122. }
  16123. /**
  16124. * Get the next sibling within a container. This will walk up the
  16125. * DOM if a node's siblings have been exhausted.
  16126. *
  16127. * @param {DOMElement|DOMTextNode} node
  16128. * @return {?DOMElement|DOMTextNode}
  16129. */
  16130. function getSiblingNode(node) {
  16131. while (node) {
  16132. if (node.nextSibling) {
  16133. return node.nextSibling;
  16134. }
  16135. node = node.parentNode;
  16136. }
  16137. }
  16138. /**
  16139. * Get object describing the nodes which contain characters at offset.
  16140. *
  16141. * @param {DOMElement|DOMTextNode} root
  16142. * @param {number} offset
  16143. * @return {?object}
  16144. */
  16145. function getNodeForCharacterOffset(root, offset) {
  16146. var node = getLeafNode(root);
  16147. var nodeStart = 0;
  16148. var nodeEnd = 0;
  16149. while (node) {
  16150. if (node.nodeType === 3) {
  16151. nodeEnd = nodeStart + node.textContent.length;
  16152. if (nodeStart <= offset && nodeEnd >= offset) {
  16153. return {
  16154. node: node,
  16155. offset: offset - nodeStart
  16156. };
  16157. }
  16158. nodeStart = nodeEnd;
  16159. }
  16160. node = getLeafNode(getSiblingNode(node));
  16161. }
  16162. }
  16163. module.exports = getNodeForCharacterOffset;
  16164. /***/ },
  16165. /* 147 */
  16166. /***/ function(module, exports, __webpack_require__) {
  16167. 'use strict';
  16168. /**
  16169. * Copyright (c) 2013-present, Facebook, Inc.
  16170. * All rights reserved.
  16171. *
  16172. * This source code is licensed under the BSD-style license found in the
  16173. * LICENSE file in the root directory of this source tree. An additional grant
  16174. * of patent rights can be found in the PATENTS file in the same directory.
  16175. *
  16176. *
  16177. */
  16178. var isTextNode = __webpack_require__(148);
  16179. /*eslint-disable no-bitwise */
  16180. /**
  16181. * Checks if a given DOM node contains or is another DOM node.
  16182. */
  16183. function containsNode(outerNode, innerNode) {
  16184. if (!outerNode || !innerNode) {
  16185. return false;
  16186. } else if (outerNode === innerNode) {
  16187. return true;
  16188. } else if (isTextNode(outerNode)) {
  16189. return false;
  16190. } else if (isTextNode(innerNode)) {
  16191. return containsNode(outerNode, innerNode.parentNode);
  16192. } else if ('contains' in outerNode) {
  16193. return outerNode.contains(innerNode);
  16194. } else if (outerNode.compareDocumentPosition) {
  16195. return !!(outerNode.compareDocumentPosition(innerNode) & 16);
  16196. } else {
  16197. return false;
  16198. }
  16199. }
  16200. module.exports = containsNode;
  16201. /***/ },
  16202. /* 148 */
  16203. /***/ function(module, exports, __webpack_require__) {
  16204. 'use strict';
  16205. /**
  16206. * Copyright (c) 2013-present, Facebook, Inc.
  16207. * All rights reserved.
  16208. *
  16209. * This source code is licensed under the BSD-style license found in the
  16210. * LICENSE file in the root directory of this source tree. An additional grant
  16211. * of patent rights can be found in the PATENTS file in the same directory.
  16212. *
  16213. * @typechecks
  16214. */
  16215. var isNode = __webpack_require__(149);
  16216. /**
  16217. * @param {*} object The object to check.
  16218. * @return {boolean} Whether or not the object is a DOM text node.
  16219. */
  16220. function isTextNode(object) {
  16221. return isNode(object) && object.nodeType == 3;
  16222. }
  16223. module.exports = isTextNode;
  16224. /***/ },
  16225. /* 149 */
  16226. /***/ function(module, exports) {
  16227. 'use strict';
  16228. /**
  16229. * Copyright (c) 2013-present, Facebook, Inc.
  16230. * All rights reserved.
  16231. *
  16232. * This source code is licensed under the BSD-style license found in the
  16233. * LICENSE file in the root directory of this source tree. An additional grant
  16234. * of patent rights can be found in the PATENTS file in the same directory.
  16235. *
  16236. * @typechecks
  16237. */
  16238. /**
  16239. * @param {*} object The object to check.
  16240. * @return {boolean} Whether or not the object is a DOM node.
  16241. */
  16242. function isNode(object) {
  16243. return !!(object && (typeof Node === 'function' ? object instanceof Node : typeof object === 'object' && typeof object.nodeType === 'number' && typeof object.nodeName === 'string'));
  16244. }
  16245. module.exports = isNode;
  16246. /***/ },
  16247. /* 150 */
  16248. /***/ function(module, exports) {
  16249. 'use strict';
  16250. /**
  16251. * Copyright (c) 2013-present, Facebook, Inc.
  16252. * All rights reserved.
  16253. *
  16254. * This source code is licensed under the BSD-style license found in the
  16255. * LICENSE file in the root directory of this source tree. An additional grant
  16256. * of patent rights can be found in the PATENTS file in the same directory.
  16257. *
  16258. * @typechecks
  16259. */
  16260. /* eslint-disable fb-www/typeof-undefined */
  16261. /**
  16262. * Same as document.activeElement but wraps in a try-catch block. In IE it is
  16263. * not safe to call document.activeElement if there is nothing focused.
  16264. *
  16265. * The activeElement will be null only if the document or document body is not
  16266. * yet defined.
  16267. */
  16268. function getActiveElement() /*?DOMElement*/{
  16269. if (typeof document === 'undefined') {
  16270. return null;
  16271. }
  16272. try {
  16273. return document.activeElement || document.body;
  16274. } catch (e) {
  16275. return document.body;
  16276. }
  16277. }
  16278. module.exports = getActiveElement;
  16279. /***/ },
  16280. /* 151 */
  16281. /***/ function(module, exports) {
  16282. /**
  16283. * Copyright 2013-present, Facebook, Inc.
  16284. * All rights reserved.
  16285. *
  16286. * This source code is licensed under the BSD-style license found in the
  16287. * LICENSE file in the root directory of this source tree. An additional grant
  16288. * of patent rights can be found in the PATENTS file in the same directory.
  16289. *
  16290. * @providesModule SVGDOMPropertyConfig
  16291. */
  16292. 'use strict';
  16293. var NS = {
  16294. xlink: 'http://www.w3.org/1999/xlink',
  16295. xml: 'http://www.w3.org/XML/1998/namespace'
  16296. };
  16297. // We use attributes for everything SVG so let's avoid some duplication and run
  16298. // code instead.
  16299. // The following are all specified in the HTML config already so we exclude here.
  16300. // - class (as className)
  16301. // - color
  16302. // - height
  16303. // - id
  16304. // - lang
  16305. // - max
  16306. // - media
  16307. // - method
  16308. // - min
  16309. // - name
  16310. // - style
  16311. // - target
  16312. // - type
  16313. // - width
  16314. var ATTRS = {
  16315. accentHeight: 'accent-height',
  16316. accumulate: 0,
  16317. additive: 0,
  16318. alignmentBaseline: 'alignment-baseline',
  16319. allowReorder: 'allowReorder',
  16320. alphabetic: 0,
  16321. amplitude: 0,
  16322. arabicForm: 'arabic-form',
  16323. ascent: 0,
  16324. attributeName: 'attributeName',
  16325. attributeType: 'attributeType',
  16326. autoReverse: 'autoReverse',
  16327. azimuth: 0,
  16328. baseFrequency: 'baseFrequency',
  16329. baseProfile: 'baseProfile',
  16330. baselineShift: 'baseline-shift',
  16331. bbox: 0,
  16332. begin: 0,
  16333. bias: 0,
  16334. by: 0,
  16335. calcMode: 'calcMode',
  16336. capHeight: 'cap-height',
  16337. clip: 0,
  16338. clipPath: 'clip-path',
  16339. clipRule: 'clip-rule',
  16340. clipPathUnits: 'clipPathUnits',
  16341. colorInterpolation: 'color-interpolation',
  16342. colorInterpolationFilters: 'color-interpolation-filters',
  16343. colorProfile: 'color-profile',
  16344. colorRendering: 'color-rendering',
  16345. contentScriptType: 'contentScriptType',
  16346. contentStyleType: 'contentStyleType',
  16347. cursor: 0,
  16348. cx: 0,
  16349. cy: 0,
  16350. d: 0,
  16351. decelerate: 0,
  16352. descent: 0,
  16353. diffuseConstant: 'diffuseConstant',
  16354. direction: 0,
  16355. display: 0,
  16356. divisor: 0,
  16357. dominantBaseline: 'dominant-baseline',
  16358. dur: 0,
  16359. dx: 0,
  16360. dy: 0,
  16361. edgeMode: 'edgeMode',
  16362. elevation: 0,
  16363. enableBackground: 'enable-background',
  16364. end: 0,
  16365. exponent: 0,
  16366. externalResourcesRequired: 'externalResourcesRequired',
  16367. fill: 0,
  16368. fillOpacity: 'fill-opacity',
  16369. fillRule: 'fill-rule',
  16370. filter: 0,
  16371. filterRes: 'filterRes',
  16372. filterUnits: 'filterUnits',
  16373. floodColor: 'flood-color',
  16374. floodOpacity: 'flood-opacity',
  16375. focusable: 0,
  16376. fontFamily: 'font-family',
  16377. fontSize: 'font-size',
  16378. fontSizeAdjust: 'font-size-adjust',
  16379. fontStretch: 'font-stretch',
  16380. fontStyle: 'font-style',
  16381. fontVariant: 'font-variant',
  16382. fontWeight: 'font-weight',
  16383. format: 0,
  16384. from: 0,
  16385. fx: 0,
  16386. fy: 0,
  16387. g1: 0,
  16388. g2: 0,
  16389. glyphName: 'glyph-name',
  16390. glyphOrientationHorizontal: 'glyph-orientation-horizontal',
  16391. glyphOrientationVertical: 'glyph-orientation-vertical',
  16392. glyphRef: 'glyphRef',
  16393. gradientTransform: 'gradientTransform',
  16394. gradientUnits: 'gradientUnits',
  16395. hanging: 0,
  16396. horizAdvX: 'horiz-adv-x',
  16397. horizOriginX: 'horiz-origin-x',
  16398. ideographic: 0,
  16399. imageRendering: 'image-rendering',
  16400. 'in': 0,
  16401. in2: 0,
  16402. intercept: 0,
  16403. k: 0,
  16404. k1: 0,
  16405. k2: 0,
  16406. k3: 0,
  16407. k4: 0,
  16408. kernelMatrix: 'kernelMatrix',
  16409. kernelUnitLength: 'kernelUnitLength',
  16410. kerning: 0,
  16411. keyPoints: 'keyPoints',
  16412. keySplines: 'keySplines',
  16413. keyTimes: 'keyTimes',
  16414. lengthAdjust: 'lengthAdjust',
  16415. letterSpacing: 'letter-spacing',
  16416. lightingColor: 'lighting-color',
  16417. limitingConeAngle: 'limitingConeAngle',
  16418. local: 0,
  16419. markerEnd: 'marker-end',
  16420. markerMid: 'marker-mid',
  16421. markerStart: 'marker-start',
  16422. markerHeight: 'markerHeight',
  16423. markerUnits: 'markerUnits',
  16424. markerWidth: 'markerWidth',
  16425. mask: 0,
  16426. maskContentUnits: 'maskContentUnits',
  16427. maskUnits: 'maskUnits',
  16428. mathematical: 0,
  16429. mode: 0,
  16430. numOctaves: 'numOctaves',
  16431. offset: 0,
  16432. opacity: 0,
  16433. operator: 0,
  16434. order: 0,
  16435. orient: 0,
  16436. orientation: 0,
  16437. origin: 0,
  16438. overflow: 0,
  16439. overlinePosition: 'overline-position',
  16440. overlineThickness: 'overline-thickness',
  16441. paintOrder: 'paint-order',
  16442. panose1: 'panose-1',
  16443. pathLength: 'pathLength',
  16444. patternContentUnits: 'patternContentUnits',
  16445. patternTransform: 'patternTransform',
  16446. patternUnits: 'patternUnits',
  16447. pointerEvents: 'pointer-events',
  16448. points: 0,
  16449. pointsAtX: 'pointsAtX',
  16450. pointsAtY: 'pointsAtY',
  16451. pointsAtZ: 'pointsAtZ',
  16452. preserveAlpha: 'preserveAlpha',
  16453. preserveAspectRatio: 'preserveAspectRatio',
  16454. primitiveUnits: 'primitiveUnits',
  16455. r: 0,
  16456. radius: 0,
  16457. refX: 'refX',
  16458. refY: 'refY',
  16459. renderingIntent: 'rendering-intent',
  16460. repeatCount: 'repeatCount',
  16461. repeatDur: 'repeatDur',
  16462. requiredExtensions: 'requiredExtensions',
  16463. requiredFeatures: 'requiredFeatures',
  16464. restart: 0,
  16465. result: 0,
  16466. rotate: 0,
  16467. rx: 0,
  16468. ry: 0,
  16469. scale: 0,
  16470. seed: 0,
  16471. shapeRendering: 'shape-rendering',
  16472. slope: 0,
  16473. spacing: 0,
  16474. specularConstant: 'specularConstant',
  16475. specularExponent: 'specularExponent',
  16476. speed: 0,
  16477. spreadMethod: 'spreadMethod',
  16478. startOffset: 'startOffset',
  16479. stdDeviation: 'stdDeviation',
  16480. stemh: 0,
  16481. stemv: 0,
  16482. stitchTiles: 'stitchTiles',
  16483. stopColor: 'stop-color',
  16484. stopOpacity: 'stop-opacity',
  16485. strikethroughPosition: 'strikethrough-position',
  16486. strikethroughThickness: 'strikethrough-thickness',
  16487. string: 0,
  16488. stroke: 0,
  16489. strokeDasharray: 'stroke-dasharray',
  16490. strokeDashoffset: 'stroke-dashoffset',
  16491. strokeLinecap: 'stroke-linecap',
  16492. strokeLinejoin: 'stroke-linejoin',
  16493. strokeMiterlimit: 'stroke-miterlimit',
  16494. strokeOpacity: 'stroke-opacity',
  16495. strokeWidth: 'stroke-width',
  16496. surfaceScale: 'surfaceScale',
  16497. systemLanguage: 'systemLanguage',
  16498. tableValues: 'tableValues',
  16499. targetX: 'targetX',
  16500. targetY: 'targetY',
  16501. textAnchor: 'text-anchor',
  16502. textDecoration: 'text-decoration',
  16503. textRendering: 'text-rendering',
  16504. textLength: 'textLength',
  16505. to: 0,
  16506. transform: 0,
  16507. u1: 0,
  16508. u2: 0,
  16509. underlinePosition: 'underline-position',
  16510. underlineThickness: 'underline-thickness',
  16511. unicode: 0,
  16512. unicodeBidi: 'unicode-bidi',
  16513. unicodeRange: 'unicode-range',
  16514. unitsPerEm: 'units-per-em',
  16515. vAlphabetic: 'v-alphabetic',
  16516. vHanging: 'v-hanging',
  16517. vIdeographic: 'v-ideographic',
  16518. vMathematical: 'v-mathematical',
  16519. values: 0,
  16520. vectorEffect: 'vector-effect',
  16521. version: 0,
  16522. vertAdvY: 'vert-adv-y',
  16523. vertOriginX: 'vert-origin-x',
  16524. vertOriginY: 'vert-origin-y',
  16525. viewBox: 'viewBox',
  16526. viewTarget: 'viewTarget',
  16527. visibility: 0,
  16528. widths: 0,
  16529. wordSpacing: 'word-spacing',
  16530. writingMode: 'writing-mode',
  16531. x: 0,
  16532. xHeight: 'x-height',
  16533. x1: 0,
  16534. x2: 0,
  16535. xChannelSelector: 'xChannelSelector',
  16536. xlinkActuate: 'xlink:actuate',
  16537. xlinkArcrole: 'xlink:arcrole',
  16538. xlinkHref: 'xlink:href',
  16539. xlinkRole: 'xlink:role',
  16540. xlinkShow: 'xlink:show',
  16541. xlinkTitle: 'xlink:title',
  16542. xlinkType: 'xlink:type',
  16543. xmlBase: 'xml:base',
  16544. xmlns: 0,
  16545. xmlnsXlink: 'xmlns:xlink',
  16546. xmlLang: 'xml:lang',
  16547. xmlSpace: 'xml:space',
  16548. y: 0,
  16549. y1: 0,
  16550. y2: 0,
  16551. yChannelSelector: 'yChannelSelector',
  16552. z: 0,
  16553. zoomAndPan: 'zoomAndPan'
  16554. };
  16555. var SVGDOMPropertyConfig = {
  16556. Properties: {},
  16557. DOMAttributeNamespaces: {
  16558. xlinkActuate: NS.xlink,
  16559. xlinkArcrole: NS.xlink,
  16560. xlinkHref: NS.xlink,
  16561. xlinkRole: NS.xlink,
  16562. xlinkShow: NS.xlink,
  16563. xlinkTitle: NS.xlink,
  16564. xlinkType: NS.xlink,
  16565. xmlBase: NS.xml,
  16566. xmlLang: NS.xml,
  16567. xmlSpace: NS.xml
  16568. },
  16569. DOMAttributeNames: {}
  16570. };
  16571. Object.keys(ATTRS).forEach(function (key) {
  16572. SVGDOMPropertyConfig.Properties[key] = 0;
  16573. if (ATTRS[key]) {
  16574. SVGDOMPropertyConfig.DOMAttributeNames[key] = ATTRS[key];
  16575. }
  16576. });
  16577. module.exports = SVGDOMPropertyConfig;
  16578. /***/ },
  16579. /* 152 */
  16580. /***/ function(module, exports, __webpack_require__) {
  16581. /**
  16582. * Copyright 2013-present, Facebook, Inc.
  16583. * All rights reserved.
  16584. *
  16585. * This source code is licensed under the BSD-style license found in the
  16586. * LICENSE file in the root directory of this source tree. An additional grant
  16587. * of patent rights can be found in the PATENTS file in the same directory.
  16588. *
  16589. * @providesModule SelectEventPlugin
  16590. */
  16591. 'use strict';
  16592. var EventConstants = __webpack_require__(43);
  16593. var EventPropagators = __webpack_require__(44);
  16594. var ExecutionEnvironment = __webpack_require__(51);
  16595. var ReactDOMComponentTree = __webpack_require__(38);
  16596. var ReactInputSelection = __webpack_require__(144);
  16597. var SyntheticEvent = __webpack_require__(55);
  16598. var getActiveElement = __webpack_require__(150);
  16599. var isTextInputElement = __webpack_require__(74);
  16600. var keyOf = __webpack_require__(27);
  16601. var shallowEqual = __webpack_require__(126);
  16602. var topLevelTypes = EventConstants.topLevelTypes;
  16603. var skipSelectionChangeEvent = ExecutionEnvironment.canUseDOM && 'documentMode' in document && document.documentMode <= 11;
  16604. var eventTypes = {
  16605. select: {
  16606. phasedRegistrationNames: {
  16607. bubbled: keyOf({ onSelect: null }),
  16608. captured: keyOf({ onSelectCapture: null })
  16609. },
  16610. dependencies: [topLevelTypes.topBlur, topLevelTypes.topContextMenu, topLevelTypes.topFocus, topLevelTypes.topKeyDown, topLevelTypes.topMouseDown, topLevelTypes.topMouseUp, topLevelTypes.topSelectionChange]
  16611. }
  16612. };
  16613. var activeElement = null;
  16614. var activeElementInst = null;
  16615. var lastSelection = null;
  16616. var mouseDown = false;
  16617. // Track whether a listener exists for this plugin. If none exist, we do
  16618. // not extract events. See #3639.
  16619. var hasListener = false;
  16620. var ON_SELECT_KEY = keyOf({ onSelect: null });
  16621. /**
  16622. * Get an object which is a unique representation of the current selection.
  16623. *
  16624. * The return value will not be consistent across nodes or browsers, but
  16625. * two identical selections on the same node will return identical objects.
  16626. *
  16627. * @param {DOMElement} node
  16628. * @return {object}
  16629. */
  16630. function getSelection(node) {
  16631. if ('selectionStart' in node && ReactInputSelection.hasSelectionCapabilities(node)) {
  16632. return {
  16633. start: node.selectionStart,
  16634. end: node.selectionEnd
  16635. };
  16636. } else if (window.getSelection) {
  16637. var selection = window.getSelection();
  16638. return {
  16639. anchorNode: selection.anchorNode,
  16640. anchorOffset: selection.anchorOffset,
  16641. focusNode: selection.focusNode,
  16642. focusOffset: selection.focusOffset
  16643. };
  16644. } else if (document.selection) {
  16645. var range = document.selection.createRange();
  16646. return {
  16647. parentElement: range.parentElement(),
  16648. text: range.text,
  16649. top: range.boundingTop,
  16650. left: range.boundingLeft
  16651. };
  16652. }
  16653. }
  16654. /**
  16655. * Poll selection to see whether it's changed.
  16656. *
  16657. * @param {object} nativeEvent
  16658. * @return {?SyntheticEvent}
  16659. */
  16660. function constructSelectEvent(nativeEvent, nativeEventTarget) {
  16661. // Ensure we have the right element, and that the user is not dragging a
  16662. // selection (this matches native `select` event behavior). In HTML5, select
  16663. // fires only on input and textarea thus if there's no focused element we
  16664. // won't dispatch.
  16665. if (mouseDown || activeElement == null || activeElement !== getActiveElement()) {
  16666. return null;
  16667. }
  16668. // Only fire when selection has actually changed.
  16669. var currentSelection = getSelection(activeElement);
  16670. if (!lastSelection || !shallowEqual(lastSelection, currentSelection)) {
  16671. lastSelection = currentSelection;
  16672. var syntheticEvent = SyntheticEvent.getPooled(eventTypes.select, activeElementInst, nativeEvent, nativeEventTarget);
  16673. syntheticEvent.type = 'select';
  16674. syntheticEvent.target = activeElement;
  16675. EventPropagators.accumulateTwoPhaseDispatches(syntheticEvent);
  16676. return syntheticEvent;
  16677. }
  16678. return null;
  16679. }
  16680. /**
  16681. * This plugin creates an `onSelect` event that normalizes select events
  16682. * across form elements.
  16683. *
  16684. * Supported elements are:
  16685. * - input (see `isTextInputElement`)
  16686. * - textarea
  16687. * - contentEditable
  16688. *
  16689. * This differs from native browser implementations in the following ways:
  16690. * - Fires on contentEditable fields as well as inputs.
  16691. * - Fires for collapsed selection.
  16692. * - Fires after user input.
  16693. */
  16694. var SelectEventPlugin = {
  16695. eventTypes: eventTypes,
  16696. extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
  16697. if (!hasListener) {
  16698. return null;
  16699. }
  16700. var targetNode = targetInst ? ReactDOMComponentTree.getNodeFromInstance(targetInst) : window;
  16701. switch (topLevelType) {
  16702. // Track the input node that has focus.
  16703. case topLevelTypes.topFocus:
  16704. if (isTextInputElement(targetNode) || targetNode.contentEditable === 'true') {
  16705. activeElement = targetNode;
  16706. activeElementInst = targetInst;
  16707. lastSelection = null;
  16708. }
  16709. break;
  16710. case topLevelTypes.topBlur:
  16711. activeElement = null;
  16712. activeElementInst = null;
  16713. lastSelection = null;
  16714. break;
  16715. // Don't fire the event while the user is dragging. This matches the
  16716. // semantics of the native select event.
  16717. case topLevelTypes.topMouseDown:
  16718. mouseDown = true;
  16719. break;
  16720. case topLevelTypes.topContextMenu:
  16721. case topLevelTypes.topMouseUp:
  16722. mouseDown = false;
  16723. return constructSelectEvent(nativeEvent, nativeEventTarget);
  16724. // Chrome and IE fire non-standard event when selection is changed (and
  16725. // sometimes when it hasn't). IE's event fires out of order with respect
  16726. // to key and input events on deletion, so we discard it.
  16727. //
  16728. // Firefox doesn't support selectionchange, so check selection status
  16729. // after each key entry. The selection changes after keydown and before
  16730. // keyup, but we check on keydown as well in the case of holding down a
  16731. // key, when multiple keydown events are fired but only one keyup is.
  16732. // This is also our approach for IE handling, for the reason above.
  16733. case topLevelTypes.topSelectionChange:
  16734. if (skipSelectionChangeEvent) {
  16735. break;
  16736. }
  16737. // falls through
  16738. case topLevelTypes.topKeyDown:
  16739. case topLevelTypes.topKeyUp:
  16740. return constructSelectEvent(nativeEvent, nativeEventTarget);
  16741. }
  16742. return null;
  16743. },
  16744. didPutListener: function (inst, registrationName, listener) {
  16745. if (registrationName === ON_SELECT_KEY) {
  16746. hasListener = true;
  16747. }
  16748. }
  16749. };
  16750. module.exports = SelectEventPlugin;
  16751. /***/ },
  16752. /* 153 */
  16753. /***/ function(module, exports, __webpack_require__) {
  16754. /* WEBPACK VAR INJECTION */(function(process) {/**
  16755. * Copyright 2013-present, Facebook, Inc.
  16756. * All rights reserved.
  16757. *
  16758. * This source code is licensed under the BSD-style license found in the
  16759. * LICENSE file in the root directory of this source tree. An additional grant
  16760. * of patent rights can be found in the PATENTS file in the same directory.
  16761. *
  16762. * @providesModule SimpleEventPlugin
  16763. */
  16764. 'use strict';
  16765. var _prodInvariant = __webpack_require__(9);
  16766. var EventConstants = __webpack_require__(43);
  16767. var EventListener = __webpack_require__(140);
  16768. var EventPropagators = __webpack_require__(44);
  16769. var ReactDOMComponentTree = __webpack_require__(38);
  16770. var SyntheticAnimationEvent = __webpack_require__(154);
  16771. var SyntheticClipboardEvent = __webpack_require__(155);
  16772. var SyntheticEvent = __webpack_require__(55);
  16773. var SyntheticFocusEvent = __webpack_require__(156);
  16774. var SyntheticKeyboardEvent = __webpack_require__(157);
  16775. var SyntheticMouseEvent = __webpack_require__(77);
  16776. var SyntheticDragEvent = __webpack_require__(160);
  16777. var SyntheticTouchEvent = __webpack_require__(161);
  16778. var SyntheticTransitionEvent = __webpack_require__(162);
  16779. var SyntheticUIEvent = __webpack_require__(78);
  16780. var SyntheticWheelEvent = __webpack_require__(163);
  16781. var emptyFunction = __webpack_require__(14);
  16782. var getEventCharCode = __webpack_require__(158);
  16783. var invariant = __webpack_require__(10);
  16784. var keyOf = __webpack_require__(27);
  16785. var topLevelTypes = EventConstants.topLevelTypes;
  16786. var eventTypes = {
  16787. abort: {
  16788. phasedRegistrationNames: {
  16789. bubbled: keyOf({ onAbort: true }),
  16790. captured: keyOf({ onAbortCapture: true })
  16791. }
  16792. },
  16793. animationEnd: {
  16794. phasedRegistrationNames: {
  16795. bubbled: keyOf({ onAnimationEnd: true }),
  16796. captured: keyOf({ onAnimationEndCapture: true })
  16797. }
  16798. },
  16799. animationIteration: {
  16800. phasedRegistrationNames: {
  16801. bubbled: keyOf({ onAnimationIteration: true }),
  16802. captured: keyOf({ onAnimationIterationCapture: true })
  16803. }
  16804. },
  16805. animationStart: {
  16806. phasedRegistrationNames: {
  16807. bubbled: keyOf({ onAnimationStart: true }),
  16808. captured: keyOf({ onAnimationStartCapture: true })
  16809. }
  16810. },
  16811. blur: {
  16812. phasedRegistrationNames: {
  16813. bubbled: keyOf({ onBlur: true }),
  16814. captured: keyOf({ onBlurCapture: true })
  16815. }
  16816. },
  16817. canPlay: {
  16818. phasedRegistrationNames: {
  16819. bubbled: keyOf({ onCanPlay: true }),
  16820. captured: keyOf({ onCanPlayCapture: true })
  16821. }
  16822. },
  16823. canPlayThrough: {
  16824. phasedRegistrationNames: {
  16825. bubbled: keyOf({ onCanPlayThrough: true }),
  16826. captured: keyOf({ onCanPlayThroughCapture: true })
  16827. }
  16828. },
  16829. click: {
  16830. phasedRegistrationNames: {
  16831. bubbled: keyOf({ onClick: true }),
  16832. captured: keyOf({ onClickCapture: true })
  16833. }
  16834. },
  16835. contextMenu: {
  16836. phasedRegistrationNames: {
  16837. bubbled: keyOf({ onContextMenu: true }),
  16838. captured: keyOf({ onContextMenuCapture: true })
  16839. }
  16840. },
  16841. copy: {
  16842. phasedRegistrationNames: {
  16843. bubbled: keyOf({ onCopy: true }),
  16844. captured: keyOf({ onCopyCapture: true })
  16845. }
  16846. },
  16847. cut: {
  16848. phasedRegistrationNames: {
  16849. bubbled: keyOf({ onCut: true }),
  16850. captured: keyOf({ onCutCapture: true })
  16851. }
  16852. },
  16853. doubleClick: {
  16854. phasedRegistrationNames: {
  16855. bubbled: keyOf({ onDoubleClick: true }),
  16856. captured: keyOf({ onDoubleClickCapture: true })
  16857. }
  16858. },
  16859. drag: {
  16860. phasedRegistrationNames: {
  16861. bubbled: keyOf({ onDrag: true }),
  16862. captured: keyOf({ onDragCapture: true })
  16863. }
  16864. },
  16865. dragEnd: {
  16866. phasedRegistrationNames: {
  16867. bubbled: keyOf({ onDragEnd: true }),
  16868. captured: keyOf({ onDragEndCapture: true })
  16869. }
  16870. },
  16871. dragEnter: {
  16872. phasedRegistrationNames: {
  16873. bubbled: keyOf({ onDragEnter: true }),
  16874. captured: keyOf({ onDragEnterCapture: true })
  16875. }
  16876. },
  16877. dragExit: {
  16878. phasedRegistrationNames: {
  16879. bubbled: keyOf({ onDragExit: true }),
  16880. captured: keyOf({ onDragExitCapture: true })
  16881. }
  16882. },
  16883. dragLeave: {
  16884. phasedRegistrationNames: {
  16885. bubbled: keyOf({ onDragLeave: true }),
  16886. captured: keyOf({ onDragLeaveCapture: true })
  16887. }
  16888. },
  16889. dragOver: {
  16890. phasedRegistrationNames: {
  16891. bubbled: keyOf({ onDragOver: true }),
  16892. captured: keyOf({ onDragOverCapture: true })
  16893. }
  16894. },
  16895. dragStart: {
  16896. phasedRegistrationNames: {
  16897. bubbled: keyOf({ onDragStart: true }),
  16898. captured: keyOf({ onDragStartCapture: true })
  16899. }
  16900. },
  16901. drop: {
  16902. phasedRegistrationNames: {
  16903. bubbled: keyOf({ onDrop: true }),
  16904. captured: keyOf({ onDropCapture: true })
  16905. }
  16906. },
  16907. durationChange: {
  16908. phasedRegistrationNames: {
  16909. bubbled: keyOf({ onDurationChange: true }),
  16910. captured: keyOf({ onDurationChangeCapture: true })
  16911. }
  16912. },
  16913. emptied: {
  16914. phasedRegistrationNames: {
  16915. bubbled: keyOf({ onEmptied: true }),
  16916. captured: keyOf({ onEmptiedCapture: true })
  16917. }
  16918. },
  16919. encrypted: {
  16920. phasedRegistrationNames: {
  16921. bubbled: keyOf({ onEncrypted: true }),
  16922. captured: keyOf({ onEncryptedCapture: true })
  16923. }
  16924. },
  16925. ended: {
  16926. phasedRegistrationNames: {
  16927. bubbled: keyOf({ onEnded: true }),
  16928. captured: keyOf({ onEndedCapture: true })
  16929. }
  16930. },
  16931. error: {
  16932. phasedRegistrationNames: {
  16933. bubbled: keyOf({ onError: true }),
  16934. captured: keyOf({ onErrorCapture: true })
  16935. }
  16936. },
  16937. focus: {
  16938. phasedRegistrationNames: {
  16939. bubbled: keyOf({ onFocus: true }),
  16940. captured: keyOf({ onFocusCapture: true })
  16941. }
  16942. },
  16943. input: {
  16944. phasedRegistrationNames: {
  16945. bubbled: keyOf({ onInput: true }),
  16946. captured: keyOf({ onInputCapture: true })
  16947. }
  16948. },
  16949. invalid: {
  16950. phasedRegistrationNames: {
  16951. bubbled: keyOf({ onInvalid: true }),
  16952. captured: keyOf({ onInvalidCapture: true })
  16953. }
  16954. },
  16955. keyDown: {
  16956. phasedRegistrationNames: {
  16957. bubbled: keyOf({ onKeyDown: true }),
  16958. captured: keyOf({ onKeyDownCapture: true })
  16959. }
  16960. },
  16961. keyPress: {
  16962. phasedRegistrationNames: {
  16963. bubbled: keyOf({ onKeyPress: true }),
  16964. captured: keyOf({ onKeyPressCapture: true })
  16965. }
  16966. },
  16967. keyUp: {
  16968. phasedRegistrationNames: {
  16969. bubbled: keyOf({ onKeyUp: true }),
  16970. captured: keyOf({ onKeyUpCapture: true })
  16971. }
  16972. },
  16973. load: {
  16974. phasedRegistrationNames: {
  16975. bubbled: keyOf({ onLoad: true }),
  16976. captured: keyOf({ onLoadCapture: true })
  16977. }
  16978. },
  16979. loadedData: {
  16980. phasedRegistrationNames: {
  16981. bubbled: keyOf({ onLoadedData: true }),
  16982. captured: keyOf({ onLoadedDataCapture: true })
  16983. }
  16984. },
  16985. loadedMetadata: {
  16986. phasedRegistrationNames: {
  16987. bubbled: keyOf({ onLoadedMetadata: true }),
  16988. captured: keyOf({ onLoadedMetadataCapture: true })
  16989. }
  16990. },
  16991. loadStart: {
  16992. phasedRegistrationNames: {
  16993. bubbled: keyOf({ onLoadStart: true }),
  16994. captured: keyOf({ onLoadStartCapture: true })
  16995. }
  16996. },
  16997. // Note: We do not allow listening to mouseOver events. Instead, use the
  16998. // onMouseEnter/onMouseLeave created by `EnterLeaveEventPlugin`.
  16999. mouseDown: {
  17000. phasedRegistrationNames: {
  17001. bubbled: keyOf({ onMouseDown: true }),
  17002. captured: keyOf({ onMouseDownCapture: true })
  17003. }
  17004. },
  17005. mouseMove: {
  17006. phasedRegistrationNames: {
  17007. bubbled: keyOf({ onMouseMove: true }),
  17008. captured: keyOf({ onMouseMoveCapture: true })
  17009. }
  17010. },
  17011. mouseOut: {
  17012. phasedRegistrationNames: {
  17013. bubbled: keyOf({ onMouseOut: true }),
  17014. captured: keyOf({ onMouseOutCapture: true })
  17015. }
  17016. },
  17017. mouseOver: {
  17018. phasedRegistrationNames: {
  17019. bubbled: keyOf({ onMouseOver: true }),
  17020. captured: keyOf({ onMouseOverCapture: true })
  17021. }
  17022. },
  17023. mouseUp: {
  17024. phasedRegistrationNames: {
  17025. bubbled: keyOf({ onMouseUp: true }),
  17026. captured: keyOf({ onMouseUpCapture: true })
  17027. }
  17028. },
  17029. paste: {
  17030. phasedRegistrationNames: {
  17031. bubbled: keyOf({ onPaste: true }),
  17032. captured: keyOf({ onPasteCapture: true })
  17033. }
  17034. },
  17035. pause: {
  17036. phasedRegistrationNames: {
  17037. bubbled: keyOf({ onPause: true }),
  17038. captured: keyOf({ onPauseCapture: true })
  17039. }
  17040. },
  17041. play: {
  17042. phasedRegistrationNames: {
  17043. bubbled: keyOf({ onPlay: true }),
  17044. captured: keyOf({ onPlayCapture: true })
  17045. }
  17046. },
  17047. playing: {
  17048. phasedRegistrationNames: {
  17049. bubbled: keyOf({ onPlaying: true }),
  17050. captured: keyOf({ onPlayingCapture: true })
  17051. }
  17052. },
  17053. progress: {
  17054. phasedRegistrationNames: {
  17055. bubbled: keyOf({ onProgress: true }),
  17056. captured: keyOf({ onProgressCapture: true })
  17057. }
  17058. },
  17059. rateChange: {
  17060. phasedRegistrationNames: {
  17061. bubbled: keyOf({ onRateChange: true }),
  17062. captured: keyOf({ onRateChangeCapture: true })
  17063. }
  17064. },
  17065. reset: {
  17066. phasedRegistrationNames: {
  17067. bubbled: keyOf({ onReset: true }),
  17068. captured: keyOf({ onResetCapture: true })
  17069. }
  17070. },
  17071. scroll: {
  17072. phasedRegistrationNames: {
  17073. bubbled: keyOf({ onScroll: true }),
  17074. captured: keyOf({ onScrollCapture: true })
  17075. }
  17076. },
  17077. seeked: {
  17078. phasedRegistrationNames: {
  17079. bubbled: keyOf({ onSeeked: true }),
  17080. captured: keyOf({ onSeekedCapture: true })
  17081. }
  17082. },
  17083. seeking: {
  17084. phasedRegistrationNames: {
  17085. bubbled: keyOf({ onSeeking: true }),
  17086. captured: keyOf({ onSeekingCapture: true })
  17087. }
  17088. },
  17089. stalled: {
  17090. phasedRegistrationNames: {
  17091. bubbled: keyOf({ onStalled: true }),
  17092. captured: keyOf({ onStalledCapture: true })
  17093. }
  17094. },
  17095. submit: {
  17096. phasedRegistrationNames: {
  17097. bubbled: keyOf({ onSubmit: true }),
  17098. captured: keyOf({ onSubmitCapture: true })
  17099. }
  17100. },
  17101. suspend: {
  17102. phasedRegistrationNames: {
  17103. bubbled: keyOf({ onSuspend: true }),
  17104. captured: keyOf({ onSuspendCapture: true })
  17105. }
  17106. },
  17107. timeUpdate: {
  17108. phasedRegistrationNames: {
  17109. bubbled: keyOf({ onTimeUpdate: true }),
  17110. captured: keyOf({ onTimeUpdateCapture: true })
  17111. }
  17112. },
  17113. touchCancel: {
  17114. phasedRegistrationNames: {
  17115. bubbled: keyOf({ onTouchCancel: true }),
  17116. captured: keyOf({ onTouchCancelCapture: true })
  17117. }
  17118. },
  17119. touchEnd: {
  17120. phasedRegistrationNames: {
  17121. bubbled: keyOf({ onTouchEnd: true }),
  17122. captured: keyOf({ onTouchEndCapture: true })
  17123. }
  17124. },
  17125. touchMove: {
  17126. phasedRegistrationNames: {
  17127. bubbled: keyOf({ onTouchMove: true }),
  17128. captured: keyOf({ onTouchMoveCapture: true })
  17129. }
  17130. },
  17131. touchStart: {
  17132. phasedRegistrationNames: {
  17133. bubbled: keyOf({ onTouchStart: true }),
  17134. captured: keyOf({ onTouchStartCapture: true })
  17135. }
  17136. },
  17137. transitionEnd: {
  17138. phasedRegistrationNames: {
  17139. bubbled: keyOf({ onTransitionEnd: true }),
  17140. captured: keyOf({ onTransitionEndCapture: true })
  17141. }
  17142. },
  17143. volumeChange: {
  17144. phasedRegistrationNames: {
  17145. bubbled: keyOf({ onVolumeChange: true }),
  17146. captured: keyOf({ onVolumeChangeCapture: true })
  17147. }
  17148. },
  17149. waiting: {
  17150. phasedRegistrationNames: {
  17151. bubbled: keyOf({ onWaiting: true }),
  17152. captured: keyOf({ onWaitingCapture: true })
  17153. }
  17154. },
  17155. wheel: {
  17156. phasedRegistrationNames: {
  17157. bubbled: keyOf({ onWheel: true }),
  17158. captured: keyOf({ onWheelCapture: true })
  17159. }
  17160. }
  17161. };
  17162. var topLevelEventsToDispatchConfig = {
  17163. topAbort: eventTypes.abort,
  17164. topAnimationEnd: eventTypes.animationEnd,
  17165. topAnimationIteration: eventTypes.animationIteration,
  17166. topAnimationStart: eventTypes.animationStart,
  17167. topBlur: eventTypes.blur,
  17168. topCanPlay: eventTypes.canPlay,
  17169. topCanPlayThrough: eventTypes.canPlayThrough,
  17170. topClick: eventTypes.click,
  17171. topContextMenu: eventTypes.contextMenu,
  17172. topCopy: eventTypes.copy,
  17173. topCut: eventTypes.cut,
  17174. topDoubleClick: eventTypes.doubleClick,
  17175. topDrag: eventTypes.drag,
  17176. topDragEnd: eventTypes.dragEnd,
  17177. topDragEnter: eventTypes.dragEnter,
  17178. topDragExit: eventTypes.dragExit,
  17179. topDragLeave: eventTypes.dragLeave,
  17180. topDragOver: eventTypes.dragOver,
  17181. topDragStart: eventTypes.dragStart,
  17182. topDrop: eventTypes.drop,
  17183. topDurationChange: eventTypes.durationChange,
  17184. topEmptied: eventTypes.emptied,
  17185. topEncrypted: eventTypes.encrypted,
  17186. topEnded: eventTypes.ended,
  17187. topError: eventTypes.error,
  17188. topFocus: eventTypes.focus,
  17189. topInput: eventTypes.input,
  17190. topInvalid: eventTypes.invalid,
  17191. topKeyDown: eventTypes.keyDown,
  17192. topKeyPress: eventTypes.keyPress,
  17193. topKeyUp: eventTypes.keyUp,
  17194. topLoad: eventTypes.load,
  17195. topLoadedData: eventTypes.loadedData,
  17196. topLoadedMetadata: eventTypes.loadedMetadata,
  17197. topLoadStart: eventTypes.loadStart,
  17198. topMouseDown: eventTypes.mouseDown,
  17199. topMouseMove: eventTypes.mouseMove,
  17200. topMouseOut: eventTypes.mouseOut,
  17201. topMouseOver: eventTypes.mouseOver,
  17202. topMouseUp: eventTypes.mouseUp,
  17203. topPaste: eventTypes.paste,
  17204. topPause: eventTypes.pause,
  17205. topPlay: eventTypes.play,
  17206. topPlaying: eventTypes.playing,
  17207. topProgress: eventTypes.progress,
  17208. topRateChange: eventTypes.rateChange,
  17209. topReset: eventTypes.reset,
  17210. topScroll: eventTypes.scroll,
  17211. topSeeked: eventTypes.seeked,
  17212. topSeeking: eventTypes.seeking,
  17213. topStalled: eventTypes.stalled,
  17214. topSubmit: eventTypes.submit,
  17215. topSuspend: eventTypes.suspend,
  17216. topTimeUpdate: eventTypes.timeUpdate,
  17217. topTouchCancel: eventTypes.touchCancel,
  17218. topTouchEnd: eventTypes.touchEnd,
  17219. topTouchMove: eventTypes.touchMove,
  17220. topTouchStart: eventTypes.touchStart,
  17221. topTransitionEnd: eventTypes.transitionEnd,
  17222. topVolumeChange: eventTypes.volumeChange,
  17223. topWaiting: eventTypes.waiting,
  17224. topWheel: eventTypes.wheel
  17225. };
  17226. for (var type in topLevelEventsToDispatchConfig) {
  17227. topLevelEventsToDispatchConfig[type].dependencies = [type];
  17228. }
  17229. var ON_CLICK_KEY = keyOf({ onClick: null });
  17230. var onClickListeners = {};
  17231. function getDictionaryKey(inst) {
  17232. // Prevents V8 performance issue:
  17233. // https://github.com/facebook/react/pull/7232
  17234. return '.' + inst._rootNodeID;
  17235. }
  17236. var SimpleEventPlugin = {
  17237. eventTypes: eventTypes,
  17238. extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
  17239. var dispatchConfig = topLevelEventsToDispatchConfig[topLevelType];
  17240. if (!dispatchConfig) {
  17241. return null;
  17242. }
  17243. var EventConstructor;
  17244. switch (topLevelType) {
  17245. case topLevelTypes.topAbort:
  17246. case topLevelTypes.topCanPlay:
  17247. case topLevelTypes.topCanPlayThrough:
  17248. case topLevelTypes.topDurationChange:
  17249. case topLevelTypes.topEmptied:
  17250. case topLevelTypes.topEncrypted:
  17251. case topLevelTypes.topEnded:
  17252. case topLevelTypes.topError:
  17253. case topLevelTypes.topInput:
  17254. case topLevelTypes.topInvalid:
  17255. case topLevelTypes.topLoad:
  17256. case topLevelTypes.topLoadedData:
  17257. case topLevelTypes.topLoadedMetadata:
  17258. case topLevelTypes.topLoadStart:
  17259. case topLevelTypes.topPause:
  17260. case topLevelTypes.topPlay:
  17261. case topLevelTypes.topPlaying:
  17262. case topLevelTypes.topProgress:
  17263. case topLevelTypes.topRateChange:
  17264. case topLevelTypes.topReset:
  17265. case topLevelTypes.topSeeked:
  17266. case topLevelTypes.topSeeking:
  17267. case topLevelTypes.topStalled:
  17268. case topLevelTypes.topSubmit:
  17269. case topLevelTypes.topSuspend:
  17270. case topLevelTypes.topTimeUpdate:
  17271. case topLevelTypes.topVolumeChange:
  17272. case topLevelTypes.topWaiting:
  17273. // HTML Events
  17274. // @see http://www.w3.org/TR/html5/index.html#events-0
  17275. EventConstructor = SyntheticEvent;
  17276. break;
  17277. case topLevelTypes.topKeyPress:
  17278. // Firefox creates a keypress event for function keys too. This removes
  17279. // the unwanted keypress events. Enter is however both printable and
  17280. // non-printable. One would expect Tab to be as well (but it isn't).
  17281. if (getEventCharCode(nativeEvent) === 0) {
  17282. return null;
  17283. }
  17284. /* falls through */
  17285. case topLevelTypes.topKeyDown:
  17286. case topLevelTypes.topKeyUp:
  17287. EventConstructor = SyntheticKeyboardEvent;
  17288. break;
  17289. case topLevelTypes.topBlur:
  17290. case topLevelTypes.topFocus:
  17291. EventConstructor = SyntheticFocusEvent;
  17292. break;
  17293. case topLevelTypes.topClick:
  17294. // Firefox creates a click event on right mouse clicks. This removes the
  17295. // unwanted click events.
  17296. if (nativeEvent.button === 2) {
  17297. return null;
  17298. }
  17299. /* falls through */
  17300. case topLevelTypes.topContextMenu:
  17301. case topLevelTypes.topDoubleClick:
  17302. case topLevelTypes.topMouseDown:
  17303. case topLevelTypes.topMouseMove:
  17304. case topLevelTypes.topMouseOut:
  17305. case topLevelTypes.topMouseOver:
  17306. case topLevelTypes.topMouseUp:
  17307. EventConstructor = SyntheticMouseEvent;
  17308. break;
  17309. case topLevelTypes.topDrag:
  17310. case topLevelTypes.topDragEnd:
  17311. case topLevelTypes.topDragEnter:
  17312. case topLevelTypes.topDragExit:
  17313. case topLevelTypes.topDragLeave:
  17314. case topLevelTypes.topDragOver:
  17315. case topLevelTypes.topDragStart:
  17316. case topLevelTypes.topDrop:
  17317. EventConstructor = SyntheticDragEvent;
  17318. break;
  17319. case topLevelTypes.topTouchCancel:
  17320. case topLevelTypes.topTouchEnd:
  17321. case topLevelTypes.topTouchMove:
  17322. case topLevelTypes.topTouchStart:
  17323. EventConstructor = SyntheticTouchEvent;
  17324. break;
  17325. case topLevelTypes.topAnimationEnd:
  17326. case topLevelTypes.topAnimationIteration:
  17327. case topLevelTypes.topAnimationStart:
  17328. EventConstructor = SyntheticAnimationEvent;
  17329. break;
  17330. case topLevelTypes.topTransitionEnd:
  17331. EventConstructor = SyntheticTransitionEvent;
  17332. break;
  17333. case topLevelTypes.topScroll:
  17334. EventConstructor = SyntheticUIEvent;
  17335. break;
  17336. case topLevelTypes.topWheel:
  17337. EventConstructor = SyntheticWheelEvent;
  17338. break;
  17339. case topLevelTypes.topCopy:
  17340. case topLevelTypes.topCut:
  17341. case topLevelTypes.topPaste:
  17342. EventConstructor = SyntheticClipboardEvent;
  17343. break;
  17344. }
  17345. !EventConstructor ? process.env.NODE_ENV !== 'production' ? invariant(false, 'SimpleEventPlugin: Unhandled event type, `%s`.', topLevelType) : _prodInvariant('86', topLevelType) : void 0;
  17346. var event = EventConstructor.getPooled(dispatchConfig, targetInst, nativeEvent, nativeEventTarget);
  17347. EventPropagators.accumulateTwoPhaseDispatches(event);
  17348. return event;
  17349. },
  17350. didPutListener: function (inst, registrationName, listener) {
  17351. // Mobile Safari does not fire properly bubble click events on
  17352. // non-interactive elements, which means delegated click listeners do not
  17353. // fire. The workaround for this bug involves attaching an empty click
  17354. // listener on the target node.
  17355. if (registrationName === ON_CLICK_KEY) {
  17356. var key = getDictionaryKey(inst);
  17357. var node = ReactDOMComponentTree.getNodeFromInstance(inst);
  17358. if (!onClickListeners[key]) {
  17359. onClickListeners[key] = EventListener.listen(node, 'click', emptyFunction);
  17360. }
  17361. }
  17362. },
  17363. willDeleteListener: function (inst, registrationName) {
  17364. if (registrationName === ON_CLICK_KEY) {
  17365. var key = getDictionaryKey(inst);
  17366. onClickListeners[key].remove();
  17367. delete onClickListeners[key];
  17368. }
  17369. }
  17370. };
  17371. module.exports = SimpleEventPlugin;
  17372. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  17373. /***/ },
  17374. /* 154 */
  17375. /***/ function(module, exports, __webpack_require__) {
  17376. /**
  17377. * Copyright 2013-present, Facebook, Inc.
  17378. * All rights reserved.
  17379. *
  17380. * This source code is licensed under the BSD-style license found in the
  17381. * LICENSE file in the root directory of this source tree. An additional grant
  17382. * of patent rights can be found in the PATENTS file in the same directory.
  17383. *
  17384. * @providesModule SyntheticAnimationEvent
  17385. */
  17386. 'use strict';
  17387. var SyntheticEvent = __webpack_require__(55);
  17388. /**
  17389. * @interface Event
  17390. * @see http://www.w3.org/TR/css3-animations/#AnimationEvent-interface
  17391. * @see https://developer.mozilla.org/en-US/docs/Web/API/AnimationEvent
  17392. */
  17393. var AnimationEventInterface = {
  17394. animationName: null,
  17395. elapsedTime: null,
  17396. pseudoElement: null
  17397. };
  17398. /**
  17399. * @param {object} dispatchConfig Configuration used to dispatch this event.
  17400. * @param {string} dispatchMarker Marker identifying the event target.
  17401. * @param {object} nativeEvent Native browser event.
  17402. * @extends {SyntheticEvent}
  17403. */
  17404. function SyntheticAnimationEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
  17405. return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
  17406. }
  17407. SyntheticEvent.augmentClass(SyntheticAnimationEvent, AnimationEventInterface);
  17408. module.exports = SyntheticAnimationEvent;
  17409. /***/ },
  17410. /* 155 */
  17411. /***/ function(module, exports, __webpack_require__) {
  17412. /**
  17413. * Copyright 2013-present, Facebook, Inc.
  17414. * All rights reserved.
  17415. *
  17416. * This source code is licensed under the BSD-style license found in the
  17417. * LICENSE file in the root directory of this source tree. An additional grant
  17418. * of patent rights can be found in the PATENTS file in the same directory.
  17419. *
  17420. * @providesModule SyntheticClipboardEvent
  17421. */
  17422. 'use strict';
  17423. var SyntheticEvent = __webpack_require__(55);
  17424. /**
  17425. * @interface Event
  17426. * @see http://www.w3.org/TR/clipboard-apis/
  17427. */
  17428. var ClipboardEventInterface = {
  17429. clipboardData: function (event) {
  17430. return 'clipboardData' in event ? event.clipboardData : window.clipboardData;
  17431. }
  17432. };
  17433. /**
  17434. * @param {object} dispatchConfig Configuration used to dispatch this event.
  17435. * @param {string} dispatchMarker Marker identifying the event target.
  17436. * @param {object} nativeEvent Native browser event.
  17437. * @extends {SyntheticUIEvent}
  17438. */
  17439. function SyntheticClipboardEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
  17440. return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
  17441. }
  17442. SyntheticEvent.augmentClass(SyntheticClipboardEvent, ClipboardEventInterface);
  17443. module.exports = SyntheticClipboardEvent;
  17444. /***/ },
  17445. /* 156 */
  17446. /***/ function(module, exports, __webpack_require__) {
  17447. /**
  17448. * Copyright 2013-present, Facebook, Inc.
  17449. * All rights reserved.
  17450. *
  17451. * This source code is licensed under the BSD-style license found in the
  17452. * LICENSE file in the root directory of this source tree. An additional grant
  17453. * of patent rights can be found in the PATENTS file in the same directory.
  17454. *
  17455. * @providesModule SyntheticFocusEvent
  17456. */
  17457. 'use strict';
  17458. var SyntheticUIEvent = __webpack_require__(78);
  17459. /**
  17460. * @interface FocusEvent
  17461. * @see http://www.w3.org/TR/DOM-Level-3-Events/
  17462. */
  17463. var FocusEventInterface = {
  17464. relatedTarget: null
  17465. };
  17466. /**
  17467. * @param {object} dispatchConfig Configuration used to dispatch this event.
  17468. * @param {string} dispatchMarker Marker identifying the event target.
  17469. * @param {object} nativeEvent Native browser event.
  17470. * @extends {SyntheticUIEvent}
  17471. */
  17472. function SyntheticFocusEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
  17473. return SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
  17474. }
  17475. SyntheticUIEvent.augmentClass(SyntheticFocusEvent, FocusEventInterface);
  17476. module.exports = SyntheticFocusEvent;
  17477. /***/ },
  17478. /* 157 */
  17479. /***/ function(module, exports, __webpack_require__) {
  17480. /**
  17481. * Copyright 2013-present, Facebook, Inc.
  17482. * All rights reserved.
  17483. *
  17484. * This source code is licensed under the BSD-style license found in the
  17485. * LICENSE file in the root directory of this source tree. An additional grant
  17486. * of patent rights can be found in the PATENTS file in the same directory.
  17487. *
  17488. * @providesModule SyntheticKeyboardEvent
  17489. */
  17490. 'use strict';
  17491. var SyntheticUIEvent = __webpack_require__(78);
  17492. var getEventCharCode = __webpack_require__(158);
  17493. var getEventKey = __webpack_require__(159);
  17494. var getEventModifierState = __webpack_require__(80);
  17495. /**
  17496. * @interface KeyboardEvent
  17497. * @see http://www.w3.org/TR/DOM-Level-3-Events/
  17498. */
  17499. var KeyboardEventInterface = {
  17500. key: getEventKey,
  17501. location: null,
  17502. ctrlKey: null,
  17503. shiftKey: null,
  17504. altKey: null,
  17505. metaKey: null,
  17506. repeat: null,
  17507. locale: null,
  17508. getModifierState: getEventModifierState,
  17509. // Legacy Interface
  17510. charCode: function (event) {
  17511. // `charCode` is the result of a KeyPress event and represents the value of
  17512. // the actual printable character.
  17513. // KeyPress is deprecated, but its replacement is not yet final and not
  17514. // implemented in any major browser. Only KeyPress has charCode.
  17515. if (event.type === 'keypress') {
  17516. return getEventCharCode(event);
  17517. }
  17518. return 0;
  17519. },
  17520. keyCode: function (event) {
  17521. // `keyCode` is the result of a KeyDown/Up event and represents the value of
  17522. // physical keyboard key.
  17523. // The actual meaning of the value depends on the users' keyboard layout
  17524. // which cannot be detected. Assuming that it is a US keyboard layout
  17525. // provides a surprisingly accurate mapping for US and European users.
  17526. // Due to this, it is left to the user to implement at this time.
  17527. if (event.type === 'keydown' || event.type === 'keyup') {
  17528. return event.keyCode;
  17529. }
  17530. return 0;
  17531. },
  17532. which: function (event) {
  17533. // `which` is an alias for either `keyCode` or `charCode` depending on the
  17534. // type of the event.
  17535. if (event.type === 'keypress') {
  17536. return getEventCharCode(event);
  17537. }
  17538. if (event.type === 'keydown' || event.type === 'keyup') {
  17539. return event.keyCode;
  17540. }
  17541. return 0;
  17542. }
  17543. };
  17544. /**
  17545. * @param {object} dispatchConfig Configuration used to dispatch this event.
  17546. * @param {string} dispatchMarker Marker identifying the event target.
  17547. * @param {object} nativeEvent Native browser event.
  17548. * @extends {SyntheticUIEvent}
  17549. */
  17550. function SyntheticKeyboardEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
  17551. return SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
  17552. }
  17553. SyntheticUIEvent.augmentClass(SyntheticKeyboardEvent, KeyboardEventInterface);
  17554. module.exports = SyntheticKeyboardEvent;
  17555. /***/ },
  17556. /* 158 */
  17557. /***/ function(module, exports) {
  17558. /**
  17559. * Copyright 2013-present, Facebook, Inc.
  17560. * All rights reserved.
  17561. *
  17562. * This source code is licensed under the BSD-style license found in the
  17563. * LICENSE file in the root directory of this source tree. An additional grant
  17564. * of patent rights can be found in the PATENTS file in the same directory.
  17565. *
  17566. * @providesModule getEventCharCode
  17567. */
  17568. 'use strict';
  17569. /**
  17570. * `charCode` represents the actual "character code" and is safe to use with
  17571. * `String.fromCharCode`. As such, only keys that correspond to printable
  17572. * characters produce a valid `charCode`, the only exception to this is Enter.
  17573. * The Tab-key is considered non-printable and does not have a `charCode`,
  17574. * presumably because it does not produce a tab-character in browsers.
  17575. *
  17576. * @param {object} nativeEvent Native browser event.
  17577. * @return {number} Normalized `charCode` property.
  17578. */
  17579. function getEventCharCode(nativeEvent) {
  17580. var charCode;
  17581. var keyCode = nativeEvent.keyCode;
  17582. if ('charCode' in nativeEvent) {
  17583. charCode = nativeEvent.charCode;
  17584. // FF does not set `charCode` for the Enter-key, check against `keyCode`.
  17585. if (charCode === 0 && keyCode === 13) {
  17586. charCode = 13;
  17587. }
  17588. } else {
  17589. // IE8 does not implement `charCode`, but `keyCode` has the correct value.
  17590. charCode = keyCode;
  17591. }
  17592. // Some non-printable keys are reported in `charCode`/`keyCode`, discard them.
  17593. // Must not discard the (non-)printable Enter-key.
  17594. if (charCode >= 32 || charCode === 13) {
  17595. return charCode;
  17596. }
  17597. return 0;
  17598. }
  17599. module.exports = getEventCharCode;
  17600. /***/ },
  17601. /* 159 */
  17602. /***/ function(module, exports, __webpack_require__) {
  17603. /**
  17604. * Copyright 2013-present, Facebook, Inc.
  17605. * All rights reserved.
  17606. *
  17607. * This source code is licensed under the BSD-style license found in the
  17608. * LICENSE file in the root directory of this source tree. An additional grant
  17609. * of patent rights can be found in the PATENTS file in the same directory.
  17610. *
  17611. * @providesModule getEventKey
  17612. */
  17613. 'use strict';
  17614. var getEventCharCode = __webpack_require__(158);
  17615. /**
  17616. * Normalization of deprecated HTML5 `key` values
  17617. * @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_names
  17618. */
  17619. var normalizeKey = {
  17620. 'Esc': 'Escape',
  17621. 'Spacebar': ' ',
  17622. 'Left': 'ArrowLeft',
  17623. 'Up': 'ArrowUp',
  17624. 'Right': 'ArrowRight',
  17625. 'Down': 'ArrowDown',
  17626. 'Del': 'Delete',
  17627. 'Win': 'OS',
  17628. 'Menu': 'ContextMenu',
  17629. 'Apps': 'ContextMenu',
  17630. 'Scroll': 'ScrollLock',
  17631. 'MozPrintableKey': 'Unidentified'
  17632. };
  17633. /**
  17634. * Translation from legacy `keyCode` to HTML5 `key`
  17635. * Only special keys supported, all others depend on keyboard layout or browser
  17636. * @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_names
  17637. */
  17638. var translateToKey = {
  17639. 8: 'Backspace',
  17640. 9: 'Tab',
  17641. 12: 'Clear',
  17642. 13: 'Enter',
  17643. 16: 'Shift',
  17644. 17: 'Control',
  17645. 18: 'Alt',
  17646. 19: 'Pause',
  17647. 20: 'CapsLock',
  17648. 27: 'Escape',
  17649. 32: ' ',
  17650. 33: 'PageUp',
  17651. 34: 'PageDown',
  17652. 35: 'End',
  17653. 36: 'Home',
  17654. 37: 'ArrowLeft',
  17655. 38: 'ArrowUp',
  17656. 39: 'ArrowRight',
  17657. 40: 'ArrowDown',
  17658. 45: 'Insert',
  17659. 46: 'Delete',
  17660. 112: 'F1', 113: 'F2', 114: 'F3', 115: 'F4', 116: 'F5', 117: 'F6',
  17661. 118: 'F7', 119: 'F8', 120: 'F9', 121: 'F10', 122: 'F11', 123: 'F12',
  17662. 144: 'NumLock',
  17663. 145: 'ScrollLock',
  17664. 224: 'Meta'
  17665. };
  17666. /**
  17667. * @param {object} nativeEvent Native browser event.
  17668. * @return {string} Normalized `key` property.
  17669. */
  17670. function getEventKey(nativeEvent) {
  17671. if (nativeEvent.key) {
  17672. // Normalize inconsistent values reported by browsers due to
  17673. // implementations of a working draft specification.
  17674. // FireFox implements `key` but returns `MozPrintableKey` for all
  17675. // printable characters (normalized to `Unidentified`), ignore it.
  17676. var key = normalizeKey[nativeEvent.key] || nativeEvent.key;
  17677. if (key !== 'Unidentified') {
  17678. return key;
  17679. }
  17680. }
  17681. // Browser does not implement `key`, polyfill as much of it as we can.
  17682. if (nativeEvent.type === 'keypress') {
  17683. var charCode = getEventCharCode(nativeEvent);
  17684. // The enter-key is technically both printable and non-printable and can
  17685. // thus be captured by `keypress`, no other non-printable key should.
  17686. return charCode === 13 ? 'Enter' : String.fromCharCode(charCode);
  17687. }
  17688. if (nativeEvent.type === 'keydown' || nativeEvent.type === 'keyup') {
  17689. // While user keyboard layout determines the actual meaning of each
  17690. // `keyCode` value, almost all function keys have a universal value.
  17691. return translateToKey[nativeEvent.keyCode] || 'Unidentified';
  17692. }
  17693. return '';
  17694. }
  17695. module.exports = getEventKey;
  17696. /***/ },
  17697. /* 160 */
  17698. /***/ function(module, exports, __webpack_require__) {
  17699. /**
  17700. * Copyright 2013-present, Facebook, Inc.
  17701. * All rights reserved.
  17702. *
  17703. * This source code is licensed under the BSD-style license found in the
  17704. * LICENSE file in the root directory of this source tree. An additional grant
  17705. * of patent rights can be found in the PATENTS file in the same directory.
  17706. *
  17707. * @providesModule SyntheticDragEvent
  17708. */
  17709. 'use strict';
  17710. var SyntheticMouseEvent = __webpack_require__(77);
  17711. /**
  17712. * @interface DragEvent
  17713. * @see http://www.w3.org/TR/DOM-Level-3-Events/
  17714. */
  17715. var DragEventInterface = {
  17716. dataTransfer: null
  17717. };
  17718. /**
  17719. * @param {object} dispatchConfig Configuration used to dispatch this event.
  17720. * @param {string} dispatchMarker Marker identifying the event target.
  17721. * @param {object} nativeEvent Native browser event.
  17722. * @extends {SyntheticUIEvent}
  17723. */
  17724. function SyntheticDragEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
  17725. return SyntheticMouseEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
  17726. }
  17727. SyntheticMouseEvent.augmentClass(SyntheticDragEvent, DragEventInterface);
  17728. module.exports = SyntheticDragEvent;
  17729. /***/ },
  17730. /* 161 */
  17731. /***/ function(module, exports, __webpack_require__) {
  17732. /**
  17733. * Copyright 2013-present, Facebook, Inc.
  17734. * All rights reserved.
  17735. *
  17736. * This source code is licensed under the BSD-style license found in the
  17737. * LICENSE file in the root directory of this source tree. An additional grant
  17738. * of patent rights can be found in the PATENTS file in the same directory.
  17739. *
  17740. * @providesModule SyntheticTouchEvent
  17741. */
  17742. 'use strict';
  17743. var SyntheticUIEvent = __webpack_require__(78);
  17744. var getEventModifierState = __webpack_require__(80);
  17745. /**
  17746. * @interface TouchEvent
  17747. * @see http://www.w3.org/TR/touch-events/
  17748. */
  17749. var TouchEventInterface = {
  17750. touches: null,
  17751. targetTouches: null,
  17752. changedTouches: null,
  17753. altKey: null,
  17754. metaKey: null,
  17755. ctrlKey: null,
  17756. shiftKey: null,
  17757. getModifierState: getEventModifierState
  17758. };
  17759. /**
  17760. * @param {object} dispatchConfig Configuration used to dispatch this event.
  17761. * @param {string} dispatchMarker Marker identifying the event target.
  17762. * @param {object} nativeEvent Native browser event.
  17763. * @extends {SyntheticUIEvent}
  17764. */
  17765. function SyntheticTouchEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
  17766. return SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
  17767. }
  17768. SyntheticUIEvent.augmentClass(SyntheticTouchEvent, TouchEventInterface);
  17769. module.exports = SyntheticTouchEvent;
  17770. /***/ },
  17771. /* 162 */
  17772. /***/ function(module, exports, __webpack_require__) {
  17773. /**
  17774. * Copyright 2013-present, Facebook, Inc.
  17775. * All rights reserved.
  17776. *
  17777. * This source code is licensed under the BSD-style license found in the
  17778. * LICENSE file in the root directory of this source tree. An additional grant
  17779. * of patent rights can be found in the PATENTS file in the same directory.
  17780. *
  17781. * @providesModule SyntheticTransitionEvent
  17782. */
  17783. 'use strict';
  17784. var SyntheticEvent = __webpack_require__(55);
  17785. /**
  17786. * @interface Event
  17787. * @see http://www.w3.org/TR/2009/WD-css3-transitions-20090320/#transition-events-
  17788. * @see https://developer.mozilla.org/en-US/docs/Web/API/TransitionEvent
  17789. */
  17790. var TransitionEventInterface = {
  17791. propertyName: null,
  17792. elapsedTime: null,
  17793. pseudoElement: null
  17794. };
  17795. /**
  17796. * @param {object} dispatchConfig Configuration used to dispatch this event.
  17797. * @param {string} dispatchMarker Marker identifying the event target.
  17798. * @param {object} nativeEvent Native browser event.
  17799. * @extends {SyntheticEvent}
  17800. */
  17801. function SyntheticTransitionEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
  17802. return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
  17803. }
  17804. SyntheticEvent.augmentClass(SyntheticTransitionEvent, TransitionEventInterface);
  17805. module.exports = SyntheticTransitionEvent;
  17806. /***/ },
  17807. /* 163 */
  17808. /***/ function(module, exports, __webpack_require__) {
  17809. /**
  17810. * Copyright 2013-present, Facebook, Inc.
  17811. * All rights reserved.
  17812. *
  17813. * This source code is licensed under the BSD-style license found in the
  17814. * LICENSE file in the root directory of this source tree. An additional grant
  17815. * of patent rights can be found in the PATENTS file in the same directory.
  17816. *
  17817. * @providesModule SyntheticWheelEvent
  17818. */
  17819. 'use strict';
  17820. var SyntheticMouseEvent = __webpack_require__(77);
  17821. /**
  17822. * @interface WheelEvent
  17823. * @see http://www.w3.org/TR/DOM-Level-3-Events/
  17824. */
  17825. var WheelEventInterface = {
  17826. deltaX: function (event) {
  17827. return 'deltaX' in event ? event.deltaX :
  17828. // Fallback to `wheelDeltaX` for Webkit and normalize (right is positive).
  17829. 'wheelDeltaX' in event ? -event.wheelDeltaX : 0;
  17830. },
  17831. deltaY: function (event) {
  17832. return 'deltaY' in event ? event.deltaY :
  17833. // Fallback to `wheelDeltaY` for Webkit and normalize (down is positive).
  17834. 'wheelDeltaY' in event ? -event.wheelDeltaY :
  17835. // Fallback to `wheelDelta` for IE<9 and normalize (down is positive).
  17836. 'wheelDelta' in event ? -event.wheelDelta : 0;
  17837. },
  17838. deltaZ: null,
  17839. // Browsers without "deltaMode" is reporting in raw wheel delta where one
  17840. // notch on the scroll is always +/- 120, roughly equivalent to pixels.
  17841. // A good approximation of DOM_DELTA_LINE (1) is 5% of viewport size or
  17842. // ~40 pixels, for DOM_DELTA_SCREEN (2) it is 87.5% of viewport size.
  17843. deltaMode: null
  17844. };
  17845. /**
  17846. * @param {object} dispatchConfig Configuration used to dispatch this event.
  17847. * @param {string} dispatchMarker Marker identifying the event target.
  17848. * @param {object} nativeEvent Native browser event.
  17849. * @extends {SyntheticMouseEvent}
  17850. */
  17851. function SyntheticWheelEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
  17852. return SyntheticMouseEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
  17853. }
  17854. SyntheticMouseEvent.augmentClass(SyntheticWheelEvent, WheelEventInterface);
  17855. module.exports = SyntheticWheelEvent;
  17856. /***/ },
  17857. /* 164 */
  17858. /***/ function(module, exports, __webpack_require__) {
  17859. /* WEBPACK VAR INJECTION */(function(process) {/**
  17860. * Copyright 2013-present, Facebook, Inc.
  17861. * All rights reserved.
  17862. *
  17863. * This source code is licensed under the BSD-style license found in the
  17864. * LICENSE file in the root directory of this source tree. An additional grant
  17865. * of patent rights can be found in the PATENTS file in the same directory.
  17866. *
  17867. * @providesModule ReactMount
  17868. */
  17869. 'use strict';
  17870. var _prodInvariant = __webpack_require__(9);
  17871. var DOMLazyTree = __webpack_require__(84);
  17872. var DOMProperty = __webpack_require__(39);
  17873. var ReactBrowserEventEmitter = __webpack_require__(109);
  17874. var ReactCurrentOwner = __webpack_require__(12);
  17875. var ReactDOMComponentTree = __webpack_require__(38);
  17876. var ReactDOMContainerInfo = __webpack_require__(165);
  17877. var ReactDOMFeatureFlags = __webpack_require__(166);
  17878. var ReactElement = __webpack_require__(11);
  17879. var ReactFeatureFlags = __webpack_require__(60);
  17880. var ReactInstanceMap = __webpack_require__(121);
  17881. var ReactInstrumentation = __webpack_require__(64);
  17882. var ReactMarkupChecksum = __webpack_require__(167);
  17883. var ReactReconciler = __webpack_require__(61);
  17884. var ReactUpdateQueue = __webpack_require__(133);
  17885. var ReactUpdates = __webpack_require__(58);
  17886. var emptyObject = __webpack_require__(21);
  17887. var instantiateReactComponent = __webpack_require__(123);
  17888. var invariant = __webpack_require__(10);
  17889. var setInnerHTML = __webpack_require__(86);
  17890. var shouldUpdateReactComponent = __webpack_require__(127);
  17891. var warning = __webpack_require__(13);
  17892. var ATTR_NAME = DOMProperty.ID_ATTRIBUTE_NAME;
  17893. var ROOT_ATTR_NAME = DOMProperty.ROOT_ATTRIBUTE_NAME;
  17894. var ELEMENT_NODE_TYPE = 1;
  17895. var DOC_NODE_TYPE = 9;
  17896. var DOCUMENT_FRAGMENT_NODE_TYPE = 11;
  17897. var instancesByReactRootID = {};
  17898. /**
  17899. * Finds the index of the first character
  17900. * that's not common between the two given strings.
  17901. *
  17902. * @return {number} the index of the character where the strings diverge
  17903. */
  17904. function firstDifferenceIndex(string1, string2) {
  17905. var minLen = Math.min(string1.length, string2.length);
  17906. for (var i = 0; i < minLen; i++) {
  17907. if (string1.charAt(i) !== string2.charAt(i)) {
  17908. return i;
  17909. }
  17910. }
  17911. return string1.length === string2.length ? -1 : minLen;
  17912. }
  17913. /**
  17914. * @param {DOMElement|DOMDocument} container DOM element that may contain
  17915. * a React component
  17916. * @return {?*} DOM element that may have the reactRoot ID, or null.
  17917. */
  17918. function getReactRootElementInContainer(container) {
  17919. if (!container) {
  17920. return null;
  17921. }
  17922. if (container.nodeType === DOC_NODE_TYPE) {
  17923. return container.documentElement;
  17924. } else {
  17925. return container.firstChild;
  17926. }
  17927. }
  17928. function internalGetID(node) {
  17929. // If node is something like a window, document, or text node, none of
  17930. // which support attributes or a .getAttribute method, gracefully return
  17931. // the empty string, as if the attribute were missing.
  17932. return node.getAttribute && node.getAttribute(ATTR_NAME) || '';
  17933. }
  17934. /**
  17935. * Mounts this component and inserts it into the DOM.
  17936. *
  17937. * @param {ReactComponent} componentInstance The instance to mount.
  17938. * @param {DOMElement} container DOM element to mount into.
  17939. * @param {ReactReconcileTransaction} transaction
  17940. * @param {boolean} shouldReuseMarkup If true, do not insert markup
  17941. */
  17942. function mountComponentIntoNode(wrapperInstance, container, transaction, shouldReuseMarkup, context) {
  17943. var markerName;
  17944. if (ReactFeatureFlags.logTopLevelRenders) {
  17945. var wrappedElement = wrapperInstance._currentElement.props;
  17946. var type = wrappedElement.type;
  17947. markerName = 'React mount: ' + (typeof type === 'string' ? type : type.displayName || type.name);
  17948. console.time(markerName);
  17949. }
  17950. var markup = ReactReconciler.mountComponent(wrapperInstance, transaction, null, ReactDOMContainerInfo(wrapperInstance, container), context, 0 /* parentDebugID */
  17951. );
  17952. if (markerName) {
  17953. console.timeEnd(markerName);
  17954. }
  17955. wrapperInstance._renderedComponent._topLevelWrapper = wrapperInstance;
  17956. ReactMount._mountImageIntoNode(markup, container, wrapperInstance, shouldReuseMarkup, transaction);
  17957. }
  17958. /**
  17959. * Batched mount.
  17960. *
  17961. * @param {ReactComponent} componentInstance The instance to mount.
  17962. * @param {DOMElement} container DOM element to mount into.
  17963. * @param {boolean} shouldReuseMarkup If true, do not insert markup
  17964. */
  17965. function batchedMountComponentIntoNode(componentInstance, container, shouldReuseMarkup, context) {
  17966. var transaction = ReactUpdates.ReactReconcileTransaction.getPooled(
  17967. /* useCreateElement */
  17968. !shouldReuseMarkup && ReactDOMFeatureFlags.useCreateElement);
  17969. transaction.perform(mountComponentIntoNode, null, componentInstance, container, transaction, shouldReuseMarkup, context);
  17970. ReactUpdates.ReactReconcileTransaction.release(transaction);
  17971. }
  17972. /**
  17973. * Unmounts a component and removes it from the DOM.
  17974. *
  17975. * @param {ReactComponent} instance React component instance.
  17976. * @param {DOMElement} container DOM element to unmount from.
  17977. * @final
  17978. * @internal
  17979. * @see {ReactMount.unmountComponentAtNode}
  17980. */
  17981. function unmountComponentFromNode(instance, container, safely) {
  17982. if (process.env.NODE_ENV !== 'production') {
  17983. ReactInstrumentation.debugTool.onBeginFlush();
  17984. }
  17985. ReactReconciler.unmountComponent(instance, safely);
  17986. if (process.env.NODE_ENV !== 'production') {
  17987. ReactInstrumentation.debugTool.onEndFlush();
  17988. }
  17989. if (container.nodeType === DOC_NODE_TYPE) {
  17990. container = container.documentElement;
  17991. }
  17992. // http://jsperf.com/emptying-a-node
  17993. while (container.lastChild) {
  17994. container.removeChild(container.lastChild);
  17995. }
  17996. }
  17997. /**
  17998. * True if the supplied DOM node has a direct React-rendered child that is
  17999. * not a React root element. Useful for warning in `render`,
  18000. * `unmountComponentAtNode`, etc.
  18001. *
  18002. * @param {?DOMElement} node The candidate DOM node.
  18003. * @return {boolean} True if the DOM element contains a direct child that was
  18004. * rendered by React but is not a root element.
  18005. * @internal
  18006. */
  18007. function hasNonRootReactChild(container) {
  18008. var rootEl = getReactRootElementInContainer(container);
  18009. if (rootEl) {
  18010. var inst = ReactDOMComponentTree.getInstanceFromNode(rootEl);
  18011. return !!(inst && inst._hostParent);
  18012. }
  18013. }
  18014. /**
  18015. * True if the supplied DOM node is a React DOM element and
  18016. * it has been rendered by another copy of React.
  18017. *
  18018. * @param {?DOMElement} node The candidate DOM node.
  18019. * @return {boolean} True if the DOM has been rendered by another copy of React
  18020. * @internal
  18021. */
  18022. function nodeIsRenderedByOtherInstance(container) {
  18023. var rootEl = getReactRootElementInContainer(container);
  18024. return !!(rootEl && isReactNode(rootEl) && !ReactDOMComponentTree.getInstanceFromNode(rootEl));
  18025. }
  18026. /**
  18027. * True if the supplied DOM node is a valid node element.
  18028. *
  18029. * @param {?DOMElement} node The candidate DOM node.
  18030. * @return {boolean} True if the DOM is a valid DOM node.
  18031. * @internal
  18032. */
  18033. function isValidContainer(node) {
  18034. return !!(node && (node.nodeType === ELEMENT_NODE_TYPE || node.nodeType === DOC_NODE_TYPE || node.nodeType === DOCUMENT_FRAGMENT_NODE_TYPE));
  18035. }
  18036. /**
  18037. * True if the supplied DOM node is a valid React node element.
  18038. *
  18039. * @param {?DOMElement} node The candidate DOM node.
  18040. * @return {boolean} True if the DOM is a valid React DOM node.
  18041. * @internal
  18042. */
  18043. function isReactNode(node) {
  18044. return isValidContainer(node) && (node.hasAttribute(ROOT_ATTR_NAME) || node.hasAttribute(ATTR_NAME));
  18045. }
  18046. function getHostRootInstanceInContainer(container) {
  18047. var rootEl = getReactRootElementInContainer(container);
  18048. var prevHostInstance = rootEl && ReactDOMComponentTree.getInstanceFromNode(rootEl);
  18049. return prevHostInstance && !prevHostInstance._hostParent ? prevHostInstance : null;
  18050. }
  18051. function getTopLevelWrapperInContainer(container) {
  18052. var root = getHostRootInstanceInContainer(container);
  18053. return root ? root._hostContainerInfo._topLevelWrapper : null;
  18054. }
  18055. /**
  18056. * Temporary (?) hack so that we can store all top-level pending updates on
  18057. * composites instead of having to worry about different types of components
  18058. * here.
  18059. */
  18060. var topLevelRootCounter = 1;
  18061. var TopLevelWrapper = function () {
  18062. this.rootID = topLevelRootCounter++;
  18063. };
  18064. TopLevelWrapper.prototype.isReactComponent = {};
  18065. if (process.env.NODE_ENV !== 'production') {
  18066. TopLevelWrapper.displayName = 'TopLevelWrapper';
  18067. }
  18068. TopLevelWrapper.prototype.render = function () {
  18069. // this.props is actually a ReactElement
  18070. return this.props;
  18071. };
  18072. /**
  18073. * Mounting is the process of initializing a React component by creating its
  18074. * representative DOM elements and inserting them into a supplied `container`.
  18075. * Any prior content inside `container` is destroyed in the process.
  18076. *
  18077. * ReactMount.render(
  18078. * component,
  18079. * document.getElementById('container')
  18080. * );
  18081. *
  18082. * <div id="container"> <-- Supplied `container`.
  18083. * <div data-reactid=".3"> <-- Rendered reactRoot of React
  18084. * // ... component.
  18085. * </div>
  18086. * </div>
  18087. *
  18088. * Inside of `container`, the first element rendered is the "reactRoot".
  18089. */
  18090. var ReactMount = {
  18091. TopLevelWrapper: TopLevelWrapper,
  18092. /**
  18093. * Used by devtools. The keys are not important.
  18094. */
  18095. _instancesByReactRootID: instancesByReactRootID,
  18096. /**
  18097. * This is a hook provided to support rendering React components while
  18098. * ensuring that the apparent scroll position of its `container` does not
  18099. * change.
  18100. *
  18101. * @param {DOMElement} container The `container` being rendered into.
  18102. * @param {function} renderCallback This must be called once to do the render.
  18103. */
  18104. scrollMonitor: function (container, renderCallback) {
  18105. renderCallback();
  18106. },
  18107. /**
  18108. * Take a component that's already mounted into the DOM and replace its props
  18109. * @param {ReactComponent} prevComponent component instance already in the DOM
  18110. * @param {ReactElement} nextElement component instance to render
  18111. * @param {DOMElement} container container to render into
  18112. * @param {?function} callback function triggered on completion
  18113. */
  18114. _updateRootComponent: function (prevComponent, nextElement, nextContext, container, callback) {
  18115. ReactMount.scrollMonitor(container, function () {
  18116. ReactUpdateQueue.enqueueElementInternal(prevComponent, nextElement, nextContext);
  18117. if (callback) {
  18118. ReactUpdateQueue.enqueueCallbackInternal(prevComponent, callback);
  18119. }
  18120. });
  18121. return prevComponent;
  18122. },
  18123. /**
  18124. * Render a new component into the DOM. Hooked by hooks!
  18125. *
  18126. * @param {ReactElement} nextElement element to render
  18127. * @param {DOMElement} container container to render into
  18128. * @param {boolean} shouldReuseMarkup if we should skip the markup insertion
  18129. * @return {ReactComponent} nextComponent
  18130. */
  18131. _renderNewRootComponent: function (nextElement, container, shouldReuseMarkup, context) {
  18132. // Various parts of our code (such as ReactCompositeComponent's
  18133. // _renderValidatedComponent) assume that calls to render aren't nested;
  18134. // verify that that's the case.
  18135. process.env.NODE_ENV !== 'production' ? 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;
  18136. !isValidContainer(container) ? process.env.NODE_ENV !== 'production' ? invariant(false, '_registerComponent(...): Target container is not a DOM element.') : _prodInvariant('37') : void 0;
  18137. ReactBrowserEventEmitter.ensureScrollValueMonitoring();
  18138. var componentInstance = instantiateReactComponent(nextElement, false);
  18139. // The initial render is synchronous but any updates that happen during
  18140. // rendering, in componentWillMount or componentDidMount, will be batched
  18141. // according to the current batching strategy.
  18142. ReactUpdates.batchedUpdates(batchedMountComponentIntoNode, componentInstance, container, shouldReuseMarkup, context);
  18143. var wrapperID = componentInstance._instance.rootID;
  18144. instancesByReactRootID[wrapperID] = componentInstance;
  18145. return componentInstance;
  18146. },
  18147. /**
  18148. * Renders a React component into the DOM in the supplied `container`.
  18149. *
  18150. * If the React component was previously rendered into `container`, this will
  18151. * perform an update on it and only mutate the DOM as necessary to reflect the
  18152. * latest React component.
  18153. *
  18154. * @param {ReactComponent} parentComponent The conceptual parent of this render tree.
  18155. * @param {ReactElement} nextElement Component element to render.
  18156. * @param {DOMElement} container DOM element to render into.
  18157. * @param {?function} callback function triggered on completion
  18158. * @return {ReactComponent} Component instance rendered in `container`.
  18159. */
  18160. renderSubtreeIntoContainer: function (parentComponent, nextElement, container, callback) {
  18161. !(parentComponent != null && ReactInstanceMap.has(parentComponent)) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'parentComponent must be a valid React Component') : _prodInvariant('38') : void 0;
  18162. return ReactMount._renderSubtreeIntoContainer(parentComponent, nextElement, container, callback);
  18163. },
  18164. _renderSubtreeIntoContainer: function (parentComponent, nextElement, container, callback) {
  18165. ReactUpdateQueue.validateCallback(callback, 'ReactDOM.render');
  18166. !ReactElement.isValidElement(nextElement) ? process.env.NODE_ENV !== 'production' ? 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 />.' :
  18167. // Check if it quacks like an element
  18168. nextElement != null && nextElement.props !== undefined ? ' This may be caused by unintentionally loading two independent ' + 'copies of React.' : '') : _prodInvariant('39', 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 />.' : nextElement != null && nextElement.props !== undefined ? ' This may be caused by unintentionally loading two independent ' + 'copies of React.' : '') : void 0;
  18169. process.env.NODE_ENV !== 'production' ? 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;
  18170. var nextWrappedElement = ReactElement(TopLevelWrapper, null, null, null, null, null, nextElement);
  18171. var nextContext;
  18172. if (parentComponent) {
  18173. var parentInst = ReactInstanceMap.get(parentComponent);
  18174. nextContext = parentInst._processChildContext(parentInst._context);
  18175. } else {
  18176. nextContext = emptyObject;
  18177. }
  18178. var prevComponent = getTopLevelWrapperInContainer(container);
  18179. if (prevComponent) {
  18180. var prevWrappedElement = prevComponent._currentElement;
  18181. var prevElement = prevWrappedElement.props;
  18182. if (shouldUpdateReactComponent(prevElement, nextElement)) {
  18183. var publicInst = prevComponent._renderedComponent.getPublicInstance();
  18184. var updatedCallback = callback && function () {
  18185. callback.call(publicInst);
  18186. };
  18187. ReactMount._updateRootComponent(prevComponent, nextWrappedElement, nextContext, container, updatedCallback);
  18188. return publicInst;
  18189. } else {
  18190. ReactMount.unmountComponentAtNode(container);
  18191. }
  18192. }
  18193. var reactRootElement = getReactRootElementInContainer(container);
  18194. var containerHasReactMarkup = reactRootElement && !!internalGetID(reactRootElement);
  18195. var containerHasNonRootReactChild = hasNonRootReactChild(container);
  18196. if (process.env.NODE_ENV !== 'production') {
  18197. 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;
  18198. if (!containerHasReactMarkup || reactRootElement.nextSibling) {
  18199. var rootElementSibling = reactRootElement;
  18200. while (rootElementSibling) {
  18201. if (internalGetID(rootElementSibling)) {
  18202. 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;
  18203. break;
  18204. }
  18205. rootElementSibling = rootElementSibling.nextSibling;
  18206. }
  18207. }
  18208. }
  18209. var shouldReuseMarkup = containerHasReactMarkup && !prevComponent && !containerHasNonRootReactChild;
  18210. var component = ReactMount._renderNewRootComponent(nextWrappedElement, container, shouldReuseMarkup, nextContext)._renderedComponent.getPublicInstance();
  18211. if (callback) {
  18212. callback.call(component);
  18213. }
  18214. return component;
  18215. },
  18216. /**
  18217. * Renders a React component into the DOM in the supplied `container`.
  18218. * See https://facebook.github.io/react/docs/top-level-api.html#reactdom.render
  18219. *
  18220. * If the React component was previously rendered into `container`, this will
  18221. * perform an update on it and only mutate the DOM as necessary to reflect the
  18222. * latest React component.
  18223. *
  18224. * @param {ReactElement} nextElement Component element to render.
  18225. * @param {DOMElement} container DOM element to render into.
  18226. * @param {?function} callback function triggered on completion
  18227. * @return {ReactComponent} Component instance rendered in `container`.
  18228. */
  18229. render: function (nextElement, container, callback) {
  18230. return ReactMount._renderSubtreeIntoContainer(null, nextElement, container, callback);
  18231. },
  18232. /**
  18233. * Unmounts and destroys the React component rendered in the `container`.
  18234. * See https://facebook.github.io/react/docs/top-level-api.html#reactdom.unmountcomponentatnode
  18235. *
  18236. * @param {DOMElement} container DOM element containing a React component.
  18237. * @return {boolean} True if a component was found in and unmounted from
  18238. * `container`
  18239. */
  18240. unmountComponentAtNode: function (container) {
  18241. // Various parts of our code (such as ReactCompositeComponent's
  18242. // _renderValidatedComponent) assume that calls to render aren't nested;
  18243. // verify that that's the case. (Strictly speaking, unmounting won't cause a
  18244. // render but we still don't expect to be in a render call here.)
  18245. process.env.NODE_ENV !== 'production' ? 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;
  18246. !isValidContainer(container) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'unmountComponentAtNode(...): Target container is not a DOM element.') : _prodInvariant('40') : void 0;
  18247. if (process.env.NODE_ENV !== 'production') {
  18248. process.env.NODE_ENV !== 'production' ? warning(!nodeIsRenderedByOtherInstance(container), 'unmountComponentAtNode(): The node you\'re attempting to unmount ' + 'was rendered by another copy of React.') : void 0;
  18249. }
  18250. var prevComponent = getTopLevelWrapperInContainer(container);
  18251. if (!prevComponent) {
  18252. // Check if the node being unmounted was rendered by React, but isn't a
  18253. // root node.
  18254. var containerHasNonRootReactChild = hasNonRootReactChild(container);
  18255. // Check if the container itself is a React root node.
  18256. var isContainerReactRoot = container.nodeType === 1 && container.hasAttribute(ROOT_ATTR_NAME);
  18257. if (process.env.NODE_ENV !== 'production') {
  18258. 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;
  18259. }
  18260. return false;
  18261. }
  18262. delete instancesByReactRootID[prevComponent._instance.rootID];
  18263. ReactUpdates.batchedUpdates(unmountComponentFromNode, prevComponent, container, false);
  18264. return true;
  18265. },
  18266. _mountImageIntoNode: function (markup, container, instance, shouldReuseMarkup, transaction) {
  18267. !isValidContainer(container) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'mountComponentIntoNode(...): Target container is not valid.') : _prodInvariant('41') : void 0;
  18268. if (shouldReuseMarkup) {
  18269. var rootElement = getReactRootElementInContainer(container);
  18270. if (ReactMarkupChecksum.canReuseMarkup(markup, rootElement)) {
  18271. ReactDOMComponentTree.precacheNode(instance, rootElement);
  18272. return;
  18273. } else {
  18274. var checksum = rootElement.getAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME);
  18275. rootElement.removeAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME);
  18276. var rootMarkup = rootElement.outerHTML;
  18277. rootElement.setAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME, checksum);
  18278. var normalizedMarkup = markup;
  18279. if (process.env.NODE_ENV !== 'production') {
  18280. // because rootMarkup is retrieved from the DOM, various normalizations
  18281. // will have occurred which will not be present in `markup`. Here,
  18282. // insert markup into a <div> or <iframe> depending on the container
  18283. // type to perform the same normalizations before comparing.
  18284. var normalizer;
  18285. if (container.nodeType === ELEMENT_NODE_TYPE) {
  18286. normalizer = document.createElement('div');
  18287. normalizer.innerHTML = markup;
  18288. normalizedMarkup = normalizer.innerHTML;
  18289. } else {
  18290. normalizer = document.createElement('iframe');
  18291. document.body.appendChild(normalizer);
  18292. normalizer.contentDocument.write(markup);
  18293. normalizedMarkup = normalizer.contentDocument.documentElement.outerHTML;
  18294. document.body.removeChild(normalizer);
  18295. }
  18296. }
  18297. var diffIndex = firstDifferenceIndex(normalizedMarkup, rootMarkup);
  18298. var difference = ' (client) ' + normalizedMarkup.substring(diffIndex - 20, diffIndex + 20) + '\n (server) ' + rootMarkup.substring(diffIndex - 20, diffIndex + 20);
  18299. !(container.nodeType !== DOC_NODE_TYPE) ? process.env.NODE_ENV !== 'production' ? 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) : _prodInvariant('42', difference) : void 0;
  18300. if (process.env.NODE_ENV !== 'production') {
  18301. 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;
  18302. }
  18303. }
  18304. }
  18305. !(container.nodeType !== DOC_NODE_TYPE) ? process.env.NODE_ENV !== 'production' ? 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.') : _prodInvariant('43') : void 0;
  18306. if (transaction.useCreateElement) {
  18307. while (container.lastChild) {
  18308. container.removeChild(container.lastChild);
  18309. }
  18310. DOMLazyTree.insertTreeBefore(container, markup, null);
  18311. } else {
  18312. setInnerHTML(container, markup);
  18313. ReactDOMComponentTree.precacheNode(instance, container.firstChild);
  18314. }
  18315. if (process.env.NODE_ENV !== 'production') {
  18316. var hostNode = ReactDOMComponentTree.getInstanceFromNode(container.firstChild);
  18317. if (hostNode._debugID !== 0) {
  18318. ReactInstrumentation.debugTool.onHostOperation(hostNode._debugID, 'mount', markup.toString());
  18319. }
  18320. }
  18321. }
  18322. };
  18323. module.exports = ReactMount;
  18324. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  18325. /***/ },
  18326. /* 165 */
  18327. /***/ function(module, exports, __webpack_require__) {
  18328. /* WEBPACK VAR INJECTION */(function(process) {/**
  18329. * Copyright 2013-present, Facebook, Inc.
  18330. * All rights reserved.
  18331. *
  18332. * This source code is licensed under the BSD-style license found in the
  18333. * LICENSE file in the root directory of this source tree. An additional grant
  18334. * of patent rights can be found in the PATENTS file in the same directory.
  18335. *
  18336. * @providesModule ReactDOMContainerInfo
  18337. */
  18338. 'use strict';
  18339. var validateDOMNesting = __webpack_require__(134);
  18340. var DOC_NODE_TYPE = 9;
  18341. function ReactDOMContainerInfo(topLevelWrapper, node) {
  18342. var info = {
  18343. _topLevelWrapper: topLevelWrapper,
  18344. _idCounter: 1,
  18345. _ownerDocument: node ? node.nodeType === DOC_NODE_TYPE ? node : node.ownerDocument : null,
  18346. _node: node,
  18347. _tag: node ? node.nodeName.toLowerCase() : null,
  18348. _namespaceURI: node ? node.namespaceURI : null
  18349. };
  18350. if (process.env.NODE_ENV !== 'production') {
  18351. info._ancestorInfo = node ? validateDOMNesting.updatedAncestorInfo(null, info._tag, null) : null;
  18352. }
  18353. return info;
  18354. }
  18355. module.exports = ReactDOMContainerInfo;
  18356. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  18357. /***/ },
  18358. /* 166 */
  18359. /***/ function(module, exports) {
  18360. /**
  18361. * Copyright 2013-present, Facebook, Inc.
  18362. * All rights reserved.
  18363. *
  18364. * This source code is licensed under the BSD-style license found in the
  18365. * LICENSE file in the root directory of this source tree. An additional grant
  18366. * of patent rights can be found in the PATENTS file in the same directory.
  18367. *
  18368. * @providesModule ReactDOMFeatureFlags
  18369. */
  18370. 'use strict';
  18371. var ReactDOMFeatureFlags = {
  18372. useCreateElement: true
  18373. };
  18374. module.exports = ReactDOMFeatureFlags;
  18375. /***/ },
  18376. /* 167 */
  18377. /***/ function(module, exports, __webpack_require__) {
  18378. /**
  18379. * Copyright 2013-present, Facebook, Inc.
  18380. * All rights reserved.
  18381. *
  18382. * This source code is licensed under the BSD-style license found in the
  18383. * LICENSE file in the root directory of this source tree. An additional grant
  18384. * of patent rights can be found in the PATENTS file in the same directory.
  18385. *
  18386. * @providesModule ReactMarkupChecksum
  18387. */
  18388. 'use strict';
  18389. var adler32 = __webpack_require__(168);
  18390. var TAG_END = /\/?>/;
  18391. var COMMENT_START = /^<\!\-\-/;
  18392. var ReactMarkupChecksum = {
  18393. CHECKSUM_ATTR_NAME: 'data-react-checksum',
  18394. /**
  18395. * @param {string} markup Markup string
  18396. * @return {string} Markup string with checksum attribute attached
  18397. */
  18398. addChecksumToMarkup: function (markup) {
  18399. var checksum = adler32(markup);
  18400. // Add checksum (handle both parent tags, comments and self-closing tags)
  18401. if (COMMENT_START.test(markup)) {
  18402. return markup;
  18403. } else {
  18404. return markup.replace(TAG_END, ' ' + ReactMarkupChecksum.CHECKSUM_ATTR_NAME + '="' + checksum + '"$&');
  18405. }
  18406. },
  18407. /**
  18408. * @param {string} markup to use
  18409. * @param {DOMElement} element root React element
  18410. * @returns {boolean} whether or not the markup is the same
  18411. */
  18412. canReuseMarkup: function (markup, element) {
  18413. var existingChecksum = element.getAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME);
  18414. existingChecksum = existingChecksum && parseInt(existingChecksum, 10);
  18415. var markupChecksum = adler32(markup);
  18416. return markupChecksum === existingChecksum;
  18417. }
  18418. };
  18419. module.exports = ReactMarkupChecksum;
  18420. /***/ },
  18421. /* 168 */
  18422. /***/ function(module, exports) {
  18423. /**
  18424. * Copyright 2013-present, Facebook, Inc.
  18425. * All rights reserved.
  18426. *
  18427. * This source code is licensed under the BSD-style license found in the
  18428. * LICENSE file in the root directory of this source tree. An additional grant
  18429. * of patent rights can be found in the PATENTS file in the same directory.
  18430. *
  18431. * @providesModule adler32
  18432. *
  18433. */
  18434. 'use strict';
  18435. var MOD = 65521;
  18436. // adler32 is not cryptographically strong, and is only used to sanity check that
  18437. // markup generated on the server matches the markup generated on the client.
  18438. // This implementation (a modified version of the SheetJS version) has been optimized
  18439. // for our use case, at the expense of conforming to the adler32 specification
  18440. // for non-ascii inputs.
  18441. function adler32(data) {
  18442. var a = 1;
  18443. var b = 0;
  18444. var i = 0;
  18445. var l = data.length;
  18446. var m = l & ~0x3;
  18447. while (i < m) {
  18448. var n = Math.min(i + 4096, m);
  18449. for (; i < n; i += 4) {
  18450. b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));
  18451. }
  18452. a %= MOD;
  18453. b %= MOD;
  18454. }
  18455. for (; i < l; i++) {
  18456. b += a += data.charCodeAt(i);
  18457. }
  18458. a %= MOD;
  18459. b %= MOD;
  18460. return a | b << 16;
  18461. }
  18462. module.exports = adler32;
  18463. /***/ },
  18464. /* 169 */
  18465. /***/ function(module, exports, __webpack_require__) {
  18466. /* WEBPACK VAR INJECTION */(function(process) {/**
  18467. * Copyright 2013-present, Facebook, Inc.
  18468. * All rights reserved.
  18469. *
  18470. * This source code is licensed under the BSD-style license found in the
  18471. * LICENSE file in the root directory of this source tree. An additional grant
  18472. * of patent rights can be found in the PATENTS file in the same directory.
  18473. *
  18474. * @providesModule findDOMNode
  18475. */
  18476. 'use strict';
  18477. var _prodInvariant = __webpack_require__(9);
  18478. var ReactCurrentOwner = __webpack_require__(12);
  18479. var ReactDOMComponentTree = __webpack_require__(38);
  18480. var ReactInstanceMap = __webpack_require__(121);
  18481. var getHostComponentFromComposite = __webpack_require__(170);
  18482. var invariant = __webpack_require__(10);
  18483. var warning = __webpack_require__(13);
  18484. /**
  18485. * Returns the DOM node rendered by this element.
  18486. *
  18487. * See https://facebook.github.io/react/docs/top-level-api.html#reactdom.finddomnode
  18488. *
  18489. * @param {ReactComponent|DOMElement} componentOrElement
  18490. * @return {?DOMElement} The root node of this element.
  18491. */
  18492. function findDOMNode(componentOrElement) {
  18493. if (process.env.NODE_ENV !== 'production') {
  18494. var owner = ReactCurrentOwner.current;
  18495. if (owner !== null) {
  18496. 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;
  18497. owner._warnedAboutRefsInRender = true;
  18498. }
  18499. }
  18500. if (componentOrElement == null) {
  18501. return null;
  18502. }
  18503. if (componentOrElement.nodeType === 1) {
  18504. return componentOrElement;
  18505. }
  18506. var inst = ReactInstanceMap.get(componentOrElement);
  18507. if (inst) {
  18508. inst = getHostComponentFromComposite(inst);
  18509. return inst ? ReactDOMComponentTree.getNodeFromInstance(inst) : null;
  18510. }
  18511. if (typeof componentOrElement.render === 'function') {
  18512. true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'findDOMNode was called on an unmounted component.') : _prodInvariant('44') : void 0;
  18513. } else {
  18514. true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Element appears to be neither ReactComponent nor DOMNode (keys: %s)', Object.keys(componentOrElement)) : _prodInvariant('45', Object.keys(componentOrElement)) : void 0;
  18515. }
  18516. }
  18517. module.exports = findDOMNode;
  18518. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  18519. /***/ },
  18520. /* 170 */
  18521. /***/ function(module, exports, __webpack_require__) {
  18522. /**
  18523. * Copyright 2013-present, Facebook, Inc.
  18524. * All rights reserved.
  18525. *
  18526. * This source code is licensed under the BSD-style license found in the
  18527. * LICENSE file in the root directory of this source tree. An additional grant
  18528. * of patent rights can be found in the PATENTS file in the same directory.
  18529. *
  18530. * @providesModule getHostComponentFromComposite
  18531. */
  18532. 'use strict';
  18533. var ReactNodeTypes = __webpack_require__(125);
  18534. function getHostComponentFromComposite(inst) {
  18535. var type;
  18536. while ((type = inst._renderedNodeType) === ReactNodeTypes.COMPOSITE) {
  18537. inst = inst._renderedComponent;
  18538. }
  18539. if (type === ReactNodeTypes.HOST) {
  18540. return inst._renderedComponent;
  18541. } else if (type === ReactNodeTypes.EMPTY) {
  18542. return null;
  18543. }
  18544. }
  18545. module.exports = getHostComponentFromComposite;
  18546. /***/ },
  18547. /* 171 */
  18548. /***/ function(module, exports, __webpack_require__) {
  18549. /**
  18550. * Copyright 2013-present, Facebook, Inc.
  18551. * All rights reserved.
  18552. *
  18553. * This source code is licensed under the BSD-style license found in the
  18554. * LICENSE file in the root directory of this source tree. An additional grant
  18555. * of patent rights can be found in the PATENTS file in the same directory.
  18556. *
  18557. * @providesModule renderSubtreeIntoContainer
  18558. */
  18559. 'use strict';
  18560. var ReactMount = __webpack_require__(164);
  18561. module.exports = ReactMount.renderSubtreeIntoContainer;
  18562. /***/ },
  18563. /* 172 */
  18564. /***/ function(module, exports, __webpack_require__) {
  18565. /* WEBPACK VAR INJECTION */(function(process) {/**
  18566. * Copyright 2013-present, Facebook, Inc.
  18567. * All rights reserved.
  18568. *
  18569. * This source code is licensed under the BSD-style license found in the
  18570. * LICENSE file in the root directory of this source tree. An additional grant
  18571. * of patent rights can be found in the PATENTS file in the same directory.
  18572. *
  18573. * @providesModule ReactDOMUnknownPropertyHook
  18574. */
  18575. 'use strict';
  18576. var DOMProperty = __webpack_require__(39);
  18577. var EventPluginRegistry = __webpack_require__(46);
  18578. var ReactComponentTreeHook = __webpack_require__(30);
  18579. var warning = __webpack_require__(13);
  18580. if (process.env.NODE_ENV !== 'production') {
  18581. var reactProps = {
  18582. children: true,
  18583. dangerouslySetInnerHTML: true,
  18584. key: true,
  18585. ref: true,
  18586. autoFocus: true,
  18587. defaultValue: true,
  18588. valueLink: true,
  18589. defaultChecked: true,
  18590. checkedLink: true,
  18591. innerHTML: true,
  18592. suppressContentEditableWarning: true,
  18593. onFocusIn: true,
  18594. onFocusOut: true
  18595. };
  18596. var warnedProperties = {};
  18597. var validateProperty = function (tagName, name, debugID) {
  18598. if (DOMProperty.properties.hasOwnProperty(name) || DOMProperty.isCustomAttribute(name)) {
  18599. return true;
  18600. }
  18601. if (reactProps.hasOwnProperty(name) && reactProps[name] || warnedProperties.hasOwnProperty(name) && warnedProperties[name]) {
  18602. return true;
  18603. }
  18604. if (EventPluginRegistry.registrationNameModules.hasOwnProperty(name)) {
  18605. return true;
  18606. }
  18607. warnedProperties[name] = true;
  18608. var lowerCasedName = name.toLowerCase();
  18609. // data-* attributes should be lowercase; suggest the lowercase version
  18610. var standardName = DOMProperty.isCustomAttribute(lowerCasedName) ? lowerCasedName : DOMProperty.getPossibleStandardName.hasOwnProperty(lowerCasedName) ? DOMProperty.getPossibleStandardName[lowerCasedName] : null;
  18611. var registrationName = EventPluginRegistry.possibleRegistrationNames.hasOwnProperty(lowerCasedName) ? EventPluginRegistry.possibleRegistrationNames[lowerCasedName] : null;
  18612. if (standardName != null) {
  18613. process.env.NODE_ENV !== 'production' ? warning(false, 'Unknown DOM property %s. Did you mean %s?%s', name, standardName, ReactComponentTreeHook.getStackAddendumByID(debugID)) : void 0;
  18614. return true;
  18615. } else if (registrationName != null) {
  18616. process.env.NODE_ENV !== 'production' ? warning(false, 'Unknown event handler property %s. Did you mean `%s`?%s', name, registrationName, ReactComponentTreeHook.getStackAddendumByID(debugID)) : void 0;
  18617. return true;
  18618. } else {
  18619. // We were unable to guess which prop the user intended.
  18620. // It is likely that the user was just blindly spreading/forwarding props
  18621. // Components should be careful to only render valid props/attributes.
  18622. // Warning will be invoked in warnUnknownProperties to allow grouping.
  18623. return false;
  18624. }
  18625. };
  18626. }
  18627. var warnUnknownProperties = function (debugID, element) {
  18628. var unknownProps = [];
  18629. for (var key in element.props) {
  18630. var isValid = validateProperty(element.type, key, debugID);
  18631. if (!isValid) {
  18632. unknownProps.push(key);
  18633. }
  18634. }
  18635. var unknownPropString = unknownProps.map(function (prop) {
  18636. return '`' + prop + '`';
  18637. }).join(', ');
  18638. if (unknownProps.length === 1) {
  18639. process.env.NODE_ENV !== 'production' ? warning(false, 'Unknown prop %s on <%s> tag. Remove this prop from the element. ' + 'For details, see https://fb.me/react-unknown-prop%s', unknownPropString, element.type, ReactComponentTreeHook.getStackAddendumByID(debugID)) : void 0;
  18640. } else if (unknownProps.length > 1) {
  18641. process.env.NODE_ENV !== 'production' ? warning(false, 'Unknown props %s on <%s> tag. Remove these props from the element. ' + 'For details, see https://fb.me/react-unknown-prop%s', unknownPropString, element.type, ReactComponentTreeHook.getStackAddendumByID(debugID)) : void 0;
  18642. }
  18643. };
  18644. function handleElement(debugID, element) {
  18645. if (element == null || typeof element.type !== 'string') {
  18646. return;
  18647. }
  18648. if (element.type.indexOf('-') >= 0 || element.props.is) {
  18649. return;
  18650. }
  18651. warnUnknownProperties(debugID, element);
  18652. }
  18653. var ReactDOMUnknownPropertyHook = {
  18654. onBeforeMountComponent: function (debugID, element) {
  18655. handleElement(debugID, element);
  18656. },
  18657. onBeforeUpdateComponent: function (debugID, element) {
  18658. handleElement(debugID, element);
  18659. }
  18660. };
  18661. module.exports = ReactDOMUnknownPropertyHook;
  18662. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  18663. /***/ },
  18664. /* 173 */
  18665. /***/ function(module, exports, __webpack_require__) {
  18666. /* WEBPACK VAR INJECTION */(function(process) {/**
  18667. * Copyright 2013-present, Facebook, Inc.
  18668. * All rights reserved.
  18669. *
  18670. * This source code is licensed under the BSD-style license found in the
  18671. * LICENSE file in the root directory of this source tree. An additional grant
  18672. * of patent rights can be found in the PATENTS file in the same directory.
  18673. *
  18674. * @providesModule ReactDOMNullInputValuePropHook
  18675. */
  18676. 'use strict';
  18677. var ReactComponentTreeHook = __webpack_require__(30);
  18678. var warning = __webpack_require__(13);
  18679. var didWarnValueNull = false;
  18680. function handleElement(debugID, element) {
  18681. if (element == null) {
  18682. return;
  18683. }
  18684. if (element.type !== 'input' && element.type !== 'textarea' && element.type !== 'select') {
  18685. return;
  18686. }
  18687. if (element.props != null && element.props.value === null && !didWarnValueNull) {
  18688. process.env.NODE_ENV !== 'production' ? warning(false, '`value` prop on `%s` should not be null. ' + 'Consider using the empty string to clear the component or `undefined` ' + 'for uncontrolled components.%s', element.type, ReactComponentTreeHook.getStackAddendumByID(debugID)) : void 0;
  18689. didWarnValueNull = true;
  18690. }
  18691. }
  18692. var ReactDOMNullInputValuePropHook = {
  18693. onBeforeMountComponent: function (debugID, element) {
  18694. handleElement(debugID, element);
  18695. },
  18696. onBeforeUpdateComponent: function (debugID, element) {
  18697. handleElement(debugID, element);
  18698. }
  18699. };
  18700. module.exports = ReactDOMNullInputValuePropHook;
  18701. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  18702. /***/ },
  18703. /* 174 */
  18704. /***/ function(module, exports, __webpack_require__) {
  18705. /**
  18706. * @author oldj
  18707. * @blog http://oldj.net
  18708. */
  18709. 'use strict';
  18710. Object.defineProperty(exports, "__esModule", {
  18711. value: true
  18712. });
  18713. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  18714. var _react = __webpack_require__(3);
  18715. var _react2 = _interopRequireDefault(_react);
  18716. var _panel = __webpack_require__(175);
  18717. var _panel2 = _interopRequireDefault(_panel);
  18718. var _content = __webpack_require__(203);
  18719. var _content2 = _interopRequireDefault(_content);
  18720. var _sudo = __webpack_require__(213);
  18721. var _sudo2 = _interopRequireDefault(_sudo);
  18722. var _edit = __webpack_require__(219);
  18723. var _edit2 = _interopRequireDefault(_edit);
  18724. __webpack_require__(222);
  18725. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  18726. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  18727. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  18728. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  18729. var App = function (_React$Component) {
  18730. _inherits(App, _React$Component);
  18731. function App(props) {
  18732. _classCallCheck(this, App);
  18733. var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(App).call(this, props));
  18734. var _data = SH_Agent.getHosts();
  18735. _this.state = {
  18736. hosts: _data,
  18737. current: _data.sys
  18738. };
  18739. // auto check refresh
  18740. setTimeout(function () {
  18741. _this.autoCheckRefresh();
  18742. }, 1000 * 5);
  18743. SH_event.on('after_apply', function () {
  18744. if (_this.state.current.is_sys) {
  18745. // 重新读取
  18746. _this.setState({
  18747. current: SH_Agent.getSysHosts()
  18748. });
  18749. }
  18750. });
  18751. ipcRenderer.on('to_import', function (e, fn) {
  18752. if (!confirm(SH_Agent.lang.confirm_import)) return;
  18753. SH_Agent.readFile(fn, function (err, cnt) {
  18754. if (err) {
  18755. alert(err.message || 'Import Error!');
  18756. return;
  18757. }
  18758. var data = void 0;
  18759. try {
  18760. data = JSON.parse(cnt);
  18761. } catch (e) {
  18762. console.log(e);
  18763. alert(e.message || 'Bad format, the import file should be a JSON file.');
  18764. return;
  18765. }
  18766. if (!data.list || !Array.isArray(data.list)) {
  18767. alert('Bad format, the data JSON should have a [list] field.');
  18768. return;
  18769. }
  18770. _this.setState({
  18771. hosts: Object.assign({}, _this.state.hosts, { list: data.list })
  18772. }, function () {
  18773. SH_event.emit('imported');
  18774. });
  18775. console.log('imported.');
  18776. });
  18777. });
  18778. return _this;
  18779. }
  18780. _createClass(App, [{
  18781. key: 'autoCheckRefresh',
  18782. value: function autoCheckRefresh() {
  18783. var _this2 = this;
  18784. this.state.hosts.list.map(function (host, idx) {
  18785. setTimeout(function () {
  18786. SH_event.emit('check_host_refresh', host);
  18787. }, 1000 * 5 * idx);
  18788. });
  18789. setTimeout(function () {
  18790. _this2.autoCheckRefresh();
  18791. }, 1000 * 60 * 10);
  18792. }
  18793. }, {
  18794. key: 'setCurrent',
  18795. value: function setCurrent(host) {
  18796. this.setState({
  18797. current: host.is_sys ? SH_Agent.getSysHosts() : host
  18798. });
  18799. }
  18800. }, {
  18801. key: 'toSave',
  18802. value: function toSave() {
  18803. clearTimeout(this._t);
  18804. this._t = setTimeout(function () {
  18805. SH_event.emit('change');
  18806. }, 1000);
  18807. }
  18808. }, {
  18809. key: 'setHostContent',
  18810. value: function setHostContent(v) {
  18811. if (this.state.current.content == v) return; // not changed
  18812. this.state.current.content = v || '';
  18813. this.toSave();
  18814. }
  18815. }, {
  18816. key: 'componentDidMount',
  18817. value: function componentDidMount() {}
  18818. }, {
  18819. key: 'render',
  18820. value: function render() {
  18821. var current = this.state.current;
  18822. return _react2.default.createElement(
  18823. 'div',
  18824. { id: 'app' },
  18825. _react2.default.createElement(_panel2.default, { hosts: this.state.hosts, current: current, setCurrent: this.setCurrent.bind(this) }),
  18826. _react2.default.createElement(_content2.default, { current: current, readonly: App.isReadOnly(current),
  18827. setHostContent: this.setHostContent.bind(this) }),
  18828. _react2.default.createElement(
  18829. 'div',
  18830. { className: 'frames' },
  18831. _react2.default.createElement(_sudo2.default, null),
  18832. _react2.default.createElement(_edit2.default, null)
  18833. )
  18834. );
  18835. }
  18836. }], [{
  18837. key: 'isReadOnly',
  18838. value: function isReadOnly(host) {
  18839. return host.is_sys || host.where == 'remote';
  18840. }
  18841. }]);
  18842. return App;
  18843. }(_react2.default.Component);
  18844. exports.default = App;
  18845. /***/ },
  18846. /* 175 */
  18847. /***/ function(module, exports, __webpack_require__) {
  18848. /**
  18849. * @author oldj
  18850. * @blog http://oldj.net
  18851. */
  18852. 'use strict';
  18853. Object.defineProperty(exports, "__esModule", {
  18854. value: true
  18855. });
  18856. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  18857. var _react = __webpack_require__(3);
  18858. var _react2 = _interopRequireDefault(_react);
  18859. var _buttons = __webpack_require__(176);
  18860. var _buttons2 = _interopRequireDefault(_buttons);
  18861. var _searchbar = __webpack_require__(182);
  18862. var _searchbar2 = _interopRequireDefault(_searchbar);
  18863. var _list = __webpack_require__(185);
  18864. var _list2 = _interopRequireDefault(_list);
  18865. __webpack_require__(196);
  18866. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  18867. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  18868. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  18869. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  18870. var Panel = function (_React$Component) {
  18871. _inherits(Panel, _React$Component);
  18872. function Panel() {
  18873. _classCallCheck(this, Panel);
  18874. return _possibleConstructorReturn(this, Object.getPrototypeOf(Panel).apply(this, arguments));
  18875. }
  18876. _createClass(Panel, [{
  18877. key: 'render',
  18878. value: function render() {
  18879. var _props = this.props;
  18880. var current = _props.current;
  18881. var hosts = _props.hosts;
  18882. return _react2.default.createElement(
  18883. 'div',
  18884. { id: 'panel' },
  18885. _react2.default.createElement(_list2.default, { hosts: hosts, current: current, setCurrent: this.props.setCurrent }),
  18886. _react2.default.createElement(_searchbar2.default, null),
  18887. _react2.default.createElement(_buttons2.default, null)
  18888. );
  18889. }
  18890. }]);
  18891. return Panel;
  18892. }(_react2.default.Component);
  18893. exports.default = Panel;
  18894. /***/ },
  18895. /* 176 */
  18896. /***/ function(module, exports, __webpack_require__) {
  18897. /**
  18898. * @author oldj
  18899. * @blog http://oldj.net
  18900. */
  18901. 'use strict';
  18902. Object.defineProperty(exports, "__esModule", {
  18903. value: true
  18904. });
  18905. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  18906. var _react = __webpack_require__(3);
  18907. var _react2 = _interopRequireDefault(_react);
  18908. var _classnames = __webpack_require__(177);
  18909. var _classnames2 = _interopRequireDefault(_classnames);
  18910. __webpack_require__(178);
  18911. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  18912. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  18913. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  18914. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  18915. var Buttons = function (_React$Component) {
  18916. _inherits(Buttons, _React$Component);
  18917. function Buttons(props) {
  18918. _classCallCheck(this, Buttons);
  18919. var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(Buttons).call(this, props));
  18920. _this.state = {
  18921. top_toggle_on: true,
  18922. search_on: false
  18923. };
  18924. _this.on_items = null;
  18925. SH_event.on('toggle_host', function (on) {
  18926. if (on && !_this.state.top_toggle_on) {
  18927. _this.setState({
  18928. top_toggle_on: true
  18929. });
  18930. _this.on_items = null;
  18931. }
  18932. });
  18933. SH_event.on('cancel_search', function () {
  18934. _this.calcelSearch();
  18935. });
  18936. ipcRenderer.on('to_add_host', function () {
  18937. SH_event.emit('add_host');
  18938. });
  18939. return _this;
  18940. }
  18941. _createClass(Buttons, [{
  18942. key: 'btnToggle',
  18943. value: function btnToggle() {
  18944. var _this2 = this;
  18945. if (this.state.top_toggle_on) {
  18946. SH_event.emit('get_on_hosts', function (items) {
  18947. _this2.on_items = items;
  18948. });
  18949. }
  18950. this.setState({
  18951. top_toggle_on: !this.state.top_toggle_on
  18952. }, function () {
  18953. SH_event.emit('top_toggle', _this2.state.top_toggle_on, _this2.on_items);
  18954. if (_this2.state.top_toggle_on) {
  18955. _this2.on_items = null;
  18956. }
  18957. });
  18958. }
  18959. }, {
  18960. key: 'btnSearch',
  18961. value: function btnSearch() {
  18962. var _this3 = this;
  18963. this.setState({
  18964. search_on: !this.state.search_on
  18965. }, function () {
  18966. SH_event.emit(_this3.state.search_on ? 'search_on' : 'search_off');
  18967. });
  18968. }
  18969. }, {
  18970. key: 'calcelSearch',
  18971. value: function calcelSearch() {
  18972. this.setState({
  18973. search_on: false
  18974. }, function () {
  18975. SH_event.emit('search_off');
  18976. });
  18977. }
  18978. }, {
  18979. key: 'render',
  18980. value: function render() {
  18981. var _this4 = this;
  18982. return _react2.default.createElement(
  18983. 'div',
  18984. { id: 'sh-buttons' },
  18985. _react2.default.createElement(
  18986. 'div',
  18987. { className: 'left' },
  18988. _react2.default.createElement(
  18989. 'a',
  18990. {
  18991. className: 'btn-add',
  18992. href: '#',
  18993. onClick: function onClick() {
  18994. return Buttons.btnAdd();
  18995. }
  18996. },
  18997. '+'
  18998. )
  18999. ),
  19000. _react2.default.createElement(
  19001. 'div',
  19002. { className: 'right' },
  19003. _react2.default.createElement('i', {
  19004. className: (0, _classnames2.default)({
  19005. iconfont: 1,
  19006. 'icon-search': 1,
  19007. 'on': this.state.search_on
  19008. }),
  19009. onClick: function onClick() {
  19010. return _this4.btnSearch();
  19011. }
  19012. }),
  19013. _react2.default.createElement('i', {
  19014. className: (0, _classnames2.default)({
  19015. iconfont: 1,
  19016. 'icon-switchon': this.state.top_toggle_on,
  19017. 'icon-switchoff': !this.state.top_toggle_on
  19018. }),
  19019. onClick: function onClick() {
  19020. return _this4.btnToggle();
  19021. }
  19022. })
  19023. )
  19024. );
  19025. }
  19026. }], [{
  19027. key: 'btnAdd',
  19028. value: function btnAdd() {
  19029. SH_event.emit('add_host');
  19030. }
  19031. }]);
  19032. return Buttons;
  19033. }(_react2.default.Component);
  19034. exports.default = Buttons;
  19035. /***/ },
  19036. /* 177 */
  19037. /***/ function(module, exports, __webpack_require__) {
  19038. var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
  19039. Copyright (c) 2016 Jed Watson.
  19040. Licensed under the MIT License (MIT), see
  19041. http://jedwatson.github.io/classnames
  19042. */
  19043. /* global define */
  19044. (function () {
  19045. 'use strict';
  19046. var hasOwn = {}.hasOwnProperty;
  19047. function classNames () {
  19048. var classes = [];
  19049. for (var i = 0; i < arguments.length; i++) {
  19050. var arg = arguments[i];
  19051. if (!arg) continue;
  19052. var argType = typeof arg;
  19053. if (argType === 'string' || argType === 'number') {
  19054. classes.push(arg);
  19055. } else if (Array.isArray(arg)) {
  19056. classes.push(classNames.apply(null, arg));
  19057. } else if (argType === 'object') {
  19058. for (var key in arg) {
  19059. if (hasOwn.call(arg, key) && arg[key]) {
  19060. classes.push(key);
  19061. }
  19062. }
  19063. }
  19064. }
  19065. return classes.join(' ');
  19066. }
  19067. if (typeof module !== 'undefined' && module.exports) {
  19068. module.exports = classNames;
  19069. } else if (true) {
  19070. // register as 'classnames', consistent with npm package name
  19071. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = function () {
  19072. return classNames;
  19073. }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  19074. } else {
  19075. window.classNames = classNames;
  19076. }
  19077. }());
  19078. /***/ },
  19079. /* 178 */
  19080. /***/ function(module, exports, __webpack_require__) {
  19081. // style-loader: Adds some css to the DOM by adding a <style> tag
  19082. // load the styles
  19083. var content = __webpack_require__(179);
  19084. if(typeof content === 'string') content = [[module.id, content, '']];
  19085. // add the styles to the DOM
  19086. var update = __webpack_require__(181)(content, {});
  19087. if(content.locals) module.exports = content.locals;
  19088. // Hot Module Replacement
  19089. if(false) {
  19090. // When the styles change, update the <style> tags
  19091. if(!content.locals) {
  19092. module.hot.accept("!!./../../../node_modules/css-loader/index.js!./../../../node_modules/less-loader/index.js!./buttons.less", function() {
  19093. var newContent = require("!!./../../../node_modules/css-loader/index.js!./../../../node_modules/less-loader/index.js!./buttons.less");
  19094. if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
  19095. update(newContent);
  19096. });
  19097. }
  19098. // When the module is disposed, remove the <style> tags
  19099. module.hot.dispose(function() { update(); });
  19100. }
  19101. /***/ },
  19102. /* 179 */
  19103. /***/ function(module, exports, __webpack_require__) {
  19104. exports = module.exports = __webpack_require__(180)();
  19105. // imports
  19106. // module
  19107. exports.push([module.id, "#sh-buttons {\n position: absolute;\n bottom: 0;\n width: 240px;\n height: 30px;\n line-height: 30px;\n background: #373d47;\n}\n#sh-buttons .left {\n float: left;\n padding-left: 10px;\n}\n#sh-buttons .left .btn-add {\n display: inline-block;\n text-align: center;\n width: 20px;\n color: #979da7;\n text-decoration: none;\n}\n#sh-buttons .left .btn-add:hover {\n background: rgba(255, 255, 255, 0.1);\n}\n#sh-buttons .right {\n float: right;\n padding-right: 17px;\n height: 30px;\n}\n#sh-buttons .right i {\n display: inline-block;\n margin-left: 10px;\n cursor: pointer;\n}\n#sh-buttons .right i.icon-switchoff {\n position: relative;\n top: -1px;\n}\n#sh-buttons .right i.icon-search {\n padding: 0 8px;\n}\n#sh-buttons .right i.icon-search.on {\n background: #3d434e;\n}\n", ""]);
  19108. // exports
  19109. /***/ },
  19110. /* 180 */
  19111. /***/ function(module, exports) {
  19112. /*
  19113. MIT License http://www.opensource.org/licenses/mit-license.php
  19114. Author Tobias Koppers @sokra
  19115. */
  19116. // css base code, injected by the css-loader
  19117. module.exports = function() {
  19118. var list = [];
  19119. // return the list of modules as css string
  19120. list.toString = function toString() {
  19121. var result = [];
  19122. for(var i = 0; i < this.length; i++) {
  19123. var item = this[i];
  19124. if(item[2]) {
  19125. result.push("@media " + item[2] + "{" + item[1] + "}");
  19126. } else {
  19127. result.push(item[1]);
  19128. }
  19129. }
  19130. return result.join("");
  19131. };
  19132. // import a list of modules into the list
  19133. list.i = function(modules, mediaQuery) {
  19134. if(typeof modules === "string")
  19135. modules = [[null, modules, ""]];
  19136. var alreadyImportedModules = {};
  19137. for(var i = 0; i < this.length; i++) {
  19138. var id = this[i][0];
  19139. if(typeof id === "number")
  19140. alreadyImportedModules[id] = true;
  19141. }
  19142. for(i = 0; i < modules.length; i++) {
  19143. var item = modules[i];
  19144. // skip already imported module
  19145. // this implementation is not 100% perfect for weird media query combinations
  19146. // when a module is imported multiple times with different media queries.
  19147. // I hope this will never occur (Hey this way we have smaller bundles)
  19148. if(typeof item[0] !== "number" || !alreadyImportedModules[item[0]]) {
  19149. if(mediaQuery && !item[2]) {
  19150. item[2] = mediaQuery;
  19151. } else if(mediaQuery) {
  19152. item[2] = "(" + item[2] + ") and (" + mediaQuery + ")";
  19153. }
  19154. list.push(item);
  19155. }
  19156. }
  19157. };
  19158. return list;
  19159. };
  19160. /***/ },
  19161. /* 181 */
  19162. /***/ function(module, exports, __webpack_require__) {
  19163. /*
  19164. MIT License http://www.opensource.org/licenses/mit-license.php
  19165. Author Tobias Koppers @sokra
  19166. */
  19167. var stylesInDom = {},
  19168. memoize = function(fn) {
  19169. var memo;
  19170. return function () {
  19171. if (typeof memo === "undefined") memo = fn.apply(this, arguments);
  19172. return memo;
  19173. };
  19174. },
  19175. isOldIE = memoize(function() {
  19176. return /msie [6-9]\b/.test(window.navigator.userAgent.toLowerCase());
  19177. }),
  19178. getHeadElement = memoize(function () {
  19179. return document.head || document.getElementsByTagName("head")[0];
  19180. }),
  19181. singletonElement = null,
  19182. singletonCounter = 0,
  19183. styleElementsInsertedAtTop = [];
  19184. module.exports = function(list, options) {
  19185. if(false) {
  19186. if(typeof document !== "object") throw new Error("The style-loader cannot be used in a non-browser environment");
  19187. }
  19188. options = options || {};
  19189. // Force single-tag solution on IE6-9, which has a hard limit on the # of <style>
  19190. // tags it will allow on a page
  19191. if (typeof options.singleton === "undefined") options.singleton = isOldIE();
  19192. // By default, add <style> tags to the bottom of <head>.
  19193. if (typeof options.insertAt === "undefined") options.insertAt = "bottom";
  19194. var styles = listToStyles(list);
  19195. addStylesToDom(styles, options);
  19196. return function update(newList) {
  19197. var mayRemove = [];
  19198. for(var i = 0; i < styles.length; i++) {
  19199. var item = styles[i];
  19200. var domStyle = stylesInDom[item.id];
  19201. domStyle.refs--;
  19202. mayRemove.push(domStyle);
  19203. }
  19204. if(newList) {
  19205. var newStyles = listToStyles(newList);
  19206. addStylesToDom(newStyles, options);
  19207. }
  19208. for(var i = 0; i < mayRemove.length; i++) {
  19209. var domStyle = mayRemove[i];
  19210. if(domStyle.refs === 0) {
  19211. for(var j = 0; j < domStyle.parts.length; j++)
  19212. domStyle.parts[j]();
  19213. delete stylesInDom[domStyle.id];
  19214. }
  19215. }
  19216. };
  19217. }
  19218. function addStylesToDom(styles, options) {
  19219. for(var i = 0; i < styles.length; i++) {
  19220. var item = styles[i];
  19221. var domStyle = stylesInDom[item.id];
  19222. if(domStyle) {
  19223. domStyle.refs++;
  19224. for(var j = 0; j < domStyle.parts.length; j++) {
  19225. domStyle.parts[j](item.parts[j]);
  19226. }
  19227. for(; j < item.parts.length; j++) {
  19228. domStyle.parts.push(addStyle(item.parts[j], options));
  19229. }
  19230. } else {
  19231. var parts = [];
  19232. for(var j = 0; j < item.parts.length; j++) {
  19233. parts.push(addStyle(item.parts[j], options));
  19234. }
  19235. stylesInDom[item.id] = {id: item.id, refs: 1, parts: parts};
  19236. }
  19237. }
  19238. }
  19239. function listToStyles(list) {
  19240. var styles = [];
  19241. var newStyles = {};
  19242. for(var i = 0; i < list.length; i++) {
  19243. var item = list[i];
  19244. var id = item[0];
  19245. var css = item[1];
  19246. var media = item[2];
  19247. var sourceMap = item[3];
  19248. var part = {css: css, media: media, sourceMap: sourceMap};
  19249. if(!newStyles[id])
  19250. styles.push(newStyles[id] = {id: id, parts: [part]});
  19251. else
  19252. newStyles[id].parts.push(part);
  19253. }
  19254. return styles;
  19255. }
  19256. function insertStyleElement(options, styleElement) {
  19257. var head = getHeadElement();
  19258. var lastStyleElementInsertedAtTop = styleElementsInsertedAtTop[styleElementsInsertedAtTop.length - 1];
  19259. if (options.insertAt === "top") {
  19260. if(!lastStyleElementInsertedAtTop) {
  19261. head.insertBefore(styleElement, head.firstChild);
  19262. } else if(lastStyleElementInsertedAtTop.nextSibling) {
  19263. head.insertBefore(styleElement, lastStyleElementInsertedAtTop.nextSibling);
  19264. } else {
  19265. head.appendChild(styleElement);
  19266. }
  19267. styleElementsInsertedAtTop.push(styleElement);
  19268. } else if (options.insertAt === "bottom") {
  19269. head.appendChild(styleElement);
  19270. } else {
  19271. throw new Error("Invalid value for parameter 'insertAt'. Must be 'top' or 'bottom'.");
  19272. }
  19273. }
  19274. function removeStyleElement(styleElement) {
  19275. styleElement.parentNode.removeChild(styleElement);
  19276. var idx = styleElementsInsertedAtTop.indexOf(styleElement);
  19277. if(idx >= 0) {
  19278. styleElementsInsertedAtTop.splice(idx, 1);
  19279. }
  19280. }
  19281. function createStyleElement(options) {
  19282. var styleElement = document.createElement("style");
  19283. styleElement.type = "text/css";
  19284. insertStyleElement(options, styleElement);
  19285. return styleElement;
  19286. }
  19287. function createLinkElement(options) {
  19288. var linkElement = document.createElement("link");
  19289. linkElement.rel = "stylesheet";
  19290. insertStyleElement(options, linkElement);
  19291. return linkElement;
  19292. }
  19293. function addStyle(obj, options) {
  19294. var styleElement, update, remove;
  19295. if (options.singleton) {
  19296. var styleIndex = singletonCounter++;
  19297. styleElement = singletonElement || (singletonElement = createStyleElement(options));
  19298. update = applyToSingletonTag.bind(null, styleElement, styleIndex, false);
  19299. remove = applyToSingletonTag.bind(null, styleElement, styleIndex, true);
  19300. } else if(obj.sourceMap &&
  19301. typeof URL === "function" &&
  19302. typeof URL.createObjectURL === "function" &&
  19303. typeof URL.revokeObjectURL === "function" &&
  19304. typeof Blob === "function" &&
  19305. typeof btoa === "function") {
  19306. styleElement = createLinkElement(options);
  19307. update = updateLink.bind(null, styleElement);
  19308. remove = function() {
  19309. removeStyleElement(styleElement);
  19310. if(styleElement.href)
  19311. URL.revokeObjectURL(styleElement.href);
  19312. };
  19313. } else {
  19314. styleElement = createStyleElement(options);
  19315. update = applyToTag.bind(null, styleElement);
  19316. remove = function() {
  19317. removeStyleElement(styleElement);
  19318. };
  19319. }
  19320. update(obj);
  19321. return function updateStyle(newObj) {
  19322. if(newObj) {
  19323. if(newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap)
  19324. return;
  19325. update(obj = newObj);
  19326. } else {
  19327. remove();
  19328. }
  19329. };
  19330. }
  19331. var replaceText = (function () {
  19332. var textStore = [];
  19333. return function (index, replacement) {
  19334. textStore[index] = replacement;
  19335. return textStore.filter(Boolean).join('\n');
  19336. };
  19337. })();
  19338. function applyToSingletonTag(styleElement, index, remove, obj) {
  19339. var css = remove ? "" : obj.css;
  19340. if (styleElement.styleSheet) {
  19341. styleElement.styleSheet.cssText = replaceText(index, css);
  19342. } else {
  19343. var cssNode = document.createTextNode(css);
  19344. var childNodes = styleElement.childNodes;
  19345. if (childNodes[index]) styleElement.removeChild(childNodes[index]);
  19346. if (childNodes.length) {
  19347. styleElement.insertBefore(cssNode, childNodes[index]);
  19348. } else {
  19349. styleElement.appendChild(cssNode);
  19350. }
  19351. }
  19352. }
  19353. function applyToTag(styleElement, obj) {
  19354. var css = obj.css;
  19355. var media = obj.media;
  19356. if(media) {
  19357. styleElement.setAttribute("media", media)
  19358. }
  19359. if(styleElement.styleSheet) {
  19360. styleElement.styleSheet.cssText = css;
  19361. } else {
  19362. while(styleElement.firstChild) {
  19363. styleElement.removeChild(styleElement.firstChild);
  19364. }
  19365. styleElement.appendChild(document.createTextNode(css));
  19366. }
  19367. }
  19368. function updateLink(linkElement, obj) {
  19369. var css = obj.css;
  19370. var sourceMap = obj.sourceMap;
  19371. if(sourceMap) {
  19372. // http://stackoverflow.com/a/26603875
  19373. css += "\n/*# sourceMappingURL=data:application/json;base64," + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + " */";
  19374. }
  19375. var blob = new Blob([css], { type: "text/css" });
  19376. var oldSrc = linkElement.href;
  19377. linkElement.href = URL.createObjectURL(blob);
  19378. if(oldSrc)
  19379. URL.revokeObjectURL(oldSrc);
  19380. }
  19381. /***/ },
  19382. /* 182 */
  19383. /***/ function(module, exports, __webpack_require__) {
  19384. /**
  19385. * @author oldj
  19386. * @blog http://oldj.net
  19387. */
  19388. 'use strict';
  19389. Object.defineProperty(exports, "__esModule", {
  19390. value: true
  19391. });
  19392. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  19393. var _react = __webpack_require__(3);
  19394. var _react2 = _interopRequireDefault(_react);
  19395. var _classnames = __webpack_require__(177);
  19396. var _classnames2 = _interopRequireDefault(_classnames);
  19397. __webpack_require__(183);
  19398. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  19399. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  19400. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  19401. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  19402. var SearchBar = function (_React$Component) {
  19403. _inherits(SearchBar, _React$Component);
  19404. function SearchBar(props) {
  19405. _classCallCheck(this, SearchBar);
  19406. var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(SearchBar).call(this, props));
  19407. _this.state = {
  19408. show: false,
  19409. keyword: ''
  19410. };
  19411. _this._t = null;
  19412. SH_event.on('search_on', function () {
  19413. _this.setState({
  19414. show: true
  19415. }, function () {
  19416. setTimeout(function () {
  19417. _this.refs.keyword.focus();
  19418. }, 100);
  19419. });
  19420. });
  19421. SH_event.on('search_off', function () {
  19422. _this.clearSearch();
  19423. });
  19424. return _this;
  19425. }
  19426. _createClass(SearchBar, [{
  19427. key: 'clearSearch',
  19428. value: function clearSearch() {
  19429. this.setState({
  19430. show: false,
  19431. keyword: ''
  19432. });
  19433. SH_event.emit('search', '');
  19434. }
  19435. }, {
  19436. key: 'doSearch',
  19437. value: function doSearch(kw) {
  19438. this.setState({
  19439. keyword: kw
  19440. });
  19441. clearTimeout(this._t);
  19442. this._t = setTimeout(function () {
  19443. SH_event.emit('search', kw);
  19444. }, 300);
  19445. }
  19446. }, {
  19447. key: 'onCancel',
  19448. value: function onCancel() {
  19449. SH_event.emit('cancel_search');
  19450. }
  19451. }, {
  19452. key: 'render',
  19453. value: function render() {
  19454. var _this2 = this;
  19455. if (!this.state.show) {
  19456. return null;
  19457. }
  19458. return _react2.default.createElement(
  19459. 'div',
  19460. { id: 'sh-searchbar' },
  19461. _react2.default.createElement('input', {
  19462. ref: 'keyword',
  19463. type: 'text',
  19464. placeholder: 'keyword',
  19465. value: this.state.keyword,
  19466. onChange: function onChange(e) {
  19467. return _this2.doSearch(e.target.value);
  19468. },
  19469. onKeyDown: function onKeyDown(e) {
  19470. return e.keyCode === 27 && _this2.onCancel();
  19471. }
  19472. })
  19473. );
  19474. }
  19475. }]);
  19476. return SearchBar;
  19477. }(_react2.default.Component);
  19478. exports.default = SearchBar;
  19479. /***/ },
  19480. /* 183 */
  19481. /***/ function(module, exports, __webpack_require__) {
  19482. // style-loader: Adds some css to the DOM by adding a <style> tag
  19483. // load the styles
  19484. var content = __webpack_require__(184);
  19485. if(typeof content === 'string') content = [[module.id, content, '']];
  19486. // add the styles to the DOM
  19487. var update = __webpack_require__(181)(content, {});
  19488. if(content.locals) module.exports = content.locals;
  19489. // Hot Module Replacement
  19490. if(false) {
  19491. // When the styles change, update the <style> tags
  19492. if(!content.locals) {
  19493. module.hot.accept("!!./../../../node_modules/css-loader/index.js!./../../../node_modules/less-loader/index.js!./searchbar.less", function() {
  19494. var newContent = require("!!./../../../node_modules/css-loader/index.js!./../../../node_modules/less-loader/index.js!./searchbar.less");
  19495. if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
  19496. update(newContent);
  19497. });
  19498. }
  19499. // When the module is disposed, remove the <style> tags
  19500. module.hot.dispose(function() { update(); });
  19501. }
  19502. /***/ },
  19503. /* 184 */
  19504. /***/ function(module, exports, __webpack_require__) {
  19505. exports = module.exports = __webpack_require__(180)();
  19506. // imports
  19507. // module
  19508. exports.push([module.id, "#sh-searchbar {\n position: fixed;\n width: 240px;\n left: 0;\n bottom: 30px;\n background: #3d434e;\n padding: 6px 20px 5px 18px;\n border-top: solid 1px #323740;\n}\n#sh-searchbar input {\n background: transparent;\n border: 0;\n outline: 0;\n color: #fff;\n font-size: 13px;\n}\n", ""]);
  19509. // exports
  19510. /***/ },
  19511. /* 185 */
  19512. /***/ function(module, exports, __webpack_require__) {
  19513. /**
  19514. * @author oldj
  19515. * @blog http://oldj.net
  19516. */
  19517. 'use strict';
  19518. Object.defineProperty(exports, "__esModule", {
  19519. value: true
  19520. });
  19521. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  19522. var _react = __webpack_require__(3);
  19523. var _react2 = _interopRequireDefault(_react);
  19524. var _list_item = __webpack_require__(186);
  19525. var _list_item2 = _interopRequireDefault(_list_item);
  19526. var _reactAddonsUpdate = __webpack_require__(190);
  19527. var _reactAddonsUpdate2 = _interopRequireDefault(_reactAddonsUpdate);
  19528. __webpack_require__(192);
  19529. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  19530. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  19531. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  19532. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  19533. var List = function (_React$Component) {
  19534. _inherits(List, _React$Component);
  19535. function List(props) {
  19536. _classCallCheck(this, List);
  19537. var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(List).call(this, props));
  19538. _this.state = {
  19539. current: _this.props.current,
  19540. list: _this.props.hosts.list
  19541. };
  19542. _this.last_content = _this.props.hosts.sys.content;
  19543. SH_event.on('imported', function () {
  19544. _this.setState({
  19545. current: _this.props.current,
  19546. list: _this.props.hosts.list
  19547. }, function () {
  19548. SH_event.emit('change');
  19549. });
  19550. });
  19551. SH_event.on('change', function () {
  19552. SH_event.emit('save_data', _this.state.list);
  19553. var content = _this.getOnContent();
  19554. if (content !== _this.last_content) {
  19555. SH_event.emit('apply', content, function () {
  19556. _this.last_content = content;
  19557. });
  19558. }
  19559. });
  19560. SH_event.on('host_added', function (data) {
  19561. _this.setState({
  19562. list: (0, _reactAddonsUpdate2.default)(_this.state.list, { $push: [data] })
  19563. }, function () {
  19564. _this.selectOne(data);
  19565. setTimeout(function () {
  19566. SH_event.emit('change', true);
  19567. var el = _this.refs.items;
  19568. el.scrollTop = document.querySelector('.list-item.selected').offsetTop - el.offsetHeight + 50;
  19569. _this.checkUpdateHost(data);
  19570. }, 100);
  19571. });
  19572. });
  19573. SH_event.on('host_edited', function (data, host) {
  19574. var idx = _this.state.list.findIndex(function (item) {
  19575. return item == host;
  19576. });
  19577. if (idx == -1) return;
  19578. _this.setState({
  19579. list: (0, _reactAddonsUpdate2.default)(_this.state.list, { $splice: [[idx, 1, data]] })
  19580. }, function () {
  19581. _this.selectOne(data);
  19582. setTimeout(function () {
  19583. SH_event.emit('change', true);
  19584. _this.checkUpdateHost(data, true);
  19585. }, 100);
  19586. });
  19587. });
  19588. SH_event.on('del_host', function (host) {
  19589. var list = _this.state.list;
  19590. var idx_to_del = list.findIndex(function (item) {
  19591. return host === item;
  19592. });
  19593. if (idx_to_del == -1) return;
  19594. // list.splice(idx_to_del, 1);
  19595. _this.setState({
  19596. list: (0, _reactAddonsUpdate2.default)(_this.state.list, { $splice: [[idx_to_del, 1]] })
  19597. // list: this.state.list.filter((item, idx) => idx != idx_to_del)
  19598. }, function () {
  19599. setTimeout(function () {
  19600. var list = _this.state.list;
  19601. var next_host = list[idx_to_del] || list[list.length - 1] || _this.props.hosts.sys;
  19602. if (next_host) {
  19603. _this.selectOne(next_host);
  19604. }
  19605. SH_event.emit('change');
  19606. }, 100);
  19607. });
  19608. });
  19609. SH_event.on('get_on_hosts', function (callback) {
  19610. callback(_this.getOnItems());
  19611. });
  19612. ipcRenderer.on('get_host_list', function () {
  19613. ipcRenderer.send('send_host_list', _this.state.list);
  19614. });
  19615. ipcRenderer.on('get_export_data', function (e, fn) {
  19616. var data = Object.assign({}, {
  19617. version: __webpack_require__(194).version,
  19618. list: _this.state.list.map(function (item) {
  19619. item.on = false;
  19620. return item;
  19621. })
  19622. });
  19623. ipcRenderer.send('export_data', fn, JSON.stringify(data));
  19624. });
  19625. SH_event.on('top_toggle', function (on, items) {
  19626. _this.setState({
  19627. list: _this.state.list.map(function (item) {
  19628. if (items.findIndex(function (i) {
  19629. return i == item;
  19630. }) > -1) {
  19631. item.on = on;
  19632. }
  19633. return item;
  19634. })
  19635. }, function () {
  19636. SH_event.emit('change');
  19637. });
  19638. });
  19639. SH_event.on('loading', function (host, flag) {
  19640. if (flag) return;
  19641. if (host == _this.state.current) {
  19642. setTimeout(function () {
  19643. _this.selectOne(host);
  19644. }, 100);
  19645. }
  19646. });
  19647. return _this;
  19648. }
  19649. /**
  19650. * 检查当前 host 是否需要从网络下载更新
  19651. * @param host
  19652. * @param force {Boolean} 如果为 true,则只要是 remote 且 refresh_interval != 0,则强制更新
  19653. */
  19654. _createClass(List, [{
  19655. key: 'checkUpdateHost',
  19656. value: function checkUpdateHost(host) {
  19657. var force = arguments.length <= 1 || arguments[1] === undefined ? false : arguments[1];
  19658. SH_event.emit('check_host_refresh', host, force);
  19659. }
  19660. }, {
  19661. key: 'apply',
  19662. value: function apply(content, success) {
  19663. var _this2 = this;
  19664. SH_event.emit('apply', content, function () {
  19665. _this2.last_content = content;
  19666. success();
  19667. SH_event.emit('save_data', _this2.state.list);
  19668. SH_Agent.notify({
  19669. message: 'host updated.'
  19670. });
  19671. });
  19672. }
  19673. }, {
  19674. key: 'selectOne',
  19675. value: function selectOne(host) {
  19676. this.setState({
  19677. current: host
  19678. });
  19679. this.props.setCurrent(host);
  19680. }
  19681. }, {
  19682. key: 'toggleOne',
  19683. value: function toggleOne(idx, success) {
  19684. var content = this.getOnContent(idx);
  19685. this.apply(content, success || function () {});
  19686. }
  19687. }, {
  19688. key: 'getOnItems',
  19689. value: function getOnItems() {
  19690. var idx = arguments.length <= 0 || arguments[0] === undefined ? -1 : arguments[0];
  19691. return this.state.list.filter(function (item, _idx) {
  19692. return item.on && _idx != idx || !item.on && _idx == idx;
  19693. });
  19694. }
  19695. }, {
  19696. key: 'getOnContent',
  19697. value: function getOnContent() {
  19698. var idx = arguments.length <= 0 || arguments[0] === undefined ? -1 : arguments[0];
  19699. var contents = this.getOnItems(idx).map(function (item) {
  19700. return item.content || '';
  19701. });
  19702. contents.unshift('# SwitchHosts!');
  19703. return contents.join('\n\n');
  19704. }
  19705. }, {
  19706. key: 'customItems',
  19707. value: function customItems() {
  19708. var _this3 = this;
  19709. return this.state.list.map(function (item, idx) {
  19710. return _react2.default.createElement(_list_item2.default, {
  19711. data: item,
  19712. idx: idx,
  19713. selectOne: _this3.selectOne.bind(_this3),
  19714. current: _this3.state.current,
  19715. onToggle: function onToggle(success) {
  19716. return _this3.toggleOne(idx, success);
  19717. },
  19718. key: 'host-' + idx,
  19719. dragOrder: function dragOrder(sidx, tidx) {
  19720. return _this3.dragOrder(sidx, tidx);
  19721. }
  19722. });
  19723. });
  19724. }
  19725. }, {
  19726. key: 'dragOrder',
  19727. value: function dragOrder(source_idx, target_idx) {
  19728. var source = this.state.list[source_idx];
  19729. var target = this.state.list[target_idx];
  19730. var list = this.state.list.filter(function (item, idx) {
  19731. return idx != source_idx;
  19732. });
  19733. var new_target_idx = list.findIndex(function (item) {
  19734. return item == target;
  19735. });
  19736. var to_idx = void 0;
  19737. if (source_idx < target_idx) {
  19738. // append
  19739. to_idx = new_target_idx + 1;
  19740. } else {
  19741. // insert before
  19742. to_idx = new_target_idx;
  19743. }
  19744. list.splice(to_idx, 0, source);
  19745. this.setState({
  19746. list: list
  19747. });
  19748. setTimeout(function () {
  19749. SH_event.emit('change');
  19750. }, 100);
  19751. }
  19752. }, {
  19753. key: 'componentDidMount',
  19754. value: function componentDidMount() {}
  19755. }, {
  19756. key: 'render',
  19757. value: function render() {
  19758. return _react2.default.createElement(
  19759. 'div',
  19760. { id: 'sh-list' },
  19761. _react2.default.createElement(_list_item2.default, {
  19762. data: this.props.hosts.sys,
  19763. selectOne: this.selectOne.bind(this),
  19764. current: this.state.current,
  19765. sys: '1' }),
  19766. _react2.default.createElement(
  19767. 'div',
  19768. { ref: 'items', className: 'custom-items' },
  19769. this.customItems()
  19770. )
  19771. );
  19772. }
  19773. }]);
  19774. return List;
  19775. }(_react2.default.Component);
  19776. exports.default = List;
  19777. /***/ },
  19778. /* 186 */
  19779. /***/ function(module, exports, __webpack_require__) {
  19780. /**
  19781. * @author oldj
  19782. * @blog http://oldj.net
  19783. */
  19784. 'use strict';
  19785. Object.defineProperty(exports, "__esModule", {
  19786. value: true
  19787. });
  19788. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  19789. var _react = __webpack_require__(3);
  19790. var _react2 = _interopRequireDefault(_react);
  19791. var _classnames = __webpack_require__(177);
  19792. var _classnames2 = _interopRequireDefault(_classnames);
  19793. var _kw = __webpack_require__(187);
  19794. __webpack_require__(188);
  19795. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  19796. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  19797. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  19798. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  19799. var ListItem = function (_React$Component) {
  19800. _inherits(ListItem, _React$Component);
  19801. function ListItem(props) {
  19802. _classCallCheck(this, ListItem);
  19803. var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(ListItem).call(this, props));
  19804. _this.is_sys = !!_this.props.sys;
  19805. _this.state = {
  19806. is_selected: false,
  19807. search_kw: '',
  19808. search_re: null
  19809. };
  19810. SH_event.on('search', function (kw) {
  19811. _this.setState({
  19812. search_kw: kw,
  19813. search_re: kw ? (0, _kw.kw2re)(kw) : null
  19814. });
  19815. });
  19816. ipcRenderer.on('tray_toggle_host', function (e, idx) {
  19817. // ipcRenderer.send('send_host_list', this.state.list);
  19818. // this.toggleOne(idx);
  19819. if (idx === _this.props.idx) {
  19820. _this.toggle();
  19821. }
  19822. });
  19823. return _this;
  19824. }
  19825. _createClass(ListItem, [{
  19826. key: 'getTitle',
  19827. value: function getTitle() {
  19828. return this.is_sys ? 'System Hosts' : this.props.data.title || 'untitled';
  19829. }
  19830. }, {
  19831. key: 'beSelected',
  19832. value: function beSelected() {
  19833. // this.setState({
  19834. // is_selected: true
  19835. // });
  19836. this.props.selectOne(this.props.data);
  19837. }
  19838. }, {
  19839. key: 'toEdit',
  19840. value: function toEdit() {
  19841. SH_event.emit('edit_host', this.props.data);
  19842. }
  19843. }, {
  19844. key: 'toggle',
  19845. value: function toggle() {
  19846. var _this2 = this;
  19847. var on = !this.props.data.on;
  19848. this.props.onToggle(function () {
  19849. _this2.props.data.on = on;
  19850. _this2.forceUpdate();
  19851. });
  19852. SH_event.emit('toggle_host', on);
  19853. }
  19854. }, {
  19855. key: 'allowedDrop',
  19856. value: function allowedDrop(e) {
  19857. e.preventDefault();
  19858. }
  19859. }, {
  19860. key: 'onDrop',
  19861. value: function onDrop(e) {
  19862. if (this.props.sys) {
  19863. e.preventDefault();
  19864. return false;
  19865. }
  19866. var source_idx = parseInt(e.dataTransfer.getData('text'));
  19867. this.props.dragOrder(source_idx, this.props.idx);
  19868. }
  19869. }, {
  19870. key: 'onDrag',
  19871. value: function onDrag(e) {
  19872. e.dataTransfer.setData('text', this.props.idx);
  19873. }
  19874. }, {
  19875. key: 'isMatched',
  19876. value: function isMatched() {
  19877. if (this.props.sys) return true;
  19878. var kw = this.state.search_kw;
  19879. var re = this.state.search_re;
  19880. if (!kw || kw === '/') return true;
  19881. var _props$data = this.props.data;
  19882. var title = _props$data.title;
  19883. var content = _props$data.content;
  19884. if (re) {
  19885. return re.test(title) || re.test(content);
  19886. } else {
  19887. return title.indexOf(kw) > -1 || content.indexOf(kw) > -1;
  19888. }
  19889. }
  19890. }, {
  19891. key: 'render',
  19892. value: function render() {
  19893. var _this3 = this;
  19894. var _props = this.props;
  19895. var data = _props.data;
  19896. var sys = _props.sys;
  19897. var current = _props.current;
  19898. var is_selected = data == current;
  19899. return _react2.default.createElement(
  19900. 'div',
  19901. { className: (0, _classnames2.default)({
  19902. 'list-item': 1,
  19903. 'hidden': !this.isMatched(),
  19904. 'sys-host': sys,
  19905. 'selected': is_selected
  19906. }),
  19907. onClick: this.beSelected.bind(this),
  19908. draggable: !sys,
  19909. onDragStart: function onDragStart(e) {
  19910. return _this3.onDrag(e);
  19911. },
  19912. onDragOver: function onDragOver(e) {
  19913. return _this3.allowedDrop(e);
  19914. },
  19915. onDrop: function onDrop(e) {
  19916. return _this3.onDrop(e);
  19917. }
  19918. },
  19919. sys ? null : _react2.default.createElement(
  19920. 'div',
  19921. null,
  19922. _react2.default.createElement('i', { className: (0, _classnames2.default)({
  19923. 'switch': 1,
  19924. 'iconfont': 1,
  19925. 'icon-on': data.on,
  19926. 'icon-off': !data.on
  19927. }),
  19928. onClick: this.toggle.bind(this)
  19929. }),
  19930. _react2.default.createElement('i', {
  19931. className: 'iconfont icon-edit',
  19932. onClick: this.toEdit.bind(this)
  19933. })
  19934. ),
  19935. _react2.default.createElement('i', { className: (0, _classnames2.default)({
  19936. 'iconfont': 1,
  19937. 'item-icon': 1,
  19938. 'icon-doc': !sys,
  19939. 'icon-sysserver': sys
  19940. }) }),
  19941. _react2.default.createElement(
  19942. 'span',
  19943. null,
  19944. this.getTitle()
  19945. )
  19946. );
  19947. }
  19948. }]);
  19949. return ListItem;
  19950. }(_react2.default.Component);
  19951. exports.default = ListItem;
  19952. /***/ },
  19953. /* 187 */
  19954. /***/ function(module, exports) {
  19955. /**
  19956. * kw
  19957. * @author oldj
  19958. * @blog http://oldj.net
  19959. */
  19960. 'use strict';
  19961. function kw2re(kw) {
  19962. // 模糊搜索
  19963. var r = void 0;
  19964. var m = void 0;
  19965. var flag = [];
  19966. if (kw === '/') {
  19967. return;
  19968. } else if (m = kw.match(/^\/([^\/]+)\/?(\w*)$/)) {
  19969. if (m[2].indexOf('i') > -1) {
  19970. flag.push('i');
  19971. }
  19972. // if (m[2].indexOf('g') > -1) {
  19973. flag.push('g');
  19974. // }
  19975. try {
  19976. r = new RegExp(m[1], flag.join(''));
  19977. } catch (e) {}
  19978. } else if (kw.indexOf('*') > -1) {
  19979. try {
  19980. r = new RegExp(kw.replace(/\*/g, '.*'), 'ig');
  19981. } catch (e) {}
  19982. }
  19983. return r;
  19984. }
  19985. exports.findPositions = function (kw, code) {
  19986. if (!kw || kw === '/') return;
  19987. var r = kw2re(kw);
  19988. if (!r) {
  19989. try {
  19990. r = new RegExp(kw.replace(/([\.\?\*\+\^\$\(\)\-\[\]\{\}])/g, '\\$1'), 'ig');
  19991. } catch (e) {
  19992. console.log(e);
  19993. return;
  19994. }
  19995. }
  19996. var indexes = [];
  19997. var lines = code.split('\n');
  19998. lines.map(function (ln, idx) {
  19999. var match = void 0;
  20000. var max_loop = 30;
  20001. while (match = r.exec(ln)) {
  20002. indexes.push([{ line: idx, ch: match.index }, { line: idx, ch: match.index + match[0].length }]);
  20003. max_loop--;
  20004. if (max_loop < 0) break;
  20005. }
  20006. });
  20007. return indexes;
  20008. };
  20009. exports.kw2re = kw2re;
  20010. /***/ },
  20011. /* 188 */
  20012. /***/ function(module, exports, __webpack_require__) {
  20013. // style-loader: Adds some css to the DOM by adding a <style> tag
  20014. // load the styles
  20015. var content = __webpack_require__(189);
  20016. if(typeof content === 'string') content = [[module.id, content, '']];
  20017. // add the styles to the DOM
  20018. var update = __webpack_require__(181)(content, {});
  20019. if(content.locals) module.exports = content.locals;
  20020. // Hot Module Replacement
  20021. if(false) {
  20022. // When the styles change, update the <style> tags
  20023. if(!content.locals) {
  20024. module.hot.accept("!!./../../../node_modules/css-loader/index.js!./../../../node_modules/less-loader/index.js!./list_item.less", function() {
  20025. var newContent = require("!!./../../../node_modules/css-loader/index.js!./../../../node_modules/less-loader/index.js!./list_item.less");
  20026. if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
  20027. update(newContent);
  20028. });
  20029. }
  20030. // When the module is disposed, remove the <style> tags
  20031. module.hot.dispose(function() { update(); });
  20032. }
  20033. /***/ },
  20034. /* 189 */
  20035. /***/ function(module, exports, __webpack_require__) {
  20036. exports = module.exports = __webpack_require__(180)();
  20037. // imports
  20038. // module
  20039. exports.push([module.id, "#sh-list .list-item {\n padding: 7px 10px 7px 15px;\n cursor: pointer;\n}\n#sh-list .list-item.hidden {\n display: none;\n}\n#sh-list .list-item.sys-host {\n font-size: 14px;\n padding: 8px 10px 8px 12px;\n}\n#sh-list .list-item.sys-host i {\n width: 23px;\n}\n#sh-list .list-item.selected {\n background: #2d3138;\n}\n#sh-list .list-item.selected span {\n color: #fff;\n}\n#sh-list .list-item.selected i.item-icon {\n color: #fff;\n}\n#sh-list .list-item.selected:hover i.icon-edit {\n display: block;\n color: #fff;\n}\n#sh-list .list-item i {\n display: inline-block;\n width: 20px;\n text-align: center;\n margin-right: 5px;\n}\n#sh-list .list-item i.switch {\n float: right;\n cursor: pointer;\n line-height: 23px;\n}\n#sh-list .list-item i.switch.icon-on {\n color: #af9;\n}\n#sh-list .list-item i.icon-edit {\n float: right;\n display: none;\n}\n", ""]);
  20040. // exports
  20041. /***/ },
  20042. /* 190 */
  20043. /***/ function(module, exports, __webpack_require__) {
  20044. module.exports = __webpack_require__(191);
  20045. /***/ },
  20046. /* 191 */
  20047. /***/ function(module, exports, __webpack_require__) {
  20048. /* WEBPACK VAR INJECTION */(function(process) {/**
  20049. * Copyright 2013-present, Facebook, Inc.
  20050. * All rights reserved.
  20051. *
  20052. * This source code is licensed under the BSD-style license found in the
  20053. * LICENSE file in the root directory of this source tree. An additional grant
  20054. * of patent rights can be found in the PATENTS file in the same directory.
  20055. *
  20056. * @providesModule update
  20057. */
  20058. /* global hasOwnProperty:true */
  20059. 'use strict';
  20060. var _prodInvariant = __webpack_require__(9),
  20061. _assign = __webpack_require__(6);
  20062. var keyOf = __webpack_require__(27);
  20063. var invariant = __webpack_require__(10);
  20064. var hasOwnProperty = {}.hasOwnProperty;
  20065. function shallowCopy(x) {
  20066. if (Array.isArray(x)) {
  20067. return x.concat();
  20068. } else if (x && typeof x === 'object') {
  20069. return _assign(new x.constructor(), x);
  20070. } else {
  20071. return x;
  20072. }
  20073. }
  20074. var COMMAND_PUSH = keyOf({ $push: null });
  20075. var COMMAND_UNSHIFT = keyOf({ $unshift: null });
  20076. var COMMAND_SPLICE = keyOf({ $splice: null });
  20077. var COMMAND_SET = keyOf({ $set: null });
  20078. var COMMAND_MERGE = keyOf({ $merge: null });
  20079. var COMMAND_APPLY = keyOf({ $apply: null });
  20080. var ALL_COMMANDS_LIST = [COMMAND_PUSH, COMMAND_UNSHIFT, COMMAND_SPLICE, COMMAND_SET, COMMAND_MERGE, COMMAND_APPLY];
  20081. var ALL_COMMANDS_SET = {};
  20082. ALL_COMMANDS_LIST.forEach(function (command) {
  20083. ALL_COMMANDS_SET[command] = true;
  20084. });
  20085. function invariantArrayCase(value, spec, command) {
  20086. !Array.isArray(value) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'update(): expected target of %s to be an array; got %s.', command, value) : _prodInvariant('1', command, value) : void 0;
  20087. var specValue = spec[command];
  20088. !Array.isArray(specValue) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'update(): expected spec of %s to be an array; got %s. Did you forget to wrap your parameter in an array?', command, specValue) : _prodInvariant('2', command, specValue) : void 0;
  20089. }
  20090. /**
  20091. * Returns a updated shallow copy of an object without mutating the original.
  20092. * See https://facebook.github.io/react/docs/update.html for details.
  20093. */
  20094. function update(value, spec) {
  20095. !(typeof spec === 'object') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'update(): You provided a key path to update() that did not contain one of %s. Did you forget to include {%s: ...}?', ALL_COMMANDS_LIST.join(', '), COMMAND_SET) : _prodInvariant('3', ALL_COMMANDS_LIST.join(', '), COMMAND_SET) : void 0;
  20096. if (hasOwnProperty.call(spec, COMMAND_SET)) {
  20097. !(Object.keys(spec).length === 1) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Cannot have more than one key in an object with %s', COMMAND_SET) : _prodInvariant('4', COMMAND_SET) : void 0;
  20098. return spec[COMMAND_SET];
  20099. }
  20100. var nextValue = shallowCopy(value);
  20101. if (hasOwnProperty.call(spec, COMMAND_MERGE)) {
  20102. var mergeObj = spec[COMMAND_MERGE];
  20103. !(mergeObj && typeof mergeObj === 'object') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'update(): %s expects a spec of type \'object\'; got %s', COMMAND_MERGE, mergeObj) : _prodInvariant('5', COMMAND_MERGE, mergeObj) : void 0;
  20104. !(nextValue && typeof nextValue === 'object') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'update(): %s expects a target of type \'object\'; got %s', COMMAND_MERGE, nextValue) : _prodInvariant('6', COMMAND_MERGE, nextValue) : void 0;
  20105. _assign(nextValue, spec[COMMAND_MERGE]);
  20106. }
  20107. if (hasOwnProperty.call(spec, COMMAND_PUSH)) {
  20108. invariantArrayCase(value, spec, COMMAND_PUSH);
  20109. spec[COMMAND_PUSH].forEach(function (item) {
  20110. nextValue.push(item);
  20111. });
  20112. }
  20113. if (hasOwnProperty.call(spec, COMMAND_UNSHIFT)) {
  20114. invariantArrayCase(value, spec, COMMAND_UNSHIFT);
  20115. spec[COMMAND_UNSHIFT].forEach(function (item) {
  20116. nextValue.unshift(item);
  20117. });
  20118. }
  20119. if (hasOwnProperty.call(spec, COMMAND_SPLICE)) {
  20120. !Array.isArray(value) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected %s target to be an array; got %s', COMMAND_SPLICE, value) : _prodInvariant('7', COMMAND_SPLICE, value) : void 0;
  20121. !Array.isArray(spec[COMMAND_SPLICE]) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'update(): expected spec of %s to be an array of arrays; got %s. Did you forget to wrap your parameters in an array?', COMMAND_SPLICE, spec[COMMAND_SPLICE]) : _prodInvariant('8', COMMAND_SPLICE, spec[COMMAND_SPLICE]) : void 0;
  20122. spec[COMMAND_SPLICE].forEach(function (args) {
  20123. !Array.isArray(args) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'update(): expected spec of %s to be an array of arrays; got %s. Did you forget to wrap your parameters in an array?', COMMAND_SPLICE, spec[COMMAND_SPLICE]) : _prodInvariant('8', COMMAND_SPLICE, spec[COMMAND_SPLICE]) : void 0;
  20124. nextValue.splice.apply(nextValue, args);
  20125. });
  20126. }
  20127. if (hasOwnProperty.call(spec, COMMAND_APPLY)) {
  20128. !(typeof spec[COMMAND_APPLY] === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'update(): expected spec of %s to be a function; got %s.', COMMAND_APPLY, spec[COMMAND_APPLY]) : _prodInvariant('9', COMMAND_APPLY, spec[COMMAND_APPLY]) : void 0;
  20129. nextValue = spec[COMMAND_APPLY](nextValue);
  20130. }
  20131. for (var k in spec) {
  20132. if (!(ALL_COMMANDS_SET.hasOwnProperty(k) && ALL_COMMANDS_SET[k])) {
  20133. nextValue[k] = update(value[k], spec[k]);
  20134. }
  20135. }
  20136. return nextValue;
  20137. }
  20138. module.exports = update;
  20139. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  20140. /***/ },
  20141. /* 192 */
  20142. /***/ function(module, exports, __webpack_require__) {
  20143. // style-loader: Adds some css to the DOM by adding a <style> tag
  20144. // load the styles
  20145. var content = __webpack_require__(193);
  20146. if(typeof content === 'string') content = [[module.id, content, '']];
  20147. // add the styles to the DOM
  20148. var update = __webpack_require__(181)(content, {});
  20149. if(content.locals) module.exports = content.locals;
  20150. // Hot Module Replacement
  20151. if(false) {
  20152. // When the styles change, update the <style> tags
  20153. if(!content.locals) {
  20154. module.hot.accept("!!./../../../node_modules/css-loader/index.js!./../../../node_modules/less-loader/index.js!./list.less", function() {
  20155. var newContent = require("!!./../../../node_modules/css-loader/index.js!./../../../node_modules/less-loader/index.js!./list.less");
  20156. if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
  20157. update(newContent);
  20158. });
  20159. }
  20160. // When the module is disposed, remove the <style> tags
  20161. module.hot.dispose(function() { update(); });
  20162. }
  20163. /***/ },
  20164. /* 193 */
  20165. /***/ function(module, exports, __webpack_require__) {
  20166. exports = module.exports = __webpack_require__(180)();
  20167. // imports
  20168. // module
  20169. exports.push([module.id, "#sh-list .custom-items {\n position: fixed;\n width: 240px;\n top: 36px;\n bottom: 30px;\n overflow: auto;\n}\n", ""]);
  20170. // exports
  20171. /***/ },
  20172. /* 194 */
  20173. /***/ function(module, exports, __webpack_require__) {
  20174. /**
  20175. * configs.js
  20176. * @author oldj
  20177. * @blog http://oldj.net
  20178. */
  20179. 'use strict';
  20180. var m_ver = __webpack_require__(195).version;
  20181. exports.version = m_ver.slice(0, 3).join('.');
  20182. exports.version_full = m_ver.join('.');
  20183. /***/ },
  20184. /* 195 */
  20185. /***/ function(module, exports) {
  20186. "use strict";
  20187. exports.version = [3, 2, 0, 4139];
  20188. /***/ },
  20189. /* 196 */
  20190. /***/ function(module, exports, __webpack_require__) {
  20191. // style-loader: Adds some css to the DOM by adding a <style> tag
  20192. // load the styles
  20193. var content = __webpack_require__(197);
  20194. if(typeof content === 'string') content = [[module.id, content, '']];
  20195. // add the styles to the DOM
  20196. var update = __webpack_require__(181)(content, {});
  20197. if(content.locals) module.exports = content.locals;
  20198. // Hot Module Replacement
  20199. if(false) {
  20200. // When the styles change, update the <style> tags
  20201. if(!content.locals) {
  20202. module.hot.accept("!!./../../../node_modules/css-loader/index.js!./../../../node_modules/less-loader/index.js!./panel.less", function() {
  20203. var newContent = require("!!./../../../node_modules/css-loader/index.js!./../../../node_modules/less-loader/index.js!./panel.less");
  20204. if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
  20205. update(newContent);
  20206. });
  20207. }
  20208. // When the module is disposed, remove the <style> tags
  20209. module.hot.dispose(function() { update(); });
  20210. }
  20211. /***/ },
  20212. /* 197 */
  20213. /***/ function(module, exports, __webpack_require__) {
  20214. exports = module.exports = __webpack_require__(180)();
  20215. // imports
  20216. exports.i(__webpack_require__(198), "");
  20217. // module
  20218. exports.push([module.id, "#panel {\n width: 240px;\n height: 100%;\n background: #373d47;\n color: #979da7;\n}\n", ""]);
  20219. // exports
  20220. /***/ },
  20221. /* 198 */
  20222. /***/ function(module, exports, __webpack_require__) {
  20223. exports = module.exports = __webpack_require__(180)();
  20224. // imports
  20225. // module
  20226. exports.push([module.id, "\n@font-face {font-family: \"iconfont\";\n src: url(" + __webpack_require__(199) + "); /* IE9*/\n src: url(" + __webpack_require__(199) + "?#iefix) format('embedded-opentype'), \n url(" + __webpack_require__(200) + ") format('woff'), \n url(" + __webpack_require__(201) + ") format('truetype'), \n url(" + __webpack_require__(202) + "#iconfont) format('svg'); /* iOS 4.1- */\n}\n\n.iconfont {\n font-family:\"iconfont\" !important;\n font-size:16px;\n font-style:normal;\n -webkit-font-smoothing: antialiased;\n -webkit-text-stroke-width: 0.2px;\n -moz-osx-font-smoothing: grayscale;\n}\n.icon-switchoff:before { content: \"\\E60D\"; }\n.icon-icon:before { content: \"\\E600\"; }\n.icon-warnfill:before { content: \"\\E607\"; }\n.icon-warn:before { content: \"\\E608\"; }\n.icon-refresh:before { content: \"\\E616\"; }\n.icon-ok:before { content: \"\\E604\"; }\n.icon-h:before { content: \"\\E617\"; }\n.icon-lock:before { content: \"\\E61D\"; }\n.icon-off:before { content: \"\\E613\"; }\n.icon-on:before { content: \"\\E614\"; }\n.icon-search:before { content: \"\\E61C\"; }\n.icon-edit:before { content: \"\\E609\"; }\n.icon-info:before { content: \"\\E601\"; }\n.icon-add-s:before { content: \"\\E612\"; }\n.icon-more:before { content: \"\\E602\"; }\n.icon-grid:before { content: \"\\E603\"; }\n.icon-movedown:before { content: \"\\E60A\"; }\n.icon-moveup:before { content: \"\\E60B\"; }\n.icon-add:before { content: \"\\E60C\"; }\n.icon-folder:before { content: \"\\E618\"; }\n.icon-files:before { content: \"\\E619\"; }\n.icon-lock2:before { content: \"\\E61E\"; }\n.icon-timescircle:before { content: \"\\E60E\"; }\n.icon-earth:before { content: \"\\E61A\"; }\n.icon-move:before { content: \"\\E60F\"; }\n.icon-delete:before { content: \"\\E610\"; }\n.icon-doc:before { content: \"\\E606\"; }\n.icon-line:before { content: \"\\E611\"; }\n.icon-file-box:before { content: \"\\E61B\"; }\n.icon-switchon:before { content: \"\\E615\"; }\n.icon-sysserver:before { content: \"\\E605\"; }\n", ""]);
  20227. // exports
  20228. /***/ },
  20229. /* 199 */
  20230. /***/ function(module, exports) {
  20231. module.exports = "data:application/vnd.ms-fontobject;base64,QDoAACQ5AAABAAIAAAAAAAIABgMAAAAAAAABAPQBAAAAAExQAQAAAAAAABAAAAAAAAAAAAEAAAAAAAAA3PicnwAAAAAAAAAAAAAAAAAAAAAAABAAaQBjAG8AbgBmAG8AbgB0AAAADABNAGUAZABpAHUAbQAAAIwAVgBlAHIAcwBpAG8AbgAgADEALgAwACAAOwAgAHQAdABmAGEAdQB0AG8AaABpAG4AdAAgACgAdgAwAC4AOQA0ACkAIAAtAGwAIAA4ACAALQByACAANQAwACAALQBHACAAMgAwADAAIAAtAHgAIAAxADQAIAAtAHcAIAAiAEcAIgAgAC0AZgAgAC0AcwAAABAAaQBjAG8AbgBmAG8AbgB0AAAAAAAAAQAAAA8AgAADAHBGRlRNcbzc/AAAAPwAAAAcT1MvMlfDXNEAAAEYAAAAYGNtYXDLuiGvAAABeAAAAUpjdnQgDWX+TAAALtAAAAAkZnBnbTD3npUAAC70AAAJlmdhc3AAAAAQAAAuyAAAAAhnbHlmWHugzQAAAsQAACdOaGVhZAmefdUAACoUAAAANmhoZWEI3gQ6AAAqTAAAACRobXR4K1EGHQAAKnAAAABebG9jYZuWpZUAACrQAAAASG1heHABfQrLAAArGAAAACBuYW1lCX/XEQAAKzgAAAIucG9zdFjLVfkAAC1oAAABYHByZXClub5mAAA4jAAAAJUAAAABAAAAAMw9os8AAAAA0r+dFgAAAADSv50WAAQEBwH0AAUAAAKZAswAAACPApkCzAAAAesAMwEJAAACAAYDAAAAAAAAAAAAARAAAAAAAAAAAAAAAFBmRWQAwAB45h4DgP+AAFwDgADUAAAAAQAAAAADGAAAAAAAIAABAAAAAwAAAAMAAAAcAAEAAAAAAEQAAwABAAAAHAAEACgAAAAGAAQAAQACAHjmHv//AAAAeOYA////ixoEAAEAAAAAAAAAAAEGAAABAAAAAAAAAAECAAAAAgAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAiAAABMgKqAAMABwApQCYAAAADAgADVwACAQECSwACAgFPBAEBAgFDAAAHBgUEAAMAAxEFDyszESERJzMRIyIBEO7MzAKq/VYiAmYAAAAFACz/4QO8AxgAFgAwADoAUgBeAXdLsBNQWEBKAgEADQ4NAA5mAAMOAQ4DXgABCAgBXBABCQgKBgleEQEMBgQGDF4ACwQLaQ8BCAAGDAgGWAAKBwUCBAsKBFkSAQ4ODVEADQ0KDkIbS7AXUFhASwIBAA0ODQAOZgADDgEOA14AAQgIAVwQAQkICggJCmYRAQwGBAYMXgALBAtpDwEIAAYMCAZYAAoHBQIECwoEWRIBDg4NUQANDQoOQhtLsBhQWEBMAgEADQ4NAA5mAAMOAQ4DXgABCAgBXBABCQgKCAkKZhEBDAYEBgwEZgALBAtpDwEIAAYMCAZYAAoHBQIECwoEWRIBDg4NUQANDQoOQhtATgIBAA0ODQAOZgADDgEOAwFmAAEIDgEIZBABCQgKCAkKZhEBDAYEBgwEZgALBAtpDwEIAAYMCAZYAAoHBQIECwoEWRIBDg4NUQANDQoOQllZWUAoU1M7OzIxFxdTXlNeW1g7UjtSS0M3NTE6MjoXMBcwURExGBEoFUATFisBBisBIg4CHQEhNTQmNTQuAisBFSEFFRQWFA4CIwYmKwEnIQcrASInIi4CPQEXIgYUFjMyNjQmFwYHDgMeATsGMjYnLgEnJicBNTQ+AjsBMhYdAQEZGxpTEiUcEgOQAQoYJx6F/koCogEVHyMODh8OIC3+SSwdIhQZGSATCHcMEhIMDRISjAgGBQsEAgQPDiVDUVBAJBcWCQUJBQUG/qQFDxoVvB8pAh8BDBknGkwpEBwEDSAbEmGINBc6OiUXCQEBgIABExsgDqc/ERoRERoRfBoWEyQOEA0IGBoNIxETFAF35AsYEwwdJuMAAAEAOv+4A5UC6QAJAAazBAABJisBEwUHEyUFEyclAeiEASnXM/73/vYz1wEpAun+8yvR/tiMjAEo0SsAAAMAbP/sA5QDFAALAB0ALwBMS7AuUFhAHQADAAQFAwRZAAICAVEAAQEKQQAFBQBRAAAACwBCG0AaAAMABAUDBFkABQAABQBVAAICAVEAAQEKAkJZtzY2NzcVEAYUKwQiLgE0PgEyHgEUBgM0JisBIgYdARQeAjsBMjY1FTQuASsBIgYdARQeATsBMjY1Am7cumxsuty6bGzxCwdKBwsDBQYESgcLBQgFSgcLBQgFSgcLFGy63LpsbLrcugIFBwsLB0oEBgUDCgiBBQkFCwjvBQgFCwcAAwBKASsDtQH1AAsAHgAmACtAKAQGAgMAAQEATQQGAgMAAAFRBQMCAQABRQ0MJCMgHxQSDB4NHhUQBxArEiIGFRQeATI+ATU0NyIGFRQeATMyNjU0LgYgIgYUFjI2NNhTOxsuNy8b6yo7Gy8bKjsECAsNEBIUAXBUOztUOwH1OyobLxsbLxsqOzsqGy8bOyoKFBIRDQsIBDtUOztUAAAAAAkAQP+/A78DPgARACIAOQBLAF0AbwCDAJQAqACHQIQUBBMCEgUABQMCAQYAAVkXChYIFQUGCwkCBwwGB1kaEBkOGAUMDQ0MTRoQGQ4YBQwMDVERDwINDA1Fl5WGhHJwYF5OTDw6JSMUEgIAop+VqJeoj4yElIaUendwg3KDaWZeb2BvV1RMXU5dREE6SzxLLSojOSU5HBkSIhQiCgcAEQIRGw4rASMiBh0BFBY7ATI2PQE0LgIhIyIGHQEUFjsBMj4BPQE0JiEjIgYdARQWOwEyPgI9ATQuBQEjIgYdARQWOwEyNj0BNC4CISMiBh0BFB4BOwEyPgE9ATQmISMiDgEdARQWOwEyNj0BNC4BASMiBh0BFBY7ATI+Aj0BNC4CISMiDgEdARQWOwEyNj0BNCYhIyIOAh0BFB4BOwEyNj0BNC4BAlmzDBISDLMMEgUICwFCswwSEgyzCA4IEv1kswwSEgyzBgsIBQIDBAUGBwFFswwSEgyzDBIFCAsBQrMMEggOCLMIDggS/WSzCA4IEgyzDBIIDgFAswwSEgyzBgsIBQUICwFCswgOCBIMswwSEv1kswYLCAUIDgizDBIIDgM+EgyzDBISDLMGCwgFEgyzDBIIDgizDBISDLMMEgUICwazAwcGBQQDAv64EgyzDRERDbMGCwgFEgyzCA4ICA4IswwSCA4Isw0REQ2zCA4I/rgSDLMNEQUICwazBgsIBQgOCLMNERENswwSBQgLBrMIDggRDbMIDggAAAAAAgBn/5MDmQLFABAAOwBFQEIjAQUDNRECAgUCQAYBAAMAaAADBQNoAAUCBWgAAgQCaAAEAQEETQAEBAFSAAEEAUYBADo5LCoeHRgWCwoAEAEQBw4rASIOBBUUHgEyPgE0LgEDFB8BHgEzMj8BPgE3MhYfARYXFAYHAwcOASMiLgEvAS4DNSY/AT4BFwIAOGpaSzUdbb3evW1tvfcFCQQMBBBdigQGBQUNAy0HAQQD+jUDCgUDBwYClwIDAgEBCCMHFggCxR01S1pqOG+9bW293r1t/jgBBQkEB2ieBQMBBAMsCAoGCQT++DkDBQIDAo4CBAQFAwsIJQgBCAAAAwBFABcDuwLpAAcAJwArADpANwACAAYFAgZXBwEAAwEATQAFBAEDAQUDWQcBAAABTwABAAFDAQArKikoJiIdGBEMBQQABwEHCA4rJSIOAQchLgElAhM0JiMGICciBhUWAxQeATc2Fjc2Nz4BFxY3NhcWNichESECAyRGOgcBUgVoAX4DAxkiLf1aMxwZAQEJFxMjkCMZFzh3OT9XXiYhGj/9CAL4kRg6KDVFDAEJAQciGgEBFhzn/scSFwwBAQEBARAoCiElAgICAhpaAcgAAAYA6f/PBQACXQAAAFMAXABsAHgAhAC1QBVLEwIJBAABCAkbAQYDWFdMAwUGBEBLsBxQWEA1AAEABAkBBFkACQAICwkIWQALAAoNCwpZAA0DBg1NAAMMAQYFAwZZBw4CBQUAUQIBAAALAEIbQDwAAQAECQEEWQAJAAgLCQhZAAsACg0LClkADQMGDU0AAwwBBgUDBlkHDgIFAAAFTQcOAgUFAFECAQAFAEVZQB8BAYSBfnt4dXJvamdiX1pZVVQBUwFPRkQ9PKoaSA8RKwkBHgMGBzArAiIuAycwETc2NyEXFhcRDgQHKwgiLgM9ATQ3NTQ+BTczETQuAychIg4DBwMXFhc7AzcjBgcVFzI3NgMUBisBIi4BNTQ2OwEyHgIUBisBIiY0NjsBMgYUBisBIiY0NjsBMgUA/OwCAwgDBgkxRCIEDSQcGQMHGUsBVRtKBgEDFB05JQEDBQYGBgYDAQECBQQEAQEEBg0PGQ9RAgkOHBL+tAMJGBIRAgEHEzAoKCIY/EYiBAgFHSU4DwrdBwwGDwrdBwwGAQ8L3AsPDwvcC3EPC1sLEBALWwsBpv5TAQIJCg0HAxAZMyEBjSNSDAggYP6vBA8sKjYWAQQFCQUgExISAQYQDhQPDAMBRgMLHRYVAgIKESYZ/n4gNQdxCic/AR0lAXMKDwcLBwsPBwyQFg8PFg+kFhAQFhAAAwBL/+ADtQMfAAwAGAAjAC9ALAADAAUEAwVZAAICAFEAAAAKQQYBBAQBUQABAQsBQhoZIB8ZIxojFRQ1EgcSKyUBJiIHAQYXFjMhMjYBNDYyFhURFAYiJjUXIi4BNTQ2MhYUBgOv/qsjbyP+rCIcHUcCokc5/g8TGhMTGhMgDRYNHCgcHH8CYT8//Z8+MTBhAf8NExMN/uANExMN4A0WDRQcHCgcAAAABQBL/98DtQMfAA8AHQApACoANQBKQEcqAQcGAUAABQAEBgUEWQAGAAcDBgdZCQECAgFRAAEBCkEAAwMAUQgBAAALAEIREAIANTQvLSUkHx4ZFhAdER0IBgAPAg8KDisFISImNwE2MzIeAhcBFgYBIgYHAQYWMyEyNicBJgIiJjURNDYyFhURFAcGNDYzMh4BFRQGIgNR/V5HOSIBVCM4DRkXFQgBVSI5/mgJEgj+rBEUIwKiIxQR/qsQBRoTExoTIDAcFA0WDRwoIWI+AmE/CBAYD/2fP2EDABAO/Z4eIiIeAmIe/iETDQEgDRMTDf7gDYMUKBwNFg0UHAAAAwB0/6ADjAK4ABIAHAAfAB9AHB4cGwMAAQFAHx0CAD0AAQABaAAAAF8VFBIRAg4rJScuATY3AT4BFh8BHgEGBwEGIgE2Mh8BFhQPAScBNxcBgKkEAwMEAXwECgoEqQQCAgT+hAYRATASMRJwEhI4xf33OMYDqQMLCgQBfAQCAgSpBAoKBP6EBgKpEhJwEjESOMX9Mv7GAAALAED/bAOgAmwABgAKAA4AEgAWABoAHgAiACYAKgAuAU20BQEPAT9LsApQWEBRAAAEAwQAA2YLCQIHBgEGB14SEAIODw5pAAUYAQQABQRXAAMABgcDBlcKCBcCBAEAEwwBE1cADAAVFAwVVwAWEQEPDhYPVwAUFA1PAA0NCw1CG0uwGFBYQFIAAAQDBAADZgsJAgcGAQYHAWYSEAIODw5pAAUYAQQABQRXAAMABgcDBlcKCBcCBAEAEwwBE1cADAAVFAwVVwAWEQEPDhYPVwAUFA1PAA0NCw1CG0BXAAAEAwQAA2YLCQIHBgEGBwFmEhACDg8OaQAFGAEEAAUEVwADAAYHAwZXCggXAgQBABMMARNXAAwAFRQMFVcAFAANFhQNVwAWDw8WSwAWFg9PEQEPFg9DWVlANgcHAAAuLSwrKikoJyYlJCMiISAfHh0cGxoZGBcWFRQTEhEQDw4NDAsHCgcKCQgABgAGEREZECslESMRIxc3ARUjNSUhESEFMxUjNzMVIzczFSMFMxUjNzMVIzczFSMnMxUjJTMVIwMAQKDAwP2gwAEA/sABQP7AYGCAYGCAQED/AEBAYGBggGBg4EBAAQBAQGwBgP6AwMABwMDAQP7AgEBAQEBggGBAQEBA4GBAYAAAAAsAQP9sA6ACbAAGAAoADgASABYAGgAeACIAJgAqAC4BA7QFAREBP0uwClBYQFwHBQIDBANoFwICAQsKCwEKZg4MAgoVFQpcAAAUExQAE2YGAQQADwgED1cACAAREAgRVwAQAAkSEAlXABINAQsBEgtXABUYARQAFRRYABMWFhNLABMTFlAAFhMWRBtAXQcFAgMEA2gXAgIBCwoLAQpmDgwCChULChVkAAAUExQAE2YGAQQADwgED1cACAAREAgRVwAQAAkSEAlXABINAQsBEgtXABUYARQAFRRYABMWFhNLABMTFlAAFhMWRFlANicnAAAuLSwrJyonKikoJiUkIyIhIB8eHRwbGhkYFxYVFBMSERAPDg0MCwoJCAcABgAGEREZECsBETMRMycHATMVIzczFSM3MxUjBTMVIzczFSM3MxUjJzMVIyUzFSMRFSM1JSERIQLAQKDAwP4gYGCAYGCAQED/AEBAYGBggGBg4EBAAQBAQMABAP7AAUABLP6AAYDAwAFAQEBAQGCAYEBAQEDgYEBg/uDAwED+wAACAFf/1wOpAykACwAXAJRLsB1QWEAmBAECAwUDAgVmBwEFBgMFBmQAAwMBUQABAQpBAAYGAFIAAAALAEIbS7AyUFhAJAQBAgMFAwIFZgcBBQYDBQZkAAEAAwIBA1cABgYAUgAAAAsAQhtAKQQBAgMFAwIFZgcBBQYDBQZkAAEAAwIBA1cABgAABksABgYAUgAABgBGWVlAChERERERFRUQCBYrBCIuATQ+ATIeARQGAyM1IxUjFTMVMzUzAnPmxHJyxObEcnJjqlSqqlSqKXLE5sRycsTmxAFhqqpUqqoAAAcAAP8sBAADLAAPABcAHwAvADcAPwBPAM5LsBpQWEAxCAYCAgABAgFVCwcCBQUAUQ4BAAAKQQoBBAQDUQ0JAgMDC0EPAQwMA1ENCQIDAwsDQhtLsC5QWEAvDgEACwcCBQQABVkIBgICAAECAVUKAQQEA1ENCQIDAwtBDwEMDANRDQkCAwMLA0IbQDEOAQALBwIFBAAFWQoBBAwDBE0PAQwNCQIDAgwDWQgGAgIBAQJNCAYCAgIBUQABAgFFWVlAJkJAAgBKR0BPQk89PDk4NTQxMC0qJSIdHBkYFRQREAoHAA8CDxAOKwEhIgYVERQWMyEyNjURNCYAIiY0NjIWFAIiJjQ2MhYUARQGIyEiJjURNDYzITIWFRIiJjQ2MhYUAiImNDYyFhQBIyIGHQEUFjsBMjY9ATQmA0D9gFBwcFACgE9xcf0eGhMTGhMTGhMTGhMCACUb/wAbJSYaAQAbJa0aExMaExMaExMaE/7AgBomJRuAGyUlAyxwUP2AT3FxTwKAUHD8gBMaExMaAq0TGhMTGv1tGyUlGwKAGiYlG/1AExoTExoCrRMaExMa/q0mGsAbJSUbwBslAAAAAAIAAP91A24C4wArADcAL0AsJBkOAwQCAAFAAAUBAQACBQBZAwECBAQCTQMBAgIEUQAEAgRFFRckLiQqBhQrJTQvATc2NTQvASYjIg8BJyYjIg8BBhUUHwEHBhUUHwEWMzI/ARcWMzI/ATYSFA4BIi4BND4BMhYCkQtoaAsLNAsPDwtnaAoPEAszCwtnZwsLMwsQDwpoZwsPDws0C912yu/JdnbJ78qrDwtnZwsPEAo0CwtoaAsLNAoQDwtnZwsPEAo0CwtoaAsLNAoBCO7KdnbK7sp2dgAAAAEAA/8sA/0DLABtAJBADCILAgECUz8CCAcCQEuwGlBYQC8DAQECAAIBAGYLAQUGBwYFB2YJAQcIBgcIZAQBAAoBBgUABlcACAgCUQACAgoIQhtANAMBAQIAAgEAZgsBBQYHBgUHZgkBBwgGBwhkAAIBCAJNBAEACgEGBQAGVwACAghRAAgCCEVZQBFeXFVUUVAXFBgvExcoExkMFysBJy4BBgcGFB8BIREXFjI3PgEmLwEuASMiDwEOARYXFjI/AREhNzY0Jy4BBg8BBhQfAR4BMzI+ATc+ASYvASERJy4BIgYHBhQfARYyPwE2NCYiDwERIQcOARQWFxYzMj4EPwE+AjU0LgID8JwJGBgJDg5M/tFMDicNCQcHCZsHEQkUDZwJBwcJDScOTP7QTA4OCRgYCZwNDZwHEQkGDAsECQcHCUwBMEwHERISBg4Omw4nDpsOGycOTAEvTAcHBwcNFAMGBQYFBgKcBAYDAgMFAUqbCQcHCQ0nDkwBNUsODQkZGAmbBwcOmwkYGQkNDUz+y0wOJw0JBwcJmw4nDZwHBwMGBQkYGAlM/tFMBwcHBg4nDpsODpsOJxsOSwEuTAcREhEHDgEBAwMEApwECwsHBAkJBwAAAAQAQf9tA78C7AAlADYAQgBMAFRAUQABAAoAAQpZBQEDBwADTQsCDAMACQEHBgAHWQgNAgYEBAZNCA0CBgYEUQAEBgRFJyYBAExLSEU+PTg3MS8mNic2IiAaFxQSDQwHBAAlASUODisBIzU0JiMhIg4CHQEjBgcGFBY7AREUFjMhMj4CNRE1MzI2NCYBIi4BNQM0PgIzMhYVERQGMiImNRE0NjIWFRMUATQ2MyEyFh0BIQOcmikd/ogPGhILmw4KChQOTykdAhAOGhMLTg8UFP3xCRAJAQYJDQcPFBTHHRQUHRQB/rwaEgEiEhr+hgI9aR0pDBIaDmkBCQodFP27HSkLEhoPAi4XFB0U/bkJEAoBdAcNCgUUD/6MDxQUDwF0DxQUD/6MDwJxERoaET4AAAADAEAABgPAAlIAEgAqADoAK0AoAAEAAAMBAFkAAwACBQMCWQAFBAQFTQAFBQRRAAQFBEU1Ojg0OTIGFCsBFAYjISIuAzQ+AzMhMhYRFAYjISIuBDU0NjMhMh4GERQGIyEiLgE1NDYzITIXFgPAGBL81AcNCggEBAgKDQcDLBIYGBL81AYLCQgFAxgSAywECQcHBgQDAhgS/NQMEwsYEgMsHQoDAigRGQQICg0ODQoIBBj+8hEZAwUICQsGERkCAwQGBwcJ/wASGAsTDBEZGgkAAQEyAK4C1QJRACMAMEAtAAQDAQRNBQEDAgYCAAEDAFkABAQBUQABBAFFAQAgHhkXFBINCwgGACMBIwcOKwEjFRQOAiMiJj0BIyImNTQ+ATsBNTQ2MzIeAh0BMzIWFAYCu50EBwoFCxCdCw8HDAedEAsFCgcEnQsPDwFmngUKBwQQCp4PCwcMB50LDwQHCgWdDxYPAAMAEABaA/ACpgAPACAALgA7QDgAAQACBQECWQAFBwEEAwUEWQADAAADTQADAwBRBgEAAwBFIiECACspIS4iLh4bFRIKBwAPAg8IDislISImPQE0NjMhMhYdARQGEzQmIyEiBh0BFB4BMyEyNjUFIi4BNTQ+AjMyFhQGAtn+TnSjo3QBsnSjo2V/Wv5OWn86ZDsBslp//ZAsTCwaLD0hRGBgWqNzIHOjo3Mgc6MBNlp+flogO2Q6f1qRLUstIT0sGmCIYQADABAAWgPwAqYADwAgADIAO0A4AAEAAgUBAlkABQcBBAMFBFkAAwAAA00AAwMAUQYBAAMARSIhAgAoJyEyIjIeGxUSCgcADwIPCA4rJSEiJj0BNDYzITIWHQEUBhM0JiMhIgYdARQeATMhMjY1ByIuATU0NjIWFRQOBgLZ/k50o6N0AbJ0o6Nmf1r+TFl/OmQ6AbRaf/UsTCxgiGEHDBIXGh0hWqNzIHOjo3Mgc6MBNVp/f1ofO2Q6f1qRLEwtRGBgRBEhHRoXEQ0HAAAHAAD/gAQAA4AADwAXAB8ALwA3AD8ATwBaQFcOAQALBwIFBAAFWQANAwQNTQ8MCgMECQEDAgQDWQgGAgIBAQJNCAYCAgIBUQABAgFFQkACAEpHQE9CTz08OTg1NDEwLSolIh0cGRgVFBEQCgcADwIPEA4rASEiBhURFBYzITI2NRE0JgAiJjQ2MhYUAiImNDYyFhQBFAYjISImNRE0NjMhMhYVEiImNDYyFhQCIiY0NjIWFAUjIgYdARQWOwEyNj0BNCYDQP2AUHBwUAKAT3Fx/R4aExMaExMaExMaEwIAJRv/ABslJhoBABslrRoTExoTExoTExoT/sCAGiYmGoAbJSUDgHBQ/YBPcXFPAoBQcPyAExoTExoCrRMaExMa/W0bJSUbAoAaJiUb/UATGhMTGgKtExoTExoTJhrAGiYlG8AbJQACADf/vQPGAzEAGAAyAFNAUCYBBQQyJxwZFwoHBggDARYBAgADQAABBQMFAQNmAAMABQMAZAAEAAUBBAVZBgEAAgIATQYBAAACUQACAAJFAQAqKCUjGxoVEwkIABgBGAcOKyUiLgE1NDcXNSMXDgMVFB4CMzI3JwYTFTMnPgE1NC4CIyIHFzYzMh4DFRQGBwH4YaVgPl32XBQfFgxGd6NaVU4yN572YCUnRnakWkZCNCkrO21YQiQbGRFgpWFuW131XBs9QkckWqN3Rh9HEgEE9mA2fkRapHZGFUkKJEJYbTsyYCkAAAAAAgCAACEDgAMiAAsAFwBmS7AyUFhAJAcBBQAGAAUGZgQBAgMBAwIBZgADAAEDAVUABgYAUgAAAAoGQhtAKgcBBQAGAAUGZgQBAgMBAwIBZgAAAAYDAAZXAAMCAQNLAAMDAVEAAQMBRVlAChERERERFRUQCBYrACIOARQeATI+ATQmAyM1IxUjETMVMzUzAmjQsWdnsdCxZ2eFMsQyMsQyAyJnsdGxZ2ex0bH+G6+vAYuzswAAAwBAAAADwQLgACUARABQAEhARS8uHh0EBgcBQAsCAQMADAoCCQMACVkEAQMIAQcGAwdZAAYFBQZNAAYGBVEABQYFRUdFTUpFUEdQQD4xJjU1QRkSEkINFysBNCYrAw4BIzAHIw4BBw4BBwYHBiMwKwEhIgYVExQWMyEyNjUnFAYjISIuATUDNDYzITA7ATI2Nz4BNzY3MzIWHQIlITI2NCYjISIGFBYDwTknugEBAwUCAQECBQEMDwgDAQQXBwj+YCg4IDgoAoAoOEATDf2ACQ4JIBMNAaAIByMvBwECAQgFqA0T/P8BoA0TEw3+YA0TEwKAKDgBAQECAgILKSQMAhE5Kf5iKDg4JgINEwkQCQGeDRMiHwIIBSIOEw0CASMTGhMTGhMAAAAEAF//wgOzA0kABQAJAA0AEwANQAoTEQwKCQcFAwQmKy0BBwkBJzcJAhENASUBJQcJAScCCf6IMgGqAaozM/5W/lYBqgEu/tL+0gEu/ogyAaoBqjPC9zT+3QEjNWwBI/7d/t0B8c7Pz/37+DT+3QEjNQAAAAUAAP8sBAADLAAhADAAeQCKAO4Bq0AcogEFCi8BBgXo53IiBAMG2pyQjoV+ejEIAg0EQEuwC1BYQEAADAAFBgwFWQsBCgcBBgMKBlkAAwAPDQMPWQAEDgENAgQNWREBCAABCAFVAAkJAFEAAAAKQQACAhBRABAQCxBCG0uwDFBYQDoADAAFBgwFWQsBCgcBBgMKBlkEAQMPDgINAgMNWREBCAABCAFVAAkJAFEAAAAKQQACAhBRABAQCxBCG0uwGlBYQEAADAAFBgwFWQsBCgcBBgMKBlkAAwAPDQMPWQAEDgENAgQNWREBCAABCAFVAAkJAFEAAAAKQQACAhBRABAQCxBCG0uwJlBYQD4AAAAJDAAJWQAMAAUGDAVZCwEKBwEGAwoGWQADAA8NAw9ZAAQOAQ0CBA1ZEQEIAAEIAVUAAgIQUQAQEAsQQhtARQAAAAkMAAlZAAwABQYMBVkLAQoHAQYDCgZZAAMADw0DD1kABA4BDQIEDVkAAgAQCAIQWREBCAEBCE0RAQgIAVEAAQgBRVlZWVlAJ4yLzszBv769u7ixr6upqKWhn4vujO5mZGNgXVtRT01LQkEXFSMSDysBLgIjIgYHDgMVFBYXHgUzMj4BNz4BNTQuAhcuAicuAicuAycWAx4BBgcOBgcOAyMmJyYnJicmJyYjIgcGIyIuAycmPgE3NjMyFx4BOwEyNzMyFhceARceAxcWFwYHBgcOARYFFhcWFwYHBhcWBgcuAj0BASImJzYnNDc+AyYnJicmJz4CMzIXLgIrAgYjIi4BJyYjIgcOAQcGFxY7ATI+ATM2MzIWFxYXFhcWFxYXFjMyNjc+Ajc2Nz4BJicmNjc+BDc2NzYnNRYVFA4CA2owdIJEZ7pJJDgmFE1JGDY5PkBDIkSCdDBJTRQmOCAFFhQVEBkMCQYIDhELglgCARIUAgUEBAIEAwIICxYiGAcFBAYIDRk7Gh0OGREHBQUKBwoFCwInIjciGyoXJxMKBQcQCQ4IDRELCAsWIBUWCQkbFQkPDQL9FggKIg4DCRwGAgMFCAwGAc2B2jsoDQ4GBggDAQQMRA0SDoDIdHdoBgwLBAoTDQYJDhcLNSgxRB8tDBccHjsHBAkFBRYLChMJIhEMCAYHBgsQGSI2FAoRCAYLBRsZAwEDAwgEBgYGBQMgCRYEG0l8qwKWMEMjTUkkVFxjM2e6SRgpIhkRCSNDMEm6ZzNjXFSgCA8HCAUeGxwSEx4VCVP+whMhLBcCBwYIBgoGBRYXHQ0IHRhCbzFcFAkDAgEEBw8LHkNHFiUXDAgBAwYJIh8YGycZBwgDCRkSCQ0iHgIBAggHBgwpGA4bDxgyNBsC/jGFbkw4BRMICREMEQcaDwMDcbprOgMDAgECBwYcLRQ9JEk/RQEBAwMDC0Isa1AeGg8YFhYLHhMRHAYePywWFRUIAwUGBQUCHQoYFAFLUV6qfEkAAAAHAIT//gN7AwIABwALAA8AEwAXACcAKwDItgYBAgkIAUBLsBtQWEBGDgEBAAFoAAkICgoJXgAAAAIDAAJXAAMABAUDBFcABQAGBwUGVwAHAAgJBwhXDwEKAA0MCg1YAAwLCwxLAAwMC1EACwwLRRtARw4BAQABaAAJCAoICQpmAAAAAgMAAlcAAwAEBQMEVwAFAAYHBQZXAAcACAkHCFcPAQoADQwKDVgADAsLDEsADAwLUQALDAtFWUAlGhgAACsqKSgjIBgnGicXFhUUExIREA8ODQwLCgkIAAcABxMQDysBEwcDIQMnExchFSEVIRUhFSEVIRUhFSEFISIOAR8BHgEzITI2PwE2BSM1MwMkMjkt/iAtOTJjAYL+fgGC/n4Bgv5+AYL+fgIr/SwHCQMCUgMSCgIUChIDUgf+38LCAwL+UQcBgv5+BwGvYDAxMDAxMDAxBgoG9AoNDQr0FmAwAAAAAAIAAP9fA/8DBAAmADoAYbUbAQECAUBLsBpQWEAgAAIEAQQCAWYAAwEDaQAEAAEDBAFZAAUFAFEAAAAKBUIbQCUAAgQBBAIBZgADAQNpAAAABQQABVkABAIBBE0ABAQBUQABBAFFWbcoKRUROSoGFCstAS4BJzY1NCYnJiMiBgcOARUUFhcWOwEyNzIfAQUeATI+AT8BNiYlDgEjJicuATU0Nz4BMzIXHgEVFAPj/vABAgMlRUFpilKYNystRUJpiAF5ZAEBAQEQChobGhgJBhgE/kwobTtiTC8yQCdtO2NLLzID4wEBAk9RUpg3WUZBNH1CUpk3WEgCAeMJCgcPDAccSe4vMgE/J247Y0swMT8obTtjAAMAVf8sA6sDLAAaACgAQwBsQAkZGBAMBAEAAUBLsBpQWEAdBgQIAwMAAAEDAFkAAQAFAQVWAAICB1EABwcKAkIbQCMABwACAwcCWQYECAMDAAABAwBZAAEFBQFNAAEBBVIABQEFRllAExsbQD47OTQxLCobKBsoLD4jCRErJTQ+ATMyFhUUDgIHHgIXFA4BKwEiJjU3JgM1ND4EMzIeAR0BJRUjIgYVERQWMyEyNjURNCYrATU0JiMiDgIBqxYoFyMyBQsOCQEECQQJDglADRMSJ1YNFh8mLBcuTy7+QEAkMjIkAqokMjIkQKJzOGdKLJcXJxcyIwsWEg8GBhQ5GwgPCRMNbhkBGZYXLCYfFgwtTy6WlpYyI/5VIzIyIwGrIzKWc6IsSmcABADA/8ADQANAABsAJwA/AFEATEBJSUACCQgBQAAAAAQBAARZBQoDAwEABwgBB1kACAAJBggJWQAGAgIGTQAGBgJSAAIGAkYAAE5NRUM6Ny4rJyYgHgAbABs2JSMLESsBNS4BIyIOAgcVIyIOARURFBYzITI+ATURNCYlPgEzMh4DFxUhARQOASMhIi4ENRE0NjMhMh4DFQc1NCYjIg4BHQEGFRQWMjY1NAMBA5VoM11FKQIBER4RJRsCABEeESX+JgJwTh86LiQUAf6AAb8JDgn+QAQJBwYEAhMNAcAFCggGA+ATDQkOCRwjMiMBwIdokSdCXDOIER4R/oAbJREeEQGAGiaFTm0TIi45H4X+YAkOCQIEBgcJBAFADRMDBggKBZI0DRMJDgk0EiEZIyMZIQAAAAABAAAAAQAAn5z43F8PPPUACwQAAAAAANK/nRYAAAAA0r+dFgAA/ywFAAOAAAAACAACAAAAAAAAAAEAAAOA/ywAXAUBAAAAAAUAAAEAAAAAAAAAAAAAAAAAAAAMAXYAIgAAAAABVQAAA+kALAQAADoEAABsBAAASgQAAEAEAABnBAAARQUBAOkEAABLAEsAdABAAEAAVwAAAAAAAwBBAEABMgAQABAAAAA3AIAAQABfAAAAhAAAAFUAwAAAAAAAKAAoACgBZAGCAewCPANaA9gEQAVGBZoGGAZkB1gIJgiWCXQJ4ArKC2ILygwUDHYM3A1+DfIOTA7gDxoRPhHwEnoTDhOnAAEAAAAjAO8ACwAAAAAAAgA2AEQAbAAAAKwJlgAAAAAAAAAMAJYAAQAAAAAAAQAIAAAAAQAAAAAAAgAGAAgAAQAAAAAAAwAkAA4AAQAAAAAABAAIADIAAQAAAAAABQBGADoAAQAAAAAABgAIAIAAAwABBAkAAQAQAIgAAwABBAkAAgAMAJgAAwABBAkAAwBIAKQAAwABBAkABAAQAOwAAwABBAkABQCMAPwAAwABBAkABgAQAYhpY29uZm9udE1lZGl1bUZvbnRGb3JnZSAyLjAgOiBpY29uZm9udCA6IDE2LTEtMjAxNmljb25mb250VmVyc2lvbiAxLjAgOyB0dGZhdXRvaGludCAodjAuOTQpIC1sIDggLXIgNTAgLUcgMjAwIC14IDE0IC13ICJHIiAtZiAtc2ljb25mb250AGkAYwBvAG4AZgBvAG4AdABNAGUAZABpAHUAbQBGAG8AbgB0AEYAbwByAGcAZQAgADIALgAwACAAOgAgAGkAYwBvAG4AZgBvAG4AdAAgADoAIAAxADYALQAxAC0AMgAwADEANgBpAGMAbwBuAGYAbwBuAHQAVgBlAHIAcwBpAG8AbgAgADEALgAwACAAOwAgAHQAdABmAGEAdQB0AG8AaABpAG4AdAAgACgAdgAwAC4AOQA0ACkAIAAtAGwAIAA4ACAALQByACAANQAwACAALQBHACAAMgAwADAAIAAtAHgAIAAxADQAIAAtAHcAIAAiAEcAIgAgAC0AZgAgAC0AcwBpAGMAbwBuAGYAbwBuAHQAAAACAAAAAAAA/4MAMgAAAAAAAAAAAAAAAAAAAAAAAAAAACMAAAABAAIAWwECAQMBBAEFAQYBBwEIAQkBCgELAQwBDQEOAQ8BEAERARIBEwEUARUBFgEXARgBGQEaARsBHAEdAR4BHwEgB3VuaUU2MDAHdW5pRTYwMQd1bmlFNjAyB3VuaUU2MDMHdW5pRTYwNAd1bmlFNjA1B3VuaUU2MDYHdW5pRTYwNwd1bmlFNjA4B3VuaUU2MDkHdW5pRTYwQQd1bmlFNjBCB3VuaUU2MEMHdW5pRTYwRAd1bmlFNjBFB3VuaUU2MEYHdW5pRTYxMAd1bmlFNjExB3VuaUU2MTIHdW5pRTYxMwd1bmlFNjE0B3VuaUU2MTUHdW5pRTYxNgd1bmlFNjE3B3VuaUU2MTgHdW5pRTYxOQd1bmlFNjFBB3VuaUU2MUIHdW5pRTYxQwd1bmlFNjFEB3VuaUU2MUUAAQAB//8ADwAAAAAAAAAAAAAAAAAAAAAAMgAyAxj/4QOA/ywDGP/hA4D/LLAALLAgYGYtsAEsIGQgsMBQsAQmWrAERVtYISMhG4pYILBQUFghsEBZGyCwOFBYIbA4WVkgsApFYWSwKFBYIbAKRSCwMFBYIbAwWRsgsMBQWCBmIIqKYSCwClBYYBsgsCBQWCGwCmAbILA2UFghsDZgG2BZWVkbsAArWVkjsABQWGVZWS2wAiwgRSCwBCVhZCCwBUNQWLAFI0KwBiNCGyEhWbABYC2wAywjISMhIGSxBWJCILAGI0KyCgACKiEgsAZDIIogirAAK7EwBSWKUVhgUBthUllYI1khILBAU1iwACsbIbBAWSOwAFBYZVktsAQssAgjQrAHI0KwACNCsABDsAdDUViwCEMrsgABAENgQrAWZRxZLbAFLLAAQyBFILACRWOwAUViYEQtsAYssABDIEUgsAArI7EEBCVgIEWKI2EgZCCwIFBYIbAAG7AwUFiwIBuwQFlZI7AAUFhlWbADJSNhREQtsAcssQUFRbABYUQtsAgssAFgICCwCkNKsABQWCCwCiNCWbALQ0qwAFJYILALI0JZLbAJLCC4BABiILgEAGOKI2GwDENgIIpgILAMI0IjLbAKLEtUWLEHAURZJLANZSN4LbALLEtRWEtTWLEHAURZGyFZJLATZSN4LbAMLLEADUNVWLENDUOwAWFCsAkrWbAAQ7ACJUKyAAEAQ2BCsQoCJUKxCwIlQrABFiMgsAMlUFiwAEOwBCVCioogiiNhsAgqISOwAWEgiiNhsAgqIRuwAEOwAiVCsAIlYbAIKiFZsApDR7ALQ0dgsIBiILACRWOwAUViYLEAABMjRLABQ7AAPrIBAQFDYEItsA0ssQAFRVRYALANI0IgYLABYbUODgEADABCQopgsQwEK7BrKxsiWS2wDiyxAA0rLbAPLLEBDSstsBAssQINKy2wESyxAw0rLbASLLEEDSstsBMssQUNKy2wFCyxBg0rLbAVLLEHDSstsBYssQgNKy2wFyyxCQ0rLbAYLLAHK7EABUVUWACwDSNCIGCwAWG1Dg4BAAwAQkKKYLEMBCuwaysbIlktsBkssQAYKy2wGiyxARgrLbAbLLECGCstsBwssQMYKy2wHSyxBBgrLbAeLLEFGCstsB8ssQYYKy2wICyxBxgrLbAhLLEIGCstsCIssQkYKy2wIywgYLAOYCBDI7ABYEOwAiWwAiVRWCMgPLABYCOwEmUcGyEhWS2wJCywIyuwIyotsCUsICBHICCwAkVjsAFFYmAjYTgjIIpVWCBHICCwAkVjsAFFYmAjYTgbIVktsCYssQAFRVRYALABFrAlKrABFTAbIlktsCcssAcrsQAFRVRYALABFrAlKrABFTAbIlktsCgsIDWwAWAtsCksALADRWOwAUVisAArsAJFY7ABRWKwACuwABa0AAAAAABEPiM4sSgBFSotsCosIDwgRyCwAkVjsAFFYmCwAENhOC2wKywuFzwtsCwsIDwgRyCwAkVjsAFFYmCwAENhsAFDYzgtsC0ssQIAFiUgLiBHsAAjQrACJUmKikcjRyNhIFhiGyFZsAEjQrIsAQEVFCotsC4ssAAWsAQlsAQlRyNHI2GwBkUrZYouIyAgPIo4LbAvLLAAFrAEJbAEJSAuRyNHI2EgsAQjQrAGRSsgsGBQWCCwQFFYswIgAyAbswImAxpZQkIjILAJQyCKI0cjRyNhI0ZgsARDsIBiYCCwACsgiophILACQ2BkI7ADQ2FkUFiwAkNhG7ADQ2BZsAMlsIBiYSMgILAEJiNGYTgbI7AJQ0awAiWwCUNHI0cjYWAgsARDsIBiYCMgsAArI7AEQ2CwACuwBSVhsAUlsIBisAQmYSCwBCVgZCOwAyVgZFBYIRsjIVkjICCwBCYjRmE4WS2wMCywABYgICCwBSYgLkcjRyNhIzw4LbAxLLAAFiCwCSNCICAgRiNHsAArI2E4LbAyLLAAFrADJbACJUcjRyNhsABUWC4gPCMhG7ACJbACJUcjRyNhILAFJbAEJUcjRyNhsAYlsAUlSbACJWGwAUVjIyBYYhshWWOwAUViYCMuIyAgPIo4IyFZLbAzLLAAFiCwCUMgLkcjRyNhIGCwIGBmsIBiIyAgPIo4LbA0LCMgLkawAiVGUlggPFkusSQBFCstsDUsIyAuRrACJUZQWCA8WS6xJAEUKy2wNiwjIC5GsAIlRlJYIDxZIyAuRrACJUZQWCA8WS6xJAEUKy2wNyywLisjIC5GsAIlRlJYIDxZLrEkARQrLbA4LLAvK4ogIDywBCNCijgjIC5GsAIlRlJYIDxZLrEkARQrsARDLrAkKy2wOSywABawBCWwBCYgLkcjRyNhsAZFKyMgPCAuIzixJAEUKy2wOiyxCQQlQrAAFrAEJbAEJSAuRyNHI2EgsAQjQrAGRSsgsGBQWCCwQFFYswIgAyAbswImAxpZQkIjIEewBEOwgGJgILAAKyCKimEgsAJDYGQjsANDYWRQWLACQ2EbsANDYFmwAyWwgGJhsAIlRmE4IyA8IzgbISAgRiNHsAArI2E4IVmxJAEUKy2wOyywLisusSQBFCstsDwssC8rISMgIDywBCNCIzixJAEUK7AEQy6wJCstsD0ssAAVIEewACNCsgABARUUEy6wKiotsD4ssAAVIEewACNCsgABARUUEy6wKiotsD8ssQABFBOwKyotsEAssC0qLbBBLLAAFkUjIC4gRoojYTixJAEUKy2wQiywCSNCsEErLbBDLLIAADorLbBELLIAATorLbBFLLIBADorLbBGLLIBATorLbBHLLIAADsrLbBILLIAATsrLbBJLLIBADsrLbBKLLIBATsrLbBLLLIAADcrLbBMLLIAATcrLbBNLLIBADcrLbBOLLIBATcrLbBPLLIAADkrLbBQLLIAATkrLbBRLLIBADkrLbBSLLIBATkrLbBTLLIAADwrLbBULLIAATwrLbBVLLIBADwrLbBWLLIBATwrLbBXLLIAADgrLbBYLLIAATgrLbBZLLIBADgrLbBaLLIBATgrLbBbLLAwKy6xJAEUKy2wXCywMCuwNCstsF0ssDArsDUrLbBeLLAAFrAwK7A2Ky2wXyywMSsusSQBFCstsGAssDErsDQrLbBhLLAxK7A1Ky2wYiywMSuwNistsGMssDIrLrEkARQrLbBkLLAyK7A0Ky2wZSywMiuwNSstsGYssDIrsDYrLbBnLLAzKy6xJAEUKy2waCywMyuwNCstsGkssDMrsDUrLbBqLLAzK7A2Ky2waywrsAhlsAMkUHiwARUwLQAAS7gAyFJYsQEBjlm5CAAIAGMgsAEjRCCwAyNwsA5FICBLuAAOUUuwBlNaWLA0G7AoWWBmIIpVWLACJWGwAUVjI2KwAiNEswoJBQQrswoLBQQrsw4PBQQrWbIEKAlFUkSzCg0GBCuxBgFEsSQBiFFYsECIWLEGA0SxJgGIUVi4BACIWLEGAURZWVlZuAH/hbAEjbEFAEQAAAA="
  20232. /***/ },
  20233. /* 200 */
  20234. /***/ function(module, exports) {
  20235. module.exports = "data:application/font-woff;base64,d09GRgABAAAAACPsABAAAAAAOWQAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAAABbAAAABoAAAAccbzc/EdERUYAAAGIAAAAHQAAACAAUAAET1MvMgAAAagAAABNAAAAYFfDXNFjbWFwAAAB+AAAAE4AAAFKy7ohr2N2dCAAAAJIAAAAGAAAACQNZf5MZnBnbQAAAmAAAAT8AAAJljD3npVnYXNwAAAHXAAAAAgAAAAIAAAAEGdseWYAAAdkAAAZCQAAJ1BYe6DNaGVhZAAAIHAAAAAvAAAANgmyfdVoaGVhAAAgoAAAAB4AAAAkCN4EOmhtdHgAACDAAAAAUQAAAF4rUQYdbG9jYQAAIRQAAABIAAAASJuWpZZtYXhwAAAhXAAAACAAAAAgAX0C4G5hbWUAACF8AAABQgAAAkA4guYYcG9zdAAAIsAAAACRAAABYFjLVflwcmVwAAAjVAAAAJUAAACVpbm+ZnicY2BgYGQAgjO2i86D6Ev754rBaABNmQcEAAB4nGNgZGBg4ANiCQYQYGJgBEIlIGYB8xgABcAAVQAAAHicY2BhYWf8wsDKwMA0k+kMAwNDP4RmfM1gzMgJFGVgY2aAAUYBBgQISHNNYTjAUPFMjrnhfwNDDHMDwxWQGpAcswRYiQIDIwCUCA09AAAAeJxjYGBgZoBgGQZGBhBwAfIYwXwWBg0gzQakGRmYGCqeyf3/D+RXPGP4//9/txQLVD0QMLIxwDmMTECCiQEVMDLQDDDTzmiSAAA8/wlRAAB4nGNgQANGDEbMEv8fMjf814HRAEIeB7d4nJ1VaXfTRhSVvGRP2pLEUETbMROnNBqZsAUDLgQpsgvp4kBoJegiJzFd+AN87Gf9mqfQntOP/LTeO14SWnpO2xxL776ZO2/TexNxjKjseSCuUUdKXveksv5UKvGzpK7rXp4o6fWSumynnpIWUStNlczF/SO5RHUuVrJJsEnG616inqs874PSSzKsKEsi2iLayrwsTVNPHD9NtTi9ZJCmgZSMgp1Ko48QqlEvkaoOZUqHXr2eipsFUjYa8aijonoQKu4czzmljTpgpHKVw1yxWW3ke0nW8/qP0kSn2Nt+nGDDY/QjV4FUjMzA9jQeh08k09FeIjORf+y4TpSFUhtcAK9qsMegSvGhuPFBthPI1HjN8XVRqTQyFee6z7LZLB2PlRDlwd/YoZQbur+Ds9OmqFZjcfvAMwY5KZQoekgWgA5Tmaf2CNo8tEBmjfqj4hzwdQgvshBlKs+ULOhQBzJndveTYtrdSddkcaBfBjJvdveS3cfDRa+O9WW7vmAKZzF6khSLixHchzLrp0y71AhHGRdzwMU8XuLWtELIyAKMSiPMUVv4ntmoa5wdY290Ho/VU2TSRfzdTH49OKlY4TjLekfcSJy7x67rwlUgiwinGu8njizqUGWw+vvSkussOGGYZ8VCxZcXvncR+S8xbj+Qd0zhUr5rihLle6YoU54xRYVyGYWlXDHFFOWqKaYpa6aYoTxrilnKc0am/X/p+334Pocz5+Gb0oNvygvwTfkBfFN+CN+UH8E3pYJvyjp8U16Eb0pt4G0pUxGqmLF0+O0lWrWhajkzuMA+D2TNiPZFbwTSMEp11Ukpdb+lVf4k+euix2Prk5K6NWlsiLu6abP4+HTGb25dMuqGnatPjCPloT109dg0oVP7zeHfzl3dKi65q4hqw6g2IpgEgDbotwLxTfNsOxDzll18/EMwAtTPqTVUU3Xt1JUaD/K8q7sYnuTA44hjoI3rrq7ASxNTVkPz4WcpMhX7g7yplWrnsHX5ZFs1hzakwtsi9pVknKbtveRVSZWV96q0Xj6fhiF6ehbXhLZs3cmkEqFRM87x8K4qRdmRlnLUP0Lnl6K+B5xxdkHrwzHuRN1BtTXsdPj5ZiNrCyaGprS9E6BkLF0VY1HlWZxjdA1rHW/cEp6upycW8Sk2mY/CSnV9lI9uI80rdllm0ahKdXSX9lnsqzb9MjtoWB1nP2mqNu7qYVuNKlI9Vb4GtAd2Vt34UA8rPuqgUVU12+jayGM0LmvGfwzIYlz560arJtPv4JZqp81izV1Bc9+YLPdOL2+9yX4r56aRpv9Woy0jl/0cjvltEeDfOSh2U9ZAvTVpiHEB2QsYLtVE5w7N3cYg4jr7H53T/W/NwiA5q22N2Tz14erpKJI7THmcZZtZ1vUozVG0k8Q+RWKrw4nBTY3hWG7KBgbk7j+s38M94K4siw+8bSSAuM/axKie6uDuHlcjNOwruQ8YmWPHuQ2wA+ASxObYtSsdALvSJecOwGfkEDwgh+AhOQS75NwE+Jwcgi/IIfiSHIKvyLkF0COHYI8cgkfkEDwmpw2wTw7BE3IIviaH4BtyWgAJOQQpOQRPySF4ZmRzUuZvqch1oO8sugH0ve0aKFtQfjByZcLOqFh23yKyDywi9dDI1Qn1iIqlDiwi9blFpP5o5NqE+hMVS/3ZIlJ/sYjUF8aXmYGU13oveUcHfwIrvqx+AAEAAf//AA94nL16C3Qb13nm/e+d92AGGMxgBg8CJAACIAk+QTz4sKgRJUqRSEqiHqbASAplayk6lfyu3UdqM4md+iTerrPrONu143jtpGtLzdquk23WideMT5Km2WxS97QnbU/Teo/3bJuzOU6y2zxOaw77X4CUZeXpNGdJ4M7Mvf/9Z/7//o/vvwNCSY4QqNCLhBGZ9PpFQgijhC0SCkBnCaVwSMAz2E2ILIkCkjFLDJdHraxVGrXyOYi89pWv0Isb1+boCs4VSf/m/2SfZXHikmEyQY6Q03Dn7DP24RP+AQrEMA1irhBmgslOE1AUOBkBVdEk9bQFIUmQQqeJLug3hEEhUkiRThBNFqmga0IzCqZpLBDD0Mzp1OwzHnKc/SkcFVVbeYss48hy7udjKaz8XDz9g1exgxXkZ4Jy9hdj2Gw2/Z6jRycnKyOed/T00dNvPzF5ZPLI7O5GbWSiMuENe8ML1kjc6on5tlsGqQw5k6YhW6sWa9VBWoZYVow5rmPSvFQsQykrI0UpN0h3gJeTHHe0Uq8WPUk2WQYmpUq9NAilYglq1Sk6CRU3DZBIJY9GCx1R9gBo8VLm3uAAfRxinXnT7DS7BoL9/emck0h02cqdoWg0ZESj9yuSqAtUCJuF3QuH/W7PVUVVFKXgY2I4GftsZy/thFCilJzrjXQIRlcqeua+qjcxUfBUgLU1sFNd5n/aaSUt/Lwr6drdZsRQ4kkjb9kO3Pm/9LgdShdfRRMmE5ufZh+i3yQqkZ4TCKB4tijbBdEuFeDv74Her48GPwi+P/p16KXfDP5f+eXgL+6/H3peLqO9k/Ob32IPMofoJE2GyNzsM4NoCmkcEEQmNLkTLBAAbRcRRbKAVq4TXNvk5XGR2/3xy2R0uvmH9XqjEYtITlnIDUJ1CioZcCRWxafKSWlwMlyf9VqsOgjbPdDqoTf+9fPnzz/Pm+/q8gFZZ6Ik4EFUxMut0x7HhoqyjlSCJDJNeTfqVVe+jTS6jI92AMrsU/A9fNYMKZKy3yNIlOHjkfnWCYEFkaF1wowR6s53dTrRUMbIxCJypBzNSTF8nsoULnyjfY6GgQYkdXEjQRv5i6OTqcHGUOr/9E2mhlJ9k4KiG5GoAzcfm5w8Ngnfm+zD7tZI62yyT3OilqErwiQnQAXiKvmbL7IX2RSxMAKNk1lyitxE3kseJE+S3/bvcQSbRkXCn1Ai0PQ0V4mJkq5SOSTJzWQkYcbFkGGE5rdOQ8aCFaZGyJj58Ifed8+tNy+fPjh3zUQh70QpefyjH3ryw0/+m/vvefB9D/7GnTe/99b33rBy+qblmxaPzZ06eGrPronZa2YH+vLjhfGORDTn5DSZWNRKmWXIt1bG5QuzA9B/sm90TAH2FK/soJxE/ElzWst7eZIJV9IAXM2GXk3TmkQvm0lrFm0+x30MG1HRYbp9oZhKdONs+1zSFZEyQZRkmLmaFOm2afkh1OoC/42JbcLtMU7He/k0Tsmm2t1t2q3pyhU3kZ5jPF0wGnwauwzLMrYpkW6bi9IewJMtqtbE7fu0xraY4XWbkNsOJec2/x37XfoFEiGTZMafzoPIahalIvUlQNNfJUxkq0Sk4iqhAl0lmMGEeSIIcISAAHsxWIz392XScVfXSAQisskDpbBl9Kha5nQCN/qdMAWNitsJrudIMpNNXKlBGIJBVivyMY+SsXcuzdbSF174mxcuXHjhB6IqhITIqfejR4oGG5BBYP9YY5qIyqAfpmjNoORlV6FfSNdml945dhOfhDODMcCZ8uqjIsMZ/TwfCsEPxxkuH/0dKmCU0ZWCgrkBhZshHvsMxjmZlEiZTPgN1IckUmlRRtHRu4koAEOFNPGawCGMjLAbSLmvt6eYS8etEOZwGWTFLBfQxOTsIBSoXS3mpa4SurrLUAeNutuoN1A6PHhuvZS1spR1752Q4Yi4CncxlsgNbCyNdiQAVM/OP5BPeGN3ju9cPF3MJnduKPSHH4xP9NRmQqCCnEsCuB1/F/xR1AsB/4v0aNkCxb/kEnyJEIl8c/NrIqGncF2PkpPkPPk1cg/5lB+btamKYVxRUyCxE4tzPA76s890YGCuoUyCChh4VaLoqtLEGKcZutYkBpOMecJCgAFRasom5fEag1w7YF/zFuZhRJ9/Y75IZpp+J8A9777rN3/tV2+96Z3nrnvHUvP4MTgKh/bu2XHNxeTbwlZZhQyT5OEyzQ2y0rCFOsx6rmeZglxWsAudtoGZVGyMWlUkyOZMJjMkmGSNvCTHvEqjzhyesgcx7tbRzTO0dVlsXUhXnIvk9W9RpjBJHdmTE4zujgSTE7NwPHVAQtNNjxcAtYV/DIGbKHDjl4xwIrxAVbMjGnySqfGoRUG2h3t6cvHX9+YERUwXxsLaNzC6tlsI63+th3lzS1h/ux6JYAO/FxwFqmqGzCKJ0Sz86/yRkNK1HDwthPv76i4ImH+67GgUpIjphEMM9jI97cYo1axiIrirqybfopV2QroAt2lhWZf1sBx6wA2H3fDH3EjEjaBtz26+wj7FOkmIxEmeDPn92IdBROQpuJV4tV0SoEA8zWJ4Sia6OhP5ZD7m1KJytFyAYk4GyXNHs5U6VOsVN2Y5Uq5Y89oqrbiYgp8OLuVvyge/n+tI76OP7xsPwnbSxk+X4RodPR0dd9MzO3dufHRqZPgMbBq2bQSv8PYVHHY6kKCFcWc3/7b1nGHEC72kj9TIAX9fH8gS+DiKzo82JhEZraGpwhvogTGyoLSt0YpQUqsODRS6OzMJN5K20opEwjSsmWUxmys2oD6K6++BKyE8QKFaMpWgSFEca0s0WapyKoihkGxh4/S+8Rwcy48ZCS+mwPHceLCqRpXg9y0nTx/PO1ZwKSK2RR3ucFrSZq+bQmmVSDy88dGdZxiJmBuPZnK5DL0uE2RtA7q25H+v09PRkp/Hn9s3H2P300+TKOkgnaTT78h0pDiu8DvTlOzg4WYVdfSOGGZ8ikEGIWS9gaHS5RGVS5KDegUDqhOGEjQ8WHtKYEyAdwmaJjwlUCoE90gWDEdHojdHo2Nf2PjB2BfZUwyBMJLg6FOcDknoU1EkGOEUleCLXKX+5nn2GD2PeteIiU/nkiQinxxinz4yCPOfFCEMO2ef0TCAoCUJDEuZFQ4oJHyq09EINcPmDUSMg4AWt4hyYryXFjXFowIQOwT2IlplzAnFFolrQdh0w4vEcYxDCMx1Y7t6OHI1Y1j5F3P2F/+FTB1iuI6BzNHVZonrhg/hXdzwbqwl6rJMyOBAP88OpWKhO5/LdnVm0h2pZCLuuTHHjlqRsGmEdFmTNRVLEyJZViJSLlh5K+81IJavFTA7iKOxfGPre+V5Cb8F/DLiP7a+vvHYOpBgHfxgfXl5DT++v0l8f7l18YrvA16ch7VgbX0d1tfXkQwpcHxtmR9eWfaXyc9eZ4brbG2v80mZ4x+26qEL6poO2ooZolospp0kxLEdYq9gNCFhRUCNK8SKKNYiQgo1GlEXSdTACBPVF0ksDg5q8gSxXdeeJbbtHiau7e5J+ad+PHtdi539JfDH1SmV2qtT6ivx9P1T1gcXR768OmCNWqMlGX7Gqlhbq0fX+eoEXT9xUbaWDfqDNeCL41+1LMErrdVCHLK4+XV01l5cJY88OPtMGtegKABFNEbFFRlECfPSWQyD2wFRksiRrXJq9pkKUnf/KDWiGgps8Upav/enkCGmmN0ilsheNHLN4n+xWERx31yN5Wv5WD42GhutjdLb/vfnb73187y5/uKxi/jpbV9hA2f49UWCiIts9qMj9mPc9zD2DZEG2UkOka/OPpPEZx9RJMxSQOG4LreAgwk8YWmYsNiCoVLG9F1hCIW2LxgXmheaQ0jIp6ArNy/z+GnT/JErZiBhiAnzSMLHaYi1eGDmn+fHVu6hMIN6KE77lBzY5x+aPrTjmvGxWnVkeKCvkEt3JOIxx4pg2YP5J4JQOItA0HJaGQdzTZFw1IG5k24dUXX5bDsNIYkbi149/uYSqMj8jbXDN998mK4duuWWjUwrBbU/lBRSmyRVKCYB209cMYK+nywWUmupQoH133x4g089RJHN62stAvqJ1mHjAhKkaIt2w79yJPhEMbnOB7Fp1wxk81fZjfRVxMwNjiy6EyYTUNWYsLEmRsDXZIBIm87jgQoLRKDCTMzrHuzuwyK+UB1CVIz5Gor5HCauVouFcSemfN66vFTwWm096piwZWUu/aC+uqrrVQ6lzq1q4Yg+quvnzul4iIS11XO8v6p/444vf/uP77jjj7/95UthPhqOaFW9PVGL/EgPKK99+Y47vswbwvc92GY/20CbvEAe8EM5nQI9upMqMvXbVjnEQSBBDLuio6tgTSavICxXJFk5i5lCQ8RLJIxOCl1AjKUpaFzVnzwDexU6f8U8SpUFolAF4bF1+uTxYwuHPSc+ZHs9diLklQGTPzJABWUtz61gSVHE2gm48kwsqVxUl5Vt1KucDPW5VXRhydUizFrYn2vP56T1ahEnWlmswhyXK3tKwBqM8o0t9p1H1HhcNc254OU5s2Sosqw+LFuqYzzCT40SDvzJnGlyokcM4xEckkK6wMfmYHhOtqJRyTQfNkv4TSExDM3J+Gc4TBLxnz4iSAwDDhx4eJsd1GZNQ03E8Tay+bAaT6iGMRf898s3x+MjMqZkkd+SPxWyk1r8+W1S5iwM8ttaKAwg/sE76LosqCrGGCKQXZsX2Iv0W6RA6mSazJFjCFlQ6QS0pghMJmxeR0cnuCyIMpuKQSVBkOb5UeKmKwkzpSKQudm3zUztGGuMDBXrpXquK+k5USMkC6QABZNvb9Sw7su29hXyXM3osW23R6VatdZeYKsYYdUpOtoG05XL8NN2oO3/aciyR/5Dbzq4L5yM6g+bmuaYh3rTNGImbf1g2HE2vqtGVJBUQ8aLP0o7TtqB4LPJKOSiyeB9dMcN6d5QNGneAKqWdjY+k+7Vo8kwHfSQbuO/qhENbpcNTXTCwf04Pwy38xbP6S1WMmlN8f1q4hOJrdMjiAb6yATf60Jt8WK4iWMU80QTQZIgYmkscvWIwkxtYqw6jjVVuR3MBlFExoWx2pdCrSVbRtq6hva157L1ePT1P8PnUQRB4ZVQfzTOeyQsJ0UWj7J+blSSwCjvDdk670prjPZYCT7B5DPjwf+1EkxUVF2yEoggJDSYTRKN63bISiRVTI0V8p/pn6NH5smwP4DoD4R5XHcqYbxiKFS7AhJgBkhXJsFXVcfqIQ95vpGB1ZBJ87niDvSzItabMNl6eqwm0uhcWALRz3xEkDVRj3yEV2DyRyK6qMkCXoRh5VF+GtEeDet8RA9zwo8gWEQ9RsgS+w79Pcx9XWSQTPpjhIdN4Lrl2xy85GGo9PlWldPahpnJZSkp92YHc4OZVCzaTjB84yHLn27behzJbplhe5eslXTElsZbRoeP+5fBwdufeOJ2+ANs/9XdS8HBpbsnzk7CHyzdvfFA/1x/sn9Hds/y8tITt3Xd9kSrgfrSXXctdU2enbh76YMDswPZHf3J5fvOXCVD5eeXoaeUreQqb00GebvmxOV4swwrKMNcE2WYgE8u3f09FAEfTg5FvWQ6e6UUtaW7717qbEvRPzeAMu6xsumkZxlyG4usIRZZuwqLLPmLV2ADYjDBmA+HNCaoaD/Cj8cG/59wgfjLwgXFZAsXrP0iuMBGWMB7OSygpLH5AvsiGyFxtIaj/uEiiEKl1JHwNFlSGLiYBplPQMTIz1b4VgQjZzE6iyCITbQORGrzeCA8dRKKztjXU8inkjEbK6U4xGW+xcaNoOHV8p7JYk4GLbpRkuzYaInvrQ+im8oed00cw7Luh2c+vjx16vsnnU43tPfOJ5aOH6w0Hv3+cqG0946PLe2drvaWJy+cmO5OJazlj5+58e2nvncytWN6X/fSE3fu7dwXBeH7y/W79ix97I69sf1a9/SJC5OV5d429lkjWbbGci1cvrKFtBE5I0AWpRWOpdE4gEsIDI5vI21NQjDQ92PIEFgznvw54J7dQvMMIeabkDbJmbC1n1psI22rjbRX/+TZc+ee5c29lc9X8MNy5559mfe9/GyQevpp+MBzz7VjOmGfo69gDtxDDpO3+TNDg5k0xkrwEeMwEtKoihmwKQBTMA0yuUkkUZTm8enFBXxecWbfzPyBmcP7DvtTI8VabVciGp02EJNUi2VmQn5YzpuA2VfGzJcfbhu3vWXcpe2oz7gpD3ODRUjSqDcwIKVpIcszI/d2x2WfGy89jxlc5E4lQiiMZiN4shIs94x1jfXQtZ4x3zY21lRT7bINeEyR80My+pwiPmnYr2/CY60dlmVsOSkgE0r13u4QtcZ7g+t6xsaK1LB5+nzUsHOdVBFzpm1QyLdtuYUV3rH5EnuO7SciUYlBbGL4mm2FNFUWmVAsD4CsQqmhUssATPv8gqrBfRW4CBdHR4Nrg2vxbDD40+BPsd3qfukH1eAbiA7OQz74Bp5996tf+9rGP/2w3dna/9qug7JkmPw6eT95DS75HY+DqA0hLvz7v7s1JzDprx554Hfuves3RhRq8I1bHW3OJyFcmZDYxFpZBolpEo+3YYOFMaeZYFDBaFqgEFDQClV1a8cP/SyyQCIRPcILphDymfhRPmgGYZMalP1sDslf0pMUkQ+HH2oIzfCt8LuCiz/zFhigI0cUGuGMAJR5i7+ZXuAssbrD+q50/we++pXPvfjfXvjMp599+tJTT378P370A6/d/9rK2euXT7194dD87PQuL5aPhsvAAw9/yRtDHJ0RtxA3j0feIC3xDyu5jO/WmZwqXyxt/WO4kvJ8c7vIvWG04rXeRnGvwDMvwzez0ZvQqVzRbZ97riTzt8uQK5bqpWpjirVZ8dyONytTzq9VT7Vc0Wu/Whutc5aX/0e5+9HWKwmciwcBz+ulGk+tlL1z+Pb37Dn3/P7usaIzvz9eH5/yd+f2vOf24f3zTnGsS3SdWCQRUiXFtPT3nKAQdfieOOZCquhuLi6LgqQYiclk2kxYsoj4B6ERLeUauVSfV7I1UY6opmJYOlJ3xVxVTcXUsEE3XEXLmUztkLAuUEIS/I93/9Vkj2FKPHEIoT1G1Fz70u13rvIyQ7MNSTU9vdYzsqdzIOR1ZCYR6ouiq2u2mrNCWFpJeiSRqzuapUi6mEpgoGWKIGEoY12qK6T2v+sSfWh4d35+f/exk9ePorTx3lzCUvO7h/c/f270+pPHHlPCsiJmUh1ROxNTjwYv2dl+j2IakzQJFyNtKOn49E0jJx0Vo7Ygh/XM7n1uwQspwCQ11xlPlRKywtREVDVyGawhFVkK9cbNVDheqaZoMHLvjXNjoq2oVsiSk2HGbnn+VyYYssJbdAw4O7r375zhhQzTp/t/5XAmGY67rp6xrQ4ps7PfjcUUhhFZpGkt7sDswumL79pPOIa5ZzNgv8konumIY2zMTvyd1pf+iwRUVQCjRgp9bC+WSHxTWVU0TT3N8xmC+sWtl++LGI0kWcRsJBNFlZXFMGjECGnGCRLS9dAsCYX0BaKH9JmUv+8NRvyXF78wp6ZfSMZJ65VaviteSpau3opDDrIdQUezZZZlJdvLxt70L2LRBa1iF1MJFrZivjbKuivjA0HXwHjlenhPcNeVX1re6Jdx3Y6wqEYdLcqOyMHfvvQSo8GCzMdleHp5eGS49cHl/gfNMLR/cJeHt/c93sE2mUCKWBmd+VSK/5Zna2ugi1ABhFbiB3YDphJgAjS3f+OgiRieCm8mwdjfgpXY036f2i5Dmn/Y0xuzxvlOyQDW96U6Fpbcp3ko4DGGe3Wj0gliCw+gwMUCZuBiqQWO0N15IIk57NXgO4gxCjO7bnj/kX/fKA/MTN9wH/z62dZbQy2ZSsZVKS4Ecz0XJq+bG6r4pQuT188OVdirKNKhBZzR3Lur+lvTR363ceJtFF5VNTkckjv2vzZUgZ2lG5F2eGQnzr0e1/v4Zj+7hPkrSXrIbnLex0I+EhLQOLY0k5YEhfHfSPBqCxDwiddi1JYXiCxrFNWSxxWmTKbNN9GJIsxj8SYe4RP2Nn07lfKnJserI/19qZ5UT/9UXrXKhSoXuBW65Az1HJP/AKRYaxQZVjwCf52ThkIs/2aoXQZeqmOlDpfcHi9fEXVTBUEVEFb4hh0tXWu4ncV+b/DQYOD73ZVKN73IW//x28bOHej/sFfyKnndjYYlyRlPKWHVNm5MQOIhr7+IUHPg0OBDDz1UyQfH85VKHi7lKw/d9nj/gXNoEOub68xHCJxCv9yJVjHn79/vt1yTQw8gQlPUEP8RGSFYkygEoyxmMiwtWjgMC3IsWfcScnB+ZvdEY7BcKnZlkFeqXsjrFsrEt4JQDTH+Y4ctcTEPobwFriPMJ7EsoILaFXm7rECoLLd1gXqSYvzXKLUq2uaHVkdPzfRSsDIWAn/CD0GR3nywc2Kw24FgDV5EXQU+VueSQBGJrYuaIrFXbAO7O/Io9vpvr36wNH1y9D6cGmB9gQfA+uHegxfs3OB4573BMlJSxJ+qAKhzJima+G+rCM5MtRrNJvL5RBZ18s8ckggIAAAAeJxjYGRgYADin50OX+L5bb4yyLMwgMCl/XPFEPR/HVYG5gYgl4OBCSQKAEk/CsAAeJxjYGRgYG74r8MQwwpkMTCwMjCAaSTAAwA91QIkAAB4nGMsY1BiAALGUAYG5pcMOiwMDFZAnAPEXkDsAMTpQOzKysjwEkh7A2EJgwMQhoN0MTAzODI4MBoxCAAhA4M5QwNQJh7IagHiUIYDANkXCpYAAAAAAAAoACgAKAFkAYIB7AI8A1oD2ARABUYFmgYYBmQHWAgmCJYJdAngCsoLYgvKDBQMdgzcDX4N8g5MDuAPGhE+EfASehMOE6gAAQAAACMA7wALAAAAAAACADYARABsAAAArAGrAAAAAHicfZC7boNAEEUvfsmRUlhp04yQC7tYtCBs+dGDm7TpLRtsJAckwA/lGyKlSxvlE9Lm63JZb5oUBu3MmZ3LPABwjw84aB4HfTxYbqGHseU2hni13KHm23IXkbOy3EPf+aLS6dzxZmC+arjF+o+W21hBW+5Q82m5izf8WO5h4LwjwwYFcqTG1kC2KfK0yElPSLCl4IgXBsk2O9JHVtf4EjtKBAE8dhMseP7Xu976mELRKmq1iRCxR1SUu0QCT8tC/voS/anyVaB9qm6M98zeJSpKmlTT4zrFkqfmm2LN0Wtm99RcZxnhRI2HOUL+c+E8B9qZoZJ2YiooxGYrbaOLqR4aPtO6zLsmSo2tOExSVlmRi89dllLX6fpYF/uM64xO2puHY1EHmYkqZaJFxRJouov4oaizuLErKhVV3dr3F/uvWXAAAHicbc23DQJRAATRP4f33luJBlg8IeZoggpIyKiAwgHBhqy0euGEKHz3eoZF+LfZ54QoXIlIkCRFmgxZcuQpUKREmQpVatRp0KRFmw5devQZMGTEmAnTzON+izfzuZVd2KVd2bXd2K3d2b092KM92bON7eWn3Jf7cl/uy325L/flvtyX+3Jf7st9ua/4DZvpSTUAAABLuADIUlixAQGOWbkIAAgAYyCwASNEILADI3CwDkUgIEu4AA5RS7AGU1pYsDQbsChZYGYgilVYsAIlYbABRWMjYrACI0SzCgkFBCuzCgsFBCuzDg8FBCtZsgQoCUVSRLMKDQYEK7EGAUSxJAGIUViwQIhYsQYDRLEmAYhRWLgEAIhYsQYBRFlZWVm4Af+FsASNsQUARAAAAA=="
  20236. /***/ },
  20237. /* 201 */
  20238. /***/ function(module, exports) {
  20239. module.exports = "data:application/x-font-ttf;base64,AAEAAAAPAIAAAwBwRkZUTXG83PwAAAD8AAAAHE9TLzJXw1zRAAABGAAAAGBjbWFwy7ohrwAAAXgAAAFKY3Z0IA1l/kwAAC7QAAAAJGZwZ20w956VAAAu9AAACZZnYXNwAAAAEAAALsgAAAAIZ2x5Zlh7oM0AAALEAAAnTmhlYWQJnn3VAAAqFAAAADZoaGVhCN4EOgAAKkwAAAAkaG10eCtRBh0AACpwAAAAXmxvY2GblqWVAAAq0AAAAEhtYXhwAX0KywAAKxgAAAAgbmFtZQl/1xEAACs4AAACLnBvc3RYy1X5AAAtaAAAAWBwcmVwpbm+ZgAAOIwAAACVAAAAAQAAAADMPaLPAAAAANK/nRYAAAAA0r+dFgAEBAcB9AAFAAACmQLMAAAAjwKZAswAAAHrADMBCQAAAgAGAwAAAAAAAAAAAAEQAAAAAAAAAAAAAABQZkVkAMAAeOYeA4D/gABcA4AA1AAAAAEAAAAAAxgAAAAAACAAAQAAAAMAAAADAAAAHAABAAAAAABEAAMAAQAAABwABAAoAAAABgAEAAEAAgB45h7//wAAAHjmAP///4saBAABAAAAAAAAAAABBgAAAQAAAAAAAAABAgAAAAIAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAIgAAATICqgADAAcAKUAmAAAAAwIAA1cAAgEBAksAAgIBTwQBAQIBQwAABwYFBAADAAMRBQ8rMxEhESczESMiARDuzMwCqv1WIgJmAAAABQAs/+EDvAMYABYAMAA6AFIAXgF3S7ATUFhASgIBAA0ODQAOZgADDgEOA14AAQgIAVwQAQkICgYJXhEBDAYEBgxeAAsEC2kPAQgABgwIBlgACgcFAgQLCgRZEgEODg1RAA0NCg5CG0uwF1BYQEsCAQANDg0ADmYAAw4BDgNeAAEICAFcEAEJCAoICQpmEQEMBgQGDF4ACwQLaQ8BCAAGDAgGWAAKBwUCBAsKBFkSAQ4ODVEADQ0KDkIbS7AYUFhATAIBAA0ODQAOZgADDgEOA14AAQgIAVwQAQkICggJCmYRAQwGBAYMBGYACwQLaQ8BCAAGDAgGWAAKBwUCBAsKBFkSAQ4ODVEADQ0KDkIbQE4CAQANDg0ADmYAAw4BDgMBZgABCA4BCGQQAQkICggJCmYRAQwGBAYMBGYACwQLaQ8BCAAGDAgGWAAKBwUCBAsKBFkSAQ4ODVEADQ0KDkJZWVlAKFNTOzsyMRcXU15TXltYO1I7UktDNzUxOjI6FzAXMFERMRgRKBVAExYrAQYrASIOAh0BITU0JjU0LgIrARUhBRUUFhQOAiMGJisBJyEHKwEiJyIuAj0BFyIGFBYzMjY0JhcGBw4DHgE7BjI2Jy4BJyYnATU0PgI7ATIWHQEBGRsaUxIlHBIDkAEKGCcehf5KAqIBFR8jDg4fDiAt/kksHSIUGRkgEwh3DBISDA0SEowIBgULBAIEDw4lQ1FQQCQXFgkFCQUFBv6kBQ8aFbwfKQIfAQwZJxpMKRAcBA0gGxJhiDQXOjolFwkBAYCAARMbIA6nPxEaEREaEXwaFhMkDhANCBgaDSMRExQBd+QLGBMMHSbjAAABADr/uAOVAukACQAGswQAASYrARMFBxMlBRMnJQHohAEp1zP+9/72M9cBKQLp/vMr0f7YjIwBKNErAAADAGz/7AOUAxQACwAdAC8ATEuwLlBYQB0AAwAEBQMEWQACAgFRAAEBCkEABQUAUQAAAAsAQhtAGgADAAQFAwRZAAUAAAUAVQACAgFRAAEBCgJCWbc2Njc3FRAGFCsEIi4BND4BMh4BFAYDNCYrASIGHQEUHgI7ATI2NRU0LgErASIGHQEUHgE7ATI2NQJu3LpsbLrcumxs8QsHSgcLAwUGBEoHCwUIBUoHCwUIBUoHCxRsuty6bGy63LoCBQcLCwdKBAYFAwoIgQUJBQsI7wUIBQsHAAMASgErA7UB9QALAB4AJgArQCgEBgIDAAEBAE0EBgIDAAABUQUDAgEAAUUNDCQjIB8UEgweDR4VEAcQKxIiBhUUHgEyPgE1NDciBhUUHgEzMjY1NC4GICIGFBYyNjTYUzsbLjcvG+sqOxsvGyo7BAgLDRASFAFwVDs7VDsB9TsqGy8bGy8bKjs7KhsvGzsqChQSEQ0LCAQ7VDs7VAAAAAAJAED/vwO/Az4AEQAiADkASwBdAG8AgwCUAKgAh0CEFAQTAhIFAAUDAgEGAAFZFwoWCBUFBgsJAgcMBgdZGhAZDhgFDA0NDE0aEBkOGAUMDA1REQ8CDQwNRZeVhoRycGBeTkw8OiUjFBICAKKflaiXqI+MhJSGlHp3cINyg2lmXm9gb1dUTF1OXURBOks8Sy0qIzklORwZEiIUIgoHABECERsOKwEjIgYdARQWOwEyNj0BNC4CISMiBh0BFBY7ATI+AT0BNCYhIyIGHQEUFjsBMj4CPQE0LgUBIyIGHQEUFjsBMjY9ATQuAiEjIgYdARQeATsBMj4BPQE0JiEjIg4BHQEUFjsBMjY9ATQuAQEjIgYdARQWOwEyPgI9ATQuAiEjIg4BHQEUFjsBMjY9ATQmISMiDgIdARQeATsBMjY9ATQuAQJZswwSEgyzDBIFCAsBQrMMEhIMswgOCBL9ZLMMEhIMswYLCAUCAwQFBgcBRbMMEhIMswwSBQgLAUKzDBIIDgizCA4IEv1kswgOCBIMswwSCA4BQLMMEhIMswYLCAUFCAsBQrMIDggSDLMMEhL9ZLMGCwgFCA4IswwSCA4DPhIMswwSEgyzBgsIBRIMswwSCA4IswwSEgyzDBIFCAsGswMHBgUEAwL+uBIMsw0REQ2zBgsIBRIMswgOCAgOCLMMEggOCLMNERENswgOCP64EgyzDREFCAsGswYLCAUIDgizDRERDbMMEgUICwazCA4IEQ2zCA4IAAAAAAIAZ/+TA5kCxQAQADsARUBCIwEFAzURAgIFAkAGAQADAGgAAwUDaAAFAgVoAAIEAmgABAEBBE0ABAQBUgABBAFGAQA6OSwqHh0YFgsKABABEAcOKwEiDgQVFB4BMj4BNC4BAxQfAR4BMzI/AT4BNzIWHwEWFxQGBwMHDgEjIi4BLwEuAzUmPwE+ARcCADhqWks1HW293r1tbb33BQkEDAQQXYoEBgUFDQMtBwEEA/o1AwoFAwcGApcCAwIBAQgjBxYIAsUdNUtaajhvvW1tvd69bf44AQUJBAdongUDAQQDLAgKBgkE/vg5AwUCAwKOAgQEBQMLCCUIAQgAAAMARQAXA7sC6QAHACcAKwA6QDcAAgAGBQIGVwcBAAMBAE0ABQQBAwEFA1kHAQAAAU8AAQABQwEAKyopKCYiHRgRDAUEAAcBBwgOKyUiDgEHIS4BJQITNCYjBiAnIgYVFgMUHgE3NhY3Njc+ARcWNzYXFjYnIREhAgMkRjoHAVIFaAF+AwMZIi39WjMcGQEBCRcTI5AjGRc4dzk/V14mIRo//QgC+JEYOig1RQwBCQEHIhoBARYc5/7HEhcMAQEBAQEQKAohJQICAgIaWgHIAAAGAOn/zwUAAl0AAABTAFwAbAB4AIQAtUAVSxMCCQQAAQgJGwEGA1hXTAMFBgRAS7AcUFhANQABAAQJAQRZAAkACAsJCFkACwAKDQsKWQANAwYNTQADDAEGBQMGWQcOAgUFAFECAQAACwBCG0A8AAEABAkBBFkACQAICwkIWQALAAoNCwpZAA0DBg1NAAMMAQYFAwZZBw4CBQAABU0HDgIFBQBRAgEABQBFWUAfAQGEgX57eHVyb2pnYl9aWVVUAVMBT0ZEPTyqGkgPESsJAR4DBgcwKwIiLgMnMBE3NjchFxYXEQ4EBysIIi4DPQE0NzU0PgU3MxE0LgMnISIOAwcDFxYXOwM3IwYHFRcyNzYDFAYrASIuATU0NjsBMh4CFAYrASImNDY7ATIGFAYrASImNDY7ATIFAPzsAgMIAwYJMUQiBA0kHBkDBxlLAVUbSgYBAxQdOSUBAwUGBgYGAwEBAgUEBAEBBAYNDxkPUQIJDhwS/rQDCRgSEQIBBxMwKCgiGPxGIgQIBR0lOA8K3QcMBg8K3QcMBgEPC9wLDw8L3AtxDwtbCxAQC1sLAab+UwECCQoNBwMQGTMhAY0jUgwIIGD+rwQPLCo2FgEEBQkFIBMSEgEGEA4UDwwDAUYDCx0WFQICChEmGf5+IDUHcQonPwEdJQFzCg8HCwcLDwcMkBYPDxYPpBYQEBYQAAMAS//gA7UDHwAMABgAIwAvQCwAAwAFBAMFWQACAgBRAAAACkEGAQQEAVEAAQELAUIaGSAfGSMaIxUUNRIHEislASYiBwEGFxYzITI2ATQ2MhYVERQGIiY1FyIuATU0NjIWFAYDr/6rI28j/qwiHB1HAqJHOf4PExoTExoTIA0WDRwoHBx/AmE/P/2fPjEwYQH/DRMTDf7gDRMTDeANFg0UHBwoHAAAAAUAS//fA7UDHwAPAB0AKQAqADUASkBHKgEHBgFAAAUABAYFBFkABgAHAwYHWQkBAgIBUQABAQpBAAMDAFEIAQAACwBCERACADU0Ly0lJB8eGRYQHREdCAYADwIPCg4rBSEiJjcBNjMyHgIXARYGASIGBwEGFjMhMjYnASYCIiY1ETQ2MhYVERQHBjQ2MzIeARUUBiIDUf1eRzkiAVQjOA0ZFxUIAVUiOf5oCRII/qwRFCMCoiMUEf6rEAUaExMaEyAwHBQNFg0cKCFiPgJhPwgQGA/9nz9hAwAQDv2eHiIiHgJiHv4hEw0BIA0TEw3+4A2DFCgcDRYNFBwAAAMAdP+gA4wCuAASABwAHwAfQBweHBsDAAEBQB8dAgA9AAEAAWgAAABfFRQSEQIOKyUnLgE2NwE+ARYfAR4BBgcBBiIBNjIfARYUDwEnATcXAYCpBAMDBAF8BAoKBKkEAgIE/oQGEQEwEjEScBISOMX99zjGA6kDCwoEAXwEAgIEqQQKCgT+hAYCqRIScBIxEjjF/TL+xgAACwBA/2wDoAJsAAYACgAOABIAFgAaAB4AIgAmACoALgFNtAUBDwE/S7AKUFhAUQAABAMEAANmCwkCBwYBBgdeEhACDg8OaQAFGAEEAAUEVwADAAYHAwZXCggXAgQBABMMARNXAAwAFRQMFVcAFhEBDw4WD1cAFBQNTwANDQsNQhtLsBhQWEBSAAAEAwQAA2YLCQIHBgEGBwFmEhACDg8OaQAFGAEEAAUEVwADAAYHAwZXCggXAgQBABMMARNXAAwAFRQMFVcAFhEBDw4WD1cAFBQNTwANDQsNQhtAVwAABAMEAANmCwkCBwYBBgcBZhIQAg4PDmkABRgBBAAFBFcAAwAGBwMGVwoIFwIEAQATDAETVwAMABUUDBVXABQADRYUDVcAFg8PFksAFhYPTxEBDxYPQ1lZQDYHBwAALi0sKyopKCcmJSQjIiEgHx4dHBsaGRgXFhUUExIREA8ODQwLBwoHCgkIAAYABhERGRArJREjESMXNwEVIzUlIREhBTMVIzczFSM3MxUjBTMVIzczFSM3MxUjJzMVIyUzFSMDAECgwMD9oMABAP7AAUD+wGBggGBggEBA/wBAQGBgYIBgYOBAQAEAQEBsAYD+gMDAAcDAwED+wIBAQEBAYIBgQEBAQOBgQGAAAAALAED/bAOgAmwABgAKAA4AEgAWABoAHgAiACYAKgAuAQO0BQERAT9LsApQWEBcBwUCAwQDaBcCAgELCgsBCmYODAIKFRUKXAAAFBMUABNmBgEEAA8IBA9XAAgAERAIEVcAEAAJEhAJVwASDQELARILVwAVGAEUABUUWAATFhYTSwATExZQABYTFkQbQF0HBQIDBANoFwICAQsKCwEKZg4MAgoVCwoVZAAAFBMUABNmBgEEAA8IBA9XAAgAERAIEVcAEAAJEhAJVwASDQELARILVwAVGAEUABUUWAATFhYTSwATExZQABYTFkRZQDYnJwAALi0sKycqJyopKCYlJCMiISAfHh0cGxoZGBcWFRQTEhEQDw4NDAsKCQgHAAYABhERGRArAREzETMnBwEzFSM3MxUjNzMVIwUzFSM3MxUjNzMVIyczFSMlMxUjERUjNSUhESECwECgwMD+IGBggGBggEBA/wBAQGBgYIBgYOBAQAEAQEDAAQD+wAFAASz+gAGAwMABQEBAQEBggGBAQEBA4GBAYP7gwMBA/sAAAgBX/9cDqQMpAAsAFwCUS7AdUFhAJgQBAgMFAwIFZgcBBQYDBQZkAAMDAVEAAQEKQQAGBgBSAAAACwBCG0uwMlBYQCQEAQIDBQMCBWYHAQUGAwUGZAABAAMCAQNXAAYGAFIAAAALAEIbQCkEAQIDBQMCBWYHAQUGAwUGZAABAAMCAQNXAAYAAAZLAAYGAFIAAAYARllZQAoRERERERUVEAgWKwQiLgE0PgEyHgEUBgMjNSMVIxUzFTM1MwJz5sRycsTmxHJyY6pUqqpUqilyxObEcnLE5sQBYaqqVKqqAAAHAAD/LAQAAywADwAXAB8ALwA3AD8ATwDOS7AaUFhAMQgGAgIAAQIBVQsHAgUFAFEOAQAACkEKAQQEA1ENCQIDAwtBDwEMDANRDQkCAwMLA0IbS7AuUFhALw4BAAsHAgUEAAVZCAYCAgABAgFVCgEEBANRDQkCAwMLQQ8BDAwDUQ0JAgMDCwNCG0AxDgEACwcCBQQABVkKAQQMAwRNDwEMDQkCAwIMA1kIBgICAQECTQgGAgICAVEAAQIBRVlZQCZCQAIASkdAT0JPPTw5ODU0MTAtKiUiHRwZGBUUERAKBwAPAg8QDisBISIGFREUFjMhMjY1ETQmACImNDYyFhQCIiY0NjIWFAEUBiMhIiY1ETQ2MyEyFhUSIiY0NjIWFAIiJjQ2MhYUASMiBh0BFBY7ATI2PQE0JgNA/YBQcHBQAoBPcXH9HhoTExoTExoTExoTAgAlG/8AGyUmGgEAGyWtGhMTGhMTGhMTGhP+wIAaJiUbgBslJQMscFD9gE9xcU8CgFBw/IATGhMTGgKtExoTExr9bRslJRsCgBomJRv9QBMaExMaAq0TGhMTGv6tJhrAGyUlG8AbJQAAAAACAAD/dQNuAuMAKwA3AC9ALCQZDgMEAgABQAAFAQEAAgUAWQMBAgQEAk0DAQICBFEABAIERRUXJC4kKgYUKyU0LwE3NjU0LwEmIyIPAScmIyIPAQYVFB8BBwYVFB8BFjMyPwEXFjMyPwE2EhQOASIuATQ+ATIWApELaGgLCzQLDw8LZ2gKDxALMwsLZ2cLCzMLEA8KaGcLDw8LNAvddsrvyXZ2ye/Kqw8LZ2cLDxAKNAsLaGgLCzQKEA8LZ2cLDxAKNAsLaGgLCzQKAQjuynZ2yu7KdnYAAAABAAP/LAP9AywAbQCQQAwiCwIBAlM/AggHAkBLsBpQWEAvAwEBAgACAQBmCwEFBgcGBQdmCQEHCAYHCGQEAQAKAQYFAAZXAAgIAlEAAgIKCEIbQDQDAQECAAIBAGYLAQUGBwYFB2YJAQcIBgcIZAACAQgCTQQBAAoBBgUABlcAAgIIUQAIAghFWUARXlxVVFFQFxQYLxMXKBMZDBcrAScuAQYHBhQfASERFxYyNz4BJi8BLgEjIg8BDgEWFxYyPwERITc2NCcuAQYPAQYUHwEeATMyPgE3PgEmLwEhEScuASIGBwYUHwEWMj8BNjQmIg8BESEHDgEUFhcWMzI+BD8BPgI1NC4CA/CcCRgYCQ4OTP7RTA4nDQkHBwmbBxEJFA2cCQcHCQ0nDkz+0EwODgkYGAmcDQ2cBxEJBgwLBAkHBwlMATBMBxESEgYODpsOJw6bDhsnDkwBL0wHBwcHDRQDBgUGBQYCnAQGAwIDBQFKmwkHBwkNJw5MATVLDg0JGRgJmwcHDpsJGBkJDQ1M/stMDicNCQcHCZsOJw2cBwcDBgUJGBgJTP7RTAcHBwYOJw6bDg6bDicbDksBLkwHERIRBw4BAQMDBAKcBAsLBwQJCQcAAAAEAEH/bQO/AuwAJQA2AEIATABUQFEAAQAKAAEKWQUBAwcAA00LAgwDAAkBBwYAB1kIDQIGBAQGTQgNAgYGBFEABAYERScmAQBMS0hFPj04NzEvJjYnNiIgGhcUEg0MBwQAJQElDg4rASM1NCYjISIOAh0BIwYHBhQWOwERFBYzITI+AjURNTMyNjQmASIuATUDND4CMzIWFREUBjIiJjURNDYyFhUTFAE0NjMhMhYdASEDnJopHf6IDxoSC5sOCgoUDk8pHQIQDhoTC04PFBT98QkQCQEGCQ0HDxQUxx0UFB0UAf68GhIBIhIa/oYCPWkdKQwSGg5pAQkKHRT9ux0pCxIaDwIuFxQdFP25CRAKAXQHDQoFFA/+jA8UFA8BdA8UFA/+jA8CcREaGhE+AAAAAwBAAAYDwAJSABIAKgA6ACtAKAABAAADAQBZAAMAAgUDAlkABQQEBU0ABQUEUQAEBQRFNTo4NDkyBhQrARQGIyEiLgM0PgMzITIWERQGIyEiLgQ1NDYzITIeBhEUBiMhIi4BNTQ2MyEyFxYDwBgS/NQHDQoIBAQICg0HAywSGBgS/NQGCwkIBQMYEgMsBAkHBwYEAwIYEvzUDBMLGBIDLB0KAwIoERkECAoNDg0KCAQY/vIRGQMFCAkLBhEZAgMEBgcHCf8AEhgLEwwRGRoJAAEBMgCuAtUCUQAjADBALQAEAwEETQUBAwIGAgABAwBZAAQEAVEAAQQBRQEAIB4ZFxQSDQsIBgAjASMHDisBIxUUDgIjIiY9ASMiJjU0PgE7ATU0NjMyHgIdATMyFhQGArudBAcKBQsQnQsPBwwHnRALBQoHBJ0LDw8BZp4FCgcEEAqeDwsHDAedCw8EBwoFnQ8WDwADABAAWgPwAqYADwAgAC4AO0A4AAEAAgUBAlkABQcBBAMFBFkAAwAAA00AAwMAUQYBAAMARSIhAgArKSEuIi4eGxUSCgcADwIPCA4rJSEiJj0BNDYzITIWHQEUBhM0JiMhIgYdARQeATMhMjY1BSIuATU0PgIzMhYUBgLZ/k50o6N0AbJ0o6Nlf1r+Tlp/OmQ7AbJaf/2QLEwsGiw9IURgYFqjcyBzo6NzIHOjATZafn5aIDtkOn9akS1LLSE9LBpgiGEAAwAQAFoD8AKmAA8AIAAyADtAOAABAAIFAQJZAAUHAQQDBQRZAAMAAANNAAMDAFEGAQADAEUiIQIAKCchMiIyHhsVEgoHAA8CDwgOKyUhIiY9ATQ2MyEyFh0BFAYTNCYjISIGHQEUHgEzITI2NQciLgE1NDYyFhUUDgYC2f5OdKOjdAGydKOjZn9a/kxZfzpkOgG0Wn/1LEwsYIhhBwwSFxodIVqjcyBzo6NzIHOjATVaf39aHztkOn9akSxMLURgYEQRIR0aFxENBwAABwAA/4AEAAOAAA8AFwAfAC8ANwA/AE8AWkBXDgEACwcCBQQABVkADQMEDU0PDAoDBAkBAwIEA1kIBgICAQECTQgGAgICAVEAAQIBRUJAAgBKR0BPQk89PDk4NTQxMC0qJSIdHBkYFRQREAoHAA8CDxAOKwEhIgYVERQWMyEyNjURNCYAIiY0NjIWFAIiJjQ2MhYUARQGIyEiJjURNDYzITIWFRIiJjQ2MhYUAiImNDYyFhQFIyIGHQEUFjsBMjY9ATQmA0D9gFBwcFACgE9xcf0eGhMTGhMTGhMTGhMCACUb/wAbJSYaAQAbJa0aExMaExMaExMaE/7AgBomJhqAGyUlA4BwUP2AT3FxTwKAUHD8gBMaExMaAq0TGhMTGv1tGyUlGwKAGiYlG/1AExoTExoCrRMaExMaEyYawBomJRvAGyUAAgA3/70DxgMxABgAMgBTQFAmAQUEMiccGRcKBwYIAwEWAQIAA0AAAQUDBQEDZgADAAUDAGQABAAFAQQFWQYBAAICAE0GAQAAAlEAAgACRQEAKiglIxsaFRMJCAAYARgHDislIi4BNTQ3FzUjFw4DFRQeAjMyNycGExUzJz4BNTQuAiMiBxc2MzIeAxUUBgcB+GGlYD5d9lwUHxYMRnejWlVOMjee9mAlJ0Z2pFpGQjQpKzttWEIkGxkRYKVhbltd9VwbPUJHJFqjd0YfRxIBBPZgNn5EWqR2RhVJCiRCWG07MmApAAAAAAIAgAAhA4ADIgALABcAZkuwMlBYQCQHAQUABgAFBmYEAQIDAQMCAWYAAwABAwFVAAYGAFIAAAAKBkIbQCoHAQUABgAFBmYEAQIDAQMCAWYAAAAGAwAGVwADAgEDSwADAwFRAAEDAUVZQAoRERERERUVEAgWKwAiDgEUHgEyPgE0JgMjNSMVIxEzFTM1MwJo0LFnZ7HQsWdnhTLEMjLEMgMiZ7HRsWdnsdGx/huvrwGLs7MAAAMAQAAAA8EC4AAlAEQAUABIQEUvLh4dBAYHAUALAgEDAAwKAgkDAAlZBAEDCAEHBgMHWQAGBQUGTQAGBgVRAAUGBUVHRU1KRVBHUEA+MSY1NUEZEhJCDRcrATQmKwMOASMwByMOAQcOAQcGBwYjMCsBISIGFRMUFjMhMjY1JxQGIyEiLgE1AzQ2MyEwOwEyNjc+ATc2NzMyFh0CJSEyNjQmIyEiBhQWA8E5J7oBAQMFAgEBAgUBDA8IAwEEFwcI/mAoOCA4KAKAKDhAEw39gAkOCSATDQGgCAcjLwcBAgEIBagNE/z/AaANExMN/mANExMCgCg4AQEBAgICCykkDAIROSn+Yig4OCYCDRMJEAkBng0TIh8CCAUiDhMNAgEjExoTExoTAAAABABf/8IDswNJAAUACQANABMADUAKExEMCgkHBQMEJistAQcJASc3CQIRDQElASUHCQEnAgn+iDIBqgGqMzP+Vv5WAaoBLv7S/tIBLv6IMgGqAaozwvc0/t0BIzVsASP+3f7dAfHOz8/9+/g0/t0BIzUAAAAFAAD/LAQAAywAIQAwAHkAigDuAatAHKIBBQovAQYF6OdyIgQDBtqckI6FfnoxCAINBEBLsAtQWEBAAAwABQYMBVkLAQoHAQYDCgZZAAMADw0DD1kABA4BDQIEDVkRAQgAAQgBVQAJCQBRAAAACkEAAgIQUQAQEAsQQhtLsAxQWEA6AAwABQYMBVkLAQoHAQYDCgZZBAEDDw4CDQIDDVkRAQgAAQgBVQAJCQBRAAAACkEAAgIQUQAQEAsQQhtLsBpQWEBAAAwABQYMBVkLAQoHAQYDCgZZAAMADw0DD1kABA4BDQIEDVkRAQgAAQgBVQAJCQBRAAAACkEAAgIQUQAQEAsQQhtLsCZQWEA+AAAACQwACVkADAAFBgwFWQsBCgcBBgMKBlkAAwAPDQMPWQAEDgENAgQNWREBCAABCAFVAAICEFEAEBALEEIbQEUAAAAJDAAJWQAMAAUGDAVZCwEKBwEGAwoGWQADAA8NAw9ZAAQOAQ0CBA1ZAAIAEAgCEFkRAQgBAQhNEQEICAFRAAEIAUVZWVlZQCeMi87Mwb++vbu4sa+rqailoZ+L7ozuZmRjYF1bUU9NS0JBFxUjEg8rAS4CIyIGBw4DFRQWFx4FMzI+ATc+ATU0LgIXLgInLgInLgMnFgMeAQYHDgYHDgMjJicmJyYnJicmIyIHBiMiLgMnJj4BNzYzMhceATsBMjczMhYXHgEXHgMXFhcGBwYHDgEWBRYXFhcGBwYXFgYHLgI9AQEiJic2JzQ3PgMmJyYnJic+AjMyFy4CKwIGIyIuAScmIyIHDgEHBhcWOwEyPgEzNjMyFhcWFxYXFhcWFxYzMjY3PgI3Njc+ASYnJjY3PgQ3Njc2JzUWFRQOAgNqMHSCRGe6SSQ4JhRNSRg2OT5AQyJEgnQwSU0UJjggBRYUFRAZDAkGCA4RC4JYAgESFAIFBAQCBAMCCAsWIhgHBQQGCA0ZOxodDhkRBwUFCgcKBQsCJyI3IhsqFycTCgUHEAkOCA0RCwgLFiAVFgkJGxUJDw0C/RYICiIOAwkcBgIDBQgMBgHNgdo7KA0OBgYIAwEEDEQNEg6AyHR3aAYMCwQKEw0GCQ4XCzUoMUQfLQwXHB47BwQJBQUWCwoTCSIRDAgGBwYLEBkiNhQKEQgGCwUbGQMBAwMIBAYGBgUDIAkWBBtJfKsCljBDI01JJFRcYzNnukkYKSIZEQkjQzBJumczY1xUoAgPBwgFHhscEhMeFQlT/sITISwXAgcGCAYKBgUWFx0NCB0YQm8xXBQJAwIBBAcPCx5DRxYlFwwIAQMGCSIfGBsnGQcIAwkZEgkNIh4CAQIIBwYMKRgOGw8YMjQbAv4xhW5MOAUTCAkRDBEHGg8DA3G6azoDAwIBAgcGHC0UPSRJP0UBAQMDAwtCLGtQHhoPGBYWCx4TERwGHj8sFhUVCAMFBgUFAh0KGBQBS1FeqnxJAAAABwCE//4DewMCAAcACwAPABMAFwAnACsAyLYGAQIJCAFAS7AbUFhARg4BAQABaAAJCAoKCV4AAAACAwACVwADAAQFAwRXAAUABgcFBlcABwAICQcIVw8BCgANDAoNWAAMCwsMSwAMDAtRAAsMC0UbQEcOAQEAAWgACQgKCAkKZgAAAAIDAAJXAAMABAUDBFcABQAGBwUGVwAHAAgJBwhXDwEKAA0MCg1YAAwLCwxLAAwMC1EACwwLRVlAJRoYAAArKikoIyAYJxonFxYVFBMSERAPDg0MCwoJCAAHAAcTEA8rARMHAyEDJxMXIRUhFSEVIRUhFSEVIRUhBSEiDgEfAR4BMyEyNj8BNgUjNTMDJDI5Lf4gLTkyYwGC/n4Bgv5+AYL+fgGC/n4CK/0sBwkDAlIDEgoCFAoSA1IH/t/CwgMC/lEHAYL+fgcBr2AwMTAwMTAwMQYKBvQKDQ0K9BZgMAAAAAACAAD/XwP/AwQAJgA6AGG1GwEBAgFAS7AaUFhAIAACBAEEAgFmAAMBA2kABAABAwQBWQAFBQBRAAAACgVCG0AlAAIEAQQCAWYAAwEDaQAAAAUEAAVZAAQCAQRNAAQEAVEAAQQBRVm3KCkVETkqBhQrLQEuASc2NTQmJyYjIgYHDgEVFBYXFjsBMjcyHwEFHgEyPgE/ATYmJQ4BIyYnLgE1NDc+ATMyFx4BFRQD4/7wAQIDJUVBaYpSmDcrLUVCaYgBeWQBAQEBEAoaGxoYCQYYBP5MKG07YkwvMkAnbTtjSy8yA+MBAQJPUVKYN1lGQTR9QlKZN1hIAgHjCQoHDwwHHEnuLzIBPyduO2NLMDE/KG07YwADAFX/LAOrAywAGgAoAEMAbEAJGRgQDAQBAAFAS7AaUFhAHQYECAMDAAABAwBZAAEABQEFVgACAgdRAAcHCgJCG0AjAAcAAgMHAlkGBAgDAwAAAQMAWQABBQUBTQABAQVSAAUBBUZZQBMbG0A+Ozk0MSwqGygbKCw+IwkRKyU0PgEzMhYVFA4CBx4CFxQOASsBIiY1NyYDNTQ+BDMyHgEdASUVIyIGFREUFjMhMjY1ETQmKwE1NCYjIg4CAasWKBcjMgULDgkBBAkECQ4JQA0TEidWDRYfJiwXLk8u/kBAJDIyJAKqJDIyJECiczhnSiyXFycXMiMLFhIPBgYUORsIDwkTDW4ZARmWFywmHxYMLU8ulpaWMiP+VSMyMiMBqyMylnOiLEpnAAQAwP/AA0ADQAAbACcAPwBRAExASUlAAgkIAUAAAAAEAQAEWQUKAwMBAAcIAQdZAAgACQYICVkABgICBk0ABgYCUgACBgJGAABOTUVDOjcuKycmIB4AGwAbNiUjCxErATUuASMiDgIHFSMiDgEVERQWMyEyPgE1ETQmJT4BMzIeAxcVIQEUDgEjISIuBDURNDYzITIeAxUHNTQmIyIOAR0BBhUUFjI2NTQDAQOVaDNdRSkCAREeESUbAgARHhEl/iYCcE4fOi4kFAH+gAG/CQ4J/kAECQcGBAITDQHABQoIBgPgEw0JDgkcIzIjAcCHaJEnQlwziBEeEf6AGyURHhEBgBomhU5tEyIuOR+F/mAJDgkCBAYHCQQBQA0TAwYICgWSNA0TCQ4JNBIhGSMjGSEAAAAAAQAAAAEAAJ+c+NxfDzz1AAsEAAAAAADSv50WAAAAANK/nRYAAP8sBQADgAAAAAgAAgAAAAAAAAABAAADgP8sAFwFAQAAAAAFAAABAAAAAAAAAAAAAAAAAAAADAF2ACIAAAAAAVUAAAPpACwEAAA6BAAAbAQAAEoEAABABAAAZwQAAEUFAQDpBAAASwBLAHQAQABAAFcAAAAAAAMAQQBAATIAEAAQAAAANwCAAEAAXwAAAIQAAABVAMAAAAAAACgAKAAoAWQBggHsAjwDWgPYBEAFRgWaBhgGZAdYCCYIlgl0CeAKygtiC8oMFAx2DNwNfg3yDkwO4A8aET4R8BJ6Ew4TpwABAAAAIwDvAAsAAAAAAAIANgBEAGwAAACsCZYAAAAAAAAADACWAAEAAAAAAAEACAAAAAEAAAAAAAIABgAIAAEAAAAAAAMAJAAOAAEAAAAAAAQACAAyAAEAAAAAAAUARgA6AAEAAAAAAAYACACAAAMAAQQJAAEAEACIAAMAAQQJAAIADACYAAMAAQQJAAMASACkAAMAAQQJAAQAEADsAAMAAQQJAAUAjAD8AAMAAQQJAAYAEAGIaWNvbmZvbnRNZWRpdW1Gb250Rm9yZ2UgMi4wIDogaWNvbmZvbnQgOiAxNi0xLTIwMTZpY29uZm9udFZlcnNpb24gMS4wIDsgdHRmYXV0b2hpbnQgKHYwLjk0KSAtbCA4IC1yIDUwIC1HIDIwMCAteCAxNCAtdyAiRyIgLWYgLXNpY29uZm9udABpAGMAbwBuAGYAbwBuAHQATQBlAGQAaQB1AG0ARgBvAG4AdABGAG8AcgBnAGUAIAAyAC4AMAAgADoAIABpAGMAbwBuAGYAbwBuAHQAIAA6ACAAMQA2AC0AMQAtADIAMAAxADYAaQBjAG8AbgBmAG8AbgB0AFYAZQByAHMAaQBvAG4AIAAxAC4AMAAgADsAIAB0AHQAZgBhAHUAdABvAGgAaQBuAHQAIAAoAHYAMAAuADkANAApACAALQBsACAAOAAgAC0AcgAgADUAMAAgAC0ARwAgADIAMAAwACAALQB4ACAAMQA0ACAALQB3ACAAIgBHACIAIAAtAGYAIAAtAHMAaQBjAG8AbgBmAG8AbgB0AAAAAgAAAAAAAP+DADIAAAAAAAAAAAAAAAAAAAAAAAAAAAAjAAAAAQACAFsBAgEDAQQBBQEGAQcBCAEJAQoBCwEMAQ0BDgEPARABEQESARMBFAEVARYBFwEYARkBGgEbARwBHQEeAR8BIAd1bmlFNjAwB3VuaUU2MDEHdW5pRTYwMgd1bmlFNjAzB3VuaUU2MDQHdW5pRTYwNQd1bmlFNjA2B3VuaUU2MDcHdW5pRTYwOAd1bmlFNjA5B3VuaUU2MEEHdW5pRTYwQgd1bmlFNjBDB3VuaUU2MEQHdW5pRTYwRQd1bmlFNjBGB3VuaUU2MTAHdW5pRTYxMQd1bmlFNjEyB3VuaUU2MTMHdW5pRTYxNAd1bmlFNjE1B3VuaUU2MTYHdW5pRTYxNwd1bmlFNjE4B3VuaUU2MTkHdW5pRTYxQQd1bmlFNjFCB3VuaUU2MUMHdW5pRTYxRAd1bmlFNjFFAAEAAf//AA8AAAAAAAAAAAAAAAAAAAAAADIAMgMY/+EDgP8sAxj/4QOA/yywACywIGBmLbABLCBkILDAULAEJlqwBEVbWCEjIRuKWCCwUFBYIbBAWRsgsDhQWCGwOFlZILAKRWFksChQWCGwCkUgsDBQWCGwMFkbILDAUFggZiCKimEgsApQWGAbILAgUFghsApgGyCwNlBYIbA2YBtgWVlZG7AAK1lZI7AAUFhlWVktsAIsIEUgsAQlYWQgsAVDUFiwBSNCsAYjQhshIVmwAWAtsAMsIyEjISBksQViQiCwBiNCsgoAAiohILAGQyCKIIqwACuxMAUlilFYYFAbYVJZWCNZISCwQFNYsAArGyGwQFkjsABQWGVZLbAELLAII0KwByNCsAAjQrAAQ7AHQ1FYsAhDK7IAAQBDYEKwFmUcWS2wBSywAEMgRSCwAkVjsAFFYmBELbAGLLAAQyBFILAAKyOxBAQlYCBFiiNhIGQgsCBQWCGwABuwMFBYsCAbsEBZWSOwAFBYZVmwAyUjYURELbAHLLEFBUWwAWFELbAILLABYCAgsApDSrAAUFggsAojQlmwC0NKsABSWCCwCyNCWS2wCSwguAQAYiC4BABjiiNhsAxDYCCKYCCwDCNCIy2wCixLVFixBwFEWSSwDWUjeC2wCyxLUVhLU1ixBwFEWRshWSSwE2UjeC2wDCyxAA1DVVixDQ1DsAFhQrAJK1mwAEOwAiVCsgABAENgQrEKAiVCsQsCJUKwARYjILADJVBYsABDsAQlQoqKIIojYbAIKiEjsAFhIIojYbAIKiEbsABDsAIlQrACJWGwCCohWbAKQ0ewC0NHYLCAYiCwAkVjsAFFYmCxAAATI0SwAUOwAD6yAQEBQ2BCLbANLLEABUVUWACwDSNCIGCwAWG1Dg4BAAwAQkKKYLEMBCuwaysbIlktsA4ssQANKy2wDyyxAQ0rLbAQLLECDSstsBEssQMNKy2wEiyxBA0rLbATLLEFDSstsBQssQYNKy2wFSyxBw0rLbAWLLEIDSstsBcssQkNKy2wGCywByuxAAVFVFgAsA0jQiBgsAFhtQ4OAQAMAEJCimCxDAQrsGsrGyJZLbAZLLEAGCstsBossQEYKy2wGyyxAhgrLbAcLLEDGCstsB0ssQQYKy2wHiyxBRgrLbAfLLEGGCstsCAssQcYKy2wISyxCBgrLbAiLLEJGCstsCMsIGCwDmAgQyOwAWBDsAIlsAIlUVgjIDywAWAjsBJlHBshIVktsCQssCMrsCMqLbAlLCAgRyAgsAJFY7ABRWJgI2E4IyCKVVggRyAgsAJFY7ABRWJgI2E4GyFZLbAmLLEABUVUWACwARawJSqwARUwGyJZLbAnLLAHK7EABUVUWACwARawJSqwARUwGyJZLbAoLCA1sAFgLbApLACwA0VjsAFFYrAAK7ACRWOwAUVisAArsAAWtAAAAAAARD4jOLEoARUqLbAqLCA8IEcgsAJFY7ABRWJgsABDYTgtsCssLhc8LbAsLCA8IEcgsAJFY7ABRWJgsABDYbABQ2M4LbAtLLECABYlIC4gR7AAI0KwAiVJiopHI0cjYSBYYhshWbABI0KyLAEBFRQqLbAuLLAAFrAEJbAEJUcjRyNhsAZFK2WKLiMgIDyKOC2wLyywABawBCWwBCUgLkcjRyNhILAEI0KwBkUrILBgUFggsEBRWLMCIAMgG7MCJgMaWUJCIyCwCUMgiiNHI0cjYSNGYLAEQ7CAYmAgsAArIIqKYSCwAkNgZCOwA0NhZFBYsAJDYRuwA0NgWbADJbCAYmEjICCwBCYjRmE4GyOwCUNGsAIlsAlDRyNHI2FgILAEQ7CAYmAjILAAKyOwBENgsAArsAUlYbAFJbCAYrAEJmEgsAQlYGQjsAMlYGRQWCEbIyFZIyAgsAQmI0ZhOFktsDAssAAWICAgsAUmIC5HI0cjYSM8OC2wMSywABYgsAkjQiAgIEYjR7AAKyNhOC2wMiywABawAyWwAiVHI0cjYbAAVFguIDwjIRuwAiWwAiVHI0cjYSCwBSWwBCVHI0cjYbAGJbAFJUmwAiVhsAFFYyMgWGIbIVljsAFFYmAjLiMgIDyKOCMhWS2wMyywABYgsAlDIC5HI0cjYSBgsCBgZrCAYiMgIDyKOC2wNCwjIC5GsAIlRlJYIDxZLrEkARQrLbA1LCMgLkawAiVGUFggPFkusSQBFCstsDYsIyAuRrACJUZSWCA8WSMgLkawAiVGUFggPFkusSQBFCstsDcssC4rIyAuRrACJUZSWCA8WS6xJAEUKy2wOCywLyuKICA8sAQjQoo4IyAuRrACJUZSWCA8WS6xJAEUK7AEQy6wJCstsDkssAAWsAQlsAQmIC5HI0cjYbAGRSsjIDwgLiM4sSQBFCstsDossQkEJUKwABawBCWwBCUgLkcjRyNhILAEI0KwBkUrILBgUFggsEBRWLMCIAMgG7MCJgMaWUJCIyBHsARDsIBiYCCwACsgiophILACQ2BkI7ADQ2FkUFiwAkNhG7ADQ2BZsAMlsIBiYbACJUZhOCMgPCM4GyEgIEYjR7AAKyNhOCFZsSQBFCstsDsssC4rLrEkARQrLbA8LLAvKyEjICA8sAQjQiM4sSQBFCuwBEMusCQrLbA9LLAAFSBHsAAjQrIAAQEVFBMusCoqLbA+LLAAFSBHsAAjQrIAAQEVFBMusCoqLbA/LLEAARQTsCsqLbBALLAtKi2wQSywABZFIyAuIEaKI2E4sSQBFCstsEIssAkjQrBBKy2wQyyyAAA6Ky2wRCyyAAE6Ky2wRSyyAQA6Ky2wRiyyAQE6Ky2wRyyyAAA7Ky2wSCyyAAE7Ky2wSSyyAQA7Ky2wSiyyAQE7Ky2wSyyyAAA3Ky2wTCyyAAE3Ky2wTSyyAQA3Ky2wTiyyAQE3Ky2wTyyyAAA5Ky2wUCyyAAE5Ky2wUSyyAQA5Ky2wUiyyAQE5Ky2wUyyyAAA8Ky2wVCyyAAE8Ky2wVSyyAQA8Ky2wViyyAQE8Ky2wVyyyAAA4Ky2wWCyyAAE4Ky2wWSyyAQA4Ky2wWiyyAQE4Ky2wWyywMCsusSQBFCstsFwssDArsDQrLbBdLLAwK7A1Ky2wXiywABawMCuwNistsF8ssDErLrEkARQrLbBgLLAxK7A0Ky2wYSywMSuwNSstsGIssDErsDYrLbBjLLAyKy6xJAEUKy2wZCywMiuwNCstsGUssDIrsDUrLbBmLLAyK7A2Ky2wZyywMysusSQBFCstsGgssDMrsDQrLbBpLLAzK7A1Ky2waiywMyuwNistsGssK7AIZbADJFB4sAEVMC0AAEu4AMhSWLEBAY5ZuQgACABjILABI0QgsAMjcLAORSAgS7gADlFLsAZTWliwNBuwKFlgZiCKVViwAiVhsAFFYyNisAIjRLMKCQUEK7MKCwUEK7MODwUEK1myBCgJRVJEswoNBgQrsQYBRLEkAYhRWLBAiFixBgNEsSYBiFFYuAQAiFixBgFEWVlZWbgB/4WwBI2xBQBEAAAA"
  20240. /***/ },
  20241. /* 202 */
  20242. /***/ function(module, exports) {
  20243. module.exports = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/Pgo8IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiID4KPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8bWV0YWRhdGE+CkNyZWF0ZWQgYnkgRm9udEZvcmdlIDIwMTIwNzMxIGF0IFNhdCBKYW4gMTYgMTU6MDk6MTAgMjAxNgogQnkgQWRzCjwvbWV0YWRhdGE+CjxkZWZzPgo8Zm9udCBpZD0iaWNvbmZvbnQiIGhvcml6LWFkdi14PSIxMDI0IiA+CiAgPGZvbnQtZmFjZSAKICAgIGZvbnQtZmFtaWx5PSJpY29uZm9udCIKICAgIGZvbnQtd2VpZ2h0PSI1MDAiCiAgICBmb250LXN0cmV0Y2g9Im5vcm1hbCIKICAgIHVuaXRzLXBlci1lbT0iMTAyNCIKICAgIHBhbm9zZS0xPSIyIDAgNiAzIDAgMCAwIDAgMCAwIgogICAgYXNjZW50PSI4OTYiCiAgICBkZXNjZW50PSItMTI4IgogICAgeC1oZWlnaHQ9Ijc5MiIKICAgIGJib3g9IjAgLTIxMiAxMDI0IDg5NiIKICAgIHVuZGVybGluZS10aGlja25lc3M9IjUwIgogICAgdW5kZXJsaW5lLXBvc2l0aW9uPSItMTAwIgogICAgdW5pY29kZS1yYW5nZT0iVSswMDc4LUU2MUUiCiAgLz4KPG1pc3NpbmctZ2x5cGggaG9yaXotYWR2LXg9IjM3NCIgCmQ9Ik0zNCAwdjY4MmgyNzJ2LTY4MmgtMjcyek02OCAzNGgyMDR2NjE0aC0yMDR2LTYxNHoiIC8+CiAgICA8Z2x5cGggZ2x5cGgtbmFtZT0iLm5vdGRlZiIgaG9yaXotYWR2LXg9IjM3NCIgCmQ9Ik0zNCAwdjY4MmgyNzJ2LTY4MmgtMjcyek02OCAzNGgyMDR2NjE0aC0yMDR2LTYxNHoiIC8+CiAgICA8Z2x5cGggZ2x5cGgtbmFtZT0iLm51bGwiIGhvcml6LWFkdi14PSIwIiAKIC8+CiAgICA8Z2x5cGggZ2x5cGgtbmFtZT0ibm9ubWFya2luZ3JldHVybiIgaG9yaXotYWR2LXg9IjM0MSIgCiAvPgogICAgPGdseXBoIGdseXBoLW5hbWU9IngiIHVuaWNvZGU9IngiIGhvcml6LWFkdi14PSIxMDAxIiAKZD0iTTI4MSA1NDNxLTI3IC0xIC01MyAtMWgtODNxLTE4IDAgLTM2LjUgLTZ0LTMyLjUgLTE4LjV0LTIzIC0zMnQtOSAtNDUuNXYtNzZoOTEydjQxcTAgMTYgLTAuNSAzMHQtMC41IDE4cTAgMTMgLTUgMjl0LTE3IDI5LjV0LTMxLjUgMjIuNXQtNDkuNSA5aC0xMzN2LTk3aC00Mzh2OTd6TTk1NSAzMTB2LTUycTAgLTIzIDAuNSAtNTJ0MC41IC01OHQtMTAuNSAtNDcuNXQtMjYgLTMwdC0zMyAtMTZ0LTMxLjUgLTQuNXEtMTQgLTEgLTI5LjUgLTAuNQp0LTI5LjUgMC41aC0zMmwtNDUgMTI4aC00MzlsLTQ0IC0xMjhoLTI5aC0zNHEtMjAgMCAtNDUgMXEtMjUgMCAtNDEgOS41dC0yNS41IDIzdC0xMy41IDI5LjV0LTQgMzB2MTY3aDkxMXpNMTYzIDI0N3EtMTIgMCAtMjEgLTguNXQtOSAtMjEuNXQ5IC0yMS41dDIxIC04LjVxMTMgMCAyMiA4LjV0OSAyMS41dC05IDIxLjV0LTIyIDguNXpNMzE2IDEyM3EtOCAtMjYgLTE0IC00OHEtNSAtMTkgLTEwLjUgLTM3dC03LjUgLTI1dC0zIC0xNXQxIC0xNC41CnQ5LjUgLTEwLjV0MjEuNSAtNGgzN2g2N2g4MWg4MGg2NGgzNnEyMyAwIDM0IDEydDIgMzhxLTUgMTMgLTkuNSAzMC41dC05LjUgMzQuNXEtNSAxOSAtMTEgMzloLTM2OHpNMzM2IDQ5OHYyMjhxMCAxMSAyLjUgMjN0MTAgMjEuNXQyMC41IDE1LjV0MzQgNmgxODhxMzEgMCA1MS41IC0xNC41dDIwLjUgLTUyLjV2LTIyN2gtMzI3eiIgLz4KICAgIDxnbHlwaCBnbHlwaC1uYW1lPSJ1bmlFNjAwIiB1bmljb2RlPSImI3hlNjAwOyIgCmQ9Ik00ODggNzQ1bDEzMiAtMjY5bDI5NyAtNDNsLTIxNSAtMjA5bDUxIC0yOTZsLTI2NSAxNDBsLTI2NiAtMTQwbDUxIDI5NmwtMjE1IDIwOWwyOTcgNDN6IiAvPgogICAgPGdseXBoIGdseXBoLW5hbWU9InVuaUU2MDEiIHVuaWNvZGU9IiYjeGU2MDE7IiAKZD0iTTUxMiAtMjBxLTExMCAwIC0yMDMgNTR0LTE0NyAxNDd0LTU0IDIwM3Q1NCAyMDN0MTQ3IDE0N3QyMDMgNTR0MjAzIC01NHQxNDcgLTE0N3Q1NCAtMjAzdC01NCAtMjAzdC0xNDcgLTE0N3QtMjAzIC01NHpNNTY3IDYwNXEwIDcgLTUuNSAxMi41dC0xMi41IDUuNWgtNzRxLTcgMCAtMTIuNSAtNS41dC01LjUgLTEyLjV2LTc0cTAgLTQgMS41IC03dDQgLTUuNXQ1LjUgLTR0NyAtMS41aDc0cTcgMCAxMi41IDV0NS41IDEzdjc0ek01NjcgNDAyCnEwIDUgLTIuNSA5LjV0LTYuNSA3dC05IDIuNWgtNzRxLTcgMCAtMTIuNSAtNS41dC01LjUgLTEzLjV2LTIzOXEwIC01IDIuNSAtOXQ2LjUgLTYuNXQ5IC0yLjVoNzRxNyAwIDEyLjUgNS41dDUuNSAxMi41djIzOXoiIC8+CiAgICA8Z2x5cGggZ2x5cGgtbmFtZT0idW5pRTYwMiIgdW5pY29kZT0iJiN4ZTYwMjsiIApkPSJNMTc0LjUgNTAxcS00MS41IDAgLTcxIC0yOS41dC0yOS41IC03MS41cTAgLTI3IDEzLjUgLTUwLjV0MzYuNSAtMzd0NTAuNSAtMTMuNXQ1MSAxMy41dDM3IDM3dDEzLjUgNTAuNXEwIDQyIC0zMCA3MS41dC03MS41IDI5LjV6TTUxMSA1MDFxLTQyIDAgLTcxLjUgLTI5LjV0LTI5LjUgLTcxLjVxMCAtMjcgMTMuNSAtNTAuNXQzNyAtMzd0NTAuNSAtMTMuNXE0MiAwIDcxLjUgMjkuNXQyOS41IDcxLjVxMCAxMCAtMiAyMHQtNiAxOQp0LTkuNSAxNy41dC0xMiAxNXQtMTQuNSAxMnQtMTcgOS41dC0xOSA2dC0yMSAyek04NDggNTAxcS00MiAwIC03MS41IC0yOS41dC0yOS41IC03MS41dDI5LjUgLTcxLjV0NzEuNSAtMjkuNXQ3MS41IDI5LjV0MjkuNSA3MS41dC0yOS41IDcxLjV0LTcxLjUgMjkuNXoiIC8+CiAgICA8Z2x5cGggZ2x5cGgtbmFtZT0idW5pRTYwMyIgdW5pY29kZT0iJiN4ZTYwMzsiIApkPSJNNjAxIDgzMGgtMTc5cS0xMiAwIC0yMSAtOXQtOSAtMjF2LTE3OXEwIC0xMiA5IC0yMXQyMSAtOWgxNzlxMTIgMCAyMSA5dDkgMjF2MTc5cTAgNiAtMi41IDExLjV0LTYuNSA5LjV0LTkuNSA2LjV0LTExLjUgMi41ek05MjkgODMwaC0xNzlxLTEyIDAgLTIxIC05dC05IC0yMXYtMTc5cTAgLTEyIDkgLTIxdDIxIC05aDE3OXE4IDAgMTUgNHQxMSAxMXQ0IDE1djE3OXEwIDEyIC05IDIxdC0yMSA5ek0yNzMgODMwaC0xNzlxLTEyIDAgLTIxIC05CnQtOSAtMjF2LTE3OXEwIC0xMiA5IC0yMXQyMSAtOWgxNzlxNiAwIDExLjUgMi41dDkuNSA2LjV0Ni41IDkuNXQyLjUgMTEuNXYxNzlxMCAzIC0xIDYuNXQtMi41IDYuNXQtMy41IDUuNXQtNC41IDQuNXQtNS41IDMuNXQtNi41IDIuNXQtNi41IDF6TTYwMSA1MDJoLTE3OXEtMTIgMCAtMjEgLTl0LTkgLTIxdi0xNzlxMCAtMTMgOSAtMjEuNXQyMSAtOC41aDE3OXExMiAwIDIxIDguNXQ5IDIxLjV2MTc5cTAgNiAtMi41IDExLjV0LTYuNSA5LjUKdC05LjUgNi41dC0xMS41IDIuNXpNOTI5IDUwMmgtMTc5cS0xMiAwIC0yMSAtOXQtOSAtMjF2LTE3OXEwIC04IDQgLTE1dDExIC0xMXQxNSAtNGgxNzlxOCAwIDE1IDR0MTEgMTF0NCAxNXYxNzlxMCAxMiAtOSAyMXQtMjEgOXpNMjczIDUwMmgtMTc5cS04IDAgLTE1IC00dC0xMSAtMTF0LTQgLTE1di0xNzlxMCAtMTMgOSAtMjEuNXQyMSAtOC41aDE3OXExMiAwIDIxIDguNXQ5IDIxLjV2MTc5cTAgOCAtNCAxNXQtMTEgMTF0LTE1IDR6TTYwMSAxNzQKaC0xNzlxLTEyIDAgLTIxIC05dC05IC0yMXYtMTc5cTAgLTEzIDkgLTIxLjV0MjEgLTguNWgxNzlxNiAwIDExLjUgMi41dDkuNSA2LjV0Ni41IDkuNXQyLjUgMTEuNXYxNzlxMCA2IC0yLjUgMTEuNXQtNi41IDkuNXQtOS41IDYuNXQtMTEuNSAyLjV6TTkyOSAxNzRoLTE3OXEtOCAwIC0xNSAtNHQtMTEgLTExdC00IC0xNXYtMTc5cTAgLTEzIDkgLTIxLjV0MjEgLTguNWgxNzlxMTIgMCAyMSA4LjV0OSAyMS41djE3OXEwIDEyIC05IDIxdC0yMSA5egpNMjczIDE3NGgtMTc5cS02IDAgLTExLjUgLTIuNXQtOS41IC02LjV0LTYuNSAtOS41dC0yLjUgLTExLjV2LTE3OXEwIC04IDQgLTE1dDExIC0xMXQxNSAtNGgxNzlxMTIgMCAyMSA4LjV0OSAyMS41djE3OXEwIDggLTQgMTV0LTExIDExdC0xNSA0eiIgLz4KICAgIDxnbHlwaCBnbHlwaC1uYW1lPSJ1bmlFNjA0IiB1bmljb2RlPSImI3hlNjA0OyIgCmQ9Ik01MTIgNzA5cS01NiAwIC0xMDkgLTE0LjV0LTk4IC00MXQtODIuNSAtNjR0LTY0IC04Mi41dC00MSAtOTh0LTE0LjUgLTEwOXEwIC0xMTEgNTQuNSAtMjA1LjV0MTQ5IC0xNDl0MjA1LjUgLTU0LjV0MjA1LjUgNTQuNXQxNDkgMTQ5dDU0LjUgMjA1LjV0LTU0LjUgMjA1LjV0LTE0OSAxNDl0LTIwNS41IDU0LjV6TTM3NiAyNTNxMCAtMSA1IC02bDkgLTlxNCAtNCAxMCAtNy41dDEwIC0zLjVxMTYgMCAxMDkgMTA0bDEzOCAxNThxNCA1IDcgNi41CnQ4IDIuNXE1IDAgMTEuNSAtMnQ5LjUgLTVsNDUgLTQ0cTcgLTggOCAtMThxMCAtNiAtMiAtMTAuNXQtNSAtOC41bC0yNTAgLTI2NGwtNTMgLTU3cS0zIC0zIC04IC01LjV0LTEwIC0yLjVxLTMgMCAtNi41IDF0LTYuNSAyLjV0LTUgMy41bC0xNTEgMTQycS0yIDIgLTMuNSA0dC0yLjUgNHQtMS41IDQuNXQtMC41IDUuNXEtMSAxMSA3IDE5bDM1IDM3cTcgOCAxOCA4LjV0MTkgLTcuNXoiIC8+CiAgICA8Z2x5cGggZ2x5cGgtbmFtZT0idW5pRTYwNSIgdW5pY29kZT0iJiN4ZTYwNTsiIApkPSJNNTE1IDE0NXEtMzYgMCAtNzEgLTEydC02NCAtNDF0LTM2IC02OWgzMzhxLTUgNTMgLTU3IDg3LjV0LTExMCAzNC41ek05NTUgMTU3cS0zIDI2NSAwIDUyOHEwIDM0IC0xMi41IDQ3dC00Ni41IDEzcS00NSAtMSAtMzg0IC0xdC0zOTAgMXEtMjggMCAtNDAuNSAtMTF0LTEyLjUgLTM5cTEgLTIzMSAwIC01NDRxMCAtMTggNC41IC0yOS41dDE2IC0xNy41dDMwLjUgLTVxMzUgMSAxMDcgMC41dDEwNyAwLjVxMjUgMSA0OCAxNwpxNTYgNDAgMTE1LjUgNDV0MTE2LjUgLTI4cTYzIC0zNyAxNTAgLTM1cTk0IDIgMTMyIDBxMzMgLTIgNDYgMTF0MTMgNDd6TTg5MiAyMTNoLTc2MHY0NTZoNzYwdi00NTZ6IiAvPgogICAgPGdseXBoIGdseXBoLW5hbWU9InVuaUU2MDYiIHVuaWNvZGU9IiYjeGU2MDY7IiBob3Jpei1hZHYteD0iMTI4MSIgCmQ9Ik0xMjgwIDQyMnpNNDkyIC03cTIgLTEgMy41IC0ydDUuNSAtNS41dDUuNSAtOS41dC0xLjUgLTExLjV0LTEyIC0xMy41aC00OWgtNjhoLTM0cS00IDAgLTEwLjUgMS41dC0yNC41IDkuNXQtMzIgMjAuNXQtMjYuNSAzOHQtMTUuNSA1OC41djM5N2w3IDM1cTI1IDgyIDEwMCA5NGgzNDFsMjcgLThxNzQgLTMyIDgwIC0xMjh2LTMzN3EtMSAtNCAtMi41IC0xMS41dC0xMS41IC0yOS41dC0yNC41IC00M3QtNDMgLTQ4dC02NS41IC00OWgtMWgtMwpoLTVoLTZoLTZoLTZoLTZoLTNoLTFxLTEgMCAtMiAwLjV0LTMuNSAyLjV0LTQuNSA0LjV0LTQgN3QtMiA5LjV2MzJxMCAxOSAxIDM3djE4cTAgMSAwLjUgNHQyLjUgMTF0NSAxNXQ5LjUgMTd0MTQgMTcuNXQyMCAxMy41dDI3LjUgOWg4MXYzMjZxMCAzIC0xIDguNXQtNS41IDIwdC0xMS41IDI1LjV0LTIxIDIxLjV0LTMyIDEyLjVoLTMzMnEtMyAwIC03LjUgLTF0LTE2LjUgLTZ0LTIxIC0xMy41dC0xNy41IC0yNy41dC0xMC41IC00NGwtMSAtMzg2Cmw3IC0zMnExOSAtNTMgNjcgLTYwaDQwaDQwaDM0aDI0aDh6TTczNiAxMDZoLTcwcS0zNCAtMTAgLTM4IC00OXYtNjNsOCAtMXE1IDAgMzQgMjlxMzcgMzcgNjYgODR6TTY1MSA0MzBxMCAtMTAgLTcuNSAtMTcuNXQtMTcuNSAtNy41aC0yMjFxLTcgMCAtMTMgMy41dC05IDl0LTMgMTIuNXEwIDExIDcuNSAxOC41dDE3LjUgNy41aDIyMXE3IDAgMTMgLTMuNXQ5IC05LjV0MyAtMTN6TTY1MiAyODJxMCAtMTEgLTcuNSAtMTguNXQtMTguNSAtNy41CmgtMjIwcS0xMSAwIC0xOC41IDcuNXQtNy41IDE4LjV0Ny41IDE4LjV0MTguNSA3LjVoMjIwcTExIDAgMTguNSAtNy41dDcuNSAtMTguNXpNNTI0IDEzM3EwIC0xMSAtNy41IC0xOXQtMTguNSAtOGgtOTFxLTExIDAgLTE5IDh0LTggMTl0OCAxOXQxOSA4aDkxcTExIDAgMTguNSAtOHQ3LjUgLTE5eiIgLz4KICAgIDxnbHlwaCBnbHlwaC1uYW1lPSJ1bmlFNjA3IiB1bmljb2RlPSImI3hlNjA3OyIgCmQ9Ik05NDMgMTI3bC0zNDEgNjA5cS0zNSA2MyAtOTAuNSA2M3QtOTAuNSAtNjNsLTM0MCAtNjA5cS0zNCAtNjIgLTYgLTExMXEyOSAtNDggMTAwIC00OGg2NzRxNzEgMCA5OS41IDQ4LjV0LTUuNSAxMTAuNXpNNDgwIDU3NnEwIDEzIDkuNSAyMi41dDIyLjUgOS41dDIyLjUgLTkuNXQ5LjUgLTIyLjV2LTI4OHEwIC0xMyAtOS41IC0yMi41dC0yMi41IC05LjV0LTIyLjUgOS41dC05LjUgMjIuNXYyODh6TTUxMiA2NHEtMTMgMCAtMjQgNi41CnQtMTcuNSAxNy41dC02LjUgMjRxMCAyMCAxNCAzNHQzNCAxNHQzNCAtMTR0MTQgLTM0dC0xNCAtMzR0LTM0IC0xNHoiIC8+CiAgICA8Z2x5cGggZ2x5cGgtbmFtZT0idW5pRTYwOCIgdW5pY29kZT0iJiN4ZTYwODsiIApkPSJNODQ5IC0zM2gtNjc0cS03MSAwIC05OS41IDQ5dDUuNSAxMTFsMzQwIDYwOXEzNSA2MyA5MSA2M3ExMyAwIDI1LjUgLTR0MjQgLTEydDIyIC0yMHQxOC41IC0yN2wzNDEgLTYwOXEzNCAtNjMgNS41IC0xMTEuNXQtOTkuNSAtNDguNXpNNTEyIDczNXEtOSAwIC0xOCAtOHQtMTcgLTIybC0zNDAgLTYxMHEtMTcgLTMwIC03IC00N3Q0NSAtMTdoNjc0cTM1IDAgNDUgMTd0LTcgNDdsLTM0MSA2MTBxLTE2IDMwIC0zNCAzMHpNNTEyIDI1NgpxLTEzIDAgLTIyLjUgOS41dC05LjUgMjIuNXYyODhxMCAxMyA5LjUgMjIuNXQyMi41IDkuNXQyMi41IC05LjV0OS41IC0yMi41di0yODhxMCAtMTMgLTkuNSAtMjIuNXQtMjIuNSAtOS41ek01MTIgMTQ0ek00NjQgMTQ0cTAgMjAgMTQgMzR0MzQgMTRxMTMgMCAyNCAtNi41dDE3LjUgLTE3LjV0Ni41IC0yNHEwIC0yMCAtMTQgLTM0dC0zNCAtMTR0LTM0IDE0dC0xNCAzNHoiIC8+CiAgICA8Z2x5cGggZ2x5cGgtbmFtZT0idW5pRTYwOSIgdW5pY29kZT0iJiN4ZTYwOTsiIApkPSJNMzg0IDNsLTE2OSAxNjlxLTQgMyAtNS41IDguNXQwIDEwLjV0NS41IDlsMzgwIDM4MHE0IDQgOSA1dDEwIDB0OSAtNWwxNjkgLTE2OXE0IC00IDUgLTl0MCAtMTB0LTUgLTlsLTM4MCAtMzgwcS02IC02IC0xNC41IC02dC0xMy41IDZ6TTY5MyA2NzhxMTggMTggNDIuNSAxOHQ0Mi41IC0xOGwxMTIgLTExMnExOCAtMTggMTggLTQyLjV0LTE4IC00Mi41bC01NiAtNTZsLTE5NyAxOTd6TTExNiAtOTZsNTYgMjU0bDE5OCAtMTk4eiIgLz4KICAgIDxnbHlwaCBnbHlwaC1uYW1lPSJ1bmlFNjBBIiB1bmljb2RlPSImI3hlNjBhOyIgCmQ9Ik03NjggMTA4djM4NGgtNjR2LTM4NGgtMTYwbDE5MiAtMTkybDE5MiAxOTJoLTE2MHpNMzIwIDU1NnYtMTkyaC0xOTJ2MTkyaDE5MnpNMzg0IDYyMGgtMzIwdi0zMjBoMzIwdjMyMHpNNjQgMTcyaDk2di02NGgtOTZ2NjR6TTE5MiAxNzJoOTZ2LTY0aC05NnY2NHpNMzIwIDE3Mmg2NHYtOTZoLTY0djk2ek02NCAtNTJoNjR2LTk2aC02NHY5NnpNMTYwIC04NGg5NnYtNjRoLTk2djY0ek0yODggLTg0aDk2di02NGgtOTZ2NjR6TTY0IDc2aDY0CnYtOTZoLTY0djk2ek0zMjAgNDRoNjR2LTk2aC02NHY5NnoiIC8+CiAgICA8Z2x5cGggZ2x5cGgtbmFtZT0idW5pRTYwQiIgdW5pY29kZT0iJiN4ZTYwYjsiIApkPSJNNzA0IDMwMHYtMzg0aDY0djM4NGgxNjBsLTE5MiAxOTJsLTE5MiAtMTkyaDE2MHpNNjQgNjIwaDk2di02NGgtOTZ2NjR6TTE5MiA2MjBoOTZ2LTY0aC05NnY2NHpNMzIwIDYyMGg2NHYtOTZoLTY0djk2ek02NCAzOTZoNjR2LTk2aC02NHY5NnpNMTYwIDM2NGg5NnYtNjRoLTk2djY0ek0yODggMzY0aDk2di02NGgtOTZ2NjR6TTY0IDUyNGg2NHYtOTZoLTY0djk2ek0zMjAgNDkyaDY0di05NmgtNjR2OTZ6TTMyMCAxMDh2LTE5MmgtMTkydjE5MgpoMTkyek0zODQgMTcyaC0zMjB2LTMyMGgzMjB2MzIweiIgLz4KICAgIDxnbHlwaCBnbHlwaC1uYW1lPSJ1bmlFNjBDIiB1bmljb2RlPSImI3hlNjBjOyIgCmQ9Ik01MTIgLTQxcS0xMTUgMCAtMjEzIDU3dC0xNTUgMTU1dC01NyAyMTN0NTcgMjEzdDE1NSAxNTV0MjEzIDU3dDIxMyAtNTd0MTU1IC0xNTV0NTcgLTIxM3QtNTcgLTIxM3QtMTU1IC0xNTV0LTIxMyAtNTd6TTcyNCA0MjZoLTE3MHYxNzBoLTg0di0xNzBoLTE3MHYtODRoMTcwdi0xNzBoODR2MTcwaDE3MHY4NHoiIC8+CiAgICA8Z2x5cGggZ2x5cGgtbmFtZT0idW5pRTYwRCIgdW5pY29kZT0iJiN4ZTYwZDsiIApkPSJNODMyIDgxMmgtNjQwcS04MCAwIC0xMzYgLTU2dC01NiAtMTM2di02NDBxMCAtNzkgNTYgLTEzNS41dDEzNiAtNTYuNWg2NDBxNzkgMCAxMzUuNSA1Ni41dDU2LjUgMTM1LjV2NjQwcTAgODAgLTU2LjUgMTM2dC0xMzUuNSA1NnpNMTYwIC04NHEtMTMgMCAtMjIuNSA5LjV0LTkuNSAyMi41dDkuNSAyMi41dDIyLjUgOS41dDIyLjUgLTkuNXQ5LjUgLTIyLjV0LTkuNSAtMjIuNXQtMjIuNSAtOS41ek0xNjAgNjIwcS0xMyAwIC0yMi41IDkuNQp0LTkuNSAyMi41dDkuNSAyMi41dDIyLjUgOS41dDIyLjUgLTkuNXQ5LjUgLTIyLjV0LTkuNSAtMjIuNXQtMjIuNSAtOS41ek03MDQgLTIwcTAgLTI3IC0xOC41IC00NS41dC00NS41IC0xOC41aC0yNTZxLTI3IDAgLTQ1LjUgMTguNXQtMTguNSA0NS41djY0MHEwIDI2IDE5IDQ1dDQ1IDE5aDI1NnEyNyAwIDQ1LjUgLTE4LjV0MTguNSAtNDUuNXYtNjQwek04NjQgLTg0cS0xMyAwIC0yMi41IDkuNXQtOS41IDIyLjV0OS41IDIyLjV0MjIuNSA5LjUKdDIyLjUgLTkuNXQ5LjUgLTIyLjV0LTkuNSAtMjIuNXQtMjIuNSAtOS41ek04NjQgNjIwcS0xMyAwIC0yMi41IDkuNXQtOS41IDIyLjV0OS41IDIyLjV0MjIuNSA5LjV0MjIuNSAtOS41dDkuNSAtMjIuNXQtOS41IC0yMi41dC0yMi41IC05LjV6TTU3NiAzMDBoLTEyOHEtMjYgMCAtNDUgLTE5dC0xOSAtNDV2LTE5MnEwIC0yNyAxOC41IC00NS41dDQ1LjUgLTE4LjVoMTI4cTI3IDAgNDUuNSAxOC41dDE4LjUgNDUuNXYxOTIKcTAgMjcgLTE4LjUgNDUuNXQtNDUuNSAxOC41eiIgLz4KICAgIDxnbHlwaCBnbHlwaC1uYW1lPSJ1bmlFNjBFIiB1bmljb2RlPSImI3hlNjBlOyIgCmQ9Ik02NTcgMTcxcTAgMTUgLTExIDI2bC0xMDQgMTAzbDEwNCAxMDNxMTEgMTEgMTEgMjZxMCAxNiAtMTEgMjZsLTUyIDUycS0xMSAxMSAtMjYgMTF0LTI2IC0xMWwtMTAzIC0xMDRsLTEwNCAxMDRxLTEwIDExIC0yNSAxMXEtMTYgMCAtMjcgLTExbC01MSAtNTJxLTExIC0xMCAtMTEgLTI2cTAgLTE1IDExIC0yNmwxMDMgLTEwM2wtMTAzIC0xMDNxLTExIC0xMSAtMTEgLTI2cTAgLTE2IDExIC0yNmw1MSAtNTJxMTEgLTExIDI3IC0xMQpxMTUgMCAyNSAxMWwxMDQgMTA0bDEwMyAtMTA0cTExIC0xMSAyNiAtMTF0MjYgMTFsNTIgNTJxMTEgMTAgMTEgMjZ6TTg3OCAzMDBxMCAtMTE5IC01OSAtMjIwdC0xNjAgLTE2MHQtMjIwLjUgLTU5dC0yMjAgNTl0LTE1OS41IDE2MHQtNTkgMjIwdDU5IDIyMHQxNTkuNSAxNjB0MjIwIDU5dDIyMC41IC01OXQxNjAgLTE2MHQ1OSAtMjIweiIgLz4KICAgIDxnbHlwaCBnbHlwaC1uYW1lPSJ1bmlFNjBGIiB1bmljb2RlPSImI3hlNjBmOyIgCmQ9Ik0xMDA4IDMzMGwtMTU2IDE1NXEtOSA5IC0yMSAxMi41dC0yNCAwdC0yMSAtMTIuNXEtMTQgLTEzIC0xNCAtMzIuNXQxNCAtMzMuNWw3NiAtNzZoLTMwM3YzMDlsNzYgLTc1cTE0IC0xNCAzMy41IC0xNHQzMi41IDEzcTkgOSAxMi41IDIxLjV0MCAyNC41dC0xMi41IDIxbC0xNTUgMTU1cS03IDcgLTE1LjUgMTAuNXQtMTcuNSAzLjVxLTIwIDAgLTMzIC0xNGwtMTU2IC0xNTVxLTkgLTkgLTEyLjUgLTIxdDAgLTI0LjV0MTIuNSAtMjEuNQpxMTMgLTEzIDMyLjUgLTEzdDMzLjUgMTNsNzYgNzZ2LTMwOWgtMzA0bDc2IDc2cTE0IDE0IDE0IDMzLjV0LTE0IDMyLjVxLTkgOSAtMjEgMTIuNXQtMjQgMHQtMjEgLTEyLjVsLTE1NiAtMTU1cS0xMyAtMTQgLTEzIC0zMy41dDEzIC0zMi41bDE1NiAtMTU2cTcgLTcgMTUuNSAtMTAuNXQxNy41IC0zLjVxNiAwIDEyIDEuNXQxMS41IDQuNXQ5LjUgOHE5IDkgMTIuNSAyMXQwIDI0dC0xMi41IDIxbC03NiA3NmgzMDR2LTMwM2wtNzYgNzYKcS03IDcgLTE1LjUgMTAuNXQtMTcuNSAzLjV0LTE4IC0zLjV0LTE1IC05LjVxLTE0IC0xNCAtMTQgLTMzLjV0MTQgLTMzLjVsMTU1IC0xNTVxMTQgLTE0IDMzLjUgLTE0dDMzLjUgMTRsMTU1IDE1NXExNCAxNCAxNCAzMy41dC0xMy41IDMzdC0zMyAxMy41dC0zMy41IC0xNGwtNzYgLTc1djMwMmgzMDNsLTc2IC03NnEtNyAtNyAtMTAuNSAtMTUuNXQtMy41IC0xNy41dDMuNSAtMTcuNXQxMC41IC0xNS41cTEzIC0xNCAzMyAtMTRxMyAwIDYgMC41CnQ1LjUgMXQ1LjUgMnQ1LjUgM3Q1LjUgMy41dDUgNGwxNTYgMTU2cTQgNCA3IDkuNXQ0LjUgMTF0MS41IDEyLjVxMCA0IC0xIDguNXQtMi41IDl0LTQgOHQtNS41IDcuNXoiIC8+CiAgICA8Z2x5cGggZ2x5cGgtbmFtZT0idW5pRTYxMCIgdW5pY29kZT0iJiN4ZTYxMDsiIApkPSJNOTI0IDU3M2gtMTU0djEwNXEwIDI5IC0yMC41IDQ5LjV0LTQ5LjUgMjAuNWgtMzc2cS0xNSAwIC0yOCAtNnQtMjIgLTE1dC0xNC41IC0yMnQtNS41IC0yN3YtMTA1aC0xNTVxLTE0IC0xIC0yNCAtMTBxLTEwIC0xMCAtMTAgLTI0LjV0MTAgLTI0LjV0MjQgLTEwaDc5di01ODFxMCAtMjkgMjAuNSAtNDkuNXQ0OS41IC0yMC41aDUyOHExNCAwIDI3IDUuNXQyMi41IDE0LjV0MTUgMjJ0NS41IDI4djU1OHYyM2g3OHExNSAwIDI1IDEwCnQxMCAyNC41dC0xMCAyNC41dC0yNSAxMHpNNDEyIC0xMHEtOSAwIC0xNyA0LjV0LTEyLjUgMTIuNXQtNC41IDE4bC0xIDM3MnEwIDcgMyAxMy41dDcuNSAxMS41dDExIDcuNXQxMy41IDIuNXExNSAwIDI1IC0xMHQxMCAtMjV2LTM3MnEwIC0xNSAtMTAgLTI1dC0yNSAtMTB6TTYxMS41IC0xMHEtMTQuNSAwIC0yNC41IDEwdC0xMCAyNXYzNzJxMCAxNSAxMCAyNXQyNC41IDEwdDI0LjUgLTEwdDEwIC0yNWwxIC0zNzJxMCAtMTUgLTEwLjUgLTI1CnQtMjUgLTEwek0zMjMgNjM1cTAgMTcgMTMgMzB0MzEgMTNoMjkwcTE4IDAgMzEgLTEzdDEzIC0zMHYtNjJoLTM3OHY2MnoiIC8+CiAgICA8Z2x5cGggZ2x5cGgtbmFtZT0idW5pRTYxMSIgdW5pY29kZT0iJiN4ZTYxMTsiIApkPSJNOTYwIDU1MnEwIC0xNyAtMTIgLTI5LjV0LTMwIC0xMi41aC04MTJxLTcgMCAtMTMuNSAydC0xMS41IDZ0LTkgOXQtNiAxMS41dC0yIDEzLjV0MiAxMy41dDYgMTEuNXQ5IDl0MTEuNSA2dDEzLjUgMmg4MTJxMTggMCAzMCAtMTJ0MTIgLTMwek05NjAgMzAwcTAgLTE3IC0xMiAtMjkuNXQtMzAgLTEyLjVoLTgxMnEtNiAwIC0xMS41IDEuNXQtMTAgNHQtOC41IDYuNXQtNi41IDguNXQtNCAxMHQtMS41IDExLjVxMCAxNyAxMiAyOS41CnQzMCAxMi41aDgxMnE0IDAgOC41IC0xdDggLTIuNXQ3IC0zLjV0Ni41IC01dDUgLTYuNXQzLjUgLTd0Mi41IC04dDEgLTguNXpNOTYwIDQ4cTAgLTE4IC0xMiAtMzB0LTMwIC0xMmgtODEycS0xMiAwIC0yMS41IDUuNXQtMTUgMTV0LTUuNSAyMS41cTAgMTcgMTIgMjkuNXQzMCAxMi41aDgxMnEyOSAwIDM5IC0yNnEzIC05IDMgLTE2eiIgLz4KICAgIDxnbHlwaCBnbHlwaC1uYW1lPSJ1bmlFNjEyIiB1bmljb2RlPSImI3hlNjEyOyIgCmQ9Ik02OTkgMzU4aC0xNTd2LTE1OHEwIC01IC0yIC0xMHQtNS41IC04LjV0LTguNSAtNS41dC0xMCAtMnEtMTEgMCAtMTkgOHQtOCAxOHYxNThoLTE1N3EtMTEgMCAtMTguNSA3LjV0LTcuNSAxOC41cTAgNyAzLjUgMTN0OS41IDkuNXQxMyAzLjVoMTU3djE1N3EwIDExIDggMTguNXQxOSA3LjVxNSAwIDEwIC0ydDguNSAtNS41dDUuNSAtOC41dDIgLTEwdi0xNTdoMTU3cTExIDAgMTguNSAtNy41dDcuNSAtMTguNXQtNy41IC0xOC41CnQtMTguNSAtNy41eiIgLz4KICAgIDxnbHlwaCBnbHlwaC1uYW1lPSJ1bmlFNjEzIiB1bmljb2RlPSImI3hlNjEzOyIgCmQ9Ik03MjkgOTBoLTQzNHEtMTE2IDAgLTE5Ny41IDgxLjV0LTgxLjUgMTk2LjV2MzJxMCAxMTUgODEuNSAxOTYuNXQxOTcuNSA4MS41aDQzNHExMTYgMCAxOTcuNSAtODEuNXQ4MS41IC0xOTYuNXYtMzJxMCAtMTE1IC04MS41IC0xOTYuNXQtMTk3LjUgLTgxLjV6TTk0NiA0MDBxMCA5MCAtNjMuNSAxNTN0LTE1My41IDYzaC00MzRxLTkwIDAgLTE1My41IC02M3QtNjMuNSAtMTUzdi0zMnEwIC01OSAyOSAtMTA5dDc5IC03OXQxMDkgLTI5aDQzNApxOTAgMCAxNTMuNSA2My41dDYzLjUgMTUzLjV2MzJ6TTMyMiAyMjNxLTQ0IDAgLTgyIDIyLjV0LTYwIDYwdC0yMiA4Mi41cTAgMzMgMTMgNjMuNXQzNSA1Mi41dDUyLjUgMzV0NjMuNSAxM3E2OCAwIDExNiAtNDh0NDggLTExNnQtNDggLTExNi41dC0xMTYgLTQ4LjV6IiAvPgogICAgPGdseXBoIGdseXBoLW5hbWU9InVuaUU2MTQiIHVuaWNvZGU9IiYjeGU2MTQ7IiAKZD0iTTcyOSA5MGgtNDM0cS0xMTYgMCAtMTk3LjUgODEuNXQtODEuNSAxOTYuNXYzMnEwIDExNSA4MS41IDE5Ni41dDE5Ny41IDgxLjVoNDM0cTExNiAwIDE5Ny41IC04MS41dDgxLjUgLTE5Ni41di0zMnEwIC0xMTUgLTgxLjUgLTE5Ni41dC0xOTcuNSAtODEuNXpNOTQ3IDM5OXEwIDkwIC02My41IDE1My41dC0xNTMuNSA2My41aC00MzZxLTg5IDAgLTE1Mi41IC02My41dC02My41IC0xNTMuNXYtMzFxMCAtNTkgMjkgLTEwOXQ3OSAtNzkKdDEwOCAtMjloNDM2cTkwIDAgMTUzLjUgNjMuNXQ2My41IDE1My41djMxek03MDIgMjIzcS00NCAwIC04MiAyMnQtNjAgNjB0LTIyIDgzcTAgNjggNDggMTE2dDExNiA0OHQxMTYuNSAtNDh0NDguNSAtMTE2cTAgLTE3IC0zLjUgLTMzLjV0LTkuNSAtMzF0LTE1IC0yNy41dC0yMC41IC0yNC41dC0yNC41IC0yMHQtMjcuNSAtMTV0LTMxIC0xMHQtMzMuNSAtMy41eiIgLz4KICAgIDxnbHlwaCBnbHlwaC1uYW1lPSJ1bmlFNjE1IiB1bmljb2RlPSImI3hlNjE1OyIgCmQ9Ik04MzIgODk2aC02NDBxLTgwIDAgLTEzNiAtNTZ0LTU2IC0xMzZ2LTY0MHEwIC03OSA1NiAtMTM1LjV0MTM2IC01Ni41aDY0MHE3OSAwIDEzNS41IDU2LjV0NTYuNSAxMzUuNXY2NDBxMCA4MCAtNTYuNSAxMzZ0LTEzNS41IDU2ek0xNjAgMHEtMTMgMCAtMjIuNSA5LjV0LTkuNSAyMi41dDkuNSAyMi41dDIyLjUgOS41dDIyLjUgLTkuNXQ5LjUgLTIyLjV0LTkuNSAtMjIuNXQtMjIuNSAtOS41ek0xNjAgNzA0cS0xMyAwIC0yMi41IDkuNQp0LTkuNSAyMi41dDkuNSAyMi41dDIyLjUgOS41dDIyLjUgLTkuNXQ5LjUgLTIyLjV0LTkuNSAtMjIuNXQtMjIuNSAtOS41ek03MDQgNjRxMCAtMjcgLTE4LjUgLTQ1LjV0LTQ1LjUgLTE4LjVoLTI1NnEtMjcgMCAtNDUuNSAxOC41dC0xOC41IDQ1LjV2NjQwcTAgMjYgMTkgNDV0NDUgMTloMjU2cTI3IDAgNDUuNSAtMTguNXQxOC41IC00NS41di02NDB6TTg2NCAwcS0xMyAwIC0yMi41IDkuNXQtOS41IDIyLjV0OS41IDIyLjV0MjIuNSA5LjUKdDIyLjUgLTkuNXQ5LjUgLTIyLjV0LTkuNSAtMjIuNXQtMjIuNSAtOS41ek04NjQgNzA0cS0xMyAwIC0yMi41IDkuNXQtOS41IDIyLjV0OS41IDIyLjV0MjIuNSA5LjV0MjIuNSAtOS41dDkuNSAtMjIuNXQtOS41IC0yMi41dC0yMi41IC05LjV6TTU3NiA3MDRoLTEyOHEtMjYgMCAtNDUgLTE5dC0xOSAtNDV2LTE5MnEwIC0yNiAxOSAtNDV0NDUgLTE5aDEyOHEyNyAwIDQ1LjUgMTguNXQxOC41IDQ1LjV2MTkycTAgMjcgLTE4LjUgNDUuNQp0LTQ1LjUgMTguNXoiIC8+CiAgICA8Z2x5cGggZ2x5cGgtbmFtZT0idW5pRTYxNiIgdW5pY29kZT0iJiN4ZTYxNjsiIApkPSJNNTA0IDE3cS05NyAwIC0xNzkuNSA0OHQtMTMwLjUgMTMwLjV0LTQ4IDE3OS41cTAgMTEwIDYyIDIwMWw5MyAtOTN2MjQ1aC0yNDZsOTIgLTkycS0yMCAtMjcgLTM1LjUgLTU3LjV0LTI2LjUgLTYzLjV0LTE3IC02OC41dC02IC03MS41cTAgLTkwIDM1IC0xNzEuNXQ5NC41IC0xNDF0MTQxIC05NC41dDE3MS41IC0zNXE4NSAwIDE2MyAzMWwtNTAgNzFxLTU1IC0xOCAtMTEzIC0xOHpNNzIwIDI3N3YtMjQ2aDI0NmwtOTYgOTYKcTM3IDU0IDU2LjUgMTE3dDE5LjUgMTMxcTAgOTAgLTM1IDE3MnQtOTQgMTQxdC0xNDEgOTR0LTE3MiAzNXEtNzAgMCAtMTM2IC0yMWw1MiAtNzNxNDEgMTAgODQgMTBxNTkgMCAxMTMuNSAtMTh0OTguNSAtNTF0NzcgLTc3dDUxIC05OC41dDE4IC0xMTMuNXEwIC01MCAtMTMuNSAtOTh0LTM4LjUgLTg5eiIgLz4KICAgIDxnbHlwaCBnbHlwaC1uYW1lPSJ1bmlFNjE3IiB1bmljb2RlPSImI3hlNjE3OyIgCmQ9Ik01MTIgODAycS0xMDQgMCAtMTkyLjUgLTUxLjV0LTE0MCAtMTQwdC01MS41IC0xOTN0NTEuNSAtMTkzdDE0MCAtMTQwdDE5Mi41IC01MS41dDE5Mi41IDUxLjV0MTQwIDE0MHQ1MS41IDE5M3QtNTEuNSAxOTN0LTE0MCAxNDB0LTE5Mi41IDUxLjV6TTY2MCAyMTRoLTUwdjE3NWgtMTk2di0xNzVoLTUwdjM5NWg1MHYtMTc5aDE5NnYxNzloNTB2LTM5NXoiIC8+CiAgICA8Z2x5cGggZ2x5cGgtbmFtZT0idW5pRTYxOCIgdW5pY29kZT0iJiN4ZTYxODsiIApkPSJNOTYxIDY0MHEwIDQwIC0yOC41IDY4dC02Ny41IDI4aC0xODZoLTFoLTFxLTMgLTEgLTUuNSAtMS41dC00LjUgLTAuNWwtMSAtMWgtMXEtMiAtMiAtNC41IC0zdC0zLjUgLTNxLTEyIC0xMSAtMTkuNSAtMzEuNXQtMTUuNSAtNTYuNXEtMyAtMTIgLTQgLTE0cS00IC0xNyAtMjcgLTE3aC03aC04aC00MTZxLTQwIDAgLTY4IC0yOC41dC0yOCAtNjkuNWwzMiAtNDE0cTAgLTQwIDI4IC02OHQ2OCAtMjhoNjQwcTQwIDAgNjggMjh0MjggNjZ6Ck04NjQgOTZxMCAtMTMgLTkuNSAtMjIuNXQtMjIuNSAtOS41aC02NDBxLTkgMCAtMTYgNC41dC0xMS41IDEyLjV0LTQuNSAxN2wtMzIgNDE0cTAgMTMgOS41IDIyLjV0MjIuNSA5LjVoNDE2aDhoN3EzNSAwIDU4LjUgMTd0MzAuNSA0OHExIDIgMiA2dDIgOXE4IDM0IDEzIDQ4aDE2OHExMyAwIDIyLjUgLTkuNXQ5LjUgLTIyLjV2LTJ2LTF6TTEyOCA2NzJoNDE2cTEzIDAgMjIuNSA5LjV0OS41IDIyLjV0LTkuNSAyMi41dC0yMi41IDkuNWgtNDE2CnEtMTMgMCAtMjIuNSAtOS41dC05LjUgLTIyLjV0OS41IC0yMi41dDIyLjUgLTkuNXoiIC8+CiAgICA8Z2x5cGggZ2x5cGgtbmFtZT0idW5pRTYxOSIgdW5pY29kZT0iJiN4ZTYxOTsiIApkPSJNNTIxIDE5NGwtMzc2IDI0N2wtNTAgLTUybDQyNiAtMjkxbDQyNiAyOTFsLTUxIDUzek05NDcgNTUwbC00MjYgMjkxbC00MjYgLTI5MWw0MjYgLTI5MXpNNTIxIDc1NmwzMDIgLTIwNmwtMzAyIC0yMDdsLTMwMiAyMDd6TTUyMSAzM2wtMzc2IDI0OGwtNTAgLTUybDQyNiAtMjkxbDQyNiAyOTFsLTUxIDUzeiIgLz4KICAgIDxnbHlwaCBnbHlwaC1uYW1lPSJ1bmlFNjFBIiB1bmljb2RlPSImI3hlNjFhOyIgCmQ9Ik04NzQgNjYycS00OCA0OCAtMTA2IDgxLjV0LTEyMyA1MXQtMTMzIDE3LjVxLTEwMyAwIC0xOTYgLTM4LjV0LTE2NiAtMTExLjVxLTM2IC0zNiAtNjQgLTc4dC00NyAtODh0LTI5IC05NS41dC0xMCAtMTAwLjVxMCAtMTAzIDM4LjUgLTE5NnQxMTEuNSAtMTY2cTI0IC0yNCA1MSAtNDQuNXQ1NS41IC0zNy41dDU5LjUgLTI5LjV0NjMgLTIxdDY1LjUgLTEzdDY3LjUgLTQuNXE2OCAwIDEzMyAxNy41dDEyMyA1MXQxMDYgODEuNQpxNzMgNzMgMTExLjUgMTY2dDM4LjUgMTk2cTAgNTEgLTEwIDEwMC41dC0yOSA5NS41dC00NyA4OHQtNjQgNzh6TTk0MiA0NjZxLTUgOCAtMTYgMTUuNXQtMjEgMTF0LTMxIDExLjVxLTE2IDUgLTI4LjUgMjB0LTE4LjUgMjguNXQtMTUgNDEuNXEtNiAxOCAtMTAgMjcuNXQtMTEgMjQuNXQtMTUuNSAyNS41dC0xOS41IDE5LjVxMTMwIC04MyAxODYgLTIyNXpNNzk4IDI5MHEyIC0xOSAyLjUgLTM1LjV0LTguNSAtMzguNXQtMjkgLTQ1CnEtMiAtMiAtNC41IC01LjV0LTQuNSAtNi41dC00IC03dC0zIC03dC0zIC04dC0zLjUgLTh0LTMuNSAtOHEtOCAtMjIgLTEzLjUgLTMzLjV0LTE2LjUgLTI2dC0yOCAtMjF0LTQxIC02LjVxLTcgOCAtMTIgMzdxLTQgMjQgLTEwIDkwcS04IDExMSAtMjEgMTYwcS0yNSA5MiAtODQgMTEycS0yNiA5IC01NSA5cS0xNCAwIC0zOSAtM3EtMTcgLTIgLTI0IC0ycS01IDAgLTcuNSAwLjV0LTcuNSAyLjV0LTguNSA1LjV0LTguNSAxMXQtMTAgMTguNQpxLTExIDMwIC0xMCA2My41dDIwLjUgNjl0NTMuNSA1Ny41cTU1IDM3IDg5IDM3cTI3IDAgNjkgLTIzcTIzIC0xMiA0Mi41IC0xNnQzOC41IC00aDEwcTUgMCAxMiAxaDE2cTkgMCAxNiAtMS41dDE1IC03LjVxMTMgLTkgMjEuNSAtMjZ0MTkuNSAtNDhxOCAtMjQgMTMuNSAtMzcuNXQxNi41IC0zM3QyNyAtMzJ0MzcgLTE5LjVxMjIgLTggMzEgLTExcS05IC05IC0zNiAtMzRxLTIxIC0xOCAtMzAgLTI3cS0xNSAtMTMgLTIxLjUgLTMwdC01LjUgLTMyCnQyIC0zMXpNNTEgMzA0cTggLTEgMTggLTNxMzQgLTggNDggLTE1cS0zIC02IC0xMiAtMThxLTI4IC00MSAtMjIgLTY1cTIgLTE0IDAuNSAtMjcuNXQtNi41IC0yOC41cS04IDI0IC0xNCA0OXQtOSA1MXQtMyA1M3YydjJ6TTUxMiAtMTYxcS0xMjkgMCAtMjM4IDY2LjV0LTE2OCAxNzYuNXE0MCA3NiAyNyAxMzJxMCA1IDE0IDI0cTYgOCA5IDEyLjV0NyAxM3Q1LjUgMTQuNXQxIDE0LjV0LTQuNSAxNS41cS0xMiAyNiAtODAgNDFxLTEzIDMgLTMxIDYKcTE0IDExMyA3OCAyMDZ0MTY0IDE0Ni41dDIxNiA1My41cTExOSAwIDIyMyAtNThxLTYgMyAtMTIgNC41dC0xMS41IDIuNXQtOS41IDFoLTEwaC0xOXEtMTMgLTEgLTE5IC0xcS05IDAgLTE2IDF0LTE4LjUgNC41dC0yMi41IDkuNXEtNTMgMjggLTkzIDI4cS00OSAwIC0xMTcgLTQ1cS0zMSAtMjAgLTUzLjUgLTUwLjV0LTM0LjUgLTY2LjVxLTIzIC03MyA1IC0xMzZxMzAgLTY5IDg5IC02OWg3cTQgMCA4LjUgMC41dDcgMXQ3LjUgMC41CnEyMiAzIDMzIDNxMTAgMCAxOS41IC0xLjV0MTguNSAtNC41cTM0IC0xMSA1MSAtNzdxMTIgLTQ0IDIwIC0xNTFxNiAtODAgMTMgLTExMHE2IC0yNiAxNyAtNDFxMTYgLTI0IDQxIC0yNHEzNCAwIDYxIDExdDQ3IDMzcTEwIDExIDE4LjUgMjZ0MTIuNSAyNC41dDEwIDI2LjVxMTEgMjggMTYgMzRxMjcgMzAgMzkuNSA2MS41dDExIDUzLjV0LTIuNSA0NHEtMyAyMSAtMS41IDMxLjV0OS41IDE4LjVxNCAzIDcgNS41dDYgNS41dDYgNS41dDUuNSA1CnQ1LjUgNC41cTMyIDI5IDQxIDM5cTIyIDI0IDE4IDQ0djFxMjcgLTc1IDI3IC0xNTZxMCAtOTQgLTM2LjUgLTE3OXQtOTguNSAtMTQ3dC0xNDcuNSAtOTguNXQtMTc4LjUgLTM2LjV6IiAvPgogICAgPGdseXBoIGdseXBoLW5hbWU9InVuaUU2MUIiIHVuaWNvZGU9IiYjeGU2MWI7IiAKZD0iTTgwNCA3NzBsNTAgLTQzMWwtNTcgLTdsLTQ1IDM4NmgtNDgwbC00NSAtMzg2bC01NyA3bDUwIDQzMWg1ODR6TTMxOSA2NzRoMzg2di00OGgtMzg2djQ4ek0zMTkgNTc3aDM4NnYtNDhoLTM4NnY0OHpNMzE5IDQ4MWgzODZ2LTQ5aC0zODZ2NDl6TTMxOSAzODRoMzg2di00OGgtMzg2djQ4ek04NzQgMjg3aC03MjRxLTcgMCAtMTEuNSAtM3QtNiAtOHQwLjUgLTExbDgyIC0yNDRxMyAtMTAgMTIgLTE2LjV0MTkgLTYuNWg1MzJxMTAgMCAxOSA2LjUKdDEyIDE2LjVsODIgMjQ0cTcgMjIgLTE3IDIyek02MDkgMTkxaC0xOTR2NDhoMTk0di00OHoiIC8+CiAgICA8Z2x5cGggZ2x5cGgtbmFtZT0idW5pRTYxQyIgdW5pY29kZT0iJiN4ZTYxYzsiIApkPSJNOTk1IDNsLTI3MiAyMjdxLTEgMSAtMiAxLjV0LTQgMi41cTM3IDc5IDM3IDE2MHEwIDgyIC0zNC41IDE1OHQtOTkuNSAxMzFxLTEwNSA4OSAtMjQzIDg5cS04MiAwIC0xNTggLTM1dC0xMzEgLTEwMHEtNDMgLTUyIC02NS41IC0xMTQuNXQtMjIuNSAtMTI4LjVxMCAtODIgMzQuNSAtMTU4LjV0MTAwLjUgLTEzMS41cTEwNSAtODggMjQxIC04OGgxcTEyMSAwIDIyMSA3MnExIDAgMiAtMmwxIC0xbDI3MiAtMjI3cTEwIC05IDIzIC0xNAp0MjYuNSAtNXQyNi41IDMuNXQyNSAxMXQyMSAxOS41bDYgN3EyNCAyOCAyMiA2NC41dC0yOCA1OC41ek01ODUgMjE5cS00MCAtNDcgLTk0LjUgLTcydC0xMTMuNSAtMjVxLTk4IDEgLTE3NCA2NHEtNDcgMzkgLTcyIDk0dC0yNSAxMTRxMCA5OSA2NCAxNzRxMzkgNDggOTMuNSA3Mi41dDExMy41IDI0LjVxOTkgMCAxNzQgLTYzcTQ3IC00MCA3MiAtOTQuNXQyNSAtMTEzLjVxMCAtOTkgLTYzIC0xNzV6IiAvPgogICAgPGdseXBoIGdseXBoLW5hbWU9InVuaUU2MUQiIHVuaWNvZGU9IiYjeGU2MWQ7IiAKZD0iTTQyNyAxNTFxMCAyMyAxMSA0Mi41dDMxIDMxdDQzIDExLjVxMzUgMCA2MCAtMjV0MjUgLTYwcTAgLTExIC0yLjUgLTIydC04IC0yMHQtMTIuNSAtMTYuNXQtMTYgLTEzLjVxMSAtNiAzIC0xNnQ2LjUgLTM4LjV0OC41IC01NS41cTAgLTggLTQuNSAtMTUuNXQtMTEuNSAtMTJ0LTE2IC00LjVoLTY0cS0xMyAwIC0yMi41IDkuNXQtOS41IDIyLjVsMTggMTEwcS0zOSAyNSAtMzkgNzJ6TTM0MSAzODV2MTUwcTAgMjMgNi41IDQ1dDE3LjUgNDEKdDI2LjUgMzQuNXQzNC41IDI2LjV0NDEgMTd0NDUgNnE0NiAwIDg1LjUgLTIyLjV0NjIuNSAtNjJ0MjMgLTg1LjV2LTE1MGgtMzQyek0yMzUgNTM1di0xNTBoLTY0cS0zNiAwIC02MSAtMjV0LTI1IC02MHYtNDI3cTAgLTM1IDI1IC02MHQ2MSAtMjVoNjgycTM2IDAgNjEgMjV0MjUgNjB2NDI3cTAgMzUgLTI1IDYwdC02MSAyNWgtNjR2MTUwcTAgMTE1IC04MSAxOTZ0LTE5NiA4MXEtNTYgMCAtMTA3LjUgLTIydC04OC41IC01OXQtNTkgLTg4LjUKdC0yMiAtMTA3LjV6IiAvPgogICAgPGdseXBoIGdseXBoLW5hbWU9InVuaUU2MUUiIHVuaWNvZGU9IiYjeGU2MWU7IiAKZD0iTTc2OSA0NDh2MTM1cS0zIDEwNCAtNzcuNSAxNzYuNXQtMTc4LjUgNzIuNXEtNTEgMCAtOTcuNSAtMTkuNXQtODEgLTUyLjV0LTU1IC03OXQtMjIuNSAtOTd2LTEzNmgtMXEtMTcgMCAtMzIgLTguNXQtMjMuNSAtMjMuNXQtOC41IC0zMnYtMzg0cTAgLTI3IDE4LjUgLTQ1LjV0NDUuNSAtMTguNWg1MTJxMTcgMCAzMiA4LjV0MjMuNSAyMy41dDguNSAzMnYzODRxMCAyNiAtMTguNSA0NXQtNDQuNSAxOXpNMzIxIDU4MXEyIDc4IDU4IDEzMi41CnQxMzQgNTQuNXEzMSAwIDYwIC05LjV0NTIgLTI2LjV0NDEgLTQwdDI4IC01MS41dDExIC01OS41di0xMzNoLTM4NHYxMzN6TTc2OCAzMnEwIC05IC00LjUgLTE2dC0xMS41IC0xMS41dC0xNiAtNC41aC00NDhxLTQgMCAtOC41IDF0LTggM3QtNi41IDV0LTUgNi41dC0zIDh0LTEgOC41djMyMHEwIDEzIDkuNSAyMi41dDIyLjUgOS41aDQ0OHE1IDAgMTAgLTEuNXQ5IC00LjV0NyAtN3Q0LjUgLTl0MS41IC0xMHYtMzIwek01NDQgMjA2djUyCnEwIDEzIC05LjUgMjIuNXQtMjIuNSA5LjVxLTkgMCAtMTYgLTQuNXQtMTEuNSAtMTEuNXQtNC41IC0xNnYtNTJxLTI4IC0xOCAtMjggLTUxcTAgLTI1IDE3LjUgLTQyLjV0NDIuNSAtMTcuNXQ0Mi41IDE3LjV0MTcuNSA0Mi41cTAgMzMgLTI4IDUxeiIgLz4KICA8L2ZvbnQ+CjwvZGVmcz48L3N2Zz4K"
  20244. /***/ },
  20245. /* 203 */
  20246. /***/ function(module, exports, __webpack_require__) {
  20247. /**
  20248. * @author oldj
  20249. * @blog http://oldj.net
  20250. */
  20251. 'use strict';
  20252. Object.defineProperty(exports, "__esModule", {
  20253. value: true
  20254. });
  20255. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  20256. var _react = __webpack_require__(3);
  20257. var _react2 = _interopRequireDefault(_react);
  20258. var _editor = __webpack_require__(204);
  20259. var _editor2 = _interopRequireDefault(_editor);
  20260. var _classnames = __webpack_require__(177);
  20261. var _classnames2 = _interopRequireDefault(_classnames);
  20262. __webpack_require__(211);
  20263. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  20264. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  20265. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  20266. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  20267. var Content = function (_React$Component) {
  20268. _inherits(Content, _React$Component);
  20269. function Content(props) {
  20270. _classCallCheck(this, Content);
  20271. var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(Content).call(this, props));
  20272. _this.codemirror = null;
  20273. _this.state = {
  20274. is_loading: _this.props.current.is_loading,
  20275. code: _this.props.current.content || ''
  20276. };
  20277. _this._t = null;
  20278. SH_event.on('loading', function (host, flag) {
  20279. if (host === _this.props.current) {
  20280. _this.setState({
  20281. is_loading: flag
  20282. });
  20283. }
  20284. });
  20285. return _this;
  20286. }
  20287. _createClass(Content, [{
  20288. key: 'setValue',
  20289. value: function setValue(v) {
  20290. this.props.setHostContent(v);
  20291. }
  20292. }, {
  20293. key: 'componentWillReceiveProps',
  20294. value: function componentWillReceiveProps(next_props) {
  20295. this.setState({
  20296. is_loading: next_props.current.is_loading,
  20297. code: next_props.current.content || ''
  20298. });
  20299. }
  20300. }, {
  20301. key: 'render',
  20302. value: function render() {
  20303. var current = this.props.current;
  20304. return _react2.default.createElement(
  20305. 'div',
  20306. { id: 'sh-content' },
  20307. _react2.default.createElement(
  20308. 'div',
  20309. { className: 'inform' },
  20310. _react2.default.createElement(
  20311. 'span',
  20312. {
  20313. className: (0, _classnames2.default)({
  20314. loading: 1,
  20315. show: this.state.is_loading
  20316. })
  20317. },
  20318. 'loading...'
  20319. ),
  20320. _react2.default.createElement('i', {
  20321. className: (0, _classnames2.default)({
  20322. show: current.where === 'remote',
  20323. iconfont: 1,
  20324. 'icon-earth': 1
  20325. }),
  20326. title: SH_Agent.lang.remote_hosts
  20327. }),
  20328. _react2.default.createElement('i', {
  20329. className: (0, _classnames2.default)({
  20330. show: this.props.readonly,
  20331. iconfont: 1,
  20332. 'icon-lock2': 1
  20333. }),
  20334. title: SH_Agent.lang.readonly
  20335. })
  20336. ),
  20337. _react2.default.createElement(_editor2.default, {
  20338. code: this.state.code,
  20339. readonly: this.props.readonly,
  20340. setValue: this.setValue.bind(this) })
  20341. );
  20342. }
  20343. }]);
  20344. return Content;
  20345. }(_react2.default.Component);
  20346. exports.default = Content;
  20347. /***/ },
  20348. /* 204 */
  20349. /***/ function(module, exports, __webpack_require__) {
  20350. /**
  20351. * editor
  20352. * @author oldj
  20353. * @blog http://oldj.net
  20354. */
  20355. 'use strict';
  20356. Object.defineProperty(exports, "__esModule", {
  20357. value: true
  20358. });
  20359. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  20360. var _react = __webpack_require__(3);
  20361. var _react2 = _interopRequireDefault(_react);
  20362. var _codemirror = __webpack_require__(205);
  20363. var _codemirror2 = _interopRequireDefault(_codemirror);
  20364. var _classnames = __webpack_require__(177);
  20365. var _classnames2 = _interopRequireDefault(_classnames);
  20366. var _cm_hl = __webpack_require__(206);
  20367. var _cm_hl2 = _interopRequireDefault(_cm_hl);
  20368. var _kw = __webpack_require__(187);
  20369. var _kw2 = _interopRequireDefault(_kw);
  20370. __webpack_require__(207);
  20371. __webpack_require__(209);
  20372. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  20373. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  20374. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  20375. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  20376. var Editor = function (_React$Component) {
  20377. _inherits(Editor, _React$Component);
  20378. function Editor(props) {
  20379. _classCallCheck(this, Editor);
  20380. var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(Editor).call(this, props));
  20381. _this.codemirror = null;
  20382. (0, _cm_hl2.default)();
  20383. _this.marks = [];
  20384. _this.kw = '';
  20385. SH_event.on('search', function (kw) {
  20386. _this.kw = kw;
  20387. _this.highlightKeyword();
  20388. });
  20389. return _this;
  20390. }
  20391. _createClass(Editor, [{
  20392. key: 'highlightKeyword',
  20393. value: function highlightKeyword() {
  20394. var _this2 = this;
  20395. while (this.marks.length > 0) {
  20396. this.marks.shift().clear();
  20397. }
  20398. var code = this.props.code;
  20399. var pos = _kw2.default.findPositions(this.kw, code) || [];
  20400. // this.codemirror.markText({line: 6, ch: 16}, {line: 6, ch: 22}, {className: 'cm-hl'});
  20401. pos.map(function (p) {
  20402. _this2.marks.push(_this2.codemirror.markText(p[0], p[1], { className: 'cm-hl' }));
  20403. });
  20404. }
  20405. }, {
  20406. key: 'setValue',
  20407. value: function setValue(v) {
  20408. this.props.setValue(v);
  20409. }
  20410. }, {
  20411. key: 'componentDidMount',
  20412. value: function componentDidMount() {
  20413. var _this3 = this;
  20414. // console.log(this.cnt_node, this.cnt_node.value);
  20415. this.codemirror = _codemirror2.default.fromTextArea(this.cnt_node, {
  20416. lineNumbers: true,
  20417. readOnly: true,
  20418. mode: 'host'
  20419. });
  20420. this.codemirror.setSize('100%', '100%');
  20421. this.codemirror.on('change', function (a) {
  20422. var v = a.getDoc().getValue();
  20423. _this3.setValue(v);
  20424. });
  20425. this.codemirror.on('gutterClick', function (cm, n) {
  20426. if (_this3.props.readonly === true) return;
  20427. var info = cm.lineInfo(n);
  20428. //cm.setGutterMarker(n, "breakpoints", info.gutterMarkers ? null : makeMarker());
  20429. var ln = info.text;
  20430. if (/^\s*$/.test(ln)) return;
  20431. var new_ln = void 0;
  20432. if (/^#/.test(ln)) {
  20433. new_ln = ln.replace(/^#\s*/, '');
  20434. } else {
  20435. new_ln = '# ' + ln;
  20436. }
  20437. _this3.codemirror.getDoc().replaceRange(new_ln, { line: info.line, ch: 0 }, { line: info.line, ch: ln.length });
  20438. //app.caculateHosts();
  20439. });
  20440. }
  20441. }, {
  20442. key: 'componentWillReceiveProps',
  20443. value: function componentWillReceiveProps(next_props) {
  20444. var _this4 = this;
  20445. // console.log(next_props);
  20446. this.codemirror.getDoc().setValue(next_props.code);
  20447. this.codemirror.setOption('readOnly', next_props.readonly);
  20448. setTimeout(function () {
  20449. _this4.highlightKeyword();
  20450. }, 100);
  20451. }
  20452. }, {
  20453. key: 'render',
  20454. value: function render() {
  20455. var _this5 = this;
  20456. return _react2.default.createElement(
  20457. 'div',
  20458. { id: 'sh-editor', className: (0, _classnames2.default)({
  20459. readonly: this.props.readonly
  20460. }) },
  20461. _react2.default.createElement('textarea', {
  20462. ref: function ref(c) {
  20463. return _this5.cnt_node = c;
  20464. },
  20465. defaultValue: this.props.code || ''
  20466. })
  20467. );
  20468. }
  20469. }]);
  20470. return Editor;
  20471. }(_react2.default.Component);
  20472. exports.default = Editor;
  20473. /***/ },
  20474. /* 205 */
  20475. /***/ function(module, exports, __webpack_require__) {
  20476. // CodeMirror, copyright (c) by Marijn Haverbeke and others
  20477. // Distributed under an MIT license: http://codemirror.net/LICENSE
  20478. // This is CodeMirror (http://codemirror.net), a code editor
  20479. // implemented in JavaScript on top of the browser's DOM.
  20480. //
  20481. // You can find some technical background for some of the code below
  20482. // at http://marijnhaverbeke.nl/blog/#cm-internals .
  20483. (function(mod) {
  20484. if (true) // CommonJS
  20485. module.exports = mod();
  20486. else if (typeof define == "function" && define.amd) // AMD
  20487. return define([], mod);
  20488. else // Plain browser env
  20489. (this || window).CodeMirror = mod();
  20490. })(function() {
  20491. "use strict";
  20492. // BROWSER SNIFFING
  20493. // Kludges for bugs and behavior differences that can't be feature
  20494. // detected are enabled based on userAgent etc sniffing.
  20495. var userAgent = navigator.userAgent;
  20496. var platform = navigator.platform;
  20497. var gecko = /gecko\/\d/i.test(userAgent);
  20498. var ie_upto10 = /MSIE \d/.test(userAgent);
  20499. var ie_11up = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(userAgent);
  20500. var ie = ie_upto10 || ie_11up;
  20501. var ie_version = ie && (ie_upto10 ? document.documentMode || 6 : ie_11up[1]);
  20502. var webkit = /WebKit\//.test(userAgent);
  20503. var qtwebkit = webkit && /Qt\/\d+\.\d+/.test(userAgent);
  20504. var chrome = /Chrome\//.test(userAgent);
  20505. var presto = /Opera\//.test(userAgent);
  20506. var safari = /Apple Computer/.test(navigator.vendor);
  20507. var mac_geMountainLion = /Mac OS X 1\d\D([8-9]|\d\d)\D/.test(userAgent);
  20508. var phantom = /PhantomJS/.test(userAgent);
  20509. var ios = /AppleWebKit/.test(userAgent) && /Mobile\/\w+/.test(userAgent);
  20510. // This is woefully incomplete. Suggestions for alternative methods welcome.
  20511. var mobile = ios || /Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(userAgent);
  20512. var mac = ios || /Mac/.test(platform);
  20513. var chromeOS = /\bCrOS\b/.test(userAgent);
  20514. var windows = /win/i.test(platform);
  20515. var presto_version = presto && userAgent.match(/Version\/(\d*\.\d*)/);
  20516. if (presto_version) presto_version = Number(presto_version[1]);
  20517. if (presto_version && presto_version >= 15) { presto = false; webkit = true; }
  20518. // Some browsers use the wrong event properties to signal cmd/ctrl on OS X
  20519. var flipCtrlCmd = mac && (qtwebkit || presto && (presto_version == null || presto_version < 12.11));
  20520. var captureRightClick = gecko || (ie && ie_version >= 9);
  20521. // Optimize some code when these features are not used.
  20522. var sawReadOnlySpans = false, sawCollapsedSpans = false;
  20523. // EDITOR CONSTRUCTOR
  20524. // A CodeMirror instance represents an editor. This is the object
  20525. // that user code is usually dealing with.
  20526. function CodeMirror(place, options) {
  20527. if (!(this instanceof CodeMirror)) return new CodeMirror(place, options);
  20528. this.options = options = options ? copyObj(options) : {};
  20529. // Determine effective options based on given values and defaults.
  20530. copyObj(defaults, options, false);
  20531. setGuttersForLineNumbers(options);
  20532. var doc = options.value;
  20533. if (typeof doc == "string") doc = new Doc(doc, options.mode, null, options.lineSeparator);
  20534. this.doc = doc;
  20535. var input = new CodeMirror.inputStyles[options.inputStyle](this);
  20536. var display = this.display = new Display(place, doc, input);
  20537. display.wrapper.CodeMirror = this;
  20538. updateGutters(this);
  20539. themeChanged(this);
  20540. if (options.lineWrapping)
  20541. this.display.wrapper.className += " CodeMirror-wrap";
  20542. if (options.autofocus && !mobile) display.input.focus();
  20543. initScrollbars(this);
  20544. this.state = {
  20545. keyMaps: [], // stores maps added by addKeyMap
  20546. overlays: [], // highlighting overlays, as added by addOverlay
  20547. modeGen: 0, // bumped when mode/overlay changes, used to invalidate highlighting info
  20548. overwrite: false,
  20549. delayingBlurEvent: false,
  20550. focused: false,
  20551. suppressEdits: false, // used to disable editing during key handlers when in readOnly mode
  20552. pasteIncoming: false, cutIncoming: false, // help recognize paste/cut edits in input.poll
  20553. selectingText: false,
  20554. draggingText: false,
  20555. highlight: new Delayed(), // stores highlight worker timeout
  20556. keySeq: null, // Unfinished key sequence
  20557. specialChars: null
  20558. };
  20559. var cm = this;
  20560. // Override magic textarea content restore that IE sometimes does
  20561. // on our hidden textarea on reload
  20562. if (ie && ie_version < 11) setTimeout(function() { cm.display.input.reset(true); }, 20);
  20563. registerEventHandlers(this);
  20564. ensureGlobalHandlers();
  20565. startOperation(this);
  20566. this.curOp.forceUpdate = true;
  20567. attachDoc(this, doc);
  20568. if ((options.autofocus && !mobile) || cm.hasFocus())
  20569. setTimeout(bind(onFocus, this), 20);
  20570. else
  20571. onBlur(this);
  20572. for (var opt in optionHandlers) if (optionHandlers.hasOwnProperty(opt))
  20573. optionHandlers[opt](this, options[opt], Init);
  20574. maybeUpdateLineNumberWidth(this);
  20575. if (options.finishInit) options.finishInit(this);
  20576. for (var i = 0; i < initHooks.length; ++i) initHooks[i](this);
  20577. endOperation(this);
  20578. // Suppress optimizelegibility in Webkit, since it breaks text
  20579. // measuring on line wrapping boundaries.
  20580. if (webkit && options.lineWrapping &&
  20581. getComputedStyle(display.lineDiv).textRendering == "optimizelegibility")
  20582. display.lineDiv.style.textRendering = "auto";
  20583. }
  20584. // DISPLAY CONSTRUCTOR
  20585. // The display handles the DOM integration, both for input reading
  20586. // and content drawing. It holds references to DOM nodes and
  20587. // display-related state.
  20588. function Display(place, doc, input) {
  20589. var d = this;
  20590. this.input = input;
  20591. // Covers bottom-right square when both scrollbars are present.
  20592. d.scrollbarFiller = elt("div", null, "CodeMirror-scrollbar-filler");
  20593. d.scrollbarFiller.setAttribute("cm-not-content", "true");
  20594. // Covers bottom of gutter when coverGutterNextToScrollbar is on
  20595. // and h scrollbar is present.
  20596. d.gutterFiller = elt("div", null, "CodeMirror-gutter-filler");
  20597. d.gutterFiller.setAttribute("cm-not-content", "true");
  20598. // Will contain the actual code, positioned to cover the viewport.
  20599. d.lineDiv = elt("div", null, "CodeMirror-code");
  20600. // Elements are added to these to represent selection and cursors.
  20601. d.selectionDiv = elt("div", null, null, "position: relative; z-index: 1");
  20602. d.cursorDiv = elt("div", null, "CodeMirror-cursors");
  20603. // A visibility: hidden element used to find the size of things.
  20604. d.measure = elt("div", null, "CodeMirror-measure");
  20605. // When lines outside of the viewport are measured, they are drawn in this.
  20606. d.lineMeasure = elt("div", null, "CodeMirror-measure");
  20607. // Wraps everything that needs to exist inside the vertically-padded coordinate system
  20608. d.lineSpace = elt("div", [d.measure, d.lineMeasure, d.selectionDiv, d.cursorDiv, d.lineDiv],
  20609. null, "position: relative; outline: none");
  20610. // Moved around its parent to cover visible view.
  20611. d.mover = elt("div", [elt("div", [d.lineSpace], "CodeMirror-lines")], null, "position: relative");
  20612. // Set to the height of the document, allowing scrolling.
  20613. d.sizer = elt("div", [d.mover], "CodeMirror-sizer");
  20614. d.sizerWidth = null;
  20615. // Behavior of elts with overflow: auto and padding is
  20616. // inconsistent across browsers. This is used to ensure the
  20617. // scrollable area is big enough.
  20618. d.heightForcer = elt("div", null, null, "position: absolute; height: " + scrollerGap + "px; width: 1px;");
  20619. // Will contain the gutters, if any.
  20620. d.gutters = elt("div", null, "CodeMirror-gutters");
  20621. d.lineGutter = null;
  20622. // Actual scrollable element.
  20623. d.scroller = elt("div", [d.sizer, d.heightForcer, d.gutters], "CodeMirror-scroll");
  20624. d.scroller.setAttribute("tabIndex", "-1");
  20625. // The element in which the editor lives.
  20626. d.wrapper = elt("div", [d.scrollbarFiller, d.gutterFiller, d.scroller], "CodeMirror");
  20627. // Work around IE7 z-index bug (not perfect, hence IE7 not really being supported)
  20628. if (ie && ie_version < 8) { d.gutters.style.zIndex = -1; d.scroller.style.paddingRight = 0; }
  20629. if (!webkit && !(gecko && mobile)) d.scroller.draggable = true;
  20630. if (place) {
  20631. if (place.appendChild) place.appendChild(d.wrapper);
  20632. else place(d.wrapper);
  20633. }
  20634. // Current rendered range (may be bigger than the view window).
  20635. d.viewFrom = d.viewTo = doc.first;
  20636. d.reportedViewFrom = d.reportedViewTo = doc.first;
  20637. // Information about the rendered lines.
  20638. d.view = [];
  20639. d.renderedView = null;
  20640. // Holds info about a single rendered line when it was rendered
  20641. // for measurement, while not in view.
  20642. d.externalMeasured = null;
  20643. // Empty space (in pixels) above the view
  20644. d.viewOffset = 0;
  20645. d.lastWrapHeight = d.lastWrapWidth = 0;
  20646. d.updateLineNumbers = null;
  20647. d.nativeBarWidth = d.barHeight = d.barWidth = 0;
  20648. d.scrollbarsClipped = false;
  20649. // Used to only resize the line number gutter when necessary (when
  20650. // the amount of lines crosses a boundary that makes its width change)
  20651. d.lineNumWidth = d.lineNumInnerWidth = d.lineNumChars = null;
  20652. // Set to true when a non-horizontal-scrolling line widget is
  20653. // added. As an optimization, line widget aligning is skipped when
  20654. // this is false.
  20655. d.alignWidgets = false;
  20656. d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null;
  20657. // Tracks the maximum line length so that the horizontal scrollbar
  20658. // can be kept static when scrolling.
  20659. d.maxLine = null;
  20660. d.maxLineLength = 0;
  20661. d.maxLineChanged = false;
  20662. // Used for measuring wheel scrolling granularity
  20663. d.wheelDX = d.wheelDY = d.wheelStartX = d.wheelStartY = null;
  20664. // True when shift is held down.
  20665. d.shift = false;
  20666. // Used to track whether anything happened since the context menu
  20667. // was opened.
  20668. d.selForContextMenu = null;
  20669. d.activeTouch = null;
  20670. input.init(d);
  20671. }
  20672. // STATE UPDATES
  20673. // Used to get the editor into a consistent state again when options change.
  20674. function loadMode(cm) {
  20675. cm.doc.mode = CodeMirror.getMode(cm.options, cm.doc.modeOption);
  20676. resetModeState(cm);
  20677. }
  20678. function resetModeState(cm) {
  20679. cm.doc.iter(function(line) {
  20680. if (line.stateAfter) line.stateAfter = null;
  20681. if (line.styles) line.styles = null;
  20682. });
  20683. cm.doc.frontier = cm.doc.first;
  20684. startWorker(cm, 100);
  20685. cm.state.modeGen++;
  20686. if (cm.curOp) regChange(cm);
  20687. }
  20688. function wrappingChanged(cm) {
  20689. if (cm.options.lineWrapping) {
  20690. addClass(cm.display.wrapper, "CodeMirror-wrap");
  20691. cm.display.sizer.style.minWidth = "";
  20692. cm.display.sizerWidth = null;
  20693. } else {
  20694. rmClass(cm.display.wrapper, "CodeMirror-wrap");
  20695. findMaxLine(cm);
  20696. }
  20697. estimateLineHeights(cm);
  20698. regChange(cm);
  20699. clearCaches(cm);
  20700. setTimeout(function(){updateScrollbars(cm);}, 100);
  20701. }
  20702. // Returns a function that estimates the height of a line, to use as
  20703. // first approximation until the line becomes visible (and is thus
  20704. // properly measurable).
  20705. function estimateHeight(cm) {
  20706. var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;
  20707. var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);
  20708. return function(line) {
  20709. if (lineIsHidden(cm.doc, line)) return 0;
  20710. var widgetsHeight = 0;
  20711. if (line.widgets) for (var i = 0; i < line.widgets.length; i++) {
  20712. if (line.widgets[i].height) widgetsHeight += line.widgets[i].height;
  20713. }
  20714. if (wrapping)
  20715. return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th;
  20716. else
  20717. return widgetsHeight + th;
  20718. };
  20719. }
  20720. function estimateLineHeights(cm) {
  20721. var doc = cm.doc, est = estimateHeight(cm);
  20722. doc.iter(function(line) {
  20723. var estHeight = est(line);
  20724. if (estHeight != line.height) updateLineHeight(line, estHeight);
  20725. });
  20726. }
  20727. function themeChanged(cm) {
  20728. cm.display.wrapper.className = cm.display.wrapper.className.replace(/\s*cm-s-\S+/g, "") +
  20729. cm.options.theme.replace(/(^|\s)\s*/g, " cm-s-");
  20730. clearCaches(cm);
  20731. }
  20732. function guttersChanged(cm) {
  20733. updateGutters(cm);
  20734. regChange(cm);
  20735. setTimeout(function(){alignHorizontally(cm);}, 20);
  20736. }
  20737. // Rebuild the gutter elements, ensure the margin to the left of the
  20738. // code matches their width.
  20739. function updateGutters(cm) {
  20740. var gutters = cm.display.gutters, specs = cm.options.gutters;
  20741. removeChildren(gutters);
  20742. for (var i = 0; i < specs.length; ++i) {
  20743. var gutterClass = specs[i];
  20744. var gElt = gutters.appendChild(elt("div", null, "CodeMirror-gutter " + gutterClass));
  20745. if (gutterClass == "CodeMirror-linenumbers") {
  20746. cm.display.lineGutter = gElt;
  20747. gElt.style.width = (cm.display.lineNumWidth || 1) + "px";
  20748. }
  20749. }
  20750. gutters.style.display = i ? "" : "none";
  20751. updateGutterSpace(cm);
  20752. }
  20753. function updateGutterSpace(cm) {
  20754. var width = cm.display.gutters.offsetWidth;
  20755. cm.display.sizer.style.marginLeft = width + "px";
  20756. }
  20757. // Compute the character length of a line, taking into account
  20758. // collapsed ranges (see markText) that might hide parts, and join
  20759. // other lines onto it.
  20760. function lineLength(line) {
  20761. if (line.height == 0) return 0;
  20762. var len = line.text.length, merged, cur = line;
  20763. while (merged = collapsedSpanAtStart(cur)) {
  20764. var found = merged.find(0, true);
  20765. cur = found.from.line;
  20766. len += found.from.ch - found.to.ch;
  20767. }
  20768. cur = line;
  20769. while (merged = collapsedSpanAtEnd(cur)) {
  20770. var found = merged.find(0, true);
  20771. len -= cur.text.length - found.from.ch;
  20772. cur = found.to.line;
  20773. len += cur.text.length - found.to.ch;
  20774. }
  20775. return len;
  20776. }
  20777. // Find the longest line in the document.
  20778. function findMaxLine(cm) {
  20779. var d = cm.display, doc = cm.doc;
  20780. d.maxLine = getLine(doc, doc.first);
  20781. d.maxLineLength = lineLength(d.maxLine);
  20782. d.maxLineChanged = true;
  20783. doc.iter(function(line) {
  20784. var len = lineLength(line);
  20785. if (len > d.maxLineLength) {
  20786. d.maxLineLength = len;
  20787. d.maxLine = line;
  20788. }
  20789. });
  20790. }
  20791. // Make sure the gutters options contains the element
  20792. // "CodeMirror-linenumbers" when the lineNumbers option is true.
  20793. function setGuttersForLineNumbers(options) {
  20794. var found = indexOf(options.gutters, "CodeMirror-linenumbers");
  20795. if (found == -1 && options.lineNumbers) {
  20796. options.gutters = options.gutters.concat(["CodeMirror-linenumbers"]);
  20797. } else if (found > -1 && !options.lineNumbers) {
  20798. options.gutters = options.gutters.slice(0);
  20799. options.gutters.splice(found, 1);
  20800. }
  20801. }
  20802. // SCROLLBARS
  20803. // Prepare DOM reads needed to update the scrollbars. Done in one
  20804. // shot to minimize update/measure roundtrips.
  20805. function measureForScrollbars(cm) {
  20806. var d = cm.display, gutterW = d.gutters.offsetWidth;
  20807. var docH = Math.round(cm.doc.height + paddingVert(cm.display));
  20808. return {
  20809. clientHeight: d.scroller.clientHeight,
  20810. viewHeight: d.wrapper.clientHeight,
  20811. scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth,
  20812. viewWidth: d.wrapper.clientWidth,
  20813. barLeft: cm.options.fixedGutter ? gutterW : 0,
  20814. docHeight: docH,
  20815. scrollHeight: docH + scrollGap(cm) + d.barHeight,
  20816. nativeBarWidth: d.nativeBarWidth,
  20817. gutterWidth: gutterW
  20818. };
  20819. }
  20820. function NativeScrollbars(place, scroll, cm) {
  20821. this.cm = cm;
  20822. var vert = this.vert = elt("div", [elt("div", null, null, "min-width: 1px")], "CodeMirror-vscrollbar");
  20823. var horiz = this.horiz = elt("div", [elt("div", null, null, "height: 100%; min-height: 1px")], "CodeMirror-hscrollbar");
  20824. place(vert); place(horiz);
  20825. on(vert, "scroll", function() {
  20826. if (vert.clientHeight) scroll(vert.scrollTop, "vertical");
  20827. });
  20828. on(horiz, "scroll", function() {
  20829. if (horiz.clientWidth) scroll(horiz.scrollLeft, "horizontal");
  20830. });
  20831. this.checkedZeroWidth = false;
  20832. // Need to set a minimum width to see the scrollbar on IE7 (but must not set it on IE8).
  20833. if (ie && ie_version < 8) this.horiz.style.minHeight = this.vert.style.minWidth = "18px";
  20834. }
  20835. NativeScrollbars.prototype = copyObj({
  20836. update: function(measure) {
  20837. var needsH = measure.scrollWidth > measure.clientWidth + 1;
  20838. var needsV = measure.scrollHeight > measure.clientHeight + 1;
  20839. var sWidth = measure.nativeBarWidth;
  20840. if (needsV) {
  20841. this.vert.style.display = "block";
  20842. this.vert.style.bottom = needsH ? sWidth + "px" : "0";
  20843. var totalHeight = measure.viewHeight - (needsH ? sWidth : 0);
  20844. // A bug in IE8 can cause this value to be negative, so guard it.
  20845. this.vert.firstChild.style.height =
  20846. Math.max(0, measure.scrollHeight - measure.clientHeight + totalHeight) + "px";
  20847. } else {
  20848. this.vert.style.display = "";
  20849. this.vert.firstChild.style.height = "0";
  20850. }
  20851. if (needsH) {
  20852. this.horiz.style.display = "block";
  20853. this.horiz.style.right = needsV ? sWidth + "px" : "0";
  20854. this.horiz.style.left = measure.barLeft + "px";
  20855. var totalWidth = measure.viewWidth - measure.barLeft - (needsV ? sWidth : 0);
  20856. this.horiz.firstChild.style.width =
  20857. (measure.scrollWidth - measure.clientWidth + totalWidth) + "px";
  20858. } else {
  20859. this.horiz.style.display = "";
  20860. this.horiz.firstChild.style.width = "0";
  20861. }
  20862. if (!this.checkedZeroWidth && measure.clientHeight > 0) {
  20863. if (sWidth == 0) this.zeroWidthHack();
  20864. this.checkedZeroWidth = true;
  20865. }
  20866. return {right: needsV ? sWidth : 0, bottom: needsH ? sWidth : 0};
  20867. },
  20868. setScrollLeft: function(pos) {
  20869. if (this.horiz.scrollLeft != pos) this.horiz.scrollLeft = pos;
  20870. if (this.disableHoriz) this.enableZeroWidthBar(this.horiz, this.disableHoriz);
  20871. },
  20872. setScrollTop: function(pos) {
  20873. if (this.vert.scrollTop != pos) this.vert.scrollTop = pos;
  20874. if (this.disableVert) this.enableZeroWidthBar(this.vert, this.disableVert);
  20875. },
  20876. zeroWidthHack: function() {
  20877. var w = mac && !mac_geMountainLion ? "12px" : "18px";
  20878. this.horiz.style.height = this.vert.style.width = w;
  20879. this.horiz.style.pointerEvents = this.vert.style.pointerEvents = "none";
  20880. this.disableHoriz = new Delayed;
  20881. this.disableVert = new Delayed;
  20882. },
  20883. enableZeroWidthBar: function(bar, delay) {
  20884. bar.style.pointerEvents = "auto";
  20885. function maybeDisable() {
  20886. // To find out whether the scrollbar is still visible, we
  20887. // check whether the element under the pixel in the bottom
  20888. // left corner of the scrollbar box is the scrollbar box
  20889. // itself (when the bar is still visible) or its filler child
  20890. // (when the bar is hidden). If it is still visible, we keep
  20891. // it enabled, if it's hidden, we disable pointer events.
  20892. var box = bar.getBoundingClientRect();
  20893. var elt = document.elementFromPoint(box.left + 1, box.bottom - 1);
  20894. if (elt != bar) bar.style.pointerEvents = "none";
  20895. else delay.set(1000, maybeDisable);
  20896. }
  20897. delay.set(1000, maybeDisable);
  20898. },
  20899. clear: function() {
  20900. var parent = this.horiz.parentNode;
  20901. parent.removeChild(this.horiz);
  20902. parent.removeChild(this.vert);
  20903. }
  20904. }, NativeScrollbars.prototype);
  20905. function NullScrollbars() {}
  20906. NullScrollbars.prototype = copyObj({
  20907. update: function() { return {bottom: 0, right: 0}; },
  20908. setScrollLeft: function() {},
  20909. setScrollTop: function() {},
  20910. clear: function() {}
  20911. }, NullScrollbars.prototype);
  20912. CodeMirror.scrollbarModel = {"native": NativeScrollbars, "null": NullScrollbars};
  20913. function initScrollbars(cm) {
  20914. if (cm.display.scrollbars) {
  20915. cm.display.scrollbars.clear();
  20916. if (cm.display.scrollbars.addClass)
  20917. rmClass(cm.display.wrapper, cm.display.scrollbars.addClass);
  20918. }
  20919. cm.display.scrollbars = new CodeMirror.scrollbarModel[cm.options.scrollbarStyle](function(node) {
  20920. cm.display.wrapper.insertBefore(node, cm.display.scrollbarFiller);
  20921. // Prevent clicks in the scrollbars from killing focus
  20922. on(node, "mousedown", function() {
  20923. if (cm.state.focused) setTimeout(function() { cm.display.input.focus(); }, 0);
  20924. });
  20925. node.setAttribute("cm-not-content", "true");
  20926. }, function(pos, axis) {
  20927. if (axis == "horizontal") setScrollLeft(cm, pos);
  20928. else setScrollTop(cm, pos);
  20929. }, cm);
  20930. if (cm.display.scrollbars.addClass)
  20931. addClass(cm.display.wrapper, cm.display.scrollbars.addClass);
  20932. }
  20933. function updateScrollbars(cm, measure) {
  20934. if (!measure) measure = measureForScrollbars(cm);
  20935. var startWidth = cm.display.barWidth, startHeight = cm.display.barHeight;
  20936. updateScrollbarsInner(cm, measure);
  20937. for (var i = 0; i < 4 && startWidth != cm.display.barWidth || startHeight != cm.display.barHeight; i++) {
  20938. if (startWidth != cm.display.barWidth && cm.options.lineWrapping)
  20939. updateHeightsInViewport(cm);
  20940. updateScrollbarsInner(cm, measureForScrollbars(cm));
  20941. startWidth = cm.display.barWidth; startHeight = cm.display.barHeight;
  20942. }
  20943. }
  20944. // Re-synchronize the fake scrollbars with the actual size of the
  20945. // content.
  20946. function updateScrollbarsInner(cm, measure) {
  20947. var d = cm.display;
  20948. var sizes = d.scrollbars.update(measure);
  20949. d.sizer.style.paddingRight = (d.barWidth = sizes.right) + "px";
  20950. d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + "px";
  20951. d.heightForcer.style.borderBottom = sizes.bottom + "px solid transparent"
  20952. if (sizes.right && sizes.bottom) {
  20953. d.scrollbarFiller.style.display = "block";
  20954. d.scrollbarFiller.style.height = sizes.bottom + "px";
  20955. d.scrollbarFiller.style.width = sizes.right + "px";
  20956. } else d.scrollbarFiller.style.display = "";
  20957. if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {
  20958. d.gutterFiller.style.display = "block";
  20959. d.gutterFiller.style.height = sizes.bottom + "px";
  20960. d.gutterFiller.style.width = measure.gutterWidth + "px";
  20961. } else d.gutterFiller.style.display = "";
  20962. }
  20963. // Compute the lines that are visible in a given viewport (defaults
  20964. // the the current scroll position). viewport may contain top,
  20965. // height, and ensure (see op.scrollToPos) properties.
  20966. function visibleLines(display, doc, viewport) {
  20967. var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;
  20968. top = Math.floor(top - paddingTop(display));
  20969. var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;
  20970. var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);
  20971. // Ensure is a {from: {line, ch}, to: {line, ch}} object, and
  20972. // forces those lines into the viewport (if possible).
  20973. if (viewport && viewport.ensure) {
  20974. var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;
  20975. if (ensureFrom < from) {
  20976. from = ensureFrom;
  20977. to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);
  20978. } else if (Math.min(ensureTo, doc.lastLine()) >= to) {
  20979. from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);
  20980. to = ensureTo;
  20981. }
  20982. }
  20983. return {from: from, to: Math.max(to, from + 1)};
  20984. }
  20985. // LINE NUMBERS
  20986. // Re-align line numbers and gutter marks to compensate for
  20987. // horizontal scrolling.
  20988. function alignHorizontally(cm) {
  20989. var display = cm.display, view = display.view;
  20990. if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) return;
  20991. var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;
  20992. var gutterW = display.gutters.offsetWidth, left = comp + "px";
  20993. for (var i = 0; i < view.length; i++) if (!view[i].hidden) {
  20994. if (cm.options.fixedGutter && view[i].gutter)
  20995. view[i].gutter.style.left = left;
  20996. var align = view[i].alignable;
  20997. if (align) for (var j = 0; j < align.length; j++)
  20998. align[j].style.left = left;
  20999. }
  21000. if (cm.options.fixedGutter)
  21001. display.gutters.style.left = (comp + gutterW) + "px";
  21002. }
  21003. // Used to ensure that the line number gutter is still the right
  21004. // size for the current document size. Returns true when an update
  21005. // is needed.
  21006. function maybeUpdateLineNumberWidth(cm) {
  21007. if (!cm.options.lineNumbers) return false;
  21008. var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;
  21009. if (last.length != display.lineNumChars) {
  21010. var test = display.measure.appendChild(elt("div", [elt("div", last)],
  21011. "CodeMirror-linenumber CodeMirror-gutter-elt"));
  21012. var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;
  21013. display.lineGutter.style.width = "";
  21014. display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;
  21015. display.lineNumWidth = display.lineNumInnerWidth + padding;
  21016. display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;
  21017. display.lineGutter.style.width = display.lineNumWidth + "px";
  21018. updateGutterSpace(cm);
  21019. return true;
  21020. }
  21021. return false;
  21022. }
  21023. function lineNumberFor(options, i) {
  21024. return String(options.lineNumberFormatter(i + options.firstLineNumber));
  21025. }
  21026. // Computes display.scroller.scrollLeft + display.gutters.offsetWidth,
  21027. // but using getBoundingClientRect to get a sub-pixel-accurate
  21028. // result.
  21029. function compensateForHScroll(display) {
  21030. return display.scroller.getBoundingClientRect().left - display.sizer.getBoundingClientRect().left;
  21031. }
  21032. // DISPLAY DRAWING
  21033. function DisplayUpdate(cm, viewport, force) {
  21034. var display = cm.display;
  21035. this.viewport = viewport;
  21036. // Store some values that we'll need later (but don't want to force a relayout for)
  21037. this.visible = visibleLines(display, cm.doc, viewport);
  21038. this.editorIsHidden = !display.wrapper.offsetWidth;
  21039. this.wrapperHeight = display.wrapper.clientHeight;
  21040. this.wrapperWidth = display.wrapper.clientWidth;
  21041. this.oldDisplayWidth = displayWidth(cm);
  21042. this.force = force;
  21043. this.dims = getDimensions(cm);
  21044. this.events = [];
  21045. }
  21046. DisplayUpdate.prototype.signal = function(emitter, type) {
  21047. if (hasHandler(emitter, type))
  21048. this.events.push(arguments);
  21049. };
  21050. DisplayUpdate.prototype.finish = function() {
  21051. for (var i = 0; i < this.events.length; i++)
  21052. signal.apply(null, this.events[i]);
  21053. };
  21054. function maybeClipScrollbars(cm) {
  21055. var display = cm.display;
  21056. if (!display.scrollbarsClipped && display.scroller.offsetWidth) {
  21057. display.nativeBarWidth = display.scroller.offsetWidth - display.scroller.clientWidth;
  21058. display.heightForcer.style.height = scrollGap(cm) + "px";
  21059. display.sizer.style.marginBottom = -display.nativeBarWidth + "px";
  21060. display.sizer.style.borderRightWidth = scrollGap(cm) + "px";
  21061. display.scrollbarsClipped = true;
  21062. }
  21063. }
  21064. // Does the actual updating of the line display. Bails out
  21065. // (returning false) when there is nothing to be done and forced is
  21066. // false.
  21067. function updateDisplayIfNeeded(cm, update) {
  21068. var display = cm.display, doc = cm.doc;
  21069. if (update.editorIsHidden) {
  21070. resetView(cm);
  21071. return false;
  21072. }
  21073. // Bail out if the visible area is already rendered and nothing changed.
  21074. if (!update.force &&
  21075. update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&
  21076. (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&
  21077. display.renderedView == display.view && countDirtyView(cm) == 0)
  21078. return false;
  21079. if (maybeUpdateLineNumberWidth(cm)) {
  21080. resetView(cm);
  21081. update.dims = getDimensions(cm);
  21082. }
  21083. // Compute a suitable new viewport (from & to)
  21084. var end = doc.first + doc.size;
  21085. var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);
  21086. var to = Math.min(end, update.visible.to + cm.options.viewportMargin);
  21087. if (display.viewFrom < from && from - display.viewFrom < 20) from = Math.max(doc.first, display.viewFrom);
  21088. if (display.viewTo > to && display.viewTo - to < 20) to = Math.min(end, display.viewTo);
  21089. if (sawCollapsedSpans) {
  21090. from = visualLineNo(cm.doc, from);
  21091. to = visualLineEndNo(cm.doc, to);
  21092. }
  21093. var different = from != display.viewFrom || to != display.viewTo ||
  21094. display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;
  21095. adjustView(cm, from, to);
  21096. display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));
  21097. // Position the mover div to align with the current scroll position
  21098. cm.display.mover.style.top = display.viewOffset + "px";
  21099. var toUpdate = countDirtyView(cm);
  21100. if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&
  21101. (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))
  21102. return false;
  21103. // For big changes, we hide the enclosing element during the
  21104. // update, since that speeds up the operations on most browsers.
  21105. var focused = activeElt();
  21106. if (toUpdate > 4) display.lineDiv.style.display = "none";
  21107. patchDisplay(cm, display.updateLineNumbers, update.dims);
  21108. if (toUpdate > 4) display.lineDiv.style.display = "";
  21109. display.renderedView = display.view;
  21110. // There might have been a widget with a focused element that got
  21111. // hidden or updated, if so re-focus it.
  21112. if (focused && activeElt() != focused && focused.offsetHeight) focused.focus();
  21113. // Prevent selection and cursors from interfering with the scroll
  21114. // width and height.
  21115. removeChildren(display.cursorDiv);
  21116. removeChildren(display.selectionDiv);
  21117. display.gutters.style.height = display.sizer.style.minHeight = 0;
  21118. if (different) {
  21119. display.lastWrapHeight = update.wrapperHeight;
  21120. display.lastWrapWidth = update.wrapperWidth;
  21121. startWorker(cm, 400);
  21122. }
  21123. display.updateLineNumbers = null;
  21124. return true;
  21125. }
  21126. function postUpdateDisplay(cm, update) {
  21127. var viewport = update.viewport;
  21128. for (var first = true;; first = false) {
  21129. if (!first || !cm.options.lineWrapping || update.oldDisplayWidth == displayWidth(cm)) {
  21130. // Clip forced viewport to actual scrollable area.
  21131. if (viewport && viewport.top != null)
  21132. viewport = {top: Math.min(cm.doc.height + paddingVert(cm.display) - displayHeight(cm), viewport.top)};
  21133. // Updated line heights might result in the drawn area not
  21134. // actually covering the viewport. Keep looping until it does.
  21135. update.visible = visibleLines(cm.display, cm.doc, viewport);
  21136. if (update.visible.from >= cm.display.viewFrom && update.visible.to <= cm.display.viewTo)
  21137. break;
  21138. }
  21139. if (!updateDisplayIfNeeded(cm, update)) break;
  21140. updateHeightsInViewport(cm);
  21141. var barMeasure = measureForScrollbars(cm);
  21142. updateSelection(cm);
  21143. updateScrollbars(cm, barMeasure);
  21144. setDocumentHeight(cm, barMeasure);
  21145. }
  21146. update.signal(cm, "update", cm);
  21147. if (cm.display.viewFrom != cm.display.reportedViewFrom || cm.display.viewTo != cm.display.reportedViewTo) {
  21148. update.signal(cm, "viewportChange", cm, cm.display.viewFrom, cm.display.viewTo);
  21149. cm.display.reportedViewFrom = cm.display.viewFrom; cm.display.reportedViewTo = cm.display.viewTo;
  21150. }
  21151. }
  21152. function updateDisplaySimple(cm, viewport) {
  21153. var update = new DisplayUpdate(cm, viewport);
  21154. if (updateDisplayIfNeeded(cm, update)) {
  21155. updateHeightsInViewport(cm);
  21156. postUpdateDisplay(cm, update);
  21157. var barMeasure = measureForScrollbars(cm);
  21158. updateSelection(cm);
  21159. updateScrollbars(cm, barMeasure);
  21160. setDocumentHeight(cm, barMeasure);
  21161. update.finish();
  21162. }
  21163. }
  21164. function setDocumentHeight(cm, measure) {
  21165. cm.display.sizer.style.minHeight = measure.docHeight + "px";
  21166. cm.display.heightForcer.style.top = measure.docHeight + "px";
  21167. cm.display.gutters.style.height = (measure.docHeight + cm.display.barHeight + scrollGap(cm)) + "px";
  21168. }
  21169. // Read the actual heights of the rendered lines, and update their
  21170. // stored heights to match.
  21171. function updateHeightsInViewport(cm) {
  21172. var display = cm.display;
  21173. var prevBottom = display.lineDiv.offsetTop;
  21174. for (var i = 0; i < display.view.length; i++) {
  21175. var cur = display.view[i], height;
  21176. if (cur.hidden) continue;
  21177. if (ie && ie_version < 8) {
  21178. var bot = cur.node.offsetTop + cur.node.offsetHeight;
  21179. height = bot - prevBottom;
  21180. prevBottom = bot;
  21181. } else {
  21182. var box = cur.node.getBoundingClientRect();
  21183. height = box.bottom - box.top;
  21184. }
  21185. var diff = cur.line.height - height;
  21186. if (height < 2) height = textHeight(display);
  21187. if (diff > .001 || diff < -.001) {
  21188. updateLineHeight(cur.line, height);
  21189. updateWidgetHeight(cur.line);
  21190. if (cur.rest) for (var j = 0; j < cur.rest.length; j++)
  21191. updateWidgetHeight(cur.rest[j]);
  21192. }
  21193. }
  21194. }
  21195. // Read and store the height of line widgets associated with the
  21196. // given line.
  21197. function updateWidgetHeight(line) {
  21198. if (line.widgets) for (var i = 0; i < line.widgets.length; ++i)
  21199. line.widgets[i].height = line.widgets[i].node.parentNode.offsetHeight;
  21200. }
  21201. // Do a bulk-read of the DOM positions and sizes needed to draw the
  21202. // view, so that we don't interleave reading and writing to the DOM.
  21203. function getDimensions(cm) {
  21204. var d = cm.display, left = {}, width = {};
  21205. var gutterLeft = d.gutters.clientLeft;
  21206. for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) {
  21207. left[cm.options.gutters[i]] = n.offsetLeft + n.clientLeft + gutterLeft;
  21208. width[cm.options.gutters[i]] = n.clientWidth;
  21209. }
  21210. return {fixedPos: compensateForHScroll(d),
  21211. gutterTotalWidth: d.gutters.offsetWidth,
  21212. gutterLeft: left,
  21213. gutterWidth: width,
  21214. wrapperWidth: d.wrapper.clientWidth};
  21215. }
  21216. // Sync the actual display DOM structure with display.view, removing
  21217. // nodes for lines that are no longer in view, and creating the ones
  21218. // that are not there yet, and updating the ones that are out of
  21219. // date.
  21220. function patchDisplay(cm, updateNumbersFrom, dims) {
  21221. var display = cm.display, lineNumbers = cm.options.lineNumbers;
  21222. var container = display.lineDiv, cur = container.firstChild;
  21223. function rm(node) {
  21224. var next = node.nextSibling;
  21225. // Works around a throw-scroll bug in OS X Webkit
  21226. if (webkit && mac && cm.display.currentWheelTarget == node)
  21227. node.style.display = "none";
  21228. else
  21229. node.parentNode.removeChild(node);
  21230. return next;
  21231. }
  21232. var view = display.view, lineN = display.viewFrom;
  21233. // Loop over the elements in the view, syncing cur (the DOM nodes
  21234. // in display.lineDiv) with the view as we go.
  21235. for (var i = 0; i < view.length; i++) {
  21236. var lineView = view[i];
  21237. if (lineView.hidden) {
  21238. } else if (!lineView.node || lineView.node.parentNode != container) { // Not drawn yet
  21239. var node = buildLineElement(cm, lineView, lineN, dims);
  21240. container.insertBefore(node, cur);
  21241. } else { // Already drawn
  21242. while (cur != lineView.node) cur = rm(cur);
  21243. var updateNumber = lineNumbers && updateNumbersFrom != null &&
  21244. updateNumbersFrom <= lineN && lineView.lineNumber;
  21245. if (lineView.changes) {
  21246. if (indexOf(lineView.changes, "gutter") > -1) updateNumber = false;
  21247. updateLineForChanges(cm, lineView, lineN, dims);
  21248. }
  21249. if (updateNumber) {
  21250. removeChildren(lineView.lineNumber);
  21251. lineView.lineNumber.appendChild(document.createTextNode(lineNumberFor(cm.options, lineN)));
  21252. }
  21253. cur = lineView.node.nextSibling;
  21254. }
  21255. lineN += lineView.size;
  21256. }
  21257. while (cur) cur = rm(cur);
  21258. }
  21259. // When an aspect of a line changes, a string is added to
  21260. // lineView.changes. This updates the relevant part of the line's
  21261. // DOM structure.
  21262. function updateLineForChanges(cm, lineView, lineN, dims) {
  21263. for (var j = 0; j < lineView.changes.length; j++) {
  21264. var type = lineView.changes[j];
  21265. if (type == "text") updateLineText(cm, lineView);
  21266. else if (type == "gutter") updateLineGutter(cm, lineView, lineN, dims);
  21267. else if (type == "class") updateLineClasses(lineView);
  21268. else if (type == "widget") updateLineWidgets(cm, lineView, dims);
  21269. }
  21270. lineView.changes = null;
  21271. }
  21272. // Lines with gutter elements, widgets or a background class need to
  21273. // be wrapped, and have the extra elements added to the wrapper div
  21274. function ensureLineWrapped(lineView) {
  21275. if (lineView.node == lineView.text) {
  21276. lineView.node = elt("div", null, null, "position: relative");
  21277. if (lineView.text.parentNode)
  21278. lineView.text.parentNode.replaceChild(lineView.node, lineView.text);
  21279. lineView.node.appendChild(lineView.text);
  21280. if (ie && ie_version < 8) lineView.node.style.zIndex = 2;
  21281. }
  21282. return lineView.node;
  21283. }
  21284. function updateLineBackground(lineView) {
  21285. var cls = lineView.bgClass ? lineView.bgClass + " " + (lineView.line.bgClass || "") : lineView.line.bgClass;
  21286. if (cls) cls += " CodeMirror-linebackground";
  21287. if (lineView.background) {
  21288. if (cls) lineView.background.className = cls;
  21289. else { lineView.background.parentNode.removeChild(lineView.background); lineView.background = null; }
  21290. } else if (cls) {
  21291. var wrap = ensureLineWrapped(lineView);
  21292. lineView.background = wrap.insertBefore(elt("div", null, cls), wrap.firstChild);
  21293. }
  21294. }
  21295. // Wrapper around buildLineContent which will reuse the structure
  21296. // in display.externalMeasured when possible.
  21297. function getLineContent(cm, lineView) {
  21298. var ext = cm.display.externalMeasured;
  21299. if (ext && ext.line == lineView.line) {
  21300. cm.display.externalMeasured = null;
  21301. lineView.measure = ext.measure;
  21302. return ext.built;
  21303. }
  21304. return buildLineContent(cm, lineView);
  21305. }
  21306. // Redraw the line's text. Interacts with the background and text
  21307. // classes because the mode may output tokens that influence these
  21308. // classes.
  21309. function updateLineText(cm, lineView) {
  21310. var cls = lineView.text.className;
  21311. var built = getLineContent(cm, lineView);
  21312. if (lineView.text == lineView.node) lineView.node = built.pre;
  21313. lineView.text.parentNode.replaceChild(built.pre, lineView.text);
  21314. lineView.text = built.pre;
  21315. if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {
  21316. lineView.bgClass = built.bgClass;
  21317. lineView.textClass = built.textClass;
  21318. updateLineClasses(lineView);
  21319. } else if (cls) {
  21320. lineView.text.className = cls;
  21321. }
  21322. }
  21323. function updateLineClasses(lineView) {
  21324. updateLineBackground(lineView);
  21325. if (lineView.line.wrapClass)
  21326. ensureLineWrapped(lineView).className = lineView.line.wrapClass;
  21327. else if (lineView.node != lineView.text)
  21328. lineView.node.className = "";
  21329. var textClass = lineView.textClass ? lineView.textClass + " " + (lineView.line.textClass || "") : lineView.line.textClass;
  21330. lineView.text.className = textClass || "";
  21331. }
  21332. function updateLineGutter(cm, lineView, lineN, dims) {
  21333. if (lineView.gutter) {
  21334. lineView.node.removeChild(lineView.gutter);
  21335. lineView.gutter = null;
  21336. }
  21337. if (lineView.gutterBackground) {
  21338. lineView.node.removeChild(lineView.gutterBackground);
  21339. lineView.gutterBackground = null;
  21340. }
  21341. if (lineView.line.gutterClass) {
  21342. var wrap = ensureLineWrapped(lineView);
  21343. lineView.gutterBackground = elt("div", null, "CodeMirror-gutter-background " + lineView.line.gutterClass,
  21344. "left: " + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) +
  21345. "px; width: " + dims.gutterTotalWidth + "px");
  21346. wrap.insertBefore(lineView.gutterBackground, lineView.text);
  21347. }
  21348. var markers = lineView.line.gutterMarkers;
  21349. if (cm.options.lineNumbers || markers) {
  21350. var wrap = ensureLineWrapped(lineView);
  21351. var gutterWrap = lineView.gutter = elt("div", null, "CodeMirror-gutter-wrapper", "left: " +
  21352. (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + "px");
  21353. cm.display.input.setUneditable(gutterWrap);
  21354. wrap.insertBefore(gutterWrap, lineView.text);
  21355. if (lineView.line.gutterClass)
  21356. gutterWrap.className += " " + lineView.line.gutterClass;
  21357. if (cm.options.lineNumbers && (!markers || !markers["CodeMirror-linenumbers"]))
  21358. lineView.lineNumber = gutterWrap.appendChild(
  21359. elt("div", lineNumberFor(cm.options, lineN),
  21360. "CodeMirror-linenumber CodeMirror-gutter-elt",
  21361. "left: " + dims.gutterLeft["CodeMirror-linenumbers"] + "px; width: "
  21362. + cm.display.lineNumInnerWidth + "px"));
  21363. if (markers) for (var k = 0; k < cm.options.gutters.length; ++k) {
  21364. var id = cm.options.gutters[k], found = markers.hasOwnProperty(id) && markers[id];
  21365. if (found)
  21366. gutterWrap.appendChild(elt("div", [found], "CodeMirror-gutter-elt", "left: " +
  21367. dims.gutterLeft[id] + "px; width: " + dims.gutterWidth[id] + "px"));
  21368. }
  21369. }
  21370. }
  21371. function updateLineWidgets(cm, lineView, dims) {
  21372. if (lineView.alignable) lineView.alignable = null;
  21373. for (var node = lineView.node.firstChild, next; node; node = next) {
  21374. var next = node.nextSibling;
  21375. if (node.className == "CodeMirror-linewidget")
  21376. lineView.node.removeChild(node);
  21377. }
  21378. insertLineWidgets(cm, lineView, dims);
  21379. }
  21380. // Build a line's DOM representation from scratch
  21381. function buildLineElement(cm, lineView, lineN, dims) {
  21382. var built = getLineContent(cm, lineView);
  21383. lineView.text = lineView.node = built.pre;
  21384. if (built.bgClass) lineView.bgClass = built.bgClass;
  21385. if (built.textClass) lineView.textClass = built.textClass;
  21386. updateLineClasses(lineView);
  21387. updateLineGutter(cm, lineView, lineN, dims);
  21388. insertLineWidgets(cm, lineView, dims);
  21389. return lineView.node;
  21390. }
  21391. // A lineView may contain multiple logical lines (when merged by
  21392. // collapsed spans). The widgets for all of them need to be drawn.
  21393. function insertLineWidgets(cm, lineView, dims) {
  21394. insertLineWidgetsFor(cm, lineView.line, lineView, dims, true);
  21395. if (lineView.rest) for (var i = 0; i < lineView.rest.length; i++)
  21396. insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false);
  21397. }
  21398. function insertLineWidgetsFor(cm, line, lineView, dims, allowAbove) {
  21399. if (!line.widgets) return;
  21400. var wrap = ensureLineWrapped(lineView);
  21401. for (var i = 0, ws = line.widgets; i < ws.length; ++i) {
  21402. var widget = ws[i], node = elt("div", [widget.node], "CodeMirror-linewidget");
  21403. if (!widget.handleMouseEvents) node.setAttribute("cm-ignore-events", "true");
  21404. positionLineWidget(widget, node, lineView, dims);
  21405. cm.display.input.setUneditable(node);
  21406. if (allowAbove && widget.above)
  21407. wrap.insertBefore(node, lineView.gutter || lineView.text);
  21408. else
  21409. wrap.appendChild(node);
  21410. signalLater(widget, "redraw");
  21411. }
  21412. }
  21413. function positionLineWidget(widget, node, lineView, dims) {
  21414. if (widget.noHScroll) {
  21415. (lineView.alignable || (lineView.alignable = [])).push(node);
  21416. var width = dims.wrapperWidth;
  21417. node.style.left = dims.fixedPos + "px";
  21418. if (!widget.coverGutter) {
  21419. width -= dims.gutterTotalWidth;
  21420. node.style.paddingLeft = dims.gutterTotalWidth + "px";
  21421. }
  21422. node.style.width = width + "px";
  21423. }
  21424. if (widget.coverGutter) {
  21425. node.style.zIndex = 5;
  21426. node.style.position = "relative";
  21427. if (!widget.noHScroll) node.style.marginLeft = -dims.gutterTotalWidth + "px";
  21428. }
  21429. }
  21430. // POSITION OBJECT
  21431. // A Pos instance represents a position within the text.
  21432. var Pos = CodeMirror.Pos = function(line, ch) {
  21433. if (!(this instanceof Pos)) return new Pos(line, ch);
  21434. this.line = line; this.ch = ch;
  21435. };
  21436. // Compare two positions, return 0 if they are the same, a negative
  21437. // number when a is less, and a positive number otherwise.
  21438. var cmp = CodeMirror.cmpPos = function(a, b) { return a.line - b.line || a.ch - b.ch; };
  21439. function copyPos(x) {return Pos(x.line, x.ch);}
  21440. function maxPos(a, b) { return cmp(a, b) < 0 ? b : a; }
  21441. function minPos(a, b) { return cmp(a, b) < 0 ? a : b; }
  21442. // INPUT HANDLING
  21443. function ensureFocus(cm) {
  21444. if (!cm.state.focused) { cm.display.input.focus(); onFocus(cm); }
  21445. }
  21446. // This will be set to a {lineWise: bool, text: [string]} object, so
  21447. // that, when pasting, we know what kind of selections the copied
  21448. // text was made out of.
  21449. var lastCopied = null;
  21450. function applyTextInput(cm, inserted, deleted, sel, origin) {
  21451. var doc = cm.doc;
  21452. cm.display.shift = false;
  21453. if (!sel) sel = doc.sel;
  21454. var paste = cm.state.pasteIncoming || origin == "paste";
  21455. var textLines = doc.splitLines(inserted), multiPaste = null
  21456. // When pasing N lines into N selections, insert one line per selection
  21457. if (paste && sel.ranges.length > 1) {
  21458. if (lastCopied && lastCopied.text.join("\n") == inserted) {
  21459. if (sel.ranges.length % lastCopied.text.length == 0) {
  21460. multiPaste = [];
  21461. for (var i = 0; i < lastCopied.text.length; i++)
  21462. multiPaste.push(doc.splitLines(lastCopied.text[i]));
  21463. }
  21464. } else if (textLines.length == sel.ranges.length) {
  21465. multiPaste = map(textLines, function(l) { return [l]; });
  21466. }
  21467. }
  21468. // Normal behavior is to insert the new text into every selection
  21469. for (var i = sel.ranges.length - 1; i >= 0; i--) {
  21470. var range = sel.ranges[i];
  21471. var from = range.from(), to = range.to();
  21472. if (range.empty()) {
  21473. if (deleted && deleted > 0) // Handle deletion
  21474. from = Pos(from.line, from.ch - deleted);
  21475. else if (cm.state.overwrite && !paste) // Handle overwrite
  21476. to = Pos(to.line, Math.min(getLine(doc, to.line).text.length, to.ch + lst(textLines).length));
  21477. else if (lastCopied && lastCopied.lineWise && lastCopied.text.join("\n") == inserted)
  21478. from = to = Pos(from.line, 0)
  21479. }
  21480. var updateInput = cm.curOp.updateInput;
  21481. var changeEvent = {from: from, to: to, text: multiPaste ? multiPaste[i % multiPaste.length] : textLines,
  21482. origin: origin || (paste ? "paste" : cm.state.cutIncoming ? "cut" : "+input")};
  21483. makeChange(cm.doc, changeEvent);
  21484. signalLater(cm, "inputRead", cm, changeEvent);
  21485. }
  21486. if (inserted && !paste)
  21487. triggerElectric(cm, inserted);
  21488. ensureCursorVisible(cm);
  21489. cm.curOp.updateInput = updateInput;
  21490. cm.curOp.typing = true;
  21491. cm.state.pasteIncoming = cm.state.cutIncoming = false;
  21492. }
  21493. function handlePaste(e, cm) {
  21494. var pasted = e.clipboardData && e.clipboardData.getData("text/plain");
  21495. if (pasted) {
  21496. e.preventDefault();
  21497. if (!cm.isReadOnly() && !cm.options.disableInput)
  21498. runInOp(cm, function() { applyTextInput(cm, pasted, 0, null, "paste"); });
  21499. return true;
  21500. }
  21501. }
  21502. function triggerElectric(cm, inserted) {
  21503. // When an 'electric' character is inserted, immediately trigger a reindent
  21504. if (!cm.options.electricChars || !cm.options.smartIndent) return;
  21505. var sel = cm.doc.sel;
  21506. for (var i = sel.ranges.length - 1; i >= 0; i--) {
  21507. var range = sel.ranges[i];
  21508. if (range.head.ch > 100 || (i && sel.ranges[i - 1].head.line == range.head.line)) continue;
  21509. var mode = cm.getModeAt(range.head);
  21510. var indented = false;
  21511. if (mode.electricChars) {
  21512. for (var j = 0; j < mode.electricChars.length; j++)
  21513. if (inserted.indexOf(mode.electricChars.charAt(j)) > -1) {
  21514. indented = indentLine(cm, range.head.line, "smart");
  21515. break;
  21516. }
  21517. } else if (mode.electricInput) {
  21518. if (mode.electricInput.test(getLine(cm.doc, range.head.line).text.slice(0, range.head.ch)))
  21519. indented = indentLine(cm, range.head.line, "smart");
  21520. }
  21521. if (indented) signalLater(cm, "electricInput", cm, range.head.line);
  21522. }
  21523. }
  21524. function copyableRanges(cm) {
  21525. var text = [], ranges = [];
  21526. for (var i = 0; i < cm.doc.sel.ranges.length; i++) {
  21527. var line = cm.doc.sel.ranges[i].head.line;
  21528. var lineRange = {anchor: Pos(line, 0), head: Pos(line + 1, 0)};
  21529. ranges.push(lineRange);
  21530. text.push(cm.getRange(lineRange.anchor, lineRange.head));
  21531. }
  21532. return {text: text, ranges: ranges};
  21533. }
  21534. function disableBrowserMagic(field) {
  21535. field.setAttribute("autocorrect", "off");
  21536. field.setAttribute("autocapitalize", "off");
  21537. field.setAttribute("spellcheck", "false");
  21538. }
  21539. // TEXTAREA INPUT STYLE
  21540. function TextareaInput(cm) {
  21541. this.cm = cm;
  21542. // See input.poll and input.reset
  21543. this.prevInput = "";
  21544. // Flag that indicates whether we expect input to appear real soon
  21545. // now (after some event like 'keypress' or 'input') and are
  21546. // polling intensively.
  21547. this.pollingFast = false;
  21548. // Self-resetting timeout for the poller
  21549. this.polling = new Delayed();
  21550. // Tracks when input.reset has punted to just putting a short
  21551. // string into the textarea instead of the full selection.
  21552. this.inaccurateSelection = false;
  21553. // Used to work around IE issue with selection being forgotten when focus moves away from textarea
  21554. this.hasSelection = false;
  21555. this.composing = null;
  21556. };
  21557. function hiddenTextarea() {
  21558. var te = elt("textarea", null, null, "position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none");
  21559. var div = elt("div", [te], null, "overflow: hidden; position: relative; width: 3px; height: 0px;");
  21560. // The textarea is kept positioned near the cursor to prevent the
  21561. // fact that it'll be scrolled into view on input from scrolling
  21562. // our fake cursor out of view. On webkit, when wrap=off, paste is
  21563. // very slow. So make the area wide instead.
  21564. if (webkit) te.style.width = "1000px";
  21565. else te.setAttribute("wrap", "off");
  21566. // If border: 0; -- iOS fails to open keyboard (issue #1287)
  21567. if (ios) te.style.border = "1px solid black";
  21568. disableBrowserMagic(te);
  21569. return div;
  21570. }
  21571. TextareaInput.prototype = copyObj({
  21572. init: function(display) {
  21573. var input = this, cm = this.cm;
  21574. // Wraps and hides input textarea
  21575. var div = this.wrapper = hiddenTextarea();
  21576. // The semihidden textarea that is focused when the editor is
  21577. // focused, and receives input.
  21578. var te = this.textarea = div.firstChild;
  21579. display.wrapper.insertBefore(div, display.wrapper.firstChild);
  21580. // Needed to hide big blue blinking cursor on Mobile Safari (doesn't seem to work in iOS 8 anymore)
  21581. if (ios) te.style.width = "0px";
  21582. on(te, "input", function() {
  21583. if (ie && ie_version >= 9 && input.hasSelection) input.hasSelection = null;
  21584. input.poll();
  21585. });
  21586. on(te, "paste", function(e) {
  21587. if (signalDOMEvent(cm, e) || handlePaste(e, cm)) return
  21588. cm.state.pasteIncoming = true;
  21589. input.fastPoll();
  21590. });
  21591. function prepareCopyCut(e) {
  21592. if (signalDOMEvent(cm, e)) return
  21593. if (cm.somethingSelected()) {
  21594. lastCopied = {lineWise: false, text: cm.getSelections()};
  21595. if (input.inaccurateSelection) {
  21596. input.prevInput = "";
  21597. input.inaccurateSelection = false;
  21598. te.value = lastCopied.text.join("\n");
  21599. selectInput(te);
  21600. }
  21601. } else if (!cm.options.lineWiseCopyCut) {
  21602. return;
  21603. } else {
  21604. var ranges = copyableRanges(cm);
  21605. lastCopied = {lineWise: true, text: ranges.text};
  21606. if (e.type == "cut") {
  21607. cm.setSelections(ranges.ranges, null, sel_dontScroll);
  21608. } else {
  21609. input.prevInput = "";
  21610. te.value = ranges.text.join("\n");
  21611. selectInput(te);
  21612. }
  21613. }
  21614. if (e.type == "cut") cm.state.cutIncoming = true;
  21615. }
  21616. on(te, "cut", prepareCopyCut);
  21617. on(te, "copy", prepareCopyCut);
  21618. on(display.scroller, "paste", function(e) {
  21619. if (eventInWidget(display, e) || signalDOMEvent(cm, e)) return;
  21620. cm.state.pasteIncoming = true;
  21621. input.focus();
  21622. });
  21623. // Prevent normal selection in the editor (we handle our own)
  21624. on(display.lineSpace, "selectstart", function(e) {
  21625. if (!eventInWidget(display, e)) e_preventDefault(e);
  21626. });
  21627. on(te, "compositionstart", function() {
  21628. var start = cm.getCursor("from");
  21629. if (input.composing) input.composing.range.clear()
  21630. input.composing = {
  21631. start: start,
  21632. range: cm.markText(start, cm.getCursor("to"), {className: "CodeMirror-composing"})
  21633. };
  21634. });
  21635. on(te, "compositionend", function() {
  21636. if (input.composing) {
  21637. input.poll();
  21638. input.composing.range.clear();
  21639. input.composing = null;
  21640. }
  21641. });
  21642. },
  21643. prepareSelection: function() {
  21644. // Redraw the selection and/or cursor
  21645. var cm = this.cm, display = cm.display, doc = cm.doc;
  21646. var result = prepareSelection(cm);
  21647. // Move the hidden textarea near the cursor to prevent scrolling artifacts
  21648. if (cm.options.moveInputWithCursor) {
  21649. var headPos = cursorCoords(cm, doc.sel.primary().head, "div");
  21650. var wrapOff = display.wrapper.getBoundingClientRect(), lineOff = display.lineDiv.getBoundingClientRect();
  21651. result.teTop = Math.max(0, Math.min(display.wrapper.clientHeight - 10,
  21652. headPos.top + lineOff.top - wrapOff.top));
  21653. result.teLeft = Math.max(0, Math.min(display.wrapper.clientWidth - 10,
  21654. headPos.left + lineOff.left - wrapOff.left));
  21655. }
  21656. return result;
  21657. },
  21658. showSelection: function(drawn) {
  21659. var cm = this.cm, display = cm.display;
  21660. removeChildrenAndAdd(display.cursorDiv, drawn.cursors);
  21661. removeChildrenAndAdd(display.selectionDiv, drawn.selection);
  21662. if (drawn.teTop != null) {
  21663. this.wrapper.style.top = drawn.teTop + "px";
  21664. this.wrapper.style.left = drawn.teLeft + "px";
  21665. }
  21666. },
  21667. // Reset the input to correspond to the selection (or to be empty,
  21668. // when not typing and nothing is selected)
  21669. reset: function(typing) {
  21670. if (this.contextMenuPending) return;
  21671. var minimal, selected, cm = this.cm, doc = cm.doc;
  21672. if (cm.somethingSelected()) {
  21673. this.prevInput = "";
  21674. var range = doc.sel.primary();
  21675. minimal = hasCopyEvent &&
  21676. (range.to().line - range.from().line > 100 || (selected = cm.getSelection()).length > 1000);
  21677. var content = minimal ? "-" : selected || cm.getSelection();
  21678. this.textarea.value = content;
  21679. if (cm.state.focused) selectInput(this.textarea);
  21680. if (ie && ie_version >= 9) this.hasSelection = content;
  21681. } else if (!typing) {
  21682. this.prevInput = this.textarea.value = "";
  21683. if (ie && ie_version >= 9) this.hasSelection = null;
  21684. }
  21685. this.inaccurateSelection = minimal;
  21686. },
  21687. getField: function() { return this.textarea; },
  21688. supportsTouch: function() { return false; },
  21689. focus: function() {
  21690. if (this.cm.options.readOnly != "nocursor" && (!mobile || activeElt() != this.textarea)) {
  21691. try { this.textarea.focus(); }
  21692. catch (e) {} // IE8 will throw if the textarea is display: none or not in DOM
  21693. }
  21694. },
  21695. blur: function() { this.textarea.blur(); },
  21696. resetPosition: function() {
  21697. this.wrapper.style.top = this.wrapper.style.left = 0;
  21698. },
  21699. receivedFocus: function() { this.slowPoll(); },
  21700. // Poll for input changes, using the normal rate of polling. This
  21701. // runs as long as the editor is focused.
  21702. slowPoll: function() {
  21703. var input = this;
  21704. if (input.pollingFast) return;
  21705. input.polling.set(this.cm.options.pollInterval, function() {
  21706. input.poll();
  21707. if (input.cm.state.focused) input.slowPoll();
  21708. });
  21709. },
  21710. // When an event has just come in that is likely to add or change
  21711. // something in the input textarea, we poll faster, to ensure that
  21712. // the change appears on the screen quickly.
  21713. fastPoll: function() {
  21714. var missed = false, input = this;
  21715. input.pollingFast = true;
  21716. function p() {
  21717. var changed = input.poll();
  21718. if (!changed && !missed) {missed = true; input.polling.set(60, p);}
  21719. else {input.pollingFast = false; input.slowPoll();}
  21720. }
  21721. input.polling.set(20, p);
  21722. },
  21723. // Read input from the textarea, and update the document to match.
  21724. // When something is selected, it is present in the textarea, and
  21725. // selected (unless it is huge, in which case a placeholder is
  21726. // used). When nothing is selected, the cursor sits after previously
  21727. // seen text (can be empty), which is stored in prevInput (we must
  21728. // not reset the textarea when typing, because that breaks IME).
  21729. poll: function() {
  21730. var cm = this.cm, input = this.textarea, prevInput = this.prevInput;
  21731. // Since this is called a *lot*, try to bail out as cheaply as
  21732. // possible when it is clear that nothing happened. hasSelection
  21733. // will be the case when there is a lot of text in the textarea,
  21734. // in which case reading its value would be expensive.
  21735. if (this.contextMenuPending || !cm.state.focused ||
  21736. (hasSelection(input) && !prevInput && !this.composing) ||
  21737. cm.isReadOnly() || cm.options.disableInput || cm.state.keySeq)
  21738. return false;
  21739. var text = input.value;
  21740. // If nothing changed, bail.
  21741. if (text == prevInput && !cm.somethingSelected()) return false;
  21742. // Work around nonsensical selection resetting in IE9/10, and
  21743. // inexplicable appearance of private area unicode characters on
  21744. // some key combos in Mac (#2689).
  21745. if (ie && ie_version >= 9 && this.hasSelection === text ||
  21746. mac && /[\uf700-\uf7ff]/.test(text)) {
  21747. cm.display.input.reset();
  21748. return false;
  21749. }
  21750. if (cm.doc.sel == cm.display.selForContextMenu) {
  21751. var first = text.charCodeAt(0);
  21752. if (first == 0x200b && !prevInput) prevInput = "\u200b";
  21753. if (first == 0x21da) { this.reset(); return this.cm.execCommand("undo"); }
  21754. }
  21755. // Find the part of the input that is actually new
  21756. var same = 0, l = Math.min(prevInput.length, text.length);
  21757. while (same < l && prevInput.charCodeAt(same) == text.charCodeAt(same)) ++same;
  21758. var self = this;
  21759. runInOp(cm, function() {
  21760. applyTextInput(cm, text.slice(same), prevInput.length - same,
  21761. null, self.composing ? "*compose" : null);
  21762. // Don't leave long text in the textarea, since it makes further polling slow
  21763. if (text.length > 1000 || text.indexOf("\n") > -1) input.value = self.prevInput = "";
  21764. else self.prevInput = text;
  21765. if (self.composing) {
  21766. self.composing.range.clear();
  21767. self.composing.range = cm.markText(self.composing.start, cm.getCursor("to"),
  21768. {className: "CodeMirror-composing"});
  21769. }
  21770. });
  21771. return true;
  21772. },
  21773. ensurePolled: function() {
  21774. if (this.pollingFast && this.poll()) this.pollingFast = false;
  21775. },
  21776. onKeyPress: function() {
  21777. if (ie && ie_version >= 9) this.hasSelection = null;
  21778. this.fastPoll();
  21779. },
  21780. onContextMenu: function(e) {
  21781. var input = this, cm = input.cm, display = cm.display, te = input.textarea;
  21782. var pos = posFromMouse(cm, e), scrollPos = display.scroller.scrollTop;
  21783. if (!pos || presto) return; // Opera is difficult.
  21784. // Reset the current text selection only if the click is done outside of the selection
  21785. // and 'resetSelectionOnContextMenu' option is true.
  21786. var reset = cm.options.resetSelectionOnContextMenu;
  21787. if (reset && cm.doc.sel.contains(pos) == -1)
  21788. operation(cm, setSelection)(cm.doc, simpleSelection(pos), sel_dontScroll);
  21789. var oldCSS = te.style.cssText, oldWrapperCSS = input.wrapper.style.cssText;
  21790. input.wrapper.style.cssText = "position: absolute"
  21791. var wrapperBox = input.wrapper.getBoundingClientRect()
  21792. te.style.cssText = "position: absolute; width: 30px; height: 30px; top: " + (e.clientY - wrapperBox.top - 5) +
  21793. "px; left: " + (e.clientX - wrapperBox.left - 5) + "px; z-index: 1000; background: " +
  21794. (ie ? "rgba(255, 255, 255, .05)" : "transparent") +
  21795. "; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);";
  21796. if (webkit) var oldScrollY = window.scrollY; // Work around Chrome issue (#2712)
  21797. display.input.focus();
  21798. if (webkit) window.scrollTo(null, oldScrollY);
  21799. display.input.reset();
  21800. // Adds "Select all" to context menu in FF
  21801. if (!cm.somethingSelected()) te.value = input.prevInput = " ";
  21802. input.contextMenuPending = true;
  21803. display.selForContextMenu = cm.doc.sel;
  21804. clearTimeout(display.detectingSelectAll);
  21805. // Select-all will be greyed out if there's nothing to select, so
  21806. // this adds a zero-width space so that we can later check whether
  21807. // it got selected.
  21808. function prepareSelectAllHack() {
  21809. if (te.selectionStart != null) {
  21810. var selected = cm.somethingSelected();
  21811. var extval = "\u200b" + (selected ? te.value : "");
  21812. te.value = "\u21da"; // Used to catch context-menu undo
  21813. te.value = extval;
  21814. input.prevInput = selected ? "" : "\u200b";
  21815. te.selectionStart = 1; te.selectionEnd = extval.length;
  21816. // Re-set this, in case some other handler touched the
  21817. // selection in the meantime.
  21818. display.selForContextMenu = cm.doc.sel;
  21819. }
  21820. }
  21821. function rehide() {
  21822. input.contextMenuPending = false;
  21823. input.wrapper.style.cssText = oldWrapperCSS
  21824. te.style.cssText = oldCSS;
  21825. if (ie && ie_version < 9) display.scrollbars.setScrollTop(display.scroller.scrollTop = scrollPos);
  21826. // Try to detect the user choosing select-all
  21827. if (te.selectionStart != null) {
  21828. if (!ie || (ie && ie_version < 9)) prepareSelectAllHack();
  21829. var i = 0, poll = function() {
  21830. if (display.selForContextMenu == cm.doc.sel && te.selectionStart == 0 &&
  21831. te.selectionEnd > 0 && input.prevInput == "\u200b")
  21832. operation(cm, commands.selectAll)(cm);
  21833. else if (i++ < 10) display.detectingSelectAll = setTimeout(poll, 500);
  21834. else display.input.reset();
  21835. };
  21836. display.detectingSelectAll = setTimeout(poll, 200);
  21837. }
  21838. }
  21839. if (ie && ie_version >= 9) prepareSelectAllHack();
  21840. if (captureRightClick) {
  21841. e_stop(e);
  21842. var mouseup = function() {
  21843. off(window, "mouseup", mouseup);
  21844. setTimeout(rehide, 20);
  21845. };
  21846. on(window, "mouseup", mouseup);
  21847. } else {
  21848. setTimeout(rehide, 50);
  21849. }
  21850. },
  21851. readOnlyChanged: function(val) {
  21852. if (!val) this.reset();
  21853. },
  21854. setUneditable: nothing,
  21855. needsContentAttribute: false
  21856. }, TextareaInput.prototype);
  21857. // CONTENTEDITABLE INPUT STYLE
  21858. function ContentEditableInput(cm) {
  21859. this.cm = cm;
  21860. this.lastAnchorNode = this.lastAnchorOffset = this.lastFocusNode = this.lastFocusOffset = null;
  21861. this.polling = new Delayed();
  21862. this.gracePeriod = false;
  21863. }
  21864. ContentEditableInput.prototype = copyObj({
  21865. init: function(display) {
  21866. var input = this, cm = input.cm;
  21867. var div = input.div = display.lineDiv;
  21868. disableBrowserMagic(div);
  21869. on(div, "paste", function(e) {
  21870. if (!signalDOMEvent(cm, e)) handlePaste(e, cm);
  21871. })
  21872. on(div, "compositionstart", function(e) {
  21873. var data = e.data;
  21874. input.composing = {sel: cm.doc.sel, data: data, startData: data};
  21875. if (!data) return;
  21876. var prim = cm.doc.sel.primary();
  21877. var line = cm.getLine(prim.head.line);
  21878. var found = line.indexOf(data, Math.max(0, prim.head.ch - data.length));
  21879. if (found > -1 && found <= prim.head.ch)
  21880. input.composing.sel = simpleSelection(Pos(prim.head.line, found),
  21881. Pos(prim.head.line, found + data.length));
  21882. });
  21883. on(div, "compositionupdate", function(e) {
  21884. input.composing.data = e.data;
  21885. });
  21886. on(div, "compositionend", function(e) {
  21887. var ours = input.composing;
  21888. if (!ours) return;
  21889. if (e.data != ours.startData && !/\u200b/.test(e.data))
  21890. ours.data = e.data;
  21891. // Need a small delay to prevent other code (input event,
  21892. // selection polling) from doing damage when fired right after
  21893. // compositionend.
  21894. setTimeout(function() {
  21895. if (!ours.handled)
  21896. input.applyComposition(ours);
  21897. if (input.composing == ours)
  21898. input.composing = null;
  21899. }, 50);
  21900. });
  21901. on(div, "touchstart", function() {
  21902. input.forceCompositionEnd();
  21903. });
  21904. on(div, "input", function() {
  21905. if (input.composing) return;
  21906. if (cm.isReadOnly() || !input.pollContent())
  21907. runInOp(input.cm, function() {regChange(cm);});
  21908. });
  21909. function onCopyCut(e) {
  21910. if (signalDOMEvent(cm, e)) return
  21911. if (cm.somethingSelected()) {
  21912. lastCopied = {lineWise: false, text: cm.getSelections()};
  21913. if (e.type == "cut") cm.replaceSelection("", null, "cut");
  21914. } else if (!cm.options.lineWiseCopyCut) {
  21915. return;
  21916. } else {
  21917. var ranges = copyableRanges(cm);
  21918. lastCopied = {lineWise: true, text: ranges.text};
  21919. if (e.type == "cut") {
  21920. cm.operation(function() {
  21921. cm.setSelections(ranges.ranges, 0, sel_dontScroll);
  21922. cm.replaceSelection("", null, "cut");
  21923. });
  21924. }
  21925. }
  21926. // iOS exposes the clipboard API, but seems to discard content inserted into it
  21927. if (e.clipboardData && !ios) {
  21928. e.preventDefault();
  21929. e.clipboardData.clearData();
  21930. e.clipboardData.setData("text/plain", lastCopied.text.join("\n"));
  21931. } else {
  21932. // Old-fashioned briefly-focus-a-textarea hack
  21933. var kludge = hiddenTextarea(), te = kludge.firstChild;
  21934. cm.display.lineSpace.insertBefore(kludge, cm.display.lineSpace.firstChild);
  21935. te.value = lastCopied.text.join("\n");
  21936. var hadFocus = document.activeElement;
  21937. selectInput(te);
  21938. setTimeout(function() {
  21939. cm.display.lineSpace.removeChild(kludge);
  21940. hadFocus.focus();
  21941. }, 50);
  21942. }
  21943. }
  21944. on(div, "copy", onCopyCut);
  21945. on(div, "cut", onCopyCut);
  21946. },
  21947. prepareSelection: function() {
  21948. var result = prepareSelection(this.cm, false);
  21949. result.focus = this.cm.state.focused;
  21950. return result;
  21951. },
  21952. showSelection: function(info, takeFocus) {
  21953. if (!info || !this.cm.display.view.length) return;
  21954. if (info.focus || takeFocus) this.showPrimarySelection();
  21955. this.showMultipleSelections(info);
  21956. },
  21957. showPrimarySelection: function() {
  21958. var sel = window.getSelection(), prim = this.cm.doc.sel.primary();
  21959. var curAnchor = domToPos(this.cm, sel.anchorNode, sel.anchorOffset);
  21960. var curFocus = domToPos(this.cm, sel.focusNode, sel.focusOffset);
  21961. if (curAnchor && !curAnchor.bad && curFocus && !curFocus.bad &&
  21962. cmp(minPos(curAnchor, curFocus), prim.from()) == 0 &&
  21963. cmp(maxPos(curAnchor, curFocus), prim.to()) == 0)
  21964. return;
  21965. var start = posToDOM(this.cm, prim.from());
  21966. var end = posToDOM(this.cm, prim.to());
  21967. if (!start && !end) return;
  21968. var view = this.cm.display.view;
  21969. var old = sel.rangeCount && sel.getRangeAt(0);
  21970. if (!start) {
  21971. start = {node: view[0].measure.map[2], offset: 0};
  21972. } else if (!end) { // FIXME dangerously hacky
  21973. var measure = view[view.length - 1].measure;
  21974. var map = measure.maps ? measure.maps[measure.maps.length - 1] : measure.map;
  21975. end = {node: map[map.length - 1], offset: map[map.length - 2] - map[map.length - 3]};
  21976. }
  21977. try { var rng = range(start.node, start.offset, end.offset, end.node); }
  21978. catch(e) {} // Our model of the DOM might be outdated, in which case the range we try to set can be impossible
  21979. if (rng) {
  21980. if (!gecko && this.cm.state.focused) {
  21981. sel.collapse(start.node, start.offset);
  21982. if (!rng.collapsed) sel.addRange(rng);
  21983. } else {
  21984. sel.removeAllRanges();
  21985. sel.addRange(rng);
  21986. }
  21987. if (old && sel.anchorNode == null) sel.addRange(old);
  21988. else if (gecko) this.startGracePeriod();
  21989. }
  21990. this.rememberSelection();
  21991. },
  21992. startGracePeriod: function() {
  21993. var input = this;
  21994. clearTimeout(this.gracePeriod);
  21995. this.gracePeriod = setTimeout(function() {
  21996. input.gracePeriod = false;
  21997. if (input.selectionChanged())
  21998. input.cm.operation(function() { input.cm.curOp.selectionChanged = true; });
  21999. }, 20);
  22000. },
  22001. showMultipleSelections: function(info) {
  22002. removeChildrenAndAdd(this.cm.display.cursorDiv, info.cursors);
  22003. removeChildrenAndAdd(this.cm.display.selectionDiv, info.selection);
  22004. },
  22005. rememberSelection: function() {
  22006. var sel = window.getSelection();
  22007. this.lastAnchorNode = sel.anchorNode; this.lastAnchorOffset = sel.anchorOffset;
  22008. this.lastFocusNode = sel.focusNode; this.lastFocusOffset = sel.focusOffset;
  22009. },
  22010. selectionInEditor: function() {
  22011. var sel = window.getSelection();
  22012. if (!sel.rangeCount) return false;
  22013. var node = sel.getRangeAt(0).commonAncestorContainer;
  22014. return contains(this.div, node);
  22015. },
  22016. focus: function() {
  22017. if (this.cm.options.readOnly != "nocursor") this.div.focus();
  22018. },
  22019. blur: function() { this.div.blur(); },
  22020. getField: function() { return this.div; },
  22021. supportsTouch: function() { return true; },
  22022. receivedFocus: function() {
  22023. var input = this;
  22024. if (this.selectionInEditor())
  22025. this.pollSelection();
  22026. else
  22027. runInOp(this.cm, function() { input.cm.curOp.selectionChanged = true; });
  22028. function poll() {
  22029. if (input.cm.state.focused) {
  22030. input.pollSelection();
  22031. input.polling.set(input.cm.options.pollInterval, poll);
  22032. }
  22033. }
  22034. this.polling.set(this.cm.options.pollInterval, poll);
  22035. },
  22036. selectionChanged: function() {
  22037. var sel = window.getSelection();
  22038. return sel.anchorNode != this.lastAnchorNode || sel.anchorOffset != this.lastAnchorOffset ||
  22039. sel.focusNode != this.lastFocusNode || sel.focusOffset != this.lastFocusOffset;
  22040. },
  22041. pollSelection: function() {
  22042. if (!this.composing && !this.gracePeriod && this.selectionChanged()) {
  22043. var sel = window.getSelection(), cm = this.cm;
  22044. this.rememberSelection();
  22045. var anchor = domToPos(cm, sel.anchorNode, sel.anchorOffset);
  22046. var head = domToPos(cm, sel.focusNode, sel.focusOffset);
  22047. if (anchor && head) runInOp(cm, function() {
  22048. setSelection(cm.doc, simpleSelection(anchor, head), sel_dontScroll);
  22049. if (anchor.bad || head.bad) cm.curOp.selectionChanged = true;
  22050. });
  22051. }
  22052. },
  22053. pollContent: function() {
  22054. var cm = this.cm, display = cm.display, sel = cm.doc.sel.primary();
  22055. var from = sel.from(), to = sel.to();
  22056. if (from.line < display.viewFrom || to.line > display.viewTo - 1) return false;
  22057. var fromIndex;
  22058. if (from.line == display.viewFrom || (fromIndex = findViewIndex(cm, from.line)) == 0) {
  22059. var fromLine = lineNo(display.view[0].line);
  22060. var fromNode = display.view[0].node;
  22061. } else {
  22062. var fromLine = lineNo(display.view[fromIndex].line);
  22063. var fromNode = display.view[fromIndex - 1].node.nextSibling;
  22064. }
  22065. var toIndex = findViewIndex(cm, to.line);
  22066. if (toIndex == display.view.length - 1) {
  22067. var toLine = display.viewTo - 1;
  22068. var toNode = display.lineDiv.lastChild;
  22069. } else {
  22070. var toLine = lineNo(display.view[toIndex + 1].line) - 1;
  22071. var toNode = display.view[toIndex + 1].node.previousSibling;
  22072. }
  22073. var newText = cm.doc.splitLines(domTextBetween(cm, fromNode, toNode, fromLine, toLine));
  22074. var oldText = getBetween(cm.doc, Pos(fromLine, 0), Pos(toLine, getLine(cm.doc, toLine).text.length));
  22075. while (newText.length > 1 && oldText.length > 1) {
  22076. if (lst(newText) == lst(oldText)) { newText.pop(); oldText.pop(); toLine--; }
  22077. else if (newText[0] == oldText[0]) { newText.shift(); oldText.shift(); fromLine++; }
  22078. else break;
  22079. }
  22080. var cutFront = 0, cutEnd = 0;
  22081. var newTop = newText[0], oldTop = oldText[0], maxCutFront = Math.min(newTop.length, oldTop.length);
  22082. while (cutFront < maxCutFront && newTop.charCodeAt(cutFront) == oldTop.charCodeAt(cutFront))
  22083. ++cutFront;
  22084. var newBot = lst(newText), oldBot = lst(oldText);
  22085. var maxCutEnd = Math.min(newBot.length - (newText.length == 1 ? cutFront : 0),
  22086. oldBot.length - (oldText.length == 1 ? cutFront : 0));
  22087. while (cutEnd < maxCutEnd &&
  22088. newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1))
  22089. ++cutEnd;
  22090. newText[newText.length - 1] = newBot.slice(0, newBot.length - cutEnd);
  22091. newText[0] = newText[0].slice(cutFront);
  22092. var chFrom = Pos(fromLine, cutFront);
  22093. var chTo = Pos(toLine, oldText.length ? lst(oldText).length - cutEnd : 0);
  22094. if (newText.length > 1 || newText[0] || cmp(chFrom, chTo)) {
  22095. replaceRange(cm.doc, newText, chFrom, chTo, "+input");
  22096. return true;
  22097. }
  22098. },
  22099. ensurePolled: function() {
  22100. this.forceCompositionEnd();
  22101. },
  22102. reset: function() {
  22103. this.forceCompositionEnd();
  22104. },
  22105. forceCompositionEnd: function() {
  22106. if (!this.composing || this.composing.handled) return;
  22107. this.applyComposition(this.composing);
  22108. this.composing.handled = true;
  22109. this.div.blur();
  22110. this.div.focus();
  22111. },
  22112. applyComposition: function(composing) {
  22113. if (this.cm.isReadOnly())
  22114. operation(this.cm, regChange)(this.cm)
  22115. else if (composing.data && composing.data != composing.startData)
  22116. operation(this.cm, applyTextInput)(this.cm, composing.data, 0, composing.sel);
  22117. },
  22118. setUneditable: function(node) {
  22119. node.contentEditable = "false"
  22120. },
  22121. onKeyPress: function(e) {
  22122. e.preventDefault();
  22123. if (!this.cm.isReadOnly())
  22124. operation(this.cm, applyTextInput)(this.cm, String.fromCharCode(e.charCode == null ? e.keyCode : e.charCode), 0);
  22125. },
  22126. readOnlyChanged: function(val) {
  22127. this.div.contentEditable = String(val != "nocursor")
  22128. },
  22129. onContextMenu: nothing,
  22130. resetPosition: nothing,
  22131. needsContentAttribute: true
  22132. }, ContentEditableInput.prototype);
  22133. function posToDOM(cm, pos) {
  22134. var view = findViewForLine(cm, pos.line);
  22135. if (!view || view.hidden) return null;
  22136. var line = getLine(cm.doc, pos.line);
  22137. var info = mapFromLineView(view, line, pos.line);
  22138. var order = getOrder(line), side = "left";
  22139. if (order) {
  22140. var partPos = getBidiPartAt(order, pos.ch);
  22141. side = partPos % 2 ? "right" : "left";
  22142. }
  22143. var result = nodeAndOffsetInLineMap(info.map, pos.ch, side);
  22144. result.offset = result.collapse == "right" ? result.end : result.start;
  22145. return result;
  22146. }
  22147. function badPos(pos, bad) { if (bad) pos.bad = true; return pos; }
  22148. function domToPos(cm, node, offset) {
  22149. var lineNode;
  22150. if (node == cm.display.lineDiv) {
  22151. lineNode = cm.display.lineDiv.childNodes[offset];
  22152. if (!lineNode) return badPos(cm.clipPos(Pos(cm.display.viewTo - 1)), true);
  22153. node = null; offset = 0;
  22154. } else {
  22155. for (lineNode = node;; lineNode = lineNode.parentNode) {
  22156. if (!lineNode || lineNode == cm.display.lineDiv) return null;
  22157. if (lineNode.parentNode && lineNode.parentNode == cm.display.lineDiv) break;
  22158. }
  22159. }
  22160. for (var i = 0; i < cm.display.view.length; i++) {
  22161. var lineView = cm.display.view[i];
  22162. if (lineView.node == lineNode)
  22163. return locateNodeInLineView(lineView, node, offset);
  22164. }
  22165. }
  22166. function locateNodeInLineView(lineView, node, offset) {
  22167. var wrapper = lineView.text.firstChild, bad = false;
  22168. if (!node || !contains(wrapper, node)) return badPos(Pos(lineNo(lineView.line), 0), true);
  22169. if (node == wrapper) {
  22170. bad = true;
  22171. node = wrapper.childNodes[offset];
  22172. offset = 0;
  22173. if (!node) {
  22174. var line = lineView.rest ? lst(lineView.rest) : lineView.line;
  22175. return badPos(Pos(lineNo(line), line.text.length), bad);
  22176. }
  22177. }
  22178. var textNode = node.nodeType == 3 ? node : null, topNode = node;
  22179. if (!textNode && node.childNodes.length == 1 && node.firstChild.nodeType == 3) {
  22180. textNode = node.firstChild;
  22181. if (offset) offset = textNode.nodeValue.length;
  22182. }
  22183. while (topNode.parentNode != wrapper) topNode = topNode.parentNode;
  22184. var measure = lineView.measure, maps = measure.maps;
  22185. function find(textNode, topNode, offset) {
  22186. for (var i = -1; i < (maps ? maps.length : 0); i++) {
  22187. var map = i < 0 ? measure.map : maps[i];
  22188. for (var j = 0; j < map.length; j += 3) {
  22189. var curNode = map[j + 2];
  22190. if (curNode == textNode || curNode == topNode) {
  22191. var line = lineNo(i < 0 ? lineView.line : lineView.rest[i]);
  22192. var ch = map[j] + offset;
  22193. if (offset < 0 || curNode != textNode) ch = map[j + (offset ? 1 : 0)];
  22194. return Pos(line, ch);
  22195. }
  22196. }
  22197. }
  22198. }
  22199. var found = find(textNode, topNode, offset);
  22200. if (found) return badPos(found, bad);
  22201. // FIXME this is all really shaky. might handle the few cases it needs to handle, but likely to cause problems
  22202. for (var after = topNode.nextSibling, dist = textNode ? textNode.nodeValue.length - offset : 0; after; after = after.nextSibling) {
  22203. found = find(after, after.firstChild, 0);
  22204. if (found)
  22205. return badPos(Pos(found.line, found.ch - dist), bad);
  22206. else
  22207. dist += after.textContent.length;
  22208. }
  22209. for (var before = topNode.previousSibling, dist = offset; before; before = before.previousSibling) {
  22210. found = find(before, before.firstChild, -1);
  22211. if (found)
  22212. return badPos(Pos(found.line, found.ch + dist), bad);
  22213. else
  22214. dist += after.textContent.length;
  22215. }
  22216. }
  22217. function domTextBetween(cm, from, to, fromLine, toLine) {
  22218. var text = "", closing = false, lineSep = cm.doc.lineSeparator();
  22219. function recognizeMarker(id) { return function(marker) { return marker.id == id; }; }
  22220. function walk(node) {
  22221. if (node.nodeType == 1) {
  22222. var cmText = node.getAttribute("cm-text");
  22223. if (cmText != null) {
  22224. if (cmText == "") cmText = node.textContent.replace(/\u200b/g, "");
  22225. text += cmText;
  22226. return;
  22227. }
  22228. var markerID = node.getAttribute("cm-marker"), range;
  22229. if (markerID) {
  22230. var found = cm.findMarks(Pos(fromLine, 0), Pos(toLine + 1, 0), recognizeMarker(+markerID));
  22231. if (found.length && (range = found[0].find()))
  22232. text += getBetween(cm.doc, range.from, range.to).join(lineSep);
  22233. return;
  22234. }
  22235. if (node.getAttribute("contenteditable") == "false") return;
  22236. for (var i = 0; i < node.childNodes.length; i++)
  22237. walk(node.childNodes[i]);
  22238. if (/^(pre|div|p)$/i.test(node.nodeName))
  22239. closing = true;
  22240. } else if (node.nodeType == 3) {
  22241. var val = node.nodeValue;
  22242. if (!val) return;
  22243. if (closing) {
  22244. text += lineSep;
  22245. closing = false;
  22246. }
  22247. text += val;
  22248. }
  22249. }
  22250. for (;;) {
  22251. walk(from);
  22252. if (from == to) break;
  22253. from = from.nextSibling;
  22254. }
  22255. return text;
  22256. }
  22257. CodeMirror.inputStyles = {"textarea": TextareaInput, "contenteditable": ContentEditableInput};
  22258. // SELECTION / CURSOR
  22259. // Selection objects are immutable. A new one is created every time
  22260. // the selection changes. A selection is one or more non-overlapping
  22261. // (and non-touching) ranges, sorted, and an integer that indicates
  22262. // which one is the primary selection (the one that's scrolled into
  22263. // view, that getCursor returns, etc).
  22264. function Selection(ranges, primIndex) {
  22265. this.ranges = ranges;
  22266. this.primIndex = primIndex;
  22267. }
  22268. Selection.prototype = {
  22269. primary: function() { return this.ranges[this.primIndex]; },
  22270. equals: function(other) {
  22271. if (other == this) return true;
  22272. if (other.primIndex != this.primIndex || other.ranges.length != this.ranges.length) return false;
  22273. for (var i = 0; i < this.ranges.length; i++) {
  22274. var here = this.ranges[i], there = other.ranges[i];
  22275. if (cmp(here.anchor, there.anchor) != 0 || cmp(here.head, there.head) != 0) return false;
  22276. }
  22277. return true;
  22278. },
  22279. deepCopy: function() {
  22280. for (var out = [], i = 0; i < this.ranges.length; i++)
  22281. out[i] = new Range(copyPos(this.ranges[i].anchor), copyPos(this.ranges[i].head));
  22282. return new Selection(out, this.primIndex);
  22283. },
  22284. somethingSelected: function() {
  22285. for (var i = 0; i < this.ranges.length; i++)
  22286. if (!this.ranges[i].empty()) return true;
  22287. return false;
  22288. },
  22289. contains: function(pos, end) {
  22290. if (!end) end = pos;
  22291. for (var i = 0; i < this.ranges.length; i++) {
  22292. var range = this.ranges[i];
  22293. if (cmp(end, range.from()) >= 0 && cmp(pos, range.to()) <= 0)
  22294. return i;
  22295. }
  22296. return -1;
  22297. }
  22298. };
  22299. function Range(anchor, head) {
  22300. this.anchor = anchor; this.head = head;
  22301. }
  22302. Range.prototype = {
  22303. from: function() { return minPos(this.anchor, this.head); },
  22304. to: function() { return maxPos(this.anchor, this.head); },
  22305. empty: function() {
  22306. return this.head.line == this.anchor.line && this.head.ch == this.anchor.ch;
  22307. }
  22308. };
  22309. // Take an unsorted, potentially overlapping set of ranges, and
  22310. // build a selection out of it. 'Consumes' ranges array (modifying
  22311. // it).
  22312. function normalizeSelection(ranges, primIndex) {
  22313. var prim = ranges[primIndex];
  22314. ranges.sort(function(a, b) { return cmp(a.from(), b.from()); });
  22315. primIndex = indexOf(ranges, prim);
  22316. for (var i = 1; i < ranges.length; i++) {
  22317. var cur = ranges[i], prev = ranges[i - 1];
  22318. if (cmp(prev.to(), cur.from()) >= 0) {
  22319. var from = minPos(prev.from(), cur.from()), to = maxPos(prev.to(), cur.to());
  22320. var inv = prev.empty() ? cur.from() == cur.head : prev.from() == prev.head;
  22321. if (i <= primIndex) --primIndex;
  22322. ranges.splice(--i, 2, new Range(inv ? to : from, inv ? from : to));
  22323. }
  22324. }
  22325. return new Selection(ranges, primIndex);
  22326. }
  22327. function simpleSelection(anchor, head) {
  22328. return new Selection([new Range(anchor, head || anchor)], 0);
  22329. }
  22330. // Most of the external API clips given positions to make sure they
  22331. // actually exist within the document.
  22332. function clipLine(doc, n) {return Math.max(doc.first, Math.min(n, doc.first + doc.size - 1));}
  22333. function clipPos(doc, pos) {
  22334. if (pos.line < doc.first) return Pos(doc.first, 0);
  22335. var last = doc.first + doc.size - 1;
  22336. if (pos.line > last) return Pos(last, getLine(doc, last).text.length);
  22337. return clipToLen(pos, getLine(doc, pos.line).text.length);
  22338. }
  22339. function clipToLen(pos, linelen) {
  22340. var ch = pos.ch;
  22341. if (ch == null || ch > linelen) return Pos(pos.line, linelen);
  22342. else if (ch < 0) return Pos(pos.line, 0);
  22343. else return pos;
  22344. }
  22345. function isLine(doc, l) {return l >= doc.first && l < doc.first + doc.size;}
  22346. function clipPosArray(doc, array) {
  22347. for (var out = [], i = 0; i < array.length; i++) out[i] = clipPos(doc, array[i]);
  22348. return out;
  22349. }
  22350. // SELECTION UPDATES
  22351. // The 'scroll' parameter given to many of these indicated whether
  22352. // the new cursor position should be scrolled into view after
  22353. // modifying the selection.
  22354. // If shift is held or the extend flag is set, extends a range to
  22355. // include a given position (and optionally a second position).
  22356. // Otherwise, simply returns the range between the given positions.
  22357. // Used for cursor motion and such.
  22358. function extendRange(doc, range, head, other) {
  22359. if (doc.cm && doc.cm.display.shift || doc.extend) {
  22360. var anchor = range.anchor;
  22361. if (other) {
  22362. var posBefore = cmp(head, anchor) < 0;
  22363. if (posBefore != (cmp(other, anchor) < 0)) {
  22364. anchor = head;
  22365. head = other;
  22366. } else if (posBefore != (cmp(head, other) < 0)) {
  22367. head = other;
  22368. }
  22369. }
  22370. return new Range(anchor, head);
  22371. } else {
  22372. return new Range(other || head, head);
  22373. }
  22374. }
  22375. // Extend the primary selection range, discard the rest.
  22376. function extendSelection(doc, head, other, options) {
  22377. setSelection(doc, new Selection([extendRange(doc, doc.sel.primary(), head, other)], 0), options);
  22378. }
  22379. // Extend all selections (pos is an array of selections with length
  22380. // equal the number of selections)
  22381. function extendSelections(doc, heads, options) {
  22382. for (var out = [], i = 0; i < doc.sel.ranges.length; i++)
  22383. out[i] = extendRange(doc, doc.sel.ranges[i], heads[i], null);
  22384. var newSel = normalizeSelection(out, doc.sel.primIndex);
  22385. setSelection(doc, newSel, options);
  22386. }
  22387. // Updates a single range in the selection.
  22388. function replaceOneSelection(doc, i, range, options) {
  22389. var ranges = doc.sel.ranges.slice(0);
  22390. ranges[i] = range;
  22391. setSelection(doc, normalizeSelection(ranges, doc.sel.primIndex), options);
  22392. }
  22393. // Reset the selection to a single range.
  22394. function setSimpleSelection(doc, anchor, head, options) {
  22395. setSelection(doc, simpleSelection(anchor, head), options);
  22396. }
  22397. // Give beforeSelectionChange handlers a change to influence a
  22398. // selection update.
  22399. function filterSelectionChange(doc, sel, options) {
  22400. var obj = {
  22401. ranges: sel.ranges,
  22402. update: function(ranges) {
  22403. this.ranges = [];
  22404. for (var i = 0; i < ranges.length; i++)
  22405. this.ranges[i] = new Range(clipPos(doc, ranges[i].anchor),
  22406. clipPos(doc, ranges[i].head));
  22407. },
  22408. origin: options && options.origin
  22409. };
  22410. signal(doc, "beforeSelectionChange", doc, obj);
  22411. if (doc.cm) signal(doc.cm, "beforeSelectionChange", doc.cm, obj);
  22412. if (obj.ranges != sel.ranges) return normalizeSelection(obj.ranges, obj.ranges.length - 1);
  22413. else return sel;
  22414. }
  22415. function setSelectionReplaceHistory(doc, sel, options) {
  22416. var done = doc.history.done, last = lst(done);
  22417. if (last && last.ranges) {
  22418. done[done.length - 1] = sel;
  22419. setSelectionNoUndo(doc, sel, options);
  22420. } else {
  22421. setSelection(doc, sel, options);
  22422. }
  22423. }
  22424. // Set a new selection.
  22425. function setSelection(doc, sel, options) {
  22426. setSelectionNoUndo(doc, sel, options);
  22427. addSelectionToHistory(doc, doc.sel, doc.cm ? doc.cm.curOp.id : NaN, options);
  22428. }
  22429. function setSelectionNoUndo(doc, sel, options) {
  22430. if (hasHandler(doc, "beforeSelectionChange") || doc.cm && hasHandler(doc.cm, "beforeSelectionChange"))
  22431. sel = filterSelectionChange(doc, sel, options);
  22432. var bias = options && options.bias ||
  22433. (cmp(sel.primary().head, doc.sel.primary().head) < 0 ? -1 : 1);
  22434. setSelectionInner(doc, skipAtomicInSelection(doc, sel, bias, true));
  22435. if (!(options && options.scroll === false) && doc.cm)
  22436. ensureCursorVisible(doc.cm);
  22437. }
  22438. function setSelectionInner(doc, sel) {
  22439. if (sel.equals(doc.sel)) return;
  22440. doc.sel = sel;
  22441. if (doc.cm) {
  22442. doc.cm.curOp.updateInput = doc.cm.curOp.selectionChanged = true;
  22443. signalCursorActivity(doc.cm);
  22444. }
  22445. signalLater(doc, "cursorActivity", doc);
  22446. }
  22447. // Verify that the selection does not partially select any atomic
  22448. // marked ranges.
  22449. function reCheckSelection(doc) {
  22450. setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false), sel_dontScroll);
  22451. }
  22452. // Return a selection that does not partially select any atomic
  22453. // ranges.
  22454. function skipAtomicInSelection(doc, sel, bias, mayClear) {
  22455. var out;
  22456. for (var i = 0; i < sel.ranges.length; i++) {
  22457. var range = sel.ranges[i];
  22458. var old = sel.ranges.length == doc.sel.ranges.length && doc.sel.ranges[i];
  22459. var newAnchor = skipAtomic(doc, range.anchor, old && old.anchor, bias, mayClear);
  22460. var newHead = skipAtomic(doc, range.head, old && old.head, bias, mayClear);
  22461. if (out || newAnchor != range.anchor || newHead != range.head) {
  22462. if (!out) out = sel.ranges.slice(0, i);
  22463. out[i] = new Range(newAnchor, newHead);
  22464. }
  22465. }
  22466. return out ? normalizeSelection(out, sel.primIndex) : sel;
  22467. }
  22468. function skipAtomicInner(doc, pos, oldPos, dir, mayClear) {
  22469. var line = getLine(doc, pos.line);
  22470. if (line.markedSpans) for (var i = 0; i < line.markedSpans.length; ++i) {
  22471. var sp = line.markedSpans[i], m = sp.marker;
  22472. if ((sp.from == null || (m.inclusiveLeft ? sp.from <= pos.ch : sp.from < pos.ch)) &&
  22473. (sp.to == null || (m.inclusiveRight ? sp.to >= pos.ch : sp.to > pos.ch))) {
  22474. if (mayClear) {
  22475. signal(m, "beforeCursorEnter");
  22476. if (m.explicitlyCleared) {
  22477. if (!line.markedSpans) break;
  22478. else {--i; continue;}
  22479. }
  22480. }
  22481. if (!m.atomic) continue;
  22482. if (oldPos) {
  22483. var near = m.find(dir < 0 ? 1 : -1), diff;
  22484. if (dir < 0 ? m.inclusiveRight : m.inclusiveLeft)
  22485. near = movePos(doc, near, -dir, near && near.line == pos.line ? line : null);
  22486. if (near && near.line == pos.line && (diff = cmp(near, oldPos)) && (dir < 0 ? diff < 0 : diff > 0))
  22487. return skipAtomicInner(doc, near, pos, dir, mayClear);
  22488. }
  22489. var far = m.find(dir < 0 ? -1 : 1);
  22490. if (dir < 0 ? m.inclusiveLeft : m.inclusiveRight)
  22491. far = movePos(doc, far, dir, far.line == pos.line ? line : null);
  22492. return far ? skipAtomicInner(doc, far, pos, dir, mayClear) : null;
  22493. }
  22494. }
  22495. return pos;
  22496. }
  22497. // Ensure a given position is not inside an atomic range.
  22498. function skipAtomic(doc, pos, oldPos, bias, mayClear) {
  22499. var dir = bias || 1;
  22500. var found = skipAtomicInner(doc, pos, oldPos, dir, mayClear) ||
  22501. (!mayClear && skipAtomicInner(doc, pos, oldPos, dir, true)) ||
  22502. skipAtomicInner(doc, pos, oldPos, -dir, mayClear) ||
  22503. (!mayClear && skipAtomicInner(doc, pos, oldPos, -dir, true));
  22504. if (!found) {
  22505. doc.cantEdit = true;
  22506. return Pos(doc.first, 0);
  22507. }
  22508. return found;
  22509. }
  22510. function movePos(doc, pos, dir, line) {
  22511. if (dir < 0 && pos.ch == 0) {
  22512. if (pos.line > doc.first) return clipPos(doc, Pos(pos.line - 1));
  22513. else return null;
  22514. } else if (dir > 0 && pos.ch == (line || getLine(doc, pos.line)).text.length) {
  22515. if (pos.line < doc.first + doc.size - 1) return Pos(pos.line + 1, 0);
  22516. else return null;
  22517. } else {
  22518. return new Pos(pos.line, pos.ch + dir);
  22519. }
  22520. }
  22521. // SELECTION DRAWING
  22522. function updateSelection(cm) {
  22523. cm.display.input.showSelection(cm.display.input.prepareSelection());
  22524. }
  22525. function prepareSelection(cm, primary) {
  22526. var doc = cm.doc, result = {};
  22527. var curFragment = result.cursors = document.createDocumentFragment();
  22528. var selFragment = result.selection = document.createDocumentFragment();
  22529. for (var i = 0; i < doc.sel.ranges.length; i++) {
  22530. if (primary === false && i == doc.sel.primIndex) continue;
  22531. var range = doc.sel.ranges[i];
  22532. if (range.from().line >= cm.display.viewTo || range.to().line < cm.display.viewFrom) continue;
  22533. var collapsed = range.empty();
  22534. if (collapsed || cm.options.showCursorWhenSelecting)
  22535. drawSelectionCursor(cm, range.head, curFragment);
  22536. if (!collapsed)
  22537. drawSelectionRange(cm, range, selFragment);
  22538. }
  22539. return result;
  22540. }
  22541. // Draws a cursor for the given range
  22542. function drawSelectionCursor(cm, head, output) {
  22543. var pos = cursorCoords(cm, head, "div", null, null, !cm.options.singleCursorHeightPerLine);
  22544. var cursor = output.appendChild(elt("div", "\u00a0", "CodeMirror-cursor"));
  22545. cursor.style.left = pos.left + "px";
  22546. cursor.style.top = pos.top + "px";
  22547. cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + "px";
  22548. if (pos.other) {
  22549. // Secondary cursor, shown when on a 'jump' in bi-directional text
  22550. var otherCursor = output.appendChild(elt("div", "\u00a0", "CodeMirror-cursor CodeMirror-secondarycursor"));
  22551. otherCursor.style.display = "";
  22552. otherCursor.style.left = pos.other.left + "px";
  22553. otherCursor.style.top = pos.other.top + "px";
  22554. otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + "px";
  22555. }
  22556. }
  22557. // Draws the given range as a highlighted selection
  22558. function drawSelectionRange(cm, range, output) {
  22559. var display = cm.display, doc = cm.doc;
  22560. var fragment = document.createDocumentFragment();
  22561. var padding = paddingH(cm.display), leftSide = padding.left;
  22562. var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;
  22563. function add(left, top, width, bottom) {
  22564. if (top < 0) top = 0;
  22565. top = Math.round(top);
  22566. bottom = Math.round(bottom);
  22567. fragment.appendChild(elt("div", null, "CodeMirror-selected", "position: absolute; left: " + left +
  22568. "px; top: " + top + "px; width: " + (width == null ? rightSide - left : width) +
  22569. "px; height: " + (bottom - top) + "px"));
  22570. }
  22571. function drawForLine(line, fromArg, toArg) {
  22572. var lineObj = getLine(doc, line);
  22573. var lineLen = lineObj.text.length;
  22574. var start, end;
  22575. function coords(ch, bias) {
  22576. return charCoords(cm, Pos(line, ch), "div", lineObj, bias);
  22577. }
  22578. iterateBidiSections(getOrder(lineObj), fromArg || 0, toArg == null ? lineLen : toArg, function(from, to, dir) {
  22579. var leftPos = coords(from, "left"), rightPos, left, right;
  22580. if (from == to) {
  22581. rightPos = leftPos;
  22582. left = right = leftPos.left;
  22583. } else {
  22584. rightPos = coords(to - 1, "right");
  22585. if (dir == "rtl") { var tmp = leftPos; leftPos = rightPos; rightPos = tmp; }
  22586. left = leftPos.left;
  22587. right = rightPos.right;
  22588. }
  22589. if (fromArg == null && from == 0) left = leftSide;
  22590. if (rightPos.top - leftPos.top > 3) { // Different lines, draw top part
  22591. add(left, leftPos.top, null, leftPos.bottom);
  22592. left = leftSide;
  22593. if (leftPos.bottom < rightPos.top) add(left, leftPos.bottom, null, rightPos.top);
  22594. }
  22595. if (toArg == null && to == lineLen) right = rightSide;
  22596. if (!start || leftPos.top < start.top || leftPos.top == start.top && leftPos.left < start.left)
  22597. start = leftPos;
  22598. if (!end || rightPos.bottom > end.bottom || rightPos.bottom == end.bottom && rightPos.right > end.right)
  22599. end = rightPos;
  22600. if (left < leftSide + 1) left = leftSide;
  22601. add(left, rightPos.top, right - left, rightPos.bottom);
  22602. });
  22603. return {start: start, end: end};
  22604. }
  22605. var sFrom = range.from(), sTo = range.to();
  22606. if (sFrom.line == sTo.line) {
  22607. drawForLine(sFrom.line, sFrom.ch, sTo.ch);
  22608. } else {
  22609. var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);
  22610. var singleVLine = visualLine(fromLine) == visualLine(toLine);
  22611. var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;
  22612. var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;
  22613. if (singleVLine) {
  22614. if (leftEnd.top < rightStart.top - 2) {
  22615. add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);
  22616. add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);
  22617. } else {
  22618. add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);
  22619. }
  22620. }
  22621. if (leftEnd.bottom < rightStart.top)
  22622. add(leftSide, leftEnd.bottom, null, rightStart.top);
  22623. }
  22624. output.appendChild(fragment);
  22625. }
  22626. // Cursor-blinking
  22627. function restartBlink(cm) {
  22628. if (!cm.state.focused) return;
  22629. var display = cm.display;
  22630. clearInterval(display.blinker);
  22631. var on = true;
  22632. display.cursorDiv.style.visibility = "";
  22633. if (cm.options.cursorBlinkRate > 0)
  22634. display.blinker = setInterval(function() {
  22635. display.cursorDiv.style.visibility = (on = !on) ? "" : "hidden";
  22636. }, cm.options.cursorBlinkRate);
  22637. else if (cm.options.cursorBlinkRate < 0)
  22638. display.cursorDiv.style.visibility = "hidden";
  22639. }
  22640. // HIGHLIGHT WORKER
  22641. function startWorker(cm, time) {
  22642. if (cm.doc.mode.startState && cm.doc.frontier < cm.display.viewTo)
  22643. cm.state.highlight.set(time, bind(highlightWorker, cm));
  22644. }
  22645. function highlightWorker(cm) {
  22646. var doc = cm.doc;
  22647. if (doc.frontier < doc.first) doc.frontier = doc.first;
  22648. if (doc.frontier >= cm.display.viewTo) return;
  22649. var end = +new Date + cm.options.workTime;
  22650. var state = copyState(doc.mode, getStateBefore(cm, doc.frontier));
  22651. var changedLines = [];
  22652. doc.iter(doc.frontier, Math.min(doc.first + doc.size, cm.display.viewTo + 500), function(line) {
  22653. if (doc.frontier >= cm.display.viewFrom) { // Visible
  22654. var oldStyles = line.styles, tooLong = line.text.length > cm.options.maxHighlightLength;
  22655. var highlighted = highlightLine(cm, line, tooLong ? copyState(doc.mode, state) : state, true);
  22656. line.styles = highlighted.styles;
  22657. var oldCls = line.styleClasses, newCls = highlighted.classes;
  22658. if (newCls) line.styleClasses = newCls;
  22659. else if (oldCls) line.styleClasses = null;
  22660. var ischange = !oldStyles || oldStyles.length != line.styles.length ||
  22661. oldCls != newCls && (!oldCls || !newCls || oldCls.bgClass != newCls.bgClass || oldCls.textClass != newCls.textClass);
  22662. for (var i = 0; !ischange && i < oldStyles.length; ++i) ischange = oldStyles[i] != line.styles[i];
  22663. if (ischange) changedLines.push(doc.frontier);
  22664. line.stateAfter = tooLong ? state : copyState(doc.mode, state);
  22665. } else {
  22666. if (line.text.length <= cm.options.maxHighlightLength)
  22667. processLine(cm, line.text, state);
  22668. line.stateAfter = doc.frontier % 5 == 0 ? copyState(doc.mode, state) : null;
  22669. }
  22670. ++doc.frontier;
  22671. if (+new Date > end) {
  22672. startWorker(cm, cm.options.workDelay);
  22673. return true;
  22674. }
  22675. });
  22676. if (changedLines.length) runInOp(cm, function() {
  22677. for (var i = 0; i < changedLines.length; i++)
  22678. regLineChange(cm, changedLines[i], "text");
  22679. });
  22680. }
  22681. // Finds the line to start with when starting a parse. Tries to
  22682. // find a line with a stateAfter, so that it can start with a
  22683. // valid state. If that fails, it returns the line with the
  22684. // smallest indentation, which tends to need the least context to
  22685. // parse correctly.
  22686. function findStartLine(cm, n, precise) {
  22687. var minindent, minline, doc = cm.doc;
  22688. var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);
  22689. for (var search = n; search > lim; --search) {
  22690. if (search <= doc.first) return doc.first;
  22691. var line = getLine(doc, search - 1);
  22692. if (line.stateAfter && (!precise || search <= doc.frontier)) return search;
  22693. var indented = countColumn(line.text, null, cm.options.tabSize);
  22694. if (minline == null || minindent > indented) {
  22695. minline = search - 1;
  22696. minindent = indented;
  22697. }
  22698. }
  22699. return minline;
  22700. }
  22701. function getStateBefore(cm, n, precise) {
  22702. var doc = cm.doc, display = cm.display;
  22703. if (!doc.mode.startState) return true;
  22704. var pos = findStartLine(cm, n, precise), state = pos > doc.first && getLine(doc, pos-1).stateAfter;
  22705. if (!state) state = startState(doc.mode);
  22706. else state = copyState(doc.mode, state);
  22707. doc.iter(pos, n, function(line) {
  22708. processLine(cm, line.text, state);
  22709. var save = pos == n - 1 || pos % 5 == 0 || pos >= display.viewFrom && pos < display.viewTo;
  22710. line.stateAfter = save ? copyState(doc.mode, state) : null;
  22711. ++pos;
  22712. });
  22713. if (precise) doc.frontier = pos;
  22714. return state;
  22715. }
  22716. // POSITION MEASUREMENT
  22717. function paddingTop(display) {return display.lineSpace.offsetTop;}
  22718. function paddingVert(display) {return display.mover.offsetHeight - display.lineSpace.offsetHeight;}
  22719. function paddingH(display) {
  22720. if (display.cachedPaddingH) return display.cachedPaddingH;
  22721. var e = removeChildrenAndAdd(display.measure, elt("pre", "x"));
  22722. var style = window.getComputedStyle ? window.getComputedStyle(e) : e.currentStyle;
  22723. var data = {left: parseInt(style.paddingLeft), right: parseInt(style.paddingRight)};
  22724. if (!isNaN(data.left) && !isNaN(data.right)) display.cachedPaddingH = data;
  22725. return data;
  22726. }
  22727. function scrollGap(cm) { return scrollerGap - cm.display.nativeBarWidth; }
  22728. function displayWidth(cm) {
  22729. return cm.display.scroller.clientWidth - scrollGap(cm) - cm.display.barWidth;
  22730. }
  22731. function displayHeight(cm) {
  22732. return cm.display.scroller.clientHeight - scrollGap(cm) - cm.display.barHeight;
  22733. }
  22734. // Ensure the lineView.wrapping.heights array is populated. This is
  22735. // an array of bottom offsets for the lines that make up a drawn
  22736. // line. When lineWrapping is on, there might be more than one
  22737. // height.
  22738. function ensureLineHeights(cm, lineView, rect) {
  22739. var wrapping = cm.options.lineWrapping;
  22740. var curWidth = wrapping && displayWidth(cm);
  22741. if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {
  22742. var heights = lineView.measure.heights = [];
  22743. if (wrapping) {
  22744. lineView.measure.width = curWidth;
  22745. var rects = lineView.text.firstChild.getClientRects();
  22746. for (var i = 0; i < rects.length - 1; i++) {
  22747. var cur = rects[i], next = rects[i + 1];
  22748. if (Math.abs(cur.bottom - next.bottom) > 2)
  22749. heights.push((cur.bottom + next.top) / 2 - rect.top);
  22750. }
  22751. }
  22752. heights.push(rect.bottom - rect.top);
  22753. }
  22754. }
  22755. // Find a line map (mapping character offsets to text nodes) and a
  22756. // measurement cache for the given line number. (A line view might
  22757. // contain multiple lines when collapsed ranges are present.)
  22758. function mapFromLineView(lineView, line, lineN) {
  22759. if (lineView.line == line)
  22760. return {map: lineView.measure.map, cache: lineView.measure.cache};
  22761. for (var i = 0; i < lineView.rest.length; i++)
  22762. if (lineView.rest[i] == line)
  22763. return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]};
  22764. for (var i = 0; i < lineView.rest.length; i++)
  22765. if (lineNo(lineView.rest[i]) > lineN)
  22766. return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i], before: true};
  22767. }
  22768. // Render a line into the hidden node display.externalMeasured. Used
  22769. // when measurement is needed for a line that's not in the viewport.
  22770. function updateExternalMeasurement(cm, line) {
  22771. line = visualLine(line);
  22772. var lineN = lineNo(line);
  22773. var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);
  22774. view.lineN = lineN;
  22775. var built = view.built = buildLineContent(cm, view);
  22776. view.text = built.pre;
  22777. removeChildrenAndAdd(cm.display.lineMeasure, built.pre);
  22778. return view;
  22779. }
  22780. // Get a {top, bottom, left, right} box (in line-local coordinates)
  22781. // for a given character.
  22782. function measureChar(cm, line, ch, bias) {
  22783. return measureCharPrepared(cm, prepareMeasureForLine(cm, line), ch, bias);
  22784. }
  22785. // Find a line view that corresponds to the given line number.
  22786. function findViewForLine(cm, lineN) {
  22787. if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)
  22788. return cm.display.view[findViewIndex(cm, lineN)];
  22789. var ext = cm.display.externalMeasured;
  22790. if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)
  22791. return ext;
  22792. }
  22793. // Measurement can be split in two steps, the set-up work that
  22794. // applies to the whole line, and the measurement of the actual
  22795. // character. Functions like coordsChar, that need to do a lot of
  22796. // measurements in a row, can thus ensure that the set-up work is
  22797. // only done once.
  22798. function prepareMeasureForLine(cm, line) {
  22799. var lineN = lineNo(line);
  22800. var view = findViewForLine(cm, lineN);
  22801. if (view && !view.text) {
  22802. view = null;
  22803. } else if (view && view.changes) {
  22804. updateLineForChanges(cm, view, lineN, getDimensions(cm));
  22805. cm.curOp.forceUpdate = true;
  22806. }
  22807. if (!view)
  22808. view = updateExternalMeasurement(cm, line);
  22809. var info = mapFromLineView(view, line, lineN);
  22810. return {
  22811. line: line, view: view, rect: null,
  22812. map: info.map, cache: info.cache, before: info.before,
  22813. hasHeights: false
  22814. };
  22815. }
  22816. // Given a prepared measurement object, measures the position of an
  22817. // actual character (or fetches it from the cache).
  22818. function measureCharPrepared(cm, prepared, ch, bias, varHeight) {
  22819. if (prepared.before) ch = -1;
  22820. var key = ch + (bias || ""), found;
  22821. if (prepared.cache.hasOwnProperty(key)) {
  22822. found = prepared.cache[key];
  22823. } else {
  22824. if (!prepared.rect)
  22825. prepared.rect = prepared.view.text.getBoundingClientRect();
  22826. if (!prepared.hasHeights) {
  22827. ensureLineHeights(cm, prepared.view, prepared.rect);
  22828. prepared.hasHeights = true;
  22829. }
  22830. found = measureCharInner(cm, prepared, ch, bias);
  22831. if (!found.bogus) prepared.cache[key] = found;
  22832. }
  22833. return {left: found.left, right: found.right,
  22834. top: varHeight ? found.rtop : found.top,
  22835. bottom: varHeight ? found.rbottom : found.bottom};
  22836. }
  22837. var nullRect = {left: 0, right: 0, top: 0, bottom: 0};
  22838. function nodeAndOffsetInLineMap(map, ch, bias) {
  22839. var node, start, end, collapse;
  22840. // First, search the line map for the text node corresponding to,
  22841. // or closest to, the target character.
  22842. for (var i = 0; i < map.length; i += 3) {
  22843. var mStart = map[i], mEnd = map[i + 1];
  22844. if (ch < mStart) {
  22845. start = 0; end = 1;
  22846. collapse = "left";
  22847. } else if (ch < mEnd) {
  22848. start = ch - mStart;
  22849. end = start + 1;
  22850. } else if (i == map.length - 3 || ch == mEnd && map[i + 3] > ch) {
  22851. end = mEnd - mStart;
  22852. start = end - 1;
  22853. if (ch >= mEnd) collapse = "right";
  22854. }
  22855. if (start != null) {
  22856. node = map[i + 2];
  22857. if (mStart == mEnd && bias == (node.insertLeft ? "left" : "right"))
  22858. collapse = bias;
  22859. if (bias == "left" && start == 0)
  22860. while (i && map[i - 2] == map[i - 3] && map[i - 1].insertLeft) {
  22861. node = map[(i -= 3) + 2];
  22862. collapse = "left";
  22863. }
  22864. if (bias == "right" && start == mEnd - mStart)
  22865. while (i < map.length - 3 && map[i + 3] == map[i + 4] && !map[i + 5].insertLeft) {
  22866. node = map[(i += 3) + 2];
  22867. collapse = "right";
  22868. }
  22869. break;
  22870. }
  22871. }
  22872. return {node: node, start: start, end: end, collapse: collapse, coverStart: mStart, coverEnd: mEnd};
  22873. }
  22874. function getUsefulRect(rects, bias) {
  22875. var rect = nullRect
  22876. if (bias == "left") for (var i = 0; i < rects.length; i++) {
  22877. if ((rect = rects[i]).left != rect.right) break
  22878. } else for (var i = rects.length - 1; i >= 0; i--) {
  22879. if ((rect = rects[i]).left != rect.right) break
  22880. }
  22881. return rect
  22882. }
  22883. function measureCharInner(cm, prepared, ch, bias) {
  22884. var place = nodeAndOffsetInLineMap(prepared.map, ch, bias);
  22885. var node = place.node, start = place.start, end = place.end, collapse = place.collapse;
  22886. var rect;
  22887. if (node.nodeType == 3) { // If it is a text node, use a range to retrieve the coordinates.
  22888. for (var i = 0; i < 4; i++) { // Retry a maximum of 4 times when nonsense rectangles are returned
  22889. while (start && isExtendingChar(prepared.line.text.charAt(place.coverStart + start))) --start;
  22890. while (place.coverStart + end < place.coverEnd && isExtendingChar(prepared.line.text.charAt(place.coverStart + end))) ++end;
  22891. if (ie && ie_version < 9 && start == 0 && end == place.coverEnd - place.coverStart)
  22892. rect = node.parentNode.getBoundingClientRect();
  22893. else
  22894. rect = getUsefulRect(range(node, start, end).getClientRects(), bias)
  22895. if (rect.left || rect.right || start == 0) break;
  22896. end = start;
  22897. start = start - 1;
  22898. collapse = "right";
  22899. }
  22900. if (ie && ie_version < 11) rect = maybeUpdateRectForZooming(cm.display.measure, rect);
  22901. } else { // If it is a widget, simply get the box for the whole widget.
  22902. if (start > 0) collapse = bias = "right";
  22903. var rects;
  22904. if (cm.options.lineWrapping && (rects = node.getClientRects()).length > 1)
  22905. rect = rects[bias == "right" ? rects.length - 1 : 0];
  22906. else
  22907. rect = node.getBoundingClientRect();
  22908. }
  22909. if (ie && ie_version < 9 && !start && (!rect || !rect.left && !rect.right)) {
  22910. var rSpan = node.parentNode.getClientRects()[0];
  22911. if (rSpan)
  22912. rect = {left: rSpan.left, right: rSpan.left + charWidth(cm.display), top: rSpan.top, bottom: rSpan.bottom};
  22913. else
  22914. rect = nullRect;
  22915. }
  22916. var rtop = rect.top - prepared.rect.top, rbot = rect.bottom - prepared.rect.top;
  22917. var mid = (rtop + rbot) / 2;
  22918. var heights = prepared.view.measure.heights;
  22919. for (var i = 0; i < heights.length - 1; i++)
  22920. if (mid < heights[i]) break;
  22921. var top = i ? heights[i - 1] : 0, bot = heights[i];
  22922. var result = {left: (collapse == "right" ? rect.right : rect.left) - prepared.rect.left,
  22923. right: (collapse == "left" ? rect.left : rect.right) - prepared.rect.left,
  22924. top: top, bottom: bot};
  22925. if (!rect.left && !rect.right) result.bogus = true;
  22926. if (!cm.options.singleCursorHeightPerLine) { result.rtop = rtop; result.rbottom = rbot; }
  22927. return result;
  22928. }
  22929. // Work around problem with bounding client rects on ranges being
  22930. // returned incorrectly when zoomed on IE10 and below.
  22931. function maybeUpdateRectForZooming(measure, rect) {
  22932. if (!window.screen || screen.logicalXDPI == null ||
  22933. screen.logicalXDPI == screen.deviceXDPI || !hasBadZoomedRects(measure))
  22934. return rect;
  22935. var scaleX = screen.logicalXDPI / screen.deviceXDPI;
  22936. var scaleY = screen.logicalYDPI / screen.deviceYDPI;
  22937. return {left: rect.left * scaleX, right: rect.right * scaleX,
  22938. top: rect.top * scaleY, bottom: rect.bottom * scaleY};
  22939. }
  22940. function clearLineMeasurementCacheFor(lineView) {
  22941. if (lineView.measure) {
  22942. lineView.measure.cache = {};
  22943. lineView.measure.heights = null;
  22944. if (lineView.rest) for (var i = 0; i < lineView.rest.length; i++)
  22945. lineView.measure.caches[i] = {};
  22946. }
  22947. }
  22948. function clearLineMeasurementCache(cm) {
  22949. cm.display.externalMeasure = null;
  22950. removeChildren(cm.display.lineMeasure);
  22951. for (var i = 0; i < cm.display.view.length; i++)
  22952. clearLineMeasurementCacheFor(cm.display.view[i]);
  22953. }
  22954. function clearCaches(cm) {
  22955. clearLineMeasurementCache(cm);
  22956. cm.display.cachedCharWidth = cm.display.cachedTextHeight = cm.display.cachedPaddingH = null;
  22957. if (!cm.options.lineWrapping) cm.display.maxLineChanged = true;
  22958. cm.display.lineNumChars = null;
  22959. }
  22960. function pageScrollX() { return window.pageXOffset || (document.documentElement || document.body).scrollLeft; }
  22961. function pageScrollY() { return window.pageYOffset || (document.documentElement || document.body).scrollTop; }
  22962. // Converts a {top, bottom, left, right} box from line-local
  22963. // coordinates into another coordinate system. Context may be one of
  22964. // "line", "div" (display.lineDiv), "local"/null (editor), "window",
  22965. // or "page".
  22966. function intoCoordSystem(cm, lineObj, rect, context) {
  22967. if (lineObj.widgets) for (var i = 0; i < lineObj.widgets.length; ++i) if (lineObj.widgets[i].above) {
  22968. var size = widgetHeight(lineObj.widgets[i]);
  22969. rect.top += size; rect.bottom += size;
  22970. }
  22971. if (context == "line") return rect;
  22972. if (!context) context = "local";
  22973. var yOff = heightAtLine(lineObj);
  22974. if (context == "local") yOff += paddingTop(cm.display);
  22975. else yOff -= cm.display.viewOffset;
  22976. if (context == "page" || context == "window") {
  22977. var lOff = cm.display.lineSpace.getBoundingClientRect();
  22978. yOff += lOff.top + (context == "window" ? 0 : pageScrollY());
  22979. var xOff = lOff.left + (context == "window" ? 0 : pageScrollX());
  22980. rect.left += xOff; rect.right += xOff;
  22981. }
  22982. rect.top += yOff; rect.bottom += yOff;
  22983. return rect;
  22984. }
  22985. // Coverts a box from "div" coords to another coordinate system.
  22986. // Context may be "window", "page", "div", or "local"/null.
  22987. function fromCoordSystem(cm, coords, context) {
  22988. if (context == "div") return coords;
  22989. var left = coords.left, top = coords.top;
  22990. // First move into "page" coordinate system
  22991. if (context == "page") {
  22992. left -= pageScrollX();
  22993. top -= pageScrollY();
  22994. } else if (context == "local" || !context) {
  22995. var localBox = cm.display.sizer.getBoundingClientRect();
  22996. left += localBox.left;
  22997. top += localBox.top;
  22998. }
  22999. var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();
  23000. return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top};
  23001. }
  23002. function charCoords(cm, pos, context, lineObj, bias) {
  23003. if (!lineObj) lineObj = getLine(cm.doc, pos.line);
  23004. return intoCoordSystem(cm, lineObj, measureChar(cm, lineObj, pos.ch, bias), context);
  23005. }
  23006. // Returns a box for a given cursor position, which may have an
  23007. // 'other' property containing the position of the secondary cursor
  23008. // on a bidi boundary.
  23009. function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {
  23010. lineObj = lineObj || getLine(cm.doc, pos.line);
  23011. if (!preparedMeasure) preparedMeasure = prepareMeasureForLine(cm, lineObj);
  23012. function get(ch, right) {
  23013. var m = measureCharPrepared(cm, preparedMeasure, ch, right ? "right" : "left", varHeight);
  23014. if (right) m.left = m.right; else m.right = m.left;
  23015. return intoCoordSystem(cm, lineObj, m, context);
  23016. }
  23017. function getBidi(ch, partPos) {
  23018. var part = order[partPos], right = part.level % 2;
  23019. if (ch == bidiLeft(part) && partPos && part.level < order[partPos - 1].level) {
  23020. part = order[--partPos];
  23021. ch = bidiRight(part) - (part.level % 2 ? 0 : 1);
  23022. right = true;
  23023. } else if (ch == bidiRight(part) && partPos < order.length - 1 && part.level < order[partPos + 1].level) {
  23024. part = order[++partPos];
  23025. ch = bidiLeft(part) - part.level % 2;
  23026. right = false;
  23027. }
  23028. if (right && ch == part.to && ch > part.from) return get(ch - 1);
  23029. return get(ch, right);
  23030. }
  23031. var order = getOrder(lineObj), ch = pos.ch;
  23032. if (!order) return get(ch);
  23033. var partPos = getBidiPartAt(order, ch);
  23034. var val = getBidi(ch, partPos);
  23035. if (bidiOther != null) val.other = getBidi(ch, bidiOther);
  23036. return val;
  23037. }
  23038. // Used to cheaply estimate the coordinates for a position. Used for
  23039. // intermediate scroll updates.
  23040. function estimateCoords(cm, pos) {
  23041. var left = 0, pos = clipPos(cm.doc, pos);
  23042. if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;
  23043. var lineObj = getLine(cm.doc, pos.line);
  23044. var top = heightAtLine(lineObj) + paddingTop(cm.display);
  23045. return {left: left, right: left, top: top, bottom: top + lineObj.height};
  23046. }
  23047. // Positions returned by coordsChar contain some extra information.
  23048. // xRel is the relative x position of the input coordinates compared
  23049. // to the found position (so xRel > 0 means the coordinates are to
  23050. // the right of the character position, for example). When outside
  23051. // is true, that means the coordinates lie outside the line's
  23052. // vertical range.
  23053. function PosWithInfo(line, ch, outside, xRel) {
  23054. var pos = Pos(line, ch);
  23055. pos.xRel = xRel;
  23056. if (outside) pos.outside = true;
  23057. return pos;
  23058. }
  23059. // Compute the character position closest to the given coordinates.
  23060. // Input must be lineSpace-local ("div" coordinate system).
  23061. function coordsChar(cm, x, y) {
  23062. var doc = cm.doc;
  23063. y += cm.display.viewOffset;
  23064. if (y < 0) return PosWithInfo(doc.first, 0, true, -1);
  23065. var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;
  23066. if (lineN > last)
  23067. return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1);
  23068. if (x < 0) x = 0;
  23069. var lineObj = getLine(doc, lineN);
  23070. for (;;) {
  23071. var found = coordsCharInner(cm, lineObj, lineN, x, y);
  23072. var merged = collapsedSpanAtEnd(lineObj);
  23073. var mergedPos = merged && merged.find(0, true);
  23074. if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))
  23075. lineN = lineNo(lineObj = mergedPos.to.line);
  23076. else
  23077. return found;
  23078. }
  23079. }
  23080. function coordsCharInner(cm, lineObj, lineNo, x, y) {
  23081. var innerOff = y - heightAtLine(lineObj);
  23082. var wrongLine = false, adjust = 2 * cm.display.wrapper.clientWidth;
  23083. var preparedMeasure = prepareMeasureForLine(cm, lineObj);
  23084. function getX(ch) {
  23085. var sp = cursorCoords(cm, Pos(lineNo, ch), "line", lineObj, preparedMeasure);
  23086. wrongLine = true;
  23087. if (innerOff > sp.bottom) return sp.left - adjust;
  23088. else if (innerOff < sp.top) return sp.left + adjust;
  23089. else wrongLine = false;
  23090. return sp.left;
  23091. }
  23092. var bidi = getOrder(lineObj), dist = lineObj.text.length;
  23093. var from = lineLeft(lineObj), to = lineRight(lineObj);
  23094. var fromX = getX(from), fromOutside = wrongLine, toX = getX(to), toOutside = wrongLine;
  23095. if (x > toX) return PosWithInfo(lineNo, to, toOutside, 1);
  23096. // Do a binary search between these bounds.
  23097. for (;;) {
  23098. if (bidi ? to == from || to == moveVisually(lineObj, from, 1) : to - from <= 1) {
  23099. var ch = x < fromX || x - fromX <= toX - x ? from : to;
  23100. var outside = ch == from ? fromOutside : toOutside
  23101. var xDiff = x - (ch == from ? fromX : toX);
  23102. // This is a kludge to handle the case where the coordinates
  23103. // are after a line-wrapped line. We should replace it with a
  23104. // more general handling of cursor positions around line
  23105. // breaks. (Issue #4078)
  23106. if (toOutside && !bidi && !/\s/.test(lineObj.text.charAt(ch)) && xDiff > 0 &&
  23107. ch < lineObj.text.length && preparedMeasure.view.measure.heights.length > 1) {
  23108. var charSize = measureCharPrepared(cm, preparedMeasure, ch, "right");
  23109. if (innerOff <= charSize.bottom && innerOff >= charSize.top && Math.abs(x - charSize.right) < xDiff) {
  23110. outside = false
  23111. ch++
  23112. xDiff = x - charSize.right
  23113. }
  23114. }
  23115. while (isExtendingChar(lineObj.text.charAt(ch))) ++ch;
  23116. var pos = PosWithInfo(lineNo, ch, outside, xDiff < -1 ? -1 : xDiff > 1 ? 1 : 0);
  23117. return pos;
  23118. }
  23119. var step = Math.ceil(dist / 2), middle = from + step;
  23120. if (bidi) {
  23121. middle = from;
  23122. for (var i = 0; i < step; ++i) middle = moveVisually(lineObj, middle, 1);
  23123. }
  23124. var middleX = getX(middle);
  23125. if (middleX > x) {to = middle; toX = middleX; if (toOutside = wrongLine) toX += 1000; dist = step;}
  23126. else {from = middle; fromX = middleX; fromOutside = wrongLine; dist -= step;}
  23127. }
  23128. }
  23129. var measureText;
  23130. // Compute the default text height.
  23131. function textHeight(display) {
  23132. if (display.cachedTextHeight != null) return display.cachedTextHeight;
  23133. if (measureText == null) {
  23134. measureText = elt("pre");
  23135. // Measure a bunch of lines, for browsers that compute
  23136. // fractional heights.
  23137. for (var i = 0; i < 49; ++i) {
  23138. measureText.appendChild(document.createTextNode("x"));
  23139. measureText.appendChild(elt("br"));
  23140. }
  23141. measureText.appendChild(document.createTextNode("x"));
  23142. }
  23143. removeChildrenAndAdd(display.measure, measureText);
  23144. var height = measureText.offsetHeight / 50;
  23145. if (height > 3) display.cachedTextHeight = height;
  23146. removeChildren(display.measure);
  23147. return height || 1;
  23148. }
  23149. // Compute the default character width.
  23150. function charWidth(display) {
  23151. if (display.cachedCharWidth != null) return display.cachedCharWidth;
  23152. var anchor = elt("span", "xxxxxxxxxx");
  23153. var pre = elt("pre", [anchor]);
  23154. removeChildrenAndAdd(display.measure, pre);
  23155. var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;
  23156. if (width > 2) display.cachedCharWidth = width;
  23157. return width || 10;
  23158. }
  23159. // OPERATIONS
  23160. // Operations are used to wrap a series of changes to the editor
  23161. // state in such a way that each change won't have to update the
  23162. // cursor and display (which would be awkward, slow, and
  23163. // error-prone). Instead, display updates are batched and then all
  23164. // combined and executed at once.
  23165. var operationGroup = null;
  23166. var nextOpId = 0;
  23167. // Start a new operation.
  23168. function startOperation(cm) {
  23169. cm.curOp = {
  23170. cm: cm,
  23171. viewChanged: false, // Flag that indicates that lines might need to be redrawn
  23172. startHeight: cm.doc.height, // Used to detect need to update scrollbar
  23173. forceUpdate: false, // Used to force a redraw
  23174. updateInput: null, // Whether to reset the input textarea
  23175. typing: false, // Whether this reset should be careful to leave existing text (for compositing)
  23176. changeObjs: null, // Accumulated changes, for firing change events
  23177. cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on
  23178. cursorActivityCalled: 0, // Tracks which cursorActivity handlers have been called already
  23179. selectionChanged: false, // Whether the selection needs to be redrawn
  23180. updateMaxLine: false, // Set when the widest line needs to be determined anew
  23181. scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet
  23182. scrollToPos: null, // Used to scroll to a specific position
  23183. focus: false,
  23184. id: ++nextOpId // Unique ID
  23185. };
  23186. if (operationGroup) {
  23187. operationGroup.ops.push(cm.curOp);
  23188. } else {
  23189. cm.curOp.ownsGroup = operationGroup = {
  23190. ops: [cm.curOp],
  23191. delayedCallbacks: []
  23192. };
  23193. }
  23194. }
  23195. function fireCallbacksForOps(group) {
  23196. // Calls delayed callbacks and cursorActivity handlers until no
  23197. // new ones appear
  23198. var callbacks = group.delayedCallbacks, i = 0;
  23199. do {
  23200. for (; i < callbacks.length; i++)
  23201. callbacks[i].call(null);
  23202. for (var j = 0; j < group.ops.length; j++) {
  23203. var op = group.ops[j];
  23204. if (op.cursorActivityHandlers)
  23205. while (op.cursorActivityCalled < op.cursorActivityHandlers.length)
  23206. op.cursorActivityHandlers[op.cursorActivityCalled++].call(null, op.cm);
  23207. }
  23208. } while (i < callbacks.length);
  23209. }
  23210. // Finish an operation, updating the display and signalling delayed events
  23211. function endOperation(cm) {
  23212. var op = cm.curOp, group = op.ownsGroup;
  23213. if (!group) return;
  23214. try { fireCallbacksForOps(group); }
  23215. finally {
  23216. operationGroup = null;
  23217. for (var i = 0; i < group.ops.length; i++)
  23218. group.ops[i].cm.curOp = null;
  23219. endOperations(group);
  23220. }
  23221. }
  23222. // The DOM updates done when an operation finishes are batched so
  23223. // that the minimum number of relayouts are required.
  23224. function endOperations(group) {
  23225. var ops = group.ops;
  23226. for (var i = 0; i < ops.length; i++) // Read DOM
  23227. endOperation_R1(ops[i]);
  23228. for (var i = 0; i < ops.length; i++) // Write DOM (maybe)
  23229. endOperation_W1(ops[i]);
  23230. for (var i = 0; i < ops.length; i++) // Read DOM
  23231. endOperation_R2(ops[i]);
  23232. for (var i = 0; i < ops.length; i++) // Write DOM (maybe)
  23233. endOperation_W2(ops[i]);
  23234. for (var i = 0; i < ops.length; i++) // Read DOM
  23235. endOperation_finish(ops[i]);
  23236. }
  23237. function endOperation_R1(op) {
  23238. var cm = op.cm, display = cm.display;
  23239. maybeClipScrollbars(cm);
  23240. if (op.updateMaxLine) findMaxLine(cm);
  23241. op.mustUpdate = op.viewChanged || op.forceUpdate || op.scrollTop != null ||
  23242. op.scrollToPos && (op.scrollToPos.from.line < display.viewFrom ||
  23243. op.scrollToPos.to.line >= display.viewTo) ||
  23244. display.maxLineChanged && cm.options.lineWrapping;
  23245. op.update = op.mustUpdate &&
  23246. new DisplayUpdate(cm, op.mustUpdate && {top: op.scrollTop, ensure: op.scrollToPos}, op.forceUpdate);
  23247. }
  23248. function endOperation_W1(op) {
  23249. op.updatedDisplay = op.mustUpdate && updateDisplayIfNeeded(op.cm, op.update);
  23250. }
  23251. function endOperation_R2(op) {
  23252. var cm = op.cm, display = cm.display;
  23253. if (op.updatedDisplay) updateHeightsInViewport(cm);
  23254. op.barMeasure = measureForScrollbars(cm);
  23255. // If the max line changed since it was last measured, measure it,
  23256. // and ensure the document's width matches it.
  23257. // updateDisplay_W2 will use these properties to do the actual resizing
  23258. if (display.maxLineChanged && !cm.options.lineWrapping) {
  23259. op.adjustWidthTo = measureChar(cm, display.maxLine, display.maxLine.text.length).left + 3;
  23260. cm.display.sizerWidth = op.adjustWidthTo;
  23261. op.barMeasure.scrollWidth =
  23262. Math.max(display.scroller.clientWidth, display.sizer.offsetLeft + op.adjustWidthTo + scrollGap(cm) + cm.display.barWidth);
  23263. op.maxScrollLeft = Math.max(0, display.sizer.offsetLeft + op.adjustWidthTo - displayWidth(cm));
  23264. }
  23265. if (op.updatedDisplay || op.selectionChanged)
  23266. op.preparedSelection = display.input.prepareSelection(op.focus);
  23267. }
  23268. function endOperation_W2(op) {
  23269. var cm = op.cm;
  23270. if (op.adjustWidthTo != null) {
  23271. cm.display.sizer.style.minWidth = op.adjustWidthTo + "px";
  23272. if (op.maxScrollLeft < cm.doc.scrollLeft)
  23273. setScrollLeft(cm, Math.min(cm.display.scroller.scrollLeft, op.maxScrollLeft), true);
  23274. cm.display.maxLineChanged = false;
  23275. }
  23276. var takeFocus = op.focus && op.focus == activeElt() && (!document.hasFocus || document.hasFocus())
  23277. if (op.preparedSelection)
  23278. cm.display.input.showSelection(op.preparedSelection, takeFocus);
  23279. if (op.updatedDisplay || op.startHeight != cm.doc.height)
  23280. updateScrollbars(cm, op.barMeasure);
  23281. if (op.updatedDisplay)
  23282. setDocumentHeight(cm, op.barMeasure);
  23283. if (op.selectionChanged) restartBlink(cm);
  23284. if (cm.state.focused && op.updateInput)
  23285. cm.display.input.reset(op.typing);
  23286. if (takeFocus) ensureFocus(op.cm);
  23287. }
  23288. function endOperation_finish(op) {
  23289. var cm = op.cm, display = cm.display, doc = cm.doc;
  23290. if (op.updatedDisplay) postUpdateDisplay(cm, op.update);
  23291. // Abort mouse wheel delta measurement, when scrolling explicitly
  23292. if (display.wheelStartX != null && (op.scrollTop != null || op.scrollLeft != null || op.scrollToPos))
  23293. display.wheelStartX = display.wheelStartY = null;
  23294. // Propagate the scroll position to the actual DOM scroller
  23295. if (op.scrollTop != null && (display.scroller.scrollTop != op.scrollTop || op.forceScroll)) {
  23296. doc.scrollTop = Math.max(0, Math.min(display.scroller.scrollHeight - display.scroller.clientHeight, op.scrollTop));
  23297. display.scrollbars.setScrollTop(doc.scrollTop);
  23298. display.scroller.scrollTop = doc.scrollTop;
  23299. }
  23300. if (op.scrollLeft != null && (display.scroller.scrollLeft != op.scrollLeft || op.forceScroll)) {
  23301. doc.scrollLeft = Math.max(0, Math.min(display.scroller.scrollWidth - display.scroller.clientWidth, op.scrollLeft));
  23302. display.scrollbars.setScrollLeft(doc.scrollLeft);
  23303. display.scroller.scrollLeft = doc.scrollLeft;
  23304. alignHorizontally(cm);
  23305. }
  23306. // If we need to scroll a specific position into view, do so.
  23307. if (op.scrollToPos) {
  23308. var coords = scrollPosIntoView(cm, clipPos(doc, op.scrollToPos.from),
  23309. clipPos(doc, op.scrollToPos.to), op.scrollToPos.margin);
  23310. if (op.scrollToPos.isCursor && cm.state.focused) maybeScrollWindow(cm, coords);
  23311. }
  23312. // Fire events for markers that are hidden/unidden by editing or
  23313. // undoing
  23314. var hidden = op.maybeHiddenMarkers, unhidden = op.maybeUnhiddenMarkers;
  23315. if (hidden) for (var i = 0; i < hidden.length; ++i)
  23316. if (!hidden[i].lines.length) signal(hidden[i], "hide");
  23317. if (unhidden) for (var i = 0; i < unhidden.length; ++i)
  23318. if (unhidden[i].lines.length) signal(unhidden[i], "unhide");
  23319. if (display.wrapper.offsetHeight)
  23320. doc.scrollTop = cm.display.scroller.scrollTop;
  23321. // Fire change events, and delayed event handlers
  23322. if (op.changeObjs)
  23323. signal(cm, "changes", cm, op.changeObjs);
  23324. if (op.update)
  23325. op.update.finish();
  23326. }
  23327. // Run the given function in an operation
  23328. function runInOp(cm, f) {
  23329. if (cm.curOp) return f();
  23330. startOperation(cm);
  23331. try { return f(); }
  23332. finally { endOperation(cm); }
  23333. }
  23334. // Wraps a function in an operation. Returns the wrapped function.
  23335. function operation(cm, f) {
  23336. return function() {
  23337. if (cm.curOp) return f.apply(cm, arguments);
  23338. startOperation(cm);
  23339. try { return f.apply(cm, arguments); }
  23340. finally { endOperation(cm); }
  23341. };
  23342. }
  23343. // Used to add methods to editor and doc instances, wrapping them in
  23344. // operations.
  23345. function methodOp(f) {
  23346. return function() {
  23347. if (this.curOp) return f.apply(this, arguments);
  23348. startOperation(this);
  23349. try { return f.apply(this, arguments); }
  23350. finally { endOperation(this); }
  23351. };
  23352. }
  23353. function docMethodOp(f) {
  23354. return function() {
  23355. var cm = this.cm;
  23356. if (!cm || cm.curOp) return f.apply(this, arguments);
  23357. startOperation(cm);
  23358. try { return f.apply(this, arguments); }
  23359. finally { endOperation(cm); }
  23360. };
  23361. }
  23362. // VIEW TRACKING
  23363. // These objects are used to represent the visible (currently drawn)
  23364. // part of the document. A LineView may correspond to multiple
  23365. // logical lines, if those are connected by collapsed ranges.
  23366. function LineView(doc, line, lineN) {
  23367. // The starting line
  23368. this.line = line;
  23369. // Continuing lines, if any
  23370. this.rest = visualLineContinued(line);
  23371. // Number of logical lines in this visual line
  23372. this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;
  23373. this.node = this.text = null;
  23374. this.hidden = lineIsHidden(doc, line);
  23375. }
  23376. // Create a range of LineView objects for the given lines.
  23377. function buildViewArray(cm, from, to) {
  23378. var array = [], nextPos;
  23379. for (var pos = from; pos < to; pos = nextPos) {
  23380. var view = new LineView(cm.doc, getLine(cm.doc, pos), pos);
  23381. nextPos = pos + view.size;
  23382. array.push(view);
  23383. }
  23384. return array;
  23385. }
  23386. // Updates the display.view data structure for a given change to the
  23387. // document. From and to are in pre-change coordinates. Lendiff is
  23388. // the amount of lines added or subtracted by the change. This is
  23389. // used for changes that span multiple lines, or change the way
  23390. // lines are divided into visual lines. regLineChange (below)
  23391. // registers single-line changes.
  23392. function regChange(cm, from, to, lendiff) {
  23393. if (from == null) from = cm.doc.first;
  23394. if (to == null) to = cm.doc.first + cm.doc.size;
  23395. if (!lendiff) lendiff = 0;
  23396. var display = cm.display;
  23397. if (lendiff && to < display.viewTo &&
  23398. (display.updateLineNumbers == null || display.updateLineNumbers > from))
  23399. display.updateLineNumbers = from;
  23400. cm.curOp.viewChanged = true;
  23401. if (from >= display.viewTo) { // Change after
  23402. if (sawCollapsedSpans && visualLineNo(cm.doc, from) < display.viewTo)
  23403. resetView(cm);
  23404. } else if (to <= display.viewFrom) { // Change before
  23405. if (sawCollapsedSpans && visualLineEndNo(cm.doc, to + lendiff) > display.viewFrom) {
  23406. resetView(cm);
  23407. } else {
  23408. display.viewFrom += lendiff;
  23409. display.viewTo += lendiff;
  23410. }
  23411. } else if (from <= display.viewFrom && to >= display.viewTo) { // Full overlap
  23412. resetView(cm);
  23413. } else if (from <= display.viewFrom) { // Top overlap
  23414. var cut = viewCuttingPoint(cm, to, to + lendiff, 1);
  23415. if (cut) {
  23416. display.view = display.view.slice(cut.index);
  23417. display.viewFrom = cut.lineN;
  23418. display.viewTo += lendiff;
  23419. } else {
  23420. resetView(cm);
  23421. }
  23422. } else if (to >= display.viewTo) { // Bottom overlap
  23423. var cut = viewCuttingPoint(cm, from, from, -1);
  23424. if (cut) {
  23425. display.view = display.view.slice(0, cut.index);
  23426. display.viewTo = cut.lineN;
  23427. } else {
  23428. resetView(cm);
  23429. }
  23430. } else { // Gap in the middle
  23431. var cutTop = viewCuttingPoint(cm, from, from, -1);
  23432. var cutBot = viewCuttingPoint(cm, to, to + lendiff, 1);
  23433. if (cutTop && cutBot) {
  23434. display.view = display.view.slice(0, cutTop.index)
  23435. .concat(buildViewArray(cm, cutTop.lineN, cutBot.lineN))
  23436. .concat(display.view.slice(cutBot.index));
  23437. display.viewTo += lendiff;
  23438. } else {
  23439. resetView(cm);
  23440. }
  23441. }
  23442. var ext = display.externalMeasured;
  23443. if (ext) {
  23444. if (to < ext.lineN)
  23445. ext.lineN += lendiff;
  23446. else if (from < ext.lineN + ext.size)
  23447. display.externalMeasured = null;
  23448. }
  23449. }
  23450. // Register a change to a single line. Type must be one of "text",
  23451. // "gutter", "class", "widget"
  23452. function regLineChange(cm, line, type) {
  23453. cm.curOp.viewChanged = true;
  23454. var display = cm.display, ext = cm.display.externalMeasured;
  23455. if (ext && line >= ext.lineN && line < ext.lineN + ext.size)
  23456. display.externalMeasured = null;
  23457. if (line < display.viewFrom || line >= display.viewTo) return;
  23458. var lineView = display.view[findViewIndex(cm, line)];
  23459. if (lineView.node == null) return;
  23460. var arr = lineView.changes || (lineView.changes = []);
  23461. if (indexOf(arr, type) == -1) arr.push(type);
  23462. }
  23463. // Clear the view.
  23464. function resetView(cm) {
  23465. cm.display.viewFrom = cm.display.viewTo = cm.doc.first;
  23466. cm.display.view = [];
  23467. cm.display.viewOffset = 0;
  23468. }
  23469. // Find the view element corresponding to a given line. Return null
  23470. // when the line isn't visible.
  23471. function findViewIndex(cm, n) {
  23472. if (n >= cm.display.viewTo) return null;
  23473. n -= cm.display.viewFrom;
  23474. if (n < 0) return null;
  23475. var view = cm.display.view;
  23476. for (var i = 0; i < view.length; i++) {
  23477. n -= view[i].size;
  23478. if (n < 0) return i;
  23479. }
  23480. }
  23481. function viewCuttingPoint(cm, oldN, newN, dir) {
  23482. var index = findViewIndex(cm, oldN), diff, view = cm.display.view;
  23483. if (!sawCollapsedSpans || newN == cm.doc.first + cm.doc.size)
  23484. return {index: index, lineN: newN};
  23485. for (var i = 0, n = cm.display.viewFrom; i < index; i++)
  23486. n += view[i].size;
  23487. if (n != oldN) {
  23488. if (dir > 0) {
  23489. if (index == view.length - 1) return null;
  23490. diff = (n + view[index].size) - oldN;
  23491. index++;
  23492. } else {
  23493. diff = n - oldN;
  23494. }
  23495. oldN += diff; newN += diff;
  23496. }
  23497. while (visualLineNo(cm.doc, newN) != newN) {
  23498. if (index == (dir < 0 ? 0 : view.length - 1)) return null;
  23499. newN += dir * view[index - (dir < 0 ? 1 : 0)].size;
  23500. index += dir;
  23501. }
  23502. return {index: index, lineN: newN};
  23503. }
  23504. // Force the view to cover a given range, adding empty view element
  23505. // or clipping off existing ones as needed.
  23506. function adjustView(cm, from, to) {
  23507. var display = cm.display, view = display.view;
  23508. if (view.length == 0 || from >= display.viewTo || to <= display.viewFrom) {
  23509. display.view = buildViewArray(cm, from, to);
  23510. display.viewFrom = from;
  23511. } else {
  23512. if (display.viewFrom > from)
  23513. display.view = buildViewArray(cm, from, display.viewFrom).concat(display.view);
  23514. else if (display.viewFrom < from)
  23515. display.view = display.view.slice(findViewIndex(cm, from));
  23516. display.viewFrom = from;
  23517. if (display.viewTo < to)
  23518. display.view = display.view.concat(buildViewArray(cm, display.viewTo, to));
  23519. else if (display.viewTo > to)
  23520. display.view = display.view.slice(0, findViewIndex(cm, to));
  23521. }
  23522. display.viewTo = to;
  23523. }
  23524. // Count the number of lines in the view whose DOM representation is
  23525. // out of date (or nonexistent).
  23526. function countDirtyView(cm) {
  23527. var view = cm.display.view, dirty = 0;
  23528. for (var i = 0; i < view.length; i++) {
  23529. var lineView = view[i];
  23530. if (!lineView.hidden && (!lineView.node || lineView.changes)) ++dirty;
  23531. }
  23532. return dirty;
  23533. }
  23534. // EVENT HANDLERS
  23535. // Attach the necessary event handlers when initializing the editor
  23536. function registerEventHandlers(cm) {
  23537. var d = cm.display;
  23538. on(d.scroller, "mousedown", operation(cm, onMouseDown));
  23539. // Older IE's will not fire a second mousedown for a double click
  23540. if (ie && ie_version < 11)
  23541. on(d.scroller, "dblclick", operation(cm, function(e) {
  23542. if (signalDOMEvent(cm, e)) return;
  23543. var pos = posFromMouse(cm, e);
  23544. if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) return;
  23545. e_preventDefault(e);
  23546. var word = cm.findWordAt(pos);
  23547. extendSelection(cm.doc, word.anchor, word.head);
  23548. }));
  23549. else
  23550. on(d.scroller, "dblclick", function(e) { signalDOMEvent(cm, e) || e_preventDefault(e); });
  23551. // Some browsers fire contextmenu *after* opening the menu, at
  23552. // which point we can't mess with it anymore. Context menu is
  23553. // handled in onMouseDown for these browsers.
  23554. if (!captureRightClick) on(d.scroller, "contextmenu", function(e) {onContextMenu(cm, e);});
  23555. // Used to suppress mouse event handling when a touch happens
  23556. var touchFinished, prevTouch = {end: 0};
  23557. function finishTouch() {
  23558. if (d.activeTouch) {
  23559. touchFinished = setTimeout(function() {d.activeTouch = null;}, 1000);
  23560. prevTouch = d.activeTouch;
  23561. prevTouch.end = +new Date;
  23562. }
  23563. };
  23564. function isMouseLikeTouchEvent(e) {
  23565. if (e.touches.length != 1) return false;
  23566. var touch = e.touches[0];
  23567. return touch.radiusX <= 1 && touch.radiusY <= 1;
  23568. }
  23569. function farAway(touch, other) {
  23570. if (other.left == null) return true;
  23571. var dx = other.left - touch.left, dy = other.top - touch.top;
  23572. return dx * dx + dy * dy > 20 * 20;
  23573. }
  23574. on(d.scroller, "touchstart", function(e) {
  23575. if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e)) {
  23576. clearTimeout(touchFinished);
  23577. var now = +new Date;
  23578. d.activeTouch = {start: now, moved: false,
  23579. prev: now - prevTouch.end <= 300 ? prevTouch : null};
  23580. if (e.touches.length == 1) {
  23581. d.activeTouch.left = e.touches[0].pageX;
  23582. d.activeTouch.top = e.touches[0].pageY;
  23583. }
  23584. }
  23585. });
  23586. on(d.scroller, "touchmove", function() {
  23587. if (d.activeTouch) d.activeTouch.moved = true;
  23588. });
  23589. on(d.scroller, "touchend", function(e) {
  23590. var touch = d.activeTouch;
  23591. if (touch && !eventInWidget(d, e) && touch.left != null &&
  23592. !touch.moved && new Date - touch.start < 300) {
  23593. var pos = cm.coordsChar(d.activeTouch, "page"), range;
  23594. if (!touch.prev || farAway(touch, touch.prev)) // Single tap
  23595. range = new Range(pos, pos);
  23596. else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap
  23597. range = cm.findWordAt(pos);
  23598. else // Triple tap
  23599. range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0)));
  23600. cm.setSelection(range.anchor, range.head);
  23601. cm.focus();
  23602. e_preventDefault(e);
  23603. }
  23604. finishTouch();
  23605. });
  23606. on(d.scroller, "touchcancel", finishTouch);
  23607. // Sync scrolling between fake scrollbars and real scrollable
  23608. // area, ensure viewport is updated when scrolling.
  23609. on(d.scroller, "scroll", function() {
  23610. if (d.scroller.clientHeight) {
  23611. setScrollTop(cm, d.scroller.scrollTop);
  23612. setScrollLeft(cm, d.scroller.scrollLeft, true);
  23613. signal(cm, "scroll", cm);
  23614. }
  23615. });
  23616. // Listen to wheel events in order to try and update the viewport on time.
  23617. on(d.scroller, "mousewheel", function(e){onScrollWheel(cm, e);});
  23618. on(d.scroller, "DOMMouseScroll", function(e){onScrollWheel(cm, e);});
  23619. // Prevent wrapper from ever scrolling
  23620. on(d.wrapper, "scroll", function() { d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });
  23621. d.dragFunctions = {
  23622. enter: function(e) {if (!signalDOMEvent(cm, e)) e_stop(e);},
  23623. over: function(e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},
  23624. start: function(e){onDragStart(cm, e);},
  23625. drop: operation(cm, onDrop),
  23626. leave: function(e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }}
  23627. };
  23628. var inp = d.input.getField();
  23629. on(inp, "keyup", function(e) { onKeyUp.call(cm, e); });
  23630. on(inp, "keydown", operation(cm, onKeyDown));
  23631. on(inp, "keypress", operation(cm, onKeyPress));
  23632. on(inp, "focus", bind(onFocus, cm));
  23633. on(inp, "blur", bind(onBlur, cm));
  23634. }
  23635. function dragDropChanged(cm, value, old) {
  23636. var wasOn = old && old != CodeMirror.Init;
  23637. if (!value != !wasOn) {
  23638. var funcs = cm.display.dragFunctions;
  23639. var toggle = value ? on : off;
  23640. toggle(cm.display.scroller, "dragstart", funcs.start);
  23641. toggle(cm.display.scroller, "dragenter", funcs.enter);
  23642. toggle(cm.display.scroller, "dragover", funcs.over);
  23643. toggle(cm.display.scroller, "dragleave", funcs.leave);
  23644. toggle(cm.display.scroller, "drop", funcs.drop);
  23645. }
  23646. }
  23647. // Called when the window resizes
  23648. function onResize(cm) {
  23649. var d = cm.display;
  23650. if (d.lastWrapHeight == d.wrapper.clientHeight && d.lastWrapWidth == d.wrapper.clientWidth)
  23651. return;
  23652. // Might be a text scaling operation, clear size caches.
  23653. d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null;
  23654. d.scrollbarsClipped = false;
  23655. cm.setSize();
  23656. }
  23657. // MOUSE EVENTS
  23658. // Return true when the given mouse event happened in a widget
  23659. function eventInWidget(display, e) {
  23660. for (var n = e_target(e); n != display.wrapper; n = n.parentNode) {
  23661. if (!n || (n.nodeType == 1 && n.getAttribute("cm-ignore-events") == "true") ||
  23662. (n.parentNode == display.sizer && n != display.mover))
  23663. return true;
  23664. }
  23665. }
  23666. // Given a mouse event, find the corresponding position. If liberal
  23667. // is false, it checks whether a gutter or scrollbar was clicked,
  23668. // and returns null if it was. forRect is used by rectangular
  23669. // selections, and tries to estimate a character position even for
  23670. // coordinates beyond the right of the text.
  23671. function posFromMouse(cm, e, liberal, forRect) {
  23672. var display = cm.display;
  23673. if (!liberal && e_target(e).getAttribute("cm-not-content") == "true") return null;
  23674. var x, y, space = display.lineSpace.getBoundingClientRect();
  23675. // Fails unpredictably on IE[67] when mouse is dragged around quickly.
  23676. try { x = e.clientX - space.left; y = e.clientY - space.top; }
  23677. catch (e) { return null; }
  23678. var coords = coordsChar(cm, x, y), line;
  23679. if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {
  23680. var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;
  23681. coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));
  23682. }
  23683. return coords;
  23684. }
  23685. // A mouse down can be a single click, double click, triple click,
  23686. // start of selection drag, start of text drag, new cursor
  23687. // (ctrl-click), rectangle drag (alt-drag), or xwin
  23688. // middle-click-paste. Or it might be a click on something we should
  23689. // not interfere with, such as a scrollbar or widget.
  23690. function onMouseDown(e) {
  23691. var cm = this, display = cm.display;
  23692. if (signalDOMEvent(cm, e) || display.activeTouch && display.input.supportsTouch()) return;
  23693. display.shift = e.shiftKey;
  23694. if (eventInWidget(display, e)) {
  23695. if (!webkit) {
  23696. // Briefly turn off draggability, to allow widgets to do
  23697. // normal dragging things.
  23698. display.scroller.draggable = false;
  23699. setTimeout(function(){display.scroller.draggable = true;}, 100);
  23700. }
  23701. return;
  23702. }
  23703. if (clickInGutter(cm, e)) return;
  23704. var start = posFromMouse(cm, e);
  23705. window.focus();
  23706. switch (e_button(e)) {
  23707. case 1:
  23708. // #3261: make sure, that we're not starting a second selection
  23709. if (cm.state.selectingText)
  23710. cm.state.selectingText(e);
  23711. else if (start)
  23712. leftButtonDown(cm, e, start);
  23713. else if (e_target(e) == display.scroller)
  23714. e_preventDefault(e);
  23715. break;
  23716. case 2:
  23717. if (webkit) cm.state.lastMiddleDown = +new Date;
  23718. if (start) extendSelection(cm.doc, start);
  23719. setTimeout(function() {display.input.focus();}, 20);
  23720. e_preventDefault(e);
  23721. break;
  23722. case 3:
  23723. if (captureRightClick) onContextMenu(cm, e);
  23724. else delayBlurEvent(cm);
  23725. break;
  23726. }
  23727. }
  23728. var lastClick, lastDoubleClick;
  23729. function leftButtonDown(cm, e, start) {
  23730. if (ie) setTimeout(bind(ensureFocus, cm), 0);
  23731. else cm.curOp.focus = activeElt();
  23732. var now = +new Date, type;
  23733. if (lastDoubleClick && lastDoubleClick.time > now - 400 && cmp(lastDoubleClick.pos, start) == 0) {
  23734. type = "triple";
  23735. } else if (lastClick && lastClick.time > now - 400 && cmp(lastClick.pos, start) == 0) {
  23736. type = "double";
  23737. lastDoubleClick = {time: now, pos: start};
  23738. } else {
  23739. type = "single";
  23740. lastClick = {time: now, pos: start};
  23741. }
  23742. var sel = cm.doc.sel, modifier = mac ? e.metaKey : e.ctrlKey, contained;
  23743. if (cm.options.dragDrop && dragAndDrop && !cm.isReadOnly() &&
  23744. type == "single" && (contained = sel.contains(start)) > -1 &&
  23745. (cmp((contained = sel.ranges[contained]).from(), start) < 0 || start.xRel > 0) &&
  23746. (cmp(contained.to(), start) > 0 || start.xRel < 0))
  23747. leftButtonStartDrag(cm, e, start, modifier);
  23748. else
  23749. leftButtonSelect(cm, e, start, type, modifier);
  23750. }
  23751. // Start a text drag. When it ends, see if any dragging actually
  23752. // happen, and treat as a click if it didn't.
  23753. function leftButtonStartDrag(cm, e, start, modifier) {
  23754. var display = cm.display, startTime = +new Date;
  23755. var dragEnd = operation(cm, function(e2) {
  23756. if (webkit) display.scroller.draggable = false;
  23757. cm.state.draggingText = false;
  23758. off(document, "mouseup", dragEnd);
  23759. off(display.scroller, "drop", dragEnd);
  23760. if (Math.abs(e.clientX - e2.clientX) + Math.abs(e.clientY - e2.clientY) < 10) {
  23761. e_preventDefault(e2);
  23762. if (!modifier && +new Date - 200 < startTime)
  23763. extendSelection(cm.doc, start);
  23764. // Work around unexplainable focus problem in IE9 (#2127) and Chrome (#3081)
  23765. if (webkit || ie && ie_version == 9)
  23766. setTimeout(function() {document.body.focus(); display.input.focus();}, 20);
  23767. else
  23768. display.input.focus();
  23769. }
  23770. });
  23771. // Let the drag handler handle this.
  23772. if (webkit) display.scroller.draggable = true;
  23773. cm.state.draggingText = dragEnd;
  23774. dragEnd.copy = mac ? e.altKey : e.ctrlKey
  23775. // IE's approach to draggable
  23776. if (display.scroller.dragDrop) display.scroller.dragDrop();
  23777. on(document, "mouseup", dragEnd);
  23778. on(display.scroller, "drop", dragEnd);
  23779. }
  23780. // Normal selection, as opposed to text dragging.
  23781. function leftButtonSelect(cm, e, start, type, addNew) {
  23782. var display = cm.display, doc = cm.doc;
  23783. e_preventDefault(e);
  23784. var ourRange, ourIndex, startSel = doc.sel, ranges = startSel.ranges;
  23785. if (addNew && !e.shiftKey) {
  23786. ourIndex = doc.sel.contains(start);
  23787. if (ourIndex > -1)
  23788. ourRange = ranges[ourIndex];
  23789. else
  23790. ourRange = new Range(start, start);
  23791. } else {
  23792. ourRange = doc.sel.primary();
  23793. ourIndex = doc.sel.primIndex;
  23794. }
  23795. if (chromeOS ? e.shiftKey && e.metaKey : e.altKey) {
  23796. type = "rect";
  23797. if (!addNew) ourRange = new Range(start, start);
  23798. start = posFromMouse(cm, e, true, true);
  23799. ourIndex = -1;
  23800. } else if (type == "double") {
  23801. var word = cm.findWordAt(start);
  23802. if (cm.display.shift || doc.extend)
  23803. ourRange = extendRange(doc, ourRange, word.anchor, word.head);
  23804. else
  23805. ourRange = word;
  23806. } else if (type == "triple") {
  23807. var line = new Range(Pos(start.line, 0), clipPos(doc, Pos(start.line + 1, 0)));
  23808. if (cm.display.shift || doc.extend)
  23809. ourRange = extendRange(doc, ourRange, line.anchor, line.head);
  23810. else
  23811. ourRange = line;
  23812. } else {
  23813. ourRange = extendRange(doc, ourRange, start);
  23814. }
  23815. if (!addNew) {
  23816. ourIndex = 0;
  23817. setSelection(doc, new Selection([ourRange], 0), sel_mouse);
  23818. startSel = doc.sel;
  23819. } else if (ourIndex == -1) {
  23820. ourIndex = ranges.length;
  23821. setSelection(doc, normalizeSelection(ranges.concat([ourRange]), ourIndex),
  23822. {scroll: false, origin: "*mouse"});
  23823. } else if (ranges.length > 1 && ranges[ourIndex].empty() && type == "single" && !e.shiftKey) {
  23824. setSelection(doc, normalizeSelection(ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0),
  23825. {scroll: false, origin: "*mouse"});
  23826. startSel = doc.sel;
  23827. } else {
  23828. replaceOneSelection(doc, ourIndex, ourRange, sel_mouse);
  23829. }
  23830. var lastPos = start;
  23831. function extendTo(pos) {
  23832. if (cmp(lastPos, pos) == 0) return;
  23833. lastPos = pos;
  23834. if (type == "rect") {
  23835. var ranges = [], tabSize = cm.options.tabSize;
  23836. var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize);
  23837. var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize);
  23838. var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol);
  23839. for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line));
  23840. line <= end; line++) {
  23841. var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize);
  23842. if (left == right)
  23843. ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos)));
  23844. else if (text.length > leftPos)
  23845. ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize))));
  23846. }
  23847. if (!ranges.length) ranges.push(new Range(start, start));
  23848. setSelection(doc, normalizeSelection(startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex),
  23849. {origin: "*mouse", scroll: false});
  23850. cm.scrollIntoView(pos);
  23851. } else {
  23852. var oldRange = ourRange;
  23853. var anchor = oldRange.anchor, head = pos;
  23854. if (type != "single") {
  23855. if (type == "double")
  23856. var range = cm.findWordAt(pos);
  23857. else
  23858. var range = new Range(Pos(pos.line, 0), clipPos(doc, Pos(pos.line + 1, 0)));
  23859. if (cmp(range.anchor, anchor) > 0) {
  23860. head = range.head;
  23861. anchor = minPos(oldRange.from(), range.anchor);
  23862. } else {
  23863. head = range.anchor;
  23864. anchor = maxPos(oldRange.to(), range.head);
  23865. }
  23866. }
  23867. var ranges = startSel.ranges.slice(0);
  23868. ranges[ourIndex] = new Range(clipPos(doc, anchor), head);
  23869. setSelection(doc, normalizeSelection(ranges, ourIndex), sel_mouse);
  23870. }
  23871. }
  23872. var editorSize = display.wrapper.getBoundingClientRect();
  23873. // Used to ensure timeout re-tries don't fire when another extend
  23874. // happened in the meantime (clearTimeout isn't reliable -- at
  23875. // least on Chrome, the timeouts still happen even when cleared,
  23876. // if the clear happens after their scheduled firing time).
  23877. var counter = 0;
  23878. function extend(e) {
  23879. var curCount = ++counter;
  23880. var cur = posFromMouse(cm, e, true, type == "rect");
  23881. if (!cur) return;
  23882. if (cmp(cur, lastPos) != 0) {
  23883. cm.curOp.focus = activeElt();
  23884. extendTo(cur);
  23885. var visible = visibleLines(display, doc);
  23886. if (cur.line >= visible.to || cur.line < visible.from)
  23887. setTimeout(operation(cm, function(){if (counter == curCount) extend(e);}), 150);
  23888. } else {
  23889. var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0;
  23890. if (outside) setTimeout(operation(cm, function() {
  23891. if (counter != curCount) return;
  23892. display.scroller.scrollTop += outside;
  23893. extend(e);
  23894. }), 50);
  23895. }
  23896. }
  23897. function done(e) {
  23898. cm.state.selectingText = false;
  23899. counter = Infinity;
  23900. e_preventDefault(e);
  23901. display.input.focus();
  23902. off(document, "mousemove", move);
  23903. off(document, "mouseup", up);
  23904. doc.history.lastSelOrigin = null;
  23905. }
  23906. var move = operation(cm, function(e) {
  23907. if (!e_button(e)) done(e);
  23908. else extend(e);
  23909. });
  23910. var up = operation(cm, done);
  23911. cm.state.selectingText = up;
  23912. on(document, "mousemove", move);
  23913. on(document, "mouseup", up);
  23914. }
  23915. // Determines whether an event happened in the gutter, and fires the
  23916. // handlers for the corresponding event.
  23917. function gutterEvent(cm, e, type, prevent) {
  23918. try { var mX = e.clientX, mY = e.clientY; }
  23919. catch(e) { return false; }
  23920. if (mX >= Math.floor(cm.display.gutters.getBoundingClientRect().right)) return false;
  23921. if (prevent) e_preventDefault(e);
  23922. var display = cm.display;
  23923. var lineBox = display.lineDiv.getBoundingClientRect();
  23924. if (mY > lineBox.bottom || !hasHandler(cm, type)) return e_defaultPrevented(e);
  23925. mY -= lineBox.top - display.viewOffset;
  23926. for (var i = 0; i < cm.options.gutters.length; ++i) {
  23927. var g = display.gutters.childNodes[i];
  23928. if (g && g.getBoundingClientRect().right >= mX) {
  23929. var line = lineAtHeight(cm.doc, mY);
  23930. var gutter = cm.options.gutters[i];
  23931. signal(cm, type, cm, line, gutter, e);
  23932. return e_defaultPrevented(e);
  23933. }
  23934. }
  23935. }
  23936. function clickInGutter(cm, e) {
  23937. return gutterEvent(cm, e, "gutterClick", true);
  23938. }
  23939. // Kludge to work around strange IE behavior where it'll sometimes
  23940. // re-fire a series of drag-related events right after the drop (#1551)
  23941. var lastDrop = 0;
  23942. function onDrop(e) {
  23943. var cm = this;
  23944. clearDragCursor(cm);
  23945. if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e))
  23946. return;
  23947. e_preventDefault(e);
  23948. if (ie) lastDrop = +new Date;
  23949. var pos = posFromMouse(cm, e, true), files = e.dataTransfer.files;
  23950. if (!pos || cm.isReadOnly()) return;
  23951. // Might be a file drop, in which case we simply extract the text
  23952. // and insert it.
  23953. if (files && files.length && window.FileReader && window.File) {
  23954. var n = files.length, text = Array(n), read = 0;
  23955. var loadFile = function(file, i) {
  23956. if (cm.options.allowDropFileTypes &&
  23957. indexOf(cm.options.allowDropFileTypes, file.type) == -1)
  23958. return;
  23959. var reader = new FileReader;
  23960. reader.onload = operation(cm, function() {
  23961. var content = reader.result;
  23962. if (/[\x00-\x08\x0e-\x1f]{2}/.test(content)) content = "";
  23963. text[i] = content;
  23964. if (++read == n) {
  23965. pos = clipPos(cm.doc, pos);
  23966. var change = {from: pos, to: pos,
  23967. text: cm.doc.splitLines(text.join(cm.doc.lineSeparator())),
  23968. origin: "paste"};
  23969. makeChange(cm.doc, change);
  23970. setSelectionReplaceHistory(cm.doc, simpleSelection(pos, changeEnd(change)));
  23971. }
  23972. });
  23973. reader.readAsText(file);
  23974. };
  23975. for (var i = 0; i < n; ++i) loadFile(files[i], i);
  23976. } else { // Normal drop
  23977. // Don't do a replace if the drop happened inside of the selected text.
  23978. if (cm.state.draggingText && cm.doc.sel.contains(pos) > -1) {
  23979. cm.state.draggingText(e);
  23980. // Ensure the editor is re-focused
  23981. setTimeout(function() {cm.display.input.focus();}, 20);
  23982. return;
  23983. }
  23984. try {
  23985. var text = e.dataTransfer.getData("Text");
  23986. if (text) {
  23987. if (cm.state.draggingText && !cm.state.draggingText.copy)
  23988. var selected = cm.listSelections();
  23989. setSelectionNoUndo(cm.doc, simpleSelection(pos, pos));
  23990. if (selected) for (var i = 0; i < selected.length; ++i)
  23991. replaceRange(cm.doc, "", selected[i].anchor, selected[i].head, "drag");
  23992. cm.replaceSelection(text, "around", "paste");
  23993. cm.display.input.focus();
  23994. }
  23995. }
  23996. catch(e){}
  23997. }
  23998. }
  23999. function onDragStart(cm, e) {
  24000. if (ie && (!cm.state.draggingText || +new Date - lastDrop < 100)) { e_stop(e); return; }
  24001. if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e)) return;
  24002. e.dataTransfer.setData("Text", cm.getSelection());
  24003. e.dataTransfer.effectAllowed = "copyMove"
  24004. // Use dummy image instead of default browsers image.
  24005. // Recent Safari (~6.0.2) have a tendency to segfault when this happens, so we don't do it there.
  24006. if (e.dataTransfer.setDragImage && !safari) {
  24007. var img = elt("img", null, null, "position: fixed; left: 0; top: 0;");
  24008. img.src = "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==";
  24009. if (presto) {
  24010. img.width = img.height = 1;
  24011. cm.display.wrapper.appendChild(img);
  24012. // Force a relayout, or Opera won't use our image for some obscure reason
  24013. img._top = img.offsetTop;
  24014. }
  24015. e.dataTransfer.setDragImage(img, 0, 0);
  24016. if (presto) img.parentNode.removeChild(img);
  24017. }
  24018. }
  24019. function onDragOver(cm, e) {
  24020. var pos = posFromMouse(cm, e);
  24021. if (!pos) return;
  24022. var frag = document.createDocumentFragment();
  24023. drawSelectionCursor(cm, pos, frag);
  24024. if (!cm.display.dragCursor) {
  24025. cm.display.dragCursor = elt("div", null, "CodeMirror-cursors CodeMirror-dragcursors");
  24026. cm.display.lineSpace.insertBefore(cm.display.dragCursor, cm.display.cursorDiv);
  24027. }
  24028. removeChildrenAndAdd(cm.display.dragCursor, frag);
  24029. }
  24030. function clearDragCursor(cm) {
  24031. if (cm.display.dragCursor) {
  24032. cm.display.lineSpace.removeChild(cm.display.dragCursor);
  24033. cm.display.dragCursor = null;
  24034. }
  24035. }
  24036. // SCROLL EVENTS
  24037. // Sync the scrollable area and scrollbars, ensure the viewport
  24038. // covers the visible area.
  24039. function setScrollTop(cm, val) {
  24040. if (Math.abs(cm.doc.scrollTop - val) < 2) return;
  24041. cm.doc.scrollTop = val;
  24042. if (!gecko) updateDisplaySimple(cm, {top: val});
  24043. if (cm.display.scroller.scrollTop != val) cm.display.scroller.scrollTop = val;
  24044. cm.display.scrollbars.setScrollTop(val);
  24045. if (gecko) updateDisplaySimple(cm);
  24046. startWorker(cm, 100);
  24047. }
  24048. // Sync scroller and scrollbar, ensure the gutter elements are
  24049. // aligned.
  24050. function setScrollLeft(cm, val, isScroller) {
  24051. if (isScroller ? val == cm.doc.scrollLeft : Math.abs(cm.doc.scrollLeft - val) < 2) return;
  24052. val = Math.min(val, cm.display.scroller.scrollWidth - cm.display.scroller.clientWidth);
  24053. cm.doc.scrollLeft = val;
  24054. alignHorizontally(cm);
  24055. if (cm.display.scroller.scrollLeft != val) cm.display.scroller.scrollLeft = val;
  24056. cm.display.scrollbars.setScrollLeft(val);
  24057. }
  24058. // Since the delta values reported on mouse wheel events are
  24059. // unstandardized between browsers and even browser versions, and
  24060. // generally horribly unpredictable, this code starts by measuring
  24061. // the scroll effect that the first few mouse wheel events have,
  24062. // and, from that, detects the way it can convert deltas to pixel
  24063. // offsets afterwards.
  24064. //
  24065. // The reason we want to know the amount a wheel event will scroll
  24066. // is that it gives us a chance to update the display before the
  24067. // actual scrolling happens, reducing flickering.
  24068. var wheelSamples = 0, wheelPixelsPerUnit = null;
  24069. // Fill in a browser-detected starting value on browsers where we
  24070. // know one. These don't have to be accurate -- the result of them
  24071. // being wrong would just be a slight flicker on the first wheel
  24072. // scroll (if it is large enough).
  24073. if (ie) wheelPixelsPerUnit = -.53;
  24074. else if (gecko) wheelPixelsPerUnit = 15;
  24075. else if (chrome) wheelPixelsPerUnit = -.7;
  24076. else if (safari) wheelPixelsPerUnit = -1/3;
  24077. var wheelEventDelta = function(e) {
  24078. var dx = e.wheelDeltaX, dy = e.wheelDeltaY;
  24079. if (dx == null && e.detail && e.axis == e.HORIZONTAL_AXIS) dx = e.detail;
  24080. if (dy == null && e.detail && e.axis == e.VERTICAL_AXIS) dy = e.detail;
  24081. else if (dy == null) dy = e.wheelDelta;
  24082. return {x: dx, y: dy};
  24083. };
  24084. CodeMirror.wheelEventPixels = function(e) {
  24085. var delta = wheelEventDelta(e);
  24086. delta.x *= wheelPixelsPerUnit;
  24087. delta.y *= wheelPixelsPerUnit;
  24088. return delta;
  24089. };
  24090. function onScrollWheel(cm, e) {
  24091. var delta = wheelEventDelta(e), dx = delta.x, dy = delta.y;
  24092. var display = cm.display, scroll = display.scroller;
  24093. // Quit if there's nothing to scroll here
  24094. var canScrollX = scroll.scrollWidth > scroll.clientWidth;
  24095. var canScrollY = scroll.scrollHeight > scroll.clientHeight;
  24096. if (!(dx && canScrollX || dy && canScrollY)) return;
  24097. // Webkit browsers on OS X abort momentum scrolls when the target
  24098. // of the scroll event is removed from the scrollable element.
  24099. // This hack (see related code in patchDisplay) makes sure the
  24100. // element is kept around.
  24101. if (dy && mac && webkit) {
  24102. outer: for (var cur = e.target, view = display.view; cur != scroll; cur = cur.parentNode) {
  24103. for (var i = 0; i < view.length; i++) {
  24104. if (view[i].node == cur) {
  24105. cm.display.currentWheelTarget = cur;
  24106. break outer;
  24107. }
  24108. }
  24109. }
  24110. }
  24111. // On some browsers, horizontal scrolling will cause redraws to
  24112. // happen before the gutter has been realigned, causing it to
  24113. // wriggle around in a most unseemly way. When we have an
  24114. // estimated pixels/delta value, we just handle horizontal
  24115. // scrolling entirely here. It'll be slightly off from native, but
  24116. // better than glitching out.
  24117. if (dx && !gecko && !presto && wheelPixelsPerUnit != null) {
  24118. if (dy && canScrollY)
  24119. setScrollTop(cm, Math.max(0, Math.min(scroll.scrollTop + dy * wheelPixelsPerUnit, scroll.scrollHeight - scroll.clientHeight)));
  24120. setScrollLeft(cm, Math.max(0, Math.min(scroll.scrollLeft + dx * wheelPixelsPerUnit, scroll.scrollWidth - scroll.clientWidth)));
  24121. // Only prevent default scrolling if vertical scrolling is
  24122. // actually possible. Otherwise, it causes vertical scroll
  24123. // jitter on OSX trackpads when deltaX is small and deltaY
  24124. // is large (issue #3579)
  24125. if (!dy || (dy && canScrollY))
  24126. e_preventDefault(e);
  24127. display.wheelStartX = null; // Abort measurement, if in progress
  24128. return;
  24129. }
  24130. // 'Project' the visible viewport to cover the area that is being
  24131. // scrolled into view (if we know enough to estimate it).
  24132. if (dy && wheelPixelsPerUnit != null) {
  24133. var pixels = dy * wheelPixelsPerUnit;
  24134. var top = cm.doc.scrollTop, bot = top + display.wrapper.clientHeight;
  24135. if (pixels < 0) top = Math.max(0, top + pixels - 50);
  24136. else bot = Math.min(cm.doc.height, bot + pixels + 50);
  24137. updateDisplaySimple(cm, {top: top, bottom: bot});
  24138. }
  24139. if (wheelSamples < 20) {
  24140. if (display.wheelStartX == null) {
  24141. display.wheelStartX = scroll.scrollLeft; display.wheelStartY = scroll.scrollTop;
  24142. display.wheelDX = dx; display.wheelDY = dy;
  24143. setTimeout(function() {
  24144. if (display.wheelStartX == null) return;
  24145. var movedX = scroll.scrollLeft - display.wheelStartX;
  24146. var movedY = scroll.scrollTop - display.wheelStartY;
  24147. var sample = (movedY && display.wheelDY && movedY / display.wheelDY) ||
  24148. (movedX && display.wheelDX && movedX / display.wheelDX);
  24149. display.wheelStartX = display.wheelStartY = null;
  24150. if (!sample) return;
  24151. wheelPixelsPerUnit = (wheelPixelsPerUnit * wheelSamples + sample) / (wheelSamples + 1);
  24152. ++wheelSamples;
  24153. }, 200);
  24154. } else {
  24155. display.wheelDX += dx; display.wheelDY += dy;
  24156. }
  24157. }
  24158. }
  24159. // KEY EVENTS
  24160. // Run a handler that was bound to a key.
  24161. function doHandleBinding(cm, bound, dropShift) {
  24162. if (typeof bound == "string") {
  24163. bound = commands[bound];
  24164. if (!bound) return false;
  24165. }
  24166. // Ensure previous input has been read, so that the handler sees a
  24167. // consistent view of the document
  24168. cm.display.input.ensurePolled();
  24169. var prevShift = cm.display.shift, done = false;
  24170. try {
  24171. if (cm.isReadOnly()) cm.state.suppressEdits = true;
  24172. if (dropShift) cm.display.shift = false;
  24173. done = bound(cm) != Pass;
  24174. } finally {
  24175. cm.display.shift = prevShift;
  24176. cm.state.suppressEdits = false;
  24177. }
  24178. return done;
  24179. }
  24180. function lookupKeyForEditor(cm, name, handle) {
  24181. for (var i = 0; i < cm.state.keyMaps.length; i++) {
  24182. var result = lookupKey(name, cm.state.keyMaps[i], handle, cm);
  24183. if (result) return result;
  24184. }
  24185. return (cm.options.extraKeys && lookupKey(name, cm.options.extraKeys, handle, cm))
  24186. || lookupKey(name, cm.options.keyMap, handle, cm);
  24187. }
  24188. var stopSeq = new Delayed;
  24189. function dispatchKey(cm, name, e, handle) {
  24190. var seq = cm.state.keySeq;
  24191. if (seq) {
  24192. if (isModifierKey(name)) return "handled";
  24193. stopSeq.set(50, function() {
  24194. if (cm.state.keySeq == seq) {
  24195. cm.state.keySeq = null;
  24196. cm.display.input.reset();
  24197. }
  24198. });
  24199. name = seq + " " + name;
  24200. }
  24201. var result = lookupKeyForEditor(cm, name, handle);
  24202. if (result == "multi")
  24203. cm.state.keySeq = name;
  24204. if (result == "handled")
  24205. signalLater(cm, "keyHandled", cm, name, e);
  24206. if (result == "handled" || result == "multi") {
  24207. e_preventDefault(e);
  24208. restartBlink(cm);
  24209. }
  24210. if (seq && !result && /\'$/.test(name)) {
  24211. e_preventDefault(e);
  24212. return true;
  24213. }
  24214. return !!result;
  24215. }
  24216. // Handle a key from the keydown event.
  24217. function handleKeyBinding(cm, e) {
  24218. var name = keyName(e, true);
  24219. if (!name) return false;
  24220. if (e.shiftKey && !cm.state.keySeq) {
  24221. // First try to resolve full name (including 'Shift-'). Failing
  24222. // that, see if there is a cursor-motion command (starting with
  24223. // 'go') bound to the keyname without 'Shift-'.
  24224. return dispatchKey(cm, "Shift-" + name, e, function(b) {return doHandleBinding(cm, b, true);})
  24225. || dispatchKey(cm, name, e, function(b) {
  24226. if (typeof b == "string" ? /^go[A-Z]/.test(b) : b.motion)
  24227. return doHandleBinding(cm, b);
  24228. });
  24229. } else {
  24230. return dispatchKey(cm, name, e, function(b) { return doHandleBinding(cm, b); });
  24231. }
  24232. }
  24233. // Handle a key from the keypress event
  24234. function handleCharBinding(cm, e, ch) {
  24235. return dispatchKey(cm, "'" + ch + "'", e,
  24236. function(b) { return doHandleBinding(cm, b, true); });
  24237. }
  24238. var lastStoppedKey = null;
  24239. function onKeyDown(e) {
  24240. var cm = this;
  24241. cm.curOp.focus = activeElt();
  24242. if (signalDOMEvent(cm, e)) return;
  24243. // IE does strange things with escape.
  24244. if (ie && ie_version < 11 && e.keyCode == 27) e.returnValue = false;
  24245. var code = e.keyCode;
  24246. cm.display.shift = code == 16 || e.shiftKey;
  24247. var handled = handleKeyBinding(cm, e);
  24248. if (presto) {
  24249. lastStoppedKey = handled ? code : null;
  24250. // Opera has no cut event... we try to at least catch the key combo
  24251. if (!handled && code == 88 && !hasCopyEvent && (mac ? e.metaKey : e.ctrlKey))
  24252. cm.replaceSelection("", null, "cut");
  24253. }
  24254. // Turn mouse into crosshair when Alt is held on Mac.
  24255. if (code == 18 && !/\bCodeMirror-crosshair\b/.test(cm.display.lineDiv.className))
  24256. showCrossHair(cm);
  24257. }
  24258. function showCrossHair(cm) {
  24259. var lineDiv = cm.display.lineDiv;
  24260. addClass(lineDiv, "CodeMirror-crosshair");
  24261. function up(e) {
  24262. if (e.keyCode == 18 || !e.altKey) {
  24263. rmClass(lineDiv, "CodeMirror-crosshair");
  24264. off(document, "keyup", up);
  24265. off(document, "mouseover", up);
  24266. }
  24267. }
  24268. on(document, "keyup", up);
  24269. on(document, "mouseover", up);
  24270. }
  24271. function onKeyUp(e) {
  24272. if (e.keyCode == 16) this.doc.sel.shift = false;
  24273. signalDOMEvent(this, e);
  24274. }
  24275. function onKeyPress(e) {
  24276. var cm = this;
  24277. if (eventInWidget(cm.display, e) || signalDOMEvent(cm, e) || e.ctrlKey && !e.altKey || mac && e.metaKey) return;
  24278. var keyCode = e.keyCode, charCode = e.charCode;
  24279. if (presto && keyCode == lastStoppedKey) {lastStoppedKey = null; e_preventDefault(e); return;}
  24280. if ((presto && (!e.which || e.which < 10)) && handleKeyBinding(cm, e)) return;
  24281. var ch = String.fromCharCode(charCode == null ? keyCode : charCode);
  24282. if (handleCharBinding(cm, e, ch)) return;
  24283. cm.display.input.onKeyPress(e);
  24284. }
  24285. // FOCUS/BLUR EVENTS
  24286. function delayBlurEvent(cm) {
  24287. cm.state.delayingBlurEvent = true;
  24288. setTimeout(function() {
  24289. if (cm.state.delayingBlurEvent) {
  24290. cm.state.delayingBlurEvent = false;
  24291. onBlur(cm);
  24292. }
  24293. }, 100);
  24294. }
  24295. function onFocus(cm) {
  24296. if (cm.state.delayingBlurEvent) cm.state.delayingBlurEvent = false;
  24297. if (cm.options.readOnly == "nocursor") return;
  24298. if (!cm.state.focused) {
  24299. signal(cm, "focus", cm);
  24300. cm.state.focused = true;
  24301. addClass(cm.display.wrapper, "CodeMirror-focused");
  24302. // This test prevents this from firing when a context
  24303. // menu is closed (since the input reset would kill the
  24304. // select-all detection hack)
  24305. if (!cm.curOp && cm.display.selForContextMenu != cm.doc.sel) {
  24306. cm.display.input.reset();
  24307. if (webkit) setTimeout(function() { cm.display.input.reset(true); }, 20); // Issue #1730
  24308. }
  24309. cm.display.input.receivedFocus();
  24310. }
  24311. restartBlink(cm);
  24312. }
  24313. function onBlur(cm) {
  24314. if (cm.state.delayingBlurEvent) return;
  24315. if (cm.state.focused) {
  24316. signal(cm, "blur", cm);
  24317. cm.state.focused = false;
  24318. rmClass(cm.display.wrapper, "CodeMirror-focused");
  24319. }
  24320. clearInterval(cm.display.blinker);
  24321. setTimeout(function() {if (!cm.state.focused) cm.display.shift = false;}, 150);
  24322. }
  24323. // CONTEXT MENU HANDLING
  24324. // To make the context menu work, we need to briefly unhide the
  24325. // textarea (making it as unobtrusive as possible) to let the
  24326. // right-click take effect on it.
  24327. function onContextMenu(cm, e) {
  24328. if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) return;
  24329. if (signalDOMEvent(cm, e, "contextmenu")) return;
  24330. cm.display.input.onContextMenu(e);
  24331. }
  24332. function contextMenuInGutter(cm, e) {
  24333. if (!hasHandler(cm, "gutterContextMenu")) return false;
  24334. return gutterEvent(cm, e, "gutterContextMenu", false);
  24335. }
  24336. // UPDATING
  24337. // Compute the position of the end of a change (its 'to' property
  24338. // refers to the pre-change end).
  24339. var changeEnd = CodeMirror.changeEnd = function(change) {
  24340. if (!change.text) return change.to;
  24341. return Pos(change.from.line + change.text.length - 1,
  24342. lst(change.text).length + (change.text.length == 1 ? change.from.ch : 0));
  24343. };
  24344. // Adjust a position to refer to the post-change position of the
  24345. // same text, or the end of the change if the change covers it.
  24346. function adjustForChange(pos, change) {
  24347. if (cmp(pos, change.from) < 0) return pos;
  24348. if (cmp(pos, change.to) <= 0) return changeEnd(change);
  24349. var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;
  24350. if (pos.line == change.to.line) ch += changeEnd(change).ch - change.to.ch;
  24351. return Pos(line, ch);
  24352. }
  24353. function computeSelAfterChange(doc, change) {
  24354. var out = [];
  24355. for (var i = 0; i < doc.sel.ranges.length; i++) {
  24356. var range = doc.sel.ranges[i];
  24357. out.push(new Range(adjustForChange(range.anchor, change),
  24358. adjustForChange(range.head, change)));
  24359. }
  24360. return normalizeSelection(out, doc.sel.primIndex);
  24361. }
  24362. function offsetPos(pos, old, nw) {
  24363. if (pos.line == old.line)
  24364. return Pos(nw.line, pos.ch - old.ch + nw.ch);
  24365. else
  24366. return Pos(nw.line + (pos.line - old.line), pos.ch);
  24367. }
  24368. // Used by replaceSelections to allow moving the selection to the
  24369. // start or around the replaced test. Hint may be "start" or "around".
  24370. function computeReplacedSel(doc, changes, hint) {
  24371. var out = [];
  24372. var oldPrev = Pos(doc.first, 0), newPrev = oldPrev;
  24373. for (var i = 0; i < changes.length; i++) {
  24374. var change = changes[i];
  24375. var from = offsetPos(change.from, oldPrev, newPrev);
  24376. var to = offsetPos(changeEnd(change), oldPrev, newPrev);
  24377. oldPrev = change.to;
  24378. newPrev = to;
  24379. if (hint == "around") {
  24380. var range = doc.sel.ranges[i], inv = cmp(range.head, range.anchor) < 0;
  24381. out[i] = new Range(inv ? to : from, inv ? from : to);
  24382. } else {
  24383. out[i] = new Range(from, from);
  24384. }
  24385. }
  24386. return new Selection(out, doc.sel.primIndex);
  24387. }
  24388. // Allow "beforeChange" event handlers to influence a change
  24389. function filterChange(doc, change, update) {
  24390. var obj = {
  24391. canceled: false,
  24392. from: change.from,
  24393. to: change.to,
  24394. text: change.text,
  24395. origin: change.origin,
  24396. cancel: function() { this.canceled = true; }
  24397. };
  24398. if (update) obj.update = function(from, to, text, origin) {
  24399. if (from) this.from = clipPos(doc, from);
  24400. if (to) this.to = clipPos(doc, to);
  24401. if (text) this.text = text;
  24402. if (origin !== undefined) this.origin = origin;
  24403. };
  24404. signal(doc, "beforeChange", doc, obj);
  24405. if (doc.cm) signal(doc.cm, "beforeChange", doc.cm, obj);
  24406. if (obj.canceled) return null;
  24407. return {from: obj.from, to: obj.to, text: obj.text, origin: obj.origin};
  24408. }
  24409. // Apply a change to a document, and add it to the document's
  24410. // history, and propagating it to all linked documents.
  24411. function makeChange(doc, change, ignoreReadOnly) {
  24412. if (doc.cm) {
  24413. if (!doc.cm.curOp) return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly);
  24414. if (doc.cm.state.suppressEdits) return;
  24415. }
  24416. if (hasHandler(doc, "beforeChange") || doc.cm && hasHandler(doc.cm, "beforeChange")) {
  24417. change = filterChange(doc, change, true);
  24418. if (!change) return;
  24419. }
  24420. // Possibly split or suppress the update based on the presence
  24421. // of read-only spans in its range.
  24422. var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);
  24423. if (split) {
  24424. for (var i = split.length - 1; i >= 0; --i)
  24425. makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [""] : change.text});
  24426. } else {
  24427. makeChangeInner(doc, change);
  24428. }
  24429. }
  24430. function makeChangeInner(doc, change) {
  24431. if (change.text.length == 1 && change.text[0] == "" && cmp(change.from, change.to) == 0) return;
  24432. var selAfter = computeSelAfterChange(doc, change);
  24433. addChangeToHistory(doc, change, selAfter, doc.cm ? doc.cm.curOp.id : NaN);
  24434. makeChangeSingleDoc(doc, change, selAfter, stretchSpansOverChange(doc, change));
  24435. var rebased = [];
  24436. linkedDocs(doc, function(doc, sharedHist) {
  24437. if (!sharedHist && indexOf(rebased, doc.history) == -1) {
  24438. rebaseHist(doc.history, change);
  24439. rebased.push(doc.history);
  24440. }
  24441. makeChangeSingleDoc(doc, change, null, stretchSpansOverChange(doc, change));
  24442. });
  24443. }
  24444. // Revert a change stored in a document's history.
  24445. function makeChangeFromHistory(doc, type, allowSelectionOnly) {
  24446. if (doc.cm && doc.cm.state.suppressEdits && !allowSelectionOnly) return;
  24447. var hist = doc.history, event, selAfter = doc.sel;
  24448. var source = type == "undo" ? hist.done : hist.undone, dest = type == "undo" ? hist.undone : hist.done;
  24449. // Verify that there is a useable event (so that ctrl-z won't
  24450. // needlessly clear selection events)
  24451. for (var i = 0; i < source.length; i++) {
  24452. event = source[i];
  24453. if (allowSelectionOnly ? event.ranges && !event.equals(doc.sel) : !event.ranges)
  24454. break;
  24455. }
  24456. if (i == source.length) return;
  24457. hist.lastOrigin = hist.lastSelOrigin = null;
  24458. for (;;) {
  24459. event = source.pop();
  24460. if (event.ranges) {
  24461. pushSelectionToHistory(event, dest);
  24462. if (allowSelectionOnly && !event.equals(doc.sel)) {
  24463. setSelection(doc, event, {clearRedo: false});
  24464. return;
  24465. }
  24466. selAfter = event;
  24467. }
  24468. else break;
  24469. }
  24470. // Build up a reverse change object to add to the opposite history
  24471. // stack (redo when undoing, and vice versa).
  24472. var antiChanges = [];
  24473. pushSelectionToHistory(selAfter, dest);
  24474. dest.push({changes: antiChanges, generation: hist.generation});
  24475. hist.generation = event.generation || ++hist.maxGeneration;
  24476. var filter = hasHandler(doc, "beforeChange") || doc.cm && hasHandler(doc.cm, "beforeChange");
  24477. for (var i = event.changes.length - 1; i >= 0; --i) {
  24478. var change = event.changes[i];
  24479. change.origin = type;
  24480. if (filter && !filterChange(doc, change, false)) {
  24481. source.length = 0;
  24482. return;
  24483. }
  24484. antiChanges.push(historyChangeFromChange(doc, change));
  24485. var after = i ? computeSelAfterChange(doc, change) : lst(source);
  24486. makeChangeSingleDoc(doc, change, after, mergeOldSpans(doc, change));
  24487. if (!i && doc.cm) doc.cm.scrollIntoView({from: change.from, to: changeEnd(change)});
  24488. var rebased = [];
  24489. // Propagate to the linked documents
  24490. linkedDocs(doc, function(doc, sharedHist) {
  24491. if (!sharedHist && indexOf(rebased, doc.history) == -1) {
  24492. rebaseHist(doc.history, change);
  24493. rebased.push(doc.history);
  24494. }
  24495. makeChangeSingleDoc(doc, change, null, mergeOldSpans(doc, change));
  24496. });
  24497. }
  24498. }
  24499. // Sub-views need their line numbers shifted when text is added
  24500. // above or below them in the parent document.
  24501. function shiftDoc(doc, distance) {
  24502. if (distance == 0) return;
  24503. doc.first += distance;
  24504. doc.sel = new Selection(map(doc.sel.ranges, function(range) {
  24505. return new Range(Pos(range.anchor.line + distance, range.anchor.ch),
  24506. Pos(range.head.line + distance, range.head.ch));
  24507. }), doc.sel.primIndex);
  24508. if (doc.cm) {
  24509. regChange(doc.cm, doc.first, doc.first - distance, distance);
  24510. for (var d = doc.cm.display, l = d.viewFrom; l < d.viewTo; l++)
  24511. regLineChange(doc.cm, l, "gutter");
  24512. }
  24513. }
  24514. // More lower-level change function, handling only a single document
  24515. // (not linked ones).
  24516. function makeChangeSingleDoc(doc, change, selAfter, spans) {
  24517. if (doc.cm && !doc.cm.curOp)
  24518. return operation(doc.cm, makeChangeSingleDoc)(doc, change, selAfter, spans);
  24519. if (change.to.line < doc.first) {
  24520. shiftDoc(doc, change.text.length - 1 - (change.to.line - change.from.line));
  24521. return;
  24522. }
  24523. if (change.from.line > doc.lastLine()) return;
  24524. // Clip the change to the size of this doc
  24525. if (change.from.line < doc.first) {
  24526. var shift = change.text.length - 1 - (doc.first - change.from.line);
  24527. shiftDoc(doc, shift);
  24528. change = {from: Pos(doc.first, 0), to: Pos(change.to.line + shift, change.to.ch),
  24529. text: [lst(change.text)], origin: change.origin};
  24530. }
  24531. var last = doc.lastLine();
  24532. if (change.to.line > last) {
  24533. change = {from: change.from, to: Pos(last, getLine(doc, last).text.length),
  24534. text: [change.text[0]], origin: change.origin};
  24535. }
  24536. change.removed = getBetween(doc, change.from, change.to);
  24537. if (!selAfter) selAfter = computeSelAfterChange(doc, change);
  24538. if (doc.cm) makeChangeSingleDocInEditor(doc.cm, change, spans);
  24539. else updateDoc(doc, change, spans);
  24540. setSelectionNoUndo(doc, selAfter, sel_dontScroll);
  24541. }
  24542. // Handle the interaction of a change to a document with the editor
  24543. // that this document is part of.
  24544. function makeChangeSingleDocInEditor(cm, change, spans) {
  24545. var doc = cm.doc, display = cm.display, from = change.from, to = change.to;
  24546. var recomputeMaxLength = false, checkWidthStart = from.line;
  24547. if (!cm.options.lineWrapping) {
  24548. checkWidthStart = lineNo(visualLine(getLine(doc, from.line)));
  24549. doc.iter(checkWidthStart, to.line + 1, function(line) {
  24550. if (line == display.maxLine) {
  24551. recomputeMaxLength = true;
  24552. return true;
  24553. }
  24554. });
  24555. }
  24556. if (doc.sel.contains(change.from, change.to) > -1)
  24557. signalCursorActivity(cm);
  24558. updateDoc(doc, change, spans, estimateHeight(cm));
  24559. if (!cm.options.lineWrapping) {
  24560. doc.iter(checkWidthStart, from.line + change.text.length, function(line) {
  24561. var len = lineLength(line);
  24562. if (len > display.maxLineLength) {
  24563. display.maxLine = line;
  24564. display.maxLineLength = len;
  24565. display.maxLineChanged = true;
  24566. recomputeMaxLength = false;
  24567. }
  24568. });
  24569. if (recomputeMaxLength) cm.curOp.updateMaxLine = true;
  24570. }
  24571. // Adjust frontier, schedule worker
  24572. doc.frontier = Math.min(doc.frontier, from.line);
  24573. startWorker(cm, 400);
  24574. var lendiff = change.text.length - (to.line - from.line) - 1;
  24575. // Remember that these lines changed, for updating the display
  24576. if (change.full)
  24577. regChange(cm);
  24578. else if (from.line == to.line && change.text.length == 1 && !isWholeLineUpdate(cm.doc, change))
  24579. regLineChange(cm, from.line, "text");
  24580. else
  24581. regChange(cm, from.line, to.line + 1, lendiff);
  24582. var changesHandler = hasHandler(cm, "changes"), changeHandler = hasHandler(cm, "change");
  24583. if (changeHandler || changesHandler) {
  24584. var obj = {
  24585. from: from, to: to,
  24586. text: change.text,
  24587. removed: change.removed,
  24588. origin: change.origin
  24589. };
  24590. if (changeHandler) signalLater(cm, "change", cm, obj);
  24591. if (changesHandler) (cm.curOp.changeObjs || (cm.curOp.changeObjs = [])).push(obj);
  24592. }
  24593. cm.display.selForContextMenu = null;
  24594. }
  24595. function replaceRange(doc, code, from, to, origin) {
  24596. if (!to) to = from;
  24597. if (cmp(to, from) < 0) { var tmp = to; to = from; from = tmp; }
  24598. if (typeof code == "string") code = doc.splitLines(code);
  24599. makeChange(doc, {from: from, to: to, text: code, origin: origin});
  24600. }
  24601. // SCROLLING THINGS INTO VIEW
  24602. // If an editor sits on the top or bottom of the window, partially
  24603. // scrolled out of view, this ensures that the cursor is visible.
  24604. function maybeScrollWindow(cm, coords) {
  24605. if (signalDOMEvent(cm, "scrollCursorIntoView")) return;
  24606. var display = cm.display, box = display.sizer.getBoundingClientRect(), doScroll = null;
  24607. if (coords.top + box.top < 0) doScroll = true;
  24608. else if (coords.bottom + box.top > (window.innerHeight || document.documentElement.clientHeight)) doScroll = false;
  24609. if (doScroll != null && !phantom) {
  24610. var scrollNode = elt("div", "\u200b", null, "position: absolute; top: " +
  24611. (coords.top - display.viewOffset - paddingTop(cm.display)) + "px; height: " +
  24612. (coords.bottom - coords.top + scrollGap(cm) + display.barHeight) + "px; left: " +
  24613. coords.left + "px; width: 2px;");
  24614. cm.display.lineSpace.appendChild(scrollNode);
  24615. scrollNode.scrollIntoView(doScroll);
  24616. cm.display.lineSpace.removeChild(scrollNode);
  24617. }
  24618. }
  24619. // Scroll a given position into view (immediately), verifying that
  24620. // it actually became visible (as line heights are accurately
  24621. // measured, the position of something may 'drift' during drawing).
  24622. function scrollPosIntoView(cm, pos, end, margin) {
  24623. if (margin == null) margin = 0;
  24624. for (var limit = 0; limit < 5; limit++) {
  24625. var changed = false, coords = cursorCoords(cm, pos);
  24626. var endCoords = !end || end == pos ? coords : cursorCoords(cm, end);
  24627. var scrollPos = calculateScrollPos(cm, Math.min(coords.left, endCoords.left),
  24628. Math.min(coords.top, endCoords.top) - margin,
  24629. Math.max(coords.left, endCoords.left),
  24630. Math.max(coords.bottom, endCoords.bottom) + margin);
  24631. var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft;
  24632. if (scrollPos.scrollTop != null) {
  24633. setScrollTop(cm, scrollPos.scrollTop);
  24634. if (Math.abs(cm.doc.scrollTop - startTop) > 1) changed = true;
  24635. }
  24636. if (scrollPos.scrollLeft != null) {
  24637. setScrollLeft(cm, scrollPos.scrollLeft);
  24638. if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) changed = true;
  24639. }
  24640. if (!changed) break;
  24641. }
  24642. return coords;
  24643. }
  24644. // Scroll a given set of coordinates into view (immediately).
  24645. function scrollIntoView(cm, x1, y1, x2, y2) {
  24646. var scrollPos = calculateScrollPos(cm, x1, y1, x2, y2);
  24647. if (scrollPos.scrollTop != null) setScrollTop(cm, scrollPos.scrollTop);
  24648. if (scrollPos.scrollLeft != null) setScrollLeft(cm, scrollPos.scrollLeft);
  24649. }
  24650. // Calculate a new scroll position needed to scroll the given
  24651. // rectangle into view. Returns an object with scrollTop and
  24652. // scrollLeft properties. When these are undefined, the
  24653. // vertical/horizontal position does not need to be adjusted.
  24654. function calculateScrollPos(cm, x1, y1, x2, y2) {
  24655. var display = cm.display, snapMargin = textHeight(cm.display);
  24656. if (y1 < 0) y1 = 0;
  24657. var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop;
  24658. var screen = displayHeight(cm), result = {};
  24659. if (y2 - y1 > screen) y2 = y1 + screen;
  24660. var docBottom = cm.doc.height + paddingVert(display);
  24661. var atTop = y1 < snapMargin, atBottom = y2 > docBottom - snapMargin;
  24662. if (y1 < screentop) {
  24663. result.scrollTop = atTop ? 0 : y1;
  24664. } else if (y2 > screentop + screen) {
  24665. var newTop = Math.min(y1, (atBottom ? docBottom : y2) - screen);
  24666. if (newTop != screentop) result.scrollTop = newTop;
  24667. }
  24668. var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft;
  24669. var screenw = displayWidth(cm) - (cm.options.fixedGutter ? display.gutters.offsetWidth : 0);
  24670. var tooWide = x2 - x1 > screenw;
  24671. if (tooWide) x2 = x1 + screenw;
  24672. if (x1 < 10)
  24673. result.scrollLeft = 0;
  24674. else if (x1 < screenleft)
  24675. result.scrollLeft = Math.max(0, x1 - (tooWide ? 0 : 10));
  24676. else if (x2 > screenw + screenleft - 3)
  24677. result.scrollLeft = x2 + (tooWide ? 0 : 10) - screenw;
  24678. return result;
  24679. }
  24680. // Store a relative adjustment to the scroll position in the current
  24681. // operation (to be applied when the operation finishes).
  24682. function addToScrollPos(cm, left, top) {
  24683. if (left != null || top != null) resolveScrollToPos(cm);
  24684. if (left != null)
  24685. cm.curOp.scrollLeft = (cm.curOp.scrollLeft == null ? cm.doc.scrollLeft : cm.curOp.scrollLeft) + left;
  24686. if (top != null)
  24687. cm.curOp.scrollTop = (cm.curOp.scrollTop == null ? cm.doc.scrollTop : cm.curOp.scrollTop) + top;
  24688. }
  24689. // Make sure that at the end of the operation the current cursor is
  24690. // shown.
  24691. function ensureCursorVisible(cm) {
  24692. resolveScrollToPos(cm);
  24693. var cur = cm.getCursor(), from = cur, to = cur;
  24694. if (!cm.options.lineWrapping) {
  24695. from = cur.ch ? Pos(cur.line, cur.ch - 1) : cur;
  24696. to = Pos(cur.line, cur.ch + 1);
  24697. }
  24698. cm.curOp.scrollToPos = {from: from, to: to, margin: cm.options.cursorScrollMargin, isCursor: true};
  24699. }
  24700. // When an operation has its scrollToPos property set, and another
  24701. // scroll action is applied before the end of the operation, this
  24702. // 'simulates' scrolling that position into view in a cheap way, so
  24703. // that the effect of intermediate scroll commands is not ignored.
  24704. function resolveScrollToPos(cm) {
  24705. var range = cm.curOp.scrollToPos;
  24706. if (range) {
  24707. cm.curOp.scrollToPos = null;
  24708. var from = estimateCoords(cm, range.from), to = estimateCoords(cm, range.to);
  24709. var sPos = calculateScrollPos(cm, Math.min(from.left, to.left),
  24710. Math.min(from.top, to.top) - range.margin,
  24711. Math.max(from.right, to.right),
  24712. Math.max(from.bottom, to.bottom) + range.margin);
  24713. cm.scrollTo(sPos.scrollLeft, sPos.scrollTop);
  24714. }
  24715. }
  24716. // API UTILITIES
  24717. // Indent the given line. The how parameter can be "smart",
  24718. // "add"/null, "subtract", or "prev". When aggressive is false
  24719. // (typically set to true for forced single-line indents), empty
  24720. // lines are not indented, and places where the mode returns Pass
  24721. // are left alone.
  24722. function indentLine(cm, n, how, aggressive) {
  24723. var doc = cm.doc, state;
  24724. if (how == null) how = "add";
  24725. if (how == "smart") {
  24726. // Fall back to "prev" when the mode doesn't have an indentation
  24727. // method.
  24728. if (!doc.mode.indent) how = "prev";
  24729. else state = getStateBefore(cm, n);
  24730. }
  24731. var tabSize = cm.options.tabSize;
  24732. var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize);
  24733. if (line.stateAfter) line.stateAfter = null;
  24734. var curSpaceString = line.text.match(/^\s*/)[0], indentation;
  24735. if (!aggressive && !/\S/.test(line.text)) {
  24736. indentation = 0;
  24737. how = "not";
  24738. } else if (how == "smart") {
  24739. indentation = doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text);
  24740. if (indentation == Pass || indentation > 150) {
  24741. if (!aggressive) return;
  24742. how = "prev";
  24743. }
  24744. }
  24745. if (how == "prev") {
  24746. if (n > doc.first) indentation = countColumn(getLine(doc, n-1).text, null, tabSize);
  24747. else indentation = 0;
  24748. } else if (how == "add") {
  24749. indentation = curSpace + cm.options.indentUnit;
  24750. } else if (how == "subtract") {
  24751. indentation = curSpace - cm.options.indentUnit;
  24752. } else if (typeof how == "number") {
  24753. indentation = curSpace + how;
  24754. }
  24755. indentation = Math.max(0, indentation);
  24756. var indentString = "", pos = 0;
  24757. if (cm.options.indentWithTabs)
  24758. for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += "\t";}
  24759. if (pos < indentation) indentString += spaceStr(indentation - pos);
  24760. if (indentString != curSpaceString) {
  24761. replaceRange(doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), "+input");
  24762. line.stateAfter = null;
  24763. return true;
  24764. } else {
  24765. // Ensure that, if the cursor was in the whitespace at the start
  24766. // of the line, it is moved to the end of that space.
  24767. for (var i = 0; i < doc.sel.ranges.length; i++) {
  24768. var range = doc.sel.ranges[i];
  24769. if (range.head.line == n && range.head.ch < curSpaceString.length) {
  24770. var pos = Pos(n, curSpaceString.length);
  24771. replaceOneSelection(doc, i, new Range(pos, pos));
  24772. break;
  24773. }
  24774. }
  24775. }
  24776. }
  24777. // Utility for applying a change to a line by handle or number,
  24778. // returning the number and optionally registering the line as
  24779. // changed.
  24780. function changeLine(doc, handle, changeType, op) {
  24781. var no = handle, line = handle;
  24782. if (typeof handle == "number") line = getLine(doc, clipLine(doc, handle));
  24783. else no = lineNo(handle);
  24784. if (no == null) return null;
  24785. if (op(line, no) && doc.cm) regLineChange(doc.cm, no, changeType);
  24786. return line;
  24787. }
  24788. // Helper for deleting text near the selection(s), used to implement
  24789. // backspace, delete, and similar functionality.
  24790. function deleteNearSelection(cm, compute) {
  24791. var ranges = cm.doc.sel.ranges, kill = [];
  24792. // Build up a set of ranges to kill first, merging overlapping
  24793. // ranges.
  24794. for (var i = 0; i < ranges.length; i++) {
  24795. var toKill = compute(ranges[i]);
  24796. while (kill.length && cmp(toKill.from, lst(kill).to) <= 0) {
  24797. var replaced = kill.pop();
  24798. if (cmp(replaced.from, toKill.from) < 0) {
  24799. toKill.from = replaced.from;
  24800. break;
  24801. }
  24802. }
  24803. kill.push(toKill);
  24804. }
  24805. // Next, remove those actual ranges.
  24806. runInOp(cm, function() {
  24807. for (var i = kill.length - 1; i >= 0; i--)
  24808. replaceRange(cm.doc, "", kill[i].from, kill[i].to, "+delete");
  24809. ensureCursorVisible(cm);
  24810. });
  24811. }
  24812. // Used for horizontal relative motion. Dir is -1 or 1 (left or
  24813. // right), unit can be "char", "column" (like char, but doesn't
  24814. // cross line boundaries), "word" (across next word), or "group" (to
  24815. // the start of next group of word or non-word-non-whitespace
  24816. // chars). The visually param controls whether, in right-to-left
  24817. // text, direction 1 means to move towards the next index in the
  24818. // string, or towards the character to the right of the current
  24819. // position. The resulting position will have a hitSide=true
  24820. // property if it reached the end of the document.
  24821. function findPosH(doc, pos, dir, unit, visually) {
  24822. var line = pos.line, ch = pos.ch, origDir = dir;
  24823. var lineObj = getLine(doc, line);
  24824. function findNextLine() {
  24825. var l = line + dir;
  24826. if (l < doc.first || l >= doc.first + doc.size) return false
  24827. line = l;
  24828. return lineObj = getLine(doc, l);
  24829. }
  24830. function moveOnce(boundToLine) {
  24831. var next = (visually ? moveVisually : moveLogically)(lineObj, ch, dir, true);
  24832. if (next == null) {
  24833. if (!boundToLine && findNextLine()) {
  24834. if (visually) ch = (dir < 0 ? lineRight : lineLeft)(lineObj);
  24835. else ch = dir < 0 ? lineObj.text.length : 0;
  24836. } else return false
  24837. } else ch = next;
  24838. return true;
  24839. }
  24840. if (unit == "char") {
  24841. moveOnce()
  24842. } else if (unit == "column") {
  24843. moveOnce(true)
  24844. } else if (unit == "word" || unit == "group") {
  24845. var sawType = null, group = unit == "group";
  24846. var helper = doc.cm && doc.cm.getHelper(pos, "wordChars");
  24847. for (var first = true;; first = false) {
  24848. if (dir < 0 && !moveOnce(!first)) break;
  24849. var cur = lineObj.text.charAt(ch) || "\n";
  24850. var type = isWordChar(cur, helper) ? "w"
  24851. : group && cur == "\n" ? "n"
  24852. : !group || /\s/.test(cur) ? null
  24853. : "p";
  24854. if (group && !first && !type) type = "s";
  24855. if (sawType && sawType != type) {
  24856. if (dir < 0) {dir = 1; moveOnce();}
  24857. break;
  24858. }
  24859. if (type) sawType = type;
  24860. if (dir > 0 && !moveOnce(!first)) break;
  24861. }
  24862. }
  24863. var result = skipAtomic(doc, Pos(line, ch), pos, origDir, true);
  24864. if (!cmp(pos, result)) result.hitSide = true;
  24865. return result;
  24866. }
  24867. // For relative vertical movement. Dir may be -1 or 1. Unit can be
  24868. // "page" or "line". The resulting position will have a hitSide=true
  24869. // property if it reached the end of the document.
  24870. function findPosV(cm, pos, dir, unit) {
  24871. var doc = cm.doc, x = pos.left, y;
  24872. if (unit == "page") {
  24873. var pageSize = Math.min(cm.display.wrapper.clientHeight, window.innerHeight || document.documentElement.clientHeight);
  24874. y = pos.top + dir * (pageSize - (dir < 0 ? 1.5 : .5) * textHeight(cm.display));
  24875. } else if (unit == "line") {
  24876. y = dir > 0 ? pos.bottom + 3 : pos.top - 3;
  24877. }
  24878. for (;;) {
  24879. var target = coordsChar(cm, x, y);
  24880. if (!target.outside) break;
  24881. if (dir < 0 ? y <= 0 : y >= doc.height) { target.hitSide = true; break; }
  24882. y += dir * 5;
  24883. }
  24884. return target;
  24885. }
  24886. // EDITOR METHODS
  24887. // The publicly visible API. Note that methodOp(f) means
  24888. // 'wrap f in an operation, performed on its `this` parameter'.
  24889. // This is not the complete set of editor methods. Most of the
  24890. // methods defined on the Doc type are also injected into
  24891. // CodeMirror.prototype, for backwards compatibility and
  24892. // convenience.
  24893. CodeMirror.prototype = {
  24894. constructor: CodeMirror,
  24895. focus: function(){window.focus(); this.display.input.focus();},
  24896. setOption: function(option, value) {
  24897. var options = this.options, old = options[option];
  24898. if (options[option] == value && option != "mode") return;
  24899. options[option] = value;
  24900. if (optionHandlers.hasOwnProperty(option))
  24901. operation(this, optionHandlers[option])(this, value, old);
  24902. },
  24903. getOption: function(option) {return this.options[option];},
  24904. getDoc: function() {return this.doc;},
  24905. addKeyMap: function(map, bottom) {
  24906. this.state.keyMaps[bottom ? "push" : "unshift"](getKeyMap(map));
  24907. },
  24908. removeKeyMap: function(map) {
  24909. var maps = this.state.keyMaps;
  24910. for (var i = 0; i < maps.length; ++i)
  24911. if (maps[i] == map || maps[i].name == map) {
  24912. maps.splice(i, 1);
  24913. return true;
  24914. }
  24915. },
  24916. addOverlay: methodOp(function(spec, options) {
  24917. var mode = spec.token ? spec : CodeMirror.getMode(this.options, spec);
  24918. if (mode.startState) throw new Error("Overlays may not be stateful.");
  24919. this.state.overlays.push({mode: mode, modeSpec: spec, opaque: options && options.opaque});
  24920. this.state.modeGen++;
  24921. regChange(this);
  24922. }),
  24923. removeOverlay: methodOp(function(spec) {
  24924. var overlays = this.state.overlays;
  24925. for (var i = 0; i < overlays.length; ++i) {
  24926. var cur = overlays[i].modeSpec;
  24927. if (cur == spec || typeof spec == "string" && cur.name == spec) {
  24928. overlays.splice(i, 1);
  24929. this.state.modeGen++;
  24930. regChange(this);
  24931. return;
  24932. }
  24933. }
  24934. }),
  24935. indentLine: methodOp(function(n, dir, aggressive) {
  24936. if (typeof dir != "string" && typeof dir != "number") {
  24937. if (dir == null) dir = this.options.smartIndent ? "smart" : "prev";
  24938. else dir = dir ? "add" : "subtract";
  24939. }
  24940. if (isLine(this.doc, n)) indentLine(this, n, dir, aggressive);
  24941. }),
  24942. indentSelection: methodOp(function(how) {
  24943. var ranges = this.doc.sel.ranges, end = -1;
  24944. for (var i = 0; i < ranges.length; i++) {
  24945. var range = ranges[i];
  24946. if (!range.empty()) {
  24947. var from = range.from(), to = range.to();
  24948. var start = Math.max(end, from.line);
  24949. end = Math.min(this.lastLine(), to.line - (to.ch ? 0 : 1)) + 1;
  24950. for (var j = start; j < end; ++j)
  24951. indentLine(this, j, how);
  24952. var newRanges = this.doc.sel.ranges;
  24953. if (from.ch == 0 && ranges.length == newRanges.length && newRanges[i].from().ch > 0)
  24954. replaceOneSelection(this.doc, i, new Range(from, newRanges[i].to()), sel_dontScroll);
  24955. } else if (range.head.line > end) {
  24956. indentLine(this, range.head.line, how, true);
  24957. end = range.head.line;
  24958. if (i == this.doc.sel.primIndex) ensureCursorVisible(this);
  24959. }
  24960. }
  24961. }),
  24962. // Fetch the parser token for a given character. Useful for hacks
  24963. // that want to inspect the mode state (say, for completion).
  24964. getTokenAt: function(pos, precise) {
  24965. return takeToken(this, pos, precise);
  24966. },
  24967. getLineTokens: function(line, precise) {
  24968. return takeToken(this, Pos(line), precise, true);
  24969. },
  24970. getTokenTypeAt: function(pos) {
  24971. pos = clipPos(this.doc, pos);
  24972. var styles = getLineStyles(this, getLine(this.doc, pos.line));
  24973. var before = 0, after = (styles.length - 1) / 2, ch = pos.ch;
  24974. var type;
  24975. if (ch == 0) type = styles[2];
  24976. else for (;;) {
  24977. var mid = (before + after) >> 1;
  24978. if ((mid ? styles[mid * 2 - 1] : 0) >= ch) after = mid;
  24979. else if (styles[mid * 2 + 1] < ch) before = mid + 1;
  24980. else { type = styles[mid * 2 + 2]; break; }
  24981. }
  24982. var cut = type ? type.indexOf("cm-overlay ") : -1;
  24983. return cut < 0 ? type : cut == 0 ? null : type.slice(0, cut - 1);
  24984. },
  24985. getModeAt: function(pos) {
  24986. var mode = this.doc.mode;
  24987. if (!mode.innerMode) return mode;
  24988. return CodeMirror.innerMode(mode, this.getTokenAt(pos).state).mode;
  24989. },
  24990. getHelper: function(pos, type) {
  24991. return this.getHelpers(pos, type)[0];
  24992. },
  24993. getHelpers: function(pos, type) {
  24994. var found = [];
  24995. if (!helpers.hasOwnProperty(type)) return found;
  24996. var help = helpers[type], mode = this.getModeAt(pos);
  24997. if (typeof mode[type] == "string") {
  24998. if (help[mode[type]]) found.push(help[mode[type]]);
  24999. } else if (mode[type]) {
  25000. for (var i = 0; i < mode[type].length; i++) {
  25001. var val = help[mode[type][i]];
  25002. if (val) found.push(val);
  25003. }
  25004. } else if (mode.helperType && help[mode.helperType]) {
  25005. found.push(help[mode.helperType]);
  25006. } else if (help[mode.name]) {
  25007. found.push(help[mode.name]);
  25008. }
  25009. for (var i = 0; i < help._global.length; i++) {
  25010. var cur = help._global[i];
  25011. if (cur.pred(mode, this) && indexOf(found, cur.val) == -1)
  25012. found.push(cur.val);
  25013. }
  25014. return found;
  25015. },
  25016. getStateAfter: function(line, precise) {
  25017. var doc = this.doc;
  25018. line = clipLine(doc, line == null ? doc.first + doc.size - 1: line);
  25019. return getStateBefore(this, line + 1, precise);
  25020. },
  25021. cursorCoords: function(start, mode) {
  25022. var pos, range = this.doc.sel.primary();
  25023. if (start == null) pos = range.head;
  25024. else if (typeof start == "object") pos = clipPos(this.doc, start);
  25025. else pos = start ? range.from() : range.to();
  25026. return cursorCoords(this, pos, mode || "page");
  25027. },
  25028. charCoords: function(pos, mode) {
  25029. return charCoords(this, clipPos(this.doc, pos), mode || "page");
  25030. },
  25031. coordsChar: function(coords, mode) {
  25032. coords = fromCoordSystem(this, coords, mode || "page");
  25033. return coordsChar(this, coords.left, coords.top);
  25034. },
  25035. lineAtHeight: function(height, mode) {
  25036. height = fromCoordSystem(this, {top: height, left: 0}, mode || "page").top;
  25037. return lineAtHeight(this.doc, height + this.display.viewOffset);
  25038. },
  25039. heightAtLine: function(line, mode) {
  25040. var end = false, lineObj;
  25041. if (typeof line == "number") {
  25042. var last = this.doc.first + this.doc.size - 1;
  25043. if (line < this.doc.first) line = this.doc.first;
  25044. else if (line > last) { line = last; end = true; }
  25045. lineObj = getLine(this.doc, line);
  25046. } else {
  25047. lineObj = line;
  25048. }
  25049. return intoCoordSystem(this, lineObj, {top: 0, left: 0}, mode || "page").top +
  25050. (end ? this.doc.height - heightAtLine(lineObj) : 0);
  25051. },
  25052. defaultTextHeight: function() { return textHeight(this.display); },
  25053. defaultCharWidth: function() { return charWidth(this.display); },
  25054. setGutterMarker: methodOp(function(line, gutterID, value) {
  25055. return changeLine(this.doc, line, "gutter", function(line) {
  25056. var markers = line.gutterMarkers || (line.gutterMarkers = {});
  25057. markers[gutterID] = value;
  25058. if (!value && isEmpty(markers)) line.gutterMarkers = null;
  25059. return true;
  25060. });
  25061. }),
  25062. clearGutter: methodOp(function(gutterID) {
  25063. var cm = this, doc = cm.doc, i = doc.first;
  25064. doc.iter(function(line) {
  25065. if (line.gutterMarkers && line.gutterMarkers[gutterID]) {
  25066. line.gutterMarkers[gutterID] = null;
  25067. regLineChange(cm, i, "gutter");
  25068. if (isEmpty(line.gutterMarkers)) line.gutterMarkers = null;
  25069. }
  25070. ++i;
  25071. });
  25072. }),
  25073. lineInfo: function(line) {
  25074. if (typeof line == "number") {
  25075. if (!isLine(this.doc, line)) return null;
  25076. var n = line;
  25077. line = getLine(this.doc, line);
  25078. if (!line) return null;
  25079. } else {
  25080. var n = lineNo(line);
  25081. if (n == null) return null;
  25082. }
  25083. return {line: n, handle: line, text: line.text, gutterMarkers: line.gutterMarkers,
  25084. textClass: line.textClass, bgClass: line.bgClass, wrapClass: line.wrapClass,
  25085. widgets: line.widgets};
  25086. },
  25087. getViewport: function() { return {from: this.display.viewFrom, to: this.display.viewTo};},
  25088. addWidget: function(pos, node, scroll, vert, horiz) {
  25089. var display = this.display;
  25090. pos = cursorCoords(this, clipPos(this.doc, pos));
  25091. var top = pos.bottom, left = pos.left;
  25092. node.style.position = "absolute";
  25093. node.setAttribute("cm-ignore-events", "true");
  25094. this.display.input.setUneditable(node);
  25095. display.sizer.appendChild(node);
  25096. if (vert == "over") {
  25097. top = pos.top;
  25098. } else if (vert == "above" || vert == "near") {
  25099. var vspace = Math.max(display.wrapper.clientHeight, this.doc.height),
  25100. hspace = Math.max(display.sizer.clientWidth, display.lineSpace.clientWidth);
  25101. // Default to positioning above (if specified and possible); otherwise default to positioning below
  25102. if ((vert == 'above' || pos.bottom + node.offsetHeight > vspace) && pos.top > node.offsetHeight)
  25103. top = pos.top - node.offsetHeight;
  25104. else if (pos.bottom + node.offsetHeight <= vspace)
  25105. top = pos.bottom;
  25106. if (left + node.offsetWidth > hspace)
  25107. left = hspace - node.offsetWidth;
  25108. }
  25109. node.style.top = top + "px";
  25110. node.style.left = node.style.right = "";
  25111. if (horiz == "right") {
  25112. left = display.sizer.clientWidth - node.offsetWidth;
  25113. node.style.right = "0px";
  25114. } else {
  25115. if (horiz == "left") left = 0;
  25116. else if (horiz == "middle") left = (display.sizer.clientWidth - node.offsetWidth) / 2;
  25117. node.style.left = left + "px";
  25118. }
  25119. if (scroll)
  25120. scrollIntoView(this, left, top, left + node.offsetWidth, top + node.offsetHeight);
  25121. },
  25122. triggerOnKeyDown: methodOp(onKeyDown),
  25123. triggerOnKeyPress: methodOp(onKeyPress),
  25124. triggerOnKeyUp: onKeyUp,
  25125. execCommand: function(cmd) {
  25126. if (commands.hasOwnProperty(cmd))
  25127. return commands[cmd].call(null, this);
  25128. },
  25129. triggerElectric: methodOp(function(text) { triggerElectric(this, text); }),
  25130. findPosH: function(from, amount, unit, visually) {
  25131. var dir = 1;
  25132. if (amount < 0) { dir = -1; amount = -amount; }
  25133. for (var i = 0, cur = clipPos(this.doc, from); i < amount; ++i) {
  25134. cur = findPosH(this.doc, cur, dir, unit, visually);
  25135. if (cur.hitSide) break;
  25136. }
  25137. return cur;
  25138. },
  25139. moveH: methodOp(function(dir, unit) {
  25140. var cm = this;
  25141. cm.extendSelectionsBy(function(range) {
  25142. if (cm.display.shift || cm.doc.extend || range.empty())
  25143. return findPosH(cm.doc, range.head, dir, unit, cm.options.rtlMoveVisually);
  25144. else
  25145. return dir < 0 ? range.from() : range.to();
  25146. }, sel_move);
  25147. }),
  25148. deleteH: methodOp(function(dir, unit) {
  25149. var sel = this.doc.sel, doc = this.doc;
  25150. if (sel.somethingSelected())
  25151. doc.replaceSelection("", null, "+delete");
  25152. else
  25153. deleteNearSelection(this, function(range) {
  25154. var other = findPosH(doc, range.head, dir, unit, false);
  25155. return dir < 0 ? {from: other, to: range.head} : {from: range.head, to: other};
  25156. });
  25157. }),
  25158. findPosV: function(from, amount, unit, goalColumn) {
  25159. var dir = 1, x = goalColumn;
  25160. if (amount < 0) { dir = -1; amount = -amount; }
  25161. for (var i = 0, cur = clipPos(this.doc, from); i < amount; ++i) {
  25162. var coords = cursorCoords(this, cur, "div");
  25163. if (x == null) x = coords.left;
  25164. else coords.left = x;
  25165. cur = findPosV(this, coords, dir, unit);
  25166. if (cur.hitSide) break;
  25167. }
  25168. return cur;
  25169. },
  25170. moveV: methodOp(function(dir, unit) {
  25171. var cm = this, doc = this.doc, goals = [];
  25172. var collapse = !cm.display.shift && !doc.extend && doc.sel.somethingSelected();
  25173. doc.extendSelectionsBy(function(range) {
  25174. if (collapse)
  25175. return dir < 0 ? range.from() : range.to();
  25176. var headPos = cursorCoords(cm, range.head, "div");
  25177. if (range.goalColumn != null) headPos.left = range.goalColumn;
  25178. goals.push(headPos.left);
  25179. var pos = findPosV(cm, headPos, dir, unit);
  25180. if (unit == "page" && range == doc.sel.primary())
  25181. addToScrollPos(cm, null, charCoords(cm, pos, "div").top - headPos.top);
  25182. return pos;
  25183. }, sel_move);
  25184. if (goals.length) for (var i = 0; i < doc.sel.ranges.length; i++)
  25185. doc.sel.ranges[i].goalColumn = goals[i];
  25186. }),
  25187. // Find the word at the given position (as returned by coordsChar).
  25188. findWordAt: function(pos) {
  25189. var doc = this.doc, line = getLine(doc, pos.line).text;
  25190. var start = pos.ch, end = pos.ch;
  25191. if (line) {
  25192. var helper = this.getHelper(pos, "wordChars");
  25193. if ((pos.xRel < 0 || end == line.length) && start) --start; else ++end;
  25194. var startChar = line.charAt(start);
  25195. var check = isWordChar(startChar, helper)
  25196. ? function(ch) { return isWordChar(ch, helper); }
  25197. : /\s/.test(startChar) ? function(ch) {return /\s/.test(ch);}
  25198. : function(ch) {return !/\s/.test(ch) && !isWordChar(ch);};
  25199. while (start > 0 && check(line.charAt(start - 1))) --start;
  25200. while (end < line.length && check(line.charAt(end))) ++end;
  25201. }
  25202. return new Range(Pos(pos.line, start), Pos(pos.line, end));
  25203. },
  25204. toggleOverwrite: function(value) {
  25205. if (value != null && value == this.state.overwrite) return;
  25206. if (this.state.overwrite = !this.state.overwrite)
  25207. addClass(this.display.cursorDiv, "CodeMirror-overwrite");
  25208. else
  25209. rmClass(this.display.cursorDiv, "CodeMirror-overwrite");
  25210. signal(this, "overwriteToggle", this, this.state.overwrite);
  25211. },
  25212. hasFocus: function() { return this.display.input.getField() == activeElt(); },
  25213. isReadOnly: function() { return !!(this.options.readOnly || this.doc.cantEdit); },
  25214. scrollTo: methodOp(function(x, y) {
  25215. if (x != null || y != null) resolveScrollToPos(this);
  25216. if (x != null) this.curOp.scrollLeft = x;
  25217. if (y != null) this.curOp.scrollTop = y;
  25218. }),
  25219. getScrollInfo: function() {
  25220. var scroller = this.display.scroller;
  25221. return {left: scroller.scrollLeft, top: scroller.scrollTop,
  25222. height: scroller.scrollHeight - scrollGap(this) - this.display.barHeight,
  25223. width: scroller.scrollWidth - scrollGap(this) - this.display.barWidth,
  25224. clientHeight: displayHeight(this), clientWidth: displayWidth(this)};
  25225. },
  25226. scrollIntoView: methodOp(function(range, margin) {
  25227. if (range == null) {
  25228. range = {from: this.doc.sel.primary().head, to: null};
  25229. if (margin == null) margin = this.options.cursorScrollMargin;
  25230. } else if (typeof range == "number") {
  25231. range = {from: Pos(range, 0), to: null};
  25232. } else if (range.from == null) {
  25233. range = {from: range, to: null};
  25234. }
  25235. if (!range.to) range.to = range.from;
  25236. range.margin = margin || 0;
  25237. if (range.from.line != null) {
  25238. resolveScrollToPos(this);
  25239. this.curOp.scrollToPos = range;
  25240. } else {
  25241. var sPos = calculateScrollPos(this, Math.min(range.from.left, range.to.left),
  25242. Math.min(range.from.top, range.to.top) - range.margin,
  25243. Math.max(range.from.right, range.to.right),
  25244. Math.max(range.from.bottom, range.to.bottom) + range.margin);
  25245. this.scrollTo(sPos.scrollLeft, sPos.scrollTop);
  25246. }
  25247. }),
  25248. setSize: methodOp(function(width, height) {
  25249. var cm = this;
  25250. function interpret(val) {
  25251. return typeof val == "number" || /^\d+$/.test(String(val)) ? val + "px" : val;
  25252. }
  25253. if (width != null) cm.display.wrapper.style.width = interpret(width);
  25254. if (height != null) cm.display.wrapper.style.height = interpret(height);
  25255. if (cm.options.lineWrapping) clearLineMeasurementCache(this);
  25256. var lineNo = cm.display.viewFrom;
  25257. cm.doc.iter(lineNo, cm.display.viewTo, function(line) {
  25258. if (line.widgets) for (var i = 0; i < line.widgets.length; i++)
  25259. if (line.widgets[i].noHScroll) { regLineChange(cm, lineNo, "widget"); break; }
  25260. ++lineNo;
  25261. });
  25262. cm.curOp.forceUpdate = true;
  25263. signal(cm, "refresh", this);
  25264. }),
  25265. operation: function(f){return runInOp(this, f);},
  25266. refresh: methodOp(function() {
  25267. var oldHeight = this.display.cachedTextHeight;
  25268. regChange(this);
  25269. this.curOp.forceUpdate = true;
  25270. clearCaches(this);
  25271. this.scrollTo(this.doc.scrollLeft, this.doc.scrollTop);
  25272. updateGutterSpace(this);
  25273. if (oldHeight == null || Math.abs(oldHeight - textHeight(this.display)) > .5)
  25274. estimateLineHeights(this);
  25275. signal(this, "refresh", this);
  25276. }),
  25277. swapDoc: methodOp(function(doc) {
  25278. var old = this.doc;
  25279. old.cm = null;
  25280. attachDoc(this, doc);
  25281. clearCaches(this);
  25282. this.display.input.reset();
  25283. this.scrollTo(doc.scrollLeft, doc.scrollTop);
  25284. this.curOp.forceScroll = true;
  25285. signalLater(this, "swapDoc", this, old);
  25286. return old;
  25287. }),
  25288. getInputField: function(){return this.display.input.getField();},
  25289. getWrapperElement: function(){return this.display.wrapper;},
  25290. getScrollerElement: function(){return this.display.scroller;},
  25291. getGutterElement: function(){return this.display.gutters;}
  25292. };
  25293. eventMixin(CodeMirror);
  25294. // OPTION DEFAULTS
  25295. // The default configuration options.
  25296. var defaults = CodeMirror.defaults = {};
  25297. // Functions to run when options are changed.
  25298. var optionHandlers = CodeMirror.optionHandlers = {};
  25299. function option(name, deflt, handle, notOnInit) {
  25300. CodeMirror.defaults[name] = deflt;
  25301. if (handle) optionHandlers[name] =
  25302. notOnInit ? function(cm, val, old) {if (old != Init) handle(cm, val, old);} : handle;
  25303. }
  25304. // Passed to option handlers when there is no old value.
  25305. var Init = CodeMirror.Init = {toString: function(){return "CodeMirror.Init";}};
  25306. // These two are, on init, called from the constructor because they
  25307. // have to be initialized before the editor can start at all.
  25308. option("value", "", function(cm, val) {
  25309. cm.setValue(val);
  25310. }, true);
  25311. option("mode", null, function(cm, val) {
  25312. cm.doc.modeOption = val;
  25313. loadMode(cm);
  25314. }, true);
  25315. option("indentUnit", 2, loadMode, true);
  25316. option("indentWithTabs", false);
  25317. option("smartIndent", true);
  25318. option("tabSize", 4, function(cm) {
  25319. resetModeState(cm);
  25320. clearCaches(cm);
  25321. regChange(cm);
  25322. }, true);
  25323. option("lineSeparator", null, function(cm, val) {
  25324. cm.doc.lineSep = val;
  25325. if (!val) return;
  25326. var newBreaks = [], lineNo = cm.doc.first;
  25327. cm.doc.iter(function(line) {
  25328. for (var pos = 0;;) {
  25329. var found = line.text.indexOf(val, pos);
  25330. if (found == -1) break;
  25331. pos = found + val.length;
  25332. newBreaks.push(Pos(lineNo, found));
  25333. }
  25334. lineNo++;
  25335. });
  25336. for (var i = newBreaks.length - 1; i >= 0; i--)
  25337. replaceRange(cm.doc, val, newBreaks[i], Pos(newBreaks[i].line, newBreaks[i].ch + val.length))
  25338. });
  25339. option("specialChars", /[\u0000-\u001f\u007f\u00ad\u200b-\u200f\u2028\u2029\ufeff]/g, function(cm, val, old) {
  25340. cm.state.specialChars = new RegExp(val.source + (val.test("\t") ? "" : "|\t"), "g");
  25341. if (old != CodeMirror.Init) cm.refresh();
  25342. });
  25343. option("specialCharPlaceholder", defaultSpecialCharPlaceholder, function(cm) {cm.refresh();}, true);
  25344. option("electricChars", true);
  25345. option("inputStyle", mobile ? "contenteditable" : "textarea", function() {
  25346. throw new Error("inputStyle can not (yet) be changed in a running editor"); // FIXME
  25347. }, true);
  25348. option("rtlMoveVisually", !windows);
  25349. option("wholeLineUpdateBefore", true);
  25350. option("theme", "default", function(cm) {
  25351. themeChanged(cm);
  25352. guttersChanged(cm);
  25353. }, true);
  25354. option("keyMap", "default", function(cm, val, old) {
  25355. var next = getKeyMap(val);
  25356. var prev = old != CodeMirror.Init && getKeyMap(old);
  25357. if (prev && prev.detach) prev.detach(cm, next);
  25358. if (next.attach) next.attach(cm, prev || null);
  25359. });
  25360. option("extraKeys", null);
  25361. option("lineWrapping", false, wrappingChanged, true);
  25362. option("gutters", [], function(cm) {
  25363. setGuttersForLineNumbers(cm.options);
  25364. guttersChanged(cm);
  25365. }, true);
  25366. option("fixedGutter", true, function(cm, val) {
  25367. cm.display.gutters.style.left = val ? compensateForHScroll(cm.display) + "px" : "0";
  25368. cm.refresh();
  25369. }, true);
  25370. option("coverGutterNextToScrollbar", false, function(cm) {updateScrollbars(cm);}, true);
  25371. option("scrollbarStyle", "native", function(cm) {
  25372. initScrollbars(cm);
  25373. updateScrollbars(cm);
  25374. cm.display.scrollbars.setScrollTop(cm.doc.scrollTop);
  25375. cm.display.scrollbars.setScrollLeft(cm.doc.scrollLeft);
  25376. }, true);
  25377. option("lineNumbers", false, function(cm) {
  25378. setGuttersForLineNumbers(cm.options);
  25379. guttersChanged(cm);
  25380. }, true);
  25381. option("firstLineNumber", 1, guttersChanged, true);
  25382. option("lineNumberFormatter", function(integer) {return integer;}, guttersChanged, true);
  25383. option("showCursorWhenSelecting", false, updateSelection, true);
  25384. option("resetSelectionOnContextMenu", true);
  25385. option("lineWiseCopyCut", true);
  25386. option("readOnly", false, function(cm, val) {
  25387. if (val == "nocursor") {
  25388. onBlur(cm);
  25389. cm.display.input.blur();
  25390. cm.display.disabled = true;
  25391. } else {
  25392. cm.display.disabled = false;
  25393. }
  25394. cm.display.input.readOnlyChanged(val)
  25395. });
  25396. option("disableInput", false, function(cm, val) {if (!val) cm.display.input.reset();}, true);
  25397. option("dragDrop", true, dragDropChanged);
  25398. option("allowDropFileTypes", null);
  25399. option("cursorBlinkRate", 530);
  25400. option("cursorScrollMargin", 0);
  25401. option("cursorHeight", 1, updateSelection, true);
  25402. option("singleCursorHeightPerLine", true, updateSelection, true);
  25403. option("workTime", 100);
  25404. option("workDelay", 100);
  25405. option("flattenSpans", true, resetModeState, true);
  25406. option("addModeClass", false, resetModeState, true);
  25407. option("pollInterval", 100);
  25408. option("undoDepth", 200, function(cm, val){cm.doc.history.undoDepth = val;});
  25409. option("historyEventDelay", 1250);
  25410. option("viewportMargin", 10, function(cm){cm.refresh();}, true);
  25411. option("maxHighlightLength", 10000, resetModeState, true);
  25412. option("moveInputWithCursor", true, function(cm, val) {
  25413. if (!val) cm.display.input.resetPosition();
  25414. });
  25415. option("tabindex", null, function(cm, val) {
  25416. cm.display.input.getField().tabIndex = val || "";
  25417. });
  25418. option("autofocus", null);
  25419. // MODE DEFINITION AND QUERYING
  25420. // Known modes, by name and by MIME
  25421. var modes = CodeMirror.modes = {}, mimeModes = CodeMirror.mimeModes = {};
  25422. // Extra arguments are stored as the mode's dependencies, which is
  25423. // used by (legacy) mechanisms like loadmode.js to automatically
  25424. // load a mode. (Preferred mechanism is the require/define calls.)
  25425. CodeMirror.defineMode = function(name, mode) {
  25426. if (!CodeMirror.defaults.mode && name != "null") CodeMirror.defaults.mode = name;
  25427. if (arguments.length > 2)
  25428. mode.dependencies = Array.prototype.slice.call(arguments, 2);
  25429. modes[name] = mode;
  25430. };
  25431. CodeMirror.defineMIME = function(mime, spec) {
  25432. mimeModes[mime] = spec;
  25433. };
  25434. // Given a MIME type, a {name, ...options} config object, or a name
  25435. // string, return a mode config object.
  25436. CodeMirror.resolveMode = function(spec) {
  25437. if (typeof spec == "string" && mimeModes.hasOwnProperty(spec)) {
  25438. spec = mimeModes[spec];
  25439. } else if (spec && typeof spec.name == "string" && mimeModes.hasOwnProperty(spec.name)) {
  25440. var found = mimeModes[spec.name];
  25441. if (typeof found == "string") found = {name: found};
  25442. spec = createObj(found, spec);
  25443. spec.name = found.name;
  25444. } else if (typeof spec == "string" && /^[\w\-]+\/[\w\-]+\+xml$/.test(spec)) {
  25445. return CodeMirror.resolveMode("application/xml");
  25446. }
  25447. if (typeof spec == "string") return {name: spec};
  25448. else return spec || {name: "null"};
  25449. };
  25450. // Given a mode spec (anything that resolveMode accepts), find and
  25451. // initialize an actual mode object.
  25452. CodeMirror.getMode = function(options, spec) {
  25453. var spec = CodeMirror.resolveMode(spec);
  25454. var mfactory = modes[spec.name];
  25455. if (!mfactory) return CodeMirror.getMode(options, "text/plain");
  25456. var modeObj = mfactory(options, spec);
  25457. if (modeExtensions.hasOwnProperty(spec.name)) {
  25458. var exts = modeExtensions[spec.name];
  25459. for (var prop in exts) {
  25460. if (!exts.hasOwnProperty(prop)) continue;
  25461. if (modeObj.hasOwnProperty(prop)) modeObj["_" + prop] = modeObj[prop];
  25462. modeObj[prop] = exts[prop];
  25463. }
  25464. }
  25465. modeObj.name = spec.name;
  25466. if (spec.helperType) modeObj.helperType = spec.helperType;
  25467. if (spec.modeProps) for (var prop in spec.modeProps)
  25468. modeObj[prop] = spec.modeProps[prop];
  25469. return modeObj;
  25470. };
  25471. // Minimal default mode.
  25472. CodeMirror.defineMode("null", function() {
  25473. return {token: function(stream) {stream.skipToEnd();}};
  25474. });
  25475. CodeMirror.defineMIME("text/plain", "null");
  25476. // This can be used to attach properties to mode objects from
  25477. // outside the actual mode definition.
  25478. var modeExtensions = CodeMirror.modeExtensions = {};
  25479. CodeMirror.extendMode = function(mode, properties) {
  25480. var exts = modeExtensions.hasOwnProperty(mode) ? modeExtensions[mode] : (modeExtensions[mode] = {});
  25481. copyObj(properties, exts);
  25482. };
  25483. // EXTENSIONS
  25484. CodeMirror.defineExtension = function(name, func) {
  25485. CodeMirror.prototype[name] = func;
  25486. };
  25487. CodeMirror.defineDocExtension = function(name, func) {
  25488. Doc.prototype[name] = func;
  25489. };
  25490. CodeMirror.defineOption = option;
  25491. var initHooks = [];
  25492. CodeMirror.defineInitHook = function(f) {initHooks.push(f);};
  25493. var helpers = CodeMirror.helpers = {};
  25494. CodeMirror.registerHelper = function(type, name, value) {
  25495. if (!helpers.hasOwnProperty(type)) helpers[type] = CodeMirror[type] = {_global: []};
  25496. helpers[type][name] = value;
  25497. };
  25498. CodeMirror.registerGlobalHelper = function(type, name, predicate, value) {
  25499. CodeMirror.registerHelper(type, name, value);
  25500. helpers[type]._global.push({pred: predicate, val: value});
  25501. };
  25502. // MODE STATE HANDLING
  25503. // Utility functions for working with state. Exported because nested
  25504. // modes need to do this for their inner modes.
  25505. var copyState = CodeMirror.copyState = function(mode, state) {
  25506. if (state === true) return state;
  25507. if (mode.copyState) return mode.copyState(state);
  25508. var nstate = {};
  25509. for (var n in state) {
  25510. var val = state[n];
  25511. if (val instanceof Array) val = val.concat([]);
  25512. nstate[n] = val;
  25513. }
  25514. return nstate;
  25515. };
  25516. var startState = CodeMirror.startState = function(mode, a1, a2) {
  25517. return mode.startState ? mode.startState(a1, a2) : true;
  25518. };
  25519. // Given a mode and a state (for that mode), find the inner mode and
  25520. // state at the position that the state refers to.
  25521. CodeMirror.innerMode = function(mode, state) {
  25522. while (mode.innerMode) {
  25523. var info = mode.innerMode(state);
  25524. if (!info || info.mode == mode) break;
  25525. state = info.state;
  25526. mode = info.mode;
  25527. }
  25528. return info || {mode: mode, state: state};
  25529. };
  25530. // STANDARD COMMANDS
  25531. // Commands are parameter-less actions that can be performed on an
  25532. // editor, mostly used for keybindings.
  25533. var commands = CodeMirror.commands = {
  25534. selectAll: function(cm) {cm.setSelection(Pos(cm.firstLine(), 0), Pos(cm.lastLine()), sel_dontScroll);},
  25535. singleSelection: function(cm) {
  25536. cm.setSelection(cm.getCursor("anchor"), cm.getCursor("head"), sel_dontScroll);
  25537. },
  25538. killLine: function(cm) {
  25539. deleteNearSelection(cm, function(range) {
  25540. if (range.empty()) {
  25541. var len = getLine(cm.doc, range.head.line).text.length;
  25542. if (range.head.ch == len && range.head.line < cm.lastLine())
  25543. return {from: range.head, to: Pos(range.head.line + 1, 0)};
  25544. else
  25545. return {from: range.head, to: Pos(range.head.line, len)};
  25546. } else {
  25547. return {from: range.from(), to: range.to()};
  25548. }
  25549. });
  25550. },
  25551. deleteLine: function(cm) {
  25552. deleteNearSelection(cm, function(range) {
  25553. return {from: Pos(range.from().line, 0),
  25554. to: clipPos(cm.doc, Pos(range.to().line + 1, 0))};
  25555. });
  25556. },
  25557. delLineLeft: function(cm) {
  25558. deleteNearSelection(cm, function(range) {
  25559. return {from: Pos(range.from().line, 0), to: range.from()};
  25560. });
  25561. },
  25562. delWrappedLineLeft: function(cm) {
  25563. deleteNearSelection(cm, function(range) {
  25564. var top = cm.charCoords(range.head, "div").top + 5;
  25565. var leftPos = cm.coordsChar({left: 0, top: top}, "div");
  25566. return {from: leftPos, to: range.from()};
  25567. });
  25568. },
  25569. delWrappedLineRight: function(cm) {
  25570. deleteNearSelection(cm, function(range) {
  25571. var top = cm.charCoords(range.head, "div").top + 5;
  25572. var rightPos = cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, "div");
  25573. return {from: range.from(), to: rightPos };
  25574. });
  25575. },
  25576. undo: function(cm) {cm.undo();},
  25577. redo: function(cm) {cm.redo();},
  25578. undoSelection: function(cm) {cm.undoSelection();},
  25579. redoSelection: function(cm) {cm.redoSelection();},
  25580. goDocStart: function(cm) {cm.extendSelection(Pos(cm.firstLine(), 0));},
  25581. goDocEnd: function(cm) {cm.extendSelection(Pos(cm.lastLine()));},
  25582. goLineStart: function(cm) {
  25583. cm.extendSelectionsBy(function(range) { return lineStart(cm, range.head.line); },
  25584. {origin: "+move", bias: 1});
  25585. },
  25586. goLineStartSmart: function(cm) {
  25587. cm.extendSelectionsBy(function(range) {
  25588. return lineStartSmart(cm, range.head);
  25589. }, {origin: "+move", bias: 1});
  25590. },
  25591. goLineEnd: function(cm) {
  25592. cm.extendSelectionsBy(function(range) { return lineEnd(cm, range.head.line); },
  25593. {origin: "+move", bias: -1});
  25594. },
  25595. goLineRight: function(cm) {
  25596. cm.extendSelectionsBy(function(range) {
  25597. var top = cm.charCoords(range.head, "div").top + 5;
  25598. return cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, "div");
  25599. }, sel_move);
  25600. },
  25601. goLineLeft: function(cm) {
  25602. cm.extendSelectionsBy(function(range) {
  25603. var top = cm.charCoords(range.head, "div").top + 5;
  25604. return cm.coordsChar({left: 0, top: top}, "div");
  25605. }, sel_move);
  25606. },
  25607. goLineLeftSmart: function(cm) {
  25608. cm.extendSelectionsBy(function(range) {
  25609. var top = cm.charCoords(range.head, "div").top + 5;
  25610. var pos = cm.coordsChar({left: 0, top: top}, "div");
  25611. if (pos.ch < cm.getLine(pos.line).search(/\S/)) return lineStartSmart(cm, range.head);
  25612. return pos;
  25613. }, sel_move);
  25614. },
  25615. goLineUp: function(cm) {cm.moveV(-1, "line");},
  25616. goLineDown: function(cm) {cm.moveV(1, "line");},
  25617. goPageUp: function(cm) {cm.moveV(-1, "page");},
  25618. goPageDown: function(cm) {cm.moveV(1, "page");},
  25619. goCharLeft: function(cm) {cm.moveH(-1, "char");},
  25620. goCharRight: function(cm) {cm.moveH(1, "char");},
  25621. goColumnLeft: function(cm) {cm.moveH(-1, "column");},
  25622. goColumnRight: function(cm) {cm.moveH(1, "column");},
  25623. goWordLeft: function(cm) {cm.moveH(-1, "word");},
  25624. goGroupRight: function(cm) {cm.moveH(1, "group");},
  25625. goGroupLeft: function(cm) {cm.moveH(-1, "group");},
  25626. goWordRight: function(cm) {cm.moveH(1, "word");},
  25627. delCharBefore: function(cm) {cm.deleteH(-1, "char");},
  25628. delCharAfter: function(cm) {cm.deleteH(1, "char");},
  25629. delWordBefore: function(cm) {cm.deleteH(-1, "word");},
  25630. delWordAfter: function(cm) {cm.deleteH(1, "word");},
  25631. delGroupBefore: function(cm) {cm.deleteH(-1, "group");},
  25632. delGroupAfter: function(cm) {cm.deleteH(1, "group");},
  25633. indentAuto: function(cm) {cm.indentSelection("smart");},
  25634. indentMore: function(cm) {cm.indentSelection("add");},
  25635. indentLess: function(cm) {cm.indentSelection("subtract");},
  25636. insertTab: function(cm) {cm.replaceSelection("\t");},
  25637. insertSoftTab: function(cm) {
  25638. var spaces = [], ranges = cm.listSelections(), tabSize = cm.options.tabSize;
  25639. for (var i = 0; i < ranges.length; i++) {
  25640. var pos = ranges[i].from();
  25641. var col = countColumn(cm.getLine(pos.line), pos.ch, tabSize);
  25642. spaces.push(spaceStr(tabSize - col % tabSize));
  25643. }
  25644. cm.replaceSelections(spaces);
  25645. },
  25646. defaultTab: function(cm) {
  25647. if (cm.somethingSelected()) cm.indentSelection("add");
  25648. else cm.execCommand("insertTab");
  25649. },
  25650. transposeChars: function(cm) {
  25651. runInOp(cm, function() {
  25652. var ranges = cm.listSelections(), newSel = [];
  25653. for (var i = 0; i < ranges.length; i++) {
  25654. var cur = ranges[i].head, line = getLine(cm.doc, cur.line).text;
  25655. if (line) {
  25656. if (cur.ch == line.length) cur = new Pos(cur.line, cur.ch - 1);
  25657. if (cur.ch > 0) {
  25658. cur = new Pos(cur.line, cur.ch + 1);
  25659. cm.replaceRange(line.charAt(cur.ch - 1) + line.charAt(cur.ch - 2),
  25660. Pos(cur.line, cur.ch - 2), cur, "+transpose");
  25661. } else if (cur.line > cm.doc.first) {
  25662. var prev = getLine(cm.doc, cur.line - 1).text;
  25663. if (prev)
  25664. cm.replaceRange(line.charAt(0) + cm.doc.lineSeparator() +
  25665. prev.charAt(prev.length - 1),
  25666. Pos(cur.line - 1, prev.length - 1), Pos(cur.line, 1), "+transpose");
  25667. }
  25668. }
  25669. newSel.push(new Range(cur, cur));
  25670. }
  25671. cm.setSelections(newSel);
  25672. });
  25673. },
  25674. newlineAndIndent: function(cm) {
  25675. runInOp(cm, function() {
  25676. var len = cm.listSelections().length;
  25677. for (var i = 0; i < len; i++) {
  25678. var range = cm.listSelections()[i];
  25679. cm.replaceRange(cm.doc.lineSeparator(), range.anchor, range.head, "+input");
  25680. cm.indentLine(range.from().line + 1, null, true);
  25681. }
  25682. ensureCursorVisible(cm);
  25683. });
  25684. },
  25685. openLine: function(cm) {cm.replaceSelection("\n", "start")},
  25686. toggleOverwrite: function(cm) {cm.toggleOverwrite();}
  25687. };
  25688. // STANDARD KEYMAPS
  25689. var keyMap = CodeMirror.keyMap = {};
  25690. keyMap.basic = {
  25691. "Left": "goCharLeft", "Right": "goCharRight", "Up": "goLineUp", "Down": "goLineDown",
  25692. "End": "goLineEnd", "Home": "goLineStartSmart", "PageUp": "goPageUp", "PageDown": "goPageDown",
  25693. "Delete": "delCharAfter", "Backspace": "delCharBefore", "Shift-Backspace": "delCharBefore",
  25694. "Tab": "defaultTab", "Shift-Tab": "indentAuto",
  25695. "Enter": "newlineAndIndent", "Insert": "toggleOverwrite",
  25696. "Esc": "singleSelection"
  25697. };
  25698. // Note that the save and find-related commands aren't defined by
  25699. // default. User code or addons can define them. Unknown commands
  25700. // are simply ignored.
  25701. keyMap.pcDefault = {
  25702. "Ctrl-A": "selectAll", "Ctrl-D": "deleteLine", "Ctrl-Z": "undo", "Shift-Ctrl-Z": "redo", "Ctrl-Y": "redo",
  25703. "Ctrl-Home": "goDocStart", "Ctrl-End": "goDocEnd", "Ctrl-Up": "goLineUp", "Ctrl-Down": "goLineDown",
  25704. "Ctrl-Left": "goGroupLeft", "Ctrl-Right": "goGroupRight", "Alt-Left": "goLineStart", "Alt-Right": "goLineEnd",
  25705. "Ctrl-Backspace": "delGroupBefore", "Ctrl-Delete": "delGroupAfter", "Ctrl-S": "save", "Ctrl-F": "find",
  25706. "Ctrl-G": "findNext", "Shift-Ctrl-G": "findPrev", "Shift-Ctrl-F": "replace", "Shift-Ctrl-R": "replaceAll",
  25707. "Ctrl-[": "indentLess", "Ctrl-]": "indentMore",
  25708. "Ctrl-U": "undoSelection", "Shift-Ctrl-U": "redoSelection", "Alt-U": "redoSelection",
  25709. fallthrough: "basic"
  25710. };
  25711. // Very basic readline/emacs-style bindings, which are standard on Mac.
  25712. keyMap.emacsy = {
  25713. "Ctrl-F": "goCharRight", "Ctrl-B": "goCharLeft", "Ctrl-P": "goLineUp", "Ctrl-N": "goLineDown",
  25714. "Alt-F": "goWordRight", "Alt-B": "goWordLeft", "Ctrl-A": "goLineStart", "Ctrl-E": "goLineEnd",
  25715. "Ctrl-V": "goPageDown", "Shift-Ctrl-V": "goPageUp", "Ctrl-D": "delCharAfter", "Ctrl-H": "delCharBefore",
  25716. "Alt-D": "delWordAfter", "Alt-Backspace": "delWordBefore", "Ctrl-K": "killLine", "Ctrl-T": "transposeChars",
  25717. "Ctrl-O": "openLine"
  25718. };
  25719. keyMap.macDefault = {
  25720. "Cmd-A": "selectAll", "Cmd-D": "deleteLine", "Cmd-Z": "undo", "Shift-Cmd-Z": "redo", "Cmd-Y": "redo",
  25721. "Cmd-Home": "goDocStart", "Cmd-Up": "goDocStart", "Cmd-End": "goDocEnd", "Cmd-Down": "goDocEnd", "Alt-Left": "goGroupLeft",
  25722. "Alt-Right": "goGroupRight", "Cmd-Left": "goLineLeft", "Cmd-Right": "goLineRight", "Alt-Backspace": "delGroupBefore",
  25723. "Ctrl-Alt-Backspace": "delGroupAfter", "Alt-Delete": "delGroupAfter", "Cmd-S": "save", "Cmd-F": "find",
  25724. "Cmd-G": "findNext", "Shift-Cmd-G": "findPrev", "Cmd-Alt-F": "replace", "Shift-Cmd-Alt-F": "replaceAll",
  25725. "Cmd-[": "indentLess", "Cmd-]": "indentMore", "Cmd-Backspace": "delWrappedLineLeft", "Cmd-Delete": "delWrappedLineRight",
  25726. "Cmd-U": "undoSelection", "Shift-Cmd-U": "redoSelection", "Ctrl-Up": "goDocStart", "Ctrl-Down": "goDocEnd",
  25727. fallthrough: ["basic", "emacsy"]
  25728. };
  25729. keyMap["default"] = mac ? keyMap.macDefault : keyMap.pcDefault;
  25730. // KEYMAP DISPATCH
  25731. function normalizeKeyName(name) {
  25732. var parts = name.split(/-(?!$)/), name = parts[parts.length - 1];
  25733. var alt, ctrl, shift, cmd;
  25734. for (var i = 0; i < parts.length - 1; i++) {
  25735. var mod = parts[i];
  25736. if (/^(cmd|meta|m)$/i.test(mod)) cmd = true;
  25737. else if (/^a(lt)?$/i.test(mod)) alt = true;
  25738. else if (/^(c|ctrl|control)$/i.test(mod)) ctrl = true;
  25739. else if (/^s(hift)$/i.test(mod)) shift = true;
  25740. else throw new Error("Unrecognized modifier name: " + mod);
  25741. }
  25742. if (alt) name = "Alt-" + name;
  25743. if (ctrl) name = "Ctrl-" + name;
  25744. if (cmd) name = "Cmd-" + name;
  25745. if (shift) name = "Shift-" + name;
  25746. return name;
  25747. }
  25748. // This is a kludge to keep keymaps mostly working as raw objects
  25749. // (backwards compatibility) while at the same time support features
  25750. // like normalization and multi-stroke key bindings. It compiles a
  25751. // new normalized keymap, and then updates the old object to reflect
  25752. // this.
  25753. CodeMirror.normalizeKeyMap = function(keymap) {
  25754. var copy = {};
  25755. for (var keyname in keymap) if (keymap.hasOwnProperty(keyname)) {
  25756. var value = keymap[keyname];
  25757. if (/^(name|fallthrough|(de|at)tach)$/.test(keyname)) continue;
  25758. if (value == "...") { delete keymap[keyname]; continue; }
  25759. var keys = map(keyname.split(" "), normalizeKeyName);
  25760. for (var i = 0; i < keys.length; i++) {
  25761. var val, name;
  25762. if (i == keys.length - 1) {
  25763. name = keys.join(" ");
  25764. val = value;
  25765. } else {
  25766. name = keys.slice(0, i + 1).join(" ");
  25767. val = "...";
  25768. }
  25769. var prev = copy[name];
  25770. if (!prev) copy[name] = val;
  25771. else if (prev != val) throw new Error("Inconsistent bindings for " + name);
  25772. }
  25773. delete keymap[keyname];
  25774. }
  25775. for (var prop in copy) keymap[prop] = copy[prop];
  25776. return keymap;
  25777. };
  25778. var lookupKey = CodeMirror.lookupKey = function(key, map, handle, context) {
  25779. map = getKeyMap(map);
  25780. var found = map.call ? map.call(key, context) : map[key];
  25781. if (found === false) return "nothing";
  25782. if (found === "...") return "multi";
  25783. if (found != null && handle(found)) return "handled";
  25784. if (map.fallthrough) {
  25785. if (Object.prototype.toString.call(map.fallthrough) != "[object Array]")
  25786. return lookupKey(key, map.fallthrough, handle, context);
  25787. for (var i = 0; i < map.fallthrough.length; i++) {
  25788. var result = lookupKey(key, map.fallthrough[i], handle, context);
  25789. if (result) return result;
  25790. }
  25791. }
  25792. };
  25793. // Modifier key presses don't count as 'real' key presses for the
  25794. // purpose of keymap fallthrough.
  25795. var isModifierKey = CodeMirror.isModifierKey = function(value) {
  25796. var name = typeof value == "string" ? value : keyNames[value.keyCode];
  25797. return name == "Ctrl" || name == "Alt" || name == "Shift" || name == "Mod";
  25798. };
  25799. // Look up the name of a key as indicated by an event object.
  25800. var keyName = CodeMirror.keyName = function(event, noShift) {
  25801. if (presto && event.keyCode == 34 && event["char"]) return false;
  25802. var base = keyNames[event.keyCode], name = base;
  25803. if (name == null || event.altGraphKey) return false;
  25804. if (event.altKey && base != "Alt") name = "Alt-" + name;
  25805. if ((flipCtrlCmd ? event.metaKey : event.ctrlKey) && base != "Ctrl") name = "Ctrl-" + name;
  25806. if ((flipCtrlCmd ? event.ctrlKey : event.metaKey) && base != "Cmd") name = "Cmd-" + name;
  25807. if (!noShift && event.shiftKey && base != "Shift") name = "Shift-" + name;
  25808. return name;
  25809. };
  25810. function getKeyMap(val) {
  25811. return typeof val == "string" ? keyMap[val] : val;
  25812. }
  25813. // FROMTEXTAREA
  25814. CodeMirror.fromTextArea = function(textarea, options) {
  25815. options = options ? copyObj(options) : {};
  25816. options.value = textarea.value;
  25817. if (!options.tabindex && textarea.tabIndex)
  25818. options.tabindex = textarea.tabIndex;
  25819. if (!options.placeholder && textarea.placeholder)
  25820. options.placeholder = textarea.placeholder;
  25821. // Set autofocus to true if this textarea is focused, or if it has
  25822. // autofocus and no other element is focused.
  25823. if (options.autofocus == null) {
  25824. var hasFocus = activeElt();
  25825. options.autofocus = hasFocus == textarea ||
  25826. textarea.getAttribute("autofocus") != null && hasFocus == document.body;
  25827. }
  25828. function save() {textarea.value = cm.getValue();}
  25829. if (textarea.form) {
  25830. on(textarea.form, "submit", save);
  25831. // Deplorable hack to make the submit method do the right thing.
  25832. if (!options.leaveSubmitMethodAlone) {
  25833. var form = textarea.form, realSubmit = form.submit;
  25834. try {
  25835. var wrappedSubmit = form.submit = function() {
  25836. save();
  25837. form.submit = realSubmit;
  25838. form.submit();
  25839. form.submit = wrappedSubmit;
  25840. };
  25841. } catch(e) {}
  25842. }
  25843. }
  25844. options.finishInit = function(cm) {
  25845. cm.save = save;
  25846. cm.getTextArea = function() { return textarea; };
  25847. cm.toTextArea = function() {
  25848. cm.toTextArea = isNaN; // Prevent this from being ran twice
  25849. save();
  25850. textarea.parentNode.removeChild(cm.getWrapperElement());
  25851. textarea.style.display = "";
  25852. if (textarea.form) {
  25853. off(textarea.form, "submit", save);
  25854. if (typeof textarea.form.submit == "function")
  25855. textarea.form.submit = realSubmit;
  25856. }
  25857. };
  25858. };
  25859. textarea.style.display = "none";
  25860. var cm = CodeMirror(function(node) {
  25861. textarea.parentNode.insertBefore(node, textarea.nextSibling);
  25862. }, options);
  25863. return cm;
  25864. };
  25865. // STRING STREAM
  25866. // Fed to the mode parsers, provides helper functions to make
  25867. // parsers more succinct.
  25868. var StringStream = CodeMirror.StringStream = function(string, tabSize) {
  25869. this.pos = this.start = 0;
  25870. this.string = string;
  25871. this.tabSize = tabSize || 8;
  25872. this.lastColumnPos = this.lastColumnValue = 0;
  25873. this.lineStart = 0;
  25874. };
  25875. StringStream.prototype = {
  25876. eol: function() {return this.pos >= this.string.length;},
  25877. sol: function() {return this.pos == this.lineStart;},
  25878. peek: function() {return this.string.charAt(this.pos) || undefined;},
  25879. next: function() {
  25880. if (this.pos < this.string.length)
  25881. return this.string.charAt(this.pos++);
  25882. },
  25883. eat: function(match) {
  25884. var ch = this.string.charAt(this.pos);
  25885. if (typeof match == "string") var ok = ch == match;
  25886. else var ok = ch && (match.test ? match.test(ch) : match(ch));
  25887. if (ok) {++this.pos; return ch;}
  25888. },
  25889. eatWhile: function(match) {
  25890. var start = this.pos;
  25891. while (this.eat(match)){}
  25892. return this.pos > start;
  25893. },
  25894. eatSpace: function() {
  25895. var start = this.pos;
  25896. while (/[\s\u00a0]/.test(this.string.charAt(this.pos))) ++this.pos;
  25897. return this.pos > start;
  25898. },
  25899. skipToEnd: function() {this.pos = this.string.length;},
  25900. skipTo: function(ch) {
  25901. var found = this.string.indexOf(ch, this.pos);
  25902. if (found > -1) {this.pos = found; return true;}
  25903. },
  25904. backUp: function(n) {this.pos -= n;},
  25905. column: function() {
  25906. if (this.lastColumnPos < this.start) {
  25907. this.lastColumnValue = countColumn(this.string, this.start, this.tabSize, this.lastColumnPos, this.lastColumnValue);
  25908. this.lastColumnPos = this.start;
  25909. }
  25910. return this.lastColumnValue - (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0);
  25911. },
  25912. indentation: function() {
  25913. return countColumn(this.string, null, this.tabSize) -
  25914. (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0);
  25915. },
  25916. match: function(pattern, consume, caseInsensitive) {
  25917. if (typeof pattern == "string") {
  25918. var cased = function(str) {return caseInsensitive ? str.toLowerCase() : str;};
  25919. var substr = this.string.substr(this.pos, pattern.length);
  25920. if (cased(substr) == cased(pattern)) {
  25921. if (consume !== false) this.pos += pattern.length;
  25922. return true;
  25923. }
  25924. } else {
  25925. var match = this.string.slice(this.pos).match(pattern);
  25926. if (match && match.index > 0) return null;
  25927. if (match && consume !== false) this.pos += match[0].length;
  25928. return match;
  25929. }
  25930. },
  25931. current: function(){return this.string.slice(this.start, this.pos);},
  25932. hideFirstChars: function(n, inner) {
  25933. this.lineStart += n;
  25934. try { return inner(); }
  25935. finally { this.lineStart -= n; }
  25936. }
  25937. };
  25938. // TEXTMARKERS
  25939. // Created with markText and setBookmark methods. A TextMarker is a
  25940. // handle that can be used to clear or find a marked position in the
  25941. // document. Line objects hold arrays (markedSpans) containing
  25942. // {from, to, marker} object pointing to such marker objects, and
  25943. // indicating that such a marker is present on that line. Multiple
  25944. // lines may point to the same marker when it spans across lines.
  25945. // The spans will have null for their from/to properties when the
  25946. // marker continues beyond the start/end of the line. Markers have
  25947. // links back to the lines they currently touch.
  25948. var nextMarkerId = 0;
  25949. var TextMarker = CodeMirror.TextMarker = function(doc, type) {
  25950. this.lines = [];
  25951. this.type = type;
  25952. this.doc = doc;
  25953. this.id = ++nextMarkerId;
  25954. };
  25955. eventMixin(TextMarker);
  25956. // Clear the marker.
  25957. TextMarker.prototype.clear = function() {
  25958. if (this.explicitlyCleared) return;
  25959. var cm = this.doc.cm, withOp = cm && !cm.curOp;
  25960. if (withOp) startOperation(cm);
  25961. if (hasHandler(this, "clear")) {
  25962. var found = this.find();
  25963. if (found) signalLater(this, "clear", found.from, found.to);
  25964. }
  25965. var min = null, max = null;
  25966. for (var i = 0; i < this.lines.length; ++i) {
  25967. var line = this.lines[i];
  25968. var span = getMarkedSpanFor(line.markedSpans, this);
  25969. if (cm && !this.collapsed) regLineChange(cm, lineNo(line), "text");
  25970. else if (cm) {
  25971. if (span.to != null) max = lineNo(line);
  25972. if (span.from != null) min = lineNo(line);
  25973. }
  25974. line.markedSpans = removeMarkedSpan(line.markedSpans, span);
  25975. if (span.from == null && this.collapsed && !lineIsHidden(this.doc, line) && cm)
  25976. updateLineHeight(line, textHeight(cm.display));
  25977. }
  25978. if (cm && this.collapsed && !cm.options.lineWrapping) for (var i = 0; i < this.lines.length; ++i) {
  25979. var visual = visualLine(this.lines[i]), len = lineLength(visual);
  25980. if (len > cm.display.maxLineLength) {
  25981. cm.display.maxLine = visual;
  25982. cm.display.maxLineLength = len;
  25983. cm.display.maxLineChanged = true;
  25984. }
  25985. }
  25986. if (min != null && cm && this.collapsed) regChange(cm, min, max + 1);
  25987. this.lines.length = 0;
  25988. this.explicitlyCleared = true;
  25989. if (this.atomic && this.doc.cantEdit) {
  25990. this.doc.cantEdit = false;
  25991. if (cm) reCheckSelection(cm.doc);
  25992. }
  25993. if (cm) signalLater(cm, "markerCleared", cm, this);
  25994. if (withOp) endOperation(cm);
  25995. if (this.parent) this.parent.clear();
  25996. };
  25997. // Find the position of the marker in the document. Returns a {from,
  25998. // to} object by default. Side can be passed to get a specific side
  25999. // -- 0 (both), -1 (left), or 1 (right). When lineObj is true, the
  26000. // Pos objects returned contain a line object, rather than a line
  26001. // number (used to prevent looking up the same line twice).
  26002. TextMarker.prototype.find = function(side, lineObj) {
  26003. if (side == null && this.type == "bookmark") side = 1;
  26004. var from, to;
  26005. for (var i = 0; i < this.lines.length; ++i) {
  26006. var line = this.lines[i];
  26007. var span = getMarkedSpanFor(line.markedSpans, this);
  26008. if (span.from != null) {
  26009. from = Pos(lineObj ? line : lineNo(line), span.from);
  26010. if (side == -1) return from;
  26011. }
  26012. if (span.to != null) {
  26013. to = Pos(lineObj ? line : lineNo(line), span.to);
  26014. if (side == 1) return to;
  26015. }
  26016. }
  26017. return from && {from: from, to: to};
  26018. };
  26019. // Signals that the marker's widget changed, and surrounding layout
  26020. // should be recomputed.
  26021. TextMarker.prototype.changed = function() {
  26022. var pos = this.find(-1, true), widget = this, cm = this.doc.cm;
  26023. if (!pos || !cm) return;
  26024. runInOp(cm, function() {
  26025. var line = pos.line, lineN = lineNo(pos.line);
  26026. var view = findViewForLine(cm, lineN);
  26027. if (view) {
  26028. clearLineMeasurementCacheFor(view);
  26029. cm.curOp.selectionChanged = cm.curOp.forceUpdate = true;
  26030. }
  26031. cm.curOp.updateMaxLine = true;
  26032. if (!lineIsHidden(widget.doc, line) && widget.height != null) {
  26033. var oldHeight = widget.height;
  26034. widget.height = null;
  26035. var dHeight = widgetHeight(widget) - oldHeight;
  26036. if (dHeight)
  26037. updateLineHeight(line, line.height + dHeight);
  26038. }
  26039. });
  26040. };
  26041. TextMarker.prototype.attachLine = function(line) {
  26042. if (!this.lines.length && this.doc.cm) {
  26043. var op = this.doc.cm.curOp;
  26044. if (!op.maybeHiddenMarkers || indexOf(op.maybeHiddenMarkers, this) == -1)
  26045. (op.maybeUnhiddenMarkers || (op.maybeUnhiddenMarkers = [])).push(this);
  26046. }
  26047. this.lines.push(line);
  26048. };
  26049. TextMarker.prototype.detachLine = function(line) {
  26050. this.lines.splice(indexOf(this.lines, line), 1);
  26051. if (!this.lines.length && this.doc.cm) {
  26052. var op = this.doc.cm.curOp;
  26053. (op.maybeHiddenMarkers || (op.maybeHiddenMarkers = [])).push(this);
  26054. }
  26055. };
  26056. // Collapsed markers have unique ids, in order to be able to order
  26057. // them, which is needed for uniquely determining an outer marker
  26058. // when they overlap (they may nest, but not partially overlap).
  26059. var nextMarkerId = 0;
  26060. // Create a marker, wire it up to the right lines, and
  26061. function markText(doc, from, to, options, type) {
  26062. // Shared markers (across linked documents) are handled separately
  26063. // (markTextShared will call out to this again, once per
  26064. // document).
  26065. if (options && options.shared) return markTextShared(doc, from, to, options, type);
  26066. // Ensure we are in an operation.
  26067. if (doc.cm && !doc.cm.curOp) return operation(doc.cm, markText)(doc, from, to, options, type);
  26068. var marker = new TextMarker(doc, type), diff = cmp(from, to);
  26069. if (options) copyObj(options, marker, false);
  26070. // Don't connect empty markers unless clearWhenEmpty is false
  26071. if (diff > 0 || diff == 0 && marker.clearWhenEmpty !== false)
  26072. return marker;
  26073. if (marker.replacedWith) {
  26074. // Showing up as a widget implies collapsed (widget replaces text)
  26075. marker.collapsed = true;
  26076. marker.widgetNode = elt("span", [marker.replacedWith], "CodeMirror-widget");
  26077. if (!options.handleMouseEvents) marker.widgetNode.setAttribute("cm-ignore-events", "true");
  26078. if (options.insertLeft) marker.widgetNode.insertLeft = true;
  26079. }
  26080. if (marker.collapsed) {
  26081. if (conflictingCollapsedRange(doc, from.line, from, to, marker) ||
  26082. from.line != to.line && conflictingCollapsedRange(doc, to.line, from, to, marker))
  26083. throw new Error("Inserting collapsed marker partially overlapping an existing one");
  26084. sawCollapsedSpans = true;
  26085. }
  26086. if (marker.addToHistory)
  26087. addChangeToHistory(doc, {from: from, to: to, origin: "markText"}, doc.sel, NaN);
  26088. var curLine = from.line, cm = doc.cm, updateMaxLine;
  26089. doc.iter(curLine, to.line + 1, function(line) {
  26090. if (cm && marker.collapsed && !cm.options.lineWrapping && visualLine(line) == cm.display.maxLine)
  26091. updateMaxLine = true;
  26092. if (marker.collapsed && curLine != from.line) updateLineHeight(line, 0);
  26093. addMarkedSpan(line, new MarkedSpan(marker,
  26094. curLine == from.line ? from.ch : null,
  26095. curLine == to.line ? to.ch : null));
  26096. ++curLine;
  26097. });
  26098. // lineIsHidden depends on the presence of the spans, so needs a second pass
  26099. if (marker.collapsed) doc.iter(from.line, to.line + 1, function(line) {
  26100. if (lineIsHidden(doc, line)) updateLineHeight(line, 0);
  26101. });
  26102. if (marker.clearOnEnter) on(marker, "beforeCursorEnter", function() { marker.clear(); });
  26103. if (marker.readOnly) {
  26104. sawReadOnlySpans = true;
  26105. if (doc.history.done.length || doc.history.undone.length)
  26106. doc.clearHistory();
  26107. }
  26108. if (marker.collapsed) {
  26109. marker.id = ++nextMarkerId;
  26110. marker.atomic = true;
  26111. }
  26112. if (cm) {
  26113. // Sync editor state
  26114. if (updateMaxLine) cm.curOp.updateMaxLine = true;
  26115. if (marker.collapsed)
  26116. regChange(cm, from.line, to.line + 1);
  26117. else if (marker.className || marker.title || marker.startStyle || marker.endStyle || marker.css)
  26118. for (var i = from.line; i <= to.line; i++) regLineChange(cm, i, "text");
  26119. if (marker.atomic) reCheckSelection(cm.doc);
  26120. signalLater(cm, "markerAdded", cm, marker);
  26121. }
  26122. return marker;
  26123. }
  26124. // SHARED TEXTMARKERS
  26125. // A shared marker spans multiple linked documents. It is
  26126. // implemented as a meta-marker-object controlling multiple normal
  26127. // markers.
  26128. var SharedTextMarker = CodeMirror.SharedTextMarker = function(markers, primary) {
  26129. this.markers = markers;
  26130. this.primary = primary;
  26131. for (var i = 0; i < markers.length; ++i)
  26132. markers[i].parent = this;
  26133. };
  26134. eventMixin(SharedTextMarker);
  26135. SharedTextMarker.prototype.clear = function() {
  26136. if (this.explicitlyCleared) return;
  26137. this.explicitlyCleared = true;
  26138. for (var i = 0; i < this.markers.length; ++i)
  26139. this.markers[i].clear();
  26140. signalLater(this, "clear");
  26141. };
  26142. SharedTextMarker.prototype.find = function(side, lineObj) {
  26143. return this.primary.find(side, lineObj);
  26144. };
  26145. function markTextShared(doc, from, to, options, type) {
  26146. options = copyObj(options);
  26147. options.shared = false;
  26148. var markers = [markText(doc, from, to, options, type)], primary = markers[0];
  26149. var widget = options.widgetNode;
  26150. linkedDocs(doc, function(doc) {
  26151. if (widget) options.widgetNode = widget.cloneNode(true);
  26152. markers.push(markText(doc, clipPos(doc, from), clipPos(doc, to), options, type));
  26153. for (var i = 0; i < doc.linked.length; ++i)
  26154. if (doc.linked[i].isParent) return;
  26155. primary = lst(markers);
  26156. });
  26157. return new SharedTextMarker(markers, primary);
  26158. }
  26159. function findSharedMarkers(doc) {
  26160. return doc.findMarks(Pos(doc.first, 0), doc.clipPos(Pos(doc.lastLine())),
  26161. function(m) { return m.parent; });
  26162. }
  26163. function copySharedMarkers(doc, markers) {
  26164. for (var i = 0; i < markers.length; i++) {
  26165. var marker = markers[i], pos = marker.find();
  26166. var mFrom = doc.clipPos(pos.from), mTo = doc.clipPos(pos.to);
  26167. if (cmp(mFrom, mTo)) {
  26168. var subMark = markText(doc, mFrom, mTo, marker.primary, marker.primary.type);
  26169. marker.markers.push(subMark);
  26170. subMark.parent = marker;
  26171. }
  26172. }
  26173. }
  26174. function detachSharedMarkers(markers) {
  26175. for (var i = 0; i < markers.length; i++) {
  26176. var marker = markers[i], linked = [marker.primary.doc];;
  26177. linkedDocs(marker.primary.doc, function(d) { linked.push(d); });
  26178. for (var j = 0; j < marker.markers.length; j++) {
  26179. var subMarker = marker.markers[j];
  26180. if (indexOf(linked, subMarker.doc) == -1) {
  26181. subMarker.parent = null;
  26182. marker.markers.splice(j--, 1);
  26183. }
  26184. }
  26185. }
  26186. }
  26187. // TEXTMARKER SPANS
  26188. function MarkedSpan(marker, from, to) {
  26189. this.marker = marker;
  26190. this.from = from; this.to = to;
  26191. }
  26192. // Search an array of spans for a span matching the given marker.
  26193. function getMarkedSpanFor(spans, marker) {
  26194. if (spans) for (var i = 0; i < spans.length; ++i) {
  26195. var span = spans[i];
  26196. if (span.marker == marker) return span;
  26197. }
  26198. }
  26199. // Remove a span from an array, returning undefined if no spans are
  26200. // left (we don't store arrays for lines without spans).
  26201. function removeMarkedSpan(spans, span) {
  26202. for (var r, i = 0; i < spans.length; ++i)
  26203. if (spans[i] != span) (r || (r = [])).push(spans[i]);
  26204. return r;
  26205. }
  26206. // Add a span to a line.
  26207. function addMarkedSpan(line, span) {
  26208. line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];
  26209. span.marker.attachLine(line);
  26210. }
  26211. // Used for the algorithm that adjusts markers for a change in the
  26212. // document. These functions cut an array of spans at a given
  26213. // character position, returning an array of remaining chunks (or
  26214. // undefined if nothing remains).
  26215. function markedSpansBefore(old, startCh, isInsert) {
  26216. if (old) for (var i = 0, nw; i < old.length; ++i) {
  26217. var span = old[i], marker = span.marker;
  26218. var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= startCh : span.from < startCh);
  26219. if (startsBefore || span.from == startCh && marker.type == "bookmark" && (!isInsert || !span.marker.insertLeft)) {
  26220. var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= startCh : span.to > startCh);
  26221. (nw || (nw = [])).push(new MarkedSpan(marker, span.from, endsAfter ? null : span.to));
  26222. }
  26223. }
  26224. return nw;
  26225. }
  26226. function markedSpansAfter(old, endCh, isInsert) {
  26227. if (old) for (var i = 0, nw; i < old.length; ++i) {
  26228. var span = old[i], marker = span.marker;
  26229. var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= endCh : span.to > endCh);
  26230. if (endsAfter || span.from == endCh && marker.type == "bookmark" && (!isInsert || span.marker.insertLeft)) {
  26231. var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= endCh : span.from < endCh);
  26232. (nw || (nw = [])).push(new MarkedSpan(marker, startsBefore ? null : span.from - endCh,
  26233. span.to == null ? null : span.to - endCh));
  26234. }
  26235. }
  26236. return nw;
  26237. }
  26238. // Given a change object, compute the new set of marker spans that
  26239. // cover the line in which the change took place. Removes spans
  26240. // entirely within the change, reconnects spans belonging to the
  26241. // same marker that appear on both sides of the change, and cuts off
  26242. // spans partially within the change. Returns an array of span
  26243. // arrays with one element for each line in (after) the change.
  26244. function stretchSpansOverChange(doc, change) {
  26245. if (change.full) return null;
  26246. var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans;
  26247. var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans;
  26248. if (!oldFirst && !oldLast) return null;
  26249. var startCh = change.from.ch, endCh = change.to.ch, isInsert = cmp(change.from, change.to) == 0;
  26250. // Get the spans that 'stick out' on both sides
  26251. var first = markedSpansBefore(oldFirst, startCh, isInsert);
  26252. var last = markedSpansAfter(oldLast, endCh, isInsert);
  26253. // Next, merge those two ends
  26254. var sameLine = change.text.length == 1, offset = lst(change.text).length + (sameLine ? startCh : 0);
  26255. if (first) {
  26256. // Fix up .to properties of first
  26257. for (var i = 0; i < first.length; ++i) {
  26258. var span = first[i];
  26259. if (span.to == null) {
  26260. var found = getMarkedSpanFor(last, span.marker);
  26261. if (!found) span.to = startCh;
  26262. else if (sameLine) span.to = found.to == null ? null : found.to + offset;
  26263. }
  26264. }
  26265. }
  26266. if (last) {
  26267. // Fix up .from in last (or move them into first in case of sameLine)
  26268. for (var i = 0; i < last.length; ++i) {
  26269. var span = last[i];
  26270. if (span.to != null) span.to += offset;
  26271. if (span.from == null) {
  26272. var found = getMarkedSpanFor(first, span.marker);
  26273. if (!found) {
  26274. span.from = offset;
  26275. if (sameLine) (first || (first = [])).push(span);
  26276. }
  26277. } else {
  26278. span.from += offset;
  26279. if (sameLine) (first || (first = [])).push(span);
  26280. }
  26281. }
  26282. }
  26283. // Make sure we didn't create any zero-length spans
  26284. if (first) first = clearEmptySpans(first);
  26285. if (last && last != first) last = clearEmptySpans(last);
  26286. var newMarkers = [first];
  26287. if (!sameLine) {
  26288. // Fill gap with whole-line-spans
  26289. var gap = change.text.length - 2, gapMarkers;
  26290. if (gap > 0 && first)
  26291. for (var i = 0; i < first.length; ++i)
  26292. if (first[i].to == null)
  26293. (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i].marker, null, null));
  26294. for (var i = 0; i < gap; ++i)
  26295. newMarkers.push(gapMarkers);
  26296. newMarkers.push(last);
  26297. }
  26298. return newMarkers;
  26299. }
  26300. // Remove spans that are empty and don't have a clearWhenEmpty
  26301. // option of false.
  26302. function clearEmptySpans(spans) {
  26303. for (var i = 0; i < spans.length; ++i) {
  26304. var span = spans[i];
  26305. if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false)
  26306. spans.splice(i--, 1);
  26307. }
  26308. if (!spans.length) return null;
  26309. return spans;
  26310. }
  26311. // Used for un/re-doing changes from the history. Combines the
  26312. // result of computing the existing spans with the set of spans that
  26313. // existed in the history (so that deleting around a span and then
  26314. // undoing brings back the span).
  26315. function mergeOldSpans(doc, change) {
  26316. var old = getOldSpans(doc, change);
  26317. var stretched = stretchSpansOverChange(doc, change);
  26318. if (!old) return stretched;
  26319. if (!stretched) return old;
  26320. for (var i = 0; i < old.length; ++i) {
  26321. var oldCur = old[i], stretchCur = stretched[i];
  26322. if (oldCur && stretchCur) {
  26323. spans: for (var j = 0; j < stretchCur.length; ++j) {
  26324. var span = stretchCur[j];
  26325. for (var k = 0; k < oldCur.length; ++k)
  26326. if (oldCur[k].marker == span.marker) continue spans;
  26327. oldCur.push(span);
  26328. }
  26329. } else if (stretchCur) {
  26330. old[i] = stretchCur;
  26331. }
  26332. }
  26333. return old;
  26334. }
  26335. // Used to 'clip' out readOnly ranges when making a change.
  26336. function removeReadOnlyRanges(doc, from, to) {
  26337. var markers = null;
  26338. doc.iter(from.line, to.line + 1, function(line) {
  26339. if (line.markedSpans) for (var i = 0; i < line.markedSpans.length; ++i) {
  26340. var mark = line.markedSpans[i].marker;
  26341. if (mark.readOnly && (!markers || indexOf(markers, mark) == -1))
  26342. (markers || (markers = [])).push(mark);
  26343. }
  26344. });
  26345. if (!markers) return null;
  26346. var parts = [{from: from, to: to}];
  26347. for (var i = 0; i < markers.length; ++i) {
  26348. var mk = markers[i], m = mk.find(0);
  26349. for (var j = 0; j < parts.length; ++j) {
  26350. var p = parts[j];
  26351. if (cmp(p.to, m.from) < 0 || cmp(p.from, m.to) > 0) continue;
  26352. var newParts = [j, 1], dfrom = cmp(p.from, m.from), dto = cmp(p.to, m.to);
  26353. if (dfrom < 0 || !mk.inclusiveLeft && !dfrom)
  26354. newParts.push({from: p.from, to: m.from});
  26355. if (dto > 0 || !mk.inclusiveRight && !dto)
  26356. newParts.push({from: m.to, to: p.to});
  26357. parts.splice.apply(parts, newParts);
  26358. j += newParts.length - 1;
  26359. }
  26360. }
  26361. return parts;
  26362. }
  26363. // Connect or disconnect spans from a line.
  26364. function detachMarkedSpans(line) {
  26365. var spans = line.markedSpans;
  26366. if (!spans) return;
  26367. for (var i = 0; i < spans.length; ++i)
  26368. spans[i].marker.detachLine(line);
  26369. line.markedSpans = null;
  26370. }
  26371. function attachMarkedSpans(line, spans) {
  26372. if (!spans) return;
  26373. for (var i = 0; i < spans.length; ++i)
  26374. spans[i].marker.attachLine(line);
  26375. line.markedSpans = spans;
  26376. }
  26377. // Helpers used when computing which overlapping collapsed span
  26378. // counts as the larger one.
  26379. function extraLeft(marker) { return marker.inclusiveLeft ? -1 : 0; }
  26380. function extraRight(marker) { return marker.inclusiveRight ? 1 : 0; }
  26381. // Returns a number indicating which of two overlapping collapsed
  26382. // spans is larger (and thus includes the other). Falls back to
  26383. // comparing ids when the spans cover exactly the same range.
  26384. function compareCollapsedMarkers(a, b) {
  26385. var lenDiff = a.lines.length - b.lines.length;
  26386. if (lenDiff != 0) return lenDiff;
  26387. var aPos = a.find(), bPos = b.find();
  26388. var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);
  26389. if (fromCmp) return -fromCmp;
  26390. var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);
  26391. if (toCmp) return toCmp;
  26392. return b.id - a.id;
  26393. }
  26394. // Find out whether a line ends or starts in a collapsed span. If
  26395. // so, return the marker for that span.
  26396. function collapsedSpanAtSide(line, start) {
  26397. var sps = sawCollapsedSpans && line.markedSpans, found;
  26398. if (sps) for (var sp, i = 0; i < sps.length; ++i) {
  26399. sp = sps[i];
  26400. if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&
  26401. (!found || compareCollapsedMarkers(found, sp.marker) < 0))
  26402. found = sp.marker;
  26403. }
  26404. return found;
  26405. }
  26406. function collapsedSpanAtStart(line) { return collapsedSpanAtSide(line, true); }
  26407. function collapsedSpanAtEnd(line) { return collapsedSpanAtSide(line, false); }
  26408. // Test whether there exists a collapsed span that partially
  26409. // overlaps (covers the start or end, but not both) of a new span.
  26410. // Such overlap is not allowed.
  26411. function conflictingCollapsedRange(doc, lineNo, from, to, marker) {
  26412. var line = getLine(doc, lineNo);
  26413. var sps = sawCollapsedSpans && line.markedSpans;
  26414. if (sps) for (var i = 0; i < sps.length; ++i) {
  26415. var sp = sps[i];
  26416. if (!sp.marker.collapsed) continue;
  26417. var found = sp.marker.find(0);
  26418. var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);
  26419. var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);
  26420. if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) continue;
  26421. if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||
  26422. fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))
  26423. return true;
  26424. }
  26425. }
  26426. // A visual line is a line as drawn on the screen. Folding, for
  26427. // example, can cause multiple logical lines to appear on the same
  26428. // visual line. This finds the start of the visual line that the
  26429. // given line is part of (usually that is the line itself).
  26430. function visualLine(line) {
  26431. var merged;
  26432. while (merged = collapsedSpanAtStart(line))
  26433. line = merged.find(-1, true).line;
  26434. return line;
  26435. }
  26436. // Returns an array of logical lines that continue the visual line
  26437. // started by the argument, or undefined if there are no such lines.
  26438. function visualLineContinued(line) {
  26439. var merged, lines;
  26440. while (merged = collapsedSpanAtEnd(line)) {
  26441. line = merged.find(1, true).line;
  26442. (lines || (lines = [])).push(line);
  26443. }
  26444. return lines;
  26445. }
  26446. // Get the line number of the start of the visual line that the
  26447. // given line number is part of.
  26448. function visualLineNo(doc, lineN) {
  26449. var line = getLine(doc, lineN), vis = visualLine(line);
  26450. if (line == vis) return lineN;
  26451. return lineNo(vis);
  26452. }
  26453. // Get the line number of the start of the next visual line after
  26454. // the given line.
  26455. function visualLineEndNo(doc, lineN) {
  26456. if (lineN > doc.lastLine()) return lineN;
  26457. var line = getLine(doc, lineN), merged;
  26458. if (!lineIsHidden(doc, line)) return lineN;
  26459. while (merged = collapsedSpanAtEnd(line))
  26460. line = merged.find(1, true).line;
  26461. return lineNo(line) + 1;
  26462. }
  26463. // Compute whether a line is hidden. Lines count as hidden when they
  26464. // are part of a visual line that starts with another line, or when
  26465. // they are entirely covered by collapsed, non-widget span.
  26466. function lineIsHidden(doc, line) {
  26467. var sps = sawCollapsedSpans && line.markedSpans;
  26468. if (sps) for (var sp, i = 0; i < sps.length; ++i) {
  26469. sp = sps[i];
  26470. if (!sp.marker.collapsed) continue;
  26471. if (sp.from == null) return true;
  26472. if (sp.marker.widgetNode) continue;
  26473. if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp))
  26474. return true;
  26475. }
  26476. }
  26477. function lineIsHiddenInner(doc, line, span) {
  26478. if (span.to == null) {
  26479. var end = span.marker.find(1, true);
  26480. return lineIsHiddenInner(doc, end.line, getMarkedSpanFor(end.line.markedSpans, span.marker));
  26481. }
  26482. if (span.marker.inclusiveRight && span.to == line.text.length)
  26483. return true;
  26484. for (var sp, i = 0; i < line.markedSpans.length; ++i) {
  26485. sp = line.markedSpans[i];
  26486. if (sp.marker.collapsed && !sp.marker.widgetNode && sp.from == span.to &&
  26487. (sp.to == null || sp.to != span.from) &&
  26488. (sp.marker.inclusiveLeft || span.marker.inclusiveRight) &&
  26489. lineIsHiddenInner(doc, line, sp)) return true;
  26490. }
  26491. }
  26492. // LINE WIDGETS
  26493. // Line widgets are block elements displayed above or below a line.
  26494. var LineWidget = CodeMirror.LineWidget = function(doc, node, options) {
  26495. if (options) for (var opt in options) if (options.hasOwnProperty(opt))
  26496. this[opt] = options[opt];
  26497. this.doc = doc;
  26498. this.node = node;
  26499. };
  26500. eventMixin(LineWidget);
  26501. function adjustScrollWhenAboveVisible(cm, line, diff) {
  26502. if (heightAtLine(line) < ((cm.curOp && cm.curOp.scrollTop) || cm.doc.scrollTop))
  26503. addToScrollPos(cm, null, diff);
  26504. }
  26505. LineWidget.prototype.clear = function() {
  26506. var cm = this.doc.cm, ws = this.line.widgets, line = this.line, no = lineNo(line);
  26507. if (no == null || !ws) return;
  26508. for (var i = 0; i < ws.length; ++i) if (ws[i] == this) ws.splice(i--, 1);
  26509. if (!ws.length) line.widgets = null;
  26510. var height = widgetHeight(this);
  26511. updateLineHeight(line, Math.max(0, line.height - height));
  26512. if (cm) runInOp(cm, function() {
  26513. adjustScrollWhenAboveVisible(cm, line, -height);
  26514. regLineChange(cm, no, "widget");
  26515. });
  26516. };
  26517. LineWidget.prototype.changed = function() {
  26518. var oldH = this.height, cm = this.doc.cm, line = this.line;
  26519. this.height = null;
  26520. var diff = widgetHeight(this) - oldH;
  26521. if (!diff) return;
  26522. updateLineHeight(line, line.height + diff);
  26523. if (cm) runInOp(cm, function() {
  26524. cm.curOp.forceUpdate = true;
  26525. adjustScrollWhenAboveVisible(cm, line, diff);
  26526. });
  26527. };
  26528. function widgetHeight(widget) {
  26529. if (widget.height != null) return widget.height;
  26530. var cm = widget.doc.cm;
  26531. if (!cm) return 0;
  26532. if (!contains(document.body, widget.node)) {
  26533. var parentStyle = "position: relative;";
  26534. if (widget.coverGutter)
  26535. parentStyle += "margin-left: -" + cm.display.gutters.offsetWidth + "px;";
  26536. if (widget.noHScroll)
  26537. parentStyle += "width: " + cm.display.wrapper.clientWidth + "px;";
  26538. removeChildrenAndAdd(cm.display.measure, elt("div", [widget.node], null, parentStyle));
  26539. }
  26540. return widget.height = widget.node.parentNode.offsetHeight;
  26541. }
  26542. function addLineWidget(doc, handle, node, options) {
  26543. var widget = new LineWidget(doc, node, options);
  26544. var cm = doc.cm;
  26545. if (cm && widget.noHScroll) cm.display.alignWidgets = true;
  26546. changeLine(doc, handle, "widget", function(line) {
  26547. var widgets = line.widgets || (line.widgets = []);
  26548. if (widget.insertAt == null) widgets.push(widget);
  26549. else widgets.splice(Math.min(widgets.length - 1, Math.max(0, widget.insertAt)), 0, widget);
  26550. widget.line = line;
  26551. if (cm && !lineIsHidden(doc, line)) {
  26552. var aboveVisible = heightAtLine(line) < doc.scrollTop;
  26553. updateLineHeight(line, line.height + widgetHeight(widget));
  26554. if (aboveVisible) addToScrollPos(cm, null, widget.height);
  26555. cm.curOp.forceUpdate = true;
  26556. }
  26557. return true;
  26558. });
  26559. return widget;
  26560. }
  26561. // LINE DATA STRUCTURE
  26562. // Line objects. These hold state related to a line, including
  26563. // highlighting info (the styles array).
  26564. var Line = CodeMirror.Line = function(text, markedSpans, estimateHeight) {
  26565. this.text = text;
  26566. attachMarkedSpans(this, markedSpans);
  26567. this.height = estimateHeight ? estimateHeight(this) : 1;
  26568. };
  26569. eventMixin(Line);
  26570. Line.prototype.lineNo = function() { return lineNo(this); };
  26571. // Change the content (text, markers) of a line. Automatically
  26572. // invalidates cached information and tries to re-estimate the
  26573. // line's height.
  26574. function updateLine(line, text, markedSpans, estimateHeight) {
  26575. line.text = text;
  26576. if (line.stateAfter) line.stateAfter = null;
  26577. if (line.styles) line.styles = null;
  26578. if (line.order != null) line.order = null;
  26579. detachMarkedSpans(line);
  26580. attachMarkedSpans(line, markedSpans);
  26581. var estHeight = estimateHeight ? estimateHeight(line) : 1;
  26582. if (estHeight != line.height) updateLineHeight(line, estHeight);
  26583. }
  26584. // Detach a line from the document tree and its markers.
  26585. function cleanUpLine(line) {
  26586. line.parent = null;
  26587. detachMarkedSpans(line);
  26588. }
  26589. function extractLineClasses(type, output) {
  26590. if (type) for (;;) {
  26591. var lineClass = type.match(/(?:^|\s+)line-(background-)?(\S+)/);
  26592. if (!lineClass) break;
  26593. type = type.slice(0, lineClass.index) + type.slice(lineClass.index + lineClass[0].length);
  26594. var prop = lineClass[1] ? "bgClass" : "textClass";
  26595. if (output[prop] == null)
  26596. output[prop] = lineClass[2];
  26597. else if (!(new RegExp("(?:^|\s)" + lineClass[2] + "(?:$|\s)")).test(output[prop]))
  26598. output[prop] += " " + lineClass[2];
  26599. }
  26600. return type;
  26601. }
  26602. function callBlankLine(mode, state) {
  26603. if (mode.blankLine) return mode.blankLine(state);
  26604. if (!mode.innerMode) return;
  26605. var inner = CodeMirror.innerMode(mode, state);
  26606. if (inner.mode.blankLine) return inner.mode.blankLine(inner.state);
  26607. }
  26608. function readToken(mode, stream, state, inner) {
  26609. for (var i = 0; i < 10; i++) {
  26610. if (inner) inner[0] = CodeMirror.innerMode(mode, state).mode;
  26611. var style = mode.token(stream, state);
  26612. if (stream.pos > stream.start) return style;
  26613. }
  26614. throw new Error("Mode " + mode.name + " failed to advance stream.");
  26615. }
  26616. // Utility for getTokenAt and getLineTokens
  26617. function takeToken(cm, pos, precise, asArray) {
  26618. function getObj(copy) {
  26619. return {start: stream.start, end: stream.pos,
  26620. string: stream.current(),
  26621. type: style || null,
  26622. state: copy ? copyState(doc.mode, state) : state};
  26623. }
  26624. var doc = cm.doc, mode = doc.mode, style;
  26625. pos = clipPos(doc, pos);
  26626. var line = getLine(doc, pos.line), state = getStateBefore(cm, pos.line, precise);
  26627. var stream = new StringStream(line.text, cm.options.tabSize), tokens;
  26628. if (asArray) tokens = [];
  26629. while ((asArray || stream.pos < pos.ch) && !stream.eol()) {
  26630. stream.start = stream.pos;
  26631. style = readToken(mode, stream, state);
  26632. if (asArray) tokens.push(getObj(true));
  26633. }
  26634. return asArray ? tokens : getObj();
  26635. }
  26636. // Run the given mode's parser over a line, calling f for each token.
  26637. function runMode(cm, text, mode, state, f, lineClasses, forceToEnd) {
  26638. var flattenSpans = mode.flattenSpans;
  26639. if (flattenSpans == null) flattenSpans = cm.options.flattenSpans;
  26640. var curStart = 0, curStyle = null;
  26641. var stream = new StringStream(text, cm.options.tabSize), style;
  26642. var inner = cm.options.addModeClass && [null];
  26643. if (text == "") extractLineClasses(callBlankLine(mode, state), lineClasses);
  26644. while (!stream.eol()) {
  26645. if (stream.pos > cm.options.maxHighlightLength) {
  26646. flattenSpans = false;
  26647. if (forceToEnd) processLine(cm, text, state, stream.pos);
  26648. stream.pos = text.length;
  26649. style = null;
  26650. } else {
  26651. style = extractLineClasses(readToken(mode, stream, state, inner), lineClasses);
  26652. }
  26653. if (inner) {
  26654. var mName = inner[0].name;
  26655. if (mName) style = "m-" + (style ? mName + " " + style : mName);
  26656. }
  26657. if (!flattenSpans || curStyle != style) {
  26658. while (curStart < stream.start) {
  26659. curStart = Math.min(stream.start, curStart + 50000);
  26660. f(curStart, curStyle);
  26661. }
  26662. curStyle = style;
  26663. }
  26664. stream.start = stream.pos;
  26665. }
  26666. while (curStart < stream.pos) {
  26667. // Webkit seems to refuse to render text nodes longer than 57444 characters
  26668. var pos = Math.min(stream.pos, curStart + 50000);
  26669. f(pos, curStyle);
  26670. curStart = pos;
  26671. }
  26672. }
  26673. // Compute a style array (an array starting with a mode generation
  26674. // -- for invalidation -- followed by pairs of end positions and
  26675. // style strings), which is used to highlight the tokens on the
  26676. // line.
  26677. function highlightLine(cm, line, state, forceToEnd) {
  26678. // A styles array always starts with a number identifying the
  26679. // mode/overlays that it is based on (for easy invalidation).
  26680. var st = [cm.state.modeGen], lineClasses = {};
  26681. // Compute the base array of styles
  26682. runMode(cm, line.text, cm.doc.mode, state, function(end, style) {
  26683. st.push(end, style);
  26684. }, lineClasses, forceToEnd);
  26685. // Run overlays, adjust style array.
  26686. for (var o = 0; o < cm.state.overlays.length; ++o) {
  26687. var overlay = cm.state.overlays[o], i = 1, at = 0;
  26688. runMode(cm, line.text, overlay.mode, true, function(end, style) {
  26689. var start = i;
  26690. // Ensure there's a token end at the current position, and that i points at it
  26691. while (at < end) {
  26692. var i_end = st[i];
  26693. if (i_end > end)
  26694. st.splice(i, 1, end, st[i+1], i_end);
  26695. i += 2;
  26696. at = Math.min(end, i_end);
  26697. }
  26698. if (!style) return;
  26699. if (overlay.opaque) {
  26700. st.splice(start, i - start, end, "cm-overlay " + style);
  26701. i = start + 2;
  26702. } else {
  26703. for (; start < i; start += 2) {
  26704. var cur = st[start+1];
  26705. st[start+1] = (cur ? cur + " " : "") + "cm-overlay " + style;
  26706. }
  26707. }
  26708. }, lineClasses);
  26709. }
  26710. return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null};
  26711. }
  26712. function getLineStyles(cm, line, updateFrontier) {
  26713. if (!line.styles || line.styles[0] != cm.state.modeGen) {
  26714. var state = getStateBefore(cm, lineNo(line));
  26715. var result = highlightLine(cm, line, line.text.length > cm.options.maxHighlightLength ? copyState(cm.doc.mode, state) : state);
  26716. line.stateAfter = state;
  26717. line.styles = result.styles;
  26718. if (result.classes) line.styleClasses = result.classes;
  26719. else if (line.styleClasses) line.styleClasses = null;
  26720. if (updateFrontier === cm.doc.frontier) cm.doc.frontier++;
  26721. }
  26722. return line.styles;
  26723. }
  26724. // Lightweight form of highlight -- proceed over this line and
  26725. // update state, but don't save a style array. Used for lines that
  26726. // aren't currently visible.
  26727. function processLine(cm, text, state, startAt) {
  26728. var mode = cm.doc.mode;
  26729. var stream = new StringStream(text, cm.options.tabSize);
  26730. stream.start = stream.pos = startAt || 0;
  26731. if (text == "") callBlankLine(mode, state);
  26732. while (!stream.eol()) {
  26733. readToken(mode, stream, state);
  26734. stream.start = stream.pos;
  26735. }
  26736. }
  26737. // Convert a style as returned by a mode (either null, or a string
  26738. // containing one or more styles) to a CSS style. This is cached,
  26739. // and also looks for line-wide styles.
  26740. var styleToClassCache = {}, styleToClassCacheWithMode = {};
  26741. function interpretTokenStyle(style, options) {
  26742. if (!style || /^\s*$/.test(style)) return null;
  26743. var cache = options.addModeClass ? styleToClassCacheWithMode : styleToClassCache;
  26744. return cache[style] ||
  26745. (cache[style] = style.replace(/\S+/g, "cm-$&"));
  26746. }
  26747. // Render the DOM representation of the text of a line. Also builds
  26748. // up a 'line map', which points at the DOM nodes that represent
  26749. // specific stretches of text, and is used by the measuring code.
  26750. // The returned object contains the DOM node, this map, and
  26751. // information about line-wide styles that were set by the mode.
  26752. function buildLineContent(cm, lineView) {
  26753. // The padding-right forces the element to have a 'border', which
  26754. // is needed on Webkit to be able to get line-level bounding
  26755. // rectangles for it (in measureChar).
  26756. var content = elt("span", null, null, webkit ? "padding-right: .1px" : null);
  26757. var builder = {pre: elt("pre", [content], "CodeMirror-line"), content: content,
  26758. col: 0, pos: 0, cm: cm,
  26759. trailingSpace: false,
  26760. splitSpaces: (ie || webkit) && cm.getOption("lineWrapping")};
  26761. lineView.measure = {};
  26762. // Iterate over the logical lines that make up this visual line.
  26763. for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {
  26764. var line = i ? lineView.rest[i - 1] : lineView.line, order;
  26765. builder.pos = 0;
  26766. builder.addToken = buildToken;
  26767. // Optionally wire in some hacks into the token-rendering
  26768. // algorithm, to deal with browser quirks.
  26769. if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))
  26770. builder.addToken = buildTokenBadBidi(builder.addToken, order);
  26771. builder.map = [];
  26772. var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);
  26773. insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));
  26774. if (line.styleClasses) {
  26775. if (line.styleClasses.bgClass)
  26776. builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || "");
  26777. if (line.styleClasses.textClass)
  26778. builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || "");
  26779. }
  26780. // Ensure at least a single node is present, for measuring.
  26781. if (builder.map.length == 0)
  26782. builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure)));
  26783. // Store the map and a cache object for the current logical line
  26784. if (i == 0) {
  26785. lineView.measure.map = builder.map;
  26786. lineView.measure.cache = {};
  26787. } else {
  26788. (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map);
  26789. (lineView.measure.caches || (lineView.measure.caches = [])).push({});
  26790. }
  26791. }
  26792. // See issue #2901
  26793. if (webkit) {
  26794. var last = builder.content.lastChild
  26795. if (/\bcm-tab\b/.test(last.className) || (last.querySelector && last.querySelector(".cm-tab")))
  26796. builder.content.className = "cm-tab-wrap-hack";
  26797. }
  26798. signal(cm, "renderLine", cm, lineView.line, builder.pre);
  26799. if (builder.pre.className)
  26800. builder.textClass = joinClasses(builder.pre.className, builder.textClass || "");
  26801. return builder;
  26802. }
  26803. function defaultSpecialCharPlaceholder(ch) {
  26804. var token = elt("span", "\u2022", "cm-invalidchar");
  26805. token.title = "\\u" + ch.charCodeAt(0).toString(16);
  26806. token.setAttribute("aria-label", token.title);
  26807. return token;
  26808. }
  26809. // Build up the DOM representation for a single token, and add it to
  26810. // the line map. Takes care to render special characters separately.
  26811. function buildToken(builder, text, style, startStyle, endStyle, title, css) {
  26812. if (!text) return;
  26813. var displayText = builder.splitSpaces ? splitSpaces(text, builder.trailingSpace) : text
  26814. var special = builder.cm.state.specialChars, mustWrap = false;
  26815. if (!special.test(text)) {
  26816. builder.col += text.length;
  26817. var content = document.createTextNode(displayText);
  26818. builder.map.push(builder.pos, builder.pos + text.length, content);
  26819. if (ie && ie_version < 9) mustWrap = true;
  26820. builder.pos += text.length;
  26821. } else {
  26822. var content = document.createDocumentFragment(), pos = 0;
  26823. while (true) {
  26824. special.lastIndex = pos;
  26825. var m = special.exec(text);
  26826. var skipped = m ? m.index - pos : text.length - pos;
  26827. if (skipped) {
  26828. var txt = document.createTextNode(displayText.slice(pos, pos + skipped));
  26829. if (ie && ie_version < 9) content.appendChild(elt("span", [txt]));
  26830. else content.appendChild(txt);
  26831. builder.map.push(builder.pos, builder.pos + skipped, txt);
  26832. builder.col += skipped;
  26833. builder.pos += skipped;
  26834. }
  26835. if (!m) break;
  26836. pos += skipped + 1;
  26837. if (m[0] == "\t") {
  26838. var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize;
  26839. var txt = content.appendChild(elt("span", spaceStr(tabWidth), "cm-tab"));
  26840. txt.setAttribute("role", "presentation");
  26841. txt.setAttribute("cm-text", "\t");
  26842. builder.col += tabWidth;
  26843. } else if (m[0] == "\r" || m[0] == "\n") {
  26844. var txt = content.appendChild(elt("span", m[0] == "\r" ? "\u240d" : "\u2424", "cm-invalidchar"));
  26845. txt.setAttribute("cm-text", m[0]);
  26846. builder.col += 1;
  26847. } else {
  26848. var txt = builder.cm.options.specialCharPlaceholder(m[0]);
  26849. txt.setAttribute("cm-text", m[0]);
  26850. if (ie && ie_version < 9) content.appendChild(elt("span", [txt]));
  26851. else content.appendChild(txt);
  26852. builder.col += 1;
  26853. }
  26854. builder.map.push(builder.pos, builder.pos + 1, txt);
  26855. builder.pos++;
  26856. }
  26857. }
  26858. builder.trailingSpace = displayText.charCodeAt(text.length - 1) == 32
  26859. if (style || startStyle || endStyle || mustWrap || css) {
  26860. var fullStyle = style || "";
  26861. if (startStyle) fullStyle += startStyle;
  26862. if (endStyle) fullStyle += endStyle;
  26863. var token = elt("span", [content], fullStyle, css);
  26864. if (title) token.title = title;
  26865. return builder.content.appendChild(token);
  26866. }
  26867. builder.content.appendChild(content);
  26868. }
  26869. function splitSpaces(text, trailingBefore) {
  26870. if (text.length > 1 && !/ /.test(text)) return text
  26871. var spaceBefore = trailingBefore, result = ""
  26872. for (var i = 0; i < text.length; i++) {
  26873. var ch = text.charAt(i)
  26874. if (ch == " " && spaceBefore && (i == text.length - 1 || text.charCodeAt(i + 1) == 32))
  26875. ch = "\u00a0"
  26876. result += ch
  26877. spaceBefore = ch == " "
  26878. }
  26879. return result
  26880. }
  26881. // Work around nonsense dimensions being reported for stretches of
  26882. // right-to-left text.
  26883. function buildTokenBadBidi(inner, order) {
  26884. return function(builder, text, style, startStyle, endStyle, title, css) {
  26885. style = style ? style + " cm-force-border" : "cm-force-border";
  26886. var start = builder.pos, end = start + text.length;
  26887. for (;;) {
  26888. // Find the part that overlaps with the start of this text
  26889. for (var i = 0; i < order.length; i++) {
  26890. var part = order[i];
  26891. if (part.to > start && part.from <= start) break;
  26892. }
  26893. if (part.to >= end) return inner(builder, text, style, startStyle, endStyle, title, css);
  26894. inner(builder, text.slice(0, part.to - start), style, startStyle, null, title, css);
  26895. startStyle = null;
  26896. text = text.slice(part.to - start);
  26897. start = part.to;
  26898. }
  26899. };
  26900. }
  26901. function buildCollapsedSpan(builder, size, marker, ignoreWidget) {
  26902. var widget = !ignoreWidget && marker.widgetNode;
  26903. if (widget) builder.map.push(builder.pos, builder.pos + size, widget);
  26904. if (!ignoreWidget && builder.cm.display.input.needsContentAttribute) {
  26905. if (!widget)
  26906. widget = builder.content.appendChild(document.createElement("span"));
  26907. widget.setAttribute("cm-marker", marker.id);
  26908. }
  26909. if (widget) {
  26910. builder.cm.display.input.setUneditable(widget);
  26911. builder.content.appendChild(widget);
  26912. }
  26913. builder.pos += size;
  26914. builder.trailingSpace = false
  26915. }
  26916. // Outputs a number of spans to make up a line, taking highlighting
  26917. // and marked text into account.
  26918. function insertLineContent(line, builder, styles) {
  26919. var spans = line.markedSpans, allText = line.text, at = 0;
  26920. if (!spans) {
  26921. for (var i = 1; i < styles.length; i+=2)
  26922. builder.addToken(builder, allText.slice(at, at = styles[i]), interpretTokenStyle(styles[i+1], builder.cm.options));
  26923. return;
  26924. }
  26925. var len = allText.length, pos = 0, i = 1, text = "", style, css;
  26926. var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;
  26927. for (;;) {
  26928. if (nextChange == pos) { // Update current marker set
  26929. spanStyle = spanEndStyle = spanStartStyle = title = css = "";
  26930. collapsed = null; nextChange = Infinity;
  26931. var foundBookmarks = [], endStyles
  26932. for (var j = 0; j < spans.length; ++j) {
  26933. var sp = spans[j], m = sp.marker;
  26934. if (m.type == "bookmark" && sp.from == pos && m.widgetNode) {
  26935. foundBookmarks.push(m);
  26936. } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {
  26937. if (sp.to != null && sp.to != pos && nextChange > sp.to) {
  26938. nextChange = sp.to;
  26939. spanEndStyle = "";
  26940. }
  26941. if (m.className) spanStyle += " " + m.className;
  26942. if (m.css) css = (css ? css + ";" : "") + m.css;
  26943. if (m.startStyle && sp.from == pos) spanStartStyle += " " + m.startStyle;
  26944. if (m.endStyle && sp.to == nextChange) (endStyles || (endStyles = [])).push(m.endStyle, sp.to)
  26945. if (m.title && !title) title = m.title;
  26946. if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))
  26947. collapsed = sp;
  26948. } else if (sp.from > pos && nextChange > sp.from) {
  26949. nextChange = sp.from;
  26950. }
  26951. }
  26952. if (endStyles) for (var j = 0; j < endStyles.length; j += 2)
  26953. if (endStyles[j + 1] == nextChange) spanEndStyle += " " + endStyles[j]
  26954. if (!collapsed || collapsed.from == pos) for (var j = 0; j < foundBookmarks.length; ++j)
  26955. buildCollapsedSpan(builder, 0, foundBookmarks[j]);
  26956. if (collapsed && (collapsed.from || 0) == pos) {
  26957. buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,
  26958. collapsed.marker, collapsed.from == null);
  26959. if (collapsed.to == null) return;
  26960. if (collapsed.to == pos) collapsed = false;
  26961. }
  26962. }
  26963. if (pos >= len) break;
  26964. var upto = Math.min(len, nextChange);
  26965. while (true) {
  26966. if (text) {
  26967. var end = pos + text.length;
  26968. if (!collapsed) {
  26969. var tokenText = end > upto ? text.slice(0, upto - pos) : text;
  26970. builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,
  26971. spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : "", title, css);
  26972. }
  26973. if (end >= upto) {text = text.slice(upto - pos); pos = upto; break;}
  26974. pos = end;
  26975. spanStartStyle = "";
  26976. }
  26977. text = allText.slice(at, at = styles[i++]);
  26978. style = interpretTokenStyle(styles[i++], builder.cm.options);
  26979. }
  26980. }
  26981. }
  26982. // DOCUMENT DATA STRUCTURE
  26983. // By default, updates that start and end at the beginning of a line
  26984. // are treated specially, in order to make the association of line
  26985. // widgets and marker elements with the text behave more intuitive.
  26986. function isWholeLineUpdate(doc, change) {
  26987. return change.from.ch == 0 && change.to.ch == 0 && lst(change.text) == "" &&
  26988. (!doc.cm || doc.cm.options.wholeLineUpdateBefore);
  26989. }
  26990. // Perform a change on the document data structure.
  26991. function updateDoc(doc, change, markedSpans, estimateHeight) {
  26992. function spansFor(n) {return markedSpans ? markedSpans[n] : null;}
  26993. function update(line, text, spans) {
  26994. updateLine(line, text, spans, estimateHeight);
  26995. signalLater(line, "change", line, change);
  26996. }
  26997. function linesFor(start, end) {
  26998. for (var i = start, result = []; i < end; ++i)
  26999. result.push(new Line(text[i], spansFor(i), estimateHeight));
  27000. return result;
  27001. }
  27002. var from = change.from, to = change.to, text = change.text;
  27003. var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line);
  27004. var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line;
  27005. // Adjust the line structure
  27006. if (change.full) {
  27007. doc.insert(0, linesFor(0, text.length));
  27008. doc.remove(text.length, doc.size - text.length);
  27009. } else if (isWholeLineUpdate(doc, change)) {
  27010. // This is a whole-line replace. Treated specially to make
  27011. // sure line objects move the way they are supposed to.
  27012. var added = linesFor(0, text.length - 1);
  27013. update(lastLine, lastLine.text, lastSpans);
  27014. if (nlines) doc.remove(from.line, nlines);
  27015. if (added.length) doc.insert(from.line, added);
  27016. } else if (firstLine == lastLine) {
  27017. if (text.length == 1) {
  27018. update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans);
  27019. } else {
  27020. var added = linesFor(1, text.length - 1);
  27021. added.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight));
  27022. update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));
  27023. doc.insert(from.line + 1, added);
  27024. }
  27025. } else if (text.length == 1) {
  27026. update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0));
  27027. doc.remove(from.line + 1, nlines);
  27028. } else {
  27029. update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));
  27030. update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans);
  27031. var added = linesFor(1, text.length - 1);
  27032. if (nlines > 1) doc.remove(from.line + 1, nlines - 1);
  27033. doc.insert(from.line + 1, added);
  27034. }
  27035. signalLater(doc, "change", doc, change);
  27036. }
  27037. // The document is represented as a BTree consisting of leaves, with
  27038. // chunk of lines in them, and branches, with up to ten leaves or
  27039. // other branch nodes below them. The top node is always a branch
  27040. // node, and is the document object itself (meaning it has
  27041. // additional methods and properties).
  27042. //
  27043. // All nodes have parent links. The tree is used both to go from
  27044. // line numbers to line objects, and to go from objects to numbers.
  27045. // It also indexes by height, and is used to convert between height
  27046. // and line object, and to find the total height of the document.
  27047. //
  27048. // See also http://marijnhaverbeke.nl/blog/codemirror-line-tree.html
  27049. function LeafChunk(lines) {
  27050. this.lines = lines;
  27051. this.parent = null;
  27052. for (var i = 0, height = 0; i < lines.length; ++i) {
  27053. lines[i].parent = this;
  27054. height += lines[i].height;
  27055. }
  27056. this.height = height;
  27057. }
  27058. LeafChunk.prototype = {
  27059. chunkSize: function() { return this.lines.length; },
  27060. // Remove the n lines at offset 'at'.
  27061. removeInner: function(at, n) {
  27062. for (var i = at, e = at + n; i < e; ++i) {
  27063. var line = this.lines[i];
  27064. this.height -= line.height;
  27065. cleanUpLine(line);
  27066. signalLater(line, "delete");
  27067. }
  27068. this.lines.splice(at, n);
  27069. },
  27070. // Helper used to collapse a small branch into a single leaf.
  27071. collapse: function(lines) {
  27072. lines.push.apply(lines, this.lines);
  27073. },
  27074. // Insert the given array of lines at offset 'at', count them as
  27075. // having the given height.
  27076. insertInner: function(at, lines, height) {
  27077. this.height += height;
  27078. this.lines = this.lines.slice(0, at).concat(lines).concat(this.lines.slice(at));
  27079. for (var i = 0; i < lines.length; ++i) lines[i].parent = this;
  27080. },
  27081. // Used to iterate over a part of the tree.
  27082. iterN: function(at, n, op) {
  27083. for (var e = at + n; at < e; ++at)
  27084. if (op(this.lines[at])) return true;
  27085. }
  27086. };
  27087. function BranchChunk(children) {
  27088. this.children = children;
  27089. var size = 0, height = 0;
  27090. for (var i = 0; i < children.length; ++i) {
  27091. var ch = children[i];
  27092. size += ch.chunkSize(); height += ch.height;
  27093. ch.parent = this;
  27094. }
  27095. this.size = size;
  27096. this.height = height;
  27097. this.parent = null;
  27098. }
  27099. BranchChunk.prototype = {
  27100. chunkSize: function() { return this.size; },
  27101. removeInner: function(at, n) {
  27102. this.size -= n;
  27103. for (var i = 0; i < this.children.length; ++i) {
  27104. var child = this.children[i], sz = child.chunkSize();
  27105. if (at < sz) {
  27106. var rm = Math.min(n, sz - at), oldHeight = child.height;
  27107. child.removeInner(at, rm);
  27108. this.height -= oldHeight - child.height;
  27109. if (sz == rm) { this.children.splice(i--, 1); child.parent = null; }
  27110. if ((n -= rm) == 0) break;
  27111. at = 0;
  27112. } else at -= sz;
  27113. }
  27114. // If the result is smaller than 25 lines, ensure that it is a
  27115. // single leaf node.
  27116. if (this.size - n < 25 &&
  27117. (this.children.length > 1 || !(this.children[0] instanceof LeafChunk))) {
  27118. var lines = [];
  27119. this.collapse(lines);
  27120. this.children = [new LeafChunk(lines)];
  27121. this.children[0].parent = this;
  27122. }
  27123. },
  27124. collapse: function(lines) {
  27125. for (var i = 0; i < this.children.length; ++i) this.children[i].collapse(lines);
  27126. },
  27127. insertInner: function(at, lines, height) {
  27128. this.size += lines.length;
  27129. this.height += height;
  27130. for (var i = 0; i < this.children.length; ++i) {
  27131. var child = this.children[i], sz = child.chunkSize();
  27132. if (at <= sz) {
  27133. child.insertInner(at, lines, height);
  27134. if (child.lines && child.lines.length > 50) {
  27135. // To avoid memory thrashing when child.lines is huge (e.g. first view of a large file), it's never spliced.
  27136. // Instead, small slices are taken. They're taken in order because sequential memory accesses are fastest.
  27137. var remaining = child.lines.length % 25 + 25
  27138. for (var pos = remaining; pos < child.lines.length;) {
  27139. var leaf = new LeafChunk(child.lines.slice(pos, pos += 25));
  27140. child.height -= leaf.height;
  27141. this.children.splice(++i, 0, leaf);
  27142. leaf.parent = this;
  27143. }
  27144. child.lines = child.lines.slice(0, remaining);
  27145. this.maybeSpill();
  27146. }
  27147. break;
  27148. }
  27149. at -= sz;
  27150. }
  27151. },
  27152. // When a node has grown, check whether it should be split.
  27153. maybeSpill: function() {
  27154. if (this.children.length <= 10) return;
  27155. var me = this;
  27156. do {
  27157. var spilled = me.children.splice(me.children.length - 5, 5);
  27158. var sibling = new BranchChunk(spilled);
  27159. if (!me.parent) { // Become the parent node
  27160. var copy = new BranchChunk(me.children);
  27161. copy.parent = me;
  27162. me.children = [copy, sibling];
  27163. me = copy;
  27164. } else {
  27165. me.size -= sibling.size;
  27166. me.height -= sibling.height;
  27167. var myIndex = indexOf(me.parent.children, me);
  27168. me.parent.children.splice(myIndex + 1, 0, sibling);
  27169. }
  27170. sibling.parent = me.parent;
  27171. } while (me.children.length > 10);
  27172. me.parent.maybeSpill();
  27173. },
  27174. iterN: function(at, n, op) {
  27175. for (var i = 0; i < this.children.length; ++i) {
  27176. var child = this.children[i], sz = child.chunkSize();
  27177. if (at < sz) {
  27178. var used = Math.min(n, sz - at);
  27179. if (child.iterN(at, used, op)) return true;
  27180. if ((n -= used) == 0) break;
  27181. at = 0;
  27182. } else at -= sz;
  27183. }
  27184. }
  27185. };
  27186. var nextDocId = 0;
  27187. var Doc = CodeMirror.Doc = function(text, mode, firstLine, lineSep) {
  27188. if (!(this instanceof Doc)) return new Doc(text, mode, firstLine, lineSep);
  27189. if (firstLine == null) firstLine = 0;
  27190. BranchChunk.call(this, [new LeafChunk([new Line("", null)])]);
  27191. this.first = firstLine;
  27192. this.scrollTop = this.scrollLeft = 0;
  27193. this.cantEdit = false;
  27194. this.cleanGeneration = 1;
  27195. this.frontier = firstLine;
  27196. var start = Pos(firstLine, 0);
  27197. this.sel = simpleSelection(start);
  27198. this.history = new History(null);
  27199. this.id = ++nextDocId;
  27200. this.modeOption = mode;
  27201. this.lineSep = lineSep;
  27202. this.extend = false;
  27203. if (typeof text == "string") text = this.splitLines(text);
  27204. updateDoc(this, {from: start, to: start, text: text});
  27205. setSelection(this, simpleSelection(start), sel_dontScroll);
  27206. };
  27207. Doc.prototype = createObj(BranchChunk.prototype, {
  27208. constructor: Doc,
  27209. // Iterate over the document. Supports two forms -- with only one
  27210. // argument, it calls that for each line in the document. With
  27211. // three, it iterates over the range given by the first two (with
  27212. // the second being non-inclusive).
  27213. iter: function(from, to, op) {
  27214. if (op) this.iterN(from - this.first, to - from, op);
  27215. else this.iterN(this.first, this.first + this.size, from);
  27216. },
  27217. // Non-public interface for adding and removing lines.
  27218. insert: function(at, lines) {
  27219. var height = 0;
  27220. for (var i = 0; i < lines.length; ++i) height += lines[i].height;
  27221. this.insertInner(at - this.first, lines, height);
  27222. },
  27223. remove: function(at, n) { this.removeInner(at - this.first, n); },
  27224. // From here, the methods are part of the public interface. Most
  27225. // are also available from CodeMirror (editor) instances.
  27226. getValue: function(lineSep) {
  27227. var lines = getLines(this, this.first, this.first + this.size);
  27228. if (lineSep === false) return lines;
  27229. return lines.join(lineSep || this.lineSeparator());
  27230. },
  27231. setValue: docMethodOp(function(code) {
  27232. var top = Pos(this.first, 0), last = this.first + this.size - 1;
  27233. makeChange(this, {from: top, to: Pos(last, getLine(this, last).text.length),
  27234. text: this.splitLines(code), origin: "setValue", full: true}, true);
  27235. setSelection(this, simpleSelection(top));
  27236. }),
  27237. replaceRange: function(code, from, to, origin) {
  27238. from = clipPos(this, from);
  27239. to = to ? clipPos(this, to) : from;
  27240. replaceRange(this, code, from, to, origin);
  27241. },
  27242. getRange: function(from, to, lineSep) {
  27243. var lines = getBetween(this, clipPos(this, from), clipPos(this, to));
  27244. if (lineSep === false) return lines;
  27245. return lines.join(lineSep || this.lineSeparator());
  27246. },
  27247. getLine: function(line) {var l = this.getLineHandle(line); return l && l.text;},
  27248. getLineHandle: function(line) {if (isLine(this, line)) return getLine(this, line);},
  27249. getLineNumber: function(line) {return lineNo(line);},
  27250. getLineHandleVisualStart: function(line) {
  27251. if (typeof line == "number") line = getLine(this, line);
  27252. return visualLine(line);
  27253. },
  27254. lineCount: function() {return this.size;},
  27255. firstLine: function() {return this.first;},
  27256. lastLine: function() {return this.first + this.size - 1;},
  27257. clipPos: function(pos) {return clipPos(this, pos);},
  27258. getCursor: function(start) {
  27259. var range = this.sel.primary(), pos;
  27260. if (start == null || start == "head") pos = range.head;
  27261. else if (start == "anchor") pos = range.anchor;
  27262. else if (start == "end" || start == "to" || start === false) pos = range.to();
  27263. else pos = range.from();
  27264. return pos;
  27265. },
  27266. listSelections: function() { return this.sel.ranges; },
  27267. somethingSelected: function() {return this.sel.somethingSelected();},
  27268. setCursor: docMethodOp(function(line, ch, options) {
  27269. setSimpleSelection(this, clipPos(this, typeof line == "number" ? Pos(line, ch || 0) : line), null, options);
  27270. }),
  27271. setSelection: docMethodOp(function(anchor, head, options) {
  27272. setSimpleSelection(this, clipPos(this, anchor), clipPos(this, head || anchor), options);
  27273. }),
  27274. extendSelection: docMethodOp(function(head, other, options) {
  27275. extendSelection(this, clipPos(this, head), other && clipPos(this, other), options);
  27276. }),
  27277. extendSelections: docMethodOp(function(heads, options) {
  27278. extendSelections(this, clipPosArray(this, heads), options);
  27279. }),
  27280. extendSelectionsBy: docMethodOp(function(f, options) {
  27281. var heads = map(this.sel.ranges, f);
  27282. extendSelections(this, clipPosArray(this, heads), options);
  27283. }),
  27284. setSelections: docMethodOp(function(ranges, primary, options) {
  27285. if (!ranges.length) return;
  27286. for (var i = 0, out = []; i < ranges.length; i++)
  27287. out[i] = new Range(clipPos(this, ranges[i].anchor),
  27288. clipPos(this, ranges[i].head));
  27289. if (primary == null) primary = Math.min(ranges.length - 1, this.sel.primIndex);
  27290. setSelection(this, normalizeSelection(out, primary), options);
  27291. }),
  27292. addSelection: docMethodOp(function(anchor, head, options) {
  27293. var ranges = this.sel.ranges.slice(0);
  27294. ranges.push(new Range(clipPos(this, anchor), clipPos(this, head || anchor)));
  27295. setSelection(this, normalizeSelection(ranges, ranges.length - 1), options);
  27296. }),
  27297. getSelection: function(lineSep) {
  27298. var ranges = this.sel.ranges, lines;
  27299. for (var i = 0; i < ranges.length; i++) {
  27300. var sel = getBetween(this, ranges[i].from(), ranges[i].to());
  27301. lines = lines ? lines.concat(sel) : sel;
  27302. }
  27303. if (lineSep === false) return lines;
  27304. else return lines.join(lineSep || this.lineSeparator());
  27305. },
  27306. getSelections: function(lineSep) {
  27307. var parts = [], ranges = this.sel.ranges;
  27308. for (var i = 0; i < ranges.length; i++) {
  27309. var sel = getBetween(this, ranges[i].from(), ranges[i].to());
  27310. if (lineSep !== false) sel = sel.join(lineSep || this.lineSeparator());
  27311. parts[i] = sel;
  27312. }
  27313. return parts;
  27314. },
  27315. replaceSelection: function(code, collapse, origin) {
  27316. var dup = [];
  27317. for (var i = 0; i < this.sel.ranges.length; i++)
  27318. dup[i] = code;
  27319. this.replaceSelections(dup, collapse, origin || "+input");
  27320. },
  27321. replaceSelections: docMethodOp(function(code, collapse, origin) {
  27322. var changes = [], sel = this.sel;
  27323. for (var i = 0; i < sel.ranges.length; i++) {
  27324. var range = sel.ranges[i];
  27325. changes[i] = {from: range.from(), to: range.to(), text: this.splitLines(code[i]), origin: origin};
  27326. }
  27327. var newSel = collapse && collapse != "end" && computeReplacedSel(this, changes, collapse);
  27328. for (var i = changes.length - 1; i >= 0; i--)
  27329. makeChange(this, changes[i]);
  27330. if (newSel) setSelectionReplaceHistory(this, newSel);
  27331. else if (this.cm) ensureCursorVisible(this.cm);
  27332. }),
  27333. undo: docMethodOp(function() {makeChangeFromHistory(this, "undo");}),
  27334. redo: docMethodOp(function() {makeChangeFromHistory(this, "redo");}),
  27335. undoSelection: docMethodOp(function() {makeChangeFromHistory(this, "undo", true);}),
  27336. redoSelection: docMethodOp(function() {makeChangeFromHistory(this, "redo", true);}),
  27337. setExtending: function(val) {this.extend = val;},
  27338. getExtending: function() {return this.extend;},
  27339. historySize: function() {
  27340. var hist = this.history, done = 0, undone = 0;
  27341. for (var i = 0; i < hist.done.length; i++) if (!hist.done[i].ranges) ++done;
  27342. for (var i = 0; i < hist.undone.length; i++) if (!hist.undone[i].ranges) ++undone;
  27343. return {undo: done, redo: undone};
  27344. },
  27345. clearHistory: function() {this.history = new History(this.history.maxGeneration);},
  27346. markClean: function() {
  27347. this.cleanGeneration = this.changeGeneration(true);
  27348. },
  27349. changeGeneration: function(forceSplit) {
  27350. if (forceSplit)
  27351. this.history.lastOp = this.history.lastSelOp = this.history.lastOrigin = null;
  27352. return this.history.generation;
  27353. },
  27354. isClean: function (gen) {
  27355. return this.history.generation == (gen || this.cleanGeneration);
  27356. },
  27357. getHistory: function() {
  27358. return {done: copyHistoryArray(this.history.done),
  27359. undone: copyHistoryArray(this.history.undone)};
  27360. },
  27361. setHistory: function(histData) {
  27362. var hist = this.history = new History(this.history.maxGeneration);
  27363. hist.done = copyHistoryArray(histData.done.slice(0), null, true);
  27364. hist.undone = copyHistoryArray(histData.undone.slice(0), null, true);
  27365. },
  27366. addLineClass: docMethodOp(function(handle, where, cls) {
  27367. return changeLine(this, handle, where == "gutter" ? "gutter" : "class", function(line) {
  27368. var prop = where == "text" ? "textClass"
  27369. : where == "background" ? "bgClass"
  27370. : where == "gutter" ? "gutterClass" : "wrapClass";
  27371. if (!line[prop]) line[prop] = cls;
  27372. else if (classTest(cls).test(line[prop])) return false;
  27373. else line[prop] += " " + cls;
  27374. return true;
  27375. });
  27376. }),
  27377. removeLineClass: docMethodOp(function(handle, where, cls) {
  27378. return changeLine(this, handle, where == "gutter" ? "gutter" : "class", function(line) {
  27379. var prop = where == "text" ? "textClass"
  27380. : where == "background" ? "bgClass"
  27381. : where == "gutter" ? "gutterClass" : "wrapClass";
  27382. var cur = line[prop];
  27383. if (!cur) return false;
  27384. else if (cls == null) line[prop] = null;
  27385. else {
  27386. var found = cur.match(classTest(cls));
  27387. if (!found) return false;
  27388. var end = found.index + found[0].length;
  27389. line[prop] = cur.slice(0, found.index) + (!found.index || end == cur.length ? "" : " ") + cur.slice(end) || null;
  27390. }
  27391. return true;
  27392. });
  27393. }),
  27394. addLineWidget: docMethodOp(function(handle, node, options) {
  27395. return addLineWidget(this, handle, node, options);
  27396. }),
  27397. removeLineWidget: function(widget) { widget.clear(); },
  27398. markText: function(from, to, options) {
  27399. return markText(this, clipPos(this, from), clipPos(this, to), options, options && options.type || "range");
  27400. },
  27401. setBookmark: function(pos, options) {
  27402. var realOpts = {replacedWith: options && (options.nodeType == null ? options.widget : options),
  27403. insertLeft: options && options.insertLeft,
  27404. clearWhenEmpty: false, shared: options && options.shared,
  27405. handleMouseEvents: options && options.handleMouseEvents};
  27406. pos = clipPos(this, pos);
  27407. return markText(this, pos, pos, realOpts, "bookmark");
  27408. },
  27409. findMarksAt: function(pos) {
  27410. pos = clipPos(this, pos);
  27411. var markers = [], spans = getLine(this, pos.line).markedSpans;
  27412. if (spans) for (var i = 0; i < spans.length; ++i) {
  27413. var span = spans[i];
  27414. if ((span.from == null || span.from <= pos.ch) &&
  27415. (span.to == null || span.to >= pos.ch))
  27416. markers.push(span.marker.parent || span.marker);
  27417. }
  27418. return markers;
  27419. },
  27420. findMarks: function(from, to, filter) {
  27421. from = clipPos(this, from); to = clipPos(this, to);
  27422. var found = [], lineNo = from.line;
  27423. this.iter(from.line, to.line + 1, function(line) {
  27424. var spans = line.markedSpans;
  27425. if (spans) for (var i = 0; i < spans.length; i++) {
  27426. var span = spans[i];
  27427. if (!(span.to != null && lineNo == from.line && from.ch >= span.to ||
  27428. span.from == null && lineNo != from.line ||
  27429. span.from != null && lineNo == to.line && span.from >= to.ch) &&
  27430. (!filter || filter(span.marker)))
  27431. found.push(span.marker.parent || span.marker);
  27432. }
  27433. ++lineNo;
  27434. });
  27435. return found;
  27436. },
  27437. getAllMarks: function() {
  27438. var markers = [];
  27439. this.iter(function(line) {
  27440. var sps = line.markedSpans;
  27441. if (sps) for (var i = 0; i < sps.length; ++i)
  27442. if (sps[i].from != null) markers.push(sps[i].marker);
  27443. });
  27444. return markers;
  27445. },
  27446. posFromIndex: function(off) {
  27447. var ch, lineNo = this.first, sepSize = this.lineSeparator().length;
  27448. this.iter(function(line) {
  27449. var sz = line.text.length + sepSize;
  27450. if (sz > off) { ch = off; return true; }
  27451. off -= sz;
  27452. ++lineNo;
  27453. });
  27454. return clipPos(this, Pos(lineNo, ch));
  27455. },
  27456. indexFromPos: function (coords) {
  27457. coords = clipPos(this, coords);
  27458. var index = coords.ch;
  27459. if (coords.line < this.first || coords.ch < 0) return 0;
  27460. var sepSize = this.lineSeparator().length;
  27461. this.iter(this.first, coords.line, function (line) {
  27462. index += line.text.length + sepSize;
  27463. });
  27464. return index;
  27465. },
  27466. copy: function(copyHistory) {
  27467. var doc = new Doc(getLines(this, this.first, this.first + this.size),
  27468. this.modeOption, this.first, this.lineSep);
  27469. doc.scrollTop = this.scrollTop; doc.scrollLeft = this.scrollLeft;
  27470. doc.sel = this.sel;
  27471. doc.extend = false;
  27472. if (copyHistory) {
  27473. doc.history.undoDepth = this.history.undoDepth;
  27474. doc.setHistory(this.getHistory());
  27475. }
  27476. return doc;
  27477. },
  27478. linkedDoc: function(options) {
  27479. if (!options) options = {};
  27480. var from = this.first, to = this.first + this.size;
  27481. if (options.from != null && options.from > from) from = options.from;
  27482. if (options.to != null && options.to < to) to = options.to;
  27483. var copy = new Doc(getLines(this, from, to), options.mode || this.modeOption, from, this.lineSep);
  27484. if (options.sharedHist) copy.history = this.history;
  27485. (this.linked || (this.linked = [])).push({doc: copy, sharedHist: options.sharedHist});
  27486. copy.linked = [{doc: this, isParent: true, sharedHist: options.sharedHist}];
  27487. copySharedMarkers(copy, findSharedMarkers(this));
  27488. return copy;
  27489. },
  27490. unlinkDoc: function(other) {
  27491. if (other instanceof CodeMirror) other = other.doc;
  27492. if (this.linked) for (var i = 0; i < this.linked.length; ++i) {
  27493. var link = this.linked[i];
  27494. if (link.doc != other) continue;
  27495. this.linked.splice(i, 1);
  27496. other.unlinkDoc(this);
  27497. detachSharedMarkers(findSharedMarkers(this));
  27498. break;
  27499. }
  27500. // If the histories were shared, split them again
  27501. if (other.history == this.history) {
  27502. var splitIds = [other.id];
  27503. linkedDocs(other, function(doc) {splitIds.push(doc.id);}, true);
  27504. other.history = new History(null);
  27505. other.history.done = copyHistoryArray(this.history.done, splitIds);
  27506. other.history.undone = copyHistoryArray(this.history.undone, splitIds);
  27507. }
  27508. },
  27509. iterLinkedDocs: function(f) {linkedDocs(this, f);},
  27510. getMode: function() {return this.mode;},
  27511. getEditor: function() {return this.cm;},
  27512. splitLines: function(str) {
  27513. if (this.lineSep) return str.split(this.lineSep);
  27514. return splitLinesAuto(str);
  27515. },
  27516. lineSeparator: function() { return this.lineSep || "\n"; }
  27517. });
  27518. // Public alias.
  27519. Doc.prototype.eachLine = Doc.prototype.iter;
  27520. // Set up methods on CodeMirror's prototype to redirect to the editor's document.
  27521. var dontDelegate = "iter insert remove copy getEditor constructor".split(" ");
  27522. for (var prop in Doc.prototype) if (Doc.prototype.hasOwnProperty(prop) && indexOf(dontDelegate, prop) < 0)
  27523. CodeMirror.prototype[prop] = (function(method) {
  27524. return function() {return method.apply(this.doc, arguments);};
  27525. })(Doc.prototype[prop]);
  27526. eventMixin(Doc);
  27527. // Call f for all linked documents.
  27528. function linkedDocs(doc, f, sharedHistOnly) {
  27529. function propagate(doc, skip, sharedHist) {
  27530. if (doc.linked) for (var i = 0; i < doc.linked.length; ++i) {
  27531. var rel = doc.linked[i];
  27532. if (rel.doc == skip) continue;
  27533. var shared = sharedHist && rel.sharedHist;
  27534. if (sharedHistOnly && !shared) continue;
  27535. f(rel.doc, shared);
  27536. propagate(rel.doc, doc, shared);
  27537. }
  27538. }
  27539. propagate(doc, null, true);
  27540. }
  27541. // Attach a document to an editor.
  27542. function attachDoc(cm, doc) {
  27543. if (doc.cm) throw new Error("This document is already in use.");
  27544. cm.doc = doc;
  27545. doc.cm = cm;
  27546. estimateLineHeights(cm);
  27547. loadMode(cm);
  27548. if (!cm.options.lineWrapping) findMaxLine(cm);
  27549. cm.options.mode = doc.modeOption;
  27550. regChange(cm);
  27551. }
  27552. // LINE UTILITIES
  27553. // Find the line object corresponding to the given line number.
  27554. function getLine(doc, n) {
  27555. n -= doc.first;
  27556. if (n < 0 || n >= doc.size) throw new Error("There is no line " + (n + doc.first) + " in the document.");
  27557. for (var chunk = doc; !chunk.lines;) {
  27558. for (var i = 0;; ++i) {
  27559. var child = chunk.children[i], sz = child.chunkSize();
  27560. if (n < sz) { chunk = child; break; }
  27561. n -= sz;
  27562. }
  27563. }
  27564. return chunk.lines[n];
  27565. }
  27566. // Get the part of a document between two positions, as an array of
  27567. // strings.
  27568. function getBetween(doc, start, end) {
  27569. var out = [], n = start.line;
  27570. doc.iter(start.line, end.line + 1, function(line) {
  27571. var text = line.text;
  27572. if (n == end.line) text = text.slice(0, end.ch);
  27573. if (n == start.line) text = text.slice(start.ch);
  27574. out.push(text);
  27575. ++n;
  27576. });
  27577. return out;
  27578. }
  27579. // Get the lines between from and to, as array of strings.
  27580. function getLines(doc, from, to) {
  27581. var out = [];
  27582. doc.iter(from, to, function(line) { out.push(line.text); });
  27583. return out;
  27584. }
  27585. // Update the height of a line, propagating the height change
  27586. // upwards to parent nodes.
  27587. function updateLineHeight(line, height) {
  27588. var diff = height - line.height;
  27589. if (diff) for (var n = line; n; n = n.parent) n.height += diff;
  27590. }
  27591. // Given a line object, find its line number by walking up through
  27592. // its parent links.
  27593. function lineNo(line) {
  27594. if (line.parent == null) return null;
  27595. var cur = line.parent, no = indexOf(cur.lines, line);
  27596. for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) {
  27597. for (var i = 0;; ++i) {
  27598. if (chunk.children[i] == cur) break;
  27599. no += chunk.children[i].chunkSize();
  27600. }
  27601. }
  27602. return no + cur.first;
  27603. }
  27604. // Find the line at the given vertical position, using the height
  27605. // information in the document tree.
  27606. function lineAtHeight(chunk, h) {
  27607. var n = chunk.first;
  27608. outer: do {
  27609. for (var i = 0; i < chunk.children.length; ++i) {
  27610. var child = chunk.children[i], ch = child.height;
  27611. if (h < ch) { chunk = child; continue outer; }
  27612. h -= ch;
  27613. n += child.chunkSize();
  27614. }
  27615. return n;
  27616. } while (!chunk.lines);
  27617. for (var i = 0; i < chunk.lines.length; ++i) {
  27618. var line = chunk.lines[i], lh = line.height;
  27619. if (h < lh) break;
  27620. h -= lh;
  27621. }
  27622. return n + i;
  27623. }
  27624. // Find the height above the given line.
  27625. function heightAtLine(lineObj) {
  27626. lineObj = visualLine(lineObj);
  27627. var h = 0, chunk = lineObj.parent;
  27628. for (var i = 0; i < chunk.lines.length; ++i) {
  27629. var line = chunk.lines[i];
  27630. if (line == lineObj) break;
  27631. else h += line.height;
  27632. }
  27633. for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {
  27634. for (var i = 0; i < p.children.length; ++i) {
  27635. var cur = p.children[i];
  27636. if (cur == chunk) break;
  27637. else h += cur.height;
  27638. }
  27639. }
  27640. return h;
  27641. }
  27642. // Get the bidi ordering for the given line (and cache it). Returns
  27643. // false for lines that are fully left-to-right, and an array of
  27644. // BidiSpan objects otherwise.
  27645. function getOrder(line) {
  27646. var order = line.order;
  27647. if (order == null) order = line.order = bidiOrdering(line.text);
  27648. return order;
  27649. }
  27650. // HISTORY
  27651. function History(startGen) {
  27652. // Arrays of change events and selections. Doing something adds an
  27653. // event to done and clears undo. Undoing moves events from done
  27654. // to undone, redoing moves them in the other direction.
  27655. this.done = []; this.undone = [];
  27656. this.undoDepth = Infinity;
  27657. // Used to track when changes can be merged into a single undo
  27658. // event
  27659. this.lastModTime = this.lastSelTime = 0;
  27660. this.lastOp = this.lastSelOp = null;
  27661. this.lastOrigin = this.lastSelOrigin = null;
  27662. // Used by the isClean() method
  27663. this.generation = this.maxGeneration = startGen || 1;
  27664. }
  27665. // Create a history change event from an updateDoc-style change
  27666. // object.
  27667. function historyChangeFromChange(doc, change) {
  27668. var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};
  27669. attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);
  27670. linkedDocs(doc, function(doc) {attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);}, true);
  27671. return histChange;
  27672. }
  27673. // Pop all selection events off the end of a history array. Stop at
  27674. // a change event.
  27675. function clearSelectionEvents(array) {
  27676. while (array.length) {
  27677. var last = lst(array);
  27678. if (last.ranges) array.pop();
  27679. else break;
  27680. }
  27681. }
  27682. // Find the top change event in the history. Pop off selection
  27683. // events that are in the way.
  27684. function lastChangeEvent(hist, force) {
  27685. if (force) {
  27686. clearSelectionEvents(hist.done);
  27687. return lst(hist.done);
  27688. } else if (hist.done.length && !lst(hist.done).ranges) {
  27689. return lst(hist.done);
  27690. } else if (hist.done.length > 1 && !hist.done[hist.done.length - 2].ranges) {
  27691. hist.done.pop();
  27692. return lst(hist.done);
  27693. }
  27694. }
  27695. // Register a change in the history. Merges changes that are within
  27696. // a single operation, ore are close together with an origin that
  27697. // allows merging (starting with "+") into a single event.
  27698. function addChangeToHistory(doc, change, selAfter, opId) {
  27699. var hist = doc.history;
  27700. hist.undone.length = 0;
  27701. var time = +new Date, cur;
  27702. if ((hist.lastOp == opId ||
  27703. hist.lastOrigin == change.origin && change.origin &&
  27704. ((change.origin.charAt(0) == "+" && doc.cm && hist.lastModTime > time - doc.cm.options.historyEventDelay) ||
  27705. change.origin.charAt(0) == "*")) &&
  27706. (cur = lastChangeEvent(hist, hist.lastOp == opId))) {
  27707. // Merge this change into the last event
  27708. var last = lst(cur.changes);
  27709. if (cmp(change.from, change.to) == 0 && cmp(change.from, last.to) == 0) {
  27710. // Optimized case for simple insertion -- don't want to add
  27711. // new changesets for every character typed
  27712. last.to = changeEnd(change);
  27713. } else {
  27714. // Add new sub-event
  27715. cur.changes.push(historyChangeFromChange(doc, change));
  27716. }
  27717. } else {
  27718. // Can not be merged, start a new event.
  27719. var before = lst(hist.done);
  27720. if (!before || !before.ranges)
  27721. pushSelectionToHistory(doc.sel, hist.done);
  27722. cur = {changes: [historyChangeFromChange(doc, change)],
  27723. generation: hist.generation};
  27724. hist.done.push(cur);
  27725. while (hist.done.length > hist.undoDepth) {
  27726. hist.done.shift();
  27727. if (!hist.done[0].ranges) hist.done.shift();
  27728. }
  27729. }
  27730. hist.done.push(selAfter);
  27731. hist.generation = ++hist.maxGeneration;
  27732. hist.lastModTime = hist.lastSelTime = time;
  27733. hist.lastOp = hist.lastSelOp = opId;
  27734. hist.lastOrigin = hist.lastSelOrigin = change.origin;
  27735. if (!last) signal(doc, "historyAdded");
  27736. }
  27737. function selectionEventCanBeMerged(doc, origin, prev, sel) {
  27738. var ch = origin.charAt(0);
  27739. return ch == "*" ||
  27740. ch == "+" &&
  27741. prev.ranges.length == sel.ranges.length &&
  27742. prev.somethingSelected() == sel.somethingSelected() &&
  27743. new Date - doc.history.lastSelTime <= (doc.cm ? doc.cm.options.historyEventDelay : 500);
  27744. }
  27745. // Called whenever the selection changes, sets the new selection as
  27746. // the pending selection in the history, and pushes the old pending
  27747. // selection into the 'done' array when it was significantly
  27748. // different (in number of selected ranges, emptiness, or time).
  27749. function addSelectionToHistory(doc, sel, opId, options) {
  27750. var hist = doc.history, origin = options && options.origin;
  27751. // A new event is started when the previous origin does not match
  27752. // the current, or the origins don't allow matching. Origins
  27753. // starting with * are always merged, those starting with + are
  27754. // merged when similar and close together in time.
  27755. if (opId == hist.lastSelOp ||
  27756. (origin && hist.lastSelOrigin == origin &&
  27757. (hist.lastModTime == hist.lastSelTime && hist.lastOrigin == origin ||
  27758. selectionEventCanBeMerged(doc, origin, lst(hist.done), sel))))
  27759. hist.done[hist.done.length - 1] = sel;
  27760. else
  27761. pushSelectionToHistory(sel, hist.done);
  27762. hist.lastSelTime = +new Date;
  27763. hist.lastSelOrigin = origin;
  27764. hist.lastSelOp = opId;
  27765. if (options && options.clearRedo !== false)
  27766. clearSelectionEvents(hist.undone);
  27767. }
  27768. function pushSelectionToHistory(sel, dest) {
  27769. var top = lst(dest);
  27770. if (!(top && top.ranges && top.equals(sel)))
  27771. dest.push(sel);
  27772. }
  27773. // Used to store marked span information in the history.
  27774. function attachLocalSpans(doc, change, from, to) {
  27775. var existing = change["spans_" + doc.id], n = 0;
  27776. doc.iter(Math.max(doc.first, from), Math.min(doc.first + doc.size, to), function(line) {
  27777. if (line.markedSpans)
  27778. (existing || (existing = change["spans_" + doc.id] = {}))[n] = line.markedSpans;
  27779. ++n;
  27780. });
  27781. }
  27782. // When un/re-doing restores text containing marked spans, those
  27783. // that have been explicitly cleared should not be restored.
  27784. function removeClearedSpans(spans) {
  27785. if (!spans) return null;
  27786. for (var i = 0, out; i < spans.length; ++i) {
  27787. if (spans[i].marker.explicitlyCleared) { if (!out) out = spans.slice(0, i); }
  27788. else if (out) out.push(spans[i]);
  27789. }
  27790. return !out ? spans : out.length ? out : null;
  27791. }
  27792. // Retrieve and filter the old marked spans stored in a change event.
  27793. function getOldSpans(doc, change) {
  27794. var found = change["spans_" + doc.id];
  27795. if (!found) return null;
  27796. for (var i = 0, nw = []; i < change.text.length; ++i)
  27797. nw.push(removeClearedSpans(found[i]));
  27798. return nw;
  27799. }
  27800. // Used both to provide a JSON-safe object in .getHistory, and, when
  27801. // detaching a document, to split the history in two
  27802. function copyHistoryArray(events, newGroup, instantiateSel) {
  27803. for (var i = 0, copy = []; i < events.length; ++i) {
  27804. var event = events[i];
  27805. if (event.ranges) {
  27806. copy.push(instantiateSel ? Selection.prototype.deepCopy.call(event) : event);
  27807. continue;
  27808. }
  27809. var changes = event.changes, newChanges = [];
  27810. copy.push({changes: newChanges});
  27811. for (var j = 0; j < changes.length; ++j) {
  27812. var change = changes[j], m;
  27813. newChanges.push({from: change.from, to: change.to, text: change.text});
  27814. if (newGroup) for (var prop in change) if (m = prop.match(/^spans_(\d+)$/)) {
  27815. if (indexOf(newGroup, Number(m[1])) > -1) {
  27816. lst(newChanges)[prop] = change[prop];
  27817. delete change[prop];
  27818. }
  27819. }
  27820. }
  27821. }
  27822. return copy;
  27823. }
  27824. // Rebasing/resetting history to deal with externally-sourced changes
  27825. function rebaseHistSelSingle(pos, from, to, diff) {
  27826. if (to < pos.line) {
  27827. pos.line += diff;
  27828. } else if (from < pos.line) {
  27829. pos.line = from;
  27830. pos.ch = 0;
  27831. }
  27832. }
  27833. // Tries to rebase an array of history events given a change in the
  27834. // document. If the change touches the same lines as the event, the
  27835. // event, and everything 'behind' it, is discarded. If the change is
  27836. // before the event, the event's positions are updated. Uses a
  27837. // copy-on-write scheme for the positions, to avoid having to
  27838. // reallocate them all on every rebase, but also avoid problems with
  27839. // shared position objects being unsafely updated.
  27840. function rebaseHistArray(array, from, to, diff) {
  27841. for (var i = 0; i < array.length; ++i) {
  27842. var sub = array[i], ok = true;
  27843. if (sub.ranges) {
  27844. if (!sub.copied) { sub = array[i] = sub.deepCopy(); sub.copied = true; }
  27845. for (var j = 0; j < sub.ranges.length; j++) {
  27846. rebaseHistSelSingle(sub.ranges[j].anchor, from, to, diff);
  27847. rebaseHistSelSingle(sub.ranges[j].head, from, to, diff);
  27848. }
  27849. continue;
  27850. }
  27851. for (var j = 0; j < sub.changes.length; ++j) {
  27852. var cur = sub.changes[j];
  27853. if (to < cur.from.line) {
  27854. cur.from = Pos(cur.from.line + diff, cur.from.ch);
  27855. cur.to = Pos(cur.to.line + diff, cur.to.ch);
  27856. } else if (from <= cur.to.line) {
  27857. ok = false;
  27858. break;
  27859. }
  27860. }
  27861. if (!ok) {
  27862. array.splice(0, i + 1);
  27863. i = 0;
  27864. }
  27865. }
  27866. }
  27867. function rebaseHist(hist, change) {
  27868. var from = change.from.line, to = change.to.line, diff = change.text.length - (to - from) - 1;
  27869. rebaseHistArray(hist.done, from, to, diff);
  27870. rebaseHistArray(hist.undone, from, to, diff);
  27871. }
  27872. // EVENT UTILITIES
  27873. // Due to the fact that we still support jurassic IE versions, some
  27874. // compatibility wrappers are needed.
  27875. var e_preventDefault = CodeMirror.e_preventDefault = function(e) {
  27876. if (e.preventDefault) e.preventDefault();
  27877. else e.returnValue = false;
  27878. };
  27879. var e_stopPropagation = CodeMirror.e_stopPropagation = function(e) {
  27880. if (e.stopPropagation) e.stopPropagation();
  27881. else e.cancelBubble = true;
  27882. };
  27883. function e_defaultPrevented(e) {
  27884. return e.defaultPrevented != null ? e.defaultPrevented : e.returnValue == false;
  27885. }
  27886. var e_stop = CodeMirror.e_stop = function(e) {e_preventDefault(e); e_stopPropagation(e);};
  27887. function e_target(e) {return e.target || e.srcElement;}
  27888. function e_button(e) {
  27889. var b = e.which;
  27890. if (b == null) {
  27891. if (e.button & 1) b = 1;
  27892. else if (e.button & 2) b = 3;
  27893. else if (e.button & 4) b = 2;
  27894. }
  27895. if (mac && e.ctrlKey && b == 1) b = 3;
  27896. return b;
  27897. }
  27898. // EVENT HANDLING
  27899. // Lightweight event framework. on/off also work on DOM nodes,
  27900. // registering native DOM handlers.
  27901. var on = CodeMirror.on = function(emitter, type, f) {
  27902. if (emitter.addEventListener)
  27903. emitter.addEventListener(type, f, false);
  27904. else if (emitter.attachEvent)
  27905. emitter.attachEvent("on" + type, f);
  27906. else {
  27907. var map = emitter._handlers || (emitter._handlers = {});
  27908. var arr = map[type] || (map[type] = []);
  27909. arr.push(f);
  27910. }
  27911. };
  27912. var noHandlers = []
  27913. function getHandlers(emitter, type, copy) {
  27914. var arr = emitter._handlers && emitter._handlers[type]
  27915. if (copy) return arr && arr.length > 0 ? arr.slice() : noHandlers
  27916. else return arr || noHandlers
  27917. }
  27918. var off = CodeMirror.off = function(emitter, type, f) {
  27919. if (emitter.removeEventListener)
  27920. emitter.removeEventListener(type, f, false);
  27921. else if (emitter.detachEvent)
  27922. emitter.detachEvent("on" + type, f);
  27923. else {
  27924. var handlers = getHandlers(emitter, type, false)
  27925. for (var i = 0; i < handlers.length; ++i)
  27926. if (handlers[i] == f) { handlers.splice(i, 1); break; }
  27927. }
  27928. };
  27929. var signal = CodeMirror.signal = function(emitter, type /*, values...*/) {
  27930. var handlers = getHandlers(emitter, type, true)
  27931. if (!handlers.length) return;
  27932. var args = Array.prototype.slice.call(arguments, 2);
  27933. for (var i = 0; i < handlers.length; ++i) handlers[i].apply(null, args);
  27934. };
  27935. var orphanDelayedCallbacks = null;
  27936. // Often, we want to signal events at a point where we are in the
  27937. // middle of some work, but don't want the handler to start calling
  27938. // other methods on the editor, which might be in an inconsistent
  27939. // state or simply not expect any other events to happen.
  27940. // signalLater looks whether there are any handlers, and schedules
  27941. // them to be executed when the last operation ends, or, if no
  27942. // operation is active, when a timeout fires.
  27943. function signalLater(emitter, type /*, values...*/) {
  27944. var arr = getHandlers(emitter, type, false)
  27945. if (!arr.length) return;
  27946. var args = Array.prototype.slice.call(arguments, 2), list;
  27947. if (operationGroup) {
  27948. list = operationGroup.delayedCallbacks;
  27949. } else if (orphanDelayedCallbacks) {
  27950. list = orphanDelayedCallbacks;
  27951. } else {
  27952. list = orphanDelayedCallbacks = [];
  27953. setTimeout(fireOrphanDelayed, 0);
  27954. }
  27955. function bnd(f) {return function(){f.apply(null, args);};};
  27956. for (var i = 0; i < arr.length; ++i)
  27957. list.push(bnd(arr[i]));
  27958. }
  27959. function fireOrphanDelayed() {
  27960. var delayed = orphanDelayedCallbacks;
  27961. orphanDelayedCallbacks = null;
  27962. for (var i = 0; i < delayed.length; ++i) delayed[i]();
  27963. }
  27964. // The DOM events that CodeMirror handles can be overridden by
  27965. // registering a (non-DOM) handler on the editor for the event name,
  27966. // and preventDefault-ing the event in that handler.
  27967. function signalDOMEvent(cm, e, override) {
  27968. if (typeof e == "string")
  27969. e = {type: e, preventDefault: function() { this.defaultPrevented = true; }};
  27970. signal(cm, override || e.type, cm, e);
  27971. return e_defaultPrevented(e) || e.codemirrorIgnore;
  27972. }
  27973. function signalCursorActivity(cm) {
  27974. var arr = cm._handlers && cm._handlers.cursorActivity;
  27975. if (!arr) return;
  27976. var set = cm.curOp.cursorActivityHandlers || (cm.curOp.cursorActivityHandlers = []);
  27977. for (var i = 0; i < arr.length; ++i) if (indexOf(set, arr[i]) == -1)
  27978. set.push(arr[i]);
  27979. }
  27980. function hasHandler(emitter, type) {
  27981. return getHandlers(emitter, type).length > 0
  27982. }
  27983. // Add on and off methods to a constructor's prototype, to make
  27984. // registering events on such objects more convenient.
  27985. function eventMixin(ctor) {
  27986. ctor.prototype.on = function(type, f) {on(this, type, f);};
  27987. ctor.prototype.off = function(type, f) {off(this, type, f);};
  27988. }
  27989. // MISC UTILITIES
  27990. // Number of pixels added to scroller and sizer to hide scrollbar
  27991. var scrollerGap = 30;
  27992. // Returned or thrown by various protocols to signal 'I'm not
  27993. // handling this'.
  27994. var Pass = CodeMirror.Pass = {toString: function(){return "CodeMirror.Pass";}};
  27995. // Reused option objects for setSelection & friends
  27996. var sel_dontScroll = {scroll: false}, sel_mouse = {origin: "*mouse"}, sel_move = {origin: "+move"};
  27997. function Delayed() {this.id = null;}
  27998. Delayed.prototype.set = function(ms, f) {
  27999. clearTimeout(this.id);
  28000. this.id = setTimeout(f, ms);
  28001. };
  28002. // Counts the column offset in a string, taking tabs into account.
  28003. // Used mostly to find indentation.
  28004. var countColumn = CodeMirror.countColumn = function(string, end, tabSize, startIndex, startValue) {
  28005. if (end == null) {
  28006. end = string.search(/[^\s\u00a0]/);
  28007. if (end == -1) end = string.length;
  28008. }
  28009. for (var i = startIndex || 0, n = startValue || 0;;) {
  28010. var nextTab = string.indexOf("\t", i);
  28011. if (nextTab < 0 || nextTab >= end)
  28012. return n + (end - i);
  28013. n += nextTab - i;
  28014. n += tabSize - (n % tabSize);
  28015. i = nextTab + 1;
  28016. }
  28017. };
  28018. // The inverse of countColumn -- find the offset that corresponds to
  28019. // a particular column.
  28020. var findColumn = CodeMirror.findColumn = function(string, goal, tabSize) {
  28021. for (var pos = 0, col = 0;;) {
  28022. var nextTab = string.indexOf("\t", pos);
  28023. if (nextTab == -1) nextTab = string.length;
  28024. var skipped = nextTab - pos;
  28025. if (nextTab == string.length || col + skipped >= goal)
  28026. return pos + Math.min(skipped, goal - col);
  28027. col += nextTab - pos;
  28028. col += tabSize - (col % tabSize);
  28029. pos = nextTab + 1;
  28030. if (col >= goal) return pos;
  28031. }
  28032. }
  28033. var spaceStrs = [""];
  28034. function spaceStr(n) {
  28035. while (spaceStrs.length <= n)
  28036. spaceStrs.push(lst(spaceStrs) + " ");
  28037. return spaceStrs[n];
  28038. }
  28039. function lst(arr) { return arr[arr.length-1]; }
  28040. var selectInput = function(node) { node.select(); };
  28041. if (ios) // Mobile Safari apparently has a bug where select() is broken.
  28042. selectInput = function(node) { node.selectionStart = 0; node.selectionEnd = node.value.length; };
  28043. else if (ie) // Suppress mysterious IE10 errors
  28044. selectInput = function(node) { try { node.select(); } catch(_e) {} };
  28045. function indexOf(array, elt) {
  28046. for (var i = 0; i < array.length; ++i)
  28047. if (array[i] == elt) return i;
  28048. return -1;
  28049. }
  28050. function map(array, f) {
  28051. var out = [];
  28052. for (var i = 0; i < array.length; i++) out[i] = f(array[i], i);
  28053. return out;
  28054. }
  28055. function nothing() {}
  28056. function createObj(base, props) {
  28057. var inst;
  28058. if (Object.create) {
  28059. inst = Object.create(base);
  28060. } else {
  28061. nothing.prototype = base;
  28062. inst = new nothing();
  28063. }
  28064. if (props) copyObj(props, inst);
  28065. return inst;
  28066. };
  28067. function copyObj(obj, target, overwrite) {
  28068. if (!target) target = {};
  28069. for (var prop in obj)
  28070. if (obj.hasOwnProperty(prop) && (overwrite !== false || !target.hasOwnProperty(prop)))
  28071. target[prop] = obj[prop];
  28072. return target;
  28073. }
  28074. function bind(f) {
  28075. var args = Array.prototype.slice.call(arguments, 1);
  28076. return function(){return f.apply(null, args);};
  28077. }
  28078. var nonASCIISingleCaseWordChar = /[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;
  28079. var isWordCharBasic = CodeMirror.isWordChar = function(ch) {
  28080. return /\w/.test(ch) || ch > "\x80" &&
  28081. (ch.toUpperCase() != ch.toLowerCase() || nonASCIISingleCaseWordChar.test(ch));
  28082. };
  28083. function isWordChar(ch, helper) {
  28084. if (!helper) return isWordCharBasic(ch);
  28085. if (helper.source.indexOf("\\w") > -1 && isWordCharBasic(ch)) return true;
  28086. return helper.test(ch);
  28087. }
  28088. function isEmpty(obj) {
  28089. for (var n in obj) if (obj.hasOwnProperty(n) && obj[n]) return false;
  28090. return true;
  28091. }
  28092. // Extending unicode characters. A series of a non-extending char +
  28093. // any number of extending chars is treated as a single unit as far
  28094. // as editing and measuring is concerned. This is not fully correct,
  28095. // since some scripts/fonts/browsers also treat other configurations
  28096. // of code points as a group.
  28097. var extendingChars = /[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;
  28098. function isExtendingChar(ch) { return ch.charCodeAt(0) >= 768 && extendingChars.test(ch); }
  28099. // DOM UTILITIES
  28100. function elt(tag, content, className, style) {
  28101. var e = document.createElement(tag);
  28102. if (className) e.className = className;
  28103. if (style) e.style.cssText = style;
  28104. if (typeof content == "string") e.appendChild(document.createTextNode(content));
  28105. else if (content) for (var i = 0; i < content.length; ++i) e.appendChild(content[i]);
  28106. return e;
  28107. }
  28108. var range;
  28109. if (document.createRange) range = function(node, start, end, endNode) {
  28110. var r = document.createRange();
  28111. r.setEnd(endNode || node, end);
  28112. r.setStart(node, start);
  28113. return r;
  28114. };
  28115. else range = function(node, start, end) {
  28116. var r = document.body.createTextRange();
  28117. try { r.moveToElementText(node.parentNode); }
  28118. catch(e) { return r; }
  28119. r.collapse(true);
  28120. r.moveEnd("character", end);
  28121. r.moveStart("character", start);
  28122. return r;
  28123. };
  28124. function removeChildren(e) {
  28125. for (var count = e.childNodes.length; count > 0; --count)
  28126. e.removeChild(e.firstChild);
  28127. return e;
  28128. }
  28129. function removeChildrenAndAdd(parent, e) {
  28130. return removeChildren(parent).appendChild(e);
  28131. }
  28132. var contains = CodeMirror.contains = function(parent, child) {
  28133. if (child.nodeType == 3) // Android browser always returns false when child is a textnode
  28134. child = child.parentNode;
  28135. if (parent.contains)
  28136. return parent.contains(child);
  28137. do {
  28138. if (child.nodeType == 11) child = child.host;
  28139. if (child == parent) return true;
  28140. } while (child = child.parentNode);
  28141. };
  28142. function activeElt() {
  28143. var activeElement = document.activeElement;
  28144. while (activeElement && activeElement.root && activeElement.root.activeElement)
  28145. activeElement = activeElement.root.activeElement;
  28146. return activeElement;
  28147. }
  28148. // Older versions of IE throws unspecified error when touching
  28149. // document.activeElement in some cases (during loading, in iframe)
  28150. if (ie && ie_version < 11) activeElt = function() {
  28151. try { return document.activeElement; }
  28152. catch(e) { return document.body; }
  28153. };
  28154. function classTest(cls) { return new RegExp("(^|\\s)" + cls + "(?:$|\\s)\\s*"); }
  28155. var rmClass = CodeMirror.rmClass = function(node, cls) {
  28156. var current = node.className;
  28157. var match = classTest(cls).exec(current);
  28158. if (match) {
  28159. var after = current.slice(match.index + match[0].length);
  28160. node.className = current.slice(0, match.index) + (after ? match[1] + after : "");
  28161. }
  28162. };
  28163. var addClass = CodeMirror.addClass = function(node, cls) {
  28164. var current = node.className;
  28165. if (!classTest(cls).test(current)) node.className += (current ? " " : "") + cls;
  28166. };
  28167. function joinClasses(a, b) {
  28168. var as = a.split(" ");
  28169. for (var i = 0; i < as.length; i++)
  28170. if (as[i] && !classTest(as[i]).test(b)) b += " " + as[i];
  28171. return b;
  28172. }
  28173. // WINDOW-WIDE EVENTS
  28174. // These must be handled carefully, because naively registering a
  28175. // handler for each editor will cause the editors to never be
  28176. // garbage collected.
  28177. function forEachCodeMirror(f) {
  28178. if (!document.body.getElementsByClassName) return;
  28179. var byClass = document.body.getElementsByClassName("CodeMirror");
  28180. for (var i = 0; i < byClass.length; i++) {
  28181. var cm = byClass[i].CodeMirror;
  28182. if (cm) f(cm);
  28183. }
  28184. }
  28185. var globalsRegistered = false;
  28186. function ensureGlobalHandlers() {
  28187. if (globalsRegistered) return;
  28188. registerGlobalHandlers();
  28189. globalsRegistered = true;
  28190. }
  28191. function registerGlobalHandlers() {
  28192. // When the window resizes, we need to refresh active editors.
  28193. var resizeTimer;
  28194. on(window, "resize", function() {
  28195. if (resizeTimer == null) resizeTimer = setTimeout(function() {
  28196. resizeTimer = null;
  28197. forEachCodeMirror(onResize);
  28198. }, 100);
  28199. });
  28200. // When the window loses focus, we want to show the editor as blurred
  28201. on(window, "blur", function() {
  28202. forEachCodeMirror(onBlur);
  28203. });
  28204. }
  28205. // FEATURE DETECTION
  28206. // Detect drag-and-drop
  28207. var dragAndDrop = function() {
  28208. // There is *some* kind of drag-and-drop support in IE6-8, but I
  28209. // couldn't get it to work yet.
  28210. if (ie && ie_version < 9) return false;
  28211. var div = elt('div');
  28212. return "draggable" in div || "dragDrop" in div;
  28213. }();
  28214. var zwspSupported;
  28215. function zeroWidthElement(measure) {
  28216. if (zwspSupported == null) {
  28217. var test = elt("span", "\u200b");
  28218. removeChildrenAndAdd(measure, elt("span", [test, document.createTextNode("x")]));
  28219. if (measure.firstChild.offsetHeight != 0)
  28220. zwspSupported = test.offsetWidth <= 1 && test.offsetHeight > 2 && !(ie && ie_version < 8);
  28221. }
  28222. var node = zwspSupported ? elt("span", "\u200b") :
  28223. elt("span", "\u00a0", null, "display: inline-block; width: 1px; margin-right: -1px");
  28224. node.setAttribute("cm-text", "");
  28225. return node;
  28226. }
  28227. // Feature-detect IE's crummy client rect reporting for bidi text
  28228. var badBidiRects;
  28229. function hasBadBidiRects(measure) {
  28230. if (badBidiRects != null) return badBidiRects;
  28231. var txt = removeChildrenAndAdd(measure, document.createTextNode("A\u062eA"));
  28232. var r0 = range(txt, 0, 1).getBoundingClientRect();
  28233. var r1 = range(txt, 1, 2).getBoundingClientRect();
  28234. removeChildren(measure);
  28235. if (!r0 || r0.left == r0.right) return false; // Safari returns null in some cases (#2780)
  28236. return badBidiRects = (r1.right - r0.right < 3);
  28237. }
  28238. // See if "".split is the broken IE version, if so, provide an
  28239. // alternative way to split lines.
  28240. var splitLinesAuto = CodeMirror.splitLines = "\n\nb".split(/\n/).length != 3 ? function(string) {
  28241. var pos = 0, result = [], l = string.length;
  28242. while (pos <= l) {
  28243. var nl = string.indexOf("\n", pos);
  28244. if (nl == -1) nl = string.length;
  28245. var line = string.slice(pos, string.charAt(nl - 1) == "\r" ? nl - 1 : nl);
  28246. var rt = line.indexOf("\r");
  28247. if (rt != -1) {
  28248. result.push(line.slice(0, rt));
  28249. pos += rt + 1;
  28250. } else {
  28251. result.push(line);
  28252. pos = nl + 1;
  28253. }
  28254. }
  28255. return result;
  28256. } : function(string){return string.split(/\r\n?|\n/);};
  28257. var hasSelection = window.getSelection ? function(te) {
  28258. try { return te.selectionStart != te.selectionEnd; }
  28259. catch(e) { return false; }
  28260. } : function(te) {
  28261. try {var range = te.ownerDocument.selection.createRange();}
  28262. catch(e) {}
  28263. if (!range || range.parentElement() != te) return false;
  28264. return range.compareEndPoints("StartToEnd", range) != 0;
  28265. };
  28266. var hasCopyEvent = (function() {
  28267. var e = elt("div");
  28268. if ("oncopy" in e) return true;
  28269. e.setAttribute("oncopy", "return;");
  28270. return typeof e.oncopy == "function";
  28271. })();
  28272. var badZoomedRects = null;
  28273. function hasBadZoomedRects(measure) {
  28274. if (badZoomedRects != null) return badZoomedRects;
  28275. var node = removeChildrenAndAdd(measure, elt("span", "x"));
  28276. var normal = node.getBoundingClientRect();
  28277. var fromRange = range(node, 0, 1).getBoundingClientRect();
  28278. return badZoomedRects = Math.abs(normal.left - fromRange.left) > 1;
  28279. }
  28280. // KEY NAMES
  28281. var keyNames = CodeMirror.keyNames = {
  28282. 3: "Enter", 8: "Backspace", 9: "Tab", 13: "Enter", 16: "Shift", 17: "Ctrl", 18: "Alt",
  28283. 19: "Pause", 20: "CapsLock", 27: "Esc", 32: "Space", 33: "PageUp", 34: "PageDown", 35: "End",
  28284. 36: "Home", 37: "Left", 38: "Up", 39: "Right", 40: "Down", 44: "PrintScrn", 45: "Insert",
  28285. 46: "Delete", 59: ";", 61: "=", 91: "Mod", 92: "Mod", 93: "Mod",
  28286. 106: "*", 107: "=", 109: "-", 110: ".", 111: "/", 127: "Delete",
  28287. 173: "-", 186: ";", 187: "=", 188: ",", 189: "-", 190: ".", 191: "/", 192: "`", 219: "[", 220: "\\",
  28288. 221: "]", 222: "'", 63232: "Up", 63233: "Down", 63234: "Left", 63235: "Right", 63272: "Delete",
  28289. 63273: "Home", 63275: "End", 63276: "PageUp", 63277: "PageDown", 63302: "Insert"
  28290. };
  28291. (function() {
  28292. // Number keys
  28293. for (var i = 0; i < 10; i++) keyNames[i + 48] = keyNames[i + 96] = String(i);
  28294. // Alphabetic keys
  28295. for (var i = 65; i <= 90; i++) keyNames[i] = String.fromCharCode(i);
  28296. // Function keys
  28297. for (var i = 1; i <= 12; i++) keyNames[i + 111] = keyNames[i + 63235] = "F" + i;
  28298. })();
  28299. // BIDI HELPERS
  28300. function iterateBidiSections(order, from, to, f) {
  28301. if (!order) return f(from, to, "ltr");
  28302. var found = false;
  28303. for (var i = 0; i < order.length; ++i) {
  28304. var part = order[i];
  28305. if (part.from < to && part.to > from || from == to && part.to == from) {
  28306. f(Math.max(part.from, from), Math.min(part.to, to), part.level == 1 ? "rtl" : "ltr");
  28307. found = true;
  28308. }
  28309. }
  28310. if (!found) f(from, to, "ltr");
  28311. }
  28312. function bidiLeft(part) { return part.level % 2 ? part.to : part.from; }
  28313. function bidiRight(part) { return part.level % 2 ? part.from : part.to; }
  28314. function lineLeft(line) { var order = getOrder(line); return order ? bidiLeft(order[0]) : 0; }
  28315. function lineRight(line) {
  28316. var order = getOrder(line);
  28317. if (!order) return line.text.length;
  28318. return bidiRight(lst(order));
  28319. }
  28320. function lineStart(cm, lineN) {
  28321. var line = getLine(cm.doc, lineN);
  28322. var visual = visualLine(line);
  28323. if (visual != line) lineN = lineNo(visual);
  28324. var order = getOrder(visual);
  28325. var ch = !order ? 0 : order[0].level % 2 ? lineRight(visual) : lineLeft(visual);
  28326. return Pos(lineN, ch);
  28327. }
  28328. function lineEnd(cm, lineN) {
  28329. var merged, line = getLine(cm.doc, lineN);
  28330. while (merged = collapsedSpanAtEnd(line)) {
  28331. line = merged.find(1, true).line;
  28332. lineN = null;
  28333. }
  28334. var order = getOrder(line);
  28335. var ch = !order ? line.text.length : order[0].level % 2 ? lineLeft(line) : lineRight(line);
  28336. return Pos(lineN == null ? lineNo(line) : lineN, ch);
  28337. }
  28338. function lineStartSmart(cm, pos) {
  28339. var start = lineStart(cm, pos.line);
  28340. var line = getLine(cm.doc, start.line);
  28341. var order = getOrder(line);
  28342. if (!order || order[0].level == 0) {
  28343. var firstNonWS = Math.max(0, line.text.search(/\S/));
  28344. var inWS = pos.line == start.line && pos.ch <= firstNonWS && pos.ch;
  28345. return Pos(start.line, inWS ? 0 : firstNonWS);
  28346. }
  28347. return start;
  28348. }
  28349. function compareBidiLevel(order, a, b) {
  28350. var linedir = order[0].level;
  28351. if (a == linedir) return true;
  28352. if (b == linedir) return false;
  28353. return a < b;
  28354. }
  28355. var bidiOther;
  28356. function getBidiPartAt(order, pos) {
  28357. bidiOther = null;
  28358. for (var i = 0, found; i < order.length; ++i) {
  28359. var cur = order[i];
  28360. if (cur.from < pos && cur.to > pos) return i;
  28361. if ((cur.from == pos || cur.to == pos)) {
  28362. if (found == null) {
  28363. found = i;
  28364. } else if (compareBidiLevel(order, cur.level, order[found].level)) {
  28365. if (cur.from != cur.to) bidiOther = found;
  28366. return i;
  28367. } else {
  28368. if (cur.from != cur.to) bidiOther = i;
  28369. return found;
  28370. }
  28371. }
  28372. }
  28373. return found;
  28374. }
  28375. function moveInLine(line, pos, dir, byUnit) {
  28376. if (!byUnit) return pos + dir;
  28377. do pos += dir;
  28378. while (pos > 0 && isExtendingChar(line.text.charAt(pos)));
  28379. return pos;
  28380. }
  28381. // This is needed in order to move 'visually' through bi-directional
  28382. // text -- i.e., pressing left should make the cursor go left, even
  28383. // when in RTL text. The tricky part is the 'jumps', where RTL and
  28384. // LTR text touch each other. This often requires the cursor offset
  28385. // to move more than one unit, in order to visually move one unit.
  28386. function moveVisually(line, start, dir, byUnit) {
  28387. var bidi = getOrder(line);
  28388. if (!bidi) return moveLogically(line, start, dir, byUnit);
  28389. var pos = getBidiPartAt(bidi, start), part = bidi[pos];
  28390. var target = moveInLine(line, start, part.level % 2 ? -dir : dir, byUnit);
  28391. for (;;) {
  28392. if (target > part.from && target < part.to) return target;
  28393. if (target == part.from || target == part.to) {
  28394. if (getBidiPartAt(bidi, target) == pos) return target;
  28395. part = bidi[pos += dir];
  28396. return (dir > 0) == part.level % 2 ? part.to : part.from;
  28397. } else {
  28398. part = bidi[pos += dir];
  28399. if (!part) return null;
  28400. if ((dir > 0) == part.level % 2)
  28401. target = moveInLine(line, part.to, -1, byUnit);
  28402. else
  28403. target = moveInLine(line, part.from, 1, byUnit);
  28404. }
  28405. }
  28406. }
  28407. function moveLogically(line, start, dir, byUnit) {
  28408. var target = start + dir;
  28409. if (byUnit) while (target > 0 && isExtendingChar(line.text.charAt(target))) target += dir;
  28410. return target < 0 || target > line.text.length ? null : target;
  28411. }
  28412. // Bidirectional ordering algorithm
  28413. // See http://unicode.org/reports/tr9/tr9-13.html for the algorithm
  28414. // that this (partially) implements.
  28415. // One-char codes used for character types:
  28416. // L (L): Left-to-Right
  28417. // R (R): Right-to-Left
  28418. // r (AL): Right-to-Left Arabic
  28419. // 1 (EN): European Number
  28420. // + (ES): European Number Separator
  28421. // % (ET): European Number Terminator
  28422. // n (AN): Arabic Number
  28423. // , (CS): Common Number Separator
  28424. // m (NSM): Non-Spacing Mark
  28425. // b (BN): Boundary Neutral
  28426. // s (B): Paragraph Separator
  28427. // t (S): Segment Separator
  28428. // w (WS): Whitespace
  28429. // N (ON): Other Neutrals
  28430. // Returns null if characters are ordered as they appear
  28431. // (left-to-right), or an array of sections ({from, to, level}
  28432. // objects) in the order in which they occur visually.
  28433. var bidiOrdering = (function() {
  28434. // Character types for codepoints 0 to 0xff
  28435. var lowTypes = "bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN";
  28436. // Character types for codepoints 0x600 to 0x6ff
  28437. var arabicTypes = "rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmm";
  28438. function charType(code) {
  28439. if (code <= 0xf7) return lowTypes.charAt(code);
  28440. else if (0x590 <= code && code <= 0x5f4) return "R";
  28441. else if (0x600 <= code && code <= 0x6ed) return arabicTypes.charAt(code - 0x600);
  28442. else if (0x6ee <= code && code <= 0x8ac) return "r";
  28443. else if (0x2000 <= code && code <= 0x200b) return "w";
  28444. else if (code == 0x200c) return "b";
  28445. else return "L";
  28446. }
  28447. var bidiRE = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;
  28448. var isNeutral = /[stwN]/, isStrong = /[LRr]/, countsAsLeft = /[Lb1n]/, countsAsNum = /[1n]/;
  28449. // Browsers seem to always treat the boundaries of block elements as being L.
  28450. var outerType = "L";
  28451. function BidiSpan(level, from, to) {
  28452. this.level = level;
  28453. this.from = from; this.to = to;
  28454. }
  28455. return function(str) {
  28456. if (!bidiRE.test(str)) return false;
  28457. var len = str.length, types = [];
  28458. for (var i = 0, type; i < len; ++i)
  28459. types.push(type = charType(str.charCodeAt(i)));
  28460. // W1. Examine each non-spacing mark (NSM) in the level run, and
  28461. // change the type of the NSM to the type of the previous
  28462. // character. If the NSM is at the start of the level run, it will
  28463. // get the type of sor.
  28464. for (var i = 0, prev = outerType; i < len; ++i) {
  28465. var type = types[i];
  28466. if (type == "m") types[i] = prev;
  28467. else prev = type;
  28468. }
  28469. // W2. Search backwards from each instance of a European number
  28470. // until the first strong type (R, L, AL, or sor) is found. If an
  28471. // AL is found, change the type of the European number to Arabic
  28472. // number.
  28473. // W3. Change all ALs to R.
  28474. for (var i = 0, cur = outerType; i < len; ++i) {
  28475. var type = types[i];
  28476. if (type == "1" && cur == "r") types[i] = "n";
  28477. else if (isStrong.test(type)) { cur = type; if (type == "r") types[i] = "R"; }
  28478. }
  28479. // W4. A single European separator between two European numbers
  28480. // changes to a European number. A single common separator between
  28481. // two numbers of the same type changes to that type.
  28482. for (var i = 1, prev = types[0]; i < len - 1; ++i) {
  28483. var type = types[i];
  28484. if (type == "+" && prev == "1" && types[i+1] == "1") types[i] = "1";
  28485. else if (type == "," && prev == types[i+1] &&
  28486. (prev == "1" || prev == "n")) types[i] = prev;
  28487. prev = type;
  28488. }
  28489. // W5. A sequence of European terminators adjacent to European
  28490. // numbers changes to all European numbers.
  28491. // W6. Otherwise, separators and terminators change to Other
  28492. // Neutral.
  28493. for (var i = 0; i < len; ++i) {
  28494. var type = types[i];
  28495. if (type == ",") types[i] = "N";
  28496. else if (type == "%") {
  28497. for (var end = i + 1; end < len && types[end] == "%"; ++end) {}
  28498. var replace = (i && types[i-1] == "!") || (end < len && types[end] == "1") ? "1" : "N";
  28499. for (var j = i; j < end; ++j) types[j] = replace;
  28500. i = end - 1;
  28501. }
  28502. }
  28503. // W7. Search backwards from each instance of a European number
  28504. // until the first strong type (R, L, or sor) is found. If an L is
  28505. // found, then change the type of the European number to L.
  28506. for (var i = 0, cur = outerType; i < len; ++i) {
  28507. var type = types[i];
  28508. if (cur == "L" && type == "1") types[i] = "L";
  28509. else if (isStrong.test(type)) cur = type;
  28510. }
  28511. // N1. A sequence of neutrals takes the direction of the
  28512. // surrounding strong text if the text on both sides has the same
  28513. // direction. European and Arabic numbers act as if they were R in
  28514. // terms of their influence on neutrals. Start-of-level-run (sor)
  28515. // and end-of-level-run (eor) are used at level run boundaries.
  28516. // N2. Any remaining neutrals take the embedding direction.
  28517. for (var i = 0; i < len; ++i) {
  28518. if (isNeutral.test(types[i])) {
  28519. for (var end = i + 1; end < len && isNeutral.test(types[end]); ++end) {}
  28520. var before = (i ? types[i-1] : outerType) == "L";
  28521. var after = (end < len ? types[end] : outerType) == "L";
  28522. var replace = before || after ? "L" : "R";
  28523. for (var j = i; j < end; ++j) types[j] = replace;
  28524. i = end - 1;
  28525. }
  28526. }
  28527. // Here we depart from the documented algorithm, in order to avoid
  28528. // building up an actual levels array. Since there are only three
  28529. // levels (0, 1, 2) in an implementation that doesn't take
  28530. // explicit embedding into account, we can build up the order on
  28531. // the fly, without following the level-based algorithm.
  28532. var order = [], m;
  28533. for (var i = 0; i < len;) {
  28534. if (countsAsLeft.test(types[i])) {
  28535. var start = i;
  28536. for (++i; i < len && countsAsLeft.test(types[i]); ++i) {}
  28537. order.push(new BidiSpan(0, start, i));
  28538. } else {
  28539. var pos = i, at = order.length;
  28540. for (++i; i < len && types[i] != "L"; ++i) {}
  28541. for (var j = pos; j < i;) {
  28542. if (countsAsNum.test(types[j])) {
  28543. if (pos < j) order.splice(at, 0, new BidiSpan(1, pos, j));
  28544. var nstart = j;
  28545. for (++j; j < i && countsAsNum.test(types[j]); ++j) {}
  28546. order.splice(at, 0, new BidiSpan(2, nstart, j));
  28547. pos = j;
  28548. } else ++j;
  28549. }
  28550. if (pos < i) order.splice(at, 0, new BidiSpan(1, pos, i));
  28551. }
  28552. }
  28553. if (order[0].level == 1 && (m = str.match(/^\s+/))) {
  28554. order[0].from = m[0].length;
  28555. order.unshift(new BidiSpan(0, 0, m[0].length));
  28556. }
  28557. if (lst(order).level == 1 && (m = str.match(/\s+$/))) {
  28558. lst(order).to -= m[0].length;
  28559. order.push(new BidiSpan(0, len - m[0].length, len));
  28560. }
  28561. if (order[0].level == 2)
  28562. order.unshift(new BidiSpan(1, order[0].to, order[0].to));
  28563. if (order[0].level != lst(order).level)
  28564. order.push(new BidiSpan(order[0].level, len, len));
  28565. return order;
  28566. };
  28567. })();
  28568. // THE END
  28569. CodeMirror.version = "5.17.0";
  28570. return CodeMirror;
  28571. });
  28572. /***/ },
  28573. /* 206 */
  28574. /***/ function(module, exports, __webpack_require__) {
  28575. // custom mode
  28576. 'use strict';
  28577. Object.defineProperty(exports, "__esModule", {
  28578. value: true
  28579. });
  28580. exports.default = function () {
  28581. _codemirror2.default.defineMode('host', function () {
  28582. function tokenBase(stream) {
  28583. if (stream.eatSpace()) return null;
  28584. var sol = stream.sol();
  28585. var ch = stream.next();
  28586. var s = stream.string;
  28587. if (ch === '#') {
  28588. stream.skipToEnd();
  28589. return 'comment';
  28590. }
  28591. if (!s.match(/^\s*([\d\.]+|[\da-f:\.%lo]+)\s+\w/i)) {
  28592. return 'error';
  28593. }
  28594. if (sol && ch.match(/[\w\.:%]/)) {
  28595. stream.eatWhile(/[\w\.:%]/);
  28596. return 'ip';
  28597. }
  28598. return null;
  28599. }
  28600. function tokenize(stream, state) {
  28601. return (state.tokens[0] || tokenBase)(stream, state);
  28602. }
  28603. return {
  28604. startState: function startState() {
  28605. return { tokens: [] };
  28606. },
  28607. token: function token(stream, state) {
  28608. return tokenize(stream, state);
  28609. },
  28610. lineComment: '#'
  28611. };
  28612. });
  28613. //CodeMirror.defineMIME('text/x-host', 'host');
  28614. };
  28615. var _codemirror = __webpack_require__(205);
  28616. var _codemirror2 = _interopRequireDefault(_codemirror);
  28617. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  28618. /***/ },
  28619. /* 207 */
  28620. /***/ function(module, exports, __webpack_require__) {
  28621. // style-loader: Adds some css to the DOM by adding a <style> tag
  28622. // load the styles
  28623. var content = __webpack_require__(208);
  28624. if(typeof content === 'string') content = [[module.id, content, '']];
  28625. // add the styles to the DOM
  28626. var update = __webpack_require__(181)(content, {});
  28627. if(content.locals) module.exports = content.locals;
  28628. // Hot Module Replacement
  28629. if(false) {
  28630. // When the styles change, update the <style> tags
  28631. if(!content.locals) {
  28632. module.hot.accept("!!./../../css-loader/index.js!./codemirror.css", function() {
  28633. var newContent = require("!!./../../css-loader/index.js!./codemirror.css");
  28634. if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
  28635. update(newContent);
  28636. });
  28637. }
  28638. // When the module is disposed, remove the <style> tags
  28639. module.hot.dispose(function() { update(); });
  28640. }
  28641. /***/ },
  28642. /* 208 */
  28643. /***/ function(module, exports, __webpack_require__) {
  28644. exports = module.exports = __webpack_require__(180)();
  28645. // imports
  28646. // module
  28647. exports.push([module.id, "/* BASICS */\n\n.CodeMirror {\n /* Set height, width, borders, and global font properties here */\n font-family: monospace;\n height: 300px;\n color: black;\n}\n\n/* PADDING */\n\n.CodeMirror-lines {\n padding: 4px 0; /* Vertical padding around content */\n}\n.CodeMirror pre {\n padding: 0 4px; /* Horizontal padding of content */\n}\n\n.CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {\n background-color: white; /* The little square between H and V scrollbars */\n}\n\n/* GUTTER */\n\n.CodeMirror-gutters {\n border-right: 1px solid #ddd;\n background-color: #f7f7f7;\n white-space: nowrap;\n}\n.CodeMirror-linenumbers {}\n.CodeMirror-linenumber {\n padding: 0 3px 0 5px;\n min-width: 20px;\n text-align: right;\n color: #999;\n white-space: nowrap;\n}\n\n.CodeMirror-guttermarker { color: black; }\n.CodeMirror-guttermarker-subtle { color: #999; }\n\n/* CURSOR */\n\n.CodeMirror-cursor {\n border-left: 1px solid black;\n border-right: none;\n width: 0;\n}\n/* Shown when moving in bi-directional text */\n.CodeMirror div.CodeMirror-secondarycursor {\n border-left: 1px solid silver;\n}\n.cm-fat-cursor .CodeMirror-cursor {\n width: auto;\n border: 0 !important;\n background: #7e7;\n}\n.cm-fat-cursor div.CodeMirror-cursors {\n z-index: 1;\n}\n\n.cm-animate-fat-cursor {\n width: auto;\n border: 0;\n -webkit-animation: blink 1.06s steps(1) infinite;\n -moz-animation: blink 1.06s steps(1) infinite;\n animation: blink 1.06s steps(1) infinite;\n background-color: #7e7;\n}\n@-moz-keyframes blink {\n 0% {}\n 50% { background-color: transparent; }\n 100% {}\n}\n@-webkit-keyframes blink {\n 0% {}\n 50% { background-color: transparent; }\n 100% {}\n}\n@keyframes blink {\n 0% {}\n 50% { background-color: transparent; }\n 100% {}\n}\n\n/* Can style cursor different in overwrite (non-insert) mode */\n.CodeMirror-overwrite .CodeMirror-cursor {}\n\n.cm-tab { display: inline-block; text-decoration: inherit; }\n\n.CodeMirror-rulers {\n position: absolute;\n left: 0; right: 0; top: -50px; bottom: -20px;\n overflow: hidden;\n}\n.CodeMirror-ruler {\n border-left: 1px solid #ccc;\n top: 0; bottom: 0;\n position: absolute;\n}\n\n/* DEFAULT THEME */\n\n.cm-s-default .cm-header {color: blue;}\n.cm-s-default .cm-quote {color: #090;}\n.cm-negative {color: #d44;}\n.cm-positive {color: #292;}\n.cm-header, .cm-strong {font-weight: bold;}\n.cm-em {font-style: italic;}\n.cm-link {text-decoration: underline;}\n.cm-strikethrough {text-decoration: line-through;}\n\n.cm-s-default .cm-keyword {color: #708;}\n.cm-s-default .cm-atom {color: #219;}\n.cm-s-default .cm-number {color: #164;}\n.cm-s-default .cm-def {color: #00f;}\n.cm-s-default .cm-variable,\n.cm-s-default .cm-punctuation,\n.cm-s-default .cm-property,\n.cm-s-default .cm-operator {}\n.cm-s-default .cm-variable-2 {color: #05a;}\n.cm-s-default .cm-variable-3 {color: #085;}\n.cm-s-default .cm-comment {color: #a50;}\n.cm-s-default .cm-string {color: #a11;}\n.cm-s-default .cm-string-2 {color: #f50;}\n.cm-s-default .cm-meta {color: #555;}\n.cm-s-default .cm-qualifier {color: #555;}\n.cm-s-default .cm-builtin {color: #30a;}\n.cm-s-default .cm-bracket {color: #997;}\n.cm-s-default .cm-tag {color: #170;}\n.cm-s-default .cm-attribute {color: #00c;}\n.cm-s-default .cm-hr {color: #999;}\n.cm-s-default .cm-link {color: #00c;}\n\n.cm-s-default .cm-error {color: #f00;}\n.cm-invalidchar {color: #f00;}\n\n.CodeMirror-composing { border-bottom: 2px solid; }\n\n/* Default styles for common addons */\n\ndiv.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;}\ndiv.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}\n.CodeMirror-matchingtag { background: rgba(255, 150, 0, .3); }\n.CodeMirror-activeline-background {background: #e8f2ff;}\n\n/* STOP */\n\n/* The rest of this file contains styles related to the mechanics of\n the editor. You probably shouldn't touch them. */\n\n.CodeMirror {\n position: relative;\n overflow: hidden;\n background: white;\n}\n\n.CodeMirror-scroll {\n overflow: scroll !important; /* Things will break if this is overridden */\n /* 30px is the magic margin used to hide the element's real scrollbars */\n /* See overflow: hidden in .CodeMirror */\n margin-bottom: -30px; margin-right: -30px;\n padding-bottom: 30px;\n height: 100%;\n outline: none; /* Prevent dragging from highlighting the element */\n position: relative;\n}\n.CodeMirror-sizer {\n position: relative;\n border-right: 30px solid transparent;\n}\n\n/* The fake, visible scrollbars. Used to force redraw during scrolling\n before actual scrolling happens, thus preventing shaking and\n flickering artifacts. */\n.CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {\n position: absolute;\n z-index: 6;\n display: none;\n}\n.CodeMirror-vscrollbar {\n right: 0; top: 0;\n overflow-x: hidden;\n overflow-y: scroll;\n}\n.CodeMirror-hscrollbar {\n bottom: 0; left: 0;\n overflow-y: hidden;\n overflow-x: scroll;\n}\n.CodeMirror-scrollbar-filler {\n right: 0; bottom: 0;\n}\n.CodeMirror-gutter-filler {\n left: 0; bottom: 0;\n}\n\n.CodeMirror-gutters {\n position: absolute; left: 0; top: 0;\n min-height: 100%;\n z-index: 3;\n}\n.CodeMirror-gutter {\n white-space: normal;\n height: 100%;\n display: inline-block;\n vertical-align: top;\n margin-bottom: -30px;\n /* Hack to make IE7 behave */\n *zoom:1;\n *display:inline;\n}\n.CodeMirror-gutter-wrapper {\n position: absolute;\n z-index: 4;\n background: none !important;\n border: none !important;\n}\n.CodeMirror-gutter-background {\n position: absolute;\n top: 0; bottom: 0;\n z-index: 4;\n}\n.CodeMirror-gutter-elt {\n position: absolute;\n cursor: default;\n z-index: 4;\n}\n.CodeMirror-gutter-wrapper {\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n}\n\n.CodeMirror-lines {\n cursor: text;\n min-height: 1px; /* prevents collapsing before first draw */\n}\n.CodeMirror pre {\n /* Reset some styles that the rest of the page might have set */\n -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0;\n border-width: 0;\n background: transparent;\n font-family: inherit;\n font-size: inherit;\n margin: 0;\n white-space: pre;\n word-wrap: normal;\n line-height: inherit;\n color: inherit;\n z-index: 2;\n position: relative;\n overflow: visible;\n -webkit-tap-highlight-color: transparent;\n -webkit-font-variant-ligatures: none;\n font-variant-ligatures: none;\n}\n.CodeMirror-wrap pre {\n word-wrap: break-word;\n white-space: pre-wrap;\n word-break: normal;\n}\n\n.CodeMirror-linebackground {\n position: absolute;\n left: 0; right: 0; top: 0; bottom: 0;\n z-index: 0;\n}\n\n.CodeMirror-linewidget {\n position: relative;\n z-index: 2;\n overflow: auto;\n}\n\n.CodeMirror-widget {}\n\n.CodeMirror-code {\n outline: none;\n}\n\n/* Force content-box sizing for the elements where we expect it */\n.CodeMirror-scroll,\n.CodeMirror-sizer,\n.CodeMirror-gutter,\n.CodeMirror-gutters,\n.CodeMirror-linenumber {\n -moz-box-sizing: content-box;\n box-sizing: content-box;\n}\n\n.CodeMirror-measure {\n position: absolute;\n width: 100%;\n height: 0;\n overflow: hidden;\n visibility: hidden;\n}\n\n.CodeMirror-cursor {\n position: absolute;\n pointer-events: none;\n}\n.CodeMirror-measure pre { position: static; }\n\ndiv.CodeMirror-cursors {\n visibility: hidden;\n position: relative;\n z-index: 3;\n}\ndiv.CodeMirror-dragcursors {\n visibility: visible;\n}\n\n.CodeMirror-focused div.CodeMirror-cursors {\n visibility: visible;\n}\n\n.CodeMirror-selected { background: #d9d9d9; }\n.CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; }\n.CodeMirror-crosshair { cursor: crosshair; }\n.CodeMirror-line::selection, .CodeMirror-line > span::selection, .CodeMirror-line > span > span::selection { background: #d7d4f0; }\n.CodeMirror-line::-moz-selection, .CodeMirror-line > span::-moz-selection, .CodeMirror-line > span > span::-moz-selection { background: #d7d4f0; }\n\n.cm-searching {\n background: #ffa;\n background: rgba(255, 255, 0, .4);\n}\n\n/* IE7 hack to prevent it from returning funny offsetTops on the spans */\n.CodeMirror span { *vertical-align: text-bottom; }\n\n/* Used to force a border model for a node */\n.cm-force-border { padding-right: .1px; }\n\n@media print {\n /* Hide the cursor when printing */\n .CodeMirror div.CodeMirror-cursors {\n visibility: hidden;\n }\n}\n\n/* See issue #2901 */\n.cm-tab-wrap-hack:after { content: ''; }\n\n/* Help users use markselection to safely style text background */\nspan.CodeMirror-selectedtext { background: none; }\n", ""]);
  28648. // exports
  28649. /***/ },
  28650. /* 209 */
  28651. /***/ function(module, exports, __webpack_require__) {
  28652. // style-loader: Adds some css to the DOM by adding a <style> tag
  28653. // load the styles
  28654. var content = __webpack_require__(210);
  28655. if(typeof content === 'string') content = [[module.id, content, '']];
  28656. // add the styles to the DOM
  28657. var update = __webpack_require__(181)(content, {});
  28658. if(content.locals) module.exports = content.locals;
  28659. // Hot Module Replacement
  28660. if(false) {
  28661. // When the styles change, update the <style> tags
  28662. if(!content.locals) {
  28663. module.hot.accept("!!./../../../node_modules/css-loader/index.js!./../../../node_modules/less-loader/index.js!./editor.less", function() {
  28664. var newContent = require("!!./../../../node_modules/css-loader/index.js!./../../../node_modules/less-loader/index.js!./editor.less");
  28665. if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
  28666. update(newContent);
  28667. });
  28668. }
  28669. // When the module is disposed, remove the <style> tags
  28670. module.hot.dispose(function() { update(); });
  28671. }
  28672. /***/ },
  28673. /* 210 */
  28674. /***/ function(module, exports, __webpack_require__) {
  28675. exports = module.exports = __webpack_require__(180)();
  28676. // imports
  28677. // module
  28678. exports.push([module.id, "#sh-editor {\n height: 100%;\n font-family: Menlo, \"Source Code Pro\", Monaco, \"Courier New\", sans-serif;\n}\n#sh-editor .cm-s-default .cm-comment {\n color: #090;\n}\n#sh-editor .cm-s-default .cm-ip {\n color: #00a;\n font-weight: bold;\n}\n#sh-editor .cm-s-default .cm-hl {\n background: #ff0;\n}\n#sh-editor .CodeMirror-gutters {\n border-right: none;\n padding-right: 6px;\n}\n#sh-editor .CodeMirror-linenumber {\n cursor: pointer;\n}\n#sh-editor.readonly .CodeMirror .CodeMirror-linenumber {\n cursor: default;\n}\n#sh-editor.readonly .CodeMirror .CodeMirror-cursors {\n display: none;\n}\n", ""]);
  28679. // exports
  28680. /***/ },
  28681. /* 211 */
  28682. /***/ function(module, exports, __webpack_require__) {
  28683. // style-loader: Adds some css to the DOM by adding a <style> tag
  28684. // load the styles
  28685. var content = __webpack_require__(212);
  28686. if(typeof content === 'string') content = [[module.id, content, '']];
  28687. // add the styles to the DOM
  28688. var update = __webpack_require__(181)(content, {});
  28689. if(content.locals) module.exports = content.locals;
  28690. // Hot Module Replacement
  28691. if(false) {
  28692. // When the styles change, update the <style> tags
  28693. if(!content.locals) {
  28694. module.hot.accept("!!./../../../node_modules/css-loader/index.js!./../../../node_modules/less-loader/index.js!./content.less", function() {
  28695. var newContent = require("!!./../../../node_modules/css-loader/index.js!./../../../node_modules/less-loader/index.js!./content.less");
  28696. if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
  28697. update(newContent);
  28698. });
  28699. }
  28700. // When the module is disposed, remove the <style> tags
  28701. module.hot.dispose(function() { update(); });
  28702. }
  28703. /***/ },
  28704. /* 212 */
  28705. /***/ function(module, exports, __webpack_require__) {
  28706. exports = module.exports = __webpack_require__(180)();
  28707. // imports
  28708. // module
  28709. exports.push([module.id, "#sh-content {\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n left: 240px;\n height: 100%;\n}\n#sh-content .inform {\n position: absolute;\n z-index: 100;\n top: 5px;\n right: 10px;\n opacity: 0.5;\n background: #fff;\n}\n#sh-content .inform i {\n display: none;\n color: #666;\n margin-left: 5px;\n}\n#sh-content .inform i.show {\n display: inline-block;\n}\n#sh-content .inform span {\n display: none;\n}\n#sh-content .inform span.show {\n display: inline-block;\n}\n", ""]);
  28710. // exports
  28711. /***/ },
  28712. /* 213 */
  28713. /***/ function(module, exports, __webpack_require__) {
  28714. /**
  28715. * @author oldj
  28716. * @blog http://oldj.net
  28717. */
  28718. 'use strict';
  28719. Object.defineProperty(exports, "__esModule", {
  28720. value: true
  28721. });
  28722. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  28723. var _react = __webpack_require__(3);
  28724. var _react2 = _interopRequireDefault(_react);
  28725. var _frame = __webpack_require__(214);
  28726. var _frame2 = _interopRequireDefault(_frame);
  28727. __webpack_require__(217);
  28728. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  28729. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  28730. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  28731. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  28732. var SudoPrompt = function (_React$Component) {
  28733. _inherits(SudoPrompt, _React$Component);
  28734. function SudoPrompt(props) {
  28735. _classCallCheck(this, SudoPrompt);
  28736. var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(SudoPrompt).call(this, props));
  28737. _this.onSuccess = null;
  28738. _this.state = {
  28739. show: false,
  28740. pswd: ''
  28741. };
  28742. return _this;
  28743. }
  28744. _createClass(SudoPrompt, [{
  28745. key: 'componentDidMount',
  28746. value: function componentDidMount() {
  28747. var _this2 = this;
  28748. SH_event.on('sudo_prompt', function (success) {
  28749. _this2.setState({ show: true });
  28750. _this2.onSuccess = success;
  28751. setTimeout(function () {
  28752. var el = _this2.refs.body;
  28753. el && el.querySelector('input').focus();
  28754. }, 100);
  28755. });
  28756. }
  28757. }, {
  28758. key: 'onOK',
  28759. value: function onOK() {
  28760. var pswd = this.refs.pswd.value;
  28761. if (!pswd) return;
  28762. this.setState({
  28763. show: false,
  28764. pswd: pswd
  28765. });
  28766. SH_event.emit('sudo_pswd', pswd);
  28767. if (typeof this.onSuccess === 'function') {
  28768. this.onSuccess(pswd);
  28769. }
  28770. this.onSuccess = null;
  28771. }
  28772. }, {
  28773. key: 'onCancel',
  28774. value: function onCancel() {
  28775. this.setState({
  28776. show: false
  28777. });
  28778. this.onSuccess = null;
  28779. }
  28780. }, {
  28781. key: 'body',
  28782. value: function body() {
  28783. var _this3 = this;
  28784. return _react2.default.createElement(
  28785. 'div',
  28786. { ref: 'body' },
  28787. _react2.default.createElement(
  28788. 'div',
  28789. { className: 'ln' },
  28790. _react2.default.createElement(
  28791. 'div',
  28792. { className: 'title' },
  28793. SH_Agent.lang.sudo_pswd
  28794. ),
  28795. _react2.default.createElement(
  28796. 'div',
  28797. { className: 'cnt' },
  28798. _react2.default.createElement('input', {
  28799. type: 'password',
  28800. ref: 'pswd',
  28801. onKeyDown: function onKeyDown(e) {
  28802. return e.keyCode === 13 && _this3.onOK() || e.keyCode === 27 && _this3.onCancel();
  28803. }
  28804. })
  28805. )
  28806. )
  28807. );
  28808. }
  28809. }, {
  28810. key: 'render',
  28811. value: function render() {
  28812. var _this4 = this;
  28813. return _react2.default.createElement(_frame2.default, {
  28814. show: this.state.show,
  28815. head: SH_Agent.lang.input_sudo_pswd,
  28816. body: this.body(),
  28817. onOK: function onOK() {
  28818. return _this4.onOK();
  28819. },
  28820. onCancel: function onCancel() {
  28821. return _this4.onCancel();
  28822. }
  28823. });
  28824. }
  28825. }]);
  28826. return SudoPrompt;
  28827. }(_react2.default.Component);
  28828. exports.default = SudoPrompt;
  28829. /***/ },
  28830. /* 214 */
  28831. /***/ function(module, exports, __webpack_require__) {
  28832. /**
  28833. * @author oldj
  28834. * @blog http://oldj.net
  28835. */
  28836. 'use strict';
  28837. Object.defineProperty(exports, "__esModule", {
  28838. value: true
  28839. });
  28840. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  28841. var _react = __webpack_require__(3);
  28842. var _react2 = _interopRequireDefault(_react);
  28843. __webpack_require__(215);
  28844. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  28845. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  28846. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  28847. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  28848. var Frame = function (_React$Component) {
  28849. _inherits(Frame, _React$Component);
  28850. function Frame(props) {
  28851. _classCallCheck(this, Frame);
  28852. return _possibleConstructorReturn(this, Object.getPrototypeOf(Frame).call(this, props));
  28853. }
  28854. _createClass(Frame, [{
  28855. key: 'componentDidMount',
  28856. value: function componentDidMount() {}
  28857. }, {
  28858. key: 'onOK',
  28859. value: function onOK() {
  28860. this.props.onOK();
  28861. }
  28862. }, {
  28863. key: 'onCancel',
  28864. value: function onCancel() {
  28865. this.props.onCancel();
  28866. }
  28867. }, {
  28868. key: 'renderFootButtons',
  28869. value: function renderFootButtons() {
  28870. var html = [];
  28871. html.push(_react2.default.createElement(
  28872. 'div',
  28873. {
  28874. className: 'button btn-cancel',
  28875. key: 'btn-cancel',
  28876. onClick: this.onCancel.bind(this)
  28877. },
  28878. SH_Agent.lang.cancel
  28879. ));
  28880. html.push(_react2.default.createElement(
  28881. 'div',
  28882. {
  28883. className: 'button btn-ok btn-default',
  28884. key: 'btn-ok',
  28885. onClick: this.onOK.bind(this)
  28886. },
  28887. SH_Agent.lang.ok
  28888. ));
  28889. return html;
  28890. }
  28891. }, {
  28892. key: 'render',
  28893. value: function render() {
  28894. if (!this.props.show) {
  28895. return null;
  28896. }
  28897. return _react2.default.createElement(
  28898. 'div',
  28899. { className: 'frame', ref: 'frame' },
  28900. _react2.default.createElement('div', { className: 'overlay' }),
  28901. _react2.default.createElement(
  28902. 'div',
  28903. { className: 'prompt' },
  28904. _react2.default.createElement(
  28905. 'div',
  28906. { className: 'head' },
  28907. this.props.head
  28908. ),
  28909. _react2.default.createElement(
  28910. 'div',
  28911. { className: 'body' },
  28912. this.props.body
  28913. ),
  28914. _react2.default.createElement(
  28915. 'div',
  28916. { className: 'foot' },
  28917. this.renderFootButtons()
  28918. )
  28919. )
  28920. );
  28921. }
  28922. }]);
  28923. return Frame;
  28924. }(_react2.default.Component);
  28925. exports.default = Frame;
  28926. /***/ },
  28927. /* 215 */
  28928. /***/ function(module, exports, __webpack_require__) {
  28929. // style-loader: Adds some css to the DOM by adding a <style> tag
  28930. // load the styles
  28931. var content = __webpack_require__(216);
  28932. if(typeof content === 'string') content = [[module.id, content, '']];
  28933. // add the styles to the DOM
  28934. var update = __webpack_require__(181)(content, {});
  28935. if(content.locals) module.exports = content.locals;
  28936. // Hot Module Replacement
  28937. if(false) {
  28938. // When the styles change, update the <style> tags
  28939. if(!content.locals) {
  28940. module.hot.accept("!!./../../../node_modules/css-loader/index.js!./../../../node_modules/less-loader/index.js!./frame.less", function() {
  28941. var newContent = require("!!./../../../node_modules/css-loader/index.js!./../../../node_modules/less-loader/index.js!./frame.less");
  28942. if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
  28943. update(newContent);
  28944. });
  28945. }
  28946. // When the module is disposed, remove the <style> tags
  28947. module.hot.dispose(function() { update(); });
  28948. }
  28949. /***/ },
  28950. /* 216 */
  28951. /***/ function(module, exports, __webpack_require__) {
  28952. exports = module.exports = __webpack_require__(180)();
  28953. // imports
  28954. // module
  28955. exports.push([module.id, ".frame {\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n}\n.frame .overlay {\n position: absolute;\n z-index: -1;\n width: 100%;\n height: 100%;\n background: #000;\n opacity: 0.5;\n}\n.frame .prompt {\n margin: 60px auto;\n min-width: 300px;\n max-width: 600px;\n background: #fff;\n box-shadow: 0 0 4px 4px rgba(0, 0, 0, 0.1);\n}\n.frame .prompt .head {\n padding: 20px;\n font-size: 16px;\n background: #f5f5f5;\n}\n.frame .prompt .body {\n padding: 20px 20px;\n}\n.frame .prompt .body .ln {\n line-height: 30px;\n padding: 2px 0;\n}\n.frame .prompt .body .ln .title {\n float: left;\n width: 100px;\n}\n.frame .prompt .body .ln .cnt input[type=text] {\n width: 240px;\n outline: none;\n padding: 6px 10px;\n}\n.frame .prompt .body input {\n padding: 6px 4px;\n}\n.frame .prompt .body input[type=password] {\n letter-spacing: 8px;\n width: 240px;\n outline: none;\n padding: 6px 10px;\n}\n.frame .prompt .foot {\n padding: 20px;\n background: #f5f5f5;\n text-align: right;\n}\n.frame .prompt .foot .button {\n display: inline-block;\n background: #ccc;\n padding: 8px 20px;\n margin-left: 1em;\n cursor: pointer;\n}\n.frame .prompt .foot .button:hover {\n background: #ddd;\n}\n.frame .prompt .foot .button.btn-default {\n background: #05a;\n color: #fff;\n}\n.frame .prompt .foot .button.btn-default:hover {\n background: #0077ee;\n}\n", ""]);
  28956. // exports
  28957. /***/ },
  28958. /* 217 */
  28959. /***/ function(module, exports, __webpack_require__) {
  28960. // style-loader: Adds some css to the DOM by adding a <style> tag
  28961. // load the styles
  28962. var content = __webpack_require__(218);
  28963. if(typeof content === 'string') content = [[module.id, content, '']];
  28964. // add the styles to the DOM
  28965. var update = __webpack_require__(181)(content, {});
  28966. if(content.locals) module.exports = content.locals;
  28967. // Hot Module Replacement
  28968. if(false) {
  28969. // When the styles change, update the <style> tags
  28970. if(!content.locals) {
  28971. module.hot.accept("!!./../../../node_modules/css-loader/index.js!./../../../node_modules/less-loader/index.js!./sudo.less", function() {
  28972. var newContent = require("!!./../../../node_modules/css-loader/index.js!./../../../node_modules/less-loader/index.js!./sudo.less");
  28973. if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
  28974. update(newContent);
  28975. });
  28976. }
  28977. // When the module is disposed, remove the <style> tags
  28978. module.hot.dispose(function() { update(); });
  28979. }
  28980. /***/ },
  28981. /* 218 */
  28982. /***/ function(module, exports, __webpack_require__) {
  28983. exports = module.exports = __webpack_require__(180)();
  28984. // imports
  28985. // module
  28986. exports.push([module.id, ".frame {\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n}\n.frame .overlay {\n position: absolute;\n z-index: -1;\n width: 100%;\n height: 100%;\n background: #000;\n opacity: 0.5;\n}\n.frame .prompt {\n margin: 60px auto;\n min-width: 300px;\n max-width: 600px;\n background: #fff;\n box-shadow: 0 0 4px 4px rgba(0, 0, 0, 0.1);\n}\n.frame .prompt .head {\n padding: 20px;\n font-size: 16px;\n background: #f5f5f5;\n}\n.frame .prompt .body {\n padding: 20px 20px;\n}\n.frame .prompt .body .ln {\n line-height: 30px;\n padding: 2px 0;\n}\n.frame .prompt .body .ln .title {\n float: left;\n width: 100px;\n}\n.frame .prompt .body .ln .cnt input[type=text] {\n width: 240px;\n outline: none;\n padding: 6px 10px;\n}\n.frame .prompt .body input {\n padding: 6px 4px;\n}\n.frame .prompt .body input[type=password] {\n letter-spacing: 8px;\n width: 240px;\n outline: none;\n padding: 6px 10px;\n}\n.frame .prompt .foot {\n padding: 20px;\n background: #f5f5f5;\n text-align: right;\n}\n.frame .prompt .foot .button {\n display: inline-block;\n background: #ccc;\n padding: 8px 20px;\n margin-left: 1em;\n cursor: pointer;\n}\n.frame .prompt .foot .button:hover {\n background: #ddd;\n}\n.frame .prompt .foot .button.btn-default {\n background: #05a;\n color: #fff;\n}\n.frame .prompt .foot .button.btn-default:hover {\n background: #0077ee;\n}\n.frame .prompt {\n width: 480px;\n}\n", ""]);
  28987. // exports
  28988. /***/ },
  28989. /* 219 */
  28990. /***/ function(module, exports, __webpack_require__) {
  28991. /**
  28992. * @author oldj
  28993. * @blog http://oldj.net
  28994. */
  28995. 'use strict';
  28996. Object.defineProperty(exports, "__esModule", {
  28997. value: true
  28998. });
  28999. var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
  29000. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  29001. var _react = __webpack_require__(3);
  29002. var _react2 = _interopRequireDefault(_react);
  29003. var _frame = __webpack_require__(214);
  29004. var _frame2 = _interopRequireDefault(_frame);
  29005. __webpack_require__(220);
  29006. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  29007. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  29008. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  29009. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  29010. var EditPrompt = function (_React$Component) {
  29011. _inherits(EditPrompt, _React$Component);
  29012. function EditPrompt(props) {
  29013. _classCallCheck(this, EditPrompt);
  29014. var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(EditPrompt).call(this, props));
  29015. _this.state = {
  29016. show: false,
  29017. add: true,
  29018. where: 'local',
  29019. title: '',
  29020. url: '',
  29021. last_refresh: null,
  29022. refresh_interval: 0
  29023. };
  29024. _this.current_host = null;
  29025. return _this;
  29026. }
  29027. _createClass(EditPrompt, [{
  29028. key: 'tryToFocus',
  29029. value: function tryToFocus() {
  29030. var el = this.refs.body && this.refs.body.querySelector('input[type=text]');
  29031. el && el.focus();
  29032. }
  29033. }, {
  29034. key: 'clear',
  29035. value: function clear() {
  29036. this.setState({
  29037. where: 'local',
  29038. title: '',
  29039. url: '',
  29040. last_refresh: null,
  29041. refresh_interval: 0
  29042. });
  29043. }
  29044. }, {
  29045. key: 'componentDidMount',
  29046. value: function componentDidMount() {
  29047. var _this2 = this;
  29048. SH_event.on('add_host', function () {
  29049. _this2.setState({
  29050. show: true,
  29051. add: true
  29052. });
  29053. setTimeout(function () {
  29054. _this2.tryToFocus();
  29055. }, 100);
  29056. });
  29057. SH_event.on('edit_host', function (host) {
  29058. _this2.current_host = host;
  29059. _this2.setState({
  29060. show: true,
  29061. add: false,
  29062. where: host.where || 'local',
  29063. title: host.title || '',
  29064. url: host.url || '',
  29065. last_refresh: host.last_refresh || null,
  29066. refresh_interval: host.refresh_interval || 0
  29067. });
  29068. setTimeout(function () {
  29069. _this2.tryToFocus();
  29070. }, 100);
  29071. });
  29072. }
  29073. }, {
  29074. key: 'onOK',
  29075. value: function onOK() {
  29076. this.setState({
  29077. title: (this.state.title || '').replace(/^\s+|\s+$/g, ''),
  29078. url: (this.state.url || '').replace(/^\s+|\s+$/g, '')
  29079. });
  29080. if (this.state.title === '') {
  29081. this.refs.title.focus();
  29082. return false;
  29083. }
  29084. if (this.state.where === 'remote' && this.state.url === '') {
  29085. this.refs.url.focus();
  29086. return false;
  29087. }
  29088. var data = Object.assign({
  29089. content: '# ' + this.state.title
  29090. }, this.current_host, this.state);
  29091. delete data['add'];
  29092. SH_event.emit('host_' + (this.state.add ? 'add' : 'edit') + 'ed', data, this.current_host);
  29093. this.setState({
  29094. show: false
  29095. });
  29096. this.clear();
  29097. }
  29098. }, {
  29099. key: 'onCancel',
  29100. value: function onCancel() {
  29101. this.setState({
  29102. show: false
  29103. });
  29104. this.clear();
  29105. }
  29106. }, {
  29107. key: 'confirmDel',
  29108. value: function confirmDel() {
  29109. if (!confirm(SH_Agent.lang.confirm_del)) return;
  29110. SH_event.emit('del_host', this.current_host);
  29111. this.setState({
  29112. show: false
  29113. });
  29114. this.clear();
  29115. }
  29116. }, {
  29117. key: 'getEditOperations',
  29118. value: function getEditOperations() {
  29119. if (this.state.add) return null;
  29120. return _react2.default.createElement(
  29121. 'div',
  29122. null,
  29123. _react2.default.createElement(
  29124. 'div',
  29125. { className: 'ln' },
  29126. _react2.default.createElement(
  29127. 'a',
  29128. { href: '#', className: 'del',
  29129. onClick: this.confirmDel.bind(this)
  29130. },
  29131. _react2.default.createElement('i', { className: 'iconfont icon-delete' }),
  29132. _react2.default.createElement(
  29133. 'span',
  29134. null,
  29135. SH_Agent.lang.del_host
  29136. )
  29137. )
  29138. )
  29139. );
  29140. }
  29141. }, {
  29142. key: 'renderRemoteInputs',
  29143. value: function renderRemoteInputs() {
  29144. var _this3 = this;
  29145. if (this.state.where !== 'remote') return null;
  29146. return _react2.default.createElement(
  29147. 'div',
  29148. { className: 'remote-ipts' },
  29149. _react2.default.createElement(
  29150. 'div',
  29151. { className: 'ln' },
  29152. _react2.default.createElement(
  29153. 'div',
  29154. { className: 'title' },
  29155. SH_Agent.lang.url
  29156. ),
  29157. _react2.default.createElement(
  29158. 'div',
  29159. { className: 'cnt' },
  29160. _react2.default.createElement('input', {
  29161. type: 'text',
  29162. ref: 'url',
  29163. value: this.state.url,
  29164. placeholder: 'http://',
  29165. onChange: function onChange(e) {
  29166. return _this3.setState({ url: e.target.value });
  29167. },
  29168. onKeyDown: function onKeyDown(e) {
  29169. return e.keyCode === 13 && _this3.onOK() || e.keyCode === 27 && _this3.onCancel();
  29170. }
  29171. })
  29172. )
  29173. ),
  29174. _react2.default.createElement(
  29175. 'div',
  29176. { className: 'ln' },
  29177. _react2.default.createElement(
  29178. 'div',
  29179. { className: 'title' },
  29180. SH_Agent.lang.auto_refresh
  29181. ),
  29182. _react2.default.createElement(
  29183. 'div',
  29184. { className: 'cnt' },
  29185. _react2.default.createElement(
  29186. 'select',
  29187. {
  29188. value: this.state.refresh_interval,
  29189. onChange: function onChange(e) {
  29190. return _this3.setState({ refresh_interval: parseInt(e.target.value) || 0 });
  29191. }
  29192. },
  29193. EditPrompt.getRefreshOptions()
  29194. ),
  29195. _react2.default.createElement(
  29196. 'span',
  29197. { className: 'last-refresh' },
  29198. SH_Agent.lang.last_refresh,
  29199. this.state.last_refresh || 'N/A'
  29200. )
  29201. )
  29202. )
  29203. );
  29204. }
  29205. }, {
  29206. key: 'body',
  29207. value: function body() {
  29208. var _this4 = this;
  29209. return _react2.default.createElement(
  29210. 'div',
  29211. { ref: 'body' },
  29212. _react2.default.createElement(
  29213. 'div',
  29214. { className: 'ln' },
  29215. _react2.default.createElement('input', { id: 'ipt-local', type: 'radio', name: 'where', value: 'local',
  29216. checked: this.state.where === 'local',
  29217. onChange: function onChange(e) {
  29218. return _this4.setState({ where: e.target.value });
  29219. }
  29220. }),
  29221. _react2.default.createElement(
  29222. 'label',
  29223. { htmlFor: 'ipt-local' },
  29224. SH_Agent.lang.where_local
  29225. ),
  29226. _react2.default.createElement('input', { id: 'ipt-remote', type: 'radio', name: 'where', value: 'remote',
  29227. checked: this.state.where === 'remote',
  29228. onChange: function onChange(e) {
  29229. return _this4.setState({ where: e.target.value });
  29230. }
  29231. }),
  29232. _react2.default.createElement(
  29233. 'label',
  29234. { htmlFor: 'ipt-remote' },
  29235. SH_Agent.lang.where_remote
  29236. )
  29237. ),
  29238. _react2.default.createElement(
  29239. 'div',
  29240. { className: 'ln' },
  29241. _react2.default.createElement(
  29242. 'div',
  29243. { className: 'title' },
  29244. SH_Agent.lang.host_title
  29245. ),
  29246. _react2.default.createElement(
  29247. 'div',
  29248. { className: 'cnt' },
  29249. _react2.default.createElement('input', {
  29250. type: 'text',
  29251. ref: 'title',
  29252. name: 'text',
  29253. value: this.state.title,
  29254. onChange: function onChange(e) {
  29255. return _this4.setState({ title: e.target.value });
  29256. },
  29257. onKeyDown: function onKeyDown(e) {
  29258. return e.keyCode === 13 && _this4.onOK() || e.keyCode === 27 && _this4.onCancel();
  29259. }
  29260. })
  29261. )
  29262. ),
  29263. this.renderRemoteInputs(),
  29264. this.getEditOperations()
  29265. );
  29266. }
  29267. }, {
  29268. key: 'render',
  29269. value: function render() {
  29270. var _this5 = this;
  29271. return _react2.default.createElement(_frame2.default, {
  29272. show: this.state.show,
  29273. head: SH_Agent.lang[this.state.add ? 'add_host' : 'edit_host'],
  29274. body: this.body(),
  29275. onOK: function onOK() {
  29276. return _this5.onOK();
  29277. },
  29278. onCancel: function onCancel() {
  29279. return _this5.onCancel();
  29280. }
  29281. });
  29282. }
  29283. }], [{
  29284. key: 'getRefreshOptions',
  29285. value: function getRefreshOptions() {
  29286. var k = [[0, '' + SH_Agent.lang.never], [1, '1 ' + SH_Agent.lang.hour], [24, '24 ' + SH_Agent.lang.hours], [168, '7 ' + SH_Agent.lang.days]];
  29287. return k.map(function (_ref, idx) {
  29288. var _ref2 = _slicedToArray(_ref, 2);
  29289. var v = _ref2[0];
  29290. var n = _ref2[1];
  29291. return _react2.default.createElement(
  29292. 'option',
  29293. { value: v, key: idx },
  29294. n
  29295. );
  29296. });
  29297. }
  29298. }]);
  29299. return EditPrompt;
  29300. }(_react2.default.Component);
  29301. exports.default = EditPrompt;
  29302. /***/ },
  29303. /* 220 */
  29304. /***/ function(module, exports, __webpack_require__) {
  29305. // style-loader: Adds some css to the DOM by adding a <style> tag
  29306. // load the styles
  29307. var content = __webpack_require__(221);
  29308. if(typeof content === 'string') content = [[module.id, content, '']];
  29309. // add the styles to the DOM
  29310. var update = __webpack_require__(181)(content, {});
  29311. if(content.locals) module.exports = content.locals;
  29312. // Hot Module Replacement
  29313. if(false) {
  29314. // When the styles change, update the <style> tags
  29315. if(!content.locals) {
  29316. module.hot.accept("!!./../../../node_modules/css-loader/index.js!./../../../node_modules/less-loader/index.js!./edit.less", function() {
  29317. var newContent = require("!!./../../../node_modules/css-loader/index.js!./../../../node_modules/less-loader/index.js!./edit.less");
  29318. if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
  29319. update(newContent);
  29320. });
  29321. }
  29322. // When the module is disposed, remove the <style> tags
  29323. module.hot.dispose(function() { update(); });
  29324. }
  29325. /***/ },
  29326. /* 221 */
  29327. /***/ function(module, exports, __webpack_require__) {
  29328. exports = module.exports = __webpack_require__(180)();
  29329. // imports
  29330. // module
  29331. exports.push([module.id, ".frame label {\n padding: 0 4em 0 0.5em;\n}\n.frame .last-refresh {\n padding-left: 1em;\n color: #999;\n}\n.frame a.del {\n color: red;\n}\n.frame a.del span {\n padding-left: 0.5em;\n}\n", ""]);
  29332. // exports
  29333. /***/ },
  29334. /* 222 */
  29335. /***/ function(module, exports, __webpack_require__) {
  29336. // style-loader: Adds some css to the DOM by adding a <style> tag
  29337. // load the styles
  29338. var content = __webpack_require__(223);
  29339. if(typeof content === 'string') content = [[module.id, content, '']];
  29340. // add the styles to the DOM
  29341. var update = __webpack_require__(181)(content, {});
  29342. if(content.locals) module.exports = content.locals;
  29343. // Hot Module Replacement
  29344. if(false) {
  29345. // When the styles change, update the <style> tags
  29346. if(!content.locals) {
  29347. module.hot.accept("!!./../../node_modules/css-loader/index.js!./../../node_modules/less-loader/index.js!./app.less", function() {
  29348. var newContent = require("!!./../../node_modules/css-loader/index.js!./../../node_modules/less-loader/index.js!./app.less");
  29349. if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
  29350. update(newContent);
  29351. });
  29352. }
  29353. // When the module is disposed, remove the <style> tags
  29354. module.hot.dispose(function() { update(); });
  29355. }
  29356. /***/ },
  29357. /* 223 */
  29358. /***/ function(module, exports, __webpack_require__) {
  29359. exports = module.exports = __webpack_require__(180)();
  29360. // imports
  29361. // module
  29362. exports.push([module.id, "html,\nbody {\n margin: 0;\n padding: 0;\n height: 100%;\n font-size: 12px;\n font-family: Arial, Helvetica, sans-serif;\n color: #212121;\n line-height: 20px;\n background: #fff;\n}\na {\n text-decoration: none;\n}\n#app {\n height: 100%;\n}\n", ""]);
  29363. // exports
  29364. /***/ }
  29365. /******/ ]);
  29366. //# sourceMappingURL=bundle.js.map